@learncard/core 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core.cjs.development.js +82 -48
- package/dist/core.cjs.development.js.map +3 -3
- package/dist/core.cjs.production.min.js +109 -109
- package/dist/core.cjs.production.min.js.map +3 -3
- package/dist/core.d.ts +22 -7
- package/dist/core.esm.js +82 -48
- package/dist/core.esm.js.map +3 -3
- package/package.json +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var o5=Object.create;var zs=Object.defineProperty,s5=Object.defineProperties,a5=Object.getOwnPropertyDescriptor,f5=Object.getOwnPropertyDescriptors,c5=Object.getOwnPropertyNames,kc=Object.getOwnPropertySymbols,Dm=Object.getPrototypeOf,bd=Object.prototype.hasOwnProperty,Om=Object.prototype.propertyIsEnumerable,u5=Reflect.get;var gd=Math.pow,Cm=(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={}))bd.call(e,t)&&Cm(r,t,e[t]);if(kc)for(var t of kc(e))Om.call(e,t)&&Cm(r,t,e[t]);return r},Me=(r,e)=>s5(r,f5(e)),o=(r,e)=>zs(r,"name",{value:e,configurable:!0});var Im=(r,e)=>{var t={};for(var n in r)bd.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&&Om.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})},Pm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c5(e))!bd.call(r,i)&&i!==t&&zs(r,i,{get:()=>e[i],enumerable:!(n=a5(e,i))||n.enumerable});return r};var at=(r,e,t)=>(t=r!=null?o5(Dm(r)):{},Pm(e||!r||!r.__esModule?zs(t,"default",{value:r,enumerable:!0}):t,r)),tf=r=>Pm(zs({},"__esModule",{value:!0}),r);var vd=(r,e,t)=>u5(Dm(r),t,e);var Z=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{f(t.next(u))}catch(p){i(p)}},a=u=>{try{f(t.throw(u))}catch(p){i(p)}},f=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);f((t=t.apply(r,e)).next())});var Gm={};St(Gm,{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 wd=gt(()=>{o(vn,"concat")});function F5(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),p=Math.log(f)/Math.log(256),m=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 z=(U-O)*m+1>>>0,H=new Uint8Array(z);O!==U;){for(var X=T[O],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,O++}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,O=0;T[C]===u;)$++,C++;for(var U=(T.length-C)*p+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<O)&&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");O=X,C++}if(T[C]!==" "){for(var L=U-O;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 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 $5,q5,Ym,Jm=gt(()=>{o(F5,"base");$5=F5,q5=$5,Ym=q5});var sf={};St(sf,{coerce:()=>en,empty:()=>Xm,equals:()=>_d,fromHex:()=>j5,fromString:()=>Ed,isBinary:()=>z5,toHex:()=>H5,toString:()=>Sd});var Xm,H5,j5,_d,en,z5,Ed,Sd,Vi=gt(()=>{Xm=new Uint8Array(0),H5=o(r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),"toHex"),j5=o(r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):Xm},"fromHex"),_d=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"),z5=o(r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),"isBinary"),Ed=o(r=>new TextEncoder().encode(r),"fromString"),Sd=o(r=>new TextDecoder().decode(r),"toString")});var Nc,Rc,Lc,Zm,Bc,Vs,Wi,K5,V5,Dt,yn=gt(()=>{Jm();Vi();Nc=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(Nc,"Encoder");Rc=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 Zm(this,e)}};o(Rc,"Decoder");Lc=class{constructor(e){this.decoders=e}or(e){return Zm(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(Lc,"ComposedDecoder");Zm=o((r,e)=>new Lc(ie(ie({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e})),"or"),Bc=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Nc(e,t,n),this.decoder=new Rc(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Bc,"Codec");Vs=o(({name:r,prefix:e,encode:t,decode:n})=>new Bc(r,e,t,n),"from"),Wi=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Ym(t,e);return Vs({prefix:r,name:e,encode:n,decode:s=>en(i(s))})},"baseX"),K5=o((r,e,t,n)=>{let i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let s=r.length;for(;r[s-1]==="=";)--s;let a=new Uint8Array(s*t/8|0),f=0,u=0,p=0;for(let m=0;m<s;++m){let x=i[r[m]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<t|x,f+=t,f>=8&&(f-=8,a[p++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return a},"decode"),V5=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})=>Vs({prefix:e,name:r,encode(i){return V5(i,n,t)},decode(i){return K5(i,n,t,r)}}),"rfc4648")});var Ad={};St(Ad,{identity:()=>W5});var W5,Qm=gt(()=>{yn();Vi();W5=Vs({prefix:"\0",name:"identity",encode:r=>Sd(r),decode:r=>Ed(r)})});var Md={};St(Md,{base2:()=>G5});var G5,e1=gt(()=>{yn();G5=Dt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Td={};St(Td,{base8:()=>Y5});var Y5,t1=gt(()=>{yn();Y5=Dt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var kd={};St(kd,{base10:()=>J5});var J5,r1=gt(()=>{yn();J5=Wi({prefix:"9",name:"base10",alphabet:"0123456789"})});var Cd={};St(Cd,{base16:()=>X5,base16upper:()=>Z5});var X5,Z5,n1=gt(()=>{yn();X5=Dt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Z5=Dt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Dd={};St(Dd,{base32:()=>Ws,base32hex:()=>r8,base32hexpad:()=>i8,base32hexpadupper:()=>o8,base32hexupper:()=>n8,base32pad:()=>e8,base32padupper:()=>t8,base32upper:()=>Q5,base32z:()=>s8});var Ws,Q5,e8,t8,r8,n8,i8,o8,s8,Od=gt(()=>{yn();Ws=Dt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Q5=Dt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),e8=Dt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),t8=Dt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),r8=Dt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),n8=Dt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),i8=Dt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),o8=Dt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),s8=Dt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Id={};St(Id,{base36:()=>Fo,base36upper:()=>a8});var Fo,a8,Uc=gt(()=>{yn();Fo=Wi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),a8=Wi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Pd={};St(Pd,{base58btc:()=>zn,base58flickr:()=>f8});var zn,f8,Nd=gt(()=>{yn();zn=Wi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),f8=Wi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Rd={};St(Rd,{base64:()=>c8,base64pad:()=>u8,base64url:()=>i1,base64urlpad:()=>l8});var c8,u8,i1,l8,Ld=gt(()=>{yn();c8=Dt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),u8=Dt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),i1=Dt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),l8=Dt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Bd={};St(Bd,{base256emoji:()=>b8});function p8(r){return r.reduce((e,t)=>(e+=d8[t],e),"")}function m8(r){let e=[];for(let t of r){let n=h8[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var o1,d8,h8,b8,s1=gt(()=>{yn();o1=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}"),d8=o1.reduce((r,e,t)=>(r[t]=e,r),[]),h8=o1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(p8,"encode");o(m8,"decode");b8=Vs({prefix:"\u{1F680}",name:"base256emoji",encode:p8,decode:m8})});function c1(r,e,t){e=e||[],t=t||0;for(var n=t;r>=x8;)e[t++]=r&255|a1,r/=128;for(;r&y8;)e[t++]=r&255|a1,r>>>=7;return e[t]=r|0,c1.bytes=t-n+1,e}function Ud(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw Ud.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&f1)<<i:(a&f1)*Math.pow(2,i),i+=7}while(a>=_8);return Ud.bytes=s-n,t}var g8,a1,v8,y8,x8,w8,_8,f1,E8,S8,A8,M8,T8,k8,C8,D8,O8,I8,P8,N8,af,u1=gt(()=>{g8=c1,a1=128,v8=127,y8=~v8,x8=Math.pow(2,31);o(c1,"encode");w8=Ud,_8=128,f1=127;o(Ud,"read");E8=Math.pow(2,7),S8=Math.pow(2,14),A8=Math.pow(2,21),M8=Math.pow(2,28),T8=Math.pow(2,35),k8=Math.pow(2,42),C8=Math.pow(2,49),D8=Math.pow(2,56),O8=Math.pow(2,63),I8=o(function(r){return r<E8?1:r<S8?2:r<A8?3:r<M8?4:r<T8?5:r<k8?6:r<C8?7:r<D8?8:r<O8?9:10},"length"),P8={encode:g8,decode:w8,encodingLength:I8},N8=P8,af=N8});var Ys={};St(Ys,{decode:()=>Gs,encodeTo:()=>$o,encodingLength:()=>qo});var Gs,$o,qo,Fc=gt(()=>{u1();Gs=o(r=>[af.decode(r),af.decode.bytes],"decode"),$o=o((r,e,t=0)=>(af.encode(r,e,t),e),"encodeTo"),qo=o(r=>af.encodingLength(r),"encodingLength")});var Ho={};St(Ho,{Digest:()=>Gi,create:()=>Kn,decode:()=>ff,equals:()=>Fd});var Kn,ff,Fd,Gi,jo=gt(()=>{Vi();Fc();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"),ff=o(r=>{let e=en(r),[t,n]=Gs(e),[i,s]=Gs(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"),Fd=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&_d(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 qc={};St(qc,{Hasher:()=>cf,from:()=>$c});var $c,cf,$d=gt(()=>{jo();$c=o(({name:r,code:e,encode:t})=>new cf(r,e,t),"from"),cf=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(cf,"Hasher")});var qd={};St(qd,{sha256:()=>zo,sha512:()=>R8});var l1,zo,R8,uf=gt(()=>{$d();l1=o(r=>e=>Z(void 0,null,function*(){return new Uint8Array(yield crypto.subtle.digest(r,e))}),"sha"),zo=$c({name:"sha2-256",code:18,encode:l1("SHA-256")}),R8=$c({name:"sha2-512",code:19,encode:l1("SHA-512")})});var Hd={};St(Hd,{identity:()=>Hc});var d1,L8,h1,B8,Hc,jd=gt(()=>{Vi();jo();d1=0,L8="identity",h1=en,B8=o(r=>Kn(d1,h1(r)),"digest"),Hc={code:d1,name:L8,encode:h1,digest:B8}});var zd={};St(zd,{code:()=>F8,decode:()=>q8,encode:()=>$8,name:()=>U8});var U8,F8,$8,q8,p1=gt(()=>{Vi();U8="raw",F8=85,$8=o(r=>en(r),"encode"),q8=o(r=>en(r),"decode")});var Kd={};St(Kd,{code:()=>K8,decode:()=>W8,encode:()=>V8,name:()=>z8});var H8,j8,z8,K8,V8,W8,m1=gt(()=>{H8=new TextEncoder,j8=new TextDecoder,z8="json",K8=512,V8=o(r=>H8.encode(JSON.stringify(r)),"encode"),W8=o(r=>JSON.parse(j8.decode(r)),"decode")});var Pe,G8,Y8,J8,lf,X8,b1,g1,jc,zc,Z8,Q8,e_,Vn=gt(()=>{Fc();jo();Nd();Od();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:zc,byteLength:zc,code:jc,version:jc,multihash:jc,bytes:jc,_baseCache:zc,asCID:zc})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==lf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==X8)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&&Fd(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return Y8(t,i,e||zn.encoder);default:return J8(t,i,e||Ws.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 Q8(/^0\.0/,e_),!!(e&&(e[g1]||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||b1(t,n,i.bytes))}else if(e!=null&&e[g1]===!0){let{version:t,multihash:n,code:i}=e,s=ff(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!==lf)throw new Error(`Version 0 CID must use dag-pb (code: ${lf}) block encoding`);return new Pe(e,t,n,n.bytes)}case 1:{let i=b1(e,t,n.bytes);return new Pe(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Pe.create(0,lf,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]=Gs(e.subarray(t));return t+=k,x},"next"),i=n(),s=lf;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(),p=t+u,m=p-a;return{version:i,codec:s,multihashCode:f,digestSize:u,multihashSize:m,size:p}}static parse(e,t){let[n,i]=G8(e,t),s=Pe.decode(i);return s._baseCache.set(n,e),s}};o(Pe,"CID");G8=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 Ws.prefix:{let t=e||Ws;return[Ws.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"),Y8=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"),J8=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"),lf=112,X8=18,b1=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"),g1=Symbol.for("@ipld/js-cid/CID"),jc={writable:!1,configurable:!1,enumerable:!0},zc={writable:!1,enumerable:!1,configurable:!1},Z8="0.0.0-dev",Q8=o((r,e)=>{if(r.test(Z8))console.warn(e);else throw new Error(e)},"deprecate"),e_=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
1
|
+
"use strict";var s5=Object.create;var zs=Object.defineProperty,a5=Object.defineProperties,f5=Object.getOwnPropertyDescriptor,c5=Object.getOwnPropertyDescriptors,u5=Object.getOwnPropertyNames,kc=Object.getOwnPropertySymbols,Dm=Object.getPrototypeOf,bd=Object.prototype.hasOwnProperty,Im=Object.prototype.propertyIsEnumerable,l5=Reflect.get;var gd=Math.pow,Cm=(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={}))bd.call(e,t)&&Cm(r,t,e[t]);if(kc)for(var t of kc(e))Im.call(e,t)&&Cm(r,t,e[t]);return r},Ae=(r,e)=>a5(r,c5(e)),o=(r,e)=>zs(r,"name",{value:e,configurable:!0});var Om=(r,e)=>{var t={};for(var n in r)bd.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&&Im.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})},Pm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u5(e))!bd.call(r,i)&&i!==t&&zs(r,i,{get:()=>e[i],enumerable:!(n=f5(e,i))||n.enumerable});return r};var at=(r,e,t)=>(t=r!=null?s5(Dm(r)):{},Pm(e||!r||!r.__esModule?zs(t,"default",{value:r,enumerable:!0}):t,r)),tf=r=>Pm(zs({},"__esModule",{value:!0}),r);var vd=(r,e,t)=>l5(Dm(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 Gm={};St(Gm,{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 wd=gt(()=>{o(vn,"concat")});function $5(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 q5,H5,Ym,Jm=gt(()=>{o($5,"base");q5=$5,H5=q5,Ym=H5});var sf={};St(sf,{coerce:()=>en,empty:()=>Xm,equals:()=>_d,fromHex:()=>z5,fromString:()=>Ed,isBinary:()=>K5,toHex:()=>j5,toString:()=>Sd});var Xm,j5,z5,_d,en,K5,Ed,Sd,Vi=gt(()=>{Xm=new Uint8Array(0),j5=o(r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),"toHex"),z5=o(r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):Xm},"fromHex"),_d=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"),K5=o(r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),"isBinary"),Ed=o(r=>new TextEncoder().encode(r),"fromString"),Sd=o(r=>new TextDecoder().decode(r),"toString")});var Nc,Rc,Lc,Zm,Bc,Vs,Wi,V5,W5,Dt,yn=gt(()=>{Jm();Vi();Nc=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(Nc,"Encoder");Rc=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 Zm(this,e)}};o(Rc,"Decoder");Lc=class{constructor(e){this.decoders=e}or(e){return Zm(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(Lc,"ComposedDecoder");Zm=o((r,e)=>new Lc(ie(ie({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e})),"or"),Bc=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Nc(e,t,n),this.decoder=new Rc(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Bc,"Codec");Vs=o(({name:r,prefix:e,encode:t,decode:n})=>new Bc(r,e,t,n),"from"),Wi=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Ym(t,e);return Vs({prefix:r,name:e,encode:n,decode:s=>en(i(s))})},"baseX"),V5=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"),W5=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})=>Vs({prefix:e,name:r,encode(i){return W5(i,n,t)},decode(i){return V5(i,n,t,r)}}),"rfc4648")});var Md={};St(Md,{identity:()=>G5});var G5,Qm=gt(()=>{yn();Vi();G5=Vs({prefix:"\0",name:"identity",encode:r=>Sd(r),decode:r=>Ed(r)})});var Ad={};St(Ad,{base2:()=>Y5});var Y5,e1=gt(()=>{yn();Y5=Dt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Td={};St(Td,{base8:()=>J5});var J5,t1=gt(()=>{yn();J5=Dt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var kd={};St(kd,{base10:()=>X5});var X5,r1=gt(()=>{yn();X5=Wi({prefix:"9",name:"base10",alphabet:"0123456789"})});var Cd={};St(Cd,{base16:()=>Z5,base16upper:()=>Q5});var Z5,Q5,n1=gt(()=>{yn();Z5=Dt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Q5=Dt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Dd={};St(Dd,{base32:()=>Ws,base32hex:()=>n8,base32hexpad:()=>o8,base32hexpadupper:()=>s8,base32hexupper:()=>i8,base32pad:()=>t8,base32padupper:()=>r8,base32upper:()=>e8,base32z:()=>a8});var Ws,e8,t8,r8,n8,i8,o8,s8,a8,Id=gt(()=>{yn();Ws=Dt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),e8=Dt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),t8=Dt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),r8=Dt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),n8=Dt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),i8=Dt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),o8=Dt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),s8=Dt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),a8=Dt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Od={};St(Od,{base36:()=>Fo,base36upper:()=>f8});var Fo,f8,Uc=gt(()=>{yn();Fo=Wi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),f8=Wi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Pd={};St(Pd,{base58btc:()=>zn,base58flickr:()=>c8});var zn,c8,Nd=gt(()=>{yn();zn=Wi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),c8=Wi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Rd={};St(Rd,{base64:()=>u8,base64pad:()=>l8,base64url:()=>i1,base64urlpad:()=>d8});var u8,l8,i1,d8,Ld=gt(()=>{yn();u8=Dt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),l8=Dt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),i1=Dt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),d8=Dt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Bd={};St(Bd,{base256emoji:()=>g8});function m8(r){return r.reduce((e,t)=>(e+=h8[t],e),"")}function b8(r){let e=[];for(let t of r){let n=p8[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var o1,h8,p8,g8,s1=gt(()=>{yn();o1=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}"),h8=o1.reduce((r,e,t)=>(r[t]=e,r),[]),p8=o1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(m8,"encode");o(b8,"decode");g8=Vs({prefix:"\u{1F680}",name:"base256emoji",encode:m8,decode:b8})});function c1(r,e,t){e=e||[],t=t||0;for(var n=t;r>=w8;)e[t++]=r&255|a1,r/=128;for(;r&x8;)e[t++]=r&255|a1,r>>>=7;return e[t]=r|0,c1.bytes=t-n+1,e}function Ud(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw Ud.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&f1)<<i:(a&f1)*Math.pow(2,i),i+=7}while(a>=E8);return Ud.bytes=s-n,t}var v8,a1,y8,x8,w8,_8,E8,f1,S8,M8,A8,T8,k8,C8,D8,I8,O8,P8,N8,R8,af,u1=gt(()=>{v8=c1,a1=128,y8=127,x8=~y8,w8=Math.pow(2,31);o(c1,"encode");_8=Ud,E8=128,f1=127;o(Ud,"read");S8=Math.pow(2,7),M8=Math.pow(2,14),A8=Math.pow(2,21),T8=Math.pow(2,28),k8=Math.pow(2,35),C8=Math.pow(2,42),D8=Math.pow(2,49),I8=Math.pow(2,56),O8=Math.pow(2,63),P8=o(function(r){return r<S8?1:r<M8?2:r<A8?3:r<T8?4:r<k8?5:r<C8?6:r<D8?7:r<I8?8:r<O8?9:10},"length"),N8={encode:v8,decode:_8,encodingLength:P8},R8=N8,af=R8});var Ys={};St(Ys,{decode:()=>Gs,encodeTo:()=>$o,encodingLength:()=>qo});var Gs,$o,qo,Fc=gt(()=>{u1();Gs=o(r=>[af.decode(r),af.decode.bytes],"decode"),$o=o((r,e,t=0)=>(af.encode(r,e,t),e),"encodeTo"),qo=o(r=>af.encodingLength(r),"encodingLength")});var Ho={};St(Ho,{Digest:()=>Gi,create:()=>Kn,decode:()=>ff,equals:()=>Fd});var Kn,ff,Fd,Gi,jo=gt(()=>{Vi();Fc();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"),ff=o(r=>{let e=en(r),[t,n]=Gs(e),[i,s]=Gs(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"),Fd=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&_d(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 qc={};St(qc,{Hasher:()=>cf,from:()=>$c});var $c,cf,$d=gt(()=>{jo();$c=o(({name:r,code:e,encode:t})=>new cf(r,e,t),"from"),cf=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(cf,"Hasher")});var qd={};St(qd,{sha256:()=>zo,sha512:()=>L8});var l1,zo,L8,uf=gt(()=>{$d();l1=o(r=>e=>Z(void 0,null,function*(){return new Uint8Array(yield crypto.subtle.digest(r,e))}),"sha"),zo=$c({name:"sha2-256",code:18,encode:l1("SHA-256")}),L8=$c({name:"sha2-512",code:19,encode:l1("SHA-512")})});var Hd={};St(Hd,{identity:()=>Hc});var d1,B8,h1,U8,Hc,jd=gt(()=>{Vi();jo();d1=0,B8="identity",h1=en,U8=o(r=>Kn(d1,h1(r)),"digest"),Hc={code:d1,name:B8,encode:h1,digest:U8}});var zd={};St(zd,{code:()=>$8,decode:()=>H8,encode:()=>q8,name:()=>F8});var F8,$8,q8,H8,p1=gt(()=>{Vi();F8="raw",$8=85,q8=o(r=>en(r),"encode"),H8=o(r=>en(r),"decode")});var Kd={};St(Kd,{code:()=>V8,decode:()=>G8,encode:()=>W8,name:()=>K8});var j8,z8,K8,V8,W8,G8,m1=gt(()=>{j8=new TextEncoder,z8=new TextDecoder,K8="json",V8=512,W8=o(r=>j8.encode(JSON.stringify(r)),"encode"),G8=o(r=>JSON.parse(z8.decode(r)),"decode")});var Pe,Y8,J8,X8,lf,Z8,b1,g1,jc,zc,Q8,e_,t_,Vn=gt(()=>{Fc();jo();Nd();Id();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:zc,byteLength:zc,code:jc,version:jc,multihash:jc,bytes:jc,_baseCache:zc,asCID:zc})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==lf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Z8)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&&Fd(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return J8(t,i,e||zn.encoder);default:return X8(t,i,e||Ws.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 e_(/^0\.0/,t_),!!(e&&(e[g1]||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||b1(t,n,i.bytes))}else if(e!=null&&e[g1]===!0){let{version:t,multihash:n,code:i}=e,s=ff(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!==lf)throw new Error(`Version 0 CID must use dag-pb (code: ${lf}) block encoding`);return new Pe(e,t,n,n.bytes)}case 1:{let i=b1(e,t,n.bytes);return new Pe(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Pe.create(0,lf,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]=Gs(e.subarray(t));return t+=k,x},"next"),i=n(),s=lf;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]=Y8(e,t),s=Pe.decode(i);return s._baseCache.set(n,e),s}};o(Pe,"CID");Y8=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 Ws.prefix:{let t=e||Ws;return[Ws.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"),J8=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"),X8=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"),lf=112,Z8=18,b1=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"),g1=Symbol.for("@ipld/js-cid/CID"),jc={writable:!1,configurable:!1,enumerable:!0},zc={writable:!1,enumerable:!1,configurable:!1},Q8="0.0.0-dev",e_=o((r,e)=>{if(r.test(Q8))console.warn(e);else throw new Error(e)},"deprecate"),t_=`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 Vd=gt(()=>{Vn();Fc();Vi();$d();jo()});var v1={};St(v1,{CID:()=>Pe,bases:()=>Js,bytes:()=>sf,codecs:()=>r_,digest:()=>Ho,hasher:()=>qc,hashes:()=>t_,varint:()=>Ys});var Js,t_,r_,Kc=gt(()=>{Qm();e1();t1();r1();n1();Od();Uc();Nd();Ld();s1();uf();jd();p1();m1();Vd();Js=ie(ie(ie(ie(ie(ie(ie(ie(ie(ie({},Ad),Md),Td),kd),Cd),Dd),Id),Pd),Rd),Bd),t_=ie(ie({},qd),Hd),r_={raw:zd,json:Kd}});function x1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var y1,Wd,n_,Vc,Gd=gt(()=>{Kc();o(x1,"createCodec");y1=x1("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Wd=x1("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}),n_=ie({utf8:y1,"utf-8":y1,hex:Js.base16,latin1:Wd,ascii:Wd,binary:Wd},Js),Vc=n_});var w1={};St(w1,{fromString:()=>Lt});function Lt(r,e="utf8"){let t=Vc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var Wc=gt(()=>{Gd();o(Lt,"fromString")});var _1={};St(_1,{toString:()=>Ot});function Ot(r,e="utf8"){let t=Vc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var df=gt(()=>{Gd();o(Ot,"toString")});var E1=me(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function i_(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(i_,"imulShim");Or.mul=Math.imul||i_;function o_(r,e){return r+e|0}o(o_,"add");Or.add=o_;function s_(r,e){return r-e|0}o(s_,"sub");Or.sub=s_;function a_(r,e){return r<<e|r>>>32-e}o(a_,"rotl");Or.rotl=a_;function f_(r,e){return r<<32-e|r>>>e}o(f_,"rotr");Or.rotr=f_;function c_(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(c_,"isIntegerShim");Or.isInteger=Number.isInteger||c_;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 S1=E1();function u_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(u_,"readInt16BE");it.readInt16BE=u_;function l_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(l_,"readUint16BE");it.readUint16BE=l_;function d_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(d_,"readInt16LE");it.readInt16LE=d_;function h_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(h_,"readUint16LE");it.readUint16LE=h_;function A1(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(A1,"writeUint16BE");it.writeUint16BE=A1;it.writeInt16BE=A1;function M1(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(M1,"writeUint16LE");it.writeUint16LE=M1;it.writeInt16LE=M1;function Yd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Yd,"readInt32BE");it.readInt32BE=Yd;function Jd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Jd,"readUint32BE");it.readUint32BE=Jd;function Xd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Xd,"readInt32LE");it.readInt32LE=Xd;function Zd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(Zd,"readUint32LE");it.readUint32LE=Zd;function Yc(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(Yc,"writeUint32BE");it.writeUint32BE=Yc;it.writeInt32BE=Yc;function Jc(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(Jc,"writeUint32LE");it.writeUint32LE=Jc;it.writeInt32LE=Jc;function p_(r,e){e===void 0&&(e=0);var t=Yd(r,e),n=Yd(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(p_,"readInt64BE");it.readInt64BE=p_;function m_(r,e){e===void 0&&(e=0);var t=Jd(r,e),n=Jd(r,e+4);return t*4294967296+n}o(m_,"readUint64BE");it.readUint64BE=m_;function b_(r,e){e===void 0&&(e=0);var t=Xd(r,e),n=Xd(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(b_,"readInt64LE");it.readInt64LE=b_;function g_(r,e){e===void 0&&(e=0);var t=Zd(r,e),n=Zd(r,e+4);return n*4294967296+t}o(g_,"readUint64LE");it.readUint64LE=g_;function T1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Yc(r/4294967296>>>0,e,t),Yc(r>>>0,e,t+4),e}o(T1,"writeUint64BE");it.writeUint64BE=T1;it.writeInt64BE=T1;function k1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Jc(r>>>0,e,t),Jc(r/4294967296>>>0,e,t+4),e}o(k1,"writeUint64LE");it.writeUint64LE=k1;it.writeInt64LE=k1;function v_(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(v_,"readUintBE");it.readUintBE=v_;function y_(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(y_,"readUintLE");it.readUintLE=y_;function x_(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(!S1.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(x_,"writeUintBE");it.writeUintBE=x_;function w_(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(!S1.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(w_,"writeUintLE");it.writeUintLE=w_;function __(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(__,"readFloat32BE");it.readFloat32BE=__;function E_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(E_,"readFloat32LE");it.readFloat32LE=E_;function S_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(S_,"readFloat64BE");it.readFloat64BE=S_;function A_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(A_,"readFloat64LE");it.readFloat64LE=A_;function M_(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(M_,"writeFloat32BE");it.writeFloat32BE=M_;function T_(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(T_,"writeFloat32LE");it.writeFloat32LE=T_;function k_(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(k_,"writeFloat64BE");it.writeFloat64BE=k_;function C_(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(C_,"writeFloat64LE");it.writeFloat64LE=C_});var tn=me(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});function D_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(D_,"wipe");Qd.wipe=D_});var D1=me(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Zc=Ko(),Xc=tn();Yi.DIGEST_LENGTH=32;Yi.BLOCK_SIZE=64;var C1=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(){Xc.wipe(this._buffer),Xc.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&&(eh(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=eh(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;Zc.writeUint32BE(i,this._buffer,a-8),Zc.writeUint32BE(s,this._buffer,a-4),eh(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/4;f++)Zc.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){Xc.wipe(e.state),e.buffer&&Xc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Yi.SHA256=C1;var O_=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 eh(r,e,t,n,i){for(;i>=64;){for(var s=e[0],a=e[1],f=e[2],u=e[3],p=e[4],m=e[5],x=e[6],k=e[7],I=0;I<16;I++){var T=n+I*4;r[I]=Zc.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 $=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&x)|0)+(k+(O_[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=m,m=p,p=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]+=p,e[5]+=m,e[6]+=x,e[7]+=k,n+=64,i-=64}return n}o(eh,"hashBlocks");function I_(r){var e=new C1;e.update(r);var t=e.digest();return e.clean(),t}o(I_,"hash");Yi.hash=I_});var th=me((nN,Qc)=>{(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 Qc=="object"&&Qc.exports,f=typeof define=="function"&&define.amd,u=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",p="0123456789abcdef".split(""),m=[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"],z={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}),u&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(M){return typeof M=="object"&&M.buffer&&M.buffer.constructor===ArrayBuffer});for(var H=o(function(M,K,J){return function(N){return new v(M,K,M).update(N)[J]()}},"createOutputMethod"),X=o(function(M,K,J){return function(N,R){return new v(M,K,R).update(N)[J]()}},"createShakeOutputMethod"),B=o(function(M,K,J){return function(N,R,V,W){return c["cshake"+M].update(N,R,V,W)[J]()}},"createCshakeOutputMethod"),L=o(function(M,K,J){return function(N,R,V,W){return c["kmac"+M].update(N,R,V,W)[J]()}},"createKmacOutputMethod"),F=o(function(M,K,J,N){for(var R=0;R<U.length;++R){var V=U[R];M[V]=K(J,N,V)}return M},"createOutputMethods"),re=o(function(M,K){var J=H(M,K,"hex");return J.create=function(){return new v(M,K,M)},J.update=function(N){return J.create().update(N)},F(J,H,M,K)},"createMethod"),E=o(function(M,K){var J=X(M,K,"hex");return J.create=function(N){return new v(M,K,N)},J.update=function(N,R){return J.create(R).update(N)},F(J,X,M,K)},"createShakeMethod"),l=o(function(M,K){var J=z[M],N=B(M,K,"hex");return N.create=function(R,V,W){return!V&&!W?c["shake"+M].create(R):new v(M,K,R).bytepad([V,W],J)},N.update=function(R,V,W,ee){return N.create(V,W,ee).update(R)},F(N,B,M,K)},"createCshakeMethod"),g=o(function(M,K){var J=z[M],N=L(M,K,"hex");return N.create=function(R,V,W){return new A(M,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,M,K)},"createKmacMethod"),h=[{name:"keccak",padding:k,bits:$,createMethod:re},{name:"sha3",padding:I,bits:$,createMethod:re},{name:"shake",padding:m,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(M,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-(M<<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(M){if(this.finalized)throw new Error(e);var K,J=typeof M;if(J!=="string"){if(J==="object"){if(M===null)throw new Error(r);if(u&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!u||!ArrayBuffer.isView(M)))throw new Error(r)}else throw new Error(r);K=!0}for(var N=this.blocks,R=this.byteCount,V=M.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]|=M[ee]<<T[fe++&3];else for(fe=this.start;ee<V&&fe<R;++ee)Y=M.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|M.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(M,K){var J=M&255,N=1,R=[J];for(M=M>>8,J=M&255;J>0;)R.unshift(J),M=M>>8,J=M&255,++N;return K?R.push(N):R.unshift(N),this.update(R),R.length},v.prototype.encodeString=function(M){var K,J=typeof M;if(J!=="string"){if(J==="object"){if(M===null)throw new Error(r);if(u&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!u||!ArrayBuffer.isView(M)))throw new Error(r)}else throw new Error(r);K=!0}var N=0,R=M.length;if(K)N=R;else for(var V=0;V<M.length;++V){var W=M.charCodeAt(V);W<128?N+=1:W<2048?N+=2:W<55296||W>=57344?N+=3:(W=65536+((W&1023)<<10|M.charCodeAt(++V)&1023),N+=4)}return N+=this.encode(N*8),this.update(M),N},v.prototype.bytepad=function(M,K){for(var J=this.encode(K),N=0;N<M.length;++N)J+=this.encodeString(M[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 M=this.blocks,K=this.lastByteIndex,J=this.blockCount,N=this.s;if(M[K>>2]|=this.padding[K&3],this.lastByteIndex===this.byteCount)for(M[0]=M[J],K=1;K<J+1;++K)M[K]=0;for(M[J-1]|=2147483648,K=0;K<J;++K)N[K]^=M[K];ne(N)}},v.prototype.toString=v.prototype.hex=function(){this.finalize();for(var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W="",ee;V<J;){for(R=0;R<M&&V<J;++R,++V)ee=K[R],W+=p[ee>>4&15]+p[ee&15]+p[ee>>12&15]+p[ee>>8&15]+p[ee>>20&15]+p[ee>>16&15]+p[ee>>28&15]+p[ee>>24&15];V%M===0&&(ne(K),R=0)}return N&&(ee=K[R],W+=p[ee>>4&15]+p[ee&15],N>1&&(W+=p[ee>>12&15]+p[ee>>8&15]),N>2&&(W+=p[ee>>20&15]+p[ee>>16&15])),W},v.prototype.arrayBuffer=function(){this.finalize();var M=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<M&&V<J;++R,++V)he[V]=K[R];V%M===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 M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=[],ee,he;V<J;){for(R=0;R<M&&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%M===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 A(M,K,J){v.call(this,M,K,J)}o(A,"Kmac"),A.prototype=new v,A.prototype.finalize=function(){return this.encode(this.outputBits,!0),v.prototype.finalize.call(this)};var ne=o(function(M){var K,J,N,R,V,W,ee,he,fe,Y,pe,Q,ce,q,se,be,Te,we,Ie,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=M[0]^M[10]^M[20]^M[30]^M[40],V=M[1]^M[11]^M[21]^M[31]^M[41],W=M[2]^M[12]^M[22]^M[32]^M[42],ee=M[3]^M[13]^M[23]^M[33]^M[43],he=M[4]^M[14]^M[24]^M[34]^M[44],fe=M[5]^M[15]^M[25]^M[35]^M[45],Y=M[6]^M[16]^M[26]^M[36]^M[46],pe=M[7]^M[17]^M[27]^M[37]^M[47],Q=M[8]^M[18]^M[28]^M[38]^M[48],ce=M[9]^M[19]^M[29]^M[39]^M[49],K=Q^(W<<1|ee>>>31),J=ce^(ee<<1|W>>>31),M[0]^=K,M[1]^=J,M[10]^=K,M[11]^=J,M[20]^=K,M[21]^=J,M[30]^=K,M[31]^=J,M[40]^=K,M[41]^=J,K=R^(he<<1|fe>>>31),J=V^(fe<<1|he>>>31),M[2]^=K,M[3]^=J,M[12]^=K,M[13]^=J,M[22]^=K,M[23]^=J,M[32]^=K,M[33]^=J,M[42]^=K,M[43]^=J,K=W^(Y<<1|pe>>>31),J=ee^(pe<<1|Y>>>31),M[4]^=K,M[5]^=J,M[14]^=K,M[15]^=J,M[24]^=K,M[25]^=J,M[34]^=K,M[35]^=J,M[44]^=K,M[45]^=J,K=he^(Q<<1|ce>>>31),J=fe^(ce<<1|Q>>>31),M[6]^=K,M[7]^=J,M[16]^=K,M[17]^=J,M[26]^=K,M[27]^=J,M[36]^=K,M[37]^=J,M[46]^=K,M[47]^=J,K=Y^(R<<1|V>>>31),J=pe^(V<<1|R>>>31),M[8]^=K,M[9]^=J,M[18]^=K,M[19]^=J,M[28]^=K,M[29]^=J,M[38]^=K,M[39]^=J,M[48]^=K,M[49]^=J,q=M[0],se=M[1],je=M[11]<<4|M[10]>>>28,qn=M[10]<<4|M[11]>>>28,ge=M[20]<<3|M[21]>>>29,ft=M[21]<<3|M[20]>>>29,Jr=M[31]<<9|M[30]>>>23,Xr=M[30]<<9|M[31]>>>23,$e=M[40]<<18|M[41]>>>14,qe=M[41]<<18|M[40]>>>14,Ne=M[2]<<1|M[3]>>>31,Bn=M[3]<<1|M[2]>>>31,be=M[13]<<12|M[12]>>>20,Te=M[12]<<12|M[13]>>>20,ze=M[22]<<10|M[23]>>>22,Ke=M[23]<<10|M[22]>>>22,Ee=M[33]<<13|M[32]>>>19,ve=M[32]<<13|M[33]>>>19,Zr=M[42]<<2|M[43]>>>30,Qr=M[43]<<2|M[42]>>>30,Ge=M[5]<<30|M[4]>>>2,Ye=M[4]<<30|M[5]>>>2,Le=M[14]<<6|M[15]>>>26,Be=M[15]<<6|M[14]>>>26,we=M[25]<<11|M[24]>>>21,Ie=M[24]<<11|M[25]>>>21,Hn=M[34]<<15|M[35]>>>17,Ve=M[35]<<15|M[34]>>>17,lt=M[45]<<29|M[44]>>>3,De=M[44]<<29|M[45]>>>3,j=M[6]<<28|M[7]>>>4,ae=M[7]<<28|M[6]>>>4,gn=M[17]<<23|M[16]>>>9,mt=M[16]<<23|M[17]>>>9,Un=M[26]<<25|M[27]>>>7,Ue=M[27]<<25|M[26]>>>7,gr=M[36]<<21|M[37]>>>11,te=M[37]<<21|M[36]>>>11,We=M[47]<<24|M[46]>>>8,jn=M[46]<<24|M[47]>>>8,$n=M[8]<<27|M[9]>>>5,He=M[9]<<27|M[8]>>>5,ue=M[18]<<20|M[19]>>>12,le=M[19]<<20|M[18]>>>12,bt=M[29]<<7|M[28]>>>25,Yr=M[28]<<7|M[29]>>>25,Fe=M[38]<<8|M[39]>>>24,Fn=M[39]<<8|M[38]>>>24,G=M[48]<<14|M[49]>>>18,P=M[49]<<14|M[48]>>>18,M[0]=q^~be&we,M[1]=se^~Te&Ie,M[10]=j^~ue&ge,M[11]=ae^~le&ft,M[20]=Ne^~Le&Un,M[21]=Bn^~Be&Ue,M[30]=$n^~je&ze,M[31]=He^~qn&Ke,M[40]=Ge^~gn&bt,M[41]=Ye^~mt&Yr,M[2]=be^~we&gr,M[3]=Te^~Ie&te,M[12]=ue^~ge&Ee,M[13]=le^~ft&ve,M[22]=Le^~Un&Fe,M[23]=Be^~Ue&Fn,M[32]=je^~ze&Hn,M[33]=qn^~Ke&Ve,M[42]=gn^~bt&Jr,M[43]=mt^~Yr&Xr,M[4]=we^~gr&G,M[5]=Ie^~te&P,M[14]=ge^~Ee<,M[15]=ft^~ve&De,M[24]=Un^~Fe&$e,M[25]=Ue^~Fn&qe,M[34]=ze^~Hn&We,M[35]=Ke^~Ve&jn,M[44]=bt^~Jr&Zr,M[45]=Yr^~Xr&Qr,M[6]=gr^~G&q,M[7]=te^~P&se,M[16]=Ee^~lt&j,M[17]=ve^~De&ae,M[26]=Fe^~$e&Ne,M[27]=Fn^~qe&Bn,M[36]=Hn^~We&$n,M[37]=Ve^~jn&He,M[46]=Jr^~Zr&Ge,M[47]=Xr^~Qr&Ye,M[8]=G^~q&be,M[9]=P^~se&Te,M[18]=lt^~j&ue,M[19]=De^~ae&le,M[28]=$e^~Ne&Le,M[29]=qe^~Bn&Be,M[38]=We^~$n&je,M[39]=jn^~He&qn,M[48]=Zr^~Ge&gn,M[49]=Qr^~Ye&mt,M[0]^=C[N],M[1]^=C[N+1]},"f");if(a)Qc.exports=c;else{for(y=0;y<d.length;++y)n[d[y]]=c[d[y]];f&&define(function(){return c})}})()});var O1=me((iN,P_)=>{P_.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 rh=me(()=>{});var Wn=me((I1,nh)=>{(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=rh().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 p=["","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"],m=[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=p[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=m[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=p[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),A=Math.max(0,b-E.length+1);A<=v;A++){var ne=b-A|0;c=E.words[ne]|0,d=l.words[A]|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,A=D>>>13,ne=c[1]|0,M=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,Ie=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(A,le)|0,S=Math.imul(A,ge);var gn=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(gn>>>26)|0,gn&=67108863,w=Math.imul(M,le),b=Math.imul(M,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(A,Ee)|0,S=S+Math.imul(A,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(M,Ee)|0,b=b+Math.imul(M,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(A,De)|0,S=S+Math.imul(A,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(M,De)|0,b=b+Math.imul(M,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(A,Le)|0,S=S+Math.imul(A,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(M,Le)|0,b=b+Math.imul(M,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(A,Ue)|0,S=S+Math.imul(A,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(M,Ue)|0,b=b+Math.imul(M,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(A,$e)|0,S=S+Math.imul(A,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(M,$e)|0,b=b+Math.imul(M,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(A,He)|0,S=S+Math.imul(A,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(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(M,He)|0,b=b+Math.imul(M,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(A,ze)|0,S=S+Math.imul(A,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,je)|0,b=b+Math.imul(R,He)|0,S=S+Math.imul(R,je)|0,w=w+Math.imul(M,ze)|0,b=b+Math.imul(M,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(A,Ve)|0,S=S+Math.imul(A,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(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,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(M,Ve)|0,b=b+Math.imul(M,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(A,Ge)|0,S=S+Math.imul(A,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(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,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(M,Ge)|0,b=b+Math.imul(M,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(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,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 Oo=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Oo>>>26)|0,Oo&=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(Ie,$e)|0,S=S+Math.imul(Ie,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 Io=(_+w|0)+((b&8191)<<13)|0;_=(S+(b>>>13)|0)+(Io>>>26)|0,Io&=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(Ie,He)|0,S=S+Math.imul(Ie,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(Ie,ze)|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(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(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(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(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(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]=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,A=D*v,ne=A&67108863;y=y+(A/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,A=S,ne=0;ne<_;ne++){var M=h[D+ne],K=c[D+ne],J=h[D+ne+_],N=c[D+ne+_],R=v*J-A*N;N=v*N+A*J,J=R,h[D+ne]=M+J,c[D+ne]=K+N,h[D+ne+_]=M-J,c[D+ne+_]=K-N,ne!==w&&(R=b*v-S*A,A=b*A+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),A=h.words;A.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 M=w[ne]*D[ne]-b[ne]*v[ne];b[ne]=w[ne]*v[ne]+b[ne]*D[ne],w[ne]=M}return this.conjugate(w,b,c),this.transform(w,b,A,y,c,d),this.conjugate(A,y,c),this.normalize13b(A,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 A=(c.words[d.length+v]|0)*67108864+(c.words[d.length+v-1]|0);for(A=Math.min(A/y|0,67108863),c._ishlnsubmul(d,A,v);c.negative!==0;)A--,c.negative=0,c._ishlnsubmul(d,1,v),c.isZero()||(c.negative^=1);b&&(b.words[v]=A)}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 A=0,ne=1;(h.words[0]&ne)===0&&A<26;++A,ne<<=1);if(A>0)for(h.iushrn(A);A-- >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),A=d;v.cmp(y)!==0;){for(var ne=v,M=0;ne.cmp(y)!==0;M++)ne=ne.redSqr();t(M<A);var K=this.pow(S,new i(1).iushln(A-M-1));D=D.redMul(K),S=K.redSqr(),v=v.redMul(S),A=M}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 nh=="undefined"||nh,I1)});var Ji=me((aN,N1)=>{N1.exports=P1;function P1(r,e){if(!r)throw new Error(e||"Assertion failed")}o(P1,"assert");P1.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var ih=me(B1=>{"use strict";var eu=B1;function N_(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(N_,"toArray");eu.toArray=N_;function R1(r){return r.length===1?"0"+r:r}o(R1,"zero2");eu.zero2=R1;function L1(r){for(var e="",t=0;t<r.length;t++)e+=R1(r[t].toString(16));return e}o(L1,"toHex");eu.toHex=L1;eu.encode=o(function(e,t){return t==="hex"?L1(e):e},"encode")});var Ir=me(U1=>{"use strict";var xn=U1,R_=Wn(),L_=Ji(),tu=ih();xn.assert=L_;xn.toArray=tu.toArray;xn.zero2=tu.zero2;xn.toHex=tu.toHex;xn.encode=tu.encode;function B_(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(B_,"getNAF");xn.getNAF=B_;function U_(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 p;(f&1)===0?p=0:(s=e.andln(7)+i&7,(s===3||s===5)&&a===2?p=-f:p=f),t[1].push(p),2*n===u+1&&(n=1-n),2*i===p+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(U_,"getJSF");xn.getJSF=U_;function F_(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(F_,"cachedProperty");xn.cachedProperty=F_;function $_(r){return typeof r=="string"?xn.toArray(r,"hex"):r}o($_,"parseBytes");xn.parseBytes=$_;function q_(r){return new R_(r,"hex","le")}o(q_,"intFromLE");xn.intFromLE=q_});var fh=me((uN,ah)=>{var oh;ah.exports=o(function(e){return oh||(oh=new Xi(null)),oh.generate(e)},"rand");function Xi(r){this.rand=r}o(Xi,"Rand");ah.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(sh=require("crypto"),typeof sh.randomBytes!="function")throw new Error("Not supported");Xi.prototype._rand=o(function(e){return sh.randomBytes(e)},"_rand")}catch(r){}var sh});var pf=me((lN,F1)=>{"use strict";var Vo=Wn(),hf=Ir(),ru=hf.getNAF,H_=hf.getJSF,nu=hf.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");F1.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){nu(e.precomputed);var n=e._getDoubles(),i=ru(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 p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var m=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()));m=m.add(x)}return m.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=ru(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var m=a[u];nu(m!==0),e.type==="affine"?m>0?f=f.mixedAdd(s[m-1>>1]):f=f.mixedAdd(s[-m-1>>1].neg()):m>0?f=f.add(s[m-1>>1]):f=f.add(s[-m-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,p=0,m,x,k;for(m=0;m<i;m++){k=t[m];var I=k._getNAFPoints(e);a[m]=I.wnd,f[m]=I.points}for(m=i-1;m>=1;m-=2){var T=m-1,C=m;if(a[T]!==1||a[C]!==1){u[T]=ru(n[T],a[T],this._bitLength),u[C]=ru(n[C],a[C],this._bitLength),p=Math.max(u[T].length,p),p=Math.max(u[C].length,p);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=H_(n[T],n[C]);for(p=Math.max(U[0].length,p),u[T]=new Array(p),u[C]=new Array(p),x=0;x<p;x++){var z=U[0][x]|0,H=U[1][x]|0;u[T][x]=O[(z+1)*3+(H+1)],u[C][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),B=this._wnafT4;for(m=p;m>=0;m--){for(var L=0;m>=0;){var F=!0;for(x=0;x<i;x++)B[x]=u[x][m]|0,B[x]!==0&&(F=!1);if(!F)break;L++,m--}if(m>=0&&L++,X=X.dblp(L),m<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(m=0;m<i;m++)f[m]=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=hf.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?nu(e[e.length-1]%2===0):e[0]===7&&nu(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 hf.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 mf=me((dN,ch)=>{typeof Object.create=="function"?ch.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"):ch.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 q1=me((hN,$1)=>{"use strict";var j_=Ir(),It=Wn(),uh=mf(),Xs=pf(),z_=j_.assert;function nn(r){Xs.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");uh(nn,Xs);$1.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],z_(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),p,m,x,k,I,T,C,$=0,O,U;n.cmpn(0)!==0;){var z=i.div(n);O=i.sub(z.mul(n)),U=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&O.cmp(t)<0)p=C.neg(),m=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=p,T=m),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),p=s.mul(n.b),m=a.mul(i.b),x=e.sub(f).sub(u),k=p.add(m).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],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var m=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return m},"_endoWnafMulAdd");function jt(r,e,t,n){Xs.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(jt,"Point");uh(jt,Xs.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 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");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 Zt(r,e,t,n){Xs.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");uh(Zt,Xs.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),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=u.redSqr(),x=m.redMul(u),k=i.redMul(m),I=p.redSqr().redIAdd(x).redISub(k).redISub(k),T=p.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 p=f.redSqr(),m=p.redMul(f),x=n.redMul(p),k=u.redSqr().redIAdd(m).redISub(x).redISub(x),I=u.redMul(x.redISub(k)).redISub(s.redMul(m)),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,p=u.redSqr().redSqr(),m=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),k=m.redSqr(),I=k.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(p)),C=a.redMul(k),$=T.redSqr().redISub(C.redAdd(C)),O=C.redISub($),U=T.redMul(O);U=U.redIAdd(U).redISub(I);var z=m.redMul(u);t+1<e&&(p=p.redMul(I)),a=$,u=z,m=U}return this.curve.jpoint(a,m.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),p=u.redSqr().redISub(f).redISub(f),m=a.redIAdd(a);m=m.redIAdd(m),m=m.redIAdd(m),e=p,t=u.redMul(f.redISub(p)).redISub(m),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),p=u.redSqr().redISub(f).redISub(f);e=p;var m=a.redIAdd(a);m=m.redIAdd(m),m=m.redIAdd(m),t=u.redMul(f.redISub(p)).redISub(m),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)),p=t.redAdd(t);p=p.redIAdd(p);var m=p.redMul(f),x=u.redSqr().redISub(m.redAdd(m)),k=m.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(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var m=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),x=t.redMul(m);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(m.redMul(p.redISub(m)).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 z1=me((pN,j1)=>{"use strict";var Zs=Wn(),H1=mf(),iu=pf(),K_=Ir();function Qs(r){iu.call(this,"mont",r),this.a=new Zs(r.a,16).toRed(this.red),this.b=new Zs(r.b,16).toRed(this.red),this.i4=new Zs(4).toRed(this.red).redInvm(),this.two=new Zs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Qs,"MontCurve");H1(Qs,iu);j1.exports=Qs;Qs.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){iu.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zs(e,16),this.z=new Zs(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");H1(zt,iu.BasePoint);Qs.prototype.decodePoint=o(function(e,t){return this.point(K_.toArray(e,t),1)},"decodePoint");Qs.prototype.point=o(function(e,t){return new zt(this,e,t)},"point");Qs.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),p=t.z.redMul(f.redAdd(u).redSqr()),m=t.x.redMul(f.redISub(u).redSqr());return this.curve.point(p,m)},"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 W1=me((mN,V1)=>{"use strict";var V_=Ir(),xi=Wn(),K1=mf(),ou=pf(),W_=V_.assert;function Gn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,ou.call(this,"edwards",r),this.a=new xi(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new xi(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new xi(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),W_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(Gn,"EdwardsCurve");K1(Gn,ou);V1.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 xi(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 xi(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 At(r,e,t,n,i){ou.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 xi(e,16),this.y=new xi(t,16),this.z=n?new xi(n,16):this.curve.one,this.t=i&&new xi(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(At,"Point");K1(At,ou.BasePoint);Gn.prototype.pointFromJSON=o(function(e){return At.fromJSON(this,e)},"pointFromJSON");Gn.prototype.point=o(function(e,t,n,i){return new At(this,e,t,n,i)},"point");At.fromJSON=o(function(e,t){return new At(e,t[0],t[1],t[2])},"fromJSON");At.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");At.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");At.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),p=s.redMul(f),m=a.redMul(u),x=s.redMul(u),k=f.redMul(a);return this.curve.point(p,m,k,x)},"_extDbl");At.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,p;if(this.curve.twisted){f=this.curve._mulA(t);var m=f.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(m.redSub(this.curve.two)),s=m.redMul(f.redSub(n)),a=m.redSqr().redSub(m).redSub(m)):(u=this.z.redSqr(),p=m.redSub(u).redISub(u),i=e.redSub(t).redISub(n).redMul(p),s=m.redMul(f.redSub(n)),a=m.redMul(p))}else f=t.redAdd(n),u=this.curve._mulC(this.z).redSqr(),p=f.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(f)).redMul(p),s=this.curve._mulC(f).redMul(t.redISub(n)),a=f.redMul(p);return this.curve.point(i,s,a)},"_projDbl");At.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");At.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),p=n.redAdd(t),m=a.redMul(f),x=u.redMul(p),k=a.redMul(p),I=f.redMul(u);return this.curve.point(m,x,I,k)},"_extAdd");At.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),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),m=t.redMul(f).redMul(p),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(m,x,k)},"_projAdd");At.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");At.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");At.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");At.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");At.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");At.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");At.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");At.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");At.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");At.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");At.prototype.toP=At.prototype.normalize;At.prototype.mixedAdd=At.prototype.add});var lh=me(G1=>{"use strict";var su=G1;su.base=pf();su.short=q1();su.mont=z1();su.edwards=W1()});var wn=me(wt=>{"use strict";var G_=Ji(),Y_=mf();wt.inherits=Y_;function J_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(J_,"isSurrogatePair");function X_(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):J_(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(X_,"toArray");wt.toArray=X_;function Z_(r){for(var e="",t=0;t<r.length;t++)e+=J1(r[t].toString(16));return e}o(Z_,"toHex");wt.toHex=Z_;function Y1(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(Y1,"htonl");wt.htonl=Y1;function Q_(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=Y1(i)),t+=X1(i.toString(16))}return t}o(Q_,"toHex32");wt.toHex32=Q_;function J1(r){return r.length===1?"0"+r:r}o(J1,"zero2");wt.zero2=J1;function X1(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(X1,"zero8");wt.zero8=X1;function e9(r,e,t,n){var i=t-e;G_(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(e9,"join32");wt.join32=e9;function t9(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(t9,"split32");wt.split32=t9;function r9(r,e){return r>>>e|r<<32-e}o(r9,"rotr32");wt.rotr32=r9;function n9(r,e){return r<<e|r>>>32-e}o(n9,"rotl32");wt.rotl32=n9;function i9(r,e){return r+e>>>0}o(i9,"sum32");wt.sum32=i9;function o9(r,e,t){return r+e+t>>>0}o(o9,"sum32_3");wt.sum32_3=o9;function s9(r,e,t,n){return r+e+t+n>>>0}o(s9,"sum32_4");wt.sum32_4=s9;function a9(r,e,t,n,i){return r+e+t+n+i>>>0}o(a9,"sum32_5");wt.sum32_5=a9;function f9(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(f9,"sum64");wt.sum64=f9;function c9(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(c9,"sum64_hi");wt.sum64_hi=c9;function u9(r,e,t,n){var i=e+n;return i>>>0}o(u9,"sum64_lo");wt.sum64_lo=u9;function l9(r,e,t,n,i,s,a,f){var u=0,p=e;p=p+n>>>0,u+=p<e?1:0,p=p+s>>>0,u+=p<s?1:0,p=p+f>>>0,u+=p<f?1:0;var m=r+t+i+a+u;return m>>>0}o(l9,"sum64_4_hi");wt.sum64_4_hi=l9;function d9(r,e,t,n,i,s,a,f){var u=e+n+s+f;return u>>>0}o(d9,"sum64_4_lo");wt.sum64_4_lo=d9;function h9(r,e,t,n,i,s,a,f,u,p){var m=0,x=e;x=x+n>>>0,m+=x<e?1:0,x=x+s>>>0,m+=x<s?1:0,x=x+f>>>0,m+=x<f?1:0,x=x+p>>>0,m+=x<p?1:0;var k=r+t+i+a+u+m;return k>>>0}o(h9,"sum64_5_hi");wt.sum64_5_hi=h9;function p9(r,e,t,n,i,s,a,f,u,p){var m=e+n+s+f+p;return m>>>0}o(p9,"sum64_5_lo");wt.sum64_5_lo=p9;function m9(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(m9,"rotr64_hi");wt.rotr64_hi=m9;function b9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(b9,"rotr64_lo");wt.rotr64_lo=b9;function g9(r,e,t){return r>>>t}o(g9,"shr64_hi");wt.shr64_hi=g9;function v9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(v9,"shr64_lo");wt.shr64_lo=v9});var ea=me(Q1=>{"use strict";var Z1=wn(),y9=Ji();function au(){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(au,"BlockHash");Q1.BlockHash=au;au.prototype.update=o(function(e,t){if(e=Z1.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=Z1.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");au.prototype.digest=o(function(e){return this.update(this._pad()),y9(this.pending===null),this._digest(e)},"digest");au.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 dh=me(wi=>{"use strict";var x9=wn(),Yn=x9.rotr32;function w9(r,e,t,n){if(r===0)return eb(e,t,n);if(r===1||r===3)return rb(e,t,n);if(r===2)return tb(e,t,n)}o(w9,"ft_1");wi.ft_1=w9;function eb(r,e,t){return r&e^~r&t}o(eb,"ch32");wi.ch32=eb;function tb(r,e,t){return r&e^r&t^e&t}o(tb,"maj32");wi.maj32=tb;function rb(r,e,t){return r^e^t}o(rb,"p32");wi.p32=rb;function _9(r){return Yn(r,2)^Yn(r,13)^Yn(r,22)}o(_9,"s0_256");wi.s0_256=_9;function E9(r){return Yn(r,6)^Yn(r,11)^Yn(r,25)}o(E9,"s1_256");wi.s1_256=E9;function S9(r){return Yn(r,7)^Yn(r,18)^r>>>3}o(S9,"g0_256");wi.g0_256=S9;function A9(r){return Yn(r,17)^Yn(r,19)^r>>>10}o(A9,"g1_256");wi.g1_256=A9});var ob=me((xN,ib)=>{"use strict";var ta=wn(),M9=ea(),T9=dh(),hh=ta.rotl32,bf=ta.sum32,k9=ta.sum32_5,C9=T9.ft_1,nb=M9.BlockHash,D9=[1518500249,1859775393,2400959708,3395469782];function Jn(){if(!(this instanceof Jn))return new Jn;nb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(Jn,"SHA1");ta.inherits(Jn,nb);ib.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]=hh(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],p=this.h[4];for(i=0;i<n.length;i++){var m=~~(i/20),x=k9(hh(s,5),C9(m,a,f,u),p,n[i],D9[m]);p=u,u=f,f=hh(a,30),a=s,s=x}this.h[0]=bf(this.h[0],s),this.h[1]=bf(this.h[1],a),this.h[2]=bf(this.h[2],f),this.h[3]=bf(this.h[3],u),this.h[4]=bf(this.h[4],p)},"_update");Jn.prototype._digest=o(function(e){return e==="hex"?ta.toHex32(this.h,"big"):ta.split32(this.h,"big")},"digest")});var ph=me((wN,ab)=>{"use strict";var ra=wn(),O9=ea(),na=dh(),I9=Ji(),_n=ra.sum32,P9=ra.sum32_4,N9=ra.sum32_5,R9=na.ch32,L9=na.maj32,B9=na.s0_256,U9=na.s1_256,F9=na.g0_256,$9=na.g1_256,sb=O9.BlockHash,q9=[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;sb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=q9,this.W=new Array(64)}o(Xn,"SHA256");ra.inherits(Xn,sb);ab.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]=P9($9(n[i-2]),n[i-7],F9(n[i-15]),n[i-16]);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],p=this.h[4],m=this.h[5],x=this.h[6],k=this.h[7];for(I9(this.k.length===n.length),i=0;i<n.length;i++){var I=N9(k,U9(p),R9(p,m,x),this.k[i],n[i]),T=_n(B9(s),L9(s,a,f));k=x,x=m,m=p,p=_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],p),this.h[5]=_n(this.h[5],m),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"?ra.toHex32(this.h,"big"):ra.split32(this.h,"big")},"digest")});var ub=me((_N,cb)=>{"use strict";var mh=wn(),fb=ph();function _i(){if(!(this instanceof _i))return new _i;fb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(_i,"SHA224");mh.inherits(_i,fb);cb.exports=_i;_i.blockSize=512;_i.outSize=224;_i.hmacStrength=192;_i.padLength=64;_i.prototype._digest=o(function(e){return e==="hex"?mh.toHex32(this.h.slice(0,7),"big"):mh.split32(this.h.slice(0,7),"big")},"digest")});var vh=me((EN,pb)=>{"use strict";var Er=wn(),H9=ea(),j9=Ji(),Zn=Er.rotr64_hi,Qn=Er.rotr64_lo,lb=Er.shr64_hi,db=Er.shr64_lo,Qi=Er.sum64,bh=Er.sum64_hi,gh=Er.sum64_lo,z9=Er.sum64_4_hi,K9=Er.sum64_4_lo,V9=Er.sum64_5_hi,W9=Er.sum64_5_lo,hb=H9.BlockHash,G9=[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;hb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=G9,this.W=new Array(160)}o(En,"SHA512");Er.inherits(En,hb);pb.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=o7(n[i-4],n[i-3]),a=s7(n[i-4],n[i-3]),f=n[i-14],u=n[i-13],p=n7(n[i-30],n[i-29]),m=i7(n[i-30],n[i-29]),x=n[i-32],k=n[i-31];n[i]=z9(s,a,f,u,p,m,x,k),n[i+1]=K9(s,a,f,u,p,m,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],p=this.h[5],m=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],z=this.h[15];j9(this.k.length===n.length);for(var H=0;H<n.length;H+=2){var X=U,B=z,L=t7(k,I),F=r7(k,I),re=Y9(k,I,T,C,$,O),E=J9(k,I,T,C,$,O),l=this.k[H],g=this.k[H+1],h=n[H],c=n[H+1],d=V9(X,B,L,F,re,E,l,g,h,c),y=W9(X,B,L,F,re,E,l,g,h,c);X=Q9(i,s),B=e7(i,s),L=X9(i,s,a,f,u,p),F=Z9(i,s,a,f,u,p);var _=bh(X,B,L,F),w=gh(X,B,L,F);U=$,z=O,$=T,O=C,T=k,C=I,k=bh(m,x,d,y),I=gh(x,x,d,y),m=u,x=p,u=a,p=f,a=i,f=s,i=bh(d,y,_,w),s=gh(d,y,_,w)}Qi(this.h,0,i,s),Qi(this.h,2,a,f),Qi(this.h,4,u,p),Qi(this.h,6,m,x),Qi(this.h,8,k,I),Qi(this.h,10,T,C),Qi(this.h,12,$,O),Qi(this.h,14,U,z)},"_update");En.prototype._digest=o(function(e){return e==="hex"?Er.toHex32(this.h,"big"):Er.split32(this.h,"big")},"digest");function Y9(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(Y9,"ch64_hi");function J9(r,e,t,n,i,s){var a=e&n^~e&s;return a<0&&(a+=4294967296),a}o(J9,"ch64_lo");function X9(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(X9,"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 Q9(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(Q9,"s0_512_hi");function e7(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(e7,"s0_512_lo");function t7(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(t7,"s1_512_hi");function r7(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(r7,"s1_512_lo");function n7(r,e){var t=Zn(r,e,1),n=Zn(r,e,8),i=lb(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(n7,"g0_512_hi");function i7(r,e){var t=Qn(r,e,1),n=Qn(r,e,8),i=db(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(i7,"g0_512_lo");function o7(r,e){var t=Zn(r,e,19),n=Zn(e,r,29),i=lb(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(o7,"g1_512_hi");function s7(r,e){var t=Qn(r,e,19),n=Qn(e,r,29),i=db(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(s7,"g1_512_lo")});var gb=me((SN,bb)=>{"use strict";var yh=wn(),mb=vh();function Ei(){if(!(this instanceof Ei))return new Ei;mb.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(Ei,"SHA384");yh.inherits(Ei,mb);bb.exports=Ei;Ei.blockSize=1024;Ei.outSize=384;Ei.hmacStrength=192;Ei.padLength=128;Ei.prototype._digest=o(function(e){return e==="hex"?yh.toHex32(this.h.slice(0,12),"big"):yh.split32(this.h.slice(0,12),"big")},"digest")});var vb=me(ia=>{"use strict";ia.sha1=ob();ia.sha224=ub();ia.sha256=ph();ia.sha384=gb();ia.sha512=vh()});var Sb=me(Eb=>{"use strict";var Wo=wn(),a7=ea(),fu=Wo.rotl32,yb=Wo.sum32,gf=Wo.sum32_3,xb=Wo.sum32_4,_b=a7.BlockHash;function ei(){if(!(this instanceof ei))return new ei;_b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(ei,"RIPEMD160");Wo.inherits(ei,_b);Eb.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,p=i,m=s,x=a,k=f,I=0;I<80;I++){var T=yb(fu(xb(n,wb(I,i,s,a),e[u7[I]+t],f7(I)),d7[I]),f);n=f,f=a,a=fu(s,10),s=i,i=T,T=yb(fu(xb(u,wb(79-I,p,m,x),e[l7[I]+t],c7(I)),h7[I]),k),u=k,k=x,x=fu(m,10),m=p,p=T}T=gf(this.h[1],s,x),this.h[1]=gf(this.h[2],a,k),this.h[2]=gf(this.h[3],f,u),this.h[3]=gf(this.h[4],n,p),this.h[4]=gf(this.h[0],i,m),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 wb(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(wb,"f");function f7(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(f7,"K");function c7(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(c7,"Kh");var u7=[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],l7=[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],d7=[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],h7=[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 Mb=me((TN,Ab)=>{"use strict";var p7=wn(),m7=Ji();function oa(r,e,t){if(!(this instanceof oa))return new oa(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(p7.toArray(e,t))}o(oa,"Hmac");Ab.exports=oa;oa.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),m7(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");oa.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");oa.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var vf=me(Tb=>{var Qt=Tb;Qt.utils=wn();Qt.common=ea();Qt.sha=vb();Qt.ripemd=Sb();Qt.hmac=Mb();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 Cb=me((CN,kb)=>{kb.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 cu=me(Ib=>{"use strict";var wh=Ib,eo=vf(),xh=lh(),b7=Ir(),Db=b7.assert;function Ob(r){r.type==="short"?this.curve=new xh.short(r):r.type==="edwards"?this.curve=new xh.edwards(r):this.curve=new xh.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,Db(this.g.validate(),"Invalid curve"),Db(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(Ob,"PresetCurve");wh.PresetCurve=Ob;function to(r,e){Object.defineProperty(wh,r,{configurable:!0,enumerable:!0,get:function(){var t=new Ob(e);return Object.defineProperty(wh,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 _h;try{_h=Cb()}catch(r){_h=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",_h]})});var Rb=me((ON,Nb)=>{"use strict";var g7=vf(),Go=ih(),Pb=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");Pb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ro,"HmacDRBG");Nb.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 g7.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),Pb(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 Bb=me((IN,Lb)=>{"use strict";var v7=Wn(),y7=Ir(),Eh=y7.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");Lb.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 v7(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"?Eh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Eh(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()||Eh(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 $b=me((PN,Fb)=>{"use strict";var uu=Wn(),Mh=Ir(),x7=Mh.assert;function lu(r,e){if(r instanceof lu)return r;this._importDER(r,e)||(x7(r.r&&r.s,"Signature without r or s"),this.r=new uu(r.r,16),this.s=new uu(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(lu,"Signature");Fb.exports=lu;function w7(){this.place=0}o(w7,"Position");function Sh(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(Sh,"getLength");function Ub(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(Ub,"rmPadding");lu.prototype._importDER=o(function(e,t){e=Mh.toArray(e,t);var n=new w7;if(e[n.place++]!==48)return!1;var i=Sh(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Sh(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=Sh(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 uu(a),this.s=new uu(u),this.recoveryParam=null,!0},"_importDER");function Ah(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(Ah,"constructLength");lu.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=Ub(t),n=Ub(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Ah(i,t.length),i=i.concat(t),i.push(2),Ah(i,n.length);var s=i.concat(n),a=[48];return Ah(a,s.length),a=a.concat(s),Mh.encode(a,e)},"toDER")});var zb=me((NN,jb)=>{"use strict";var Yo=Wn(),qb=Rb(),_7=Ir(),Th=cu(),E7=fh(),Hb=_7.assert,kh=Bb(),du=$b();function on(r){if(!(this instanceof on))return new on(r);typeof r=="string"&&(Hb(Object.prototype.hasOwnProperty.call(Th,r),"Unknown curve "+r),r=Th[r]),r instanceof Th.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");jb.exports=on;on.prototype.keyPair=o(function(e){return new kh(this,e)},"keyPair");on.prototype.keyFromPrivate=o(function(e,t){return kh.fromPrivate(this,e,t)},"keyFromPrivate");on.prototype.keyFromPublic=o(function(e,t){return kh.fromPublic(this,e,t)},"keyFromPublic");on.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new qb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||E7(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 qb({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new Yo(1)),m=0;;m++){var x=i.k?i.k(m):new Yo(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(p)>=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 du({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 du(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),p=f.mul(s).umod(this.n),m;return this.curve._maxwellTrick?(m=this.g.jmulAdd(u,n.getPublic(),p),m.isInfinity()?!1:m.eqXToP(s)):(m=this.g.mulAdd(u,n.getPublic(),p),m.isInfinity()?!1:m.getX().umod(this.n).cmp(s)===0)},"verify");on.prototype.recoverPubKey=function(r,e,t,n){Hb((3&t)===t,"The recovery param is more than two bits"),e=new du(e,n);var i=this.n,s=new Yo(r),a=e.r,f=e.s,u=t&1,p=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var m=e.r.invm(i),x=i.sub(s).mul(m).umod(i),k=f.mul(m).umod(i);return this.g.mulAdd(x,a,k)};on.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new du(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 Gb=me((RN,Wb)=>{"use strict";var yf=Ir(),Vb=yf.assert,Kb=yf.parseBytes,sa=yf.cachedProperty;function Kt(r,e){this.eddsa=r,this._secret=Kb(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Kb(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");sa(Kt,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));sa(Kt,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));sa(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"));sa(Kt,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));sa(Kt,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));sa(Kt,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Kt.prototype.sign=o(function(e){return Vb(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 Vb(this._secret,"KeyPair is public only"),yf.encode(this.secret(),e)},"getSecret");Kt.prototype.getPublic=o(function(e){return yf.encode(this.pubBytes(),e)},"getPublic");Wb.exports=Kt});var Jb=me((LN,Yb)=>{"use strict";var S7=Wn(),hu=Ir(),A7=hu.assert,pu=hu.cachedProperty,M7=hu.parseBytes;function Jo(r,e){this.eddsa=r,typeof e!="object"&&(e=M7(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),A7(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof S7&&(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");pu(Jo,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));pu(Jo,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));pu(Jo,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));pu(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 hu.encode(this.toBytes(),"hex").toUpperCase()},"toHex");Yb.exports=Jo});var tg=me((BN,eg)=>{"use strict";var T7=vf(),k7=cu(),aa=Ir(),C7=aa.assert,Zb=aa.parseBytes,Qb=Gb(),Xb=Jb();function Sr(r){if(C7(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sr))return new Sr(r);r=k7[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=T7.sha512}o(Sr,"EDDSA");eg.exports=Sr;Sr.prototype.sign=o(function(e,t){e=Zb(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=Zb(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 aa.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 Xb?e:new Xb(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=aa.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=aa.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 aa.intFromLE(e)},"decodeInt");Sr.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var ng=me(rg=>{"use strict";var Xo=rg;Xo.version=O1().version;Xo.utils=Ir();Xo.rand=fh();Xo.curve=lh();Xo.curves=cu();Xo.ec=zb();Xo.eddsa=tg()});var og=me(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var ig=65536,D7=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+=ig)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,ig)));return t},r}();Ch.BrowserRandomSource=D7});var sg=me(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var O7=tn(),I7=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 O7.wipe(t),n},r}();Dh.NodeRandomSource=I7});var ag=me(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var P7=og(),N7=sg(),R7=function(){function r(){if(this.isAvailable=!1,this.name="",this._source=new P7.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new N7.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}();Oh.SystemRandomSource=R7});var no=me(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var L7=ag(),B7=Ko(),fg=tn();Sn.defaultRandomSource=new L7.SystemRandomSource;function Ih(r,e){return e===void 0&&(e=Sn.defaultRandomSource),e.randomBytes(r)}o(Ih,"randomBytes");Sn.randomBytes=Ih;function U7(r){r===void 0&&(r=Sn.defaultRandomSource);var e=Ih(4,r),t=B7.readUint32LE(e);return fg.wipe(e),t}o(U7,"randomUint32");Sn.randomUint32=U7;var cg="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function ug(r,e,t){if(e===void 0&&(e=cg),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=Ih(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--)}fg.wipe(a)}return n}o(ug,"randomString");Sn.randomString=ug;function F7(r,e,t){e===void 0&&(e=cg),t===void 0&&(t=Sn.defaultRandomSource);var n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return ug(n,e,t)}o(F7,"randomStringForEntropy");Sn.randomStringForEntropy=F7});var hg=me(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var ca=Ko(),fa=tn();Si.DIGEST_LENGTH=64;Si.BLOCK_SIZE=128;var dg=function(){function r(){this.digestLength=Si.DIGEST_LENGTH,this.blockSize=Si.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(){fa.wipe(this._buffer),fa.wipe(this._tempHi),fa.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<Si.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Ph(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Ph(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;ca.writeUint32BE(i,this._buffer,a-8),ca.writeUint32BE(s,this._buffer,a-4),Ph(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/8;f++)ca.writeUint32BE(this._stateHi[f],e,f*8),ca.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){fa.wipe(e.stateHi),fa.wipe(e.stateLo),e.buffer&&fa.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Si.SHA512=dg;var lg=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 Ph(r,e,t,n,i,s,a){for(var f=t[0],u=t[1],p=t[2],m=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],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]=ca.readUint32BE(i,y),e[d]=ca.readUint32BE(i,y+4)}for(var d=0;d<80;d++){var _=f,w=u,b=p,S=m,D=x,v=k,A=I,ne=T,M=C,K=$,J=O,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&I,F=z&H^~z&X,l+=F&65535,g+=F>>>16,h+=L&65535,c+=L>>>16,L=lg[d*2],F=lg[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&p^u&p,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=_,p=w,m=b,x=S,k=D,I=v,T=A,f=ne,$=M,O=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=p,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]=p=h&65535|c<<16,n[2]=O=l&65535|g<<16,L=m,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]=m=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=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(Ph,"hashBlocks");function $7(r){var e=new dg;e.update(r);var t=e.digest();return e.clean(),t}o($7,"hash");Si.hash=$7});var mu=me($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var q7=no(),xf=hg(),vg=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 H7=new Uint8Array(32);H7[0]=9;var Lh=Ce(),ua=Ce([1]),j7=Ce([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),z7=Ce([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),pg=Ce([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),mg=Ce([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),K7=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 Nh(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(Nh,"car25519");function yg(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(yg,"sel25519");function wf(r,e){for(var t=Ce(),n=Ce(),i=0;i<16;i++)n[i]=e[i];Nh(n),Nh(n),Nh(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,yg(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(wf,"pack25519");function xg(r,e){for(var t=0,n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(xg,"verify32");function bg(r,e){var t=new Uint8Array(32),n=new Uint8Array(32);return wf(t,r),wf(n,e),xg(t,n)}o(bg,"neq25519");function wg(r){var e=new Uint8Array(32);return wf(e,r),e[0]&1}o(wg,"par25519");function V7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(V7,"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,p=0,m=0,x=0,k=0,I=0,T=0,C=0,$=0,O=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],A=t[3],ne=t[4],M=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*A,p+=n*ne,m+=n*M,x+=n*K,k+=n*J,I+=n*N,T+=n*R,C+=n*V,$+=n*W,O+=n*ee,U+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*S,f+=n*D,u+=n*v,p+=n*A,m+=n*ne,x+=n*M,k+=n*K,I+=n*J,T+=n*N,C+=n*R,$+=n*V,O+=n*W,U+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*S,u+=n*D,p+=n*v,m+=n*A,x+=n*ne,k+=n*M,I+=n*K,T+=n*J,C+=n*N,$+=n*R,O+=n*V,U+=n*W,z+=n*ee,H+=n*he,X+=n*fe,B+=n*Y,n=e[3],u+=n*S,p+=n*D,m+=n*v,x+=n*A,k+=n*ne,I+=n*M,T+=n*K,C+=n*J,$+=n*N,O+=n*R,U+=n*V,z+=n*W,H+=n*ee,X+=n*he,B+=n*fe,L+=n*Y,n=e[4],p+=n*S,m+=n*D,x+=n*v,k+=n*A,I+=n*ne,T+=n*M,C+=n*K,$+=n*J,O+=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],m+=n*S,x+=n*D,k+=n*v,I+=n*A,T+=n*ne,C+=n*M,$+=n*K,O+=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,I+=n*v,T+=n*A,C+=n*ne,$+=n*M,O+=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,I+=n*D,T+=n*v,C+=n*A,$+=n*ne,O+=n*M,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],I+=n*S,T+=n*D,C+=n*v,$+=n*A,O+=n*ne,U+=n*M,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,O+=n*A,U+=n*ne,z+=n*M,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*A,z+=n*ne,H+=n*M,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,z+=n*A,H+=n*ne,X+=n*M,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,z+=n*v,H+=n*A,X+=n*ne,B+=n*M,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*A,B+=n*ne,L+=n*M,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*A,L+=n*ne,F+=n*M,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*A,F+=n*ne,re+=n*M,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,p+=38*re,m+=38*E,x+=38*l,k+=38*g,I+=38*h,T+=38*c,C+=38*d,$+=38*y,O+=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=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=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=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=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]=p,r[5]=m,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]=z,r[15]=H}o(vt,"mul");function Qo(r,e){vt(r,e,e)}o(Qo,"square");function _g(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(_g,"inv25519");function W7(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(W7,"pow2523");function Bh(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce(),p=Ce(),m=Ce();es(t,r[1],r[0]),es(m,e[1],e[0]),vt(t,t,m),Zo(n,r[0],r[1]),Zo(m,e[0],e[1]),vt(n,n,m),vt(i,r[3],e[3]),vt(i,i,z7),vt(s,r[2],e[2]),Zo(s,s,s),es(a,n,t),es(f,s,i),Zo(u,s,i),Zo(p,n,t),vt(r[0],a,f),vt(r[1],p,u),vt(r[2],u,f),vt(r[3],a,p)}o(Bh,"edadd");function gg(r,e,t){for(var n=0;n<4;n++)yg(r[n],e[n],t)}o(gg,"cswap");function Fh(r,e){var t=Ce(),n=Ce(),i=Ce();_g(i,e[2]),vt(t,e[0],i),vt(n,e[1],i),wf(r,n),r[31]^=wg(t)<<7}o(Fh,"pack");function Eg(r,e,t){io(r[0],Lh),io(r[1],ua),io(r[2],ua),io(r[3],Lh);for(var n=255;n>=0;--n){var i=t[n/8|0]>>(n&7)&1;gg(r,e,i),Bh(e,r),Bh(r,r),gg(r,e,i)}}o(Eg,"scalarmult");function $h(r,e){var t=[Ce(),Ce(),Ce(),Ce()];io(t[0],pg),io(t[1],mg),io(t[2],ua),vt(t[3],pg,mg),Eg(r,t,e)}o($h,"scalarbase");function Sg(r){if(r.length!==$t.SEED_LENGTH)throw new Error("ed25519: seed must be "+$t.SEED_LENGTH+" bytes");var e=xf.hash(r);e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(32),n=[Ce(),Ce(),Ce(),Ce()];$h(n,e),Fh(t,n);var i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(Sg,"generateKeyPairFromSeed");$t.generateKeyPairFromSeed=Sg;function G7(r){var e=q7.randomBytes(32,r),t=Sg(e);return vg.wipe(e),t}o(G7,"generateKeyPair");$t.generateKeyPair=G7;function Y7(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(Y7,"extractPublicKeyFromSecretKey");$t.extractPublicKeyFromSecretKey=Y7;var Rh=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 Ag(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]*Rh[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)*Rh[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Rh[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(Ag,"modL");function Uh(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;Ag(r,e)}o(Uh,"reduce");function J7(r,e){var t=new Float64Array(64),n=[Ce(),Ce(),Ce(),Ce()],i=xf.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 xf.SHA512;a.update(s.subarray(32)),a.update(e);var f=a.digest();a.clean(),Uh(f),$h(n,f),Fh(s,n),a.reset(),a.update(s.subarray(0,32)),a.update(r.subarray(32)),a.update(e);var u=a.digest();Uh(u);for(var p=0;p<32;p++)t[p]=f[p];for(var p=0;p<32;p++)for(var m=0;m<32;m++)t[p+m]+=u[p]*i[m];return Ag(s.subarray(32),t),s}o(J7,"sign");$t.sign=J7;function Mg(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce();return io(r[2],ua),V7(r[1],e),Qo(i,r[1]),vt(s,i,j7),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),W7(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),bg(n,i)&&vt(r[0],r[0],K7),Qo(n,r[0]),vt(n,n,s),bg(n,i)?-1:(wg(r[0])===e[31]>>7&&es(r[0],Lh,r[0]),vt(r[3],r[0],r[1]),0)}o(Mg,"unpackneg");function X7(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(Mg(s,r))return!1;var a=new xf.SHA512;a.update(t.subarray(0,32)),a.update(r),a.update(e);var f=a.digest();return Uh(f),Eg(i,s,f),$h(s,t.subarray(32)),Bh(i,s),Fh(n,i),!xg(t,n)}o(X7,"verify");$t.verify=X7;function Z7(r){var e=[Ce(),Ce(),Ce(),Ce()];if(Mg(e,r))throw new Error("Ed25519: invalid public key");var t=Ce(),n=Ce(),i=e[1];Zo(t,ua,i),es(n,ua,i),_g(n,n),vt(t,t,n);var s=new Uint8Array(32);return wf(s,t),s}o(Z7,"convertPublicKeyToX25519");$t.convertPublicKeyToX25519=Z7;function Q7(r){var e=xf.hash(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(e.subarray(0,32));return vg.wipe(e),t}o(Q7,"convertSecretKeyToX25519");$t.convertSecretKeyToX25519=Q7});var kg=me((KN,Tg)=>{"use strict";Tg.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 Ig=me(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});var eE=no(),tE=tn();Ar.PUBLIC_KEY_LENGTH=32;Ar.SECRET_KEY_LENGTH=32;Ar.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 Cg=new Uint8Array(32);Cg[0]=9;var rE=ti([56129,1]);function qh(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(qh,"car25519");function _f(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(_f,"sel25519");function nE(r,e){for(var t=ti(),n=ti(),i=0;i<16;i++)n[i]=e[i];qh(n),qh(n),qh(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,_f(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(nE,"pack25519");function iE(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(iE,"unpack25519");function bu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(bu,"add");function gu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(gu,"sub");function Ai(r,e,t){var n,i,s=0,a=0,f=0,u=0,p=0,m=0,x=0,k=0,I=0,T=0,C=0,$=0,O=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],A=t[3],ne=t[4],M=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*A,p+=n*ne,m+=n*M,x+=n*K,k+=n*J,I+=n*N,T+=n*R,C+=n*V,$+=n*W,O+=n*ee,U+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*S,f+=n*D,u+=n*v,p+=n*A,m+=n*ne,x+=n*M,k+=n*K,I+=n*J,T+=n*N,C+=n*R,$+=n*V,O+=n*W,U+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*S,u+=n*D,p+=n*v,m+=n*A,x+=n*ne,k+=n*M,I+=n*K,T+=n*J,C+=n*N,$+=n*R,O+=n*V,U+=n*W,z+=n*ee,H+=n*he,X+=n*fe,B+=n*Y,n=e[3],u+=n*S,p+=n*D,m+=n*v,x+=n*A,k+=n*ne,I+=n*M,T+=n*K,C+=n*J,$+=n*N,O+=n*R,U+=n*V,z+=n*W,H+=n*ee,X+=n*he,B+=n*fe,L+=n*Y,n=e[4],p+=n*S,m+=n*D,x+=n*v,k+=n*A,I+=n*ne,T+=n*M,C+=n*K,$+=n*J,O+=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],m+=n*S,x+=n*D,k+=n*v,I+=n*A,T+=n*ne,C+=n*M,$+=n*K,O+=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,I+=n*v,T+=n*A,C+=n*ne,$+=n*M,O+=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,I+=n*D,T+=n*v,C+=n*A,$+=n*ne,O+=n*M,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],I+=n*S,T+=n*D,C+=n*v,$+=n*A,O+=n*ne,U+=n*M,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,O+=n*A,U+=n*ne,z+=n*M,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*A,z+=n*ne,H+=n*M,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,z+=n*A,H+=n*ne,X+=n*M,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,z+=n*v,H+=n*A,X+=n*ne,B+=n*M,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*A,B+=n*ne,L+=n*M,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*A,L+=n*ne,F+=n*M,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*A,F+=n*ne,re+=n*M,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,p+=38*re,m+=38*E,x+=38*l,k+=38*g,I+=38*h,T+=38*c,C+=38*d,$+=38*y,O+=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=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=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=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=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]=p,r[5]=m,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]=z,r[15]=H}o(Ai,"mul");function Ef(r,e){Ai(r,e,e)}o(Ef,"square");function oE(r,e){for(var t=ti(),n=0;n<16;n++)t[n]=e[n];for(var n=253;n>=0;n--)Ef(t,t),n!==2&&n!==4&&Ai(t,t,e);for(var n=0;n<16;n++)r[n]=t[n]}o(oE,"inv25519");function Hh(r,e){for(var t=new Uint8Array(32),n=new Float64Array(80),i=ti(),s=ti(),a=ti(),f=ti(),u=ti(),p=ti(),m=0;m<31;m++)t[m]=r[m];t[31]=r[31]&127|64,t[0]&=248,iE(n,e);for(var m=0;m<16;m++)s[m]=n[m];i[0]=f[0]=1;for(var m=254;m>=0;--m){var x=t[m>>>3]>>>(m&7)&1;_f(i,s,x),_f(a,f,x),bu(u,i,a),gu(i,i,a),bu(a,s,f),gu(s,s,f),Ef(f,u),Ef(p,i),Ai(i,a,i),Ai(a,s,u),bu(u,i,a),gu(i,i,a),Ef(s,i),gu(a,f,p),Ai(i,a,rE),bu(i,i,f),Ai(a,a,i),Ai(i,f,p),Ai(f,s,n),Ef(s,u),_f(i,s,x),_f(a,f,x)}for(var m=0;m<16;m++)n[m+16]=i[m],n[m+32]=a[m],n[m+48]=s[m],n[m+64]=f[m];var k=n.subarray(32),I=n.subarray(16);oE(k,k),Ai(I,I,k);var T=new Uint8Array(32);return nE(T,I),T}o(Hh,"scalarMult");Ar.scalarMult=Hh;function Dg(r){return Hh(r,Cg)}o(Dg,"scalarMultBase");Ar.scalarMultBase=Dg;function Og(r){if(r.length!==Ar.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+Ar.SECRET_KEY_LENGTH+" bytes");var e=new Uint8Array(r),t=Dg(e);return{publicKey:t,secretKey:e}}o(Og,"generateKeyPairFromSeed");Ar.generateKeyPairFromSeed=Og;function sE(r){var e=eE.randomBytes(32,r),t=Og(e);return tE.wipe(e),t}o(sE,"generateKeyPair");Ar.generateKeyPair=sE;function aE(r,e,t){if(t===void 0&&(t=!1),r.length!==Ar.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Ar.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var n=Hh(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(aE,"sharedKey");Ar.sharedKey=aE});var zh=me(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});var fr=Ko(),jh=tn(),fE=20;function cE(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],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=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],z=n,H=i,X=s,B=a,L=f,F=u,re=p,E=m,l=x,g=k,h=I,c=T,d=C,y=$,_=O,w=U,b=0;b<fE;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;fr.writeUint32LE(z+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+p|0,r,24),fr.writeUint32LE(E+m|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(cE,"core");function Pg(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){cE(f,s,r);for(var p=u;p<u+64&&p<t.length;p++)n[p]=t[p]^f[p-u];lE(s,0,a)}return jh.wipe(f),i===0&&jh.wipe(s),n}o(Pg,"streamXOR");vu.streamXOR=Pg;function uE(r,e,t,n){return n===void 0&&(n=0),jh.wipe(t),Pg(r,e,t,t,n)}o(uE,"stream");vu.stream=uE;function lE(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(lE,"incrementCounter")});var Bg=me(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var oo=Ko(),Ng=tn(),dE=zh(),hE=20;function Rg(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=Lg(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var a=dE.streamXOR(i,s,t,n);return Ng.wipe(i),a}o(Rg,"streamXOR");Sf.streamXOR=Rg;function pE(r,e,t){return Ng.wipe(t),Rg(r,e,t,t)}o(pE,"stream");Sf.stream=pE;function Lg(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],p=r[11]<<24|r[10]<<16|r[9]<<8|r[8],m=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],z=n,H=i,X=s,B=a,L=f,F=u,re=p,E=m,l=x,g=k,h=I,c=T,d=C,y=$,_=O,w=U,b=0;b<hE;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(Lg,"hchacha");Sf.hchacha=Lg});var Kh=me(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});function mE(r,e,t){return~(r-1)&e|r-1&t}o(mE,"select");la.select=mE;function bE(r,e){return(r|0)-(e|0)-1>>>31&1}o(bE,"lessOrEqual");la.lessOrEqual=bE;function Ug(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(Ug,"compare");la.compare=Ug;function gE(r,e){return r.length===0||e.length===0?!1:Ug(r,e)!==0}o(gE,"equal");la.equal=gE});var $g=me(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var vE=Kh(),yu=tn();Mi.DIGEST_LENGTH=16;var Fg=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 p=e[14]|e[15]<<8;this._r[8]=(u>>>8|p<<8)&8191,this._r[9]=p>>>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],p=this._h[4],m=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],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;p+=(g>>>4|h<<12)&8191,m+=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+=p*(5*X),_=w>>>13,w&=8191,w+=m*(5*H),w+=x*(5*z),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+=p*(5*B),_=b>>>13,b&=8191,b+=m*(5*X),b+=x*(5*H),b+=k*(5*z),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+=p*(5*L),_=S>>>13,S&=8191,S+=m*(5*B),S+=x*(5*X),S+=k*(5*H),S+=I*(5*z),S+=T*(5*U),_+=S>>>13,S&=8191;var D=_;D+=s*U,D+=a*O,D+=f*$,D+=u*C,D+=p*(5*F),_=D>>>13,D&=8191,D+=m*(5*L),D+=x*(5*B),D+=k*(5*X),D+=I*(5*H),D+=T*(5*z),_+=D>>>13,D&=8191;var v=_;v+=s*z,v+=a*U,v+=f*O,v+=u*$,v+=p*C,_=v>>>13,v&=8191,v+=m*(5*F),v+=x*(5*L),v+=k*(5*B),v+=I*(5*X),v+=T*(5*H),_+=v>>>13,v&=8191;var A=_;A+=s*H,A+=a*z,A+=f*U,A+=u*O,A+=p*$,_=A>>>13,A&=8191,A+=m*C,A+=x*(5*F),A+=k*(5*L),A+=I*(5*B),A+=T*(5*X),_+=A>>>13,A&=8191;var ne=_;ne+=s*X,ne+=a*H,ne+=f*z,ne+=u*U,ne+=p*O,_=ne>>>13,ne&=8191,ne+=m*$,ne+=x*C,ne+=k*(5*F),ne+=I*(5*L),ne+=T*(5*B),_+=ne>>>13,ne&=8191;var M=_;M+=s*B,M+=a*X,M+=f*H,M+=u*z,M+=p*U,_=M>>>13,M&=8191,M+=m*O,M+=x*$,M+=k*C,M+=I*(5*F),M+=T*(5*L),_+=M>>>13,M&=8191;var K=_;K+=s*L,K+=a*B,K+=f*X,K+=u*H,K+=p*z,_=K>>>13,K&=8191,K+=m*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+=p*H,_=J>>>13,J&=8191,J+=m*z,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,p=v,m=A,x=ne,k=M,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]=p,this._h[5]=m,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 yu.wipe(this._buffer),yu.wipe(this._r),yu.wipe(this._h),yu.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();Mi.Poly1305=Fg;function yE(r,e){var t=new Fg(r);t.update(e);var n=t.digest();return t.clean(),n}o(yE,"oneTimeAuth");Mi.oneTimeAuth=yE;function xE(r,e){return r.length!==Mi.DIGEST_LENGTH||e.length!==Mi.DIGEST_LENGTH?!1:vE.equal(r,e)}o(xE,"equal");Mi.equal=xE});var jg=me(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var xu=zh(),wE=$g(),Af=tn(),qg=Ko(),_E=Kh();Ti.KEY_LENGTH=32;Ti.NONCE_LENGTH=12;Ti.TAG_LENGTH=16;var Hg=new Uint8Array(16),EE=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,"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);xu.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 xu.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),Af.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);xu.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),!_E.equal(f,t.subarray(t.length-this.tagLength,t.length)))return null;var u=t.length-this.tagLength,p;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");p=i}else p=new Uint8Array(u);return xu.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),p,4),Af.wipe(s),p},r.prototype.clean=function(){return Af.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new wE.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(Hg.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(Hg.subarray(n.length%16));var a=new Uint8Array(8);i&&qg.writeUint64LE(i.length,a),s.update(a),qg.writeUint64LE(n.length,a),s.update(a);for(var f=s.digest(),u=0;u<f.length;u++)e[u]=f[u];s.clean(),Af.wipe(f),Af.wipe(a)},r}();Ti.ChaCha20Poly1305=EE});var Vg=me(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});var zg=Bg(),Kg=jg(),Mf=tn();ki.KEY_LENGTH=32;ki.NONCE_LENGTH=24;ki.TAG_LENGTH=16;var SE=function(){function r(e){if(this.nonceLength=ki.NONCE_LENGTH,this.tagLength=ki.TAG_LENGTH,e.length!==ki.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=zg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Kg.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=zg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Kg.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}();ki.XChaCha20Poly1305=SE});var Tn=me((ML,N2)=>{N2.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 Lf=me((TL,R2)=>{R2.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 U2=me(tr=>{var L2=tr,Fu=4294967292,$u=4294967293,g0=4294967294,B2=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"],zS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Br=[];zS.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 $u;let $=((T&xe[5])<<6)+(C&xe[6]);return $<128?Fu:$}o(t,"bytes2");function n(T,C,$){if(($&192)!==128||(C&192)!==128)return $u;let O=((T&xe[4])<<12)+((C&xe[6])<<6)+($&xe[6]);return O<2048?Fu:O>=55296&&O<=57343?g0:O}o(n,"bytes3");function i(T,C,$,O){if((O&192)!==128||($&192)!==128||(C&192)!==128)return $u;let U=(((T&xe[3])<<2)+(C>>4&xe[2])<<16)+((C&xe[4])<<12)+(($&xe[6])<<6)+(O&xe[6]);return U<65536?Fu:U>1114111?g0:U}o(i,"bytes4");let s,a,f,u,p,m,x=r.length,k=e?3:0,I=[];for(;k<x;){a=r[k],s=B2;let T=!0;for(;T;){if(a>=0&&a<=127){s=a,m=1;break}if(f=k+1,f<x&&a>=194&&a<=223){s=t(a,r[f]),m=2;break}if(u=k+2,u<x&&a>=224&&a<=239){s=n(a,r[f],r[u]),m=3;break}if(p=k+3,p<x&&a>=240&&a<=244){s=i(a,r[f],r[u],r[p]),m=4;break}break}if(s>1114111){let C=`byte[${k}]`;throw s===B2?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${C}`):s===$u?new RangeError(`utf8.decode: illegal trailing byte found at: ${C}`):s===g0?new RangeError(`utf8.decode: code point out of range found at: ${C}`):s===Fu?new RangeError(`utf8.decode: non-shortest form found at: ${C}`):new RangeError(`utf8.decode: unrecognized error found at: ${C}`)}I.push(s),k+=m}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,p,m,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(m=(r[i]<<8)+r[u],m<55296||m>57343){a=m,f=2;break}if(p=i+3,p<n&&(x=(r[i+2]<<8)+r[p],m<=56319&&x>=56320&&x<=57343)){a=65536+(m-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,p,m,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(m=(r[u]<<8)+r[i],m<55296||m>57343){a=m,f=2;break}if(p=i+3,p<n&&(x=(r[p]<<8)+r[i+2],m<=56319&&x>=56320&&x<=57343)){a=65536+(m-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 L2.utf16le.encode(r).toString("utf16le")},decode(r){return L2.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,p,m=0;for(;m<a;){for(;;){if(p=!0,r[m]!==96){s.push(r[m]),m+=1,p=!1;break}if(f=m+1,f>=a)break;if(r[f]===96){s.push(96),m+=2,p=!1;break}if(r[f]===120){if(u=t(f+1,a,r),u.error)break;s.push(u.char),m=u.nexti,p=!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),m=u.nexti,p=!1;break}if(u=n(f+1,a,r),u.error)break;s.push(u.char),m=u.nexti,p=!1;break}break}if(p)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${m}]`)}return s}};var Bf=13,cn=10;tr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Bf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(Bf),e.push(cn);break;case cn:e.push(Bf),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(Bf),e.push(cn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Bf: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(m){let x=[],k=0;for(let I=0;I<m.length;I+=1){let T=m[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,p=Buffer.alloc(u*3-n);n>0&&(u-=1),a=0,s=0;for(let m=0;m<u;m+=1)f=i[s++]<<18,f+=i[s++]<<12,f+=i[s++]<<6,f+=i[s++],p[a++]=f>>16&xe[8],p[a++]=f>>8&xe[8],p[a++]=f&xe[8];return n===1&&(f=i[s++]<<18,f+=i[s++]<<12,f+=i[s]<<6,p[a++]=f>>16&xe[8],p[a]=f>>8&xe[8]),n===2&&(f=i[s++]<<18,f+=i[s++]<<12,p[a]=f>>16&xe[8]),p},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 Vd=gt(()=>{Vn();Fc();Vi();$d();jo()});var v1={};St(v1,{CID:()=>Pe,bases:()=>Js,bytes:()=>sf,codecs:()=>n_,digest:()=>Ho,hasher:()=>qc,hashes:()=>r_,varint:()=>Ys});var Js,r_,n_,Kc=gt(()=>{Qm();e1();t1();r1();n1();Id();Uc();Nd();Ld();s1();uf();jd();p1();m1();Vd();Js=ie(ie(ie(ie(ie(ie(ie(ie(ie(ie({},Md),Ad),Td),kd),Cd),Dd),Od),Pd),Rd),Bd),r_=ie(ie({},qd),Hd),n_={raw:zd,json:Kd}});function x1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var y1,Wd,i_,Vc,Gd=gt(()=>{Kc();o(x1,"createCodec");y1=x1("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Wd=x1("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}),i_=ie({utf8:y1,"utf-8":y1,hex:Js.base16,latin1:Wd,ascii:Wd,binary:Wd},Js),Vc=i_});var w1={};St(w1,{fromString:()=>Lt});function Lt(r,e="utf8"){let t=Vc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var Wc=gt(()=>{Gd();o(Lt,"fromString")});var _1={};St(_1,{toString:()=>It});function It(r,e="utf8"){let t=Vc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var df=gt(()=>{Gd();o(It,"toString")});var E1=me(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});function o_(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(o_,"imulShim");Ir.mul=Math.imul||o_;function s_(r,e){return r+e|0}o(s_,"add");Ir.add=s_;function a_(r,e){return r-e|0}o(a_,"sub");Ir.sub=a_;function f_(r,e){return r<<e|r>>>32-e}o(f_,"rotl");Ir.rotl=f_;function c_(r,e){return r<<32-e|r>>>e}o(c_,"rotr");Ir.rotr=c_;function u_(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(u_,"isIntegerShim");Ir.isInteger=Number.isInteger||u_;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 S1=E1();function l_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(l_,"readInt16BE");it.readInt16BE=l_;function d_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(d_,"readUint16BE");it.readUint16BE=d_;function h_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(h_,"readInt16LE");it.readInt16LE=h_;function p_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(p_,"readUint16LE");it.readUint16LE=p_;function M1(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(M1,"writeUint16BE");it.writeUint16BE=M1;it.writeInt16BE=M1;function A1(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(A1,"writeUint16LE");it.writeUint16LE=A1;it.writeInt16LE=A1;function Yd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Yd,"readInt32BE");it.readInt32BE=Yd;function Jd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Jd,"readUint32BE");it.readUint32BE=Jd;function Xd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Xd,"readInt32LE");it.readInt32LE=Xd;function Zd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(Zd,"readUint32LE");it.readUint32LE=Zd;function Yc(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(Yc,"writeUint32BE");it.writeUint32BE=Yc;it.writeInt32BE=Yc;function Jc(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(Jc,"writeUint32LE");it.writeUint32LE=Jc;it.writeInt32LE=Jc;function m_(r,e){e===void 0&&(e=0);var t=Yd(r,e),n=Yd(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(m_,"readInt64BE");it.readInt64BE=m_;function b_(r,e){e===void 0&&(e=0);var t=Jd(r,e),n=Jd(r,e+4);return t*4294967296+n}o(b_,"readUint64BE");it.readUint64BE=b_;function g_(r,e){e===void 0&&(e=0);var t=Xd(r,e),n=Xd(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(g_,"readInt64LE");it.readInt64LE=g_;function v_(r,e){e===void 0&&(e=0);var t=Zd(r,e),n=Zd(r,e+4);return n*4294967296+t}o(v_,"readUint64LE");it.readUint64LE=v_;function T1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Yc(r/4294967296>>>0,e,t),Yc(r>>>0,e,t+4),e}o(T1,"writeUint64BE");it.writeUint64BE=T1;it.writeInt64BE=T1;function k1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Jc(r>>>0,e,t),Jc(r/4294967296>>>0,e,t+4),e}o(k1,"writeUint64LE");it.writeUint64LE=k1;it.writeInt64LE=k1;function y_(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(y_,"readUintBE");it.readUintBE=y_;function x_(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(x_,"readUintLE");it.readUintLE=x_;function w_(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(!S1.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(w_,"writeUintBE");it.writeUintBE=w_;function __(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(!S1.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(__,"writeUintLE");it.writeUintLE=__;function E_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(E_,"readFloat32BE");it.readFloat32BE=E_;function S_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(S_,"readFloat32LE");it.readFloat32LE=S_;function M_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(M_,"readFloat64BE");it.readFloat64BE=M_;function A_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(A_,"readFloat64LE");it.readFloat64LE=A_;function T_(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(T_,"writeFloat32BE");it.writeFloat32BE=T_;function k_(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(k_,"writeFloat32LE");it.writeFloat32LE=k_;function C_(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(C_,"writeFloat64BE");it.writeFloat64BE=C_;function D_(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(D_,"writeFloat64LE");it.writeFloat64LE=D_});var tn=me(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});function I_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(I_,"wipe");Qd.wipe=I_});var D1=me(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Zc=Ko(),Xc=tn();Yi.DIGEST_LENGTH=32;Yi.BLOCK_SIZE=64;var C1=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(){Xc.wipe(this._buffer),Xc.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&&(eh(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=eh(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;Zc.writeUint32BE(i,this._buffer,a-8),Zc.writeUint32BE(s,this._buffer,a-4),eh(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/4;f++)Zc.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){Xc.wipe(e.state),e.buffer&&Xc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Yi.SHA256=C1;var O_=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 eh(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]=Zc.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+(O_[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(eh,"hashBlocks");function P_(r){var e=new C1;e.update(r);var t=e.digest();return e.clean(),t}o(P_,"hash");Yi.hash=P_});var th=me((iN,Qc)=>{(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 Qc=="object"&&Qc.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<,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)Qc.exports=c;else{for(y=0;y<d.length;++y)n[d[y]]=c[d[y]];f&&define(function(){return c})}})()});var I1=me((oN,N_)=>{N_.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 rh=me(()=>{});var Wn=me((O1,nh)=>{(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=rh().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 nh=="undefined"||nh,O1)});var Ji=me((fN,N1)=>{N1.exports=P1;function P1(r,e){if(!r)throw new Error(e||"Assertion failed")}o(P1,"assert");P1.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var ih=me(B1=>{"use strict";var eu=B1;function R_(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(R_,"toArray");eu.toArray=R_;function R1(r){return r.length===1?"0"+r:r}o(R1,"zero2");eu.zero2=R1;function L1(r){for(var e="",t=0;t<r.length;t++)e+=R1(r[t].toString(16));return e}o(L1,"toHex");eu.toHex=L1;eu.encode=o(function(e,t){return t==="hex"?L1(e):e},"encode")});var Or=me(U1=>{"use strict";var xn=U1,L_=Wn(),B_=Ji(),tu=ih();xn.assert=B_;xn.toArray=tu.toArray;xn.zero2=tu.zero2;xn.toHex=tu.toHex;xn.encode=tu.encode;function U_(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(U_,"getNAF");xn.getNAF=U_;function F_(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(F_,"getJSF");xn.getJSF=F_;function $_(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($_,"cachedProperty");xn.cachedProperty=$_;function q_(r){return typeof r=="string"?xn.toArray(r,"hex"):r}o(q_,"parseBytes");xn.parseBytes=q_;function H_(r){return new L_(r,"hex","le")}o(H_,"intFromLE");xn.intFromLE=H_});var fh=me((lN,ah)=>{var oh;ah.exports=o(function(e){return oh||(oh=new Xi(null)),oh.generate(e)},"rand");function Xi(r){this.rand=r}o(Xi,"Rand");ah.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(sh=require("crypto"),typeof sh.randomBytes!="function")throw new Error("Not supported");Xi.prototype._rand=o(function(e){return sh.randomBytes(e)},"_rand")}catch(r){}var sh});var pf=me((dN,F1)=>{"use strict";var Vo=Wn(),hf=Or(),ru=hf.getNAF,j_=hf.getJSF,nu=hf.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");F1.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){nu(e.precomputed);var n=e._getDoubles(),i=ru(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=ru(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];nu(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]=ru(n[T],a[T],this._bitLength),u[C]=ru(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=j_(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=hf.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?nu(e[e.length-1]%2===0):e[0]===7&&nu(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 hf.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 mf=me((hN,ch)=>{typeof Object.create=="function"?ch.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"):ch.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 q1=me((pN,$1)=>{"use strict";var z_=Or(),Ot=Wn(),uh=mf(),Xs=pf(),K_=z_.assert;function nn(r){Xs.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");uh(nn,Xs);$1.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],K_(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){Xs.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");uh(jt,Xs.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 Zt(r,e,t,n){Xs.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(Zt,"JPoint");uh(Zt,Xs.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),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");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),O=u.redMul(x.redISub(k)).redISub(s.redMul(p)),T=this.z.redMul(f);return this.curve.jpoint(k,O,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(),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");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(),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");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(),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");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),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");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 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");Zt.prototype.mul=o(function(e,t){return e=new Ot(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 z1=me((mN,j1)=>{"use strict";var Zs=Wn(),H1=mf(),iu=pf(),V_=Or();function Qs(r){iu.call(this,"mont",r),this.a=new Zs(r.a,16).toRed(this.red),this.b=new Zs(r.b,16).toRed(this.red),this.i4=new Zs(4).toRed(this.red).redInvm(),this.two=new Zs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Qs,"MontCurve");H1(Qs,iu);j1.exports=Qs;Qs.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){iu.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zs(e,16),this.z=new Zs(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");H1(zt,iu.BasePoint);Qs.prototype.decodePoint=o(function(e,t){return this.point(V_.toArray(e,t),1)},"decodePoint");Qs.prototype.point=o(function(e,t){return new zt(this,e,t)},"point");Qs.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 W1=me((bN,V1)=>{"use strict";var W_=Or(),xi=Wn(),K1=mf(),ou=pf(),G_=W_.assert;function Gn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,ou.call(this,"edwards",r),this.a=new xi(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new xi(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new xi(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),G_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(Gn,"EdwardsCurve");K1(Gn,ou);V1.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 xi(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 xi(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){ou.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 xi(e,16),this.y=new xi(t,16),this.z=n?new xi(n,16):this.curve.one,this.t=i&&new xi(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");K1(Mt,ou.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 lh=me(G1=>{"use strict";var su=G1;su.base=pf();su.short=q1();su.mont=z1();su.edwards=W1()});var wn=me(wt=>{"use strict";var Y_=Ji(),J_=mf();wt.inherits=J_;function X_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(X_,"isSurrogatePair");function Z_(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):X_(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(Z_,"toArray");wt.toArray=Z_;function Q_(r){for(var e="",t=0;t<r.length;t++)e+=J1(r[t].toString(16));return e}o(Q_,"toHex");wt.toHex=Q_;function Y1(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(Y1,"htonl");wt.htonl=Y1;function e9(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=Y1(i)),t+=X1(i.toString(16))}return t}o(e9,"toHex32");wt.toHex32=e9;function J1(r){return r.length===1?"0"+r:r}o(J1,"zero2");wt.zero2=J1;function X1(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(X1,"zero8");wt.zero8=X1;function t9(r,e,t,n){var i=t-e;Y_(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(t9,"join32");wt.join32=t9;function r9(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(r9,"split32");wt.split32=r9;function n9(r,e){return r>>>e|r<<32-e}o(n9,"rotr32");wt.rotr32=n9;function i9(r,e){return r<<e|r>>>32-e}o(i9,"rotl32");wt.rotl32=i9;function o9(r,e){return r+e>>>0}o(o9,"sum32");wt.sum32=o9;function s9(r,e,t){return r+e+t>>>0}o(s9,"sum32_3");wt.sum32_3=s9;function a9(r,e,t,n){return r+e+t+n>>>0}o(a9,"sum32_4");wt.sum32_4=a9;function f9(r,e,t,n,i){return r+e+t+n+i>>>0}o(f9,"sum32_5");wt.sum32_5=f9;function c9(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(c9,"sum64");wt.sum64=c9;function u9(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(u9,"sum64_hi");wt.sum64_hi=u9;function l9(r,e,t,n){var i=e+n;return i>>>0}o(l9,"sum64_lo");wt.sum64_lo=l9;function d9(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(d9,"sum64_4_hi");wt.sum64_4_hi=d9;function h9(r,e,t,n,i,s,a,f){var u=e+n+s+f;return u>>>0}o(h9,"sum64_4_lo");wt.sum64_4_lo=h9;function p9(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(p9,"sum64_5_hi");wt.sum64_5_hi=p9;function m9(r,e,t,n,i,s,a,f,u,m){var p=e+n+s+f+m;return p>>>0}o(m9,"sum64_5_lo");wt.sum64_5_lo=m9;function b9(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(b9,"rotr64_hi");wt.rotr64_hi=b9;function g9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(g9,"rotr64_lo");wt.rotr64_lo=g9;function v9(r,e,t){return r>>>t}o(v9,"shr64_hi");wt.shr64_hi=v9;function y9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(y9,"shr64_lo");wt.shr64_lo=y9});var ea=me(Q1=>{"use strict";var Z1=wn(),x9=Ji();function au(){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(au,"BlockHash");Q1.BlockHash=au;au.prototype.update=o(function(e,t){if(e=Z1.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=Z1.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");au.prototype.digest=o(function(e){return this.update(this._pad()),x9(this.pending===null),this._digest(e)},"digest");au.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 dh=me(wi=>{"use strict";var w9=wn(),Yn=w9.rotr32;function _9(r,e,t,n){if(r===0)return eb(e,t,n);if(r===1||r===3)return rb(e,t,n);if(r===2)return tb(e,t,n)}o(_9,"ft_1");wi.ft_1=_9;function eb(r,e,t){return r&e^~r&t}o(eb,"ch32");wi.ch32=eb;function tb(r,e,t){return r&e^r&t^e&t}o(tb,"maj32");wi.maj32=tb;function rb(r,e,t){return r^e^t}o(rb,"p32");wi.p32=rb;function E9(r){return Yn(r,2)^Yn(r,13)^Yn(r,22)}o(E9,"s0_256");wi.s0_256=E9;function S9(r){return Yn(r,6)^Yn(r,11)^Yn(r,25)}o(S9,"s1_256");wi.s1_256=S9;function M9(r){return Yn(r,7)^Yn(r,18)^r>>>3}o(M9,"g0_256");wi.g0_256=M9;function A9(r){return Yn(r,17)^Yn(r,19)^r>>>10}o(A9,"g1_256");wi.g1_256=A9});var ob=me((wN,ib)=>{"use strict";var ta=wn(),T9=ea(),k9=dh(),hh=ta.rotl32,bf=ta.sum32,C9=ta.sum32_5,D9=k9.ft_1,nb=T9.BlockHash,I9=[1518500249,1859775393,2400959708,3395469782];function Jn(){if(!(this instanceof Jn))return new Jn;nb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(Jn,"SHA1");ta.inherits(Jn,nb);ib.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]=hh(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=C9(hh(s,5),D9(p,a,f,u),m,n[i],I9[p]);m=u,u=f,f=hh(a,30),a=s,s=x}this.h[0]=bf(this.h[0],s),this.h[1]=bf(this.h[1],a),this.h[2]=bf(this.h[2],f),this.h[3]=bf(this.h[3],u),this.h[4]=bf(this.h[4],m)},"_update");Jn.prototype._digest=o(function(e){return e==="hex"?ta.toHex32(this.h,"big"):ta.split32(this.h,"big")},"digest")});var ph=me((_N,ab)=>{"use strict";var ra=wn(),O9=ea(),na=dh(),P9=Ji(),_n=ra.sum32,N9=ra.sum32_4,R9=ra.sum32_5,L9=na.ch32,B9=na.maj32,U9=na.s0_256,F9=na.s1_256,$9=na.g0_256,q9=na.g1_256,sb=O9.BlockHash,H9=[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;sb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=H9,this.W=new Array(64)}o(Xn,"SHA256");ra.inherits(Xn,sb);ab.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]=N9(q9(n[i-2]),n[i-7],$9(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(P9(this.k.length===n.length),i=0;i<n.length;i++){var O=R9(k,F9(m),L9(m,p,x),this.k[i],n[i]),T=_n(U9(s),B9(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"?ra.toHex32(this.h,"big"):ra.split32(this.h,"big")},"digest")});var ub=me((EN,cb)=>{"use strict";var mh=wn(),fb=ph();function _i(){if(!(this instanceof _i))return new _i;fb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(_i,"SHA224");mh.inherits(_i,fb);cb.exports=_i;_i.blockSize=512;_i.outSize=224;_i.hmacStrength=192;_i.padLength=64;_i.prototype._digest=o(function(e){return e==="hex"?mh.toHex32(this.h.slice(0,7),"big"):mh.split32(this.h.slice(0,7),"big")},"digest")});var vh=me((SN,pb)=>{"use strict";var Er=wn(),j9=ea(),z9=Ji(),Zn=Er.rotr64_hi,Qn=Er.rotr64_lo,lb=Er.shr64_hi,db=Er.shr64_lo,Qi=Er.sum64,bh=Er.sum64_hi,gh=Er.sum64_lo,K9=Er.sum64_4_hi,V9=Er.sum64_4_lo,W9=Er.sum64_5_hi,G9=Er.sum64_5_lo,hb=j9.BlockHash,Y9=[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;hb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Y9,this.W=new Array(160)}o(En,"SHA512");Er.inherits(En,hb);pb.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=sE(n[i-4],n[i-3]),a=aE(n[i-4],n[i-3]),f=n[i-14],u=n[i-13],m=iE(n[i-30],n[i-29]),p=oE(n[i-30],n[i-29]),x=n[i-32],k=n[i-31];n[i]=K9(s,a,f,u,m,p,x,k),n[i+1]=V9(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];z9(this.k.length===n.length);for(var H=0;H<n.length;H+=2){var X=U,B=z,L=rE(k,O),F=nE(k,O),re=J9(k,O,T,C,$,I),E=X9(k,O,T,C,$,I),l=this.k[H],g=this.k[H+1],h=n[H],c=n[H+1],d=W9(X,B,L,F,re,E,l,g,h,c),y=G9(X,B,L,F,re,E,l,g,h,c);X=eE(i,s),B=tE(i,s),L=Z9(i,s,a,f,u,m),F=Q9(i,s,a,f,u,m);var _=bh(X,B,L,F),w=gh(X,B,L,F);U=$,z=I,$=T,I=C,T=k,C=O,k=bh(p,x,d,y),O=gh(x,x,d,y),p=u,x=m,u=a,m=f,a=i,f=s,i=bh(d,y,_,w),s=gh(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"?Er.toHex32(this.h,"big"):Er.split32(this.h,"big")},"digest");function J9(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(J9,"ch64_hi");function X9(r,e,t,n,i,s){var a=e&n^~e&s;return a<0&&(a+=4294967296),a}o(X9,"ch64_lo");function Z9(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(Z9,"maj64_hi");function Q9(r,e,t,n,i,s){var a=e&n^e&s^n&s;return a<0&&(a+=4294967296),a}o(Q9,"maj64_lo");function eE(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(eE,"s0_512_hi");function tE(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(tE,"s0_512_lo");function rE(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(rE,"s1_512_hi");function nE(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(nE,"s1_512_lo");function iE(r,e){var t=Zn(r,e,1),n=Zn(r,e,8),i=lb(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(iE,"g0_512_hi");function oE(r,e){var t=Qn(r,e,1),n=Qn(r,e,8),i=db(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(oE,"g0_512_lo");function sE(r,e){var t=Zn(r,e,19),n=Zn(e,r,29),i=lb(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(sE,"g1_512_hi");function aE(r,e){var t=Qn(r,e,19),n=Qn(e,r,29),i=db(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(aE,"g1_512_lo")});var gb=me((MN,bb)=>{"use strict";var yh=wn(),mb=vh();function Ei(){if(!(this instanceof Ei))return new Ei;mb.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(Ei,"SHA384");yh.inherits(Ei,mb);bb.exports=Ei;Ei.blockSize=1024;Ei.outSize=384;Ei.hmacStrength=192;Ei.padLength=128;Ei.prototype._digest=o(function(e){return e==="hex"?yh.toHex32(this.h.slice(0,12),"big"):yh.split32(this.h.slice(0,12),"big")},"digest")});var vb=me(ia=>{"use strict";ia.sha1=ob();ia.sha224=ub();ia.sha256=ph();ia.sha384=gb();ia.sha512=vh()});var Sb=me(Eb=>{"use strict";var Wo=wn(),fE=ea(),fu=Wo.rotl32,yb=Wo.sum32,gf=Wo.sum32_3,xb=Wo.sum32_4,_b=fE.BlockHash;function ei(){if(!(this instanceof ei))return new ei;_b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(ei,"RIPEMD160");Wo.inherits(ei,_b);Eb.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=yb(fu(xb(n,wb(O,i,s,a),e[lE[O]+t],cE(O)),hE[O]),f);n=f,f=a,a=fu(s,10),s=i,i=T,T=yb(fu(xb(u,wb(79-O,m,p,x),e[dE[O]+t],uE(O)),pE[O]),k),u=k,k=x,x=fu(p,10),p=m,m=T}T=gf(this.h[1],s,x),this.h[1]=gf(this.h[2],a,k),this.h[2]=gf(this.h[3],f,u),this.h[3]=gf(this.h[4],n,m),this.h[4]=gf(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 wb(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(wb,"f");function cE(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(cE,"K");function uE(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(uE,"Kh");var lE=[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],dE=[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],hE=[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],pE=[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 Ab=me((kN,Mb)=>{"use strict";var mE=wn(),bE=Ji();function oa(r,e,t){if(!(this instanceof oa))return new oa(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(mE.toArray(e,t))}o(oa,"Hmac");Mb.exports=oa;oa.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),bE(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");oa.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");oa.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var vf=me(Tb=>{var Qt=Tb;Qt.utils=wn();Qt.common=ea();Qt.sha=vb();Qt.ripemd=Sb();Qt.hmac=Ab();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 Cb=me((DN,kb)=>{kb.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 cu=me(Ob=>{"use strict";var wh=Ob,eo=vf(),xh=lh(),gE=Or(),Db=gE.assert;function Ib(r){r.type==="short"?this.curve=new xh.short(r):r.type==="edwards"?this.curve=new xh.edwards(r):this.curve=new xh.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,Db(this.g.validate(),"Invalid curve"),Db(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(Ib,"PresetCurve");wh.PresetCurve=Ib;function to(r,e){Object.defineProperty(wh,r,{configurable:!0,enumerable:!0,get:function(){var t=new Ib(e);return Object.defineProperty(wh,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 _h;try{_h=Cb()}catch(r){_h=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",_h]})});var Rb=me((ON,Nb)=>{"use strict";var vE=vf(),Go=ih(),Pb=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");Pb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ro,"HmacDRBG");Nb.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 vE.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),Pb(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 Bb=me((PN,Lb)=>{"use strict";var yE=Wn(),xE=Or(),Eh=xE.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");Lb.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 yE(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"?Eh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Eh(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()||Eh(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 $b=me((NN,Fb)=>{"use strict";var uu=Wn(),Ah=Or(),wE=Ah.assert;function lu(r,e){if(r instanceof lu)return r;this._importDER(r,e)||(wE(r.r&&r.s,"Signature without r or s"),this.r=new uu(r.r,16),this.s=new uu(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(lu,"Signature");Fb.exports=lu;function _E(){this.place=0}o(_E,"Position");function Sh(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(Sh,"getLength");function Ub(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(Ub,"rmPadding");lu.prototype._importDER=o(function(e,t){e=Ah.toArray(e,t);var n=new _E;if(e[n.place++]!==48)return!1;var i=Sh(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Sh(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=Sh(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 uu(a),this.s=new uu(u),this.recoveryParam=null,!0},"_importDER");function Mh(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(Mh,"constructLength");lu.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=Ub(t),n=Ub(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Mh(i,t.length),i=i.concat(t),i.push(2),Mh(i,n.length);var s=i.concat(n),a=[48];return Mh(a,s.length),a=a.concat(s),Ah.encode(a,e)},"toDER")});var zb=me((RN,jb)=>{"use strict";var Yo=Wn(),qb=Rb(),EE=Or(),Th=cu(),SE=fh(),Hb=EE.assert,kh=Bb(),du=$b();function on(r){if(!(this instanceof on))return new on(r);typeof r=="string"&&(Hb(Object.prototype.hasOwnProperty.call(Th,r),"Unknown curve "+r),r=Th[r]),r instanceof Th.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");jb.exports=on;on.prototype.keyPair=o(function(e){return new kh(this,e)},"keyPair");on.prototype.keyFromPrivate=o(function(e,t){return kh.fromPrivate(this,e,t)},"keyFromPrivate");on.prototype.keyFromPublic=o(function(e,t){return kh.fromPublic(this,e,t)},"keyFromPublic");on.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new qb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||SE(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 qb({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 du({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 du(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){Hb((3&t)===t,"The recovery param is more than two bits"),e=new du(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 du(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 Gb=me((LN,Wb)=>{"use strict";var yf=Or(),Vb=yf.assert,Kb=yf.parseBytes,sa=yf.cachedProperty;function Kt(r,e){this.eddsa=r,this._secret=Kb(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Kb(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");sa(Kt,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));sa(Kt,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));sa(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"));sa(Kt,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));sa(Kt,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));sa(Kt,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Kt.prototype.sign=o(function(e){return Vb(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 Vb(this._secret,"KeyPair is public only"),yf.encode(this.secret(),e)},"getSecret");Kt.prototype.getPublic=o(function(e){return yf.encode(this.pubBytes(),e)},"getPublic");Wb.exports=Kt});var Jb=me((BN,Yb)=>{"use strict";var ME=Wn(),hu=Or(),AE=hu.assert,pu=hu.cachedProperty,TE=hu.parseBytes;function Jo(r,e){this.eddsa=r,typeof e!="object"&&(e=TE(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),AE(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof ME&&(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");pu(Jo,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));pu(Jo,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));pu(Jo,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));pu(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 hu.encode(this.toBytes(),"hex").toUpperCase()},"toHex");Yb.exports=Jo});var tg=me((UN,eg)=>{"use strict";var kE=vf(),CE=cu(),aa=Or(),DE=aa.assert,Zb=aa.parseBytes,Qb=Gb(),Xb=Jb();function Sr(r){if(DE(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sr))return new Sr(r);r=CE[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=kE.sha512}o(Sr,"EDDSA");eg.exports=Sr;Sr.prototype.sign=o(function(e,t){e=Zb(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=Zb(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 aa.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 Xb?e:new Xb(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=aa.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=aa.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 aa.intFromLE(e)},"decodeInt");Sr.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var ng=me(rg=>{"use strict";var Xo=rg;Xo.version=I1().version;Xo.utils=Or();Xo.rand=fh();Xo.curve=lh();Xo.curves=cu();Xo.ec=zb();Xo.eddsa=tg()});var og=me(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var ig=65536,IE=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+=ig)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,ig)));return t},r}();Ch.BrowserRandomSource=IE});var sg=me(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var OE=tn(),PE=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 OE.wipe(t),n},r}();Dh.NodeRandomSource=PE});var ag=me(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});var NE=og(),RE=sg(),LE=function(){function r(){if(this.isAvailable=!1,this.name="",this._source=new NE.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new RE.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}();Ih.SystemRandomSource=LE});var no=me(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var BE=ag(),UE=Ko(),fg=tn();Sn.defaultRandomSource=new BE.SystemRandomSource;function Oh(r,e){return e===void 0&&(e=Sn.defaultRandomSource),e.randomBytes(r)}o(Oh,"randomBytes");Sn.randomBytes=Oh;function FE(r){r===void 0&&(r=Sn.defaultRandomSource);var e=Oh(4,r),t=UE.readUint32LE(e);return fg.wipe(e),t}o(FE,"randomUint32");Sn.randomUint32=FE;var cg="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function ug(r,e,t){if(e===void 0&&(e=cg),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=Oh(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--)}fg.wipe(a)}return n}o(ug,"randomString");Sn.randomString=ug;function $E(r,e,t){e===void 0&&(e=cg),t===void 0&&(t=Sn.defaultRandomSource);var n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return ug(n,e,t)}o($E,"randomStringForEntropy");Sn.randomStringForEntropy=$E});var hg=me(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var ca=Ko(),fa=tn();Si.DIGEST_LENGTH=64;Si.BLOCK_SIZE=128;var dg=function(){function r(){this.digestLength=Si.DIGEST_LENGTH,this.blockSize=Si.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(){fa.wipe(this._buffer),fa.wipe(this._tempHi),fa.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<Si.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Ph(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Ph(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;ca.writeUint32BE(i,this._buffer,a-8),ca.writeUint32BE(s,this._buffer,a-4),Ph(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/8;f++)ca.writeUint32BE(this._stateHi[f],e,f*8),ca.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){fa.wipe(e.stateHi),fa.wipe(e.stateLo),e.buffer&&fa.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Si.SHA512=dg;var lg=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 Ph(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]=ca.readUint32BE(i,y),e[d]=ca.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=lg[d*2],F=lg[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(Ph,"hashBlocks");function qE(r){var e=new dg;e.update(r);var t=e.digest();return e.clean(),t}o(qE,"hash");Si.hash=qE});var mu=me($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var HE=no(),xf=hg(),vg=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 jE=new Uint8Array(32);jE[0]=9;var Lh=Ce(),ua=Ce([1]),zE=Ce([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),KE=Ce([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),pg=Ce([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),mg=Ce([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),VE=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 Nh(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(Nh,"car25519");function yg(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(yg,"sel25519");function wf(r,e){for(var t=Ce(),n=Ce(),i=0;i<16;i++)n[i]=e[i];Nh(n),Nh(n),Nh(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,yg(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(wf,"pack25519");function xg(r,e){for(var t=0,n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(xg,"verify32");function bg(r,e){var t=new Uint8Array(32),n=new Uint8Array(32);return wf(t,r),wf(n,e),xg(t,n)}o(bg,"neq25519");function wg(r){var e=new Uint8Array(32);return wf(e,r),e[0]&1}o(wg,"par25519");function WE(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(WE,"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 _g(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(_g,"inv25519");function GE(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(GE,"pow2523");function Bh(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,KE),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(Bh,"edadd");function gg(r,e,t){for(var n=0;n<4;n++)yg(r[n],e[n],t)}o(gg,"cswap");function Fh(r,e){var t=Ce(),n=Ce(),i=Ce();_g(i,e[2]),vt(t,e[0],i),vt(n,e[1],i),wf(r,n),r[31]^=wg(t)<<7}o(Fh,"pack");function Eg(r,e,t){io(r[0],Lh),io(r[1],ua),io(r[2],ua),io(r[3],Lh);for(var n=255;n>=0;--n){var i=t[n/8|0]>>(n&7)&1;gg(r,e,i),Bh(e,r),Bh(r,r),gg(r,e,i)}}o(Eg,"scalarmult");function $h(r,e){var t=[Ce(),Ce(),Ce(),Ce()];io(t[0],pg),io(t[1],mg),io(t[2],ua),vt(t[3],pg,mg),Eg(r,t,e)}o($h,"scalarbase");function Sg(r){if(r.length!==$t.SEED_LENGTH)throw new Error("ed25519: seed must be "+$t.SEED_LENGTH+" bytes");var e=xf.hash(r);e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(32),n=[Ce(),Ce(),Ce(),Ce()];$h(n,e),Fh(t,n);var i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(Sg,"generateKeyPairFromSeed");$t.generateKeyPairFromSeed=Sg;function YE(r){var e=HE.randomBytes(32,r),t=Sg(e);return vg.wipe(e),t}o(YE,"generateKeyPair");$t.generateKeyPair=YE;function JE(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(JE,"extractPublicKeyFromSecretKey");$t.extractPublicKeyFromSecretKey=JE;var Rh=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 Mg(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]*Rh[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)*Rh[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Rh[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(Mg,"modL");function Uh(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;Mg(r,e)}o(Uh,"reduce");function XE(r,e){var t=new Float64Array(64),n=[Ce(),Ce(),Ce(),Ce()],i=xf.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 xf.SHA512;a.update(s.subarray(32)),a.update(e);var f=a.digest();a.clean(),Uh(f),$h(n,f),Fh(s,n),a.reset(),a.update(s.subarray(0,32)),a.update(r.subarray(32)),a.update(e);var u=a.digest();Uh(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 Mg(s.subarray(32),t),s}o(XE,"sign");$t.sign=XE;function Ag(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce();return io(r[2],ua),WE(r[1],e),Qo(i,r[1]),vt(s,i,zE),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),GE(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),bg(n,i)&&vt(r[0],r[0],VE),Qo(n,r[0]),vt(n,n,s),bg(n,i)?-1:(wg(r[0])===e[31]>>7&&es(r[0],Lh,r[0]),vt(r[3],r[0],r[1]),0)}o(Ag,"unpackneg");function ZE(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(Ag(s,r))return!1;var a=new xf.SHA512;a.update(t.subarray(0,32)),a.update(r),a.update(e);var f=a.digest();return Uh(f),Eg(i,s,f),$h(s,t.subarray(32)),Bh(i,s),Fh(n,i),!xg(t,n)}o(ZE,"verify");$t.verify=ZE;function QE(r){var e=[Ce(),Ce(),Ce(),Ce()];if(Ag(e,r))throw new Error("Ed25519: invalid public key");var t=Ce(),n=Ce(),i=e[1];Zo(t,ua,i),es(n,ua,i),_g(n,n),vt(t,t,n);var s=new Uint8Array(32);return wf(s,t),s}o(QE,"convertPublicKeyToX25519");$t.convertPublicKeyToX25519=QE;function e7(r){var e=xf.hash(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(e.subarray(0,32));return vg.wipe(e),t}o(e7,"convertSecretKeyToX25519");$t.convertSecretKeyToX25519=e7});var kg=me((VN,Tg)=>{"use strict";Tg.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 Og=me(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var t7=no(),r7=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 Cg=new Uint8Array(32);Cg[0]=9;var n7=ti([56129,1]);function qh(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(qh,"car25519");function _f(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(_f,"sel25519");function i7(r,e){for(var t=ti(),n=ti(),i=0;i<16;i++)n[i]=e[i];qh(n),qh(n),qh(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,_f(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(i7,"pack25519");function o7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(o7,"unpack25519");function bu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(bu,"add");function gu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(gu,"sub");function Mi(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(Mi,"mul");function Ef(r,e){Mi(r,e,e)}o(Ef,"square");function s7(r,e){for(var t=ti(),n=0;n<16;n++)t[n]=e[n];for(var n=253;n>=0;n--)Ef(t,t),n!==2&&n!==4&&Mi(t,t,e);for(var n=0;n<16;n++)r[n]=t[n]}o(s7,"inv25519");function Hh(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,o7(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;_f(i,s,x),_f(a,f,x),bu(u,i,a),gu(i,i,a),bu(a,s,f),gu(s,s,f),Ef(f,u),Ef(m,i),Mi(i,a,i),Mi(a,s,u),bu(u,i,a),gu(i,i,a),Ef(s,i),gu(a,f,m),Mi(i,a,n7),bu(i,i,f),Mi(a,a,i),Mi(i,f,m),Mi(f,s,n),Ef(s,u),_f(i,s,x),_f(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);s7(k,k),Mi(O,O,k);var T=new Uint8Array(32);return i7(T,O),T}o(Hh,"scalarMult");Mr.scalarMult=Hh;function Dg(r){return Hh(r,Cg)}o(Dg,"scalarMultBase");Mr.scalarMultBase=Dg;function Ig(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=Dg(e);return{publicKey:t,secretKey:e}}o(Ig,"generateKeyPairFromSeed");Mr.generateKeyPairFromSeed=Ig;function a7(r){var e=t7.randomBytes(32,r),t=Ig(e);return r7.wipe(e),t}o(a7,"generateKeyPair");Mr.generateKeyPair=a7;function f7(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=Hh(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(f7,"sharedKey");Mr.sharedKey=f7});var zh=me(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});var fr=Ko(),jh=tn(),c7=20;function u7(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<c7;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;fr.writeUint32LE(z+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+O|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(_+I|0,r,56),fr.writeUint32LE(w+U|0,r,60)}o(u7,"core");function Pg(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){u7(f,s,r);for(var m=u;m<u+64&&m<t.length;m++)n[m]=t[m]^f[m-u];d7(s,0,a)}return jh.wipe(f),i===0&&jh.wipe(s),n}o(Pg,"streamXOR");vu.streamXOR=Pg;function l7(r,e,t,n){return n===void 0&&(n=0),jh.wipe(t),Pg(r,e,t,t,n)}o(l7,"stream");vu.stream=l7;function d7(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(d7,"incrementCounter")});var Bg=me(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var oo=Ko(),Ng=tn(),h7=zh(),p7=20;function Rg(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=Lg(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var a=h7.streamXOR(i,s,t,n);return Ng.wipe(i),a}o(Rg,"streamXOR");Sf.streamXOR=Rg;function m7(r,e,t){return Ng.wipe(t),Rg(r,e,t,t)}o(m7,"stream");Sf.stream=m7;function Lg(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<p7;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(Lg,"hchacha");Sf.hchacha=Lg});var Kh=me(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});function b7(r,e,t){return~(r-1)&e|r-1&t}o(b7,"select");la.select=b7;function g7(r,e){return(r|0)-(e|0)-1>>>31&1}o(g7,"lessOrEqual");la.lessOrEqual=g7;function Ug(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(Ug,"compare");la.compare=Ug;function v7(r,e){return r.length===0||e.length===0?!1:Ug(r,e)!==0}o(v7,"equal");la.equal=v7});var $g=me(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var y7=Kh(),yu=tn();Ai.DIGEST_LENGTH=16;var Fg=function(){function r(e){this.digestLength=Ai.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 yu.wipe(this._buffer),yu.wipe(this._r),yu.wipe(this._h),yu.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();Ai.Poly1305=Fg;function x7(r,e){var t=new Fg(r);t.update(e);var n=t.digest();return t.clean(),n}o(x7,"oneTimeAuth");Ai.oneTimeAuth=x7;function w7(r,e){return r.length!==Ai.DIGEST_LENGTH||e.length!==Ai.DIGEST_LENGTH?!1:y7.equal(r,e)}o(w7,"equal");Ai.equal=w7});var jg=me(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var xu=zh(),_7=$g(),Mf=tn(),qg=Ko(),E7=Kh();Ti.KEY_LENGTH=32;Ti.NONCE_LENGTH=12;Ti.TAG_LENGTH=16;var Hg=new Uint8Array(16),S7=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,"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);xu.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 xu.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),Mf.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);xu.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),!E7.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 xu.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),m,4),Mf.wipe(s),m},r.prototype.clean=function(){return Mf.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new _7.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(Hg.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(Hg.subarray(n.length%16));var a=new Uint8Array(8);i&&qg.writeUint64LE(i.length,a),s.update(a),qg.writeUint64LE(n.length,a),s.update(a);for(var f=s.digest(),u=0;u<f.length;u++)e[u]=f[u];s.clean(),Mf.wipe(f),Mf.wipe(a)},r}();Ti.ChaCha20Poly1305=S7});var Vg=me(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});var zg=Bg(),Kg=jg(),Af=tn();ki.KEY_LENGTH=32;ki.NONCE_LENGTH=24;ki.TAG_LENGTH=16;var M7=function(){function r(e){if(this.nonceLength=ki.NONCE_LENGTH,this.tagLength=ki.TAG_LENGTH,e.length!==ki.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=zg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Kg.ChaCha20Poly1305(s),u=f.seal(a,t,n,i);return Af.wipe(s),Af.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=zg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Kg.ChaCha20Poly1305(s),u=f.open(a,t,n,i);return Af.wipe(s),Af.wipe(a),f.clean(),u},r.prototype.clean=function(){return Af.wipe(this._key),this},r}();ki.XChaCha20Poly1305=M7});var Tn=me((TL,N2)=>{N2.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 Lf=me((kL,R2)=>{R2.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 U2=me(tr=>{var L2=tr,Fu=4294967292,$u=4294967293,g0=4294967294,B2=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"],KS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Br=[];KS.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 $u;let $=((T&xe[5])<<6)+(C&xe[6]);return $<128?Fu:$}o(t,"bytes2");function n(T,C,$){if(($&192)!==128||(C&192)!==128)return $u;let I=((T&xe[4])<<12)+((C&xe[6])<<6)+($&xe[6]);return I<2048?Fu:I>=55296&&I<=57343?g0:I}o(n,"bytes3");function i(T,C,$,I){if((I&192)!==128||($&192)!==128||(C&192)!==128)return $u;let U=(((T&xe[3])<<2)+(C>>4&xe[2])<<16)+((C&xe[4])<<12)+(($&xe[6])<<6)+(I&xe[6]);return U<65536?Fu:U>1114111?g0: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=B2;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===B2?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${C}`):s===$u?new RangeError(`utf8.decode: illegal trailing byte found at: ${C}`):s===g0?new RangeError(`utf8.decode: code point out of range found at: ${C}`):s===Fu?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}};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 L2.utf16le.encode(r).toString("utf16le")},decode(r){return L2.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,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 Bf=13,cn=10;tr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Bf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(Bf),e.push(cn);break;case cn:e.push(Bf),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(Bf),e.push(cn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Bf: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 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
|
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 w0=me(Ff=>{var F2=Ff,dt=U2(),Uf="UTF8",y0="UTF16",ni="UTF16BE",
|
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 w0=me(Ff=>{var F2=Ff,dt=U2(),Uf="UTF8",y0="UTF16",ni="UTF16BE",Ii="UTF16LE",x0="UTF32",ii="UTF32BE",Oi="UTF32LE",xa="UINT7",$2="ASCII",q2="BINARY",wa="UINT8",H2="UINT16",qu="UINT16LE",_a="UINT16BE",j2="UINT32",Hu="UINT32LE",Ea="UINT32BE",ju="ESCAPED",uo="STRING",VS=o(function(e){e.type=Uf;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),WS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case y0:e.type=ni,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=Ii,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 "${Ii}"`)}break;case Ii:if(e.type=Ii,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${Ii}" 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"),GS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case x0: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"),YS=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 Uf:VS(i);break;case y0:case ni:case Ii:WS(i);break;case x0:case ii:case Oi:GS(i);break;case H2:i.type=_a;break;case j2:i.type=Ea;break;case $2:i.type=xa;break;case q2:i.type=wa;break;case xa:case wa:case qu:case _a:case Hu:case Ea:case uo:case ju: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"),JS=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 Uf:case ni:case Ii:case ii:case Oi:case xa:case wa:case qu:case _a:case Hu:case Ea:case ju:break;case uo:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${uo}`);break;case $2:i.type=xa;break;case q2:i.type=wa;break;case y0:i.type=ni;break;case x0:i.type=ii;break;case H2:i.type=_a;break;case j2:i.type=Ea;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),v0=o(function(e,t){switch(e){case Uf:return dt.utf8.encode(t);case ni:return dt.utf16be.encode(t);case Ii:return dt.utf16le.encode(t);case ii:return dt.utf32be.encode(t);case Oi:return dt.utf32le.encode(t);case xa:return dt.uint7.encode(t);case wa:return dt.uint8.encode(t);case _a:return dt.uint16be.encode(t);case qu:return dt.uint16le.encode(t);case Ea:return dt.uint32be.encode(t);case Hu:return dt.uint32le.encode(t);case uo:return dt.string.encode(t);case ju:return dt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),XS=o(function(e){switch(e.type){case Uf:return dt.utf8.decode(e.data,e.bom);case Ii: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 xa:return dt.uint7.decode(e.data);case wa:return dt.uint8.decode(e.data);case _a:return dt.uint16be.decode(e.data);case qu:return dt.uint16le.decode(e.data);case Ea:return dt.uint32be.decode(e.data);case Hu:return dt.uint32le.decode(e.data);case uo:return dt.string.decode(e.data);case ju:return dt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Ff.decode=o(function(e,t){let n=YS(e,t);return XS(n)},"exportsDecode");Ff.encode=o(function(e,t){let n,i,s=JS(e,t);return s.crlf?(n=dt.lineEnds.crlf(t),i=v0(s.type,n)):s.lf?(n=dt.lineEnds.lf(t),i=v0(s.type,n)):i=v0(s.type,t),s.base64&&(i=dt.base64.encode(i)),i},"exportsEncode");Ff.convert=o(function(e,t,n){return F2.encode(n,F2.decode(e,t))},"convert")});var _0=me((IL,z2)=>{z2.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
|
20
20
|
.apg-mono {
|
21
21
|
font-family: monospace;
|
22
22
|
}
|
@@ -230,13 +230,13 @@ 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 kr=Lf(),E0=w0(),
|
233
|
+
`},"emittcss")});var as=me(Wt=>{var kr=Lf(),E0=w0(),ZS=_0(),Pt=Tn(),lo="utilities.js: ",Pi=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+=
|
239
|
+
`,n+=ZS(),n+=`</style>
|
240
240
|
`,n+=`</head>
|
241
241
|
<body>
|
242
242
|
`,n+=`<p>${new Date}</p>
|
@@ -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?E0.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};Wt.stringToChars=function(r){return E0.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"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","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${Pi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${Pi.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
|
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?E0.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};Wt.stringToChars=function(r){return E0.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"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","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${Pi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${Pi.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 QS(r){return!(r>=55296&&r<=57343||r>1114111)}o(QS,"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)QS(r[s])?n+=`&#${r[s]};`:n+=` U+${Pi.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${Pi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${Pi.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${Pi.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}">${Pi.asciiChars[i]}</span>`:i>127?n+=`<span class="${kr.CLASS_CTRLCHAR}">U+${Pi.charToHex(i)}</span>`:n+=Pi.asciiChars[i];return n};Wt.stringToAsciiHtml=function(r){let e=E0.decode("STRING",r);return this.charsToAsciiHtml(e)}});var V2=me((PL,K2)=>{K2.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"?>
|
265
265
|
`,U+=`<root nodes="${k.length/2}" characters="${f.length}">
|
266
|
-
`,U+=`<!-- input string, ${
|
267
|
-
`,U+=
|
268
|
-
`,k.forEach(H=>{H.state===e.SEM_PRE?(z+=1,U+=
|
269
|
-
`,U+=
|
270
|
-
`):(U+=
|
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
271
|
`,z-=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 S0=me((PL,W2)=>{W2.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 Y2=me((NL,G2)=>{G2.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,p,m,x,k=0,I=0,T=0,C=null,$=null,O=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>=O.length)throw new Error(`${ae}rule index: ${G} out of range`);if(P>=m)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>=m)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,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,p=0,m=0,C=null,$=null,z=null,a=null},"clear"),E=o(function(){let te=[],G=o(function(){let j={};O.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(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 j=te.toLowerCase();for(let ae=0;ae<O.length;ae+=1)if(j===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,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,p=ge,m=u+p},"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,j=[];for(G=0;G<O.length;G+=1)j.push(O[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<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 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===p?j=!0:j=!1;break;default:throw new Error("unrecognized state")}return{success:j,state:le.state,length:p,matched:le.phraseLength,maxMatched:H,maxTreeDepth:I,nodeHits:T,inputLength:f.length,subBegin:u,subEnd:m,subLength:p}},"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 A=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"),M=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>=m||(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=O[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,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=m-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=O.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=m-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:m,charsLength:p}),m=f.length,p=f.length-u,s(te+1,G,P);let j=x.pop();switch(m=j.charsEnd,p=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:m,charsLength:p}),m=f.length,p=f.length-u,s(te+1,G,P);let j=x.pop();switch(m=j.charsEnd,p=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<m&&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<=m){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<=m){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<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<=m){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"),Ie=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<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(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>I&&(I=k,I>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:A(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:Ie(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:A(G,P,j);break;case e.CAT:ne(G,P,j);break;case e.REP:M(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 X2=me((RL,J2)=>{J2.exports=o(function(){let e=Tn(),t=as(),n=Lf(),i="stats.js: ",s=[],a=[],f=[],u,p=[],m=[];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,p.length=0;for(let B=0;B<s.length;B+=1)p.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){m.length=0;for(let B=0;B<a.length;B+=1)m.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>
|
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 S0=me((NL,W2)=>{W2.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 Y2=me((RL,G2)=>{G2.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 X2=me((LL,J2)=>{J2.exports=o(function(){let e=Tn(),t=as(),n=Lf(),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
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>
|
274
274
|
`,B+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
|
275
|
-
`;for(let L=0;L<s.length;L+=1)
|
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
|
-
`;for(let L=0;L<a.length;L+=1)
|
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){
|
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}">
|
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"){
|
287
|
-
`,F},"toHtml"),this.toHtmlPage=o(function(B,L,F){return t.htmlToPage(this.toHtml(B,L),F)},"toHtmlPage")},"statsFunc")});var Q2=me((
|
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((BL,Z2)=>{Z2.exports=o(function(){let e=as(),t=Lf(),n=new(S0()),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}">•</span>`,re=`<span class="${t.CLASS_LINEEND}">…</span>`,E=`<span class="${t.CLASS_EMPTY}">𝜺</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>
|
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===
|
333
|
-
`,n.forEach(pe=>{let Q=
|
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+=`–${W}`}else V=`%d${R.min.toString(10)}–${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+=`–${W}`}else R.max<1/0?V=`${R.min.toString(10)}–${R.max.toString(10)}`:V=`${R.min.toString(10)}–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}">↓ </span>`;break;case i.MATCH:R+=`<span class="${t.CLASS_MATCH}">↑M</span>`;break;case i.NOMATCH:R+=`<span class="${t.CLASS_NOMATCH}">↑N</span>`;break;case i.EMPTY:R+=`<span class="${t.CLASS_EMPTY}">↑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>
|
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=
|
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,ey)=>{ey.exports={ast:V2(),circular:S0(),ids:Tn(),parser:Y2(),stats:X2(),trace:Q2(),utils:as(),emitcss:_0(),style:Lf()}});var ry=me((FL,ty)=>{ty.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 iy=me(ny=>{var cr=Tn(),QS=as();function eA(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(eA,"semLine");function tA(r,e,t,n,i){return r===cr.SEM_PRE&&(i.textLength=n),cr.SEM_OK}o(tA,"semLineText");function rA(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(rA,"semLastLine");function nA(r,e,t,n,i){return r===cr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${QS.charToHex(e[t])}'`}),cr.SEM_OK}o(nA,"semInvalid");function iA(r,e,t,n,i){return r===cr.SEM_POST&&(i.lineNo+=1),cr.SEM_OK}o(iA,"semEnd");function oA(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(oA,"semLF");function sA(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(sA,"semCR");function aA(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CRLF"),cr.SEM_OK}o(aA,"semCRLF");var Ni=[];Ni.line=eA;Ni["line-text"]=tA;Ni["last-line"]=rA;Ni.invalid=nA;Ni.end=iA;Ni.lf=oA;Ni.cr=sA;Ni.crlf=aA;ny.callbacks=Ni});var sy=me(($L,oy)=>{oy.exports=o(function(e,t,n,i){let s="scanner.js: ",a=fs(),f=new(ry()),{callbacks:u}=iy(),p=[],m=new a.parser;if(m.ast=new a.ast,m.ast.callbacks=u,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);m.trace=i}if(m.parse(f,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let k={lines:p,lineNo:0,errors:t,strict:!!n};return m.ast.translate(k),p},"exfn")});var fy=me((qL,ay)=>{ay.exports=o(function(){let e="syntax-callbacks.js: ",t=fs(),n=t.ids,i,s=o(function(D,v,A,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,A){switch(S.state){case n.ACTIVE:A.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},A.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:A.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),f=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.errors.push({line:A.findLine(A.lines,v,A.charsLength),char:v,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),p=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.errors.push({line:A.findLine(A.lines,v,A.charsLength),char:v,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),m=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.strict&&A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.strict&&A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.strict&&A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.strict&&A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.strict&&A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.strict&&A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(A.strict){let ne=t.utils.charsToString(D,v,S.phraseLength);A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(A.strict){let ne=t.utils.charsToString(D,v,S.phraseLength);A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:A.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.stringTabChar!==!1&&A.errors.push({line:A.findLine(A.lines,A.stringTabChar),char:A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.stringTabChar=v;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),X=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:A.errors.push({line:A.findLine(A.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,A){switch(S.state){case n.ACTIVE:A.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.stringTabChar!==!1&&A.errors.push({line:A.findLine(A.lines,A.stringTabChar),char:A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:A.errors.push({line:A.findLine(A.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:A.strict&&A.errors.push({line:A.findLine(A.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,A){switch(S.state){case n.ACTIVE:A.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.stringTabChar!==!1&&A.errors.push({line:A.findLine(A.lines,A.stringTabChar),char:A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:A.errors.push({line:A.findLine(A.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:A.errors.push({line:A.findLine(A.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,A){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},A.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),h=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:A.errors.push({line:A.findLine(A.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=A.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=A.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),c=o(function(S,D,v,A){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},A.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),d=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:A.errors.push({line:A.findLine(A.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=A.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=A.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),y=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&A.errors.push({line:A.findLine(A.lines,v,A.charsLength),char:v,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),_=o(function(S,D,v,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.phraseLength===1&&A.strict){let ne=D[v]===13?"CR":"LF";A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:A.errors.push({line:A.findLine(A.lines,v,A.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,A){switch(S.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:A.repCount+=1;break;case n.MATCH:A.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=m,this.callbacks.basicelementerr=y,this.callbacks.clsclose=F,this.callbacks.clsopen=B,this.callbacks.clsstring=L,this.callbacks.definedaserror=p,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=O,this.callbacks.bkaop=k,this.callbacks.bknop=I,this.callbacks.bkrop=$,this.callbacks.abgop=T,this.callbacks.aenop=C},"exfn")});var uy=me((HL,cy)=>{cy.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 p(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(p,"semRuleLookup");function m(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(m,"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 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 A(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(A,"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 M(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(M,"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=m,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=A,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"]=z,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=p,this.callbacks.rulename=T,this.callbacks.tbsop=ne,this.callbacks.tlscase=D,this.callbacks.tlsstring=v,this.callbacks.tlsop=S,this.callbacks.trgop=M,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 dy=me((jL,ly)=>{ly.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 iy=me(ny=>{var cr=Tn(),eM=as();function tM(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(tM,"semLine");function rM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.textLength=n),cr.SEM_OK}o(rM,"semLineText");function nM(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(nM,"semLastLine");function iM(r,e,t,n,i){return r===cr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${eM.charToHex(e[t])}'`}),cr.SEM_OK}o(iM,"semInvalid");function oM(r,e,t,n,i){return r===cr.SEM_POST&&(i.lineNo+=1),cr.SEM_OK}o(oM,"semEnd");function sM(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(sM,"semLF");function aM(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(aM,"semCR");function fM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CRLF"),cr.SEM_OK}o(fM,"semCRLF");var Ni=[];Ni.line=tM;Ni["line-text"]=rM;Ni["last-line"]=nM;Ni.invalid=iM;Ni.end=oM;Ni.lf=sM;Ni.cr=aM;Ni.crlf=fM;ny.callbacks=Ni});var sy=me((qL,oy)=>{oy.exports=o(function(e,t,n,i){let s="scanner.js: ",a=fs(),f=new(ry()),{callbacks:u}=iy(),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 fy=me((HL,ay)=>{ay.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 uy=me((jL,cy)=>{cy.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 dy=me((zL,ly)=>{ly.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,86 +514,86 @@ 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 py=me((
|
518
|
-
`,
|
519
|
-
`,
|
520
|
-
`,
|
521
|
-
`,
|
522
|
-
`,
|
523
|
-
`,
|
524
|
-
`,
|
525
|
-
`,
|
526
|
-
`,
|
527
|
-
`,
|
528
|
-
`,
|
529
|
-
`,
|
530
|
-
`,
|
531
|
-
`,
|
532
|
-
`,
|
533
|
-
`,
|
534
|
-
`,
|
535
|
-
`,
|
536
|
-
`,
|
537
|
-
`,
|
538
|
-
`,
|
539
|
-
`,
|
540
|
-
`,
|
541
|
-
`,
|
542
|
-
`,
|
543
|
-
`,
|
544
|
-
`,
|
545
|
-
`,
|
546
|
-
`,
|
547
|
-
`,
|
548
|
-
`,
|
517
|
+
`,t},"toString")},"grammar")});var py=me((KL,hy)=>{hy.exports=o(function(){let e="parser: ",t=fs(),n=t.ids,i=new(fy()),s=new(uy()),a=new(dy()),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 = [];
|
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
|
-
`,
|
551
|
-
`,
|
552
|
-
`,
|
550
|
+
`,I+=R}),I+=`
|
551
|
+
`,I+=` /* UDTS */
|
552
|
+
`,I+=` 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
|
-
`,
|
555
|
-
`,
|
556
|
-
`,T.forEach((J,N)=>{N>0&&(
|
557
|
-
`),
|
558
|
-
`,
|
559
|
-
`,J.opcodes.forEach((R,V)=>{let W;switch(R.type){case n.ALT:
|
560
|
-
`;break;case n.CAT:
|
561
|
-
`;break;case n.RNM:
|
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,
|
563
|
-
`;break;case n.UDT:
|
564
|
-
`;break;case n.REP:
|
565
|
-
`;break;case n.AND:
|
566
|
-
`;break;case n.NOT:
|
567
|
-
`;break;case n.ABG:
|
568
|
-
`;break;case n.AEN:
|
569
|
-
`;break;case n.BKA:
|
570
|
-
`;break;case n.BKN:
|
571
|
-
`;break;case n.TLS:
|
572
|
-
`;break;case n.TBS:
|
573
|
-
`;break;case n.TRG:
|
574
|
-
`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),
|
575
|
-
`,
|
576
|
-
`,
|
577
|
-
`;let K;return
|
578
|
-
`}),
|
579
|
-
`,
|
580
|
-
`,
|
581
|
-
`,
|
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 by=me((VL,my)=>{my.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}
|
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:
|
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
|
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 vy=me((
|
591
|
-
`,U=!0,
|
592
|
-
${C}${$}`,
|
593
|
-
${C}${$}`,
|
590
|
+
`,l+=g,l+=B(),l+=F()),l},"showAttributes"),showAttributeErrors:L}},"exportRuleAttributes")()});var vy=me((WL,gy)=>{gy.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+=`
|
593
|
+
${C}${$}`,p=T.length);for(m===0&&(T+=`=> <none>
|
594
594
|
`),U===!1&&(T+=`
|
595
|
-
`),U=!0,
|
596
|
-
${C}${$}`,
|
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+=`
|
596
|
+
${C}${$}`,p=T.length);m===0&&(T+=`<= <none>
|
597
597
|
`),U===!1&&(T+=`
|
598
598
|
`),T+=`
|
599
599
|
`}return T},"show");return{ruleDependencies:n,showRuleDependencies:o((a="index")=>{let f=`RULE DEPENDENCIES(index:type:[group number:])
|
@@ -602,36 +602,36 @@ ${C}${$}`,m=T.length);p===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 xy=me((
|
606
|
-
`,
|
607
|
-
`;if(C)for(
|
605
|
+
`,f+=i(null))),f},"showRuleDependencies")}})()});var xy=me((GL,yy)=>{yy.exports=o(function(){let e=Tn(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=by(),{ruleDependencies:s,showRuleDependencies:a}=vy();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 _y=me((YL,wy)=>{wy.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}
|
608
608
|
`}else{for($+=` - ordered by rule/UDT index
|
609
|
-
`,
|
610
|
-
`;if(C)for(
|
611
|
-
`}return $},"showRules")},"exfn")()});var Sy=me((
|
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 Sy=me((JL,Ey)=>{Ey.exports=o(function(e){let t="api.js: ",n=this,i=fs(),s=w0(),a=sy(),f=new(py()),{attributes:u,showAttributes:m,showAttributeErrors:p,showRuleDependencies:x}=xy(),k=_y(),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+=" ";break;case 60:D+="<";break;case 62:D+=">";break;case 38:D+="&";break;case 34:D+=""";break;case 39:D+="'";break;case 92:D+="\";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>${
|
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>
|
617
617
|
`}),l+=`</table>
|
618
|
-
`,l},"linesToHtml"),
|
618
|
+
`,l},"linesToHtml"),I=o(function(E,l,g,h){let[c]=i,d="",y=`<span class="${c.CLASS_NOMATCH}">»</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,
|
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>
|
622
622
|
`,d+="<tr>",d+=`<td colspan="3"></td><td>↑: ${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&&m(E),p(E)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!B)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return m()},"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 R0=me((Ly,N0)=>{(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=rh().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,A=y;A<D;A+=_)v=u(c,A,A+_,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,A,c.length,d),A=0;A<S;A++)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 p(h,c){h.words=c.words,h.length=c.length,h.negative=c.negative,h.red=c.red}if(o(p,"move"),i.prototype._move=o(function(c){p(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")]=m}catch(h){i.prototype.inspect=m}else i.prototype.inspect=m;function m(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(m,"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],A=I[c];y="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var M=ne.modrn(A).toString(c);ne=ne.idivn(A),ne.isZero()?y=M+y:y=x[v-M.length]+M+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 A=D>>>26,ne=D&67108863,M=Math.min(v,c.length-1),K=Math.max(0,v-h.length+1);K<=M;K++){var J=v-K|0;_=h.words[J]|0,w=c.words[K]|0,b=_*w+ne,A+=b/67108864|0,ne=b&67108863}d.words[v]=ne|0,D=A|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,A,ne=_[0]|0,M=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,Ie=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(M,Ee),v=Math.imul(M,ve),v=v+Math.imul(K,Ee)|0,A=Math.imul(K,ve);var Yr=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=Math.imul(R,ve),D=D+Math.imul(M,De)|0,v=v+Math.imul(M,Ne)|0,v=v+Math.imul(K,De)|0,A=A+Math.imul(K,Ne)|0;var Jr=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+Math.imul(R,Ne)|0,D=D+Math.imul(M,Le)|0,v=v+Math.imul(M,Be)|0,v=v+Math.imul(K,Le)|0,A=A+Math.imul(K,Be)|0;var Xr=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+Math.imul(R,Be)|0,D=D+Math.imul(M,Ue)|0,v=v+Math.imul(M,Fe)|0,v=v+Math.imul(K,Ue)|0,A=A+Math.imul(K,Fe)|0;var Zr=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+Math.imul(R,Fe)|0,D=D+Math.imul(M,$e)|0,v=v+Math.imul(M,qe)|0,v=v+Math.imul(K,$e)|0,A=A+Math.imul(K,qe)|0;var Qr=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(R,qe)|0,D=D+Math.imul(M,He)|0,v=v+Math.imul(M,je)|0,v=v+Math.imul(K,He)|0,A=A+Math.imul(K,je)|0;var ko=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(R,je)|0,D=D+Math.imul(M,ze)|0,v=v+Math.imul(M,Ke)|0,v=v+Math.imul(K,ze)|0,A=A+Math.imul(K,Ke)|0;var Co=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(R,Ke)|0,D=D+Math.imul(M,Ve)|0,v=v+Math.imul(M,We)|0,v=v+Math.imul(K,Ve)|0,A=A+Math.imul(K,We)|0;var Do=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(R,We)|0,D=D+Math.imul(M,Ge)|0,v=v+Math.imul(M,Ye)|0,v=v+Math.imul(K,Ge)|0,A=A+Math.imul(K,Ye)|0;var Oo=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(R,Ye)|0,D=D+Math.imul(M,mt)|0,v=v+Math.imul(M,bt)|0,v=v+Math.imul(K,mt)|0,A=A+Math.imul(K,bt)|0;var Io=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+Math.imul(Ie,qe)|0,D=D+Math.imul(se,He)|0,v=v+Math.imul(se,je)|0,v=v+Math.imul(be,He)|0,A=A+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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(R,bt)|0;var Po=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+Math.imul(G,qe)|0,D=D+Math.imul(we,He)|0,v=v+Math.imul(we,je)|0,v=v+Math.imul(Ie,He)|0,A=A+Math.imul(Ie,je)|0,D=D+Math.imul(se,ze)|0,v=v+Math.imul(se,Ke)|0,v=v+Math.imul(be,ze)|0,A=A+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,A=A+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,A=A+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,A=A+Math.imul(ee,bt)|0;var No=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+Math.imul(G,je)|0,D=D+Math.imul(we,ze)|0,v=v+Math.imul(we,Ke)|0,v=v+Math.imul(Ie,ze)|0,A=A+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,A=A+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,A=A+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,A=A+Math.imul(Y,bt)|0;var Ro=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(ce,bt)|0;var Lo=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+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,A=A+Math.imul(be,bt)|0;var Bo=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+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,A=A+Math.imul(Ie,bt)|0;var Uo=(S+D|0)+((v&8191)<<13)|0;S=(A+(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,A=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,A=A+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,A=A+Math.imul(G,bt)|0;var hd=(S+D|0)+((v&8191)<<13)|0;S=(A+(v>>>13)|0)+(hd>>>26)|0,hd&=67108863,D=Math.imul(le,Ge),v=Math.imul(le,Ye),v=v+Math.imul(ge,Ge)|0,A=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,A=A+Math.imul(ae,bt)|0;var pd=(S+D|0)+((v&8191)<<13)|0;S=(A+(v>>>13)|0)+(pd>>>26)|0,pd&=67108863,D=Math.imul(le,mt),v=Math.imul(le,bt),v=v+Math.imul(ge,mt)|0,A=Math.imul(ge,bt);var md=(S+D|0)+((v&8191)<<13)|0;return S=(A+(v>>>13)|0)+(md>>>26)|0,md&=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]=hd,b[17]=pd,b[18]=md,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 A=w-v,ne=h.words[A]|0,M=c.words[v]|0,K=ne*M,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=O(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),A=Math.sin(2*Math.PI/D),ne=0;ne<w;ne+=D)for(var M=v,K=A,J=0;J<S;J++){var N=y[ne+J],R=_[ne+J],V=y[ne+J+S],W=_[ne+J+S],ee=M*V-K*W;W=M*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*M-A*K,K=v*K+A*M,M=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(_),A=new Array(_),ne=new Array(_),M=new Array(_),K=y.words;K.length=_,this.convert13b(c.words,c.length,S,_),this.convert13b(d.words,d.length,A,_),this.transform(S,b,D,v,_,w),this.transform(A,b,ne,M,_,w);for(var J=0;J<_;J++){var N=D[J]*ne[J]-v[J]*M[J];v[J]=D[J]*M[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 A=0;for(v=this.length-1;v>=0&&(A!==0||v>=_);v--){var ne=this.words[v]|0;this.words[v]=A<<26-w|ne>>>w,A=ne&S}return D&&A!==0&&(D.words[D.length++]=A),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 A=0;A<v.length;A++)v.words[A]=0}var ne=_.clone()._ishlnsubmul(w,1,D);ne.negative===0&&(_=ne,v&&(v.words[D]=1));for(var M=D-1;M>=0;M--){var K=(_.words[w.length+M]|0)*67108864+(_.words[w.length+M-1]|0);for(K=Math.min(K/b|0,67108863),_._ishlnsubmul(w,K,M);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(w,1,M),_.isZero()||(_.negative^=1);v&&(v.words[M]=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(),A=d.clone();!d.isZero();){for(var ne=0,M=1;(d.words[0]&M)===0&&ne<26;++ne,M<<=1);if(ne>0)for(d.iushrn(ne);ne-- >0;)(_.isOdd()||w.isOdd())&&(_.iadd(v),w.isub(A)),_.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(A)),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,A=1;(y.words[0]&A)===0&&v<26;++v,A<<=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):(p(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 A=this.pow(v,_),ne=this.pow(c,_.addn(1).iushrn(1)),M=this.pow(c,_),K=w;M.cmp(b)!==0;){for(var J=M,N=0;J.cmp(b)!==0;N++)J=J.redSqr();t(N<K);var R=this.pow(A,new i(1).iushln(K-N-1));ne=ne.redMul(R),A=R.redSqr(),M=M.redMul(A),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 A=d.words[w],ne=v-1;ne>=0;ne--){var M=A>>ne&1;if(b!==_[0]&&(b=this.sqr(b)),M===0&&S===0){D=0;continue}S<<=1,S|=M,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 N0=="undefined"||N0,Ly)});var _3=me((NU,w3)=>{w3.exports=G0;var x3=128,LA=127,BA=~LA,UA=Math.pow(2,31);function G0(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw G0.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=UA;)e[t++]=r&255|x3,r/=128;for(;r&BA;)e[t++]=r&255|x3,r>>>=7;return e[t]=r|0,G0.bytes=t-n+1,e}o(G0,"encode")});var A3=me((RU,S3)=>{S3.exports=Y0;var FA=128,E3=127;function Y0(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f||i>49)throw Y0.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&E3)<<i:(a&E3)*Math.pow(2,i),i+=7}while(a>=FA);return Y0.bytes=s-n,t}o(Y0,"read")});var T3=me((LU,M3)=>{var $A=Math.pow(2,7),qA=Math.pow(2,14),HA=Math.pow(2,21),jA=Math.pow(2,28),zA=Math.pow(2,35),KA=Math.pow(2,42),VA=Math.pow(2,49),WA=Math.pow(2,56),GA=Math.pow(2,63);M3.exports=function(r){return r<$A?1:r<qA?2:r<HA?3:r<jA?4:r<zA?5:r<KA?6:r<VA?7:r<WA?8:r<GA?9:10}});var Gf=me((BU,k3)=>{k3.exports={encode:_3(),decode:A3(),encodingLength:T3()}});var D3=me((UU,C3)=>{"use strict";function YA(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),p=Math.log(256)/Math.log(a);function m(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-$)*p+1>>>0,z=new Uint8Array(U);$!==O;){for(var H=I[$],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(m,"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 z=e[I.charCodeAt(T)];if(z===255)return;for(var H=0,X=O-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(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:m,decodeUnsafe:x,decode:k}}o(YA,"base");C3.exports=YA});var ol=me((FU,O3)=>{"use strict";var JA=new TextDecoder,XA=o(r=>JA.decode(r),"decodeText"),ZA=new TextEncoder,QA=o(r=>ZA.encode(r),"encodeText");function eM(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(eM,"concat");O3.exports={decodeText:XA,encodeText:QA,concat:eM}});var P3=me(($U,I3)=>{"use strict";var{encodeText:tM}=ol(),sl=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=tM(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(sl,"Base");I3.exports=sl});var R3=me((qU,N3)=>{"use strict";var rM=o((r,e,t)=>{let n={};for(let p=0;p<e.length;++p)n[e[p]]=p;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 p=0;p<i;++p){let m=n[r[p]];if(m===void 0)throw new SyntaxError("Invalid character "+r[p]);f=f<<t|m,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"),nM=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"),iM=o(r=>e=>({encode(t){return nM(t,e,r)},decode(t){return rM(t,e,r)}}),"rfc4648");N3.exports={rfc4648:iM}});var F3=me((HU,U3)=>{"use strict";var Yf=D3(),oM=P3(),{rfc4648:nr}=R3(),{decodeText:sM,encodeText:aM}=ol(),fM=o(()=>({encode:sM,decode:aM}),"identity"),L3=[["identity","\0",fM,""],["base2","0",nr(1),"01"],["base8","7",nr(3),"01234567"],["base10","9",Yf,"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",Yf,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Yf,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Yf,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Yf,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],B3=L3.reduce((r,e)=>(r[e[0]]=new oM(e[0],e[1],e[2],e[3]),r),{}),cM=L3.reduce((r,e)=>(r[e[1]]=B3[e[0]],r),{});U3.exports={names:B3,codes:cM}});var J0=me((Ri,q3)=>{"use strict";var Da=F3(),{encodeText:uM,decodeText:al,concat:$3}=ol();function lM(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=hs(r);return mM(t,e),$3([n,e],n.length+e.length)}o(lM,"multibase");function dM(r,e){let t=hs(r),n=uM(t.encode(e));return $3([t.codeBuf,n],t.codeBuf.length+n.length)}o(dM,"encode");function hM(r){r instanceof Uint8Array&&(r=al(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(hM,"decode");function pM(r){if(r instanceof Uint8Array&&(r=al(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return hs(r[0]).name}catch(e){return!1}}o(pM,"isEncoded");function mM(r,e){hs(r).decode(al(e))}o(mM,"validEncode");function hs(r){if(Object.prototype.hasOwnProperty.call(Da.names,r))return Da.names[r];if(Object.prototype.hasOwnProperty.call(Da.codes,r))return Da.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(hs,"encoding");function bM(r){return r instanceof Uint8Array&&(r=al(r)),hs(r[0])}o(bM,"encodingFromData");Ri=q3.exports=lM;Ri.encode=dM;Ri.decode=hM;Ri.isEncoded=pM;Ri.encoding=hs;Ri.encodingFromData=bM;var gM=Object.freeze(Da.names),vM=Object.freeze(Da.codes);Ri.names=gM;Ri.codes=vM});var j3=me((jU,H3)=>{"use strict";function yM(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(yM,"compare");H3.exports=yM});var K3=me((zU,z3)=>{"use strict";function xM(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(xM,"concat");z3.exports=xM});var W3=me((KU,V3)=>{"use strict";function wM(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(wM,"equals");V3.exports=wM});var Z0=me((VU,X3)=>{"use strict";var{bases:G3}=(Kc(),tf(v1));function J3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}o(J3,"createCodec");var Y3=J3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),X0=J3("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}),_M=ie({utf8:Y3,"utf-8":Y3,hex:G3.base16,latin1:X0,ascii:X0,binary:X0},G3);X3.exports=_M});var Q3=me((WU,Z3)=>{"use strict";var EM=Z0();function SM(r,e="utf8"){let t=EM[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}o(SM,"fromString");Z3.exports=SM});var tx=me((GU,ex)=>{"use strict";var AM=Z0();function MM(r,e="utf8"){let t=AM[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}o(MM,"toString");ex.exports=MM});var nx=me((YU,rx)=>{"use strict";function TM(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(TM,"xor");rx.exports=TM});var Q0=me((JU,ix)=>{"use strict";var kM=j3(),CM=K3(),DM=W3(),OM=Q3(),IM=tx(),PM=nx();ix.exports={compare:kM,concat:CM,equals:DM,fromString:OM,toString:IM,xor:PM}});var ox=me(ai=>{"use strict";var NM=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]}),RM=ai&&ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),LM=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)&&NM(e,r,t);return RM(e,r),e};Object.defineProperty(ai,"__esModule",{value:!0});ai.keyToDidDoc=void 0;var BM=LM(Q0());function UM(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:BM.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(UM,"keyToDidDoc");ai.keyToDidDoc=UM});var sx=me(fi=>{"use strict";var FM=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]}),$M=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),qM=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)&&FM(e,r,t);return $M(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.keyToDidDoc=void 0;var ep=qM(Q0()),HM=mu();function jM(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${ep.toString(e,"base58btc")}`}o(jM,"encodeKey");function zM(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=HM.convertPublicKeyToX25519(r),s=`${t}#${jM(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:ep.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:ep.toString(i,"base58btc")}]}}o(zM,"keyToDidDoc");fi.keyToDidDoc=zM});var dx=me(Fr=>{"use strict";var KM=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]}),VM=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),cx=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)&&KM(e,r,t);return VM(e,r),e},ux=Fr&&Fr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getResolver=void 0;var ax=ux(Gf()),WM=ux(J0()),GM=cx(ox()),YM=cx(sx()),JM="application/did+ld+json",fx="application/did+json",XM={231:GM,237:YM};function lx(){return{key:(r,e,t,n)=>Z(this,null,function*(){let i=n.accept||fx,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let a=WM.default.decode(e.id),f=ax.default.decode(a),u=a.slice(ax.default.decode.bytes),p=yield XM[f].keyToDidDoc(u,e.id);i===JM?(p["@context"]="https://w3id.org/did/v1",s.didDocument=p):i===fx?s.didDocument=p:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(a){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=a.toString()}return s})}}o(lx,"getResolver");Fr.getResolver=lx;Fr.default={getResolver:lx}});var px=me((eF,hx)=>{"use strict";hx.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 p={key:f,value:a[f]},m={key:u,value:a[u]};return s(p,m)}}}(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 p=i.push(a)-1,m=Object.keys(a).sort(n&&n(a));for(u="",f=0;f<m.length;f++){var x=m[f],k=s(a[x]);!k||(u&&(u+=","),u+=JSON.stringify(x)+":"+k)}return i.splice(p,1),"{"+u+"}"}},"stringify")(r)}});var oc=me((rc,Ra)=>{var ET=200,$x="__lodash_hash_undefined__",qx=9007199254740991,Ep="[object Arguments]",ST="[object Array]",Hx="[object Boolean]",jx="[object Date]",AT="[object Error]",Sp="[object Function]",zx="[object GeneratorFunction]",gl="[object Map]",Kx="[object Number]",Ap="[object Object]",Cx="[object Promise]",Vx="[object RegExp]",vl="[object Set]",Wx="[object String]",Gx="[object Symbol]",gp="[object WeakMap]",Yx="[object ArrayBuffer]",yl="[object DataView]",Jx="[object Float32Array]",Xx="[object Float64Array]",Zx="[object Int8Array]",Qx="[object Int16Array]",e6="[object Int32Array]",t6="[object Uint8Array]",r6="[object Uint8ClampedArray]",n6="[object Uint16Array]",i6="[object Uint32Array]",MT=/[\\^$.*+?()[\]{}|]/g,TT=/\w*$/,kT=/^\[object .+?Constructor\]$/,CT=/^(?:0|[1-9]\d*)$/,Mt={};Mt[Ep]=Mt[ST]=Mt[Yx]=Mt[yl]=Mt[Hx]=Mt[jx]=Mt[Jx]=Mt[Xx]=Mt[Zx]=Mt[Qx]=Mt[e6]=Mt[gl]=Mt[Kx]=Mt[Ap]=Mt[Vx]=Mt[vl]=Mt[Wx]=Mt[Gx]=Mt[t6]=Mt[r6]=Mt[n6]=Mt[i6]=!0;Mt[AT]=Mt[Sp]=Mt[gp]=!1;var DT=typeof global=="object"&&global&&global.Object===Object&&global,OT=typeof self=="object"&&self&&self.Object===Object&&self,Bi=DT||OT||Function("return this")(),o6=typeof rc=="object"&&rc&&!rc.nodeType&&rc,Dx=o6&&typeof Ra=="object"&&Ra&&!Ra.nodeType&&Ra,IT=Dx&&Dx.exports===o6;function PT(r,e){return r.set(e[0],e[1]),r}o(PT,"addMapEntry");function NT(r,e){return r.add(e),r}o(NT,"addSetEntry");function RT(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(RT,"arrayEach");function LT(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(LT,"arrayPush");function s6(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(s6,"arrayReduce");function BT(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(BT,"baseTimes");function UT(r,e){return r==null?void 0:r[e]}o(UT,"getValue");function a6(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch(t){}return e}o(a6,"isHostObject");function Ox(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(Ox,"mapToArray");function Mp(r,e){return function(t){return r(e(t))}}o(Mp,"overArg");function Ix(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(Ix,"setToArray");var FT=Array.prototype,$T=Function.prototype,xl=Object.prototype,bp=Bi["__core-js_shared__"],Px=function(){var r=/[^.]+$/.exec(bp&&bp.keys&&bp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),f6=$T.toString,go=xl.hasOwnProperty,wl=xl.toString,qT=RegExp("^"+f6.call(go).replace(MT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nx=IT?Bi.Buffer:void 0,Rx=Bi.Symbol,Lx=Bi.Uint8Array,HT=Mp(Object.getPrototypeOf,Object),jT=Object.create,zT=xl.propertyIsEnumerable,KT=FT.splice,Bx=Object.getOwnPropertySymbols,VT=Nx?Nx.isBuffer:void 0,WT=Mp(Object.keys,Object),vp=Ua(Bi,"DataView"),nc=Ua(Bi,"Map"),yp=Ua(Bi,"Promise"),xp=Ua(Bi,"Set"),wp=Ua(Bi,"WeakMap"),ic=Ua(Object,"create"),GT=vs(vp),YT=vs(nc),JT=vs(yp),XT=vs(xp),ZT=vs(wp),Ux=Rx?Rx.prototype:void 0,Fx=Ux?Ux.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 QT(){this.__data__=ic?ic(null):{}}o(QT,"hashClear");function ek(r){return this.has(r)&&delete this.__data__[r]}o(ek,"hashDelete");function tk(r){var e=this.__data__;if(ic){var t=e[r];return t===$x?void 0:t}return go.call(e,r)?e[r]:void 0}o(tk,"hashGet");function rk(r){var e=this.__data__;return ic?e[r]!==void 0:go.call(e,r)}o(rk,"hashHas");function nk(r,e){var t=this.__data__;return t[r]=ic&&e===void 0?$x:e,this}o(nk,"hashSet");gs.prototype.clear=QT;gs.prototype.delete=ek;gs.prototype.get=tk;gs.prototype.has=rk;gs.prototype.set=nk;function Ui(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(Ui,"ListCache");function ik(){this.__data__=[]}o(ik,"listCacheClear");function ok(r){var e=this.__data__,t=_l(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():KT.call(e,t,1),!0}o(ok,"listCacheDelete");function sk(r){var e=this.__data__,t=_l(e,r);return t<0?void 0:e[t][1]}o(sk,"listCacheGet");function ak(r){return _l(this.__data__,r)>-1}o(ak,"listCacheHas");function fk(r,e){var t=this.__data__,n=_l(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(fk,"listCacheSet");Ui.prototype.clear=ik;Ui.prototype.delete=ok;Ui.prototype.get=sk;Ui.prototype.has=ak;Ui.prototype.set=fk;function La(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(La,"MapCache");function ck(){this.__data__={hash:new gs,map:new(nc||Ui),string:new gs}}o(ck,"mapCacheClear");function uk(r){return El(this,r).delete(r)}o(uk,"mapCacheDelete");function lk(r){return El(this,r).get(r)}o(lk,"mapCacheGet");function dk(r){return El(this,r).has(r)}o(dk,"mapCacheHas");function hk(r,e){return El(this,r).set(r,e),this}o(hk,"mapCacheSet");La.prototype.clear=ck;La.prototype.delete=uk;La.prototype.get=lk;La.prototype.has=dk;La.prototype.set=hk;function Ba(r){this.__data__=new Ui(r)}o(Ba,"Stack");function pk(){this.__data__=new Ui}o(pk,"stackClear");function mk(r){return this.__data__.delete(r)}o(mk,"stackDelete");function bk(r){return this.__data__.get(r)}o(bk,"stackGet");function gk(r){return this.__data__.has(r)}o(gk,"stackHas");function vk(r,e){var t=this.__data__;if(t instanceof Ui){var n=t.__data__;if(!nc||n.length<ET-1)return n.push([r,e]),this;t=this.__data__=new La(n)}return t.set(r,e),this}o(vk,"stackSet");Ba.prototype.clear=pk;Ba.prototype.delete=mk;Ba.prototype.get=bk;Ba.prototype.has=gk;Ba.prototype.set=vk;function yk(r,e){var t=kp(r)||jk(r)?BT(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||go.call(r,s))&&!(i&&(s=="length"||Fk(s,n)))&&t.push(s);return t}o(yk,"arrayLikeKeys");function c6(r,e,t){var n=r[e];(!(go.call(r,e)&&h6(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(c6,"assignValue");function _l(r,e){for(var t=r.length;t--;)if(h6(r[t][0],e))return t;return-1}o(_l,"assocIndexOf");function xk(r,e){return r&&u6(e,Cp(e),r)}o(xk,"baseAssign");function _p(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(!Sl(r))return r;var u=kp(r);if(u){if(f=Lk(r),!e)return Pk(r,f)}else{var p=bs(r),m=p==Sp||p==zx;if(Kk(r))return Mk(r,e);if(p==Ap||p==Ep||m&&!s){if(a6(r))return s?r:{};if(f=Bk(m?{}:r),!e)return Nk(r,xk(f,r))}else{if(!Mt[p])return s?r:{};f=Uk(r,p,_p,e)}}a||(a=new Ba);var x=a.get(r);if(x)return x;if(a.set(r,f),!u)var k=t?Rk(r):Cp(r);return RT(k||r,function(I,T){k&&(T=I,I=r[T]),c6(f,T,_p(I,e,t,n,T,r,a))}),f}o(_p,"baseClone");function wk(r){return Sl(r)?jT(r):{}}o(wk,"baseCreate");function _k(r,e,t){var n=e(r);return kp(r)?n:LT(n,t(r))}o(_k,"baseGetAllKeys");function Ek(r){return wl.call(r)}o(Ek,"baseGetTag");function Sk(r){if(!Sl(r)||qk(r))return!1;var e=m6(r)||a6(r)?qT:kT;return e.test(vs(r))}o(Sk,"baseIsNative");function Ak(r){if(!d6(r))return WT(r);var e=[];for(var t in Object(r))go.call(r,t)&&t!="constructor"&&e.push(t);return e}o(Ak,"baseKeys");function Mk(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(Mk,"cloneBuffer");function Tp(r){var e=new r.constructor(r.byteLength);return new Lx(e).set(new Lx(r)),e}o(Tp,"cloneArrayBuffer");function Tk(r,e){var t=e?Tp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(Tk,"cloneDataView");function kk(r,e,t){var n=e?t(Ox(r),!0):Ox(r);return s6(n,PT,new r.constructor)}o(kk,"cloneMap");function Ck(r){var e=new r.constructor(r.source,TT.exec(r));return e.lastIndex=r.lastIndex,e}o(Ck,"cloneRegExp");function Dk(r,e,t){var n=e?t(Ix(r),!0):Ix(r);return s6(n,NT,new r.constructor)}o(Dk,"cloneSet");function Ok(r){return Fx?Object(Fx.call(r)):{}}o(Ok,"cloneSymbol");function Ik(r,e){var t=e?Tp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Ik,"cloneTypedArray");function Pk(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(Pk,"copyArray");function u6(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;c6(t,a,f===void 0?r[a]:f)}return t}o(u6,"copyObject");function Nk(r,e){return u6(r,l6(r),e)}o(Nk,"copySymbols");function Rk(r){return _k(r,Cp,l6)}o(Rk,"getAllKeys");function El(r,e){var t=r.__data__;return $k(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(El,"getMapData");function Ua(r,e){var t=UT(r,e);return Sk(t)?t:void 0}o(Ua,"getNative");var l6=Bx?Mp(Bx,Object):Gk,bs=Ek;(vp&&bs(new vp(new ArrayBuffer(1)))!=yl||nc&&bs(new nc)!=gl||yp&&bs(yp.resolve())!=Cx||xp&&bs(new xp)!=vl||wp&&bs(new wp)!=gp)&&(bs=o(function(r){var e=wl.call(r),t=e==Ap?r.constructor:void 0,n=t?vs(t):void 0;if(n)switch(n){case GT:return yl;case YT:return gl;case JT:return Cx;case XT:return vl;case ZT:return gp}return e},"getTag"));function Lk(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(Lk,"initCloneArray");function Bk(r){return typeof r.constructor=="function"&&!d6(r)?wk(HT(r)):{}}o(Bk,"initCloneObject");function Uk(r,e,t,n){var i=r.constructor;switch(e){case Yx:return Tp(r);case Hx:case jx:return new i(+r);case yl:return Tk(r,n);case Jx:case Xx:case Zx:case Qx:case e6:case t6:case r6:case n6:case i6:return Ik(r,n);case gl:return kk(r,n,t);case Kx:case Wx:return new i(r);case Vx:return Ck(r);case vl:return Dk(r,n,t);case Gx:return Ok(r)}}o(Uk,"initCloneByTag");function Fk(r,e){return e=e==null?qx:e,!!e&&(typeof r=="number"||CT.test(r))&&r>-1&&r%1==0&&r<e}o(Fk,"isIndex");function $k(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o($k,"isKeyable");function qk(r){return!!Px&&Px in r}o(qk,"isMasked");function d6(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||xl;return r===t}o(d6,"isPrototype");function vs(r){if(r!=null){try{return f6.call(r)}catch(e){}try{return r+""}catch(e){}}return""}o(vs,"toSource");function Hk(r){return _p(r,!0,!0)}o(Hk,"cloneDeep");function h6(r,e){return r===e||r!==r&&e!==e}o(h6,"eq");function jk(r){return zk(r)&&go.call(r,"callee")&&(!zT.call(r,"callee")||wl.call(r)==Ep)}o(jk,"isArguments");var kp=Array.isArray;function p6(r){return r!=null&&Vk(r.length)&&!m6(r)}o(p6,"isArrayLike");function zk(r){return Wk(r)&&p6(r)}o(zk,"isArrayLikeObject");var Kk=VT||Yk;function m6(r){var e=Sl(r)?wl.call(r):"";return e==Sp||e==zx}o(m6,"isFunction");function Vk(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=qx}o(Vk,"isLength");function Sl(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(Sl,"isObject");function Wk(r){return!!r&&typeof r=="object"}o(Wk,"isObjectLike");function Cp(r){return p6(r)?yk(r):Ak(r)}o(Cp,"keys");function Gk(){return[]}o(Gk,"stubArray");function Yk(){return!1}o(Yk,"stubFalse");Ra.exports=Hk});var B6=me((zF,Tl)=>{var b6,g6,v6,y6,x6,w6,_6,E6,S6,Al,Dp,A6,M6,T6,Fa,k6,C6,D6,O6,I6,P6,N6,R6,L6,Ml;(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 Tl=="object"&&typeof Tl.exports=="object"?r(t(e,t(Tl.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])};b6=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"),g6=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},v6=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"),y6=o(function(n,i,s,a){var f=arguments.length,u=f<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,i,s,a);else for(var m=n.length-1;m>=0;m--)(p=n[m])&&(u=(f<3?p(u):f>3?p(i,s,u):p(i,s))||u);return f>3&&u&&Object.defineProperty(i,s,u),u},"__decorate"),x6=o(function(n,i){return function(s,a){i(s,a,n)}},"__param"),w6=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),_6=o(function(n,i,s,a){function f(u){return u instanceof s?u:new s(function(p){p(u)})}return o(f,"adopt"),new(s||(s=Promise))(function(u,p){function m(I){try{k(a.next(I))}catch(T){p(T)}}o(m,"fulfilled");function x(I){try{k(a.throw(I))}catch(T){p(T)}}o(x,"rejected");function k(I){I.done?u(I.value):f(I.value).then(m,x)}o(k,"step"),k((a=a.apply(n,i||[])).next())})},"__awaiter"),E6=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,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(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"),S6=o(function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&Ml(i,n,s)},"__exportStar"),Ml=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]},Al=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"),Dp=o(function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),f,u=[],p;try{for(;(i===void 0||i-- >0)&&!(f=a.next()).done;)u.push(f.value)}catch(m){p={error:m}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(p)throw p.error}}return u},"__read"),A6=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Dp(arguments[i]));return n},"__spread"),M6=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],p=0,m=u.length;p<m;p++,f++)a[f]=u[p];return a},"__spreadArrays"),T6=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"),Fa=o(function(n){return this instanceof Fa?(this.v=n,this):new Fa(n)},"__await"),k6=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={},p("next"),p("throw"),p("return"),f[Symbol.asyncIterator]=function(){return this},f;function p(C){a[C]&&(f[C]=function($){return new Promise(function(O,U){u.push([C,$,O,U])>1||m(C,$)})})}function m(C,$){try{x(a[C]($))}catch(O){T(u[0][3],O)}}function x(C){C.value instanceof Fa?Promise.resolve(C.value.v).then(k,I):T(u[0][2],C)}function k(C){m("next",C)}function I(C){m("throw",C)}function T(C,$){C($),u.shift(),u.length&&m(u[0][0],u[0][1])}},"__asyncGenerator"),C6=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(p){return(s=!s)?{value:Fa(n[f](p)),done:f==="return"}:u?u(p):p}:u}},"__asyncDelegator"),D6=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 Al=="function"?Al(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(p){return new Promise(function(m,x){p=n[u](p),f(m,x,p.done,p.value)})}}function f(u,p,m,x){Promise.resolve(x).then(function(k){u({value:k,done:m})},p)}},"__asyncValues"),O6=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};I6=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)&&Ml(i,n,s);return t(i,n),i},"__importStar"),P6=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),N6=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"),R6=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"),L6=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",b6),r("__assign",g6),r("__rest",v6),r("__decorate",y6),r("__param",x6),r("__metadata",w6),r("__awaiter",_6),r("__generator",E6),r("__exportStar",S6),r("__createBinding",Ml),r("__values",Al),r("__read",Dp),r("__spread",A6),r("__spreadArrays",M6),r("__spreadArray",T6),r("__await",Fa),r("__asyncGenerator",k6),r("__asyncDelegator",C6),r("__asyncValues",D6),r("__makeTemplateObject",O6),r("__importStar",I6),r("__importDefault",P6),r("__classPrivateFieldGet",N6),r("__classPrivateFieldSet",R6),r("__classPrivateFieldIn",L6)})});var Sw=me((Fi,Ew)=>{var _w=typeof self!="undefined"?self:Fi,Jl=function(){function r(){this.fetch=!1,this.DOMException=_w.DOMException}return o(r,"F"),r.prototype=_w,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 p(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(p,"iteratorFor");function m(E){this.map={},E instanceof m?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(m,"Headers"),m.prototype.append=function(E,l){E=f(E),l=u(l);var g=this.map[E];this.map[E]=g?g+", "+l:l},m.prototype.delete=function(E){delete this.map[f(E)]},m.prototype.get=function(E){return E=f(E),this.has(E)?this.map[E]:null},m.prototype.has=function(E){return this.map.hasOwnProperty(f(E))},m.prototype.set=function(E,l){this.map[f(E)]=u(l)},m.prototype.forEach=function(E,l){for(var g in this.map)this.map.hasOwnProperty(g)&&E.call(l,this.map[g],g,this)},m.prototype.keys=function(){var E=[];return this.forEach(function(l,g){E.push(g)}),p(E)},m.prototype.values=function(){var E=[];return this.forEach(function(l){E.push(l)}),p(E)},m.prototype.entries=function(){var E=[];return this.forEach(function(l,g){E.push([g,l])}),p(E)},n.iterable&&(m.prototype[Symbol.iterator]=m.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 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 m(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 m(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 m,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 m(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 m(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=m,r.Request=H,r.Response=L),t.Headers=m,t.Request=H,t.Response=L,t.fetch=re,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(Jl);Jl.fetch.ponyfill=!0;delete Jl.fetch.polyfill;var Va=Jl;Fi=Va.fetch;Fi.default=Va.fetch;Fi.fetch=Va.fetch;Fi.Headers=Va.Headers;Fi.Request=Va.Request;Fi.Response=Va.Response;Ew.exports=Fi});var Bw=me((Zz,Lw)=>{"use strict";var AC=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=CC(n),this._batchScheduleFn=DC(n),this._cacheKeyFn=OC(n),this._cacheMap=IC(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=TC(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(m){u.push(function(){m(f)})})}}i.keys.push(n);var p=new Promise(function(m,x){i.callbacks.push({resolve:m,reject:x})});return s&&s.set(a,p),p},"load"),e.loadMany=o(function(n){if(!Rw(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}(),MC=typeof process=="object"&&typeof process.nextTick=="function"?function(r){Gp||(Gp=Promise.resolve()),Gp.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},Gp;function TC(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(){kC(r,t)}),t}o(TC,"getCurrentBatch");function kC(r,e){if(e.hasDispatched=!0,e.keys.length===0){Yp(e);return}var t=r._batchLoadFn(e.keys);if(!t||typeof t.then!="function")return Nw(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(!Rw(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"),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 R0=me((Ly,N0)=>{(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=rh().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 hd=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(hd>>>26)|0,hd&=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 pd=(S+D|0)+((v&8191)<<13)|0;S=(M+(v>>>13)|0)+(pd>>>26)|0,pd&=67108863,D=Math.imul(le,mt),v=Math.imul(le,bt),v=v+Math.imul(ge,mt)|0,M=Math.imul(ge,bt);var md=(S+D|0)+((v&8191)<<13)|0;return S=(M+(v>>>13)|0)+(md>>>26)|0,md&=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]=hd,b[17]=pd,b[18]=md,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 N0=="undefined"||N0,Ly)});var _3=me((RU,w3)=>{w3.exports=G0;var x3=128,BM=127,UM=~BM,FM=Math.pow(2,31);function G0(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw G0.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=FM;)e[t++]=r&255|x3,r/=128;for(;r&UM;)e[t++]=r&255|x3,r>>>=7;return e[t]=r|0,G0.bytes=t-n+1,e}o(G0,"encode")});var M3=me((LU,S3)=>{S3.exports=Y0;var $M=128,E3=127;function Y0(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f||i>49)throw Y0.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&E3)<<i:(a&E3)*Math.pow(2,i),i+=7}while(a>=$M);return Y0.bytes=s-n,t}o(Y0,"read")});var T3=me((BU,A3)=>{var qM=Math.pow(2,7),HM=Math.pow(2,14),jM=Math.pow(2,21),zM=Math.pow(2,28),KM=Math.pow(2,35),VM=Math.pow(2,42),WM=Math.pow(2,49),GM=Math.pow(2,56),YM=Math.pow(2,63);A3.exports=function(r){return r<qM?1:r<HM?2:r<jM?3:r<zM?4:r<KM?5:r<VM?6:r<WM?7:r<GM?8:r<YM?9:10}});var Gf=me((UU,k3)=>{k3.exports={encode:_3(),decode:M3(),encodingLength:T3()}});var D3=me((FU,C3)=>{"use strict";function JM(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(JM,"base");C3.exports=JM});var ol=me(($U,I3)=>{"use strict";var XM=new TextDecoder,ZM=o(r=>XM.decode(r),"decodeText"),QM=new TextEncoder,eA=o(r=>QM.encode(r),"encodeText");function tA(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(tA,"concat");I3.exports={decodeText:ZM,encodeText:eA,concat:tA}});var P3=me((qU,O3)=>{"use strict";var{encodeText:rA}=ol(),sl=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=rA(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(sl,"Base");O3.exports=sl});var R3=me((HU,N3)=>{"use strict";var nA=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"),iA=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"),oA=o(r=>e=>({encode(t){return iA(t,e,r)},decode(t){return nA(t,e,r)}}),"rfc4648");N3.exports={rfc4648:oA}});var F3=me((jU,U3)=>{"use strict";var Yf=D3(),sA=P3(),{rfc4648:nr}=R3(),{decodeText:aA,encodeText:fA}=ol(),cA=o(()=>({encode:aA,decode:fA}),"identity"),L3=[["identity","\0",cA,""],["base2","0",nr(1),"01"],["base8","7",nr(3),"01234567"],["base10","9",Yf,"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",Yf,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Yf,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Yf,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Yf,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],B3=L3.reduce((r,e)=>(r[e[0]]=new sA(e[0],e[1],e[2],e[3]),r),{}),uA=L3.reduce((r,e)=>(r[e[1]]=B3[e[0]],r),{});U3.exports={names:B3,codes:uA}});var J0=me((Ri,q3)=>{"use strict";var Da=F3(),{encodeText:lA,decodeText:al,concat:$3}=ol();function dA(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=hs(r);return bA(t,e),$3([n,e],n.length+e.length)}o(dA,"multibase");function hA(r,e){let t=hs(r),n=lA(t.encode(e));return $3([t.codeBuf,n],t.codeBuf.length+n.length)}o(hA,"encode");function pA(r){r instanceof Uint8Array&&(r=al(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(pA,"decode");function mA(r){if(r instanceof Uint8Array&&(r=al(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return hs(r[0]).name}catch(e){return!1}}o(mA,"isEncoded");function bA(r,e){hs(r).decode(al(e))}o(bA,"validEncode");function hs(r){if(Object.prototype.hasOwnProperty.call(Da.names,r))return Da.names[r];if(Object.prototype.hasOwnProperty.call(Da.codes,r))return Da.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(hs,"encoding");function gA(r){return r instanceof Uint8Array&&(r=al(r)),hs(r[0])}o(gA,"encodingFromData");Ri=q3.exports=dA;Ri.encode=hA;Ri.decode=pA;Ri.isEncoded=mA;Ri.encoding=hs;Ri.encodingFromData=gA;var vA=Object.freeze(Da.names),yA=Object.freeze(Da.codes);Ri.names=vA;Ri.codes=yA});var j3=me((zU,H3)=>{"use strict";function xA(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(xA,"compare");H3.exports=xA});var K3=me((KU,z3)=>{"use strict";function wA(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(wA,"concat");z3.exports=wA});var W3=me((VU,V3)=>{"use strict";function _A(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(_A,"equals");V3.exports=_A});var Z0=me((WU,X3)=>{"use strict";var{bases:G3}=(Kc(),tf(v1));function J3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}o(J3,"createCodec");var Y3=J3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),X0=J3("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}),EA=ie({utf8:Y3,"utf-8":Y3,hex:G3.base16,latin1:X0,ascii:X0,binary:X0},G3);X3.exports=EA});var Q3=me((GU,Z3)=>{"use strict";var SA=Z0();function MA(r,e="utf8"){let t=SA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}o(MA,"fromString");Z3.exports=MA});var tx=me((YU,ex)=>{"use strict";var AA=Z0();function TA(r,e="utf8"){let t=AA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}o(TA,"toString");ex.exports=TA});var nx=me((JU,rx)=>{"use strict";function kA(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(kA,"xor");rx.exports=kA});var Q0=me((XU,ix)=>{"use strict";var CA=j3(),DA=K3(),IA=W3(),OA=Q3(),PA=tx(),NA=nx();ix.exports={compare:CA,concat:DA,equals:IA,fromString:OA,toString:PA,xor:NA}});var ox=me(ai=>{"use strict";var RA=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]}),LA=ai&&ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),BA=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)&&RA(e,r,t);return LA(e,r),e};Object.defineProperty(ai,"__esModule",{value:!0});ai.keyToDidDoc=void 0;var UA=BA(Q0());function FA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:UA.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(FA,"keyToDidDoc");ai.keyToDidDoc=FA});var sx=me(fi=>{"use strict";var $A=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]}),qA=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),HA=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)&&$A(e,r,t);return qA(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.keyToDidDoc=void 0;var ep=HA(Q0()),jA=mu();function zA(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${ep.toString(e,"base58btc")}`}o(zA,"encodeKey");function KA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=jA.convertPublicKeyToX25519(r),s=`${t}#${zA(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:ep.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:ep.toString(i,"base58btc")}]}}o(KA,"keyToDidDoc");fi.keyToDidDoc=KA});var dx=me(Fr=>{"use strict";var VA=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]}),WA=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),cx=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)&&VA(e,r,t);return WA(e,r),e},ux=Fr&&Fr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getResolver=void 0;var ax=ux(Gf()),GA=ux(J0()),YA=cx(ox()),JA=cx(sx()),XA="application/did+ld+json",fx="application/did+json",ZA={231:YA,237:JA};function lx(){return{key:(r,e,t,n)=>Z(this,null,function*(){let i=n.accept||fx,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let a=GA.default.decode(e.id),f=ax.default.decode(a),u=a.slice(ax.default.decode.bytes),m=yield ZA[f].keyToDidDoc(u,e.id);i===XA?(m["@context"]="https://w3id.org/did/v1",s.didDocument=m):i===fx?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(lx,"getResolver");Fr.getResolver=lx;Fr.default={getResolver:lx}});var px=me((tF,hx)=>{"use strict";hx.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 oc=me((rc,Ra)=>{var ST=200,$x="__lodash_hash_undefined__",qx=9007199254740991,Ep="[object Arguments]",MT="[object Array]",Hx="[object Boolean]",jx="[object Date]",AT="[object Error]",Sp="[object Function]",zx="[object GeneratorFunction]",gl="[object Map]",Kx="[object Number]",Mp="[object Object]",Cx="[object Promise]",Vx="[object RegExp]",vl="[object Set]",Wx="[object String]",Gx="[object Symbol]",gp="[object WeakMap]",Yx="[object ArrayBuffer]",yl="[object DataView]",Jx="[object Float32Array]",Xx="[object Float64Array]",Zx="[object Int8Array]",Qx="[object Int16Array]",e6="[object Int32Array]",t6="[object Uint8Array]",r6="[object Uint8ClampedArray]",n6="[object Uint16Array]",i6="[object Uint32Array]",TT=/[\\^$.*+?()[\]{}|]/g,kT=/\w*$/,CT=/^\[object .+?Constructor\]$/,DT=/^(?:0|[1-9]\d*)$/,At={};At[Ep]=At[MT]=At[Yx]=At[yl]=At[Hx]=At[jx]=At[Jx]=At[Xx]=At[Zx]=At[Qx]=At[e6]=At[gl]=At[Kx]=At[Mp]=At[Vx]=At[vl]=At[Wx]=At[Gx]=At[t6]=At[r6]=At[n6]=At[i6]=!0;At[AT]=At[Sp]=At[gp]=!1;var IT=typeof global=="object"&&global&&global.Object===Object&&global,OT=typeof self=="object"&&self&&self.Object===Object&&self,Bi=IT||OT||Function("return this")(),o6=typeof rc=="object"&&rc&&!rc.nodeType&&rc,Dx=o6&&typeof Ra=="object"&&Ra&&!Ra.nodeType&&Ra,PT=Dx&&Dx.exports===o6;function NT(r,e){return r.set(e[0],e[1]),r}o(NT,"addMapEntry");function RT(r,e){return r.add(e),r}o(RT,"addSetEntry");function LT(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(LT,"arrayEach");function BT(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(BT,"arrayPush");function s6(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(s6,"arrayReduce");function UT(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(UT,"baseTimes");function FT(r,e){return r==null?void 0:r[e]}o(FT,"getValue");function a6(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch(t){}return e}o(a6,"isHostObject");function Ix(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(Ix,"mapToArray");function Ap(r,e){return function(t){return r(e(t))}}o(Ap,"overArg");function Ox(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(Ox,"setToArray");var $T=Array.prototype,qT=Function.prototype,xl=Object.prototype,bp=Bi["__core-js_shared__"],Px=function(){var r=/[^.]+$/.exec(bp&&bp.keys&&bp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),f6=qT.toString,go=xl.hasOwnProperty,wl=xl.toString,HT=RegExp("^"+f6.call(go).replace(TT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nx=PT?Bi.Buffer:void 0,Rx=Bi.Symbol,Lx=Bi.Uint8Array,jT=Ap(Object.getPrototypeOf,Object),zT=Object.create,KT=xl.propertyIsEnumerable,VT=$T.splice,Bx=Object.getOwnPropertySymbols,WT=Nx?Nx.isBuffer:void 0,GT=Ap(Object.keys,Object),vp=Ua(Bi,"DataView"),nc=Ua(Bi,"Map"),yp=Ua(Bi,"Promise"),xp=Ua(Bi,"Set"),wp=Ua(Bi,"WeakMap"),ic=Ua(Object,"create"),YT=vs(vp),JT=vs(nc),XT=vs(yp),ZT=vs(xp),QT=vs(wp),Ux=Rx?Rx.prototype:void 0,Fx=Ux?Ux.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 ek(){this.__data__=ic?ic(null):{}}o(ek,"hashClear");function tk(r){return this.has(r)&&delete this.__data__[r]}o(tk,"hashDelete");function rk(r){var e=this.__data__;if(ic){var t=e[r];return t===$x?void 0:t}return go.call(e,r)?e[r]:void 0}o(rk,"hashGet");function nk(r){var e=this.__data__;return ic?e[r]!==void 0:go.call(e,r)}o(nk,"hashHas");function ik(r,e){var t=this.__data__;return t[r]=ic&&e===void 0?$x:e,this}o(ik,"hashSet");gs.prototype.clear=ek;gs.prototype.delete=tk;gs.prototype.get=rk;gs.prototype.has=nk;gs.prototype.set=ik;function Ui(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(Ui,"ListCache");function ok(){this.__data__=[]}o(ok,"listCacheClear");function sk(r){var e=this.__data__,t=_l(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():VT.call(e,t,1),!0}o(sk,"listCacheDelete");function ak(r){var e=this.__data__,t=_l(e,r);return t<0?void 0:e[t][1]}o(ak,"listCacheGet");function fk(r){return _l(this.__data__,r)>-1}o(fk,"listCacheHas");function ck(r,e){var t=this.__data__,n=_l(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(ck,"listCacheSet");Ui.prototype.clear=ok;Ui.prototype.delete=sk;Ui.prototype.get=ak;Ui.prototype.has=fk;Ui.prototype.set=ck;function La(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(La,"MapCache");function uk(){this.__data__={hash:new gs,map:new(nc||Ui),string:new gs}}o(uk,"mapCacheClear");function lk(r){return El(this,r).delete(r)}o(lk,"mapCacheDelete");function dk(r){return El(this,r).get(r)}o(dk,"mapCacheGet");function hk(r){return El(this,r).has(r)}o(hk,"mapCacheHas");function pk(r,e){return El(this,r).set(r,e),this}o(pk,"mapCacheSet");La.prototype.clear=uk;La.prototype.delete=lk;La.prototype.get=dk;La.prototype.has=hk;La.prototype.set=pk;function Ba(r){this.__data__=new Ui(r)}o(Ba,"Stack");function mk(){this.__data__=new Ui}o(mk,"stackClear");function bk(r){return this.__data__.delete(r)}o(bk,"stackDelete");function gk(r){return this.__data__.get(r)}o(gk,"stackGet");function vk(r){return this.__data__.has(r)}o(vk,"stackHas");function yk(r,e){var t=this.__data__;if(t instanceof Ui){var n=t.__data__;if(!nc||n.length<ST-1)return n.push([r,e]),this;t=this.__data__=new La(n)}return t.set(r,e),this}o(yk,"stackSet");Ba.prototype.clear=mk;Ba.prototype.delete=bk;Ba.prototype.get=gk;Ba.prototype.has=vk;Ba.prototype.set=yk;function xk(r,e){var t=kp(r)||zk(r)?UT(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||go.call(r,s))&&!(i&&(s=="length"||$k(s,n)))&&t.push(s);return t}o(xk,"arrayLikeKeys");function c6(r,e,t){var n=r[e];(!(go.call(r,e)&&h6(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(c6,"assignValue");function _l(r,e){for(var t=r.length;t--;)if(h6(r[t][0],e))return t;return-1}o(_l,"assocIndexOf");function wk(r,e){return r&&u6(e,Cp(e),r)}o(wk,"baseAssign");function _p(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(!Sl(r))return r;var u=kp(r);if(u){if(f=Bk(r),!e)return Nk(r,f)}else{var m=bs(r),p=m==Sp||m==zx;if(Vk(r))return Tk(r,e);if(m==Mp||m==Ep||p&&!s){if(a6(r))return s?r:{};if(f=Uk(p?{}:r),!e)return Rk(r,wk(f,r))}else{if(!At[m])return s?r:{};f=Fk(r,m,_p,e)}}a||(a=new Ba);var x=a.get(r);if(x)return x;if(a.set(r,f),!u)var k=t?Lk(r):Cp(r);return LT(k||r,function(O,T){k&&(T=O,O=r[T]),c6(f,T,_p(O,e,t,n,T,r,a))}),f}o(_p,"baseClone");function _k(r){return Sl(r)?zT(r):{}}o(_k,"baseCreate");function Ek(r,e,t){var n=e(r);return kp(r)?n:BT(n,t(r))}o(Ek,"baseGetAllKeys");function Sk(r){return wl.call(r)}o(Sk,"baseGetTag");function Mk(r){if(!Sl(r)||Hk(r))return!1;var e=m6(r)||a6(r)?HT:CT;return e.test(vs(r))}o(Mk,"baseIsNative");function Ak(r){if(!d6(r))return GT(r);var e=[];for(var t in Object(r))go.call(r,t)&&t!="constructor"&&e.push(t);return e}o(Ak,"baseKeys");function Tk(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(Tk,"cloneBuffer");function Tp(r){var e=new r.constructor(r.byteLength);return new Lx(e).set(new Lx(r)),e}o(Tp,"cloneArrayBuffer");function kk(r,e){var t=e?Tp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(kk,"cloneDataView");function Ck(r,e,t){var n=e?t(Ix(r),!0):Ix(r);return s6(n,NT,new r.constructor)}o(Ck,"cloneMap");function Dk(r){var e=new r.constructor(r.source,kT.exec(r));return e.lastIndex=r.lastIndex,e}o(Dk,"cloneRegExp");function Ik(r,e,t){var n=e?t(Ox(r),!0):Ox(r);return s6(n,RT,new r.constructor)}o(Ik,"cloneSet");function Ok(r){return Fx?Object(Fx.call(r)):{}}o(Ok,"cloneSymbol");function Pk(r,e){var t=e?Tp(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Pk,"cloneTypedArray");function Nk(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(Nk,"copyArray");function u6(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;c6(t,a,f===void 0?r[a]:f)}return t}o(u6,"copyObject");function Rk(r,e){return u6(r,l6(r),e)}o(Rk,"copySymbols");function Lk(r){return Ek(r,Cp,l6)}o(Lk,"getAllKeys");function El(r,e){var t=r.__data__;return qk(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(El,"getMapData");function Ua(r,e){var t=FT(r,e);return Mk(t)?t:void 0}o(Ua,"getNative");var l6=Bx?Ap(Bx,Object):Yk,bs=Sk;(vp&&bs(new vp(new ArrayBuffer(1)))!=yl||nc&&bs(new nc)!=gl||yp&&bs(yp.resolve())!=Cx||xp&&bs(new xp)!=vl||wp&&bs(new wp)!=gp)&&(bs=o(function(r){var e=wl.call(r),t=e==Mp?r.constructor:void 0,n=t?vs(t):void 0;if(n)switch(n){case YT:return yl;case JT:return gl;case XT:return Cx;case ZT:return vl;case QT:return gp}return e},"getTag"));function Bk(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(Bk,"initCloneArray");function Uk(r){return typeof r.constructor=="function"&&!d6(r)?_k(jT(r)):{}}o(Uk,"initCloneObject");function Fk(r,e,t,n){var i=r.constructor;switch(e){case Yx:return Tp(r);case Hx:case jx:return new i(+r);case yl:return kk(r,n);case Jx:case Xx:case Zx:case Qx:case e6:case t6:case r6:case n6:case i6:return Pk(r,n);case gl:return Ck(r,n,t);case Kx:case Wx:return new i(r);case Vx:return Dk(r);case vl:return Ik(r,n,t);case Gx:return Ok(r)}}o(Fk,"initCloneByTag");function $k(r,e){return e=e==null?qx:e,!!e&&(typeof r=="number"||DT.test(r))&&r>-1&&r%1==0&&r<e}o($k,"isIndex");function qk(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(qk,"isKeyable");function Hk(r){return!!Px&&Px in r}o(Hk,"isMasked");function d6(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||xl;return r===t}o(d6,"isPrototype");function vs(r){if(r!=null){try{return f6.call(r)}catch(e){}try{return r+""}catch(e){}}return""}o(vs,"toSource");function jk(r){return _p(r,!0,!0)}o(jk,"cloneDeep");function h6(r,e){return r===e||r!==r&&e!==e}o(h6,"eq");function zk(r){return Kk(r)&&go.call(r,"callee")&&(!KT.call(r,"callee")||wl.call(r)==Ep)}o(zk,"isArguments");var kp=Array.isArray;function p6(r){return r!=null&&Wk(r.length)&&!m6(r)}o(p6,"isArrayLike");function Kk(r){return Gk(r)&&p6(r)}o(Kk,"isArrayLikeObject");var Vk=WT||Jk;function m6(r){var e=Sl(r)?wl.call(r):"";return e==Sp||e==zx}o(m6,"isFunction");function Wk(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=qx}o(Wk,"isLength");function Sl(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(Sl,"isObject");function Gk(r){return!!r&&typeof r=="object"}o(Gk,"isObjectLike");function Cp(r){return p6(r)?xk(r):Ak(r)}o(Cp,"keys");function Yk(){return[]}o(Yk,"stubArray");function Jk(){return!1}o(Jk,"stubFalse");Ra.exports=jk});var B6=me((KF,Tl)=>{var b6,g6,v6,y6,x6,w6,_6,E6,S6,Ml,Dp,M6,A6,T6,Fa,k6,C6,D6,I6,O6,P6,N6,R6,L6,Al;(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 Tl=="object"&&typeof Tl.exports=="object"?r(t(e,t(Tl.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])};b6=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"),g6=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},v6=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"),y6=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"),x6=o(function(n,i){return function(s,a){i(s,a,n)}},"__param"),w6=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),_6=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"),E6=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"),S6=o(function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&Al(i,n,s)},"__exportStar"),Al=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]},Ml=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"),Dp=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"),M6=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Dp(arguments[i]));return n},"__spread"),A6=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"),T6=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"),Fa=o(function(n){return this instanceof Fa?(this.v=n,this):new Fa(n)},"__await"),k6=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 Fa?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"),C6=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:Fa(n[f](m)),done:f==="return"}:u?u(m):m}:u}},"__asyncDelegator"),D6=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 Ml=="function"?Ml(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"),I6=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};O6=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)&&Al(i,n,s);return t(i,n),i},"__importStar"),P6=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),N6=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"),R6=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"),L6=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",b6),r("__assign",g6),r("__rest",v6),r("__decorate",y6),r("__param",x6),r("__metadata",w6),r("__awaiter",_6),r("__generator",E6),r("__exportStar",S6),r("__createBinding",Al),r("__values",Ml),r("__read",Dp),r("__spread",M6),r("__spreadArrays",A6),r("__spreadArray",T6),r("__await",Fa),r("__asyncGenerator",k6),r("__asyncDelegator",C6),r("__asyncValues",D6),r("__makeTemplateObject",I6),r("__importStar",O6),r("__importDefault",P6),r("__classPrivateFieldGet",N6),r("__classPrivateFieldSet",R6),r("__classPrivateFieldIn",L6)})});var Sw=me((Fi,Ew)=>{var _w=typeof self!="undefined"?self:Fi,Jl=function(){function r(){this.fetch=!1,this.DOMException=_w.DOMException}return o(r,"F"),r.prototype=_w,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}({})})(Jl);Jl.fetch.ponyfill=!0;delete Jl.fetch.polyfill;var Va=Jl;Fi=Va.fetch;Fi.default=Va.fetch;Fi.fetch=Va.fetch;Fi.Headers=Va.Headers;Fi.Request=Va.Request;Fi.Response=Va.Response;Ew.exports=Fi});var Bw=me((Qz,Lw)=>{"use strict";var AC=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=DC(n),this._batchScheduleFn=IC(n),this._cacheKeyFn=OC(n),this._cacheMap=PC(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=kC(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(!Rw(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}(),TC=typeof process=="object"&&typeof process.nextTick=="function"?function(r){Gp||(Gp=Promise.resolve()),Gp.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},Gp;function kC(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(){CC(r,t)}),t}o(kC,"getCurrentBatch");function CC(r,e){if(e.hasDispatched=!0,e.keys.length===0){Yp(e);return}var t=r._batchLoadFn(e.keys);if(!t||typeof t.then!="function")return Nw(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(!Rw(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)));Yp(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){Nw(r,e,n)})}o(kC,"dispatchBatch");function Nw(r,e,t){Yp(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(Nw,"failedDispatch");function Yp(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Yp,"resolveCacheHits");function CC(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(CC,"getValidMaxBatchSize");function DC(r){var e=r&&r.batchScheduleFn;if(e===void 0)return MC;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(DC,"getValidBatchScheduleFn");function OC(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(OC,"getValidCacheKeyFn");function IC(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(IC,"getValidCacheMap");function Rw(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(Rw,"isArrayLike");Lw.exports=AC});var Xw=me((MK,Jw)=>{Jw.exports=Yw;var Gw=128,ZC=127,QC=~ZC,eD=Math.pow(2,31);function Yw(r,e,t){e=e||[],t=t||0;for(var n=t;r>=eD;)e[t++]=r&255|Gw,r/=128;for(;r&QC;)e[t++]=r&255|Gw,r>>>=7;return e[t]=r|0,Yw.bytes=t-n+1,e}o(Yw,"encode")});var e4=me((TK,Qw)=>{Qw.exports=am;var tD=128,Zw=127;function am(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw am.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Zw)<<i:(a&Zw)*Math.pow(2,i),i+=7}while(a>=tD);return am.bytes=s-n,t}o(am,"read")});var r4=me((kK,t4)=>{var rD=Math.pow(2,7),nD=Math.pow(2,14),iD=Math.pow(2,21),oD=Math.pow(2,28),sD=Math.pow(2,35),aD=Math.pow(2,42),fD=Math.pow(2,49),cD=Math.pow(2,56),uD=Math.pow(2,63);t4.exports=function(r){return r<rD?1:r<nD?2:r<iD?3:r<oD?4:r<sD?5:r<aD?6:r<fD?7:r<cD?8:r<uD?9:10}});var i4=me((CK,n4)=>{n4.exports={encode:Xw(),decode:e4(),encodingLength:r4()}});var s4=me((DK,o4)=>{"use strict";var lD=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});o4.exports={names:lD}});var h4=me((OK,d4)=>{"use strict";var a4=J0(),Ja=i4(),{names:gc}=s4(),{toString:od}=(df(),tf(_1)),{fromString:dD}=(Wc(),tf(w1)),{concat:hD}=(wd(),tf(Gm)),Xa={};for(let r in gc){let e=r;Xa[gc[e]]=e}Object.freeze(Xa);function pD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return od(r,"base16")}o(pD,"toHexString");function mD(r){return dD(r,"base16")}o(mD,"fromHexString");function bD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return od(a4.encode("base58btc",r)).slice(1)}o(bD,"toB58String");function gD(r){let e=r instanceof Uint8Array?od(r):r;return a4.decode("z"+e)}o(gD,"fromB58String");function f4(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=Ja.decode(r);if(!u4(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Ja.decode.bytes);let t=Ja.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Ja.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${od(r,"base16")}`);return{code:e,name:Xa[e],length:t,digest:r}}o(f4,"decode");function vD(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=c4(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=Ja.encode(n),s=Ja.encode(t);return hD([i,s,r],i.length+s.length+r.length)}o(vD,"encode");function c4(r){let e=r;if(typeof r=="string"){if(gc[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=gc[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Xa[e]===void 0&&!fm(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(c4,"coerceCode");function fm(r){return r>0&&r<16}o(fm,"isAppCode");function u4(r){return!!(fm(r)||Xa[r])}o(u4,"isValidCode");function l4(r){f4(r)}o(l4,"validate");function yD(r){return l4(r),r.subarray(0,2)}o(yD,"prefix");d4.exports={names:gc,codes:Xa,toHexString:pD,fromHexString:mD,toB58String:bD,fromB58String:gD,decode:f4,encode:vD,coerceCode:c4,isAppCode:fm,validate:l4,prefix:yD,isValidCode:u4}});var UI={};St(UI,{walletFromKey:()=>i5});module.exports=tf(UI);var lY=require("isomorphic-fetch");var ke,Nm=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Nm.decode();var Cc=null;function Ks(){return(Cc===null||Cc.buffer!==ke.memory.buffer)&&(Cc=new Uint8Array(ke.memory.buffer)),Cc}o(Ks,"getUint8Memory0");function gi(r,e){return Nm.decode(Ks().subarray(r,r+e))}o(gi,"getStringFromWasm0");var vi=new Array(32).fill(void 0);vi.push(void 0,null,!0,!1);var rf=vi.length;function Xe(r){rf===vi.length&&vi.push(vi.length+1);let e=rf;return rf=vi[e],vi[e]=r,e}o(Xe,"addHeapObject");function Oe(r){return vi[r]}o(Oe,"getObject");function l5(r){r<36||(vi[r]=rf,rf=r)}o(l5,"dropObject");function yi(r){let e=Oe(r);return l5(r),e}o(yi,"takeObject");var Rt=0,Oc=new TextEncoder("utf-8"),d5=typeof Oc.encodeInto=="function"?function(r,e){return Oc.encodeInto(r,e)}:function(r,e){let t=Oc.encode(r);return e.set(t),{read:r.length,written:t.length}};function Xt(r,e,t){if(t===void 0){let f=Oc.encode(r),u=e(f.length);return Ks().subarray(u,u+f.length).set(f),Rt=f.length,u}let n=r.length,i=e(n),s=Ks(),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=Ks().subarray(i+a,i+n);a+=d5(r,f).written}return Rt=a,i}o(Xt,"passStringToWasm0");function h5(r){return r==null}o(h5,"isLikeNone");var Dc=null;function _r(){return(Dc===null||Dc.buffer!==ke.memory.buffer)&&(Dc=new Int32Array(ke.memory.buffer)),Dc}o(_r,"getInt32Memory0");function yd(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+=yd(r[0]));for(let a=1;a<i;a++)s+=", "+yd(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}
|
633
|
-
${r.stack}`:n}o(yd,"debugString");function p5(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(p5,"makeMutClosure");function m5(r,e,t){ke._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(r,e,Xe(t))}o(m5,"__wbg_adapter_24");function b5(r,e){let t=e(r.length*1);return Ks().set(r,t/1),Rt=r.length,t}o(b5,"passArray8ToWasm0");function Rm(r){try{let f=ke.__wbindgen_add_to_stack_pointer(-16),u=b5(r,ke.__wbindgen_malloc),p=Rt;ke.generateEd25519KeyFromBytes(f,u,p);var e=_r()[f/4+0],t=_r()[f/4+1],n=_r()[f/4+2],i=_r()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,yi(n);return gi(s,a)}finally{ke.__wbindgen_add_to_stack_pointer(16),ke.__wbindgen_free(s,a)}}o(Rm,"generateEd25519KeyFromBytes");function Lm(r,e){try{let u=ke.__wbindgen_add_to_stack_pointer(-16),p=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),m=Rt,x=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),k=Rt;ke.keyToDID(u,p,m,x,k);var t=_r()[u/4+0],n=_r()[u/4+1],i=_r()[u/4+2],s=_r()[u/4+3],a=t,f=n;if(s)throw a=0,f=0,yi(i);return gi(a,f)}finally{ke.__wbindgen_add_to_stack_pointer(16),ke.__wbindgen_free(a,f)}}o(Lm,"keyToDID");function Ic(r,e){let t=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Rt,i=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Rt,a=ke.keyToVerificationMethod(t,n,i,s);return yi(a)}o(Ic,"keyToVerificationMethod");function Bm(r,e,t){let n=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),i=Rt,s=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),a=Rt,f=Xt(t,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt,p=ke.issueCredential(n,i,s,a,f,u);return yi(p)}o(Bm,"issueCredential");function Um(r,e){let t=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Rt,i=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Rt,a=ke.verifyCredential(t,n,i,s);return yi(a)}o(Um,"verifyCredential");function Fm(r,e,t){let n=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),i=Rt,s=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),a=Rt,f=Xt(t,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt,p=ke.issuePresentation(n,i,s,a,f,u);return yi(p)}o(Fm,"issuePresentation");function $m(r,e){let t=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Rt,i=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Rt,a=ke.verifyPresentation(t,n,i,s);return yi(a)}o($m,"verifyPresentation");function sr(r,e){try{return r.apply(this,e)}catch(t){ke.__wbindgen_exn_store(Xe(t))}}o(sr,"handleError");function g5(r,e){return Ks().subarray(r/1,r/1+e)}o(g5,"getArrayU8FromWasm0");function v5(r,e,t,n){ke.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(r,e,Xe(t),Xe(n))}o(v5,"__wbg_adapter_108");function y5(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(y5,"load");function qm(r){return Z(this,null,function*(){let e={};e.wbg={},e.wbg.__wbindgen_string_new=function(i,s){let a=gi(i,s);return Xe(a)},e.wbg.__wbindgen_object_drop_ref=function(i){yi(i)},e.wbg.__wbindgen_cb_drop=function(i){let s=yi(i).original;return s.cnt--==1?(s.a=0,!0):!1},e.wbg.__wbindgen_object_clone_ref=function(i){let s=Oe(i);return Xe(s)},e.wbg.__wbg_fetch_811d43d6bdcad5b1=function(i){let s=fetch(Oe(i));return Xe(s)},e.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(i,s){let a=Oe(i).fetch(Oe(s));return Xe(a)},e.wbg.__wbg_new_89d7f088c1c45353=function(){return sr(function(){let i=new Headers;return Xe(i)},arguments)},e.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return sr(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=h5(f)?0:Xt(f,ke.__wbindgen_malloc,ke.__wbindgen_realloc),p=Rt;_r()[i/4+1]=p,_r()[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=Xt(a,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt;_r()[i/4+1]=u,_r()[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 Xe(s)},e.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return sr(function(i){let s=Oe(i).arrayBuffer();return Xe(s)},arguments)},e.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return sr(function(i,s,a){let f=new Request(gi(i,s),Oe(a));return Xe(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 sr(function(){let i=self.self;return Xe(i)},arguments)},e.wbg.__wbg_crypto_b8c92eaac23d0d80=function(i){let s=Oe(i).crypto;return Xe(s)},e.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(i){let s=Oe(i).msCrypto;return Xe(s)},e.wbg.__wbindgen_is_undefined=function(i){return Oe(i)===void 0},e.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Xe(n)},e.wbg.__wbg_require_f5521a5b85ad2542=function(i,s,a){let f=Oe(i).require(gi(s,a));return Xe(f)},e.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(i){let s=Oe(i).getRandomValues;return Xe(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(g5(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 Xe(a)},e.wbg.__wbg_next_cabb70b365520721=function(i){let s=Oe(i).next;return Xe(s)},e.wbg.__wbg_next_bf3d83fc18df496e=function(){return sr(function(i){let s=Oe(i).next();return Xe(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 Xe(s)},e.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Xe(Symbol.iterator)},e.wbg.__wbg_get_a9cab131e3152c49=function(){return sr(function(i,s){let a=Reflect.get(Oe(i),Oe(s));return Xe(a)},arguments)},e.wbg.__wbg_call_ae78342adc33730a=function(){return sr(function(i,s){let a=Oe(i).call(Oe(s));return Xe(a)},arguments)},e.wbg.__wbg_new_36359baae5a47e27=function(){let i=new Object;return Xe(i)},e.wbg.__wbg_call_3ed288a247f13ea5=function(){return sr(function(i,s,a){let f=Oe(i).call(Oe(s),Oe(a));return Xe(f)},arguments)},e.wbg.__wbg_getTime_bffb1c09df09618b=function(i){return Oe(i).getTime()},e.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){let i=new Date;return Xe(i)},e.wbg.__wbg_new_37705eed627d5ed9=function(i,s){try{var a={a:i,b:s},f=o((p,m)=>{let x=a.a;a.a=0;try{return v5(x,a.b,p,m)}finally{a.a=x}},"cb0");let u=new Promise(f);return Xe(u)}finally{a.a=a.b=0}},e.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(i){let s=Promise.resolve(Oe(i));return Xe(s)},e.wbg.__wbg_then_ce526c837d07b68f=function(i,s){let a=Oe(i).then(Oe(s));return Xe(a)},e.wbg.__wbg_then_842e65b843962f56=function(i,s,a){let f=Oe(i).then(Oe(s),Oe(a));return Xe(f)},e.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return sr(function(){let i=self.self;return Xe(i)},arguments)},e.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return sr(function(){let i=window.window;return Xe(i)},arguments)},e.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return sr(function(){let i=globalThis.globalThis;return Xe(i)},arguments)},e.wbg.__wbg_global_5de1e0f82bddcd27=function(){return sr(function(){let i=global.global;return Xe(i)},arguments)},e.wbg.__wbg_buffer_7af23f65f6c64548=function(i){let s=Oe(i).buffer;return Xe(s)},e.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(i,s,a){let f=new Uint8Array(Oe(i),s>>>0,a>>>0);return Xe(f)},e.wbg.__wbg_new_cc9018bd6f283b6f=function(i){let s=new Uint8Array(Oe(i));return Xe(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 Xe(s)},e.wbg.__wbg_subarray_da527dbd24eafb6b=function(i,s,a){let f=Oe(i).subarray(s>>>0,a>>>0);return Xe(f)},e.wbg.__wbg_has_ce995ec88636803d=function(){return sr(function(i,s){return Reflect.has(Oe(i),Oe(s))},arguments)},e.wbg.__wbg_set_93b1c87ee2af852e=function(){return sr(function(i,s,a){return Reflect.set(Oe(i),Oe(s),Oe(a))},arguments)},e.wbg.__wbg_stringify_c760003feffcc1f2=function(){return sr(function(i){let s=JSON.stringify(Oe(i));return Xe(s)},arguments)},e.wbg.__wbindgen_debug_string=function(i,s){let a=yd(Oe(s)),f=Xt(a,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt;_r()[i/4+1]=u,_r()[i/4+0]=f},e.wbg.__wbindgen_throw=function(i,s){throw new Error(gi(i,s))},e.wbg.__wbindgen_memory=function(){let i=ke.memory;return Xe(i)},e.wbg.__wbindgen_closure_wrapper10902=function(i,s,a){let f=p5(i,s,3717,m5);return Xe(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 y5(yield r,e);return ke=t.exports,qm.__wbindgen_wasm_module=n,ke})}o(qm,"init");var Hm=qm;var jm=!1,x5=o((r="https://cdn.filestackcontent.com/jXExSjNXSerFVDMIYOgy")=>Z(void 0,null,function*(){if(!jm)return jm=!0,Hm(r)}),"init"),zm=x5;var Km=at(require("isomorphic-webcrypto"));typeof window=="undefined"&&(globalThis.crypto=Km.default);var _5=o((r,e)=>Z(void 0,null,function*(){return nf(r.contents,{plugins:[...r.plugins,e]})}),"addPluginToWallet"),E5=o((r,e)=>Z(void 0,null,function*(){return nf([...r.contents,e],r)}),"addToWallet"),S5=o((r,e)=>Z(void 0,null,function*(){let t=JSON.parse(JSON.stringify(r.contents)),n=t.find(i=>i.id===e);return nf(t.filter(i=>i.id!==n.id),r)}),"removeFromWallet"),A5=o((r,e)=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.bind(r,r)])),"bindMethods"),nf=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 E5(this,a)},remove:function(a){return S5(this,a)},status:"UNLOCKED",plugins:n,pluginMethods:i,addPlugin:function(a){return _5(this,a)}};return i&&(s.pluginMethods=A5(s,i)),s}),"generateWallet");function M5(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(M5,"_catch");function T5(){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 p;return((p=u.didResolutionMetadata)==null?void 0:p.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(T5,"inMemoryCache");function k5(r,e){return e()}o(k5,"noCache");var C5="(?:%[0-9a-fA-F]{2})",Vm=`(?:[a-zA-Z0-9._-]|${C5})`,D5="([a-z0-9]+)",O5=`((?:${Vm}*:)*(${Vm}+))`,Wm="[a-zA-Z0-9_.:%-]",I5=`;${Wm}+=${Wm}*`,P5=`((${I5})*)`,N5="(/[^#?]*)?",R5="([?][^#]*)?",L5="(#.*)?",B5=new RegExp(`^did:${D5}:${O5}${P5}${N5}${R5}${L5}$`);function xd(r){if(r===""||!r)return null;let e=r.match(B5);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(xd,"parse");var Pc={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function U5(r){return function(e,t,n){try{return Promise.resolve(M5(function(){return Promise.resolve(r(e,t,n)).then(function(i){return Me(ie({},Pc),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i})})},function(i){return Me(ie({},Pc),{didResolutionMetadata:{error:"notFound",message:i.toString()}})}))}catch(i){return Promise.reject(i)}}}o(U5,"wrapLegacyResolver");var of=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?T5():t.cache||k5,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=U5(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=xd(e);if(i===null)return Promise.resolve(Me(ie({},Pc),{didResolutionMetadata:{error:"invalidDid"}}));let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve(Me(ie({},Pc),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(n){return Promise.reject(n)}}};o(of,"Resolver");wd();Wc();df();Kc();var Jh=at(D1()),ev=at(th()),Xh=at(ng()),_u=at(mu()),tv=at(kg()),Tf=at(Ig()),Zh=at(Vg()),Qh=at(no());function sn(r){return Ot(r,"base64url")}o(sn,"bytesToBase64url");function Mr(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Lt(e,"base64url")}o(Mr,"base64ToBytes");function e0(r){return Lt(r,"base58btc")}o(e0,"base58ToBytes");function Wh(r){let e=r.startsWith("0x")?r.substring(2):r;return Lt(e.toLowerCase(),"base16")}o(Wh,"hexToBytes");function Gh(r){return sn(Lt(r))}o(Gh,"encodeBase64url");function rv(r){return Ot(Mr(r))}o(rv,"decodeBase64url");function ts(r){return Ot(r,"base16")}o(ts,"bytesToHex");function nv(r){return Lt(r)}o(nv,"stringToBytes");function AE({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(AE,"toJose");function ME(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(ME,"fromJose");function iv(r,e){return vn([Mr(r),Mr(e)])}o(iv,"toSealed");var TE=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,kE=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,CE=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function DE(r){if(typeof r=="string"){if(TE.test(r))return Wh(r);if(kE.test(r))return e0(r);if(CE.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(DE,"parseKey");function ov(r){let e=typeof r=="string"?Lt(r):r;return(0,Jh.hash)(e)}o(ov,"sha256");function OE(r){return new Uint8Array(ev.keccak_256.arrayBuffer(r))}o(OE,"keccak");function IE(r){let e=Lt(r.slice(2),"base16");return`0x${Ot(OE(e).slice(-20),"base16")}`}o(IE,"toEthereumAddress");function Yh(r,e=new Uint8Array(4)){let t=Lt(r.toString(),"base10");return e.set(t,4-t.length),e}o(Yh,"writeUint32BE");var Vh=o(r=>vn([Yh(r.length),r]),"lengthAndInput");function sv(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=vn([Vh(Lt(t)),Vh(typeof n=="undefined"?new Uint8Array(0):n),Vh(typeof i=="undefined"?new Uint8Array(0):i),Yh(e)]);return(0,Jh.hash)(vn([Yh(1),r,s]))}o(sv,"concatKDF");var eR=new Xh.ec("secp256k1");function av(r){let e=DE(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"?nv(t):t,i=(0,_u.sign)(e,n);return Promise.resolve(sn(i))}catch(n){return Promise.reject(n)}}}o(av,"EdDSASigner");function fv(r){return typeof r=="object"&&"r"in r&&"s"in r}o(fv,"instanceOfEcdsaSignature");function Wg(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(fv(i))return AE(i,r);if(r&&typeof ME(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(Wg,"ES256KSignerAlg");function Gg(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(fv(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(Gg,"Ed25519SignerAlg");var PE={ES256K:Wg(),"ES256K-R":Wg(!0),Ed25519:Gg(),EdDSA:Gg()};function NE(r){let e=PE[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(NE,"SignerAlg");var t0=new Xh.ec("secp256k1");function wu(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(wu,"toSignatureObject");function r0(r){if(r.publicKeyBase58)return e0(r.publicKeyBase58);if(r.publicKeyBase64)return Mr(r.publicKeyBase64);if(r.publicKeyHex)return Wh(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return Wh(t0.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}=Js;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(r0,"extractPublicKeyBytes");function RE(r,e,t){let n=ov(r),i=wu(e),s=t.filter(({ethereumAddress:u,blockchainAccountId:p})=>typeof u=="undefined"&&typeof p=="undefined"),a=t.filter(({ethereumAddress:u,blockchainAccountId:p})=>typeof u!="undefined"||typeof p!==void 0),f=s.find(u=>{try{let p=r0(u);return t0.keyFromPublic(p).verify(n,i)}catch(p){return!1}});if(!f&&a.length>0&&(f=cv(r,e,a)),!f)throw new Error("invalid_signature: Signature invalid for JWT");return f}o(RE,"verifyES256K");function cv(r,e,t){let n;if(e.length>86)n=[wu(e,!0)];else{let a=wu(e,!1);n=[Me(ie({},a),{recoveryParam:0}),Me(ie({},a),{recoveryParam:1})]}let i=o(a=>{let f=ov(r),u=t0.recoverPubKey(f,a,a.recoveryParam),p=u.encode("hex"),m=u.encode("hex",!0),x=IE(p);return t.find(I=>{var T,C,$;let O=ts(r0(I));return O===p||O===m||((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(cv,"verifyRecoverableES256K");function Yg(r,e,t){let n=nv(r),i=Mr(e),s=t.find(a=>(0,_u.verify)(r0(a),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Yg,"verifyEd25519");var LE={ES256K:RE,"ES256K-R":cv,Ed25519:Yg,EdDSA:Yg};function uv(r){let e=LE[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(uv,"VerifierAlgorithm");uv.toSignatureObject=wu;var lv=o(function(r,e,t={},n={}){try{t.alg||(t.alg=BE);let i=typeof r=="string"?r:Jg(r,n.canonicalize),s=[Jg(t,n.canonicalize),i].join("."),a=NE(t.alg);return Promise.resolve(a(s,e)).then(function(f){return[s,f].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var BE="ES256K";function Jg(r,e=!1){return Gh(e?(0,tv.default)(r):JSON.stringify(r))}o(Jg,"encodeSection");function UE(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(rv(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(UE,"decodeJWS");function FE({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),uv(r.alg)(e,t,n)}o(FE,"verifyJWSDecoded");function dv(r,e){let t=UE(r);return FE(t,e)}o(dv,"verifyJWS");function $E(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(m):n===1?s.then(p):a.then(x)).then(void 0,u),f;function p(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(m).then(void 0,u);return}s=t(),so(s)&&(s=s.v)}while(!s||!s.then);s.then(p).then(void 0,u)}o(p,"_resumeAfterBody");function m(k){k?(s=t(),s&&s.then?s.then(p).then(void 0,u):p(s)):qt(f,1,s)}o(m,"_resumeAfterTest");function x(){(i=r())?i.then?i.then(m).then(void 0,u):m(i):qt(f,1,s)}o(x,"_resumeAfterUpdate")}o($E,"_for");var hv=o(function(r,e){try{let n=function(p){if(f===null)throw new Error("failure: Failed to decrypt");return f};o(n,"_temp5");let t;jE(r);let i=JSON.parse(rv(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=iv(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(p){f=p}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let p=0;return $E(function(){return!f&&p<r.recipients.length},function(){return p++},function(){let m=r.recipients[p];Object.assign(m.header,i);let x=function(){if(m.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Mr(r.iv),a,m)).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"),Xg=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 qE(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(qE,"_forTo");function HE(r,e,t){if(typeof r[Xg]=="function"){let m=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(m,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(m,"_cycle");var n=r[Xg](),i,s,a;if(m(),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=[],p=0;p<r.length;p++)u.push(r[p]);return qE(u,function(m){return e(u[m])},t)}o(HE,"_forOf");function jE(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(jE,"validateJWE");function Zg({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(Zg,"encodeJWE");var pv=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 Zg(i,n)})}else{let i=e[0].enc;if(!e.reduce((u,p)=>u&&p.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,a,f=HE(e,function(u){let p=function(){return s?Promise.resolve(u.encryptCek==null?void 0:u.encryptCek(s)).then(function(m){if(m){var x,k;(x=a)==null||(k=x.recipients)==null||k.push(m)}}):Promise.resolve(u.encrypt(r,t,n)).then(function(m){s=m.cek,a=Zg(m,n)})}();if(p&&p.then)return p.then(function(){})});return Promise.resolve(f&&f.then?f.then(function(){return a}):a)}}catch(i){return Promise.reject(i)}},"createJWE");var mv=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 p=((f=a.keyAgreement)==null?void 0:f.map(m=>typeof m=="string"?[...a.publicKey||[],...a.verificationMethod||[]].find(x=>x.id===m):m).filter(m=>typeof m!="undefined")).filter(m=>m.type==="X25519KeyAgreementKey2019"&&Boolean(m.publicKeyBase58));if(!p.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return p.map(m=>KE(e0(m.publicKeyBase58),m.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 bv(r){let e=new Zh.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Qh.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(bv,"xc20pEncrypter");function zE(r){let e=o(function(s,a={},f){try{let u=Gh(JSON.stringify(Object.assign({alg:i},a,{enc:n}))),p=new Uint8Array(Buffer.from(f?`${u}.${sn(f)}`:u));return Promise.resolve(Me(ie({},t(s,p)),{protectedHeader:u}))}catch(u){return Promise.reject(u)}},"encrypt"),t=bv(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(zE,"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 Zh.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Qg,"xc20pDirDecrypter");function KE(r,e){let t=o(function(f,u={},p){try{Object.assign(u,{alg:void 0});let m=(0,Qh.randomBytes)(32);return Promise.resolve(zE(m).encrypt(f,u,p)).then(function(x){return Promise.resolve(n(m)).then(function(k){return Me(ie({},x),{recipient:k,cek:m})})})}catch(m){return Promise.reject(m)}},"encrypt"),n=o(function(f){try{let u=(0,Tf.generateKeyPair)(),p=(0,Tf.sharedKey)(u.secretKey,r),m=sv(p,s,i),x=bv(m)(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(KE,"x25519Encrypter");function VE(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(VE,"validateHeader");function gv(r){let e=o(function(s,a,f,u){try{let x=function(){let C=sv(I,n,t),$=iv(u.encrypted_key,u.header.tag);return Promise.resolve(Qg(C).decrypt($,Mr(u.header.iv))).then(function(O){return O===null?null:Qg(O).decrypt(s,a,f)})};o(x,"_temp4");var p,m;if(VE((p=u)==null?void 0:p.header),u=u,((m=u.header.epk)==null?void 0:m.crv)!==i||typeof u.header.epk.x=="undefined")return Promise.resolve(null);let k=Mr(u.header.epk.x),I,T=function(){if(r instanceof Uint8Array)I=(0,Tf.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(gv,"x25519Decrypter");Vd();var Eu=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),n0=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*n0(a,f))}else{let s=Pe.asCID(n);s?yield[i.join("/"),s]:yield*n0(n,i)}}},"links"),i0=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*i0(a,f))}else yield*i0(n,i)}},"tree"),WE=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"),Su=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:Eu(),bytes:Eu(),value:Eu(),asBlock:Eu()})}links(){return n0(this.value,[])}tree(){return i0(this.value,[])}get(e="/"){return WE(this.value,e.split("/").filter(Boolean))}};o(Su,"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 Su({value:r,bytes:i,cid:a})}),"encode");Vn();uf();jd();Ld();var Di={};St(Di,{code:()=>va,decode:()=>m0,encode:()=>Pf,name:()=>CS});var GE=["string","number","bigint","symbol"],YE=["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 vv(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(GE.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(JE(r))return"Buffer";let t=XE(r);return t||"Object"}o(vv,"is");function JE(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(JE,"isBuffer");function XE(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(YE.includes(e))return e}o(XE,"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 da=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",ZE=new TextDecoder,QE=new TextEncoder;function Au(r){return da&&globalThis.Buffer.isBuffer(r)}o(Au,"isBuffer");function s0(r){return r instanceof Uint8Array?Au(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(s0,"asU8A");var _v=da?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):xv(r,e,t):(r,e,t)=>t-e>64?ZE.decode(r.subarray(e,t)):xv(r,e,t),Ev=da?r=>r.length>64?globalThis.Buffer.from(r):yv(r):r=>r.length>64?QE.encode(r):yv(r),ri=o(r=>Uint8Array.from(r),"fromArray"),ha=da?(r,e,t)=>Au(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Sv=da?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),s0(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},Av=da?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Mv(r,e){if(Au(r)&&Au(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(Mv,"compare");function yv(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(yv,"utf8ToBytes");function xv(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,p,m;switch(a){case 1:i<128&&(s=i);break;case 2:f=r[e+1],(f&192)===128&&(m=(i&31)<<6|f&63,m>127&&(s=m));break;case 3:f=r[e+1],u=r[e+2],(f&192)===128&&(u&192)===128&&(m=(i&15)<<12|(f&63)<<6|u&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:f=r[e+1],u=r[e+2],p=r[e+3],(f&192)===128&&(u&192)===128&&(p&192)===128&&(m=(i&15)<<18|(f&63)<<12|(u&63)<<6|p&63,m>65535&&m<1114112&&(s=m))}}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 eS(n)}o(xv,"utf8Slice");var wv=4096;function eS(r){let e=r.length;if(e<=wv)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=wv));return t}o(eS,"decodeCodePointsArray");var tS=256,pa=class{constructor(e=tS){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=Av(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=ha(n,0,this.cursor)}else t=Sv(this.chunks,this.cursor);return e&&this.reset(),t}};o(pa,"Bl");var Ze="CBOR decode error:",a0="CBOR encode error:",kf=[];kf[23]=1;kf[24]=2;kf[25]=3;kf[26]=5;kf[27]=9;function Ci(r,e,t){if(r.length-e<t)throw new Error(`${Ze} not enough data for type`)}o(Ci,"assertEnoughData");var Vt=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Pr(r,e,t){Ci(r,e,1);let n=r[e];if(t.strict===!0&&n<Vt[0])throw new Error(`${Ze} integer encoded in more bytes than necessary (strict decode)`);return n}o(Pr,"readUint8");function Nr(r,e,t){Ci(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Vt[1])throw new Error(`${Ze} integer encoded in more bytes than necessary (strict decode)`);return n}o(Nr,"readUint16");function Rr(r,e,t){Ci(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(`${Ze} integer encoded in more bytes than necessary (strict decode)`);return n}o(Rr,"readUint32");function Lr(r,e,t){Ci(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(`${Ze} 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(`${Ze} integers outside of the safe integer range are not supported`)}o(Lr,"readUint64");function Tv(r,e,t,n){return new _e(de.uint,Pr(r,e+1,n),2)}o(Tv,"decodeUint8");function kv(r,e,t,n){return new _e(de.uint,Nr(r,e+1,n),3)}o(kv,"decodeUint16");function Cv(r,e,t,n){return new _e(de.uint,Rr(r,e+1,n),5)}o(Cv,"decodeUint32");function Dv(r,e,t,n){return new _e(de.uint,Lr(r,e+1,n),9)}o(Dv,"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(`${Ze} 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 Ov(r,e,t,n){return new _e(de.negint,-1-Pr(r,e+1,n),2)}o(Ov,"decodeNegint8");function Iv(r,e,t,n){return new _e(de.negint,-1-Nr(r,e+1,n),3)}o(Iv,"decodeNegint16");function Pv(r,e,t,n){return new _e(de.negint,-1-Rr(r,e+1,n),5)}o(Pv,"decodeNegint32");var f0=BigInt(-1),Nv=BigInt(1);function Rv(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(`${Ze} integers outside of the safe integer range are not supported`);return new _e(de.negint,f0-BigInt(i),9)}o(Rv,"decodeNegint64");function Mu(r,e){let t=e.value,n=typeof t=="bigint"?t*f0-Nv:t*-1-1;er(r,e.type.majorEncoded,n)}o(Mu,"encodeNegint");Mu.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*f0-Nv:t*-1-1;return n<Vt[0]?1:n<Vt[1]?2:n<Vt[2]?3:n<Vt[3]?5:9},"encodedSize");Mu.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function Cf(r,e,t,n){Ci(r,e,t+n);let i=ha(r,e+t,e+t+n);return new _e(de.bytes,i,t+n)}o(Cf,"toToken");function Lv(r,e,t,n){return Cf(r,e,1,t)}o(Lv,"decodeBytesCompact");function Bv(r,e,t,n){return Cf(r,e,2,Pr(r,e+1,n))}o(Bv,"decodeBytes8");function Uv(r,e,t,n){return Cf(r,e,3,Nr(r,e+1,n))}o(Uv,"decodeBytes16");function Fv(r,e,t,n){return Cf(r,e,5,Rr(r,e+1,n))}o(Fv,"decodeBytes32");function $v(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer bytes lengths not supported`);return Cf(r,e,9,i)}o($v,"decodeBytes64");function Tu(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===de.string?Ev(r.value):r.value),r.encodedBytes}o(Tu,"tokenBytes");function ma(r,e){let t=Tu(e);er(r,e.type.majorEncoded,t.length),r.push(t)}o(ma,"encodeBytes");ma.encodedSize=o(function(e){let t=Tu(e);return er.encodedSize(t.length)+t.length},"encodedSize");ma.compareTokens=o(function(e,t){return nS(Tu(e),Tu(t))},"compareTokens");function nS(r,e){return r.length<e.length?-1:r.length>e.length?1:Mv(r,e)}o(nS,"compareBytes");function Df(r,e,t,n,i){let s=t+n;Ci(r,e,s);let a=new _e(de.string,_v(r,e+t,e+s),s);return i.retainStringBytes===!0&&(a.byteValue=ha(r,e+t,e+s)),a}o(Df,"toToken");function qv(r,e,t,n){return Df(r,e,1,t,n)}o(qv,"decodeStringCompact");function Hv(r,e,t,n){return Df(r,e,2,Pr(r,e+1,n),n)}o(Hv,"decodeString8");function jv(r,e,t,n){return Df(r,e,3,Nr(r,e+1,n),n)}o(jv,"decodeString16");function zv(r,e,t,n){return Df(r,e,5,Rr(r,e+1,n),n)}o(zv,"decodeString32");function Kv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer string lengths not supported`);return Df(r,e,9,i,n)}o(Kv,"decodeString64");var Vv=ma;function ba(r,e,t,n){return new _e(de.array,n,t)}o(ba,"toToken");function Wv(r,e,t,n){return ba(r,e,1,t)}o(Wv,"decodeArrayCompact");function Gv(r,e,t,n){return ba(r,e,2,Pr(r,e+1,n))}o(Gv,"decodeArray8");function Yv(r,e,t,n){return ba(r,e,3,Nr(r,e+1,n))}o(Yv,"decodeArray16");function Jv(r,e,t,n){return ba(r,e,5,Rr(r,e+1,n))}o(Jv,"decodeArray32");function Xv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer array lengths not supported`);return ba(r,e,9,i)}o(Xv,"decodeArray64");function Zv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Ze} indefinite length items not allowed`);return ba(r,e,1,1/0)}o(Zv,"decodeArrayIndefinite");function ku(r,e){er(r,de.array.majorEncoded,e.value)}o(ku,"encodeArray");ku.compareTokens=an.compareTokens;ku.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function ga(r,e,t,n){return new _e(de.map,n,t)}o(ga,"toToken");function Qv(r,e,t,n){return ga(r,e,1,t)}o(Qv,"decodeMapCompact");function e2(r,e,t,n){return ga(r,e,2,Pr(r,e+1,n))}o(e2,"decodeMap8");function t2(r,e,t,n){return ga(r,e,3,Nr(r,e+1,n))}o(t2,"decodeMap16");function r2(r,e,t,n){return ga(r,e,5,Rr(r,e+1,n))}o(r2,"decodeMap32");function n2(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer map lengths not supported`);return ga(r,e,9,i)}o(n2,"decodeMap64");function i2(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Ze} indefinite length items not allowed`);return ga(r,e,1,1/0)}o(i2,"decodeMapIndefinite");function Cu(r,e){er(r,de.map.majorEncoded,e.value)}o(Cu,"encodeMap");Cu.compareTokens=an.compareTokens;Cu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function o2(r,e,t,n){return new _e(de.tag,t,1)}o(o2,"decodeTagCompact");function s2(r,e,t,n){return new _e(de.tag,Pr(r,e+1,n),2)}o(s2,"decodeTag8");function a2(r,e,t,n){return new _e(de.tag,Nr(r,e+1,n),3)}o(a2,"decodeTag16");function f2(r,e,t,n){return new _e(de.tag,Rr(r,e+1,n),5)}o(f2,"decodeTag32");function c2(r,e,t,n){return new _e(de.tag,Lr(r,e+1,n),9)}o(c2,"decodeTag64");function Du(r,e){er(r,de.tag.majorEncoded,e.value)}o(Du,"encodeTag");Du.compareTokens=an.compareTokens;Du.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");var cS=20,uS=21,lS=22,dS=23;function u2(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${Ze} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new _e(de.null,null,1):new _e(de.undefined,void 0,1)}o(u2,"decodeUndefined");function l2(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Ze} indefinite length items not allowed`);return new _e(de.break,void 0,1)}o(l2,"decodeBreak");function c0(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${Ze} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${Ze} Infinity values are not supported`)}return new _e(de.float,r,e)}o(c0,"createToken");function d2(r,e,t,n){return c0(u0(r,e+1),3,n)}o(d2,"decodeFloat16");function h2(r,e,t,n){return c0(l0(r,e+1),5,n)}o(h2,"decodeFloat32");function p2(r,e,t,n){return c0(v2(r,e+1),9,n)}o(p2,"decodeFloat64");function Ou(r,e,t){let n=e.value;if(n===!1)r.push([de.float.majorEncoded|cS]);else if(n===!0)r.push([de.float.majorEncoded|uS]);else if(n===null)r.push([de.float.majorEncoded|lS]);else if(n===void 0)r.push([de.float.majorEncoded|dS]);else{let i,s=!1;(!t||t.float64!==!0)&&(b2(n),i=u0(An,1),n===i||Number.isNaN(n)?(An[0]=249,r.push(An.slice(0,3)),s=!0):(g2(n),i=l0(An,1),n===i&&(An[0]=250,r.push(An.slice(0,5)),s=!0))),s||(hS(n),i=v2(An,1),An[0]=251,r.push(An.slice(0,9)))}}o(Ou,"encodeFloat");Ou.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){b2(n);let i=u0(An,1);if(n===i||Number.isNaN(n))return 3;if(g2(n),i=l0(An,1),n===i)return 5}return 9},"encodedSize");var m2=new ArrayBuffer(9),fn=new DataView(m2,1),An=new Uint8Array(m2,0);function b2(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(b2,"encodeFloat16");function u0(r,e){if(r.length-e<2)throw new Error(`${Ze} 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*gd(2,-24):n!==31?s=(i+1024)*gd(2,n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(u0,"readFloat16");function g2(r){fn.setFloat32(0,r,!1)}o(g2,"encodeFloat32");function l0(r,e){if(r.length-e<4)throw new Error(`${Ze} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(l0,"readFloat32");function hS(r){fn.setFloat64(0,r,!1)}o(hS,"encodeFloat64");function v2(r,e){if(r.length-e<8)throw new Error(`${Ze} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(v2,"readFloat64");Ou.compareTokens=an.compareTokens;function ct(r,e,t){throw new Error(`${Ze} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(ct,"invalidMinor");function Iu(r){return()=>{throw new Error(`${Ze} ${r}`)}}o(Iu,"errorer");var ye=[];for(let r=0;r<=23;r++)ye[r]=ct;ye[24]=Tv;ye[25]=kv;ye[26]=Cv;ye[27]=Dv;ye[28]=ct;ye[29]=ct;ye[30]=ct;ye[31]=ct;for(let r=32;r<=55;r++)ye[r]=ct;ye[56]=Ov;ye[57]=Iv;ye[58]=Pv;ye[59]=Rv;ye[60]=ct;ye[61]=ct;ye[62]=ct;ye[63]=ct;for(let r=64;r<=87;r++)ye[r]=Lv;ye[88]=Bv;ye[89]=Uv;ye[90]=Fv;ye[91]=$v;ye[92]=ct;ye[93]=ct;ye[94]=ct;ye[95]=Iu("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)ye[r]=qv;ye[120]=Hv;ye[121]=jv;ye[122]=zv;ye[123]=Kv;ye[124]=ct;ye[125]=ct;ye[126]=ct;ye[127]=Iu("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)ye[r]=Wv;ye[152]=Gv;ye[153]=Yv;ye[154]=Jv;ye[155]=Xv;ye[156]=ct;ye[157]=ct;ye[158]=ct;ye[159]=Zv;for(let r=160;r<=183;r++)ye[r]=Qv;ye[184]=e2;ye[185]=t2;ye[186]=r2;ye[187]=n2;ye[188]=ct;ye[189]=ct;ye[190]=ct;ye[191]=i2;for(let r=192;r<=215;r++)ye[r]=o2;ye[216]=s2;ye[217]=a2;ye[218]=f2;ye[219]=c2;ye[220]=ct;ye[221]=ct;ye[222]=ct;ye[223]=ct;for(let r=224;r<=243;r++)ye[r]=Iu("simple values are not supported");ye[244]=ct;ye[245]=ct;ye[246]=ct;ye[247]=u2;ye[248]=Iu("simple values are not supported");ye[249]=d2;ye[250]=h2;ye[251]=p2;ye[252]=ct;ye[253]=ct;ye[254]=ct;ye[255]=l2;var Mn=[];for(let r=0;r<24;r++)Mn[r]=new _e(de.uint,r,1);for(let r=-1;r>=-24;r--)Mn[31-r]=new _e(de.negint,r,1);Mn[64]=new _e(de.bytes,new Uint8Array(0),1);Mn[96]=new _e(de.string,"",1);Mn[128]=new _e(de.array,0,1);Mn[160]=new _e(de.map,0,1);Mn[244]=new _e(de.false,!1,1);Mn[245]=new _e(de.true,!0,1);Mn[246]=new _e(de.null,null,1);function y2(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(y2,"quickEncodeToken");var mS={float64:!1,mapSorter:vS,quickEncodeToken:y2};function bS(){let r=[];return r[de.uint.major]=an,r[de.negint.major]=Mu,r[de.bytes.major]=ma,r[de.string.major]=Vv,r[de.array.major]=ku,r[de.map.major]=Cu,r[de.tag.major]=Du,r[de.float.major]=Ou,r}o(bS,"makeCborEncoders");var x2=bS(),d0=new pa,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(`${a0} 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++]=Pu(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 p of s)f[u++]=[Pu(p,t,n),Pu(i?r.get(p):r[p],t,n)];return gS(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 Pu(r,e={},t){let n=vv(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(`${a0} unsupported type: ${n}`);return s(r,n,e,t)}o(Pu,"objectToTokens");function gS(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(gS,"sortMapEntries");function vS(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=x2[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(vS,"mapSorter");function w2(r,e,t,n){if(Array.isArray(e))for(let i of e)w2(r,i,t,n);else t[e.type.major](r,e,n)}o(w2,"tokensToEncoded");function yS(r,e,t){let n=Pu(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 pa(a);if(s(f,n,t),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return s0(f.chunks[0])}}return d0.reset(),w2(d0,n,e,t),d0.toBytes(!0)}o(yS,"encodeCustom");function h0(r,e){return e=Object.assign({},mS,e),yS(r,x2,e)}o(h0,"encode");var xS={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Nu=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=Mn[e];if(t===void 0){let n=ye[e];if(!n)throw new Error(`${Ze} 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(Nu,"Tokeniser");var Of=Symbol.for("DONE"),Ru=Symbol.for("BREAK");function wS(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=If(e,t);if(s===Ru){if(r.value===1/0)break;throw new Error(`${Ze} got unexpected break to lengthed array`)}if(s===Of)throw new Error(`${Ze} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(wS,"tokenToArray");function _S(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===Ru){if(r.value===1/0)break;throw new Error(`${Ze} got unexpected break to lengthed map`)}if(f===Of)throw new Error(`${Ze} found map but not enough entries (got ${a} [no key], expected ${r.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${Ze} non-string keys not supported (got ${typeof f})`);let u=If(e,t);if(u===Of)throw new Error(`${Ze} 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(_S,"tokenToMap");function If(r,e){if(r.done())return Of;let t=r.next();if(t.type===de.break)return Ru;if(t.type.terminal)return t.value;if(t.type===de.array)return wS(t,r,e);if(t.type===de.map)return _S(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(`${Ze} tag not supported (${t.value})`)}throw new Error("unsupported")}o(If,"tokensToObject");function p0(r,e){if(!(r instanceof Uint8Array))throw new Error(`${Ze} data to decode must be a Uint8Array`);e=Object.assign({},xS,e);let t=e.tokenizer||new Nu(r,e),n=If(t,e);if(n===Of)throw new Error(`${Ze} did not find any content to decode`);if(n===Ru)throw new Error(`${Ze} got unexpected break`);if(!t.done())throw new Error(`${Ze} too many terminals, data makes no sense`);return n}o(p0,"decode");Vn();var _2=42;function SS(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,_2),new _e(de.bytes,t)]}o(SS,"cidEncoder");function AS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(AS,"undefinedEncoder");function MS(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(MS,"numberEncoder");var TS={float64:!0,typeEncoders:{Object:SS,undefined:AS,number:MS}};function kS(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Pe.decode(r.subarray(1))}o(kS,"cidDecoder");var E2={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};E2.tags[_2]=kS;var CS="dag-cbor",va=113,Pf=o(r=>h0(r,TS),"encode"),m0=o(r=>p0(r,E2),"decode");var DS=24;function S2(r){return Z(this,null,function*(){let e=yield ns({value:r,codec:Di,hasher:zo});return{cid:e.cid,linkedBlock:e.bytes}})}o(S2,"encodePayload");function OS(r,e=DS){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(OS,"pad");function IS(r){return Z(this,null,function*(){return(yield ns({value:r,codec:Di,hasher:Hc})).cid})}o(IS,"encodeIdentityCID");function PS(r){if(r=Pe.asCID(r),r.code!==va)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==Hc.code)throw new Error("CID must use identity multihash");return m0(r.multihash.digest)}o(PS,"decodeIdentityCID");function A2(r,e){return Z(this,null,function*(){return OS((yield IS(r)).bytes,e)})}o(A2,"prepareCleartext");function M2(r){return PS(Pe.decodeFirst(r)[0])}o(M2,"decodeCleartext");var T2=Symbol("abortable"),Lu=Symbol("aborted");function k2(r,e){if(e.aborted)return Promise.reject(Lu);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Lu)}),Promise.race([r,n])}o(k2,"abortable");var C2=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 Bu="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 D2={[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 NS(r){return-32e3>=r&&r>=-32099}o(NS,"isServerError");function Uu(r){var e;return(e=D2[r.toString()])!=null?e:NS(r)?"Server error":"Application error"}o(Uu,"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:Uu(e)}};o(Tr,"RPCError");function Nf(r){let e=D2[r];return o(function(n){return new Tr(r,e,n)},"createError")}o(Nf,"createErrorFactory");var RS=Nf(vr.PARSE_ERROR),dL=Nf(vr.INVALID_REQUEST),hL=Nf(vr.METHOD_NOT_FOUND),pL=Nf(vr.INVALID_PARAMS),mL=Nf(vr.INTERNAL_ERROR);function LS(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(LS,"_checkPrivateRedeclaration");function BS(r,e){return e.get?e.get.call(r):e.value}o(BS,"_classApplyDescriptorGet");function US(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(US,"_classApplyDescriptorSet");function O2(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(O2,"_classExtractFieldDescriptor");function b0(r,e){var t=O2(r,e,"get");return BS(r,t)}o(b0,"_classPrivateFieldGet");function FS(r,e,t){LS(r,e),e.set(r,t)}o(FS,"_classPrivateFieldInit");function $S(r,e,t){var n=O2(r,e,"set");return US(r,n,t),t}o($S,"_classPrivateFieldSet");var Rf=new WeakMap,ya=class{get connection(){return b0(this,Rf)}createID(){return C2()}request(e,t=void 0,n={}){let{signal:i}=n;if(i!=null&&i.aborted)return Promise.reject(Lu);let s=this.createID(),a=b0(this,Rf).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(Bu,{id:s})}),k2(a,i))}notify(e,t=void 0){return Z(this,null,function*(){yield b0(this,Rf).send({jsonrpc:"2.0",method:e,params:t})})}constructor(e){FS(this,Rf,{writable:!0,value:void 0}),$S(this,Rf,e)}};o(ya,"RPCClient");function I2(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Uu(e)}}}o(I2,"createErrorResponse");function qS(r,e,t){console.warn("Unhandled handler error",e,t)}o(qS,"fallbackOnHandlerError");function HS(r,e){console.warn("Unhandled invalid message",e)}o(HS,"fallbackOnInvalidMessage");function jS(r,e){console.warn("Unhandled notification",e)}o(jS,"fallbackOnNotification");function P2(r,e={}){var f,u,p;let t=(f=e.onHandlerError)!=null?f:qS,n=(u=e.onInvalidMessage)!=null?u:HS,i=(p=e.onNotification)!=null?p:jS,s={};function a(m,x){var k,I;if(x.method===Bu){let T=(k=x.params)==null?void 0:k.id;T!=null&&((I=s[T])==null||I.abort())}else i(m,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):I2(I,vr.INVALID_REQUEST);let T=r[k.method];if(T==null)return I==null?(a(x,k),null):I2(I,vr.METHOD_NOT_FOUND);try{let U;if(I!=null&&T[T2]){let H=new AbortController;s[I]=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 I==null||((C=s[I])==null?void 0:C.signal.aborted)?null:{jsonrpc:"2.0",id:I,result:z}}catch(U){if(I==null||(($=s[I])==null?void 0:$.signal.aborted))return t(x,k,U),null;let z;if(U instanceof Tr)z=U.toObject();else{t(x,k,U);let H=(O=U.code)!=null?O:-32e3;z={code:H,message:U.message||Uu(H)}}return{jsonrpc:"2.0",id:I,error:z}}finally{I!=null&&delete s[I]}})},"handleRequest")}o(P2,"createHandler");Vn();var c3=at(Sy(),1),dr=at(fs(),1);function A0(){return A0=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},A0.apply(this,arguments)}o(A0,"_extends");var M0={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}"}}}},fA={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}"}}}},T0={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}"}}}},cA={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:M0,1:T0}}},uA={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:M0,1:T0,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},$f={2:M0,10:fA,19:{assetName:T0,assetType:cA,assetId:uA}};function Ay(r,e){return r.split(e.parameters.delimiter)}o(Ay,"splitParams");function qf(r,e){var t=Ay(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(qf,"getParams");function Sa(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Sa(n,t)}).join(e.parameters.delimiter)}o(Sa,"joinParams");function Hf(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=Ay(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(Hf,"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(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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=$f[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(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=qf(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=A0({},i.toJSON(),{address:n.address});return Sa(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=$f[10];var k0=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(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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}();k0.spec=$f[19].assetName;var lA=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new k0(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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}();lA.spec=$f[19].assetType;var dA=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new k0(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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}();dA.spec=$f[19].assetId;var My="logger/5.6.0";var Ty=!1,ky=!1,zu={debug:1,default:2,info:2,warning:3,error:4,off:5},Cy=zu.default,C0=null;function hA(){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(hA,"_checkNormalize");var Dy=hA(),D0;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(D0||(D0={}));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 Oy="0123456789abcdef",tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();zu[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Cy>zu[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(ky)return this.makeError("censored error",t,{});t||(t=tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(u=>{let p=n[u];try{if(p instanceof Uint8Array){let m="";for(let x=0;x<p.length;x++)m+=Oy[p[x]>>4],m+=Oy[p[x]&15];i.push(u+"=Uint8Array(0x"+m+")")}else i.push(u+"="+JSON.stringify(p))}catch(m){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"),Dy&&this.throwError("platform missing String.prototype.normalize",tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Dy})}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 C0||(C0=new tt(My)),C0}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ty){if(!e)return;this.globalLogger().throwError("error censorship permanent",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ky=!!e,Ty=!!t}static setLogLevel(e){let t=zu[e.toLowerCase()];if(t==null){tt.globalLogger().warn("invalid log level - "+e);return}Cy=t}static from(e){return new tt(e)}};o(tt,"Logger");tt.errors=kn;tt.levels=D0;var Iy="bytes/5.6.1";var Bt=new tt(Iy);function Ny(r){return!!r.toHexString}o(Ny,"isHexable");function Aa(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Aa(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Aa,"addSlice");function Ry(r){return Cn(r)&&!(r.length%2)||I0(r)}o(Ry,"isBytesLike");function Py(r){return typeof r=="number"&&r==r&&r%1===0}o(Py,"isInteger");function I0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!Py(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!Py(t)||t<0||t>=256)return!1}return!0}o(I0,"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),Aa(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Ny(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 Aa(new Uint8Array(n))}return I0(r)?Aa(new Uint8Array(r)):Bt.throwArgumentError("invalid arrayify value","value",r)}o(Tt,"arrayify");function P0(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),Aa(n)}o(P0,"concat");function pA(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),Aa(t)}o(pA,"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 O0="0123456789abcdef";function ur(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=O0[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),Ny(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(I0(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=O0[(i&240)>>4]+O0[i&15]}return t}return Bt.throwArgumentError("invalid hexlify value","value",r)}o(ur,"hexlify");function Ku(r){if(typeof r!="string")r=ur(r);else if(!Cn(r)||r.length%2)return null;return(r.length-2)/2}o(Ku,"hexDataLength");function Vu(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(Vu,"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 Wu(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ry(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=pA(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(Wu,"splitSignature");var Uy=at(R0());var By="bignumber/5.6.2";var mA=Uy.default.BN,aB=new tt(By);function L0(r){return new mA(r,36).toString(16)}o(L0,"_base36To16");var Fy=at(th());function Ma(r){return"0x"+Fy.default.keccak_256(Tt(r))}o(Ma,"keccak256");var $y="address/5.6.1";var jf=new tt($y);function qy(r){Cn(r,20)||jf.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(qy,"getChecksumAddress");var vA=9007199254740991;function yA(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(yA,"log10");var B0={};for(let r=0;r<10;r++)B0[String(r)]=String(r);for(let r=0;r<26;r++)B0[String.fromCharCode(65+r)]=String(10+r);var Hy=Math.floor(yA(vA));function xA(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>B0[n]).join("");for(;e.length>=Hy;){let n=e.substring(0,Hy);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(xA,"ibanChecksum");function jy(r){let e=null;if(typeof r!="string"&&jf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=qy(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&jf.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)!==xA(r)&&jf.throwArgumentError("bad icap checksum","address",r),e=L0(r.substring(4));e.length<40;)e="0"+e;e=qy("0x"+e)}else jf.throwArgumentError("invalid address","address",r);return e}o(jy,"getAddress");var zy="properties/5.6.0";var SB=new tt(zy);function Ta(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Ta,"defineReadOnly");var Ky="strings/5.6.1";var Vy=new tt(Ky),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 wA(r,e,t,n,i){return Vy.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(wA,"errorFunc");function Wy(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(Wy,"ignoreFunc");function _A(r,e,t,n,i){return r===us.OVERLONG?(n.push(i),0):(n.push(65533),Wy(r,e,t,n,i))}o(_A,"replaceFunc");var EA=Object.freeze({error:wA,ignore:Wy,replace:_A});function Kf(r,e=zf.current){e!=zf.current&&(Vy.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(Kf,"toUtf8Bytes");var Gy=`Ethereum Signed Message:
|
634
|
-
`;function U0(r){return typeof r=="string"&&(r=Kf(r)),Ma(P0([Kf(Gy),Kf(String(r.length)),r]))}o(U0,"hashMessage");var Qe=at(R0()),oi=at(vf());function ka(r,e,t){return t={path:e,exports:{},require:function(n,i){return SA(n,i==null?t.path:i)}},r(t,t.exports),t.exports}o(ka,"createCommonjsModule");function SA(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(SA,"commonjsRequire");var H0=Jy;function Jy(r,e){if(!r)throw new Error(e||"Assertion failed")}o(Jy,"assert");Jy.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Dn=ka(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 p=0;p<a.length;p++)u[p]=a[p]|0;return u}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var p=0;p<a.length;p+=2)u.push(parseInt(a[p]+a[p+1],16))}else for(var p=0;p<a.length;p++){var m=a.charCodeAt(p),x=m>>8,k=m&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=ka(function(r,e){"use strict";var t=e;t.assert=H0,t.toArray=Dn.toArray,t.zero2=Dn.zero2,t.toHex=Dn.toHex,t.encode=Dn.encode;function n(u,p,m){var x=new Array(Math.max(u.bitLength(),m)+1);x.fill(0);for(var k=1<<p+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,p){var m=[[],[]];u=u.clone(),p=p.clone();for(var x=0,k=0,I;u.cmpn(-x)>0||p.cmpn(-k)>0;){var T=u.andln(3)+x&3,C=p.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),m[0].push($);var O;(C&1)===0?O=0:(I=p.andln(7)+k&7,(I===3||I===5)&&T===2?O=-C:O=C),m[1].push(O),2*x===$+1&&(x=1-x),2*k===O+1&&(k=1-k),u.iushrn(1),p.iushrn(1)}return m}o(i,"getJSF"),t.getJSF=i;function s(u,p,m){var x="_"+p;u.prototype[p]=o(function(){return this[x]!==void 0?this[x]:this[x]=m.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}),Ju=Ur.getNAF,AA=Ur.getJSF,Xu=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){Xu(e.precomputed);var n=e._getDoubles(),i=Ju(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 p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var m=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()));m=m.add(x)}return m.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=Ju(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var m=a[u];Xu(m!==0),e.type==="affine"?m>0?f=f.mixedAdd(s[m-1>>1]):f=f.mixedAdd(s[-m-1>>1].neg()):m>0?f=f.add(s[m-1>>1]):f=f.add(s[-m-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,p=0,m,x,k;for(m=0;m<i;m++){k=t[m];var I=k._getNAFPoints(e);a[m]=I.wnd,f[m]=I.points}for(m=i-1;m>=1;m-=2){var T=m-1,C=m;if(a[T]!==1||a[C]!==1){u[T]=Ju(n[T],a[T],this._bitLength),u[C]=Ju(n[C],a[C],this._bitLength),p=Math.max(u[T].length,p),p=Math.max(u[C].length,p);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=AA(n[T],n[C]);for(p=Math.max(U[0].length,p),u[T]=new Array(p),u[C]=new Array(p),x=0;x<p;x++){var z=U[0][x]|0,H=U[1][x]|0;u[T][x]=O[(z+1)*3+(H+1)],u[C][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),B=this._wnafT4;for(m=p;m>=0;m--){for(var L=0;m>=0;){var F=!0;for(x=0;x<i;x++)B[x]=u[x][m]|0,B[x]!==0&&(F=!1);if(!F)break;L++,m--}if(m>=0&&L++,X=X.dblp(L),m<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(m=0;m<i;m++)f[m]=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?Xu(e[e.length-1]%2===0):e[0]===7&&Xu(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 j0=ka(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")}),MA=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");j0(dn,ls);var TA=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],MA(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),p,m,x,k,I,T,C,$=0,O,U;n.cmpn(0)!==0;){var z=i.div(n);O=i.sub(z.mul(n)),U=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&O.cmp(t)<0)p=C.neg(),m=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=p,T=m),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),p=s.mul(n.b),m=a.mul(i.b),x=e.sub(f).sub(u),k=p.add(m).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],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var m=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return m},"_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");j0(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");j0(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),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=u.redSqr(),x=m.redMul(u),k=i.redMul(m),I=p.redSqr().redIAdd(x).redISub(k).redISub(k),T=p.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 p=f.redSqr(),m=p.redMul(f),x=n.redMul(p),k=u.redSqr().redIAdd(m).redISub(x).redISub(x),I=u.redMul(x.redISub(k)).redISub(s.redMul(m)),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,p=u.redSqr().redSqr(),m=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),k=m.redSqr(),I=k.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(p)),C=a.redMul(k),$=T.redSqr().redISub(C.redAdd(C)),O=C.redISub($),U=T.redMul(O);U=U.redIAdd(U).redISub(I);var z=m.redMul(u);t+1<e&&(p=p.redMul(I)),a=$,u=z,m=U}return this.curve.jpoint(a,m.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),p=u.redSqr().redISub(f).redISub(f),m=a.redIAdd(a);m=m.redIAdd(m),m=m.redIAdd(m),e=p,t=u.redMul(f.redISub(p)).redISub(m),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),p=u.redSqr().redISub(f).redISub(f);e=p;var m=a.redIAdd(a);m=m.redIAdd(m),m=m.redIAdd(m),t=u.redMul(f.redISub(p)).redISub(m),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)),p=t.redAdd(t);p=p.redIAdd(p);var m=p.redMul(f),x=u.redSqr().redISub(m.redAdd(m)),k=m.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(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var m=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),x=t.redMul(m);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(m.redMul(p.redISub(m)).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 Gu=ka(function(r,e){"use strict";var t=e;t.base=ls,t.short=TA,t.mont=null,t.edwards=null}),Yu=ka(function(r,e){"use strict";var t=e,n=Ur.assert;function i(f){f.type==="short"?this.curve=new Gu.short(f):f.type==="edwards"?this.curve=new Gu.edwards(f):this.curve=new Gu.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 p=new i(u);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:p}),p}})}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");H0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(mo,"HmacDRBG");var Xy=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),H0(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 q0=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 z0=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"?q0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&q0(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()||q0(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 kA=Ur.assert;function Zu(r,e){if(r instanceof Zu)return r;this._importDER(r,e)||(kA(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(Zu,"Signature");var Qu=Zu;function CA(){this.place=0}o(CA,"Position");function F0(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(F0,"getLength");function Yy(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(Yy,"rmPadding");Zu.prototype._importDER=o(function(e,t){e=Ur.toArray(e,t);var n=new CA;if(e[n.place++]!==48)return!1;var i=F0(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=F0(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=F0(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 $0(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($0,"constructLength");Zu.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=Yy(t),n=Yy(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];$0(i,t.length),i=i.concat(t),i.push(2),$0(i,n.length);var s=i.concat(n),a=[48];return $0(a,s.length),a=a.concat(s),Ur.encode(a,e)},"toDER");var DA=o(function(){throw new Error("unsupported")},"rand"),Zy=Ur.assert;function un(r){if(!(this instanceof un))return new un(r);typeof r=="string"&&(Zy(Object.prototype.hasOwnProperty.call(Yu,r),"Unknown curve "+r),r=Yu[r]),r instanceof Yu.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 OA=un;un.prototype.keyPair=o(function(e){return new z0(this,e)},"keyPair");un.prototype.keyFromPrivate=o(function(e,t){return z0.fromPrivate(this,e,t)},"keyFromPrivate");un.prototype.keyFromPublic=o(function(e,t){return z0.fromPublic(this,e,t)},"keyFromPublic");un.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Xy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||DA(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 Xy({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new Qe.default(1)),m=0;;m++){var x=i.k?i.k(m):new Qe.default(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(p)>=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 Qu({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 Qu(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),p=f.mul(s).umod(this.n),m;return this.curve._maxwellTrick?(m=this.g.jmulAdd(u,n.getPublic(),p),m.isInfinity()?!1:m.eqXToP(s)):(m=this.g.mulAdd(u,n.getPublic(),p),m.isInfinity()?!1:m.getX().umod(this.n).cmp(s)===0)},"verify");un.prototype.recoverPubKey=function(r,e,t,n){Zy((3&t)===t,"The recovery param is more than two bits"),e=new Qu(e,n);var i=this.n,s=new Qe.default(r),a=e.r,f=e.s,u=t&1,p=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var m=e.r.invm(i),x=i.sub(s).mul(m).umod(i),k=f.mul(m).umod(i);return this.g.mulAdd(x,a,k)};un.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Qu(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 IA=ka(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=Gu,t.curves=Yu,t.ec=OA,t.eddsa=null}),Qy=IA.ec;var e3="signing-key/5.6.2";var V0=new tt(e3),K0=null;function si(){return K0||(K0=new Qy("secp256k1")),K0}o(si,"getCurve");var el=class{constructor(e){Ta(this,"curve","secp256k1"),Ta(this,"privateKey",ur(e)),Ku(this.privateKey)!==32&&V0.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=si().keyFromPrivate(Tt(this.privateKey));Ta(this,"publicKey","0x"+t.getPublic(!1,"hex")),Ta(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Ta(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&&V0.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return Wu({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(W0(e)));return po("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(el,"SigningKey");function t3(r,e){let t=Wu(e),n={r:Tt(t.r),s:Tt(t.s)};return"0x"+si().recoverPubKey(Tt(r),n,t.recoveryParam).encode("hex",!1)}o(t3,"recoverPublicKey");function W0(r,e){let t=Tt(r);if(t.length===32){let n=new el(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 V0.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(W0,"computePublicKey");var r3="transactions/5.6.2";var iU=new tt(r3),n3;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(n3||(n3={}));function i3(r){let e=W0(r);return jy(Vu(Ma(Vu(e,1)),12))}o(i3,"computeAddress");function o3(r,e){return i3(t3(Tt(r),e))}o(o3,"recoverAddress");var s3="wallet/5.6.2";var hU=new tt(s3);function a3(r,e){return o3(U0(r),e)}o(a3,"verifyMessage");uf();var PA=`
|
632
|
+
`+String(n)));Yp(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){Nw(r,e,n)})}o(CC,"dispatchBatch");function Nw(r,e,t){Yp(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(Nw,"failedDispatch");function Yp(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Yp,"resolveCacheHits");function DC(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(DC,"getValidMaxBatchSize");function IC(r){var e=r&&r.batchScheduleFn;if(e===void 0)return TC;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(IC,"getValidBatchScheduleFn");function OC(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(OC,"getValidCacheKeyFn");function PC(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(PC,"getValidCacheMap");function Rw(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(Rw,"isArrayLike");Lw.exports=AC});var Xw=me((TK,Jw)=>{Jw.exports=Yw;var Gw=128,QC=127,eD=~QC,tD=Math.pow(2,31);function Yw(r,e,t){e=e||[],t=t||0;for(var n=t;r>=tD;)e[t++]=r&255|Gw,r/=128;for(;r&eD;)e[t++]=r&255|Gw,r>>>=7;return e[t]=r|0,Yw.bytes=t-n+1,e}o(Yw,"encode")});var e4=me((kK,Qw)=>{Qw.exports=am;var rD=128,Zw=127;function am(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw am.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Zw)<<i:(a&Zw)*Math.pow(2,i),i+=7}while(a>=rD);return am.bytes=s-n,t}o(am,"read")});var r4=me((CK,t4)=>{var nD=Math.pow(2,7),iD=Math.pow(2,14),oD=Math.pow(2,21),sD=Math.pow(2,28),aD=Math.pow(2,35),fD=Math.pow(2,42),cD=Math.pow(2,49),uD=Math.pow(2,56),lD=Math.pow(2,63);t4.exports=function(r){return r<nD?1:r<iD?2:r<oD?3:r<sD?4:r<aD?5:r<fD?6:r<cD?7:r<uD?8:r<lD?9:10}});var i4=me((DK,n4)=>{n4.exports={encode:Xw(),decode:e4(),encodingLength:r4()}});var s4=me((IK,o4)=>{"use strict";var dD=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});o4.exports={names:dD}});var h4=me((OK,d4)=>{"use strict";var a4=J0(),Ja=i4(),{names:gc}=s4(),{toString:od}=(df(),tf(_1)),{fromString:hD}=(Wc(),tf(w1)),{concat:pD}=(wd(),tf(Gm)),Xa={};for(let r in gc){let e=r;Xa[gc[e]]=e}Object.freeze(Xa);function mD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return od(r,"base16")}o(mD,"toHexString");function bD(r){return hD(r,"base16")}o(bD,"fromHexString");function gD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return od(a4.encode("base58btc",r)).slice(1)}o(gD,"toB58String");function vD(r){let e=r instanceof Uint8Array?od(r):r;return a4.decode("z"+e)}o(vD,"fromB58String");function f4(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=Ja.decode(r);if(!u4(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Ja.decode.bytes);let t=Ja.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Ja.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${od(r,"base16")}`);return{code:e,name:Xa[e],length:t,digest:r}}o(f4,"decode");function yD(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=c4(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=Ja.encode(n),s=Ja.encode(t);return pD([i,s,r],i.length+s.length+r.length)}o(yD,"encode");function c4(r){let e=r;if(typeof r=="string"){if(gc[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=gc[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Xa[e]===void 0&&!fm(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(c4,"coerceCode");function fm(r){return r>0&&r<16}o(fm,"isAppCode");function u4(r){return!!(fm(r)||Xa[r])}o(u4,"isValidCode");function l4(r){f4(r)}o(l4,"validate");function xD(r){return l4(r),r.subarray(0,2)}o(xD,"prefix");d4.exports={names:gc,codes:Xa,toHexString:mD,fromHexString:bD,toB58String:gD,fromB58String:vD,decode:f4,encode:yD,coerceCode:c4,isAppCode:fm,validate:l4,prefix:xD,isValidCode:u4}});var FO={};St(FO,{walletFromKey:()=>o5});module.exports=tf(FO);var dY=require("isomorphic-fetch");var ke,Nm=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Nm.decode();var Cc=null;function Ks(){return(Cc===null||Cc.buffer!==ke.memory.buffer)&&(Cc=new Uint8Array(ke.memory.buffer)),Cc}o(Ks,"getUint8Memory0");function gi(r,e){return Nm.decode(Ks().subarray(r,r+e))}o(gi,"getStringFromWasm0");var vi=new Array(32).fill(void 0);vi.push(void 0,null,!0,!1);var rf=vi.length;function Xe(r){rf===vi.length&&vi.push(vi.length+1);let e=rf;return rf=vi[e],vi[e]=r,e}o(Xe,"addHeapObject");function Ie(r){return vi[r]}o(Ie,"getObject");function d5(r){r<36||(vi[r]=rf,rf=r)}o(d5,"dropObject");function yi(r){let e=Ie(r);return d5(r),e}o(yi,"takeObject");var Rt=0,Ic=new TextEncoder("utf-8"),h5=typeof Ic.encodeInto=="function"?function(r,e){return Ic.encodeInto(r,e)}:function(r,e){let t=Ic.encode(r);return e.set(t),{read:r.length,written:t.length}};function Xt(r,e,t){if(t===void 0){let f=Ic.encode(r),u=e(f.length);return Ks().subarray(u,u+f.length).set(f),Rt=f.length,u}let n=r.length,i=e(n),s=Ks(),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=Ks().subarray(i+a,i+n);a+=h5(r,f).written}return Rt=a,i}o(Xt,"passStringToWasm0");function p5(r){return r==null}o(p5,"isLikeNone");var Dc=null;function _r(){return(Dc===null||Dc.buffer!==ke.memory.buffer)&&(Dc=new Int32Array(ke.memory.buffer)),Dc}o(_r,"getInt32Memory0");function yd(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+=yd(r[0]));for(let a=1;a<i;a++)s+=", "+yd(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}
|
633
|
+
${r.stack}`:n}o(yd,"debugString");function m5(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(m5,"makeMutClosure");function b5(r,e,t){ke._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(r,e,Xe(t))}o(b5,"__wbg_adapter_24");function g5(r,e){let t=e(r.length*1);return Ks().set(r,t/1),Rt=r.length,t}o(g5,"passArray8ToWasm0");function Rm(r){try{let f=ke.__wbindgen_add_to_stack_pointer(-16),u=g5(r,ke.__wbindgen_malloc),m=Rt;ke.generateEd25519KeyFromBytes(f,u,m);var e=_r()[f/4+0],t=_r()[f/4+1],n=_r()[f/4+2],i=_r()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,yi(n);return gi(s,a)}finally{ke.__wbindgen_add_to_stack_pointer(16),ke.__wbindgen_free(s,a)}}o(Rm,"generateEd25519KeyFromBytes");function Lm(r,e){try{let u=ke.__wbindgen_add_to_stack_pointer(-16),m=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),p=Rt,x=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),k=Rt;ke.keyToDID(u,m,p,x,k);var t=_r()[u/4+0],n=_r()[u/4+1],i=_r()[u/4+2],s=_r()[u/4+3],a=t,f=n;if(s)throw a=0,f=0,yi(i);return gi(a,f)}finally{ke.__wbindgen_add_to_stack_pointer(16),ke.__wbindgen_free(a,f)}}o(Lm,"keyToDID");function Bm(r,e){let t=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Rt,i=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Rt,a=ke.keyToVerificationMethod(t,n,i,s);return yi(a)}o(Bm,"keyToVerificationMethod");function Um(r,e,t){let n=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),i=Rt,s=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),a=Rt,f=Xt(t,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt,m=ke.issueCredential(n,i,s,a,f,u);return yi(m)}o(Um,"issueCredential");function Fm(r,e){let t=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Rt,i=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Rt,a=ke.verifyCredential(t,n,i,s);return yi(a)}o(Fm,"verifyCredential");function $m(r,e,t){let n=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),i=Rt,s=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),a=Rt,f=Xt(t,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt,m=ke.issuePresentation(n,i,s,a,f,u);return yi(m)}o($m,"issuePresentation");function qm(r,e){let t=Xt(r,ke.__wbindgen_malloc,ke.__wbindgen_realloc),n=Rt,i=Xt(e,ke.__wbindgen_malloc,ke.__wbindgen_realloc),s=Rt,a=ke.verifyPresentation(t,n,i,s);return yi(a)}o(qm,"verifyPresentation");function sr(r,e){try{return r.apply(this,e)}catch(t){ke.__wbindgen_exn_store(Xe(t))}}o(sr,"handleError");function v5(r,e){return Ks().subarray(r/1,r/1+e)}o(v5,"getArrayU8FromWasm0");function y5(r,e,t,n){ke.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(r,e,Xe(t),Xe(n))}o(y5,"__wbg_adapter_108");function x5(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(x5,"load");function Hm(r){return Z(this,null,function*(){let e={};e.wbg={},e.wbg.__wbindgen_string_new=function(i,s){let a=gi(i,s);return Xe(a)},e.wbg.__wbindgen_object_drop_ref=function(i){yi(i)},e.wbg.__wbindgen_cb_drop=function(i){let s=yi(i).original;return s.cnt--==1?(s.a=0,!0):!1},e.wbg.__wbindgen_object_clone_ref=function(i){let s=Ie(i);return Xe(s)},e.wbg.__wbg_fetch_811d43d6bdcad5b1=function(i){let s=fetch(Ie(i));return Xe(s)},e.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(i,s){let a=Ie(i).fetch(Ie(s));return Xe(a)},e.wbg.__wbg_new_89d7f088c1c45353=function(){return sr(function(){let i=new Headers;return Xe(i)},arguments)},e.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return sr(function(i,s,a,f,u){Ie(i).append(gi(s,a),gi(f,u))},arguments)},e.wbg.__wbindgen_string_get=function(i,s){let a=Ie(s),f=typeof a=="string"?a:void 0;var u=p5(f)?0:Xt(f,ke.__wbindgen_malloc,ke.__wbindgen_realloc),m=Rt;_r()[i/4+1]=m,_r()[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=Xt(a,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt;_r()[i/4+1]=u,_r()[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 Xe(s)},e.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return sr(function(i){let s=Ie(i).arrayBuffer();return Xe(s)},arguments)},e.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return sr(function(i,s,a){let f=new Request(gi(i,s),Ie(a));return Xe(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 sr(function(){let i=self.self;return Xe(i)},arguments)},e.wbg.__wbg_crypto_b8c92eaac23d0d80=function(i){let s=Ie(i).crypto;return Xe(s)},e.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(i){let s=Ie(i).msCrypto;return Xe(s)},e.wbg.__wbindgen_is_undefined=function(i){return Ie(i)===void 0},e.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Xe(n)},e.wbg.__wbg_require_f5521a5b85ad2542=function(i,s,a){let f=Ie(i).require(gi(s,a));return Xe(f)},e.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(i){let s=Ie(i).getRandomValues;return Xe(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(v5(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(gi(i,s));return Xe(a)},e.wbg.__wbg_next_cabb70b365520721=function(i){let s=Ie(i).next;return Xe(s)},e.wbg.__wbg_next_bf3d83fc18df496e=function(){return sr(function(i){let s=Ie(i).next();return Xe(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 Xe(s)},e.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Xe(Symbol.iterator)},e.wbg.__wbg_get_a9cab131e3152c49=function(){return sr(function(i,s){let a=Reflect.get(Ie(i),Ie(s));return Xe(a)},arguments)},e.wbg.__wbg_call_ae78342adc33730a=function(){return sr(function(i,s){let a=Ie(i).call(Ie(s));return Xe(a)},arguments)},e.wbg.__wbg_new_36359baae5a47e27=function(){let i=new Object;return Xe(i)},e.wbg.__wbg_call_3ed288a247f13ea5=function(){return sr(function(i,s,a){let f=Ie(i).call(Ie(s),Ie(a));return Xe(f)},arguments)},e.wbg.__wbg_getTime_bffb1c09df09618b=function(i){return Ie(i).getTime()},e.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){let i=new Date;return Xe(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 y5(x,a.b,m,p)}finally{a.a=x}},"cb0");let u=new Promise(f);return Xe(u)}finally{a.a=a.b=0}},e.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(i){let s=Promise.resolve(Ie(i));return Xe(s)},e.wbg.__wbg_then_ce526c837d07b68f=function(i,s){let a=Ie(i).then(Ie(s));return Xe(a)},e.wbg.__wbg_then_842e65b843962f56=function(i,s,a){let f=Ie(i).then(Ie(s),Ie(a));return Xe(f)},e.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return sr(function(){let i=self.self;return Xe(i)},arguments)},e.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return sr(function(){let i=window.window;return Xe(i)},arguments)},e.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return sr(function(){let i=globalThis.globalThis;return Xe(i)},arguments)},e.wbg.__wbg_global_5de1e0f82bddcd27=function(){return sr(function(){let i=global.global;return Xe(i)},arguments)},e.wbg.__wbg_buffer_7af23f65f6c64548=function(i){let s=Ie(i).buffer;return Xe(s)},e.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(i,s,a){let f=new Uint8Array(Ie(i),s>>>0,a>>>0);return Xe(f)},e.wbg.__wbg_new_cc9018bd6f283b6f=function(i){let s=new Uint8Array(Ie(i));return Xe(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 Xe(s)},e.wbg.__wbg_subarray_da527dbd24eafb6b=function(i,s,a){let f=Ie(i).subarray(s>>>0,a>>>0);return Xe(f)},e.wbg.__wbg_has_ce995ec88636803d=function(){return sr(function(i,s){return Reflect.has(Ie(i),Ie(s))},arguments)},e.wbg.__wbg_set_93b1c87ee2af852e=function(){return sr(function(i,s,a){return Reflect.set(Ie(i),Ie(s),Ie(a))},arguments)},e.wbg.__wbg_stringify_c760003feffcc1f2=function(){return sr(function(i){let s=JSON.stringify(Ie(i));return Xe(s)},arguments)},e.wbg.__wbindgen_debug_string=function(i,s){let a=yd(Ie(s)),f=Xt(a,ke.__wbindgen_malloc,ke.__wbindgen_realloc),u=Rt;_r()[i/4+1]=u,_r()[i/4+0]=f},e.wbg.__wbindgen_throw=function(i,s){throw new Error(gi(i,s))},e.wbg.__wbindgen_memory=function(){let i=ke.memory;return Xe(i)},e.wbg.__wbindgen_closure_wrapper10902=function(i,s,a){let f=m5(i,s,3717,b5);return Xe(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 x5(yield r,e);return ke=t.exports,Hm.__wbindgen_wasm_module=n,ke})}o(Hm,"init");var jm=Hm;var zm=!1,w5=o((r="https://cdn.filestackcontent.com/jXExSjNXSerFVDMIYOgy")=>Z(void 0,null,function*(){if(!zm)return zm=!0,jm(r)}),"init"),Oc=w5;var Km=at(require("isomorphic-webcrypto"));typeof window=="undefined"&&(globalThis.crypto=Km.default);var E5=o((r,e)=>Z(void 0,null,function*(){return nf(r.contents,{plugins:[...r.plugins,e]})}),"addPluginToWallet"),S5=o((r,e)=>Z(void 0,null,function*(){return nf([...r.contents,e],r)}),"addToWallet"),M5=o((r,e)=>Z(void 0,null,function*(){let t=JSON.parse(JSON.stringify(r.contents)),n=t.find(i=>i.id===e);return nf(t.filter(i=>i.id!==n.id),r)}),"removeFromWallet"),A5=o((r,e)=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.bind(r,r)])),"bindMethods"),nf=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 S5(this,a)},remove:function(a){return M5(this,a)},status:"UNLOCKED",plugins:n,pluginMethods:i,addPlugin:function(a){return E5(this,a)}};return i&&(s.pluginMethods=A5(s,i)),s}),"generateWallet");function T5(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(T5,"_catch");function k5(){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(k5,"inMemoryCache");function C5(r,e){return e()}o(C5,"noCache");var D5="(?:%[0-9a-fA-F]{2})",Vm=`(?:[a-zA-Z0-9._-]|${D5})`,I5="([a-z0-9]+)",O5=`((?:${Vm}*:)*(${Vm}+))`,Wm="[a-zA-Z0-9_.:%-]",P5=`;${Wm}+=${Wm}*`,N5=`((${P5})*)`,R5="(/[^#?]*)?",L5="([?][^#]*)?",B5="(#.*)?",U5=new RegExp(`^did:${I5}:${O5}${N5}${R5}${L5}${B5}$`);function xd(r){if(r===""||!r)return null;let e=r.match(U5);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(xd,"parse");var Pc={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function F5(r){return function(e,t,n){try{return Promise.resolve(T5(function(){return Promise.resolve(r(e,t,n)).then(function(i){return Ae(ie({},Pc),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i})})},function(i){return Ae(ie({},Pc),{didResolutionMetadata:{error:"notFound",message:i.toString()}})}))}catch(i){return Promise.reject(i)}}}o(F5,"wrapLegacyResolver");var of=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?k5():t.cache||C5,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=F5(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=xd(e);if(i===null)return Promise.resolve(Ae(ie({},Pc),{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({},Pc),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(n){return Promise.reject(n)}}};o(of,"Resolver");wd();Wc();df();Kc();var Jh=at(D1()),ev=at(th()),Xh=at(ng()),_u=at(mu()),tv=at(kg()),Tf=at(Og()),Zh=at(Vg()),Qh=at(no());function sn(r){return It(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 e0(r){return Lt(r,"base58btc")}o(e0,"base58ToBytes");function Wh(r){let e=r.startsWith("0x")?r.substring(2):r;return Lt(e.toLowerCase(),"base16")}o(Wh,"hexToBytes");function Gh(r){return sn(Lt(r))}o(Gh,"encodeBase64url");function rv(r){return It(Ar(r))}o(rv,"decodeBase64url");function ts(r){return It(r,"base16")}o(ts,"bytesToHex");function nv(r){return Lt(r)}o(nv,"stringToBytes");function A7({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(A7,"toJose");function T7(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(T7,"fromJose");function iv(r,e){return vn([Ar(r),Ar(e)])}o(iv,"toSealed");var k7=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,C7=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,D7=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function I7(r){if(typeof r=="string"){if(k7.test(r))return Wh(r);if(C7.test(r))return e0(r);if(D7.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(I7,"parseKey");function ov(r){let e=typeof r=="string"?Lt(r):r;return(0,Jh.hash)(e)}o(ov,"sha256");function O7(r){return new Uint8Array(ev.keccak_256.arrayBuffer(r))}o(O7,"keccak");function P7(r){let e=Lt(r.slice(2),"base16");return`0x${It(O7(e).slice(-20),"base16")}`}o(P7,"toEthereumAddress");function Yh(r,e=new Uint8Array(4)){let t=Lt(r.toString(),"base10");return e.set(t,4-t.length),e}o(Yh,"writeUint32BE");var Vh=o(r=>vn([Yh(r.length),r]),"lengthAndInput");function sv(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=vn([Vh(Lt(t)),Vh(typeof n=="undefined"?new Uint8Array(0):n),Vh(typeof i=="undefined"?new Uint8Array(0):i),Yh(e)]);return(0,Jh.hash)(vn([Yh(1),r,s]))}o(sv,"concatKDF");var tR=new Xh.ec("secp256k1");function av(r){let e=I7(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"?nv(t):t,i=(0,_u.sign)(e,n);return Promise.resolve(sn(i))}catch(n){return Promise.reject(n)}}}o(av,"EdDSASigner");function fv(r){return typeof r=="object"&&"r"in r&&"s"in r}o(fv,"instanceOfEcdsaSignature");function Wg(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(fv(i))return A7(i,r);if(r&&typeof T7(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(Wg,"ES256KSignerAlg");function Gg(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(fv(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(Gg,"Ed25519SignerAlg");var N7={ES256K:Wg(),"ES256K-R":Wg(!0),Ed25519:Gg(),EdDSA:Gg()};function R7(r){let e=N7[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(R7,"SignerAlg");var t0=new Xh.ec("secp256k1");function wu(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(wu,"toSignatureObject");function r0(r){if(r.publicKeyBase58)return e0(r.publicKeyBase58);if(r.publicKeyBase64)return Ar(r.publicKeyBase64);if(r.publicKeyHex)return Wh(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return Wh(t0.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}=Js;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(r0,"extractPublicKeyBytes");function L7(r,e,t){let n=ov(r),i=wu(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=r0(u);return t0.keyFromPublic(m).verify(n,i)}catch(m){return!1}});if(!f&&a.length>0&&(f=cv(r,e,a)),!f)throw new Error("invalid_signature: Signature invalid for JWT");return f}o(L7,"verifyES256K");function cv(r,e,t){let n;if(e.length>86)n=[wu(e,!0)];else{let a=wu(e,!1);n=[Ae(ie({},a),{recoveryParam:0}),Ae(ie({},a),{recoveryParam:1})]}let i=o(a=>{let f=ov(r),u=t0.recoverPubKey(f,a,a.recoveryParam),m=u.encode("hex"),p=u.encode("hex",!0),x=P7(m);return t.find(O=>{var T,C,$;let I=ts(r0(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(cv,"verifyRecoverableES256K");function Yg(r,e,t){let n=nv(r),i=Ar(e),s=t.find(a=>(0,_u.verify)(r0(a),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Yg,"verifyEd25519");var B7={ES256K:L7,"ES256K-R":cv,Ed25519:Yg,EdDSA:Yg};function uv(r){let e=B7[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(uv,"VerifierAlgorithm");uv.toSignatureObject=wu;var lv=o(function(r,e,t={},n={}){try{t.alg||(t.alg=U7);let i=typeof r=="string"?r:Jg(r,n.canonicalize),s=[Jg(t,n.canonicalize),i].join("."),a=R7(t.alg);return Promise.resolve(a(s,e)).then(function(f){return[s,f].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var U7="ES256K";function Jg(r,e=!1){return Gh(e?(0,tv.default)(r):JSON.stringify(r))}o(Jg,"encodeSection");function F7(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(rv(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(F7,"decodeJWS");function $7({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),uv(r.alg)(e,t,n)}o($7,"verifyJWSDecoded");function dv(r,e){let t=F7(r);return $7(t,e)}o(dv,"verifyJWS");function q7(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(q7,"_for");var hv=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;z7(r);let i=JSON.parse(rv(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=iv(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 q7(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"),Xg=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 H7(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(H7,"_forTo");function j7(r,e,t){if(typeof r[Xg]=="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[Xg](),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 H7(u,function(p){return e(u[p])},t)}o(j7,"_forOf");function z7(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(z7,"validateJWE");function Zg({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(Zg,"encodeJWE");var pv=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 Zg(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=j7(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=Zg(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 mv=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=>V7(e0(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 bv(r){let e=new Zh.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Qh.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(bv,"xc20pEncrypter");function K7(r){let e=o(function(s,a={},f){try{let u=Gh(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=bv(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(K7,"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 Zh.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Qg,"xc20pDirDecrypter");function V7(r,e){let t=o(function(f,u={},m){try{Object.assign(u,{alg:void 0});let p=(0,Qh.randomBytes)(32);return Promise.resolve(K7(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,Tf.generateKeyPair)(),m=(0,Tf.sharedKey)(u.secretKey,r),p=sv(m,s,i),x=bv(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(V7,"x25519Encrypter");function W7(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(W7,"validateHeader");function gv(r){let e=o(function(s,a,f,u){try{let x=function(){let C=sv(O,n,t),$=iv(u.encrypted_key,u.header.tag);return Promise.resolve(Qg(C).decrypt($,Ar(u.header.iv))).then(function(I){return I===null?null:Qg(I).decrypt(s,a,f)})};o(x,"_temp4");var m,p;if(W7((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),O,T=function(){if(r instanceof Uint8Array)O=(0,Tf.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(gv,"x25519Decrypter");Vd();var Eu=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),n0=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*n0(a,f))}else{let s=Pe.asCID(n);s?yield[i.join("/"),s]:yield*n0(n,i)}}},"links"),i0=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*i0(a,f))}else yield*i0(n,i)}},"tree"),G7=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"),Su=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:Eu(),bytes:Eu(),value:Eu(),asBlock:Eu()})}links(){return n0(this.value,[])}tree(){return i0(this.value,[])}get(e="/"){return G7(this.value,e.split("/").filter(Boolean))}};o(Su,"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 Su({value:r,bytes:i,cid:a})}),"encode");Vn();uf();jd();Ld();var Di={};St(Di,{code:()=>va,decode:()=>m0,encode:()=>Pf,name:()=>DS});var Y7=["string","number","bigint","symbol"],J7=["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 vv(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(Y7.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(X7(r))return"Buffer";let t=Z7(r);return t||"Object"}o(vv,"is");function X7(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(X7,"isBuffer");function Z7(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(J7.includes(e))return e}o(Z7,"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 da=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Q7=new TextDecoder,eS=new TextEncoder;function Mu(r){return da&&globalThis.Buffer.isBuffer(r)}o(Mu,"isBuffer");function s0(r){return r instanceof Uint8Array?Mu(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(s0,"asU8A");var _v=da?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):xv(r,e,t):(r,e,t)=>t-e>64?Q7.decode(r.subarray(e,t)):xv(r,e,t),Ev=da?r=>r.length>64?globalThis.Buffer.from(r):yv(r):r=>r.length>64?eS.encode(r):yv(r),ri=o(r=>Uint8Array.from(r),"fromArray"),ha=da?(r,e,t)=>Mu(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Sv=da?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),s0(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},Mv=da?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Av(r,e){if(Mu(r)&&Mu(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(Av,"compare");function yv(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(yv,"utf8ToBytes");function xv(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 tS(n)}o(xv,"utf8Slice");var wv=4096;function tS(r){let e=r.length;if(e<=wv)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=wv));return t}o(tS,"decodeCodePointsArray");var rS=256,pa=class{constructor(e=rS){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=Mv(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=ha(n,0,this.cursor)}else t=Sv(this.chunks,this.cursor);return e&&this.reset(),t}};o(pa,"Bl");var Ze="CBOR decode error:",a0="CBOR encode error:",kf=[];kf[23]=1;kf[24]=2;kf[25]=3;kf[26]=5;kf[27]=9;function Ci(r,e,t){if(r.length-e<t)throw new Error(`${Ze} not enough data for type`)}o(Ci,"assertEnoughData");var Vt=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Pr(r,e,t){Ci(r,e,1);let n=r[e];if(t.strict===!0&&n<Vt[0])throw new Error(`${Ze} integer encoded in more bytes than necessary (strict decode)`);return n}o(Pr,"readUint8");function Nr(r,e,t){Ci(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Vt[1])throw new Error(`${Ze} integer encoded in more bytes than necessary (strict decode)`);return n}o(Nr,"readUint16");function Rr(r,e,t){Ci(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(`${Ze} integer encoded in more bytes than necessary (strict decode)`);return n}o(Rr,"readUint32");function Lr(r,e,t){Ci(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(`${Ze} 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(`${Ze} integers outside of the safe integer range are not supported`)}o(Lr,"readUint64");function Tv(r,e,t,n){return new _e(de.uint,Pr(r,e+1,n),2)}o(Tv,"decodeUint8");function kv(r,e,t,n){return new _e(de.uint,Nr(r,e+1,n),3)}o(kv,"decodeUint16");function Cv(r,e,t,n){return new _e(de.uint,Rr(r,e+1,n),5)}o(Cv,"decodeUint32");function Dv(r,e,t,n){return new _e(de.uint,Lr(r,e+1,n),9)}o(Dv,"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(`${Ze} 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 Iv(r,e,t,n){return new _e(de.negint,-1-Pr(r,e+1,n),2)}o(Iv,"decodeNegint8");function Ov(r,e,t,n){return new _e(de.negint,-1-Nr(r,e+1,n),3)}o(Ov,"decodeNegint16");function Pv(r,e,t,n){return new _e(de.negint,-1-Rr(r,e+1,n),5)}o(Pv,"decodeNegint32");var f0=BigInt(-1),Nv=BigInt(1);function Rv(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(`${Ze} integers outside of the safe integer range are not supported`);return new _e(de.negint,f0-BigInt(i),9)}o(Rv,"decodeNegint64");function Au(r,e){let t=e.value,n=typeof t=="bigint"?t*f0-Nv:t*-1-1;er(r,e.type.majorEncoded,n)}o(Au,"encodeNegint");Au.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*f0-Nv:t*-1-1;return n<Vt[0]?1:n<Vt[1]?2:n<Vt[2]?3:n<Vt[3]?5:9},"encodedSize");Au.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function Cf(r,e,t,n){Ci(r,e,t+n);let i=ha(r,e+t,e+t+n);return new _e(de.bytes,i,t+n)}o(Cf,"toToken");function Lv(r,e,t,n){return Cf(r,e,1,t)}o(Lv,"decodeBytesCompact");function Bv(r,e,t,n){return Cf(r,e,2,Pr(r,e+1,n))}o(Bv,"decodeBytes8");function Uv(r,e,t,n){return Cf(r,e,3,Nr(r,e+1,n))}o(Uv,"decodeBytes16");function Fv(r,e,t,n){return Cf(r,e,5,Rr(r,e+1,n))}o(Fv,"decodeBytes32");function $v(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer bytes lengths not supported`);return Cf(r,e,9,i)}o($v,"decodeBytes64");function Tu(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===de.string?Ev(r.value):r.value),r.encodedBytes}o(Tu,"tokenBytes");function ma(r,e){let t=Tu(e);er(r,e.type.majorEncoded,t.length),r.push(t)}o(ma,"encodeBytes");ma.encodedSize=o(function(e){let t=Tu(e);return er.encodedSize(t.length)+t.length},"encodedSize");ma.compareTokens=o(function(e,t){return iS(Tu(e),Tu(t))},"compareTokens");function iS(r,e){return r.length<e.length?-1:r.length>e.length?1:Av(r,e)}o(iS,"compareBytes");function Df(r,e,t,n,i){let s=t+n;Ci(r,e,s);let a=new _e(de.string,_v(r,e+t,e+s),s);return i.retainStringBytes===!0&&(a.byteValue=ha(r,e+t,e+s)),a}o(Df,"toToken");function qv(r,e,t,n){return Df(r,e,1,t,n)}o(qv,"decodeStringCompact");function Hv(r,e,t,n){return Df(r,e,2,Pr(r,e+1,n),n)}o(Hv,"decodeString8");function jv(r,e,t,n){return Df(r,e,3,Nr(r,e+1,n),n)}o(jv,"decodeString16");function zv(r,e,t,n){return Df(r,e,5,Rr(r,e+1,n),n)}o(zv,"decodeString32");function Kv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer string lengths not supported`);return Df(r,e,9,i,n)}o(Kv,"decodeString64");var Vv=ma;function ba(r,e,t,n){return new _e(de.array,n,t)}o(ba,"toToken");function Wv(r,e,t,n){return ba(r,e,1,t)}o(Wv,"decodeArrayCompact");function Gv(r,e,t,n){return ba(r,e,2,Pr(r,e+1,n))}o(Gv,"decodeArray8");function Yv(r,e,t,n){return ba(r,e,3,Nr(r,e+1,n))}o(Yv,"decodeArray16");function Jv(r,e,t,n){return ba(r,e,5,Rr(r,e+1,n))}o(Jv,"decodeArray32");function Xv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer array lengths not supported`);return ba(r,e,9,i)}o(Xv,"decodeArray64");function Zv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Ze} indefinite length items not allowed`);return ba(r,e,1,1/0)}o(Zv,"decodeArrayIndefinite");function ku(r,e){er(r,de.array.majorEncoded,e.value)}o(ku,"encodeArray");ku.compareTokens=an.compareTokens;ku.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function ga(r,e,t,n){return new _e(de.map,n,t)}o(ga,"toToken");function Qv(r,e,t,n){return ga(r,e,1,t)}o(Qv,"decodeMapCompact");function e2(r,e,t,n){return ga(r,e,2,Pr(r,e+1,n))}o(e2,"decodeMap8");function t2(r,e,t,n){return ga(r,e,3,Nr(r,e+1,n))}o(t2,"decodeMap16");function r2(r,e,t,n){return ga(r,e,5,Rr(r,e+1,n))}o(r2,"decodeMap32");function n2(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Ze} 64-bit integer map lengths not supported`);return ga(r,e,9,i)}o(n2,"decodeMap64");function i2(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Ze} indefinite length items not allowed`);return ga(r,e,1,1/0)}o(i2,"decodeMapIndefinite");function Cu(r,e){er(r,de.map.majorEncoded,e.value)}o(Cu,"encodeMap");Cu.compareTokens=an.compareTokens;Cu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function o2(r,e,t,n){return new _e(de.tag,t,1)}o(o2,"decodeTagCompact");function s2(r,e,t,n){return new _e(de.tag,Pr(r,e+1,n),2)}o(s2,"decodeTag8");function a2(r,e,t,n){return new _e(de.tag,Nr(r,e+1,n),3)}o(a2,"decodeTag16");function f2(r,e,t,n){return new _e(de.tag,Rr(r,e+1,n),5)}o(f2,"decodeTag32");function c2(r,e,t,n){return new _e(de.tag,Lr(r,e+1,n),9)}o(c2,"decodeTag64");function Du(r,e){er(r,de.tag.majorEncoded,e.value)}o(Du,"encodeTag");Du.compareTokens=an.compareTokens;Du.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");var uS=20,lS=21,dS=22,hS=23;function u2(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${Ze} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new _e(de.null,null,1):new _e(de.undefined,void 0,1)}o(u2,"decodeUndefined");function l2(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Ze} indefinite length items not allowed`);return new _e(de.break,void 0,1)}o(l2,"decodeBreak");function c0(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${Ze} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${Ze} Infinity values are not supported`)}return new _e(de.float,r,e)}o(c0,"createToken");function d2(r,e,t,n){return c0(u0(r,e+1),3,n)}o(d2,"decodeFloat16");function h2(r,e,t,n){return c0(l0(r,e+1),5,n)}o(h2,"decodeFloat32");function p2(r,e,t,n){return c0(v2(r,e+1),9,n)}o(p2,"decodeFloat64");function Iu(r,e,t){let n=e.value;if(n===!1)r.push([de.float.majorEncoded|uS]);else if(n===!0)r.push([de.float.majorEncoded|lS]);else if(n===null)r.push([de.float.majorEncoded|dS]);else if(n===void 0)r.push([de.float.majorEncoded|hS]);else{let i,s=!1;(!t||t.float64!==!0)&&(b2(n),i=u0(Mn,1),n===i||Number.isNaN(n)?(Mn[0]=249,r.push(Mn.slice(0,3)),s=!0):(g2(n),i=l0(Mn,1),n===i&&(Mn[0]=250,r.push(Mn.slice(0,5)),s=!0))),s||(pS(n),i=v2(Mn,1),Mn[0]=251,r.push(Mn.slice(0,9)))}}o(Iu,"encodeFloat");Iu.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){b2(n);let i=u0(Mn,1);if(n===i||Number.isNaN(n))return 3;if(g2(n),i=l0(Mn,1),n===i)return 5}return 9},"encodedSize");var m2=new ArrayBuffer(9),fn=new DataView(m2,1),Mn=new Uint8Array(m2,0);function b2(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(b2,"encodeFloat16");function u0(r,e){if(r.length-e<2)throw new Error(`${Ze} 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*gd(2,-24):n!==31?s=(i+1024)*gd(2,n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(u0,"readFloat16");function g2(r){fn.setFloat32(0,r,!1)}o(g2,"encodeFloat32");function l0(r,e){if(r.length-e<4)throw new Error(`${Ze} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(l0,"readFloat32");function pS(r){fn.setFloat64(0,r,!1)}o(pS,"encodeFloat64");function v2(r,e){if(r.length-e<8)throw new Error(`${Ze} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(v2,"readFloat64");Iu.compareTokens=an.compareTokens;function ct(r,e,t){throw new Error(`${Ze} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(ct,"invalidMinor");function Ou(r){return()=>{throw new Error(`${Ze} ${r}`)}}o(Ou,"errorer");var ye=[];for(let r=0;r<=23;r++)ye[r]=ct;ye[24]=Tv;ye[25]=kv;ye[26]=Cv;ye[27]=Dv;ye[28]=ct;ye[29]=ct;ye[30]=ct;ye[31]=ct;for(let r=32;r<=55;r++)ye[r]=ct;ye[56]=Iv;ye[57]=Ov;ye[58]=Pv;ye[59]=Rv;ye[60]=ct;ye[61]=ct;ye[62]=ct;ye[63]=ct;for(let r=64;r<=87;r++)ye[r]=Lv;ye[88]=Bv;ye[89]=Uv;ye[90]=Fv;ye[91]=$v;ye[92]=ct;ye[93]=ct;ye[94]=ct;ye[95]=Ou("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)ye[r]=qv;ye[120]=Hv;ye[121]=jv;ye[122]=zv;ye[123]=Kv;ye[124]=ct;ye[125]=ct;ye[126]=ct;ye[127]=Ou("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)ye[r]=Wv;ye[152]=Gv;ye[153]=Yv;ye[154]=Jv;ye[155]=Xv;ye[156]=ct;ye[157]=ct;ye[158]=ct;ye[159]=Zv;for(let r=160;r<=183;r++)ye[r]=Qv;ye[184]=e2;ye[185]=t2;ye[186]=r2;ye[187]=n2;ye[188]=ct;ye[189]=ct;ye[190]=ct;ye[191]=i2;for(let r=192;r<=215;r++)ye[r]=o2;ye[216]=s2;ye[217]=a2;ye[218]=f2;ye[219]=c2;ye[220]=ct;ye[221]=ct;ye[222]=ct;ye[223]=ct;for(let r=224;r<=243;r++)ye[r]=Ou("simple values are not supported");ye[244]=ct;ye[245]=ct;ye[246]=ct;ye[247]=u2;ye[248]=Ou("simple values are not supported");ye[249]=d2;ye[250]=h2;ye[251]=p2;ye[252]=ct;ye[253]=ct;ye[254]=ct;ye[255]=l2;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 y2(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(y2,"quickEncodeToken");var bS={float64:!1,mapSorter:yS,quickEncodeToken:y2};function gS(){let r=[];return r[de.uint.major]=an,r[de.negint.major]=Au,r[de.bytes.major]=ma,r[de.string.major]=Vv,r[de.array.major]=ku,r[de.map.major]=Cu,r[de.tag.major]=Du,r[de.float.major]=Iu,r}o(gS,"makeCborEncoders");var x2=gS(),d0=new pa,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(`${a0} 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++]=Pu(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++]=[Pu(m,t,n),Pu(i?r.get(m):r[m],t,n)];return vS(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 Pu(r,e={},t){let n=vv(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(`${a0} unsupported type: ${n}`);return s(r,n,e,t)}o(Pu,"objectToTokens");function vS(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(vS,"sortMapEntries");function yS(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=x2[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(yS,"mapSorter");function w2(r,e,t,n){if(Array.isArray(e))for(let i of e)w2(r,i,t,n);else t[e.type.major](r,e,n)}o(w2,"tokensToEncoded");function xS(r,e,t){let n=Pu(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 pa(a);if(s(f,n,t),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return s0(f.chunks[0])}}return d0.reset(),w2(d0,n,e,t),d0.toBytes(!0)}o(xS,"encodeCustom");function h0(r,e){return e=Object.assign({},bS,e),xS(r,x2,e)}o(h0,"encode");var wS={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Nu=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(`${Ze} 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(Nu,"Tokeniser");var If=Symbol.for("DONE"),Ru=Symbol.for("BREAK");function _S(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=Of(e,t);if(s===Ru){if(r.value===1/0)break;throw new Error(`${Ze} got unexpected break to lengthed array`)}if(s===If)throw new Error(`${Ze} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(_S,"tokenToArray");function ES(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===Ru){if(r.value===1/0)break;throw new Error(`${Ze} got unexpected break to lengthed map`)}if(f===If)throw new Error(`${Ze} found map but not enough entries (got ${a} [no key], expected ${r.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${Ze} non-string keys not supported (got ${typeof f})`);let u=Of(e,t);if(u===If)throw new Error(`${Ze} 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(ES,"tokenToMap");function Of(r,e){if(r.done())return If;let t=r.next();if(t.type===de.break)return Ru;if(t.type.terminal)return t.value;if(t.type===de.array)return _S(t,r,e);if(t.type===de.map)return ES(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(`${Ze} tag not supported (${t.value})`)}throw new Error("unsupported")}o(Of,"tokensToObject");function p0(r,e){if(!(r instanceof Uint8Array))throw new Error(`${Ze} data to decode must be a Uint8Array`);e=Object.assign({},wS,e);let t=e.tokenizer||new Nu(r,e),n=Of(t,e);if(n===If)throw new Error(`${Ze} did not find any content to decode`);if(n===Ru)throw new Error(`${Ze} got unexpected break`);if(!t.done())throw new Error(`${Ze} too many terminals, data makes no sense`);return n}o(p0,"decode");Vn();var _2=42;function MS(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,_2),new _e(de.bytes,t)]}o(MS,"cidEncoder");function AS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(AS,"undefinedEncoder");function TS(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(TS,"numberEncoder");var kS={float64:!0,typeEncoders:{Object:MS,undefined:AS,number:TS}};function CS(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Pe.decode(r.subarray(1))}o(CS,"cidDecoder");var E2={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};E2.tags[_2]=CS;var DS="dag-cbor",va=113,Pf=o(r=>h0(r,kS),"encode"),m0=o(r=>p0(r,E2),"decode");var IS=24;function S2(r){return Z(this,null,function*(){let e=yield ns({value:r,codec:Di,hasher:zo});return{cid:e.cid,linkedBlock:e.bytes}})}o(S2,"encodePayload");function OS(r,e=IS){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(OS,"pad");function PS(r){return Z(this,null,function*(){return(yield ns({value:r,codec:Di,hasher:Hc})).cid})}o(PS,"encodeIdentityCID");function NS(r){if(r=Pe.asCID(r),r.code!==va)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==Hc.code)throw new Error("CID must use identity multihash");return m0(r.multihash.digest)}o(NS,"decodeIdentityCID");function M2(r,e){return Z(this,null,function*(){return OS((yield PS(r)).bytes,e)})}o(M2,"prepareCleartext");function A2(r){return NS(Pe.decodeFirst(r)[0])}o(A2,"decodeCleartext");var T2=Symbol("abortable"),Lu=Symbol("aborted");function k2(r,e){if(e.aborted)return Promise.reject(Lu);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Lu)}),Promise.race([r,n])}o(k2,"abortable");var C2=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 Bu="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 D2={[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 RS(r){return-32e3>=r&&r>=-32099}o(RS,"isServerError");function Uu(r){var e;return(e=D2[r.toString()])!=null?e:RS(r)?"Server error":"Application error"}o(Uu,"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:Uu(e)}};o(Tr,"RPCError");function Nf(r){let e=D2[r];return o(function(n){return new Tr(r,e,n)},"createError")}o(Nf,"createErrorFactory");var LS=Nf(vr.PARSE_ERROR),hL=Nf(vr.INVALID_REQUEST),pL=Nf(vr.METHOD_NOT_FOUND),mL=Nf(vr.INVALID_PARAMS),bL=Nf(vr.INTERNAL_ERROR);function BS(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(BS,"_checkPrivateRedeclaration");function US(r,e){return e.get?e.get.call(r):e.value}o(US,"_classApplyDescriptorGet");function FS(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(FS,"_classApplyDescriptorSet");function I2(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(I2,"_classExtractFieldDescriptor");function b0(r,e){var t=I2(r,e,"get");return US(r,t)}o(b0,"_classPrivateFieldGet");function $S(r,e,t){BS(r,e),e.set(r,t)}o($S,"_classPrivateFieldInit");function qS(r,e,t){var n=I2(r,e,"set");return FS(r,n,t),t}o(qS,"_classPrivateFieldSet");var Rf=new WeakMap,ya=class{get connection(){return b0(this,Rf)}createID(){return C2()}request(e,t=void 0,n={}){let{signal:i}=n;if(i!=null&&i.aborted)return Promise.reject(Lu);let s=this.createID(),a=b0(this,Rf).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(Bu,{id:s})}),k2(a,i))}notify(e,t=void 0){return Z(this,null,function*(){yield b0(this,Rf).send({jsonrpc:"2.0",method:e,params:t})})}constructor(e){$S(this,Rf,{writable:!0,value:void 0}),qS(this,Rf,e)}};o(ya,"RPCClient");function O2(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Uu(e)}}}o(O2,"createErrorResponse");function HS(r,e,t){console.warn("Unhandled handler error",e,t)}o(HS,"fallbackOnHandlerError");function jS(r,e){console.warn("Unhandled invalid message",e)}o(jS,"fallbackOnInvalidMessage");function zS(r,e){console.warn("Unhandled notification",e)}o(zS,"fallbackOnNotification");function P2(r,e={}){var f,u,m;let t=(f=e.onHandlerError)!=null?f:HS,n=(u=e.onInvalidMessage)!=null?u:jS,i=(m=e.onNotification)!=null?m:zS,s={};function a(p,x){var k,O;if(x.method===Bu){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):O2(O,vr.INVALID_REQUEST);let T=r[k.method];if(T==null)return O==null?(a(x,k),null):O2(O,vr.METHOD_NOT_FOUND);try{let U;if(O!=null&&T[T2]){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 Tr)z=U.toObject();else{t(x,k,U);let H=(I=U.code)!=null?I:-32e3;z={code:H,message:U.message||Uu(H)}}return{jsonrpc:"2.0",id:O,error:z}}finally{O!=null&&delete s[O]}})},"handleRequest")}o(P2,"createHandler");Vn();var c3=at(Sy(),1),dr=at(fs(),1);function M0(){return M0=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},M0.apply(this,arguments)}o(M0,"_extends");var A0={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}"}}}},cM={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}"}}}},T0={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}"}}}},uM={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:A0,1:T0}}},lM={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:A0,1:T0,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},$f={2:A0,10:cM,19:{assetName:T0,assetType:uM,assetId:lM}};function My(r,e){return r.split(e.parameters.delimiter)}o(My,"splitParams");function qf(r,e){var t=My(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(qf,"getParams");function Sa(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Sa(n,t)}).join(e.parameters.delimiter)}o(Sa,"joinParams");function Hf(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=My(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(Hf,"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(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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=$f[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(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=qf(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=M0({},i.toJSON(),{address:n.address});return Sa(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=$f[10];var k0=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(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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}();k0.spec=$f[19].assetName;var dM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new k0(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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}();dM.spec=$f[19].assetType;var hM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ho(t.chainId),this.assetName=new k0(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!Hf(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(qf(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Sa(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}();hM.spec=$f[19].assetId;var Ay="logger/5.6.0";var Ty=!1,ky=!1,zu={debug:1,default:2,info:2,warning:3,error:4,off:5},Cy=zu.default,C0=null;function pM(){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(pM,"_checkNormalize");var Dy=pM(),D0;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(D0||(D0={}));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 Iy="0123456789abcdef",tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();zu[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Cy>zu[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(ky)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+=Iy[m[x]>>4],p+=Iy[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"),Dy&&this.throwError("platform missing String.prototype.normalize",tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Dy})}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 C0||(C0=new tt(Ay)),C0}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ty){if(!e)return;this.globalLogger().throwError("error censorship permanent",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ky=!!e,Ty=!!t}static setLogLevel(e){let t=zu[e.toLowerCase()];if(t==null){tt.globalLogger().warn("invalid log level - "+e);return}Cy=t}static from(e){return new tt(e)}};o(tt,"Logger");tt.errors=kn;tt.levels=D0;var Oy="bytes/5.6.1";var Bt=new tt(Oy);function Ny(r){return!!r.toHexString}o(Ny,"isHexable");function Ma(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Ma(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Ma,"addSlice");function Ry(r){return Cn(r)&&!(r.length%2)||O0(r)}o(Ry,"isBytesLike");function Py(r){return typeof r=="number"&&r==r&&r%1===0}o(Py,"isInteger");function O0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!Py(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!Py(t)||t<0||t>=256)return!1}return!0}o(O0,"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),Ma(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Ny(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 Ma(new Uint8Array(n))}return O0(r)?Ma(new Uint8Array(r)):Bt.throwArgumentError("invalid arrayify value","value",r)}o(Tt,"arrayify");function P0(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),Ma(n)}o(P0,"concat");function mM(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),Ma(t)}o(mM,"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 I0="0123456789abcdef";function ur(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=I0[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),Ny(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(O0(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=I0[(i&240)>>4]+I0[i&15]}return t}return Bt.throwArgumentError("invalid hexlify value","value",r)}o(ur,"hexlify");function Ku(r){if(typeof r!="string")r=ur(r);else if(!Cn(r)||r.length%2)return null;return(r.length-2)/2}o(Ku,"hexDataLength");function Vu(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(Vu,"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 Wu(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ry(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=mM(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(Wu,"splitSignature");var Uy=at(R0());var By="bignumber/5.6.2";var bM=Uy.default.BN,fB=new tt(By);function L0(r){return new bM(r,36).toString(16)}o(L0,"_base36To16");var Fy=at(th());function Aa(r){return"0x"+Fy.default.keccak_256(Tt(r))}o(Aa,"keccak256");var $y="address/5.6.1";var jf=new tt($y);function qy(r){Cn(r,20)||jf.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(Aa(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(qy,"getChecksumAddress");var yM=9007199254740991;function xM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(xM,"log10");var B0={};for(let r=0;r<10;r++)B0[String(r)]=String(r);for(let r=0;r<26;r++)B0[String.fromCharCode(65+r)]=String(10+r);var Hy=Math.floor(xM(yM));function wM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>B0[n]).join("");for(;e.length>=Hy;){let n=e.substring(0,Hy);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(wM,"ibanChecksum");function jy(r){let e=null;if(typeof r!="string"&&jf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=qy(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&jf.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)!==wM(r)&&jf.throwArgumentError("bad icap checksum","address",r),e=L0(r.substring(4));e.length<40;)e="0"+e;e=qy("0x"+e)}else jf.throwArgumentError("invalid address","address",r);return e}o(jy,"getAddress");var zy="properties/5.6.0";var MB=new tt(zy);function Ta(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Ta,"defineReadOnly");var Ky="strings/5.6.1";var Vy=new tt(Ky),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 _M(r,e,t,n,i){return Vy.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(_M,"errorFunc");function Wy(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(Wy,"ignoreFunc");function EM(r,e,t,n,i){return r===us.OVERLONG?(n.push(i),0):(n.push(65533),Wy(r,e,t,n,i))}o(EM,"replaceFunc");var SM=Object.freeze({error:_M,ignore:Wy,replace:EM});function Kf(r,e=zf.current){e!=zf.current&&(Vy.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(Kf,"toUtf8Bytes");var Gy=`Ethereum Signed Message:
|
634
|
+
`;function U0(r){return typeof r=="string"&&(r=Kf(r)),Aa(P0([Kf(Gy),Kf(String(r.length)),r]))}o(U0,"hashMessage");var Qe=at(R0()),oi=at(vf());function ka(r,e,t){return t={path:e,exports:{},require:function(n,i){return MM(n,i==null?t.path:i)}},r(t,t.exports),t.exports}o(ka,"createCommonjsModule");function MM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(MM,"commonjsRequire");var H0=Jy;function Jy(r,e){if(!r)throw new Error(e||"Assertion failed")}o(Jy,"assert");Jy.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Dn=ka(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=ka(function(r,e){"use strict";var t=e;t.assert=H0,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}),Ju=Ur.getNAF,AM=Ur.getJSF,Xu=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){Xu(e.precomputed);var n=e._getDoubles(),i=Ju(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=Ju(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];Xu(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]=Ju(n[T],a[T],this._bitLength),u[C]=Ju(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=AM(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?Xu(e[e.length-1]%2===0):e[0]===7&&Xu(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 j0=ka(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")}),TM=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");j0(dn,ls);var kM=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],TM(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");j0(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");j0(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),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");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),O=u.redMul(x.redISub(k)).redISub(s.redMul(p)),T=this.z.redMul(f);return this.curve.jpoint(k,O,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(),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");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(),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");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(),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");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),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");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 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");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 Gu=ka(function(r,e){"use strict";var t=e;t.base=ls,t.short=kM,t.mont=null,t.edwards=null}),Yu=ka(function(r,e){"use strict";var t=e,n=Ur.assert;function i(f){f.type==="short"?this.curve=new Gu.short(f):f.type==="edwards"?this.curve=new Gu.edwards(f):this.curve=new Gu.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");H0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(mo,"HmacDRBG");var Xy=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),H0(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 q0=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 z0=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"?q0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&q0(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()||q0(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 CM=Ur.assert;function Zu(r,e){if(r instanceof Zu)return r;this._importDER(r,e)||(CM(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(Zu,"Signature");var Qu=Zu;function DM(){this.place=0}o(DM,"Position");function F0(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(F0,"getLength");function Yy(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(Yy,"rmPadding");Zu.prototype._importDER=o(function(e,t){e=Ur.toArray(e,t);var n=new DM;if(e[n.place++]!==48)return!1;var i=F0(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=F0(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=F0(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 $0(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($0,"constructLength");Zu.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=Yy(t),n=Yy(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];$0(i,t.length),i=i.concat(t),i.push(2),$0(i,n.length);var s=i.concat(n),a=[48];return $0(a,s.length),a=a.concat(s),Ur.encode(a,e)},"toDER");var IM=o(function(){throw new Error("unsupported")},"rand"),Zy=Ur.assert;function un(r){if(!(this instanceof un))return new un(r);typeof r=="string"&&(Zy(Object.prototype.hasOwnProperty.call(Yu,r),"Unknown curve "+r),r=Yu[r]),r instanceof Yu.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 OM=un;un.prototype.keyPair=o(function(e){return new z0(this,e)},"keyPair");un.prototype.keyFromPrivate=o(function(e,t){return z0.fromPrivate(this,e,t)},"keyFromPrivate");un.prototype.keyFromPublic=o(function(e,t){return z0.fromPublic(this,e,t)},"keyFromPublic");un.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Xy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||IM(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 Xy({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 Qu({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 Qu(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){Zy((3&t)===t,"The recovery param is more than two bits"),e=new Qu(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 Qu(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 PM=ka(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=Gu,t.curves=Yu,t.ec=OM,t.eddsa=null}),Qy=PM.ec;var e3="signing-key/5.6.2";var V0=new tt(e3),K0=null;function si(){return K0||(K0=new Qy("secp256k1")),K0}o(si,"getCurve");var el=class{constructor(e){Ta(this,"curve","secp256k1"),Ta(this,"privateKey",ur(e)),Ku(this.privateKey)!==32&&V0.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=si().keyFromPrivate(Tt(this.privateKey));Ta(this,"publicKey","0x"+t.getPublic(!1,"hex")),Ta(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Ta(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&&V0.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return Wu({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(W0(e)));return po("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(el,"SigningKey");function t3(r,e){let t=Wu(e),n={r:Tt(t.r),s:Tt(t.s)};return"0x"+si().recoverPubKey(Tt(r),n,t.recoveryParam).encode("hex",!1)}o(t3,"recoverPublicKey");function W0(r,e){let t=Tt(r);if(t.length===32){let n=new el(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 V0.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(W0,"computePublicKey");var r3="transactions/5.6.2";var oU=new tt(r3),n3;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(n3||(n3={}));function i3(r){let e=W0(r);return jy(Vu(Aa(Vu(e,1)),12))}o(i3,"computeAddress");function o3(r,e){return i3(t3(Tt(r),e))}o(o3,"recoverAddress");var s3="wallet/5.6.2";var pU=new tt(s3);function a3(r,e){return o3(U0(r),e)}o(a3,"verifyMessage");uf();var NM=`
|
635
635
|
sign-in-with-ethereum =
|
636
636
|
domain %s" wants you to sign in with your Ethereum account:" LF
|
637
637
|
address LF
|
@@ -778,18 +778,18 @@ LF = %x0A
|
|
778
778
|
DIGIT = %x30-39
|
779
779
|
; 0-9
|
780
780
|
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
781
|
-
`,tl=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 c3.default(
|
782
|
-
- `)),re},"resources");i.ast.callbacks.resources=
|
781
|
+
`,tl=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 c3.default(NM);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 O=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"]=O;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 I=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(`
|
782
|
+
- `)),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(tl,"ParsedMessage");var f3;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(f3||(f3={}));var rl;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(rl||(rl={}));var Ca=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 tl(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 Ca({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=rl.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(`
|
783
783
|
`),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(`
|
784
784
|
`));let f=a.join(`
|
785
785
|
`);return this.statement&&(n=[n,this.statement].join(`
|
786
786
|
|
787
787
|
`)),[n,f].join(`
|
788
788
|
|
789
|
-
`)}signMessage(){let e;switch(this.type){case rl.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Ca,"SiweMessage");var NA=5*60,Vf;(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:NA)*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 p=Ca.fromCacao(i),m=i.s.s,x=a3(p.toMessage(),m),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})(Vf||(Vf={}));var Wf;(function(r){let e=o(function(t){try{return Promise.resolve(ns({value:t,codec:Di,hasher:zo}))}catch(n){return Promise.reject(n)}},"fromCacao");r.fromCacao=e})(Wf||(Wf={}));df();Wc();var u3=at(no(),1);df();function l3(){return Ot((0,u3.randomBytes)(16),"base64")}o(l3,"randomString");var d3="base64pad",h3="base64url";function p3(r){return Ot(r,d3)}o(p3,"encodeBase64");function m3(r){return Ot(r,h3)}o(m3,"encodeBase64Url");function b3(r){return Lt(r,d3)}o(b3,"decodeBase64");function nl(r){return JSON.parse(Ot(Lt(r,h3)))}o(nl,"base64urlToJSON");function g3(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(g3,"fromDagJWS");function v3(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(v3,"didWithTime");function y3(r){return r?Array.isArray(r)?r:[r]:[]}o(y3,"extractControllers");function RA(r){return"registry"in r&&"cache"in r}o(RA,"isResolver");var ds=class{constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new ya(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 ya(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=RA(e)?e:new of(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=l3(),s=yield this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:a}=yield this.verifyJWS(s),f=nl(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 Wf.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",Me(ie({did:this._id},t),{payload:e}));return i})}createDagJWS(n){return Z(this,arguments,function*(e,t={}){let{cid:i,linkedBlock:s}=yield S2(e),a=m3(i.bytes);Object.assign(t,{linkedBlock:p3(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 p=yield Wf.fromCacao(this._capability);return{jws:f,linkedBlock:s,cacaoBlock:p.bytes}}return{jws:f,linkedBlock:s}})}verifyJWS(n){return Z(this,arguments,function*(e,t={}){var m,x,k,I,T,C,$;typeof e!="string"&&(e=g3(e));let i=nl(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=(m=s.didDocumentMetadata)==null?void 0:m.nextUpdate;if(O){let z=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,H=new Date(O).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===((I=t.capability)==null?void 0:I.p.iss)&&f===t.capability.p.aud)Vf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(t.issuer&&t.issuer!==f){let O=v3(t.issuer,t.atTime),z=(T=(yield this.resolve(O)).didDocument)==null?void 0:T.controller,H=y3(z);if(((C=t.capability)==null?void 0:C.s)&&t.capability.p.aud===f&&H.includes(t.capability.p.iss))Vf.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)||[];dv(e,u);let p;try{p=nl(e.split(".")[1])}catch(O){}return{kid:i,payload:p,didResolutionResult:s}})}createJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield mv(t,this._resolver);return pv(e,a,n.protectedHeader,n.aad)})}createDagJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield A2(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",Me(ie({did:this._id},t),{jwe:e}));return b3(i)})}decryptDagJWE(e){return Z(this,null,function*(){let t=yield this.decryptJWE(e);return M2(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 il(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(il,"toUint8Array");var E4=at(dx());var fl=at(mu(),1);var vx=at(px(),1);var ZM="base64pad";function mx(r){return JSON.parse((0,vx.default)(r))}o(mx,"toStableObject");function QM(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(QM,"encodeDID");function bx(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(bx,"toGeneralJWS");var gx=o((i,s,a,...f)=>Z(void 0,[i,s,a,...f],function*(r,e,t,n={}){let u=`${e}#${e.split(":")[2]}`,p=av(t),m=mx(Object.assign(n,{kid:u,alg:"EdDSA"}));return lv(typeof r=="string"?r:mx(r),p,m)}),"sign"),eT={did_authenticate:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){let s=yield gx({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return bx(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 gx(t.payload,r,e,t.protected);return{jws:bx(a)}}),did_decryptJWE:(t,n)=>Z(void 0,[t,n],function*({secretKey:r},e){let i=gv((0,fl.convertSecretKeyToX25519)(r));try{let s=yield hv(e.jwe,i);return{cleartext:Ot(s,ZM)}}catch(s){throw new Tr(-32e3,s.message)}})},Jf=class{constructor(e){let{secretKey:t,publicKey:n}=(0,fl.generateKeyPairFromSeed)(e),i=QM(n),s=P2(eT);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(Jf,"Ed25519Provider");Vn();Uc();var yx={tile:0,"caip10-link":1,model:2,MID:3};function tT(r){let e=yx[r];if(typeof e!="undefined")return e;throw new Error(`No stream type registered for name ${r}`)}o(tT,"codeByName");function rT(r){let e=Object.entries(yx).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(rT,"nameByCode");var Cr=class{};o(Cr,"StreamType");Cr.nameByCode=rT;Cr.codeByName=tT;var cp=at(Gf(),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=xx(a.value,e,t,n);else if(a.get!=null)a.get=xx(a.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o($r,"Memoize");var tp=new Map;function xx(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)tp.has(u)?tp.get(u).push(f):tp.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 p=`${u}__timestamp`,m=!1;if(t>0)if(!f.has(p))m=!0;else{let x=f.get(p);m=Date.now()-x>t}f.has(u)&&!m?a=f.get(u):(a=r.apply(this,s),f.set(u,a),t>0&&f.set(p,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(xx,"getNewFunction");Vn();var rp=at(Gf(),1);jo();function ci(r){let e=rp.default.decode(r),t=rp.default.decode.bytes,n=r.slice(t);return[e,n,t]}o(ci,"readVarint");function nT(r){return r===0||r===1}o(nT,"isCidVersion");function np(r){let e=ip(r);if(e instanceof Error)throw e;return e}o(np,"readCid");function ip(r){let[e,t]=ci(r);if(!nT(e))return new Error(`Unknown CID version ${e}`);let[n,i]=ci(t),[,s,a]=ci(i),[f,,u]=ci(s),p=i.slice(0,a+u+f),m=i.slice(a+u+f);return[Pe.create(e,n,ff(p)),m]}o(ip,"readCidNoThrow");Vn();Uc();uf();var op=at(Gf(),1);var Xf=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 iT(r){let e=ap(r);if(e instanceof Error)throw e;return e}o(iT,"fromBytes");function ap(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=ip(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(ap,"fromBytesNoThrow");function oT(r){let e=_x(r);if(e instanceof Error)throw e;return e}o(oT,"fromString");function _x(r){let e=r.replace("ceramic://","").replace("/ceramic/",""),t=e.includes("commit")?e.split("?")[0]:e,n=Fo.decode(t);return ap(n)}o(_x,"fromStringNoThrow");var wx=Symbol.for("@ceramicnetwork/streamid/StreamID"),Je=class{constructor(e,t){if(this._tag=wx,!(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===wx}static fromGenesis(e,t){return Z(this,null,function*(){let n=yield ns({value:t,codec:Di,hasher:zo});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=op.default.encode(206),t=op.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=iT;Je.fromBytesNoThrow=ap;Je.fromString=oT;Je.fromStringNoThrow=_x;Xf([$r(),hn("design:type",String),hn("design:paramtypes",[])],Je.prototype,"typeName",null);Xf([$r(),hn("design:type",Uint8Array),hn("design:paramtypes",[])],Je.prototype,"bytes",null);Xf([$r(),hn("design:type",Je),hn("design:paramtypes",[])],Je.prototype,"baseID",null);Xf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toString",null);Xf([$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},Dr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},fp=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},Li=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)},Oa,ps,Zf;function sT(r){let e=up(r);if(e instanceof Error)throw e;return e}o(sT,"fromBytes");function up(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=np(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]=np(f);return new ht(n,a,u)}}o(up,"fromBytesNoThrow");function aT(r){try{return typeof r=="string"?Pe.parse(r):Pe.asCID(r)}catch(e){return}}o(aT,"parseCID");function fT(r,e=null){if(!e)return null;let t=aT(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(fT,"parseCommit");function cT(r){let e=Sx(r);if(e instanceof Error)throw e;return e}o(cT,"fromString");function Sx(r){let e=r.replace("ceramic://","").replace("/ceramic/","");if(e.includes("commit")){let t=e.split("?")[1].split("=")[1],n=e.split("?")[0];return Ax(Je.fromString(n),t)}else return up(Fo.decode(e))}o(Sx,"fromStringNoThrow");var Ex=Symbol.for("@ceramicnetwork/streamid/CommitID");function Ax(r,e){return new ht(r.type,r.cid,e)}o(Ax,"make");var ht=class{constructor(e,t,n=null){if(this._tag=Ex,Oa.set(this,void 0),ps.set(this,void 0),Zf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");fp(this,Oa,typeof e=="string"?Cr.codeByName(e):e,"f"),fp(this,ps,typeof t=="string"?Pe.parse(t):t,"f"),fp(this,Zf,fT(Li(this,ps,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===Ex}get baseID(){return new Je(Li(this,Oa,"f"),Li(this,ps,"f"))}get type(){return Li(this,Oa,"f")}get typeName(){return Cr.nameByCode(Li(this,Oa,"f"))}get cid(){return Li(this,ps,"f")}get commit(){return Li(this,Zf,"f")||Li(this,ps,"f")}get bytes(){var i;let e=cp.default.encode(206),t=cp.default.encode(this.type),n=((i=Li(this,Zf,"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()}`}[(Oa=new WeakMap,ps=new WeakMap,Zf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(ht,"CommitID");ht.fromBytes=sT;ht.fromBytesNoThrow=up;ht.fromString=cT;ht.fromStringNoThrow=Sx;ht.make=Ax;Ia([$r(),Dr("design:type",Je),Dr("design:paramtypes",[])],ht.prototype,"baseID",null);Ia([$r(),Dr("design:type",String),Dr("design:paramtypes",[])],ht.prototype,"typeName",null);Ia([$r(),Dr("design:type",Pe),Dr("design:paramtypes",[])],ht.prototype,"commit",null);Ia([$r(),Dr("design:type",Uint8Array),Dr("design:paramtypes",[])],ht.prototype,"bytes",null);Ia([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toString",null);Ia([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("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 Mx="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",cl="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var lp={};St(lp,{JsonPatchError:()=>Nt,_areEquals:()=>tc,applyOperation:()=>ms,applyPatch:()=>bl,applyReducer:()=>pT,deepClone:()=>dT,getValueByPointer:()=>pl,validate:()=>kx,validator:()=>ml});var uT=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)}}(),lT=Object.prototype.hasOwnProperty;function ll(r,e){return lT.call(r,e)}o(ll,"hasOwnProperty");function dl(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)ll(r,i)&&n.push(i);return n}o(dl,"_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 hl(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(hl,"isInteger");function ui(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(ui,"escapePathComponent");function Qf(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Qf,"unescapePathComponent");function ul(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(ul(r[e]))return!0}else if(typeof r=="object"){for(var n=dl(r),i=n.length,s=0;s<i;s++)if(ul(r[n[s]]))return!0}}return!1}o(ul,"hasUndefined");function Tx(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(`
|
790
|
-
`)}o(Tx,"patchErrorMessageFormatter");var ec=function(r){uT(e,r);function e(t,n,i,s,a){var f=this.constructor,u=r.call(this,Tx(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=Tx(t,{name:n,index:i,operation:s,tree:a}),u}return o(e,"PatchError"),e}(Error);var Nt=ec,dT=ir,Pa={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=pl(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=pl(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:tc(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},hT={add:function(r,e,t){return hl(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:Pa.move,copy:Pa.copy,test:Pa.test,_get:Pa._get};function pl(r,e){if(e=="")return r;var t={op:"_get",path:e};return ms(r,t),t.value}o(pl,"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):ml(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=pl(r,e.from),e.op==="move"&&(a.removed=r),a;if(e.op==="test"){if(a.test=tc(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("/"),p=r,m=1,x=u.length,k=void 0,I=void 0,T=void 0;for(typeof t=="function"?T=t:T=ml;;){if(I=u[m],I&&I.indexOf("~")!=-1&&(I=Qf(I)),i&&(I=="__proto__"||I=="prototype"&&m>0&&u[m-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&&(p[I]===void 0?k=u.slice(0,m).join("/"):m==x-1&&(k=e.path),k!==void 0&&T(e,0,r,k)),m++,Array.isArray(p)){if(I==="-")I=p.length;else{if(t&&!hl(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);hl(I)&&(I=~~I)}if(m>=x){if(t&&e.op==="add"&&I>p.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=hT[e.op].call(e,p,I,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}}else if(m>=x){var a=Pa[e.op].call(e,p,I,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}if(p=p[I],t&&m<x&&(!p||typeof p!="object"))throw new Nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(ms,"applyOperation");function bl(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(bl,"applyPatch");function pT(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(pT,"applyReducer");function ml(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(Pa[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")&&ul(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=kx([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(ml,"validator");function kx(r,e,t){try{if(!Array.isArray(r))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)bl(ir(e),ir(r),t||!0);else{t=t||ml;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(kx,"validate");function tc(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(!tc(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],!tc(r[a],e[a]))return!1;return!0}return r!==r&&e!==e}o(tc,"_areEquals");var mp={};St(mp,{compare:()=>_T,generate:()=>dp,observe:()=>wT,unobserve:()=>xT});var hp=new WeakMap,mT=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),bT=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function gT(r){return hp.get(r)}o(gT,"getMirror");function vT(r,e){return r.observers.get(e)}o(vT,"getObserverFromMirror");function yT(r,e){r.observers.delete(e.callback)}o(yT,"removeObserverFromMirror");function xT(r,e){e.unobserve()}o(xT,"unobserve");function wT(r,e){var t=[],n,i=gT(r);if(!i)i=new mT(r),hp.set(r,i);else{var s=vT(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(){dp(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(){dp(n),clearTimeout(n.next),yT(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 bT(e,n)),n}o(wT,"observe");function dp(r,e){e===void 0&&(e=!1);var t=hp.get(r.object);pp(t.value,r.object,r.patches,"",e),r.patches.length&&bl(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(dp,"generate");function pp(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=dl(e),a=dl(r),f=!1,u=!1,p=a.length-1;p>=0;p--){var m=a[p],x=r[m];if(ll(e,m)&&!(e[m]===void 0&&x!==void 0&&Array.isArray(e)===!1)){var k=e[m];typeof x=="object"&&x!=null&&typeof k=="object"&&k!=null&&Array.isArray(x)===Array.isArray(k)?pp(x,k,t,n+"/"+ui(m),i):x!==k&&(f=!0,i&&t.push({op:"test",path:n+"/"+ui(m),value:ir(x)}),t.push({op:"replace",path:n+"/"+ui(m),value:ir(k)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+ui(m),value:ir(x)}),t.push({op:"remove",path:n+"/"+ui(m)}),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 p=0;p<s.length;p++){var m=s[p];!ll(r,m)&&e[m]!==void 0&&t.push({op:"add",path:n+"/"+ui(m),value:ir(e[m])})}}}o(pp,"_generate");function _T(r,e,t){t===void 0&&(t=!1);var n=[];return pp(r,e,n,"",t),n}o(_T,"compare");var Na=Object.assign({},lp,mp,{JsonPatchError:ec,deepClone:ir,escapePathComponent:ui,unescapePathComponent:Qf});var Iw=at(oc(),1);var Pw=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 jp=at(oc(),1);var U6=at(B6(),1),{__extends:hr,__assign:KF,__rest:VF,__decorate:WF,__param:GF,__metadata:YF,__awaiter:F6,__generator:kl,__exportStar:JF,__createBinding:XF,__values:ys,__read:qr,__spread:ZF,__spreadArrays:QF,__spreadArray:On,__await:Cl,__asyncGenerator:$6,__asyncDelegator:e$,__asyncValues:q6,__makeTemplateObject:t$,__importStar:r$,__importDefault:n$,__classPrivateFieldGet:i$,__classPrivateFieldSet:o$,__classPrivateFieldIn:s$}=U6.default;function rt(r){return typeof r=="function"}o(rt,"isFunction");function $a(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($a,"createErrorClass");var Dl=$a(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
789
|
+
`)}signMessage(){let e;switch(this.type){case rl.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Ca,"SiweMessage");var RM=5*60,Vf;(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:RM)*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=Ca.fromCacao(i),p=i.s.s,x=a3(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})(Vf||(Vf={}));var Wf;(function(r){let e=o(function(t){try{return Promise.resolve(ns({value:t,codec:Di,hasher:zo}))}catch(n){return Promise.reject(n)}},"fromCacao");r.fromCacao=e})(Wf||(Wf={}));df();Wc();var u3=at(no(),1);df();function l3(){return It((0,u3.randomBytes)(16),"base64")}o(l3,"randomString");var d3="base64pad",h3="base64url";function p3(r){return It(r,d3)}o(p3,"encodeBase64");function m3(r){return It(r,h3)}o(m3,"encodeBase64Url");function b3(r){return Lt(r,d3)}o(b3,"decodeBase64");function nl(r){return JSON.parse(It(Lt(r,h3)))}o(nl,"base64urlToJSON");function g3(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(g3,"fromDagJWS");function v3(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(v3,"didWithTime");function y3(r){return r?Array.isArray(r)?r:[r]:[]}o(y3,"extractControllers");function LM(r){return"registry"in r&&"cache"in r}o(LM,"isResolver");var ds=class{constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new ya(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 ya(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=LM(e)?e:new of(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=l3(),s=yield this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:a}=yield this.verifyJWS(s),f=nl(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 Wf.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 S2(e),a=m3(i.bytes);Object.assign(t,{linkedBlock:p3(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 Wf.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=g3(e));let i=nl(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)Vf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(t.issuer&&t.issuer!==f){let I=v3(t.issuer,t.atTime),z=(T=(yield this.resolve(I)).didDocument)==null?void 0:T.controller,H=y3(z);if(((C=t.capability)==null?void 0:C.s)&&t.capability.p.aud===f&&H.includes(t.capability.p.iss))Vf.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)||[];dv(e,u);let m;try{m=nl(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 mv(t,this._resolver);return pv(e,a,n.protectedHeader,n.aad)})}createDagJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield M2(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 b3(i)})}decryptDagJWE(e){return Z(this,null,function*(){let t=yield this.decryptJWE(e);return A2(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 il(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(il,"toUint8Array");var E4=at(dx());var fl=at(mu(),1);var vx=at(px(),1);var QA="base64pad";function mx(r){return JSON.parse((0,vx.default)(r))}o(mx,"toStableObject");function eT(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(eT,"encodeDID");function bx(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(bx,"toGeneralJWS");var gx=o((i,s,a,...f)=>Z(void 0,[i,s,a,...f],function*(r,e,t,n={}){let u=`${e}#${e.split(":")[2]}`,m=av(t),p=mx(Object.assign(n,{kid:u,alg:"EdDSA"}));return lv(typeof r=="string"?r:mx(r),m,p)}),"sign"),tT={did_authenticate:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){let s=yield gx({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return bx(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 gx(t.payload,r,e,t.protected);return{jws:bx(a)}}),did_decryptJWE:(t,n)=>Z(void 0,[t,n],function*({secretKey:r},e){let i=gv((0,fl.convertSecretKeyToX25519)(r));try{let s=yield hv(e.jwe,i);return{cleartext:It(s,QA)}}catch(s){throw new Tr(-32e3,s.message)}})},Jf=class{constructor(e){let{secretKey:t,publicKey:n}=(0,fl.generateKeyPairFromSeed)(e),i=eT(n),s=P2(tT);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(Jf,"Ed25519Provider");Vn();Uc();var yx={tile:0,"caip10-link":1,model:2,MID:3};function rT(r){let e=yx[r];if(typeof e!="undefined")return e;throw new Error(`No stream type registered for name ${r}`)}o(rT,"codeByName");function nT(r){let e=Object.entries(yx).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(nT,"nameByCode");var Cr=class{};o(Cr,"StreamType");Cr.nameByCode=nT;Cr.codeByName=rT;var cp=at(Gf(),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=xx(a.value,e,t,n);else if(a.get!=null)a.get=xx(a.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o($r,"Memoize");var tp=new Map;function xx(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)tp.has(u)?tp.get(u).push(f):tp.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(xx,"getNewFunction");Vn();var rp=at(Gf(),1);jo();function ci(r){let e=rp.default.decode(r),t=rp.default.decode.bytes,n=r.slice(t);return[e,n,t]}o(ci,"readVarint");function iT(r){return r===0||r===1}o(iT,"isCidVersion");function np(r){let e=ip(r);if(e instanceof Error)throw e;return e}o(np,"readCid");function ip(r){let[e,t]=ci(r);if(!iT(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,ff(m)),p]}o(ip,"readCidNoThrow");Vn();Uc();uf();var op=at(Gf(),1);var Xf=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 oT(r){let e=ap(r);if(e instanceof Error)throw e;return e}o(oT,"fromBytes");function ap(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=ip(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(ap,"fromBytesNoThrow");function sT(r){let e=_x(r);if(e instanceof Error)throw e;return e}o(sT,"fromString");function _x(r){let e=r.replace("ceramic://","").replace("/ceramic/",""),t=e.includes("commit")?e.split("?")[0]:e,n=Fo.decode(t);return ap(n)}o(_x,"fromStringNoThrow");var wx=Symbol.for("@ceramicnetwork/streamid/StreamID"),Je=class{constructor(e,t){if(this._tag=wx,!(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===wx}static fromGenesis(e,t){return Z(this,null,function*(){let n=yield ns({value:t,codec:Di,hasher:zo});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=op.default.encode(206),t=op.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=oT;Je.fromBytesNoThrow=ap;Je.fromString=sT;Je.fromStringNoThrow=_x;Xf([$r(),hn("design:type",String),hn("design:paramtypes",[])],Je.prototype,"typeName",null);Xf([$r(),hn("design:type",Uint8Array),hn("design:paramtypes",[])],Je.prototype,"bytes",null);Xf([$r(),hn("design:type",Je),hn("design:paramtypes",[])],Je.prototype,"baseID",null);Xf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toString",null);Xf([$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)},fp=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},Li=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)},Ia,ps,Zf;function aT(r){let e=up(r);if(e instanceof Error)throw e;return e}o(aT,"fromBytes");function up(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=np(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]=np(f);return new ht(n,a,u)}}o(up,"fromBytesNoThrow");function fT(r){try{return typeof r=="string"?Pe.parse(r):Pe.asCID(r)}catch(e){return}}o(fT,"parseCID");function cT(r,e=null){if(!e)return null;let t=fT(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(cT,"parseCommit");function uT(r){let e=Sx(r);if(e instanceof Error)throw e;return e}o(uT,"fromString");function Sx(r){let e=r.replace("ceramic://","").replace("/ceramic/","");if(e.includes("commit")){let t=e.split("?")[1].split("=")[1],n=e.split("?")[0];return Mx(Je.fromString(n),t)}else return up(Fo.decode(e))}o(Sx,"fromStringNoThrow");var Ex=Symbol.for("@ceramicnetwork/streamid/CommitID");function Mx(r,e){return new ht(r.type,r.cid,e)}o(Mx,"make");var ht=class{constructor(e,t,n=null){if(this._tag=Ex,Ia.set(this,void 0),ps.set(this,void 0),Zf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");fp(this,Ia,typeof e=="string"?Cr.codeByName(e):e,"f"),fp(this,ps,typeof t=="string"?Pe.parse(t):t,"f"),fp(this,Zf,cT(Li(this,ps,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===Ex}get baseID(){return new Je(Li(this,Ia,"f"),Li(this,ps,"f"))}get type(){return Li(this,Ia,"f")}get typeName(){return Cr.nameByCode(Li(this,Ia,"f"))}get cid(){return Li(this,ps,"f")}get commit(){return Li(this,Zf,"f")||Li(this,ps,"f")}get bytes(){var i;let e=cp.default.encode(206),t=cp.default.encode(this.type),n=((i=Li(this,Zf,"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()}`}[(Ia=new WeakMap,ps=new WeakMap,Zf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(ht,"CommitID");ht.fromBytes=aT;ht.fromBytesNoThrow=up;ht.fromString=uT;ht.fromStringNoThrow=Sx;ht.make=Mx;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 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 Ax="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",cl="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var lp={};St(lp,{JsonPatchError:()=>Nt,_areEquals:()=>tc,applyOperation:()=>ms,applyPatch:()=>bl,applyReducer:()=>mT,deepClone:()=>hT,getValueByPointer:()=>pl,validate:()=>kx,validator:()=>ml});var lT=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)}}(),dT=Object.prototype.hasOwnProperty;function ll(r,e){return dT.call(r,e)}o(ll,"hasOwnProperty");function dl(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)ll(r,i)&&n.push(i);return n}o(dl,"_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 hl(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(hl,"isInteger");function ui(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(ui,"escapePathComponent");function Qf(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Qf,"unescapePathComponent");function ul(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(ul(r[e]))return!0}else if(typeof r=="object"){for(var n=dl(r),i=n.length,s=0;s<i;s++)if(ul(r[n[s]]))return!0}}return!1}o(ul,"hasUndefined");function Tx(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(`
|
790
|
+
`)}o(Tx,"patchErrorMessageFormatter");var ec=function(r){lT(e,r);function e(t,n,i,s,a){var f=this.constructor,u=r.call(this,Tx(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=Tx(t,{name:n,index:i,operation:s,tree:a}),u}return o(e,"PatchError"),e}(Error);var Nt=ec,hT=ir,Pa={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=pl(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=pl(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:tc(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},pT={add:function(r,e,t){return hl(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:Pa.move,copy:Pa.copy,test:Pa.test,_get:Pa._get};function pl(r,e){if(e=="")return r;var t={op:"_get",path:e};return ms(r,t),t.value}o(pl,"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):ml(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=pl(r,e.from),e.op==="move"&&(a.removed=r),a;if(e.op==="test"){if(a.test=tc(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,O=void 0,T=void 0;for(typeof t=="function"?T=t:T=ml;;){if(O=u[p],O&&O.indexOf("~")!=-1&&(O=Qf(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&&!hl(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);hl(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=pT[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=Pa[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 bl(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(bl,"applyPatch");function mT(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(mT,"applyReducer");function ml(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(Pa[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")&&ul(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=kx([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(ml,"validator");function kx(r,e,t){try{if(!Array.isArray(r))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)bl(ir(e),ir(r),t||!0);else{t=t||ml;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(kx,"validate");function tc(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(!tc(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],!tc(r[a],e[a]))return!1;return!0}return r!==r&&e!==e}o(tc,"_areEquals");var mp={};St(mp,{compare:()=>ET,generate:()=>dp,observe:()=>_T,unobserve:()=>wT});var hp=new WeakMap,bT=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),gT=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function vT(r){return hp.get(r)}o(vT,"getMirror");function yT(r,e){return r.observers.get(e)}o(yT,"getObserverFromMirror");function xT(r,e){r.observers.delete(e.callback)}o(xT,"removeObserverFromMirror");function wT(r,e){e.unobserve()}o(wT,"unobserve");function _T(r,e){var t=[],n,i=vT(r);if(!i)i=new bT(r),hp.set(r,i);else{var s=yT(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(){dp(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(){dp(n),clearTimeout(n.next),xT(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 gT(e,n)),n}o(_T,"observe");function dp(r,e){e===void 0&&(e=!1);var t=hp.get(r.object);pp(t.value,r.object,r.patches,"",e),r.patches.length&&bl(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(dp,"generate");function pp(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=dl(e),a=dl(r),f=!1,u=!1,m=a.length-1;m>=0;m--){var p=a[m],x=r[p];if(ll(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)?pp(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];!ll(r,p)&&e[p]!==void 0&&t.push({op:"add",path:n+"/"+ui(p),value:ir(e[p])})}}}o(pp,"_generate");function ET(r,e,t){t===void 0&&(t=!1);var n=[];return pp(r,e,n,"",t),n}o(ET,"compare");var Na=Object.assign({},lp,mp,{JsonPatchError:ec,deepClone:ir,escapePathComponent:ui,unescapePathComponent:Qf});var Ow=at(oc(),1);var Pw=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 jp=at(oc(),1);var U6=at(B6(),1),{__extends:hr,__assign:VF,__rest:WF,__decorate:GF,__param:YF,__metadata:JF,__awaiter:F6,__generator:kl,__exportStar:XF,__createBinding:ZF,__values:ys,__read:qr,__spread:QF,__spreadArrays:e$,__spreadArray:In,__await:Cl,__asyncGenerator:$6,__asyncDelegator:t$,__asyncValues:q6,__makeTemplateObject:r$,__importStar:n$,__importDefault:i$,__classPrivateFieldGet:o$,__classPrivateFieldSet:s$,__classPrivateFieldIn:a$}=U6.default;function rt(r){return typeof r=="function"}o(rt,"isFunction");function $a(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($a,"createErrorClass");var Dl=$a(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
791
791
|
`+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
792
|
-
`):"",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 p=u.value;p.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 m=this.initialTeardown;if(rt(m))try{m()}catch(C){s=C instanceof Dl?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{H6(T)}catch(C){s=s!=null?s:[],C instanceof Dl?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 Dl(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)H6(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 Op=vo.EMPTY;function Ol(r){return r instanceof vo||r&&"closed"in r&&rt(r.remove)&&rt(r.add)&&rt(r.unsubscribe)}o(Ol,"isSubscription");function H6(r){rt(r)?r():r.unsubscribe()}o(H6,"execFinalizer");var In={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var qa={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=qa.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=qa.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function Il(r){qa.setTimeout(function(){var e=In.onUnhandledError;if(e)e(r);else throw r})}o(Il,"reportUnhandledError");function Ip(){}o(Ip,"noop");var j6=function(){return Pp("C",void 0,void 0)}();function z6(r){return Pp("E",void 0,r)}o(z6,"errorNotification");function K6(r){return Pp("N",r,void 0)}o(K6,"nextNotification");function Pp(r,e,t){return{kind:r,value:e,error:t}}o(Pp,"createNotification");var ws=null;function Ha(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(Ha,"errorContext");function V6(r){In.useDeprecatedSynchronousErrorHandling&&ws&&(ws.errorThrown=!0,ws.error=r)}o(V6,"captureError");var sc=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ol(t)&&t.add(n)):n.destination=Qk,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Nl(t,n,i)},e.prototype.next=function(t){this.isStopped?Rp(K6(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Rp(z6(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Rp(j6,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 Jk=Function.prototype.bind;function Np(r,e){return Jk.call(r,e)}o(Np,"bind");var Xk=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){Pl(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Pl(n)}else Pl(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Pl(t)}},r}(),Nl=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&&Np(t.next,f),error:t.error&&Np(t.error,f),complete:t.complete&&Np(t.complete,f)}):a=t}return s.destination=new Xk(a),s}return o(e,"SafeSubscriber"),e}(sc);function Pl(r){In.useDeprecatedSynchronousErrorHandling?V6(r):Il(r)}o(Pl,"handleUnhandledError");function Zk(r){throw r}o(Zk,"defaultErrorHandler");function Rp(r,e){var t=In.onStoppedNotification;t&&qa.setTimeout(function(){return t(r,e)})}o(Rp,"handleStoppedNotification");var Qk={closed:!0,next:Ip,error:Zk,complete:Ip};var ja=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function za(r){return r}o(za,"identity");function W6(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(W6,"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=tC(e)?e:new Nl(e,t,n);return Ha(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=G6(t),new t(function(i,s){var a=new Nl({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[ja]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W6(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=G6(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 G6(r){var e;return(e=r!=null?r:In.Promise)!==null&&e!==void 0?e:Promise}o(G6,"getPromiseCtor");function eC(r){return r&&rt(r.next)&&rt(r.error)&&rt(r.complete)}o(eC,"isObserver");function tC(r){return r&&r instanceof sc||eC(r)&&Ol(r)}o(tC,"isSubscriber");function rC(r){return rt(r==null?void 0:r.lift)}o(rC,"hasLift");function Yt(r){return function(e){if(rC(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 nC(r,e,t,n,i)}o(Jt,"createOperatorSubscriber");var nC=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(p){try{n(p)}catch(m){t.error(m)}}:r.prototype._next,u._error=s?function(p){try{s(p)}catch(m){t.error(m)}finally{this.unsubscribe()}}:r.prototype._error,u._complete=i?function(){try{i()}catch(p){t.error(p)}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}(sc);var Y6=$a(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Lp=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 J6(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Y6},e.prototype.next=function(t){var n=this;Ha(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(p){i={error:p}}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;Ha(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;Ha(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?Op:(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 J6(t,n)},e}(_t);var J6=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:Op},e}(Lp);var Bp=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}(Lp);var Up={now:function(){return(Up.delegate||Date).now()},delegate:void 0};var X6=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 ac={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=ac.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=ac.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(r)},delegate:void 0};var Z6=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),ac.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;ac.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}(X6);var Fp=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=Up.now,r}();var Q6=function(r){hr(e,r);function e(t,n){n===void 0&&(n=Fp.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}(Fp);var iC=new Q6(Z6),ew=iC;var Rl=new _t(function(r){return r.complete()});function Ll(r){return r&&rt(r.schedule)}o(Ll,"isScheduler");function tw(r){return r[r.length-1]}o(tw,"last");function rw(r){return Ll(tw(r))?r.pop():void 0}o(rw,"popScheduler");function nw(r,e){return typeof tw(r)=="number"?r.pop():e}o(nw,"popNumber");var Ka=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function Bl(r){return rt(r==null?void 0:r.then)}o(Bl,"isPromise");function Ul(r){return rt(r[ja])}o(Ul,"isInteropObservable");function Fl(r){return Symbol.asyncIterator&&rt(r==null?void 0:r[Symbol.asyncIterator])}o(Fl,"isAsyncIterable");function $l(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($l,"createInvalidObservableTypeError");function oC(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(oC,"getSymbolIterator");var ql=oC();function Hl(r){return rt(r==null?void 0:r[ql])}o(Hl,"isIterable");function jl(r){return $6(this,arguments,o(function(){var t,n,i,s;return kl(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,Cl(t.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,Cl(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Cl(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(jl,"readableStreamLikeToAsyncGenerator");function zl(r){return rt(r==null?void 0:r.getReader)}o(zl,"isReadableStreamLike");function pr(r){if(r instanceof _t)return r;if(r!=null){if(Ul(r))return sC(r);if(Ka(r))return aC(r);if(Bl(r))return fC(r);if(Fl(r))return iw(r);if(Hl(r))return cC(r);if(zl(r))return uC(r)}throw $l(r)}o(pr,"innerFrom");function sC(r){return new _t(function(e){var t=r[ja]();if(rt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(sC,"fromInteropObservable");function aC(r){return new _t(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(aC,"fromArrayLike");function fC(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,Il)})}o(fC,"fromPromise");function cC(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(cC,"fromIterable");function iw(r){return new _t(function(e){lC(r,e).catch(function(t){return e.error(t)})})}o(iw,"fromAsyncIterable");function uC(r){return iw(jl(r))}o(uC,"fromReadableStreamLike");function lC(r,e){var t,n,i,s;return F6(this,void 0,void 0,function(){var a,f;return kl(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=q6(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(lC,"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 Kl(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(Kl,"observeOn");function Vl(r,e){return e===void 0&&(e=0),Yt(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(Vl,"subscribeOn");function ow(r,e){return pr(r).pipe(Vl(e),Kl(e))}o(ow,"scheduleObservable");function sw(r,e){return pr(r).pipe(Vl(e),Kl(e))}o(sw,"schedulePromise");function aw(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(aw,"scheduleArray");function fw(r,e){return new _t(function(t){var n;return pn(t,e,function(){n=r[ql](),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(fw,"scheduleIterable");function Wl(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(Wl,"scheduleAsyncIterable");function cw(r,e){return Wl(jl(r),e)}o(cw,"scheduleReadableStreamLike");function uw(r,e){if(r!=null){if(Ul(r))return ow(r,e);if(Ka(r))return aw(r,e);if(Bl(r))return sw(r,e);if(Fl(r))return Wl(r,e);if(Hl(r))return fw(r,e);if(zl(r))return cw(r,e)}throw $l(r)}o(uw,"scheduled");function lw(r,e){return e?uw(r,e):pr(r)}o(lw,"from");var Gl=$a(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function dw(r){return r instanceof Date&&!isNaN(r)}o(dw,"isValidDate");function Yl(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){n.next(r.call(e,s,i++))}))})}o(Yl,"map");var dC=Array.isArray;function hC(r,e){return dC(e)?r.apply(void 0,On([],qr(e))):r(e)}o(hC,"callOrApply");function hw(r){return Yl(function(e){return hC(r,e)})}o(hw,"mapOneOrManyArgs");function pw(r,e,t,n,i,s,a,f){var u=[],p=0,m=0,x=!1,k=o(function(){x&&!u.length&&!p&&e.complete()},"checkComplete"),I=o(function(C){return p<n?T(C):u.push(C)},"outerNext"),T=o(function(C){s&&e.next(C),p++;var $=!1;pr(t(C,m++)).subscribe(Jt(e,function(O){i==null||i(O),s?I(O):e.next(O)},function(){$=!0},void 0,function(){if($)try{p--;for(var O=o(function(){var U=u.shift();a?pn(e,a,function(){return T(U)}):T(U)},"_loop_1");u.length&&p<n;)O();k()}catch(U){e.error(U)}}))},"doInnerSub");return r.subscribe(Jt(e,I,function(){x=!0,k()})),function(){f==null||f()}}o(pw,"mergeInternals");function fc(r,e,t){return t===void 0&&(t=1/0),rt(e)?fc(function(n,i){return Yl(function(s,a){return e(n,s,i,a)})(pr(r(n,i)))},t):(typeof e=="number"&&(t=e),Yt(function(n,i){return pw(n,i,r,t)}))}o(fc,"mergeMap");function mw(r){return r===void 0&&(r=1/0),fc(za,r)}o(mw,"mergeAll");var pC=["addListener","removeListener"],mC=["addEventListener","removeEventListener"],bC=["on","off"];function cc(r,e,t,n){if(rt(t)&&(n=t,t=void 0),n)return cc(r,e,t).pipe(hw(n));var i=qr(yC(r)?mC.map(function(f){return function(u){return r[f](e,u,t)}}):gC(r)?pC.map(bw(r,e)):vC(r)?bC.map(bw(r,e)):[],2),s=i[0],a=i[1];if(!s&&Ka(r))return fc(function(f){return cc(f,e,t)})(pr(r));if(!s)throw new TypeError("Invalid event target");return new _t(function(f){var u=o(function(){for(var p=[],m=0;m<arguments.length;m++)p[m]=arguments[m];return f.next(1<p.length?p:p[0])},"handler");return s(u),function(){return a(u)}})}o(cc,"fromEvent");function bw(r,e){return function(t){return function(n){return r[t](e,n)}}}o(bw,"toCommonHandlerRegistry");function gC(r){return rt(r.addListener)&&rt(r.removeListener)}o(gC,"isNodeStyleEventEmitter");function vC(r){return rt(r.on)&&rt(r.off)}o(vC,"isJQueryStyleEventEmitter");function yC(r){return rt(r.addEventListener)&&rt(r.removeEventListener)}o(yC,"isEventTarget");function uc(r,e,t){r===void 0&&(r=0),t===void 0&&(t=ew);var n=-1;return e!=null&&(Ll(e)?t=e:n=e),new _t(function(i){var s=dw(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(uc,"timer");function $p(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=rw(r),n=nw(r,1/0),i=r;return i.length?i.length===1?pr(i[0]):mw(n)(lw(i,t)):Rl}o($p,"merge");function gw(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(gw,"filter");function vw(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(vw,"defaultIfEmpty");function yw(r){return r<=0?function(){return Rl}:Yt(function(e,t){var n=0;e.subscribe(Jt(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(yw,"take");function xw(r){return r===void 0&&(r=xC),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(xw,"throwIfEmpty");function xC(){return new Gl}o(xC,"defaultErrorFactory");function qp(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?gw(function(i,s){return r(i,s,n)}):za,yw(1),t?vw(e):xw(function(){return new Gl}))}}o(qp,"first");var wC={leading:!0,trailing:!1};function Hp(r,e){return e===void 0&&(e=wC),Yt(function(t,n){var i=e.leading,s=e.trailing,a=!1,f=null,u=null,p=!1,m=o(function(){u==null||u.unsubscribe(),u=null,s&&(I(),p&&n.complete())},"endThrottling"),x=o(function(){u=null,p&&n.complete()},"cleanupThrottling"),k=o(function(T){return u=pr(r(T)).subscribe(Jt(n,m,x))},"startThrottle"),I=o(function(){if(a){a=!1;var T=f;f=null,n.next(T),!p&&k(T)}},"send");t.subscribe(Jt(n,function(T){a=!0,f=T,!(u&&!u.closed)&&(i?I():k(T))},function(){p=!0,!(s&&a&&u&&!u.closed)&&n.complete()}))})}o(Hp,"throttle");var ww;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(ww||(ww={}));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 zp;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(zp||(zp={}));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,jp.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===zp.ANCHOR).map(({cid:e})=>ht.make(this.id,e))}get state(){return(0,jp.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 Tw=at(Sw(),1);function Aw(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):($p(...r.map(t=>cc(t,"abort"))).pipe(qp()).subscribe(()=>{e.abort()}),e.signal)}o(Aw,"mergeAbortSignals");var lc=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=uc(e).subscribe(()=>{t.abort()})}clear(){var e;(e=this._subscription)==null||e.unsubscribe()}};o(lc,"TimedAbortSignal");function Mw(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(Mw,"abortable");var _C=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||_C,i=new lc(n),s=e.signal?Aw([e.signal,i.signal]):i.signal,a=yield Mw(s,f=>(0,Tw.default)(String(r),Me(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 dc=at(oc(),1);Vn();function $i(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($i,"toCID");var kw=0,yt=class{static streamIdFromState(e){return new Je(e.type,e.log[0].cid)}static serializeCommit(e){var n;let t=(0,dc.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,dc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=$i(t.jws.link),t.linkedBlock=Lt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Lt(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(t)&&(t.link=$i(t.link)),yt.isAnchorCommit(t)&&(t.proof=$i(t.proof)),t.id&&(t.id=$i(t.id)),t.prev&&(t.prev=$i(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,dc.default)(e);return t.log=t.log.map(f=>Me(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!=kw&&(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,dc.default)(e);t.doctype&&(t.type=Cr.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(u=>Me(ie({},u),{cid:$i(u.cid)})),t.anchorProof&&(t.anchorProof.txHash=$i(t.anchorProof.txHash),t.anchorProof.root=$i(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!=kw&&(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 Cw(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(Cw,"normalizeAccountId");var hc=class extends Bp{next(e){let t=this.value;yt.statesEqual(t,e)||super.next(e)}};o(hc,"StreamStateSubject");var EC=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,Kp={anchor:!0,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},SC={sync:Ct.PREFER_CACHE},Dw={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Vp(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,Pw.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(Vp,"headerFromMetadata");function Ow(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(Ow,"_ensureAuthenticated");function Wp(){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(Wp,"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,Iw.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({},Kp),i),!(n!=null&&n.deterministic)&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let u=i.asDID?{did:i.asDID}:e,p=yield Hr.makeGenesis(u,t,n);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,p,i)})}static createFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){var f;n=ie(ie({},Kp),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({},Kp),n),t=Me(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({},SC),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({},Dw),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({},Dw),t);let s={header:Vp(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=Wp,this.patch=Wp,this.sync=Wp,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=Vp(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=Na.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 Ow(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=Vp(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 Pf(f),f}let s={data:t,header:i};return Hr._signDagJWS(e,s)})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield Ow(e),e.did.createDagJWS(t)})}},"TileDocument");jr.STREAM_TYPE_NAME="tile";jr.STREAM_TYPE_ID=0;jr=Hr=EC([yo()],jr);var qw=at(Bw(),1);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 $w(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o($w,"_classExtractFieldDescriptor");function Jp(r,e){var t=$w(r,e,"get");return NC(r,t)}o(Jp,"_classPrivateFieldGet");function Uw(r,e,t){PC(r,e),e.set(r,t)}o(Uw,"_classPrivateFieldInit");function Fw(r,e,t){var n=$w(r,e,"set");return RC(r,n,t),t}o(Fw,"_classPrivateFieldSet");function LC(r){return typeof r=="string"||ht.isInstance(r)||Je.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(LC,"keyToQuery");function Xp(r){return typeof r=="string"?yr.from(r).toString():ht.isInstance(r)||Je.isInstance(r)?r.toString():r.streamId.toString()}o(Xp,"keyToString");function Qp(r){return Z(this,null,function*(){let e=yield jr.makeGenesis({},null,Me(ie({},r),{deterministic:!0})),t=yield Je.fromGenesis("tile",e);return{genesis:e,streamId:t}})}o(Qp,"getDeterministicQuery");var BC=o(()=>Promise.resolve([]),"tempBatchLoadFn"),Xl=new WeakMap,Zp=new WeakMap,mn=class extends qw.default{cache(e){if(!Jp(this,Zp))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(Jp(this,Xl),e,t,n);return this.cache(i),i})}deterministic(e,t){return Z(this,null,function*(){let n=yield Qp(e);try{return yield vd(mn.prototype,this,"load").call(this,n)}catch(i){let s=yield jr.createFromGenesis(Jp(this,Xl),n.genesis,t);return this.cache(s),s}})}load(e){return Z(this,null,function*(){return yield vd(mn.prototype,this,"load").call(this,e)})}update(e,t,n,i){return Z(this,null,function*(){let s=Xp(e);this.clear(s);let a=yield this.load({streamId:s});return yield a.update(t,n,i),a})}constructor(e){super(BC,{cache:!0,cacheKeyFn:Xp,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Uw(this,Xl,{writable:!0,value:void 0}),Uw(this,Zp,{writable:!0,value:void 0}),this._batchLoadFn=t=>Z(this,null,function*(){e.cache||this.clearAll();let n=yield e.ceramic.multiQuery(t.map(LC),e.multiqueryTimeout);return t.map(i=>{let s=Xp(i),a=n[s];return a||new Error(`Failed to load stream: ${s}`)})}),Fw(this,Xl,e.ceramic),Fw(this,Zp,!!e.cache)}};o(mn,"TileLoader");function UC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(UC,"_checkPrivateRedeclaration");function FC(r,e){return e.get?e.get.call(r):e.value}o(FC,"_classApplyDescriptorGet");function $C(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($C,"_classApplyDescriptorSet");function jw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(jw,"_classExtractFieldDescriptor");function Es(r,e){var t=jw(r,e,"get");return FC(r,t)}o(Es,"_classPrivateFieldGet");function Hw(r,e,t){UC(r,e),e.set(r,t)}o(Hw,"_classPrivateFieldInit");function em(r,e,t){var n=jw(r,e,"set");return $C(r,n,t),t}o(em,"_classPrivateFieldSet");var Wa=new WeakMap,Ga=new WeakMap,Ya=class{get aliases(){return Es(this,Wa)}get loader(){return Es(this,Ga)}getDefinitionID(e){var t;return(t=Es(this,Wa).definitions[e])!=null?t:null}getSchemaURL(e){var t;return(t=Es(this,Wa).schemas[e])!=null?t:null}getTileID(e){var t;return(t=Es(this,Wa).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,Ga).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 m=n,{controller:f}=m,u=Im(m,["controller"]),p={schema:a};return f!=null&&(p.controllers=[f]),yield Es(this,Ga).create(t,p,u)})}constructor(e){if(Hw(this,Wa,{writable:!0,value:void 0}),Hw(this,Ga,{writable:!0,value:void 0}),em(this,Wa,e.aliases),e.loader!=null)em(this,Ga,e.loader);else{if(e.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");em(this,Ga,new mn({ceramic:e.ceramic,cache:e.cache}))}}};o(Ya,"DataModel");function qC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(qC,"_checkPrivateRedeclaration");function HC(r,e){return e.get?e.get.call(r):e.value}o(HC,"_classApplyDescriptorGet");function jC(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(jC,"_classApplyDescriptorSet");function zw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(zw,"_classExtractFieldDescriptor");function li(r,e){var t=zw(r,e,"get");return HC(r,t)}o(li,"_classPrivateFieldGet");function Zl(r,e,t){qC(r,e),e.set(r,t)}o(Zl,"_classPrivateFieldInit");function Ql(r,e,t){var n=zw(r,e,"set");return jC(r,n,t),t}o(Ql,"_classPrivateFieldSet");var ed=new WeakMap,Ss=new WeakMap,tm=new WeakMap,td=new WeakMap,pc=class{_createValuePromise(){Ql(this,tm,new Promise((e,t)=>{Ql(this,td,{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,ed).call(this):yield li(this,tm)})}_start(){return Z(this,null,function*(){try{let e=yield li(this,ed).call(this);this._next(e)}catch(e){li(this,Ss).forEach(t=>{t.reject(e)}),Ql(this,Ss,[]),li(this,td).reject(e),this._createValuePromise()}})}_next(e){let t=li(this,Ss).shift();t==null?this._end(e):t.run(e)}_end(e){li(this,td).resolve(e),this._createValuePromise()}constructor(e){Zl(this,ed,{writable:!0,value:void 0}),Zl(this,Ss,{writable:!0,value:[]}),Zl(this,tm,{writable:!0,value:void 0}),Zl(this,td,{writable:!0,value:void 0}),Ql(this,ed,e),this._createValuePromise()}};o(pc,"TileProxy");var zC=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function KC(r){return zC.test(r)}o(KC,"isDIDstring");function VC(r){if(!KC(r))throw new Error(`Invalid DID: ${r}`)}o(VC,"assertDIDstring");function rm(r){return VC(r),{controllers:[r],family:"IDX"}}o(rm,"getIDXMetadata");function WC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(WC,"_checkPrivateRedeclaration");function GC(r,e){return e.get?e.get.call(r):e.value}o(GC,"_classApplyDescriptorGet");function YC(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(YC,"_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 Ut(r,e){var t=Kw(r,e,"get");return GC(r,t)}o(Ut,"_classPrivateFieldGet");function mc(r,e,t){WC(r,e),e.set(r,t)}o(mc,"_classPrivateFieldInit");function rd(r,e,t){var n=Kw(r,e,"set");return YC(r,n,t),t}o(rd,"_classPrivateFieldSet");var qi=new WeakMap,nd=new WeakMap,nm=new WeakMap,di=new WeakMap,id=new WeakMap,bc=class{get authenticated(){return Ut(this,qi).did!=null}get ceramic(){return Ut(this,qi)}get id(){if(Ut(this,nd)!=null)return Ut(this,nd);if(Ut(this,qi).did==null)throw new Error("Ceramic instance is not authenticated");return Ut(this,qi).did.hasParent?Ut(this,qi).did.parent:Ut(this,qi).did.id}get loader(){return Ut(this,di)}get model(){return Ut(this,id)}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,p;let n=this.getDefinitionID(e),i=yield Promise.all(t.map(m=>Z(this,null,function*(){let{genesis:x,streamId:k}=yield Qp(rm(m));return{genesis:x,streamId:k.toString(),paths:[n]}}))),s=yield Ut(this,qi).multiQuery(i),a=[];for(let m of i){let x=(u=(f=s[m.streamId])==null?void 0:f.content)==null?void 0:u[n],k=x?s[Je.fromString(x).toString()]:null;a.push((p=k==null?void 0:k.content)!=null?p:null)}return a})}set(i,s){return Z(this,arguments,function*(e,t,n={}){var p;let a=this.getDefinitionID(e),[f,u]=yield this._setRecordOnly(a,t,n);return f&&(yield this._setReference((p=n.controller)!=null?p: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(m=>Z(this,[m],function*([u,p]){let x=this.getDefinitionID(u),[k,I]=yield this._setRecordOnly(x,p,t);return[k,x,I]})),a=(yield Promise.all(i)).reduce((u,[p,m,x])=>(p&&(u[m]=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,p;let i=(u=yield this.getIndex())!=null?u:{},s=Object.entries(e).map(([m,x])=>[this.getDefinitionID(m),x]).filter(m=>i[m[0]]==null).map(k=>Z(this,[k],function*([m,x]){let I=yield this.getDefinition(m),T=yield this._createRecord(I,x,t);return{[m]:T.toUrl()}})),f=(yield Promise.all(s)).reduce((m,x)=>Object.assign(m,x),{});return yield this._setReferences((p=t.controller)!=null?p: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(rm(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!==cl)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:cl});else if(t.metadata.schema!==cl)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getIndexProxy(e){let t=Ut(this,nm)[e];return t==null&&(t=new pc(()=>Z(this,null,function*(){return yield this._getOwnIDXDoc(e)})),Ut(this,nm)[e]=t),t}getDefinitionID(e){var t;return(t=Ut(this,id).getDefinitionID(e))!=null?t:e}getDefinition(e){return Z(this,null,function*(){let t=yield Ut(this,di).load(e);if(t.metadata.schema!==Mx)throw new Error("Invalid document: schema is not Definition");return Me(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=>Me(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){mc(this,qi,{writable:!0,value:void 0}),mc(this,nd,{writable:!0,value:void 0}),mc(this,nm,{writable:!0,value:{}}),mc(this,di,{writable:!0,value:void 0}),mc(this,id,{writable:!0,value:void 0});let{cache:t,ceramic:n,id:i,loader:s,model:a}=e;rd(this,qi,n),rd(this,nd,i),rd(this,di,s!=null?s:new mn({ceramic:n,cache:t})),rd(this,id,a instanceof Ya?a:new Ya({loader:Ut(this,di),aliases:a}))}};o(bc,"DIDDataStore");function im(r){return typeof r=="string"?Je.fromString(r):r}o(im,"typeStreamID");var mr=class extends _t{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=uc(0,n).pipe(Hp(()=>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 hc(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 xr(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 xr(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 xr(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 xr(n);return i.map(s=>({cid:s.cid,value:yt.deserializeCommit(s.value)}))})}complete(){this.state$.complete()}};o(mr,"Document");var Ww=at(oc(),1),JC=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},As,om=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),Vw={anchor:!1,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},sm={anchor:!0,publish:!0,throwOnInvalidCommit:!0},XC={sync:Ct.PREFER_CACHE},Ms=As=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,Ww.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({},Vw),n);let a=Cw(t),f=As.makeGenesis(a);return As.fromGenesis(e,f,n)})}static fromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){return n=ie(ie({},Vw),n),e.createStreamFromGenesis(As.STREAM_TYPE_ID,t,n)})}setDid(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},sm),n);let a=typeof e=="string"?e.trim():e.id,f=xd(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({},sm),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({},sm),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({},XC),n);let a=yr.from(t);if(a.type!=As.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${As.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=om,this.setDid=om,this.sync=om,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Ms.STREAM_TYPE_NAME="caip10-link";Ms.STREAM_TYPE_ID=1;Ms=As=JC([yo()],Ms);var g4=at(no(),1);Vn();jo();var v4=at(h4(),1),xD=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,wD={sync:Ct.PREFER_CACHE};function p4(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(p4,"_ensureAuthenticated");function m4(){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(m4,"throwReadOnlyError");var b4;(function(r){r.LIST="list",r.SINGLE="single"})(b4||(b4={}));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({},wD),n);let a=yr.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:Na.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 p4(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,g4.randomBytes)(12),model:br.MODEL.bytes};return{data:t,header:i}})}makeReadOnly(){this.replacePlaceholder=m4,this.sync=m4,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static _signDagJWS(e,t){return Z(this,null,function*(){return yield p4(e),e.did.createDagJWS(t)})}},"Model");xo.STREAM_TYPE_NAME="model";xo.STREAM_TYPE_ID=2;xo.MODEL=function(){let r=Pf("model-v1"),e=v4.default.encode(r,"identity"),t=Kn(va,e),n=Pe.createV1(va,t);return new Je(br.STREAM_TYPE_ID,n)}();xo=br=xD([yo()],xo);var w4=at(no(),1);var _D=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},Hi,ED={anchor:!0,publish:!0,pin:!0,sync:Ct.NEVER_SYNC,syncTimeoutSeconds:0},SD={sync:Ct.PREFER_CACHE},y4={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function x4(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(x4,"_ensureAuthenticated");function cm(){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(cm,"throwReadOnlyError");var Ts=Hi=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({},ED),i);let u=i.asDID?{did:i.asDID}:e,p=yield Hi._makeGenesis(u,t,n);return e.createStreamFromGenesis(Hi.STREAM_TYPE_ID,p,i)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},SD),n);let a=yr.from(t);if(a.type!=Hi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Hi.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({},y4),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({},y4),t);let i={data:e,prev:this.tip,id:this.id.cid},s=yield Hi._signDagJWS(this.api,i),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}makeReadOnly(){this.replace=cm,this.patch=cm,this.sync=cm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return Hi._signDagJWS(e,n)}_makeRawCommit(e){return{data:Na.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 Hi._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 x4(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,w4.randomBytes)(12),model:n.model.bytes};return{data:t,header:i}})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield x4(e),e.did.createDagJWS(t)})}},"ModelInstanceDocument");Ts.STREAM_TYPE_NAME="MID";Ts.STREAM_TYPE_ID=3;Ts=Hi=_D([yo()],Ts);var vc=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(vc,"RemotePinApi");var yc=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(yc,"RemoteIndexApi");var AD="/api/v0/",MD="http://localhost:7007",TD={syncInterval:5e3},kD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},CD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},_4={sync:Ct.PREFER_CACHE},xc=class{constructor(e=MD,t={}){this._config=ie(ie({},TD),t),this._apiUrl=new URL(AD,e),this._streamCache=new Map,this.context={api:this},this.pin=new vc(this._apiUrl),this.index=new yc(this._apiUrl),this._streamConstructors={[Ms.STREAM_TYPE_ID]:Ms,[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({},CD),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({},_4),t);let i=yr.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=>Me(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,p]=f,m=yt.deserializeState(p),x=new mr(m,this._apiUrl,this._config.syncInterval);return a[u]=this.buildStreamFromDocument(x),a},{})})}loadStreamCommits(e){let t=im(e);return mr.loadStreamCommits(t,this._apiUrl)}applyCommit(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},kD),n);let a=im(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({},_4),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 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 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(xc,"CeramicClient");var DD=o((r,e)=>Z(void 0,null,function*(){let t=new xc(e),n=ie({},E4.default.getResolver()),i=new ds({resolver:n});t.did=i;let s=r.pluginMethods.getKey(),a=new Jf(il(s));return t.did.setProvider(a),yield t.did.authenticate(),t}),"getCeramicClientFromWalletSuite"),sd=o((s,a)=>Z(void 0,[s,a],function*(r,{modelData:e,credentialAlias:t,ceramicEndpoint:n,defaultContentFamily:i}){let f=yield DD(r,n),u=new mn({ceramic:f}),p=new bc({ceramic:f,model:e}),m=o((...C)=>Z(void 0,[...C],function*(T=t){return(yield p.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 m(C);return $.credentials.push(ie({storageType:"ceramic"},T)),p.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 jr.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 m(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 m(),O=(U=$==null?void 0:$.credentials)==null?void 0:U.find(z=>(z==null?void 0:z.title)===C);return O&&(yield I(O.id))}),getVerifiableCredentialsFromIndex:()=>Z(void 0,null,function*(){var $,O;let T=yield m(),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 OD=o(r=>/^[0-9a-f]+$/i.test(r),"isHex"),S4=o(r=>Z(void 0,null,function*(){if(r.length===0)throw new Error("Please don't use an empty string for a key!");if(!OD(r))throw new Error("Key must be a hexadecimal string!");if(r.length>64)throw new Error("Key must be less than 64 characters");let e=JSON.parse(Rm(il(r.padStart(64,"0")))),t=Lm("key",JSON.stringify(e));return{pluginMethods:{getSubjectDid:()=>t,getSubjectKeypair:()=>e,getKey:()=>r.padStart(64,"0")}}}),"getDidKeyPlugin");var A4=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 M4=o((r,e)=>Z(void 0,null,function*(){let t=r.pluginMethods.getSubjectKeypair();if(!t)throw new Error("Cannot issue credential: Could not get subject keypair");let n=JSON.stringify(t),i=JSON.stringify({verificationMethod:yield Ic("key",n),proofPurpose:"assertionMethod"});return JSON.parse(yield Bm(JSON.stringify(e),i,n))}),"issueCredential");var T4=o(r=>Z(void 0,null,function*(){return JSON.parse(yield Um(JSON.stringify(r),"{}"))}),"verifyCredential");var k4=o((r,e)=>Z(void 0,null,function*(){let t=r.pluginMethods.getSubjectDid();if(!t)throw new Error("Cannot create presentation: No holder key found");let n=t,i=r.pluginMethods.getSubjectKeypair();if(!i)throw new Error("Cannot issue credential: Could not get subject keypair");let s=JSON.stringify(i),a=JSON.stringify({verificationMethod:yield Ic("key",s),proofPurpose:"assertionMethod"}),f=JSON.stringify({"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],holder:n,verifiableCredential:e});return JSON.parse(yield Fm(f,a,s))}),"issuePresentation");var C4=o(r=>Z(void 0,null,function*(){return JSON.parse(yield $m(JSON.stringify(r),"{}"))}),"verifyPresentation");var um=o(r=>Z(void 0,null,function*(){return{pluginMethods:Me(ie({},r.pluginMethods),{issueCredential:M4,verifyCredential:(e,t)=>Z(void 0,null,function*(){return T4(t)}),issuePresentation:k4,verifyPresentation:(e,t)=>Z(void 0,null,function*(){return C4(t)}),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>{let n=e.pluginMethods.getSubjectDid();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 Ae=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 Ae.undefined;case"string":return Ae.string;case"number":return isNaN(r)?Ae.nan:Ae.number;case"boolean":return Ae.boolean;case"function":return Ae.function;case"bigint":return Ae.bigint;case"object":return Array.isArray(r)?Ae.array:r===null?Ae.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Ae.promise:typeof Map!="undefined"&&r instanceof Map?Ae.map:typeof Set!="undefined"&&r instanceof Set?Ae.set:typeof Date!="undefined"&&r instanceof Date?Ae.date:Ae.object;default:return Ae.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"]),ID=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 p=a.path[u];u===a.path.length-1?(f[p]=f[p]||{_errors:[]},f[p]._errors.push(t(a))):f[p]=f[p]||{_errors:[]},f=f[p],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 wc=o((r,e)=>{let t;switch(r.code){case Se.invalid_type:r.received===Ae.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"),_c=wc,PD=o(r=>{_c=r},"setErrorMap"),ad=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],a=Me(ie({},i),{path:s}),f="",u=n.filter(p=>!!p).slice().reverse();for(let p of u)f=p(a,{data:e,defaultError:f}).message;return Me(ie({},i),{path:s,message:i.message||f})},"makeIssue"),ND=[];function Re(r,e){let t=ad({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_c,wc].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"}),RD=o(r=>({status:"dirty",value:r}),"DIRTY"),wr=o(r=>({status:"valid",value:r}),"OK"),lm=o(r=>r.status==="aborted","isAborted"),dm=o(r=>r.status==="dirty","isDirty"),fd=o(r=>r.status==="valid","isValid"),hm=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 D4=o((r,e)=>{if(fd(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(hm(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 D4(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 hm(i)?i:Promise.resolve(i);return D4(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 Qa({innerType:this,defaultValue:t,typeName:et.ZodDefault})}describe(e){let t=this.constructor;return new t(Me(ie({},this._def),{description:e}))}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(ot,"ZodType");var LD=/^c[^\s-]{8,}$/i,BD=/^([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,UD=/^(([^<>()[\]\.,;:\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(Me(ie({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}_parse(e){if(this._getType(e)!==Ae.string){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Ae.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")UD.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")BD.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")LD.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(Me(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 FD(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(FD,"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)!==Ae.number){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Ae.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"?FD(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(Me(ie({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:xt.toString(i)}]}))}_addCheck(e){return new hi(Me(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)!==Ae.bigint){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.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)!==Ae.boolean){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.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)!==Ae.date){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.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)!==Ae.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.undefined,received:n.parsedType}),nt}return wr(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)!==Ae.null){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.null,received:n.parsedType}),nt}return wr(e.data)}};o(Is,"ZodNull");Is.create=r=>new Is(ie({typeName:et.ZodNull},st(r)));var ji=class extends ot{constructor(){super(...arguments),this._any=!0}_parse(e){return wr(e.data)}};o(ji,"ZodAny");ji.create=r=>new ji(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:Ae.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)!==Ae.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.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!==Ae.array)return Re(t,{code:Se.invalid_type,expected:Ae.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=>or.mergeArray(n,a));let s=t.data.map((a,f)=>i.type._parseSync(new zr(t,a,t.path,f)));return or.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Kr(Me(ie({},this._def),{minLength:{value:e,message:xt.toString(t)}}))}max(e,t){return new Kr(Me(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 cd;(function(r){r.mergeShapes=(e,t)=>ie(ie({},e),t)})(cd||(cd={}));var O4=o(r=>e=>new Et(Me(ie({},r),{shape:()=>ie(ie({},r.shape()),e)})),"AugmentFactory");function Za(r){if(r instanceof Et){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Gr.create(Za(n))}return new Et(Me(ie({},r._def),{shape:()=>e}))}else return r instanceof Kr?Kr.create(Za(r.element)):r instanceof Gr?Gr.create(Za(r.unwrap())):r instanceof bi?bi.create(Za(r.unwrap())):r instanceof Vr?Vr.create(r.items.map(e=>Za(e))):r}o(Za,"deepPartialify");var Et=class extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=O4(this._def),this.extend=O4(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)!==Ae.object){let p=this._getOrReturnCtx(e);return Re(p,{code:Se.invalid_type,expected:Ae.object,received:p.parsedType}),nt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),f=[];for(let p in i.data)a.includes(p)||f.push(p);let u=[];for(let p of a){let m=s[p],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})}if(this._def.catchall instanceof Ln){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of f)u.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(p==="strict")f.length>0&&(Re(i,{code:Se.unrecognized_keys,keys:f}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of f){let 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})}}return i.common.async?Promise.resolve().then(()=>Z(this,null,function*(){let p=[];for(let m of u){let x=yield m.key;p.push({key:x,value:yield m.value,alwaysSet:m.alwaysSet})}return p})).then(p=>or.mergeObjectSync(n,p)):or.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return xt.errToObj,new Et(ie(Me(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(Me(ie({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Et(Me(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:()=>cd.mergeShapes(this._def.shape(),e._def.shape()),typeName:et.ZodObject})}catchall(e){return new Et(Me(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(Me(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(Me(ie({},this._def),{shape:()=>t}))}deepPartial(){return Za(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(Me(ie({},this._def),{shape:()=>t}));for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new Et(Me(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(Me(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=Me(ie({},t),{common:Me(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 p=Me(ie({},t),{common:Me(ie({},t.common),{issues:[]}),parent:null}),m=u._parseSync({data:t.data,path:t.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:p}),p.common.issues.length&&a.push(p.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!==Ae.object)return Re(t,{code:Se.invalid_type,expected:Ae.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 pm(r,e){let t=wo(r),n=wo(e);if(r===e)return{valid:!0,data:r};if(t===Ae.object&&n===Ae.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=pm(r[f],e[f]);if(!u.valid)return{valid:!1};a[f]=u.data}return{valid:!0,data:a}}else if(t===Ae.array&&n===Ae.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=pm(a,f);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===Ae.date&&n===Ae.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(pm,"mergeValues");var Eo=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,a)=>{if(lm(s)||lm(a))return nt;let f=pm(s.value,a.value);return f.valid?((dm(s)||dm(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!==Ae.array)return Re(n,{code:Se.invalid_type,expected:Ae.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=>or.mergeArray(t,a)):or.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Vr(Me(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!==Ae.object)return Re(n,{code:Se.invalid_type,expected:Ae.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?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!==Ae.map)return Re(n,{code:Se.invalid_type,expected:Ae.map,received:n.parsedType}),nt;let i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([f,u],p)=>({key:i._parse(new zr(n,f,n.path,[p,"key"])),value:s._parse(new zr(n,u,n.path,[p,"value"]))}));if(n.common.async){let f=new Map;return Promise.resolve().then(()=>Z(this,null,function*(){for(let u of a){let p=yield u.key,m=yield u.value;if(p.status==="aborted"||m.status==="aborted")return nt;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),f.set(p.value,m.value)}return{status:t.value,value:f}}))}else{let f=new Map;for(let u of a){let p=u.key,m=u.value;if(p.status==="aborted"||m.status==="aborted")return nt;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),f.set(p.value,m.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!==Ae.set)return Re(n,{code:Se.invalid_type,expected:Ae.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 p=new Set;for(let m of u){if(m.status==="aborted")return nt;m.status==="dirty"&&t.dirty(),p.add(m.value)}return{status:t.value,value:p}}o(a,"finalizeSet");let f=[...n.data.values()].map((u,p)=>s._parse(new zr(n,u,n.path,p)));return n.common.async?Promise.all(f).then(u=>a(u)):a(f)}min(e,t){return new pi(Me(ie({},this._def),{minSize:{value:e,message:xt.toString(t)}}))}max(e,t){return new pi(Me(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!==Ae.function)return Re(t,{code:Se.invalid_type,expected:Ae.function,received:t.parsedType}),nt;function n(f,u){return ad({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_c,wc].filter(p=>!!p),issueData:{code:Se.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function i(f,u){return ad({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_c,wc].filter(p=>!!p),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?wr((...f)=>Z(this,null,function*(){let u=new bn([]),p=yield this._def.args.parseAsync(f,s).catch(k=>{throw u.addIssue(n(f,k)),u}),m=yield a(...p);return yield this._def.returns._def.type.parseAsync(m,s).catch(k=>{throw u.addIssue(i(m,k)),u})})):wr((...f)=>{let u=this._def.args.safeParse(f,s);if(!u.success)throw new bn([n(f,u.error)]);let p=a(...u.data),m=this._def.returns.safeParse(p,s);if(!m.success)throw new bn([i(p,m.error)]);return m.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mi(Me(ie({},this._def),{args:Vr.create(e).rest(Rn.create())}))}returns(e){return new mi(Me(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 $D(r,e){return new Us(ie({values:r,typeName:et.ZodEnum},st(e)))}o($D,"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=$D;var Fs=class extends ot{_parse(e){let t=kt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ae.string&&n.parsedType!==Ae.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 zi=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ae.promise&&t.common.async===!1)return Re(t,{code:Se.invalid_type,expected:Ae.promise,received:t.parsedType}),nt;let n=t.parsedType===Ae.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(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(!fd(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=>fd(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)===Ae.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)===Ae.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 Qa=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Qa,"ZodDefault");Qa.create=(r,e)=>new Gr(ie({innerType:r,typeName:et.ZodOptional},st(e)));var $s=class extends ot{_parse(e){if(this._getType(e)!==Ae.nan){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Ae.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 P4=o((r,e={},t)=>r?ji.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,a=typeof s=="string"?{message:s}:s;i.addIssue(Me(ie({code:"custom"},a),{fatal:t}))}}):ji.create(),"custom"),qD={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 HD=o((r,e={message:`Input not instance of ${r.name}`})=>P4(t=>t instanceof r,e,!0),"instanceOfType"),N4=Nn.create,R4=hi.create,jD=$s.create,zD=ks.create,L4=Cs.create,KD=Ds.create,VD=Os.create,WD=Is.create,GD=ji.create,YD=Rn.create,JD=Ln.create,XD=Ps.create,ZD=Kr.create,QD=Et.create,eO=Et.strictCreate,tO=_o.create,rO=Ns.create,nO=Eo.create,iO=Vr.create,oO=So.create,sO=Rs.create,aO=pi.create,fO=mi.create,cO=Ls.create,uO=Bs.create,lO=Us.create,dO=Fs.create,hO=zi.create,I4=Wr.create,pO=Gr.create,mO=bi.create,bO=Wr.createWithPreprocess,gO=o(()=>N4().optional(),"ostring"),vO=o(()=>R4().optional(),"onumber"),yO=o(()=>L4().optional(),"oboolean"),oe=Object.freeze({__proto__:null,getParsedType:wo,ZodParsedType:Ae,makeIssue:ad,EMPTY_PATH:ND,addIssueToContext:Re,ParseStatus:or,INVALID:nt,DIRTY:RD,OK:wr,isAborted:lm,isDirty:dm,isValid:fd,isAsync:hm,ZodType:ot,ZodString:Nn,ZodNumber:hi,ZodBigInt:ks,ZodBoolean:Cs,ZodDate:Ds,ZodUndefined:Os,ZodNull:Is,ZodAny:ji,ZodUnknown:Rn,ZodNever:Ln,ZodVoid:Ps,ZodArray:Kr,get objectUtil(){return cd},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:Qa,ZodNaN:$s,custom:P4,Schema:ot,ZodSchema:ot,late:qD,get ZodFirstPartyTypeKind(){return et},any:GD,array:ZD,bigint:zD,boolean:L4,date:KD,discriminatedUnion:rO,effect:I4,enum:lO,function:fO,instanceof:HD,intersection:nO,lazy:cO,literal:uO,map:sO,nan:jD,nativeEnum:dO,never:JD,null:WD,nullable:mO,number:R4,object:QD,oboolean:yO,onumber:vO,optional:pO,ostring:gO,preprocess:bO,promise:hO,record:oO,set:aO,strictObject:eO,string:N4,transformer:I4,tuple:iO,undefined:VD,union:tO,unknown:YD,void:XD,ZodIssueCode:Se,quotelessJson:ID,ZodError:bn,defaultErrorMap:wc,get overrideErrorMap(){return _c},setErrorMap:PD});var F4=oe.string().array(),WV=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),bm=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),xO=oe.object({type:oe.string().array().nonempty(),latitude:oe.number(),longitude:oe.number()}),wO=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:xO.optional()}),_O=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),$4=oe.object({type:oe.string().array().nonempty(),identifier:oe.string(),identifierType:_O}),Ec=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:bm.optional(),email:oe.string().email().optional(),address:wO.optional(),otherIdentifier:$4.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())),mm=oe.object({id:oe.string().optional()}).catchall(oe.any()),EO=oe.object({type:oe.string(),id:oe.string()}),SO=oe.object({id:oe.string(),type:oe.string()}),AO=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),ud=oe.object({"@context":F4,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:Ec,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:mm.or(mm.array()),credentialStatus:EO.optional(),credentialSchema:SO.array().optional(),refreshService:AO.optional()}).catchall(oe.any()),Ao=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()),B4=ud.extend({proof:Ao.or(Ao.array())}),MO=oe.object({"@context":F4,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:B4.or(B4.array()),holder:oe.string().optional()}).catchall(oe.any()),GV=MO.extend({proof:Ao.or(Ao.array())}),TO=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),ld=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:TO.optional(),targetUrl:oe.string()}),kO=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()),CO=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),DO=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),OO=ud.extend({credentialSubject:DO,proof:Ao.or(Ao.array()).optional()}),IO=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),PO=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),NO=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ld.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),RO=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ld.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:PO,rubricCriterionLevel:NO.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),LO=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:ld.array().optional(),achievementType:kO.optional(),creator:Ec.optional(),creditsAvailable:oe.number().optional(),criteria:CO,description:oe.string(),endorsement:OO.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:bm.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:$4.array().optional(),related:IO.array().optional(),resultDescription:RO.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),BO=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),UO=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),FO=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:ld.array().optional(),resultDescription:oe.string().optional(),status:UO.optional(),value:oe.string().optional()}).catchall(oe.any()),U4=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:LO.optional(),identifier:BO.optional(),image:bm.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:FO.array().optional(),role:oe.string().optional(),source:Ec.optional(),term:oe.string().optional()}).catchall(oe.any()),$O=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()),qO=ud.extend({name:oe.string().optional(),description:oe.string().optional(),image:oe.string().optional(),credentialSubject:U4.or(U4.array()),endorsement:ud.array().optional(),evidence:$O.array().optional()}),JV=qO.extend({proof:Ao.or(Ao.array())}),q4=oe.enum(["Success","Failed","Error"]),dd=q4.enum,ZV=oe.object({check:oe.string(),status:q4,message:oe.string().optional(),details:oe.string().optional()}),QV=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:Ec.optional(),issuee:Ec.optional(),credentialSubject:mm.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 gm(r,e){pt(2,arguments);var t=Ft(r).getTime(),n=Ht(e);return new Date(t+n)}o(gm,"addMilliseconds");function vm(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(vm,"getTimezoneOffsetInMilliseconds");function ym(r){return pt(1,arguments),r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}o(ym,"isDate");function xm(r){if(pt(1,arguments),!ym(r)&&typeof r!="number")return!1;var e=Ft(r);return!isNaN(Number(e))}o(xm,"isValid");var HO={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"}},jO=o(function(r,e,t){var n,i=HO[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"),H4=jO;function Sc(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(Sc,"buildFormatLongFn");var zO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},KO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},VO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WO={date:Sc({formats:zO,defaultWidth:"full"}),time:Sc({formats:KO,defaultWidth:"full"}),dateTime:Sc({formats:VO,defaultWidth:"full"})},j4=WO;var GO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},YO=o(function(r,e,t,n){return GO[r]},"formatRelative"),z4=YO;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,p=n.width?String(n.width):r.defaultWidth;s=r.values[p]||r.values[u]}var m=r.argumentCallback?r.argumentCallback(e):e;return s[m]}}o(qs,"buildLocalizeFn");var JO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},XO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ZO={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"]},QO={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"]},eI={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"}},tI={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"}},rI=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"),nI={ordinalNumber:rI,era:qs({values:JO,defaultWidth:"wide"}),quarter:qs({values:XO,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:qs({values:ZO,defaultWidth:"wide"}),day:qs({values:QO,defaultWidth:"wide"}),dayPeriod:qs({values:eI,defaultWidth:"wide",formattingValues:tI,defaultFormattingWidth:"wide"})},K4=nI;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)?oI(f,function(x){return x.test(a)}):iI(f,function(x){return x.test(a)}),p;p=r.valueCallback?r.valueCallback(u):u,p=t.valueCallback?t.valueCallback(p):p;var m=e.slice(a.length);return{value:p,rest:m}}}o(Hs,"buildMatchFn");function iI(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}o(iI,"findKey");function oI(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}o(oI,"findIndex");function wm(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(wm,"buildMatchPatternFn");var sI=/^(\d+)(th|st|nd|rd)?/i,aI=/\d+/i,fI={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},cI={any:[/^b/i,/^(a|c)/i]},uI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lI={any:[/1/i,/2/i,/3/i,/4/i]},dI={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},hI={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]},pI={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},mI={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]},bI={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},gI={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}},vI={ordinalNumber:wm({matchPattern:sI,parsePattern:aI,valueCallback:function(r){return parseInt(r,10)}}),era:Hs({matchPatterns:fI,defaultMatchWidth:"wide",parsePatterns:cI,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:uI,defaultMatchWidth:"wide",parsePatterns:lI,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Hs({matchPatterns:dI,defaultMatchWidth:"wide",parsePatterns:hI,defaultParseWidth:"any"}),day:Hs({matchPatterns:pI,defaultMatchWidth:"wide",parsePatterns:mI,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:bI,defaultMatchWidth:"any",parsePatterns:gI,defaultParseWidth:"any"})},V4=vI;var yI={code:"en-US",formatDistance:H4,formatLong:j4,formatRelative:z4,localize:K4,match:V4,options:{weekStartsOn:0,firstWeekContainsDate:1}},W4=yI;function _m(r,e){pt(2,arguments);var t=Ht(e);return gm(r,-t)}o(_m,"subMilliseconds");var xI=864e5;function Em(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/xI)+1}o(Em,"getUTCDayOfYear");function Mo(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(Mo,"startOfUTCISOWeek");function Ac(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=Mo(n),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var a=Mo(s);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}o(Ac,"getUTCISOWeekYear");function Sm(r){pt(1,arguments);var e=Ac(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Mo(t);return n}o(Sm,"startOfUTCISOWeekYear");var wI=6048e5;function Am(r){pt(1,arguments);var e=Ft(r),t=Mo(e).getTime()-Sm(e).getTime();return Math.round(t/wI)+1}o(Am,"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(),p=(u<a?7:0)+u-a;return f.setUTCDate(f.getUTCDate()-p),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 p=new Date(0);p.setUTCFullYear(n+1,0,u),p.setUTCHours(0,0,0,0);var m=To(p,e),x=new Date(0);x.setUTCFullYear(n,0,u),x.setUTCHours(0,0,0,0);var k=To(x,e);return t.getTime()>=m.getTime()?n+1:t.getTime()>=k.getTime()?n:n-1}o(Mc,"getUTCWeekYear");function Mm(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 p=To(u,e);return p}o(Mm,"startOfUTCWeekYear");var _I=6048e5;function Tm(r,e){pt(1,arguments);var t=Ft(r),n=To(t,e).getTime()-Mm(t,e).getTime();return Math.round(n/_I)+1}o(Tm,"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 EI={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)}},Ki=EI;var ef={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},SI={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 Ki.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=Ac(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 Ki.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=Tm(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):ut(i,e.length)},I:function(r,e,t){var n=Am(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"}):Ki.d(r,e)},D:function(r,e,t){var n=Em(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=ef.noon:n===0?i=ef.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=ef.evening:n>=12?i=ef.afternoon:n>=4?i=ef.morning:i=ef.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 Ki.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Ki.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"}):Ki.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Ki.s(r,e)},S:function(r,e){return Ki.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 Y4(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 Y4(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"+G4(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"+G4(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 G4(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(G4,"formatTimezoneShort");function Y4(r,e){if(r%60===0){var t=r>0?"-":"+";return t+ut(Math.abs(r)/60,2)}return js(r,e)}o(Y4,"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 J4=SI;function X4(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(X4,"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 AI(r,e){var t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return X4(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}}",X4(n,e)).replace("{{time}}",Z4(i,e))}o(AI,"dateTimeLongFormatter");var MI={p:Z4,P:AI},Q4=MI;var TI=["D","DD"],kI=["YY","YYYY"];function e5(r){return TI.indexOf(r)!==-1}o(e5,"isProtectedDayOfYearToken");function t5(r){return kI.indexOf(r)!==-1}o(t5,"isProtectedWeekYearToken");function km(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(km,"throwProtectedError");var CI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,DI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,OI=/^'([^]*?)'?$/,II=/''/g,PI=/[a-zA-Z]/;function Tc(r,e,t){pt(2,arguments);var n=String(e),i=t||{},s=i.locale||W4,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 p=s.options&&s.options.weekStartsOn,m=p==null?0:Ht(p),x=i.weekStartsOn==null?m: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(!xm(k))throw new RangeError("Invalid time value");var I=vm(k),T=_m(k,I),C={firstWeekContainsDate:u,weekStartsOn:x,locale:s,_originalDate:k},$=n.match(DI).map(function(O){var U=O[0];if(U==="p"||U==="P"){var z=Q4[U];return z(O,s.formatLong,C)}return O}).join("").match(CI).map(function(O){if(O==="''")return"'";var U=O[0];if(U==="'")return NI(O);var z=J4[U];if(z)return!i.useAdditionalWeekYearTokens&&t5(O)&&km(O,e,r),!i.useAdditionalDayOfYearTokens&&e5(O)&&km(O,e,r),z(T,O,s.localize,C);if(U.match(PI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return O}).join("");return $}o(Tc,"format");function NI(r){return r.match(OI)[1].replace(II,"'")}o(NI,"cleanEscapedString");var RI=o((r,e)=>r.split(" error")[0]||r,"transformErrorCheck"),LI=o((r,e)=>r.startsWith("expiration")?e.expirationDate?`Invalid \u2022 Expired ${Tc(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Invalid \u2022 Expired":r,"transformErrorMessage"),BI=o((r,e)=>({proof:"Valid",expiration:e.expirationDate?`Valid \u2022 Expires ${Tc(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Valid \u2022 Does Not Expire"})[r]||r,"transformCheckMessage"),r5=o(r=>e=>Z(void 0,null,function*(){let t=yield r.pluginMethods.verifyCredential(e),n=[];return t.errors.forEach(i=>{n.push({status:dd.Failed,check:RI(i,e),details:LI(i,e)})}),t.warnings.forEach(i=>{n.push({status:dd.Error,check:"hmm",message:i})}),t.checks.forEach(i=>{n.push({status:dd.Success,check:i,message:BI(i,e)})}),n}),"verifyCredential");var n5={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var i5=o((i,...s)=>Z(void 0,[i,...s],function*(r,{ceramicIdx:e=n5,didkit:t,defaultContents:n=[]}={}){yield zm(t);let a=yield(yield nf(n)).addPlugin(yield S4(r)),f=yield a.addPlugin(yield um(a)),u=yield f.addPlugin(yield sd(f,e)),p=yield u.addPlugin(A4(u));return{_wallet:p,get did(){return p.pluginMethods.getSubjectDid()},get keypair(){return p.pluginMethods.getSubjectKeypair()},issueCredential:p.pluginMethods.issueCredential,verifyCredential:r5(p),issuePresentation:p.pluginMethods.issuePresentation,verifyPresentation:p.pluginMethods.verifyPresentation,getCredential:p.pluginMethods.getVerifiableCredentialFromIndex,getCredentials:p.pluginMethods.getVerifiableCredentialsFromIndex,publishCredential:p.pluginMethods.publishContentToCeramic,addCredential:m=>Z(void 0,null,function*(){yield p.pluginMethods.addVerifiableCredentialInIdx(m)}),readFromCeramic:p.pluginMethods.readContentFromCeramic,getTestVc:p.pluginMethods.getTestVc}}),"walletFromKey");
|
792
|
+
`):"",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 Dl?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{H6(T)}catch(C){s=s!=null?s:[],C instanceof Dl?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 Dl(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)H6(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 Ip=vo.EMPTY;function Il(r){return r instanceof vo||r&&"closed"in r&&rt(r.remove)&&rt(r.add)&&rt(r.unsubscribe)}o(Il,"isSubscription");function H6(r){rt(r)?r():r.unsubscribe()}o(H6,"execFinalizer");var On={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var qa={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=qa.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=qa.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function Ol(r){qa.setTimeout(function(){var e=On.onUnhandledError;if(e)e(r);else throw r})}o(Ol,"reportUnhandledError");function Op(){}o(Op,"noop");var j6=function(){return Pp("C",void 0,void 0)}();function z6(r){return Pp("E",void 0,r)}o(z6,"errorNotification");function K6(r){return Pp("N",r,void 0)}o(K6,"nextNotification");function Pp(r,e,t){return{kind:r,value:e,error:t}}o(Pp,"createNotification");var ws=null;function Ha(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(Ha,"errorContext");function V6(r){On.useDeprecatedSynchronousErrorHandling&&ws&&(ws.errorThrown=!0,ws.error=r)}o(V6,"captureError");var sc=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Il(t)&&t.add(n)):n.destination=eC,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Nl(t,n,i)},e.prototype.next=function(t){this.isStopped?Rp(K6(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Rp(z6(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Rp(j6,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 Xk=Function.prototype.bind;function Np(r,e){return Xk.call(r,e)}o(Np,"bind");var Zk=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){Pl(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Pl(n)}else Pl(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Pl(t)}},r}(),Nl=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&&On.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Np(t.next,f),error:t.error&&Np(t.error,f),complete:t.complete&&Np(t.complete,f)}):a=t}return s.destination=new Zk(a),s}return o(e,"SafeSubscriber"),e}(sc);function Pl(r){On.useDeprecatedSynchronousErrorHandling?V6(r):Ol(r)}o(Pl,"handleUnhandledError");function Qk(r){throw r}o(Qk,"defaultErrorHandler");function Rp(r,e){var t=On.onStoppedNotification;t&&qa.setTimeout(function(){return t(r,e)})}o(Rp,"handleStoppedNotification");var eC={closed:!0,next:Op,error:Qk,complete:Op};var ja=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function za(r){return r}o(za,"identity");function W6(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(W6,"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=rC(e)?e:new Nl(e,t,n);return Ha(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=G6(t),new t(function(i,s){var a=new Nl({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[ja]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W6(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=G6(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 G6(r){var e;return(e=r!=null?r:On.Promise)!==null&&e!==void 0?e:Promise}o(G6,"getPromiseCtor");function tC(r){return r&&rt(r.next)&&rt(r.error)&&rt(r.complete)}o(tC,"isObserver");function rC(r){return r&&r instanceof sc||tC(r)&&Il(r)}o(rC,"isSubscriber");function nC(r){return rt(r==null?void 0:r.lift)}o(nC,"hasLift");function Yt(r){return function(e){if(nC(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 iC(r,e,t,n,i)}o(Jt,"createOperatorSubscriber");var iC=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}(sc);var Y6=$a(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Lp=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 J6(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Y6},e.prototype.next=function(t){var n=this;Ha(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;Ha(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;Ha(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?Ip:(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 J6(t,n)},e}(_t);var J6=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:Ip},e}(Lp);var Bp=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}(Lp);var Up={now:function(){return(Up.delegate||Date).now()},delegate:void 0};var X6=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 ac={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=ac.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=ac.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(r)},delegate:void 0};var Z6=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),ac.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;ac.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}(X6);var Fp=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=Up.now,r}();var Q6=function(r){hr(e,r);function e(t,n){n===void 0&&(n=Fp.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}(Fp);var oC=new Q6(Z6),ew=oC;var Rl=new _t(function(r){return r.complete()});function Ll(r){return r&&rt(r.schedule)}o(Ll,"isScheduler");function tw(r){return r[r.length-1]}o(tw,"last");function rw(r){return Ll(tw(r))?r.pop():void 0}o(rw,"popScheduler");function nw(r,e){return typeof tw(r)=="number"?r.pop():e}o(nw,"popNumber");var Ka=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function Bl(r){return rt(r==null?void 0:r.then)}o(Bl,"isPromise");function Ul(r){return rt(r[ja])}o(Ul,"isInteropObservable");function Fl(r){return Symbol.asyncIterator&&rt(r==null?void 0:r[Symbol.asyncIterator])}o(Fl,"isAsyncIterable");function $l(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($l,"createInvalidObservableTypeError");function sC(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(sC,"getSymbolIterator");var ql=sC();function Hl(r){return rt(r==null?void 0:r[ql])}o(Hl,"isIterable");function jl(r){return $6(this,arguments,o(function(){var t,n,i,s;return kl(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,Cl(t.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,Cl(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Cl(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(jl,"readableStreamLikeToAsyncGenerator");function zl(r){return rt(r==null?void 0:r.getReader)}o(zl,"isReadableStreamLike");function pr(r){if(r instanceof _t)return r;if(r!=null){if(Ul(r))return aC(r);if(Ka(r))return fC(r);if(Bl(r))return cC(r);if(Fl(r))return iw(r);if(Hl(r))return uC(r);if(zl(r))return lC(r)}throw $l(r)}o(pr,"innerFrom");function aC(r){return new _t(function(e){var t=r[ja]();if(rt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(aC,"fromInteropObservable");function fC(r){return new _t(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(fC,"fromArrayLike");function cC(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,Ol)})}o(cC,"fromPromise");function uC(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(uC,"fromIterable");function iw(r){return new _t(function(e){dC(r,e).catch(function(t){return e.error(t)})})}o(iw,"fromAsyncIterable");function lC(r){return iw(jl(r))}o(lC,"fromReadableStreamLike");function dC(r,e){var t,n,i,s;return F6(this,void 0,void 0,function(){var a,f;return kl(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=q6(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(dC,"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 Kl(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(Kl,"observeOn");function Vl(r,e){return e===void 0&&(e=0),Yt(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(Vl,"subscribeOn");function ow(r,e){return pr(r).pipe(Vl(e),Kl(e))}o(ow,"scheduleObservable");function sw(r,e){return pr(r).pipe(Vl(e),Kl(e))}o(sw,"schedulePromise");function aw(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(aw,"scheduleArray");function fw(r,e){return new _t(function(t){var n;return pn(t,e,function(){n=r[ql](),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(fw,"scheduleIterable");function Wl(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(Wl,"scheduleAsyncIterable");function cw(r,e){return Wl(jl(r),e)}o(cw,"scheduleReadableStreamLike");function uw(r,e){if(r!=null){if(Ul(r))return ow(r,e);if(Ka(r))return aw(r,e);if(Bl(r))return sw(r,e);if(Fl(r))return Wl(r,e);if(Hl(r))return fw(r,e);if(zl(r))return cw(r,e)}throw $l(r)}o(uw,"scheduled");function lw(r,e){return e?uw(r,e):pr(r)}o(lw,"from");var Gl=$a(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function dw(r){return r instanceof Date&&!isNaN(r)}o(dw,"isValidDate");function Yl(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){n.next(r.call(e,s,i++))}))})}o(Yl,"map");var hC=Array.isArray;function pC(r,e){return hC(e)?r.apply(void 0,In([],qr(e))):r(e)}o(pC,"callOrApply");function hw(r){return Yl(function(e){return pC(r,e)})}o(hw,"mapOneOrManyArgs");function pw(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;pr(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(pw,"mergeInternals");function fc(r,e,t){return t===void 0&&(t=1/0),rt(e)?fc(function(n,i){return Yl(function(s,a){return e(n,s,i,a)})(pr(r(n,i)))},t):(typeof e=="number"&&(t=e),Yt(function(n,i){return pw(n,i,r,t)}))}o(fc,"mergeMap");function mw(r){return r===void 0&&(r=1/0),fc(za,r)}o(mw,"mergeAll");var mC=["addListener","removeListener"],bC=["addEventListener","removeEventListener"],gC=["on","off"];function cc(r,e,t,n){if(rt(t)&&(n=t,t=void 0),n)return cc(r,e,t).pipe(hw(n));var i=qr(xC(r)?bC.map(function(f){return function(u){return r[f](e,u,t)}}):vC(r)?mC.map(bw(r,e)):yC(r)?gC.map(bw(r,e)):[],2),s=i[0],a=i[1];if(!s&&Ka(r))return fc(function(f){return cc(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(cc,"fromEvent");function bw(r,e){return function(t){return function(n){return r[t](e,n)}}}o(bw,"toCommonHandlerRegistry");function vC(r){return rt(r.addListener)&&rt(r.removeListener)}o(vC,"isNodeStyleEventEmitter");function yC(r){return rt(r.on)&&rt(r.off)}o(yC,"isJQueryStyleEventEmitter");function xC(r){return rt(r.addEventListener)&&rt(r.removeEventListener)}o(xC,"isEventTarget");function uc(r,e,t){r===void 0&&(r=0),t===void 0&&(t=ew);var n=-1;return e!=null&&(Ll(e)?t=e:n=e),new _t(function(i){var s=dw(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(uc,"timer");function $p(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=rw(r),n=nw(r,1/0),i=r;return i.length?i.length===1?pr(i[0]):mw(n)(lw(i,t)):Rl}o($p,"merge");function gw(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(gw,"filter");function vw(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(vw,"defaultIfEmpty");function yw(r){return r<=0?function(){return Rl}:Yt(function(e,t){var n=0;e.subscribe(Jt(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(yw,"take");function xw(r){return r===void 0&&(r=wC),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(xw,"throwIfEmpty");function wC(){return new Gl}o(wC,"defaultErrorFactory");function qp(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?gw(function(i,s){return r(i,s,n)}):za,yw(1),t?vw(e):xw(function(){return new Gl}))}}o(qp,"first");var _C={leading:!0,trailing:!1};function Hp(r,e){return e===void 0&&(e=_C),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=pr(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(Hp,"throttle");var ww;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(ww||(ww={}));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 zp;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(zp||(zp={}));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,jp.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===zp.ANCHOR).map(({cid:e})=>ht.make(this.id,e))}get state(){return(0,jp.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 Tw=at(Sw(),1);function Mw(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):($p(...r.map(t=>cc(t,"abort"))).pipe(qp()).subscribe(()=>{e.abort()}),e.signal)}o(Mw,"mergeAbortSignals");var lc=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=uc(e).subscribe(()=>{t.abort()})}clear(){var e;(e=this._subscription)==null||e.unsubscribe()}};o(lc,"TimedAbortSignal");function Aw(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(Aw,"abortable");var EC=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||EC,i=new lc(n),s=e.signal?Mw([e.signal,i.signal]):i.signal,a=yield Aw(s,f=>(0,Tw.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 dc=at(oc(),1);Vn();function $i(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($i,"toCID");var kw=0,yt=class{static streamIdFromState(e){return new Je(e.type,e.log[0].cid)}static serializeCommit(e){var n;let t=(0,dc.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,dc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=$i(t.jws.link),t.linkedBlock=Lt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Lt(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(t)&&(t.link=$i(t.link)),yt.isAnchorCommit(t)&&(t.proof=$i(t.proof)),t.id&&(t.id=$i(t.id)),t.prev&&(t.prev=$i(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,dc.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!=kw&&(t.metadata.unique=It(t.metadata.unique,"base64")),t.doctype=Cr.nameByCode(t.type),t}static deserializeState(e){var i,s,a,f;let t=(0,dc.default)(e);t.doctype&&(t.type=Cr.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(u=>Ae(ie({},u),{cid:$i(u.cid)})),t.anchorProof&&(t.anchorProof.txHash=$i(t.anchorProof.txHash),t.anchorProof.root=$i(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!=kw&&(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 Cw(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(Cw,"normalizeAccountId");var hc=class extends Bp{next(e){let t=this.value;yt.statesEqual(t,e)||super.next(e)}};o(hc,"StreamStateSubject");var SC=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,Kp={anchor:!0,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},MC={sync:Ct.PREFER_CACHE},Dw={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Vp(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,Pw.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(Vp,"headerFromMetadata");function Iw(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(Iw,"_ensureAuthenticated");function Wp(){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(Wp,"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,Ow.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({},Kp),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({},Kp),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({},Kp),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({},MC),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({},Dw),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({},Dw),t);let s={header:Vp(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=Wp,this.patch=Wp,this.sync=Wp,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=Vp(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=Na.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 Iw(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=Vp(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 Pf(f),f}let s={data:t,header:i};return Hr._signDagJWS(e,s)})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield Iw(e),e.did.createDagJWS(t)})}},"TileDocument");jr.STREAM_TYPE_NAME="tile";jr.STREAM_TYPE_ID=0;jr=Hr=SC([yo()],jr);var qw=at(Bw(),1);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 $w(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o($w,"_classExtractFieldDescriptor");function Jp(r,e){var t=$w(r,e,"get");return RC(r,t)}o(Jp,"_classPrivateFieldGet");function Uw(r,e,t){NC(r,e),e.set(r,t)}o(Uw,"_classPrivateFieldInit");function Fw(r,e,t){var n=$w(r,e,"set");return LC(r,n,t),t}o(Fw,"_classPrivateFieldSet");function BC(r){return typeof r=="string"||ht.isInstance(r)||Je.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(BC,"keyToQuery");function Xp(r){return typeof r=="string"?yr.from(r).toString():ht.isInstance(r)||Je.isInstance(r)?r.toString():r.streamId.toString()}o(Xp,"keyToString");function Qp(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(Qp,"getDeterministicQuery");var UC=o(()=>Promise.resolve([]),"tempBatchLoadFn"),Xl=new WeakMap,Zp=new WeakMap,mn=class extends qw.default{cache(e){if(!Jp(this,Zp))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(Jp(this,Xl),e,t,n);return this.cache(i),i})}deterministic(e,t){return Z(this,null,function*(){let n=yield Qp(e);try{return yield vd(mn.prototype,this,"load").call(this,n)}catch(i){let s=yield jr.createFromGenesis(Jp(this,Xl),n.genesis,t);return this.cache(s),s}})}load(e){return Z(this,null,function*(){return yield vd(mn.prototype,this,"load").call(this,e)})}update(e,t,n,i){return Z(this,null,function*(){let s=Xp(e);this.clear(s);let a=yield this.load({streamId:s});return yield a.update(t,n,i),a})}constructor(e){super(UC,{cache:!0,cacheKeyFn:Xp,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Uw(this,Xl,{writable:!0,value:void 0}),Uw(this,Zp,{writable:!0,value:void 0}),this._batchLoadFn=t=>Z(this,null,function*(){e.cache||this.clearAll();let n=yield e.ceramic.multiQuery(t.map(BC),e.multiqueryTimeout);return t.map(i=>{let s=Xp(i),a=n[s];return a||new Error(`Failed to load stream: ${s}`)})}),Fw(this,Xl,e.ceramic),Fw(this,Zp,!!e.cache)}};o(mn,"TileLoader");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 jw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(jw,"_classExtractFieldDescriptor");function Es(r,e){var t=jw(r,e,"get");return $C(r,t)}o(Es,"_classPrivateFieldGet");function Hw(r,e,t){FC(r,e),e.set(r,t)}o(Hw,"_classPrivateFieldInit");function em(r,e,t){var n=jw(r,e,"set");return qC(r,n,t),t}o(em,"_classPrivateFieldSet");var Wa=new WeakMap,Ga=new WeakMap,Ya=class{get aliases(){return Es(this,Wa)}get loader(){return Es(this,Ga)}getDefinitionID(e){var t;return(t=Es(this,Wa).definitions[e])!=null?t:null}getSchemaURL(e){var t;return(t=Es(this,Wa).schemas[e])!=null?t:null}getTileID(e){var t;return(t=Es(this,Wa).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,Ga).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,Ga).create(t,m,u)})}constructor(e){if(Hw(this,Wa,{writable:!0,value:void 0}),Hw(this,Ga,{writable:!0,value:void 0}),em(this,Wa,e.aliases),e.loader!=null)em(this,Ga,e.loader);else{if(e.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");em(this,Ga,new mn({ceramic:e.ceramic,cache:e.cache}))}}};o(Ya,"DataModel");function HC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(HC,"_checkPrivateRedeclaration");function jC(r,e){return e.get?e.get.call(r):e.value}o(jC,"_classApplyDescriptorGet");function zC(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(zC,"_classApplyDescriptorSet");function zw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(zw,"_classExtractFieldDescriptor");function li(r,e){var t=zw(r,e,"get");return jC(r,t)}o(li,"_classPrivateFieldGet");function Zl(r,e,t){HC(r,e),e.set(r,t)}o(Zl,"_classPrivateFieldInit");function Ql(r,e,t){var n=zw(r,e,"set");return zC(r,n,t),t}o(Ql,"_classPrivateFieldSet");var ed=new WeakMap,Ss=new WeakMap,tm=new WeakMap,td=new WeakMap,pc=class{_createValuePromise(){Ql(this,tm,new Promise((e,t)=>{Ql(this,td,{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,ed).call(this):yield li(this,tm)})}_start(){return Z(this,null,function*(){try{let e=yield li(this,ed).call(this);this._next(e)}catch(e){li(this,Ss).forEach(t=>{t.reject(e)}),Ql(this,Ss,[]),li(this,td).reject(e),this._createValuePromise()}})}_next(e){let t=li(this,Ss).shift();t==null?this._end(e):t.run(e)}_end(e){li(this,td).resolve(e),this._createValuePromise()}constructor(e){Zl(this,ed,{writable:!0,value:void 0}),Zl(this,Ss,{writable:!0,value:[]}),Zl(this,tm,{writable:!0,value:void 0}),Zl(this,td,{writable:!0,value:void 0}),Ql(this,ed,e),this._createValuePromise()}};o(pc,"TileProxy");var KC=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function VC(r){return KC.test(r)}o(VC,"isDIDstring");function WC(r){if(!VC(r))throw new Error(`Invalid DID: ${r}`)}o(WC,"assertDIDstring");function rm(r){return WC(r),{controllers:[r],family:"IDX"}}o(rm,"getIDXMetadata");function GC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(GC,"_checkPrivateRedeclaration");function YC(r,e){return e.get?e.get.call(r):e.value}o(YC,"_classApplyDescriptorGet");function JC(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(JC,"_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 Ut(r,e){var t=Kw(r,e,"get");return YC(r,t)}o(Ut,"_classPrivateFieldGet");function mc(r,e,t){GC(r,e),e.set(r,t)}o(mc,"_classPrivateFieldInit");function rd(r,e,t){var n=Kw(r,e,"set");return JC(r,n,t),t}o(rd,"_classPrivateFieldSet");var qi=new WeakMap,nd=new WeakMap,nm=new WeakMap,di=new WeakMap,id=new WeakMap,bc=class{get authenticated(){return Ut(this,qi).did!=null}get ceramic(){return Ut(this,qi)}get id(){if(Ut(this,nd)!=null)return Ut(this,nd);if(Ut(this,qi).did==null)throw new Error("Ceramic instance is not authenticated");return Ut(this,qi).did.hasParent?Ut(this,qi).did.parent:Ut(this,qi).did.id}get loader(){return Ut(this,di)}get model(){return Ut(this,id)}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 Qp(rm(p));return{genesis:x,streamId:k.toString(),paths:[n]}}))),s=yield Ut(this,qi).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 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(rm(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!==cl)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:cl});else if(t.metadata.schema!==cl)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getIndexProxy(e){let t=Ut(this,nm)[e];return t==null&&(t=new pc(()=>Z(this,null,function*(){return yield this._getOwnIDXDoc(e)})),Ut(this,nm)[e]=t),t}getDefinitionID(e){var t;return(t=Ut(this,id).getDefinitionID(e))!=null?t:e}getDefinition(e){return Z(this,null,function*(){let t=yield Ut(this,di).load(e);if(t.metadata.schema!==Ax)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 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=>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){mc(this,qi,{writable:!0,value:void 0}),mc(this,nd,{writable:!0,value:void 0}),mc(this,nm,{writable:!0,value:{}}),mc(this,di,{writable:!0,value:void 0}),mc(this,id,{writable:!0,value:void 0});let{cache:t,ceramic:n,id:i,loader:s,model:a}=e;rd(this,qi,n),rd(this,nd,i),rd(this,di,s!=null?s:new mn({ceramic:n,cache:t})),rd(this,id,a instanceof Ya?a:new Ya({loader:Ut(this,di),aliases:a}))}};o(bc,"DIDDataStore");function im(r){return typeof r=="string"?Je.fromString(r):r}o(im,"typeStreamID");var mr=class extends _t{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=uc(0,n).pipe(Hp(()=>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 hc(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 xr(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 xr(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 xr(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 xr(n);return i.map(s=>({cid:s.cid,value:yt.deserializeCommit(s.value)}))})}complete(){this.state$.complete()}};o(mr,"Document");var Ww=at(oc(),1),XC=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,om=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),Vw={anchor:!1,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},sm={anchor:!0,publish:!0,throwOnInvalidCommit:!0},ZC={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,Ww.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({},Vw),n);let a=Cw(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({},Vw),n),e.createStreamFromGenesis(Ms.STREAM_TYPE_ID,t,n)})}setDid(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},sm),n);let a=typeof e=="string"?e.trim():e.id,f=xd(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({},sm),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({},sm),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({},ZC),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=om,this.setDid=om,this.sync=om,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");As.STREAM_TYPE_NAME="caip10-link";As.STREAM_TYPE_ID=1;As=Ms=XC([yo()],As);var g4=at(no(),1);Vn();jo();var v4=at(h4(),1),wD=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,_D={sync:Ct.PREFER_CACHE};function p4(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(p4,"_ensureAuthenticated");function m4(){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(m4,"throwReadOnlyError");var b4;(function(r){r.LIST="list",r.SINGLE="single"})(b4||(b4={}));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({},_D),n);let a=yr.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:Na.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 p4(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,g4.randomBytes)(12),model:br.MODEL.bytes};return{data:t,header:i}})}makeReadOnly(){this.replacePlaceholder=m4,this.sync=m4,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static _signDagJWS(e,t){return Z(this,null,function*(){return yield p4(e),e.did.createDagJWS(t)})}},"Model");xo.STREAM_TYPE_NAME="model";xo.STREAM_TYPE_ID=2;xo.MODEL=function(){let r=Pf("model-v1"),e=v4.default.encode(r,"identity"),t=Kn(va,e),n=Pe.createV1(va,t);return new Je(br.STREAM_TYPE_ID,n)}();xo=br=wD([yo()],xo);var w4=at(no(),1);var ED=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},Hi,SD={anchor:!0,publish:!0,pin:!0,sync:Ct.NEVER_SYNC,syncTimeoutSeconds:0},MD={sync:Ct.PREFER_CACHE},y4={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function x4(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(x4,"_ensureAuthenticated");function cm(){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(cm,"throwReadOnlyError");var Ts=Hi=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({},SD),i);let u=i.asDID?{did:i.asDID}:e,m=yield Hi._makeGenesis(u,t,n);return e.createStreamFromGenesis(Hi.STREAM_TYPE_ID,m,i)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},MD),n);let a=yr.from(t);if(a.type!=Hi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Hi.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({},y4),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({},y4),t);let i={data:e,prev:this.tip,id:this.id.cid},s=yield Hi._signDagJWS(this.api,i),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}makeReadOnly(){this.replace=cm,this.patch=cm,this.sync=cm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return Hi._signDagJWS(e,n)}_makeRawCommit(e){return{data:Na.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 Hi._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 x4(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,w4.randomBytes)(12),model:n.model.bytes};return{data:t,header:i}})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield x4(e),e.did.createDagJWS(t)})}},"ModelInstanceDocument");Ts.STREAM_TYPE_NAME="MID";Ts.STREAM_TYPE_ID=3;Ts=Hi=ED([yo()],Ts);var vc=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(vc,"RemotePinApi");var yc=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(yc,"RemoteIndexApi");var AD="/api/v0/",TD="http://localhost:7007",kD={syncInterval:5e3},CD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},DD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},_4={sync:Ct.PREFER_CACHE},xc=class{constructor(e=TD,t={}){this._config=ie(ie({},kD),t),this._apiUrl=new URL(AD,e),this._streamCache=new Map,this.context={api:this},this.pin=new vc(this._apiUrl),this.index=new yc(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({},DD),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({},_4),t);let i=yr.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=>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 mr(p,this._apiUrl,this._config.syncInterval);return a[u]=this.buildStreamFromDocument(x),a},{})})}loadStreamCommits(e){let t=im(e);return mr.loadStreamCommits(t,this._apiUrl)}applyCommit(i,s){return Z(this,arguments,function*(e,t,n={}){n=ie(ie({},CD),n);let a=im(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({},_4),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 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 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(xc,"CeramicClient");var ID=o((r,e)=>Z(void 0,null,function*(){let t=new xc(e),n=ie({},E4.default.getResolver()),i=new ds({resolver:n});t.did=i;let s=r.pluginMethods.getKey(),a=new Jf(il(s));return t.did.setProvider(a),yield t.did.authenticate(),t}),"getCeramicClientFromWalletSuite"),sd=o((s,a)=>Z(void 0,[s,a],function*(r,{modelData:e,credentialAlias:t,ceramicEndpoint:n,defaultContentFamily:i}){let f=yield ID(r,n),u=new mn({ceramic:f}),m=new bc({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 OD=o(r=>/^[0-9a-f]+$/i.test(r),"isHex"),S4=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(!OD(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(il(e.padStart(64,"0"))),n=r.pluginMethods.keyToDid("key",t);return{pluginMethods:{getSubjectDid:()=>n,getSubjectKeypair:()=>t,getKey:()=>e.padStart(64,"0")}}}),"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 A4=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 T4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyCredential(t)}),"verifyCredential");var k4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectDid();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 C4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyPresentation(t)}),"verifyPresentation");var um=o(r=>Z(void 0,null,function*(){return{pluginMethods:Ae(ie({},r.pluginMethods),{issueCredential:A4(r),verifyCredential:T4(r),issuePresentation:k4(r),verifyPresentation:C4(r),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>{let n=e.pluginMethods.getSubjectDid();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"]),PD=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 wc=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"),_c=wc,ND=o(r=>{_c=r},"setErrorMap"),ad=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"),RD=[];function Re(r,e){let t=ad({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_c,wc].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"}),LD=o(r=>({status:"dirty",value:r}),"DIRTY"),wr=o(r=>({status:"valid",value:r}),"OK"),lm=o(r=>r.status==="aborted","isAborted"),dm=o(r=>r.status==="dirty","isDirty"),fd=o(r=>r.status==="valid","isValid"),hm=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 D4=o((r,e)=>{if(fd(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(hm(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 D4(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 hm(i)?i:Promise.resolve(i);return D4(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 Qa({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 BD=/^c[^\s-]{8,}$/i,UD=/^([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,FD=/^(([^<>()[\]\.,;:\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 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")FD.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")UD.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")BD.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 $D(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($D,"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"?$D(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 ji=class extends ot{constructor(){super(...arguments),this._any=!0}_parse(e){return wr(e.data)}};o(ji,"ZodAny");ji.create=r=>new ji(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=>or.mergeArray(n,a));let s=t.data.map((a,f)=>i.type._parseSync(new zr(t,a,t.path,f)));return or.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 cd;(function(r){r.mergeShapes=(e,t)=>ie(ie({},e),t)})(cd||(cd={}));var I4=o(r=>e=>new Et(Ae(ie({},r),{shape:()=>ie(ie({},r.shape()),e)})),"AugmentFactory");function Za(r){if(r instanceof Et){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Gr.create(Za(n))}return new Et(Ae(ie({},r._def),{shape:()=>e}))}else return r instanceof Kr?Kr.create(Za(r.element)):r instanceof Gr?Gr.create(Za(r.unwrap())):r instanceof bi?bi.create(Za(r.unwrap())):r instanceof Vr?Vr.create(r.items.map(e=>Za(e))):r}o(Za,"deepPartialify");var Et=class extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=I4(this._def),this.extend=I4(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=>or.mergeObjectSync(n,m)):or.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:()=>cd.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 Za(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 pm(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=pm(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=pm(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(pm,"mergeValues");var Eo=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,a)=>{if(lm(s)||lm(a))return nt;let f=pm(s.value,a.value);return f.valid?((dm(s)||dm(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=>or.mergeArray(t,a)):or.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?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 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 ad({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_c,wc].filter(m=>!!m),issueData:{code:Se.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function i(f,u){return ad({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_c,wc].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?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 qD(r,e){return new Us(ie({values:r,typeName:et.ZodEnum},st(e)))}o(qD,"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=qD;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 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 wr(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(!fd(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=>fd(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 Qa=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(Qa,"ZodDefault");Qa.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 P4=o((r,e={},t)=>r?ji.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}))}}):ji.create(),"custom"),HD={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 jD=o((r,e={message:`Input not instance of ${r.name}`})=>P4(t=>t instanceof r,e,!0),"instanceOfType"),N4=Nn.create,R4=hi.create,zD=$s.create,KD=ks.create,L4=Cs.create,VD=Ds.create,WD=Is.create,GD=Os.create,YD=ji.create,JD=Rn.create,XD=Ln.create,ZD=Ps.create,QD=Kr.create,eI=Et.create,tI=Et.strictCreate,rI=_o.create,nI=Ns.create,iI=Eo.create,oI=Vr.create,sI=So.create,aI=Rs.create,fI=pi.create,cI=mi.create,uI=Ls.create,lI=Bs.create,dI=Us.create,hI=Fs.create,pI=zi.create,O4=Wr.create,mI=Gr.create,bI=bi.create,gI=Wr.createWithPreprocess,vI=o(()=>N4().optional(),"ostring"),yI=o(()=>R4().optional(),"onumber"),xI=o(()=>L4().optional(),"oboolean"),oe=Object.freeze({__proto__:null,getParsedType:wo,ZodParsedType:Me,makeIssue:ad,EMPTY_PATH:RD,addIssueToContext:Re,ParseStatus:or,INVALID:nt,DIRTY:LD,OK:wr,isAborted:lm,isDirty:dm,isValid:fd,isAsync:hm,ZodType:ot,ZodString:Nn,ZodNumber:hi,ZodBigInt:ks,ZodBoolean:Cs,ZodDate:Ds,ZodUndefined:Is,ZodNull:Os,ZodAny:ji,ZodUnknown:Rn,ZodNever:Ln,ZodVoid:Ps,ZodArray:Kr,get objectUtil(){return cd},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:Qa,ZodNaN:$s,custom:P4,Schema:ot,ZodSchema:ot,late:HD,get ZodFirstPartyTypeKind(){return et},any:YD,array:QD,bigint:KD,boolean:L4,date:VD,discriminatedUnion:nI,effect:O4,enum:dI,function:cI,instanceof:jD,intersection:iI,lazy:uI,literal:lI,map:aI,nan:zD,nativeEnum:hI,never:XD,null:GD,nullable:bI,number:R4,object:eI,oboolean:xI,onumber:yI,optional:mI,ostring:vI,preprocess:gI,promise:pI,record:sI,set:fI,strictObject:tI,string:N4,transformer:O4,tuple:oI,undefined:WD,union:rI,unknown:JD,void:ZD,ZodIssueCode:Se,quotelessJson:PD,ZodError:bn,defaultErrorMap:wc,get overrideErrorMap(){return _c},setErrorMap:ND});var F4=oe.string().array(),jV=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),bm=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),wI=oe.object({type:oe.string().array().nonempty(),latitude:oe.number(),longitude:oe.number()}),_I=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:wI.optional()}),EI=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),$4=oe.object({type:oe.string().array().nonempty(),identifier:oe.string(),identifierType:EI}),Ec=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:bm.optional(),email:oe.string().email().optional(),address:_I.optional(),otherIdentifier:$4.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())),mm=oe.object({id:oe.string().optional()}).catchall(oe.any()),SI=oe.object({type:oe.string(),id:oe.string()}),MI=oe.object({id:oe.string(),type:oe.string()}),AI=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),ud=oe.object({"@context":F4,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:Ec,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:mm.or(mm.array()),credentialStatus:SI.optional(),credentialSchema:MI.array().optional(),refreshService:AI.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()),B4=ud.extend({proof:Mo.or(Mo.array())}),TI=oe.object({"@context":F4,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:B4.or(B4.array()),holder:oe.string().optional()}).catchall(oe.any()),zV=TI.extend({proof:Mo.or(Mo.array())}),kI=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),ld=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:kI.optional(),targetUrl:oe.string()}),CI=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()),DI=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),II=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),OI=ud.extend({credentialSubject:II,proof:Mo.or(Mo.array()).optional()}),PI=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),NI=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),RI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ld.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),LI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:ld.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:NI,rubricCriterionLevel:RI.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),BI=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:ld.array().optional(),achievementType:CI.optional(),creator:Ec.optional(),creditsAvailable:oe.number().optional(),criteria:DI,description:oe.string(),endorsement:OI.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:bm.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:$4.array().optional(),related:PI.array().optional(),resultDescription:LI.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),UI=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),FI=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),$I=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:ld.array().optional(),resultDescription:oe.string().optional(),status:FI.optional(),value:oe.string().optional()}).catchall(oe.any()),U4=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:BI.optional(),identifier:UI.optional(),image:bm.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:$I.array().optional(),role:oe.string().optional(),source:Ec.optional(),term:oe.string().optional()}).catchall(oe.any()),qI=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()),HI=ud.extend({name:oe.string().optional(),description:oe.string().optional(),image:oe.string().optional(),credentialSubject:U4.or(U4.array()),endorsement:ud.array().optional(),evidence:qI.array().optional()}),VV=HI.extend({proof:Mo.or(Mo.array())}),GV=oe.object({checks:oe.string().array(),warnings:oe.string().array(),errors:oe.string().array()}),q4=oe.enum(["Success","Failed","Error"]),dd=q4.enum,YV=oe.object({check:oe.string(),status:q4,message:oe.string().optional(),details:oe.string().optional()}),JV=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:Ec.optional(),issuee:Ec.optional(),credentialSubject:mm.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 gm(r,e){pt(2,arguments);var t=Ft(r).getTime(),n=Ht(e);return new Date(t+n)}o(gm,"addMilliseconds");function vm(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(vm,"getTimezoneOffsetInMilliseconds");function ym(r){return pt(1,arguments),r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}o(ym,"isDate");function xm(r){if(pt(1,arguments),!ym(r)&&typeof r!="number")return!1;var e=Ft(r);return!isNaN(Number(e))}o(xm,"isValid");var jI={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"}},zI=o(function(r,e,t){var n,i=jI[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"),H4=zI;function Sc(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(Sc,"buildFormatLongFn");var KI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},VI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},WI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GI={date:Sc({formats:KI,defaultWidth:"full"}),time:Sc({formats:VI,defaultWidth:"full"}),dateTime:Sc({formats:WI,defaultWidth:"full"})},j4=GI;var YI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},JI=o(function(r,e,t,n){return YI[r]},"formatRelative"),z4=JI;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 XI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ZI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},QI={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"]},eO={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"]},tO={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"}},rO={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"}},nO=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"),iO={ordinalNumber:nO,era:qs({values:XI,defaultWidth:"wide"}),quarter:qs({values:ZI,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:qs({values:QI,defaultWidth:"wide"}),day:qs({values:eO,defaultWidth:"wide"}),dayPeriod:qs({values:tO,defaultWidth:"wide",formattingValues:rO,defaultFormattingWidth:"wide"})},K4=iO;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)?sO(f,function(x){return x.test(a)}):oO(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 oO(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}o(oO,"findKey");function sO(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}o(sO,"findIndex");function wm(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(wm,"buildMatchPatternFn");var aO=/^(\d+)(th|st|nd|rd)?/i,fO=/\d+/i,cO={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},uO={any:[/^b/i,/^(a|c)/i]},lO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dO={any:[/1/i,/2/i,/3/i,/4/i]},hO={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},pO={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]},mO={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},bO={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]},gO={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},vO={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}},yO={ordinalNumber:wm({matchPattern:aO,parsePattern:fO,valueCallback:function(r){return parseInt(r,10)}}),era:Hs({matchPatterns:cO,defaultMatchWidth:"wide",parsePatterns:uO,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:lO,defaultMatchWidth:"wide",parsePatterns:dO,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Hs({matchPatterns:hO,defaultMatchWidth:"wide",parsePatterns:pO,defaultParseWidth:"any"}),day:Hs({matchPatterns:mO,defaultMatchWidth:"wide",parsePatterns:bO,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:gO,defaultMatchWidth:"any",parsePatterns:vO,defaultParseWidth:"any"})},V4=yO;var xO={code:"en-US",formatDistance:H4,formatLong:j4,formatRelative:z4,localize:K4,match:V4,options:{weekStartsOn:0,firstWeekContainsDate:1}},W4=xO;function _m(r,e){pt(2,arguments);var t=Ht(e);return gm(r,-t)}o(_m,"subMilliseconds");var wO=864e5;function Em(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/wO)+1}o(Em,"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 Mc(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(Mc,"getUTCISOWeekYear");function Sm(r){pt(1,arguments);var e=Mc(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Ao(t);return n}o(Sm,"startOfUTCISOWeekYear");var _O=6048e5;function Mm(r){pt(1,arguments);var e=Ft(r),t=Ao(e).getTime()-Sm(e).getTime();return Math.round(t/_O)+1}o(Mm,"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 Ac(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(Ac,"getUTCWeekYear");function Am(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=Ac(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(Am,"startOfUTCWeekYear");var EO=6048e5;function Tm(r,e){pt(1,arguments);var t=Ft(r),n=To(t,e).getTime()-Am(t,e).getTime();return Math.round(n/EO)+1}o(Tm,"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 SO={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)}},Ki=SO;var ef={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},MO={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 Ki.y(r,e)},Y:function(r,e,t,n){var i=Ac(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=Mc(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 Ki.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=Tm(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):ut(i,e.length)},I:function(r,e,t){var n=Mm(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"}):Ki.d(r,e)},D:function(r,e,t){var n=Em(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=ef.noon:n===0?i=ef.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=ef.evening:n>=12?i=ef.afternoon:n>=4?i=ef.morning:i=ef.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 Ki.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Ki.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"}):Ki.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Ki.s(r,e)},S:function(r,e){return Ki.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 Y4(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 Y4(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"+G4(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"+G4(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 G4(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(G4,"formatTimezoneShort");function Y4(r,e){if(r%60===0){var t=r>0?"-":"+";return t+ut(Math.abs(r)/60,2)}return js(r,e)}o(Y4,"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 J4=MO;function X4(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(X4,"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 AO(r,e){var t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return X4(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}}",X4(n,e)).replace("{{time}}",Z4(i,e))}o(AO,"dateTimeLongFormatter");var TO={p:Z4,P:AO},Q4=TO;var kO=["D","DD"],CO=["YY","YYYY"];function e5(r){return kO.indexOf(r)!==-1}o(e5,"isProtectedDayOfYearToken");function t5(r){return CO.indexOf(r)!==-1}o(t5,"isProtectedWeekYearToken");function km(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(km,"throwProtectedError");var DO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,IO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,OO=/^'([^]*?)'?$/,PO=/''/g,NO=/[a-zA-Z]/;function Tc(r,e,t){pt(2,arguments);var n=String(e),i=t||{},s=i.locale||W4,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(!xm(k))throw new RangeError("Invalid time value");var O=vm(k),T=_m(k,O),C={firstWeekContainsDate:u,weekStartsOn:x,locale:s,_originalDate:k},$=n.match(IO).map(function(I){var U=I[0];if(U==="p"||U==="P"){var z=Q4[U];return z(I,s.formatLong,C)}return I}).join("").match(DO).map(function(I){if(I==="''")return"'";var U=I[0];if(U==="'")return RO(I);var z=J4[U];if(z)return!i.useAdditionalWeekYearTokens&&t5(I)&&km(I,e,r),!i.useAdditionalDayOfYearTokens&&e5(I)&&km(I,e,r),z(T,I,s.localize,C);if(U.match(NO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return I}).join("");return $}o(Tc,"format");function RO(r){return r.match(OO)[1].replace(PO,"'")}o(RO,"cleanEscapedString");var LO=o((r,e)=>r.split(" error")[0]||r,"transformErrorCheck"),BO=o((r,e)=>r.startsWith("expiration")?e.expirationDate?`Invalid \u2022 Expired ${Tc(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Invalid \u2022 Expired":r,"transformErrorMessage"),UO=o((r,e)=>({proof:"Valid",expiration:e.expirationDate?`Valid \u2022 Expires ${Tc(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Valid \u2022 Does Not Expire"})[r]||r,"transformCheckMessage"),r5=o(r=>e=>Z(void 0,null,function*(){let t=yield r.pluginMethods.verifyCredential(e),n=[];return t.errors.forEach(i=>{n.push({status:dd.Failed,check:LO(i,e),details:BO(i,e)})}),t.warnings.forEach(i=>{n.push({status:dd.Error,check:"hmm",message:i})}),t.checks.forEach(i=>{n.push({status:dd.Success,check:i,message:UO(i,e)})}),n}),"verifyCredential");var n5={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var i5=o(r=>Z(void 0,null,function*(){return yield Oc(r),{pluginMethods:{generateEd25519KeyFromBytes:(e,t)=>JSON.parse(Rm(t)),keyToDid:(e,t,n)=>Lm(t,JSON.stringify(n)),keyToVerificationMethod:(e,t,n)=>Z(void 0,null,function*(){return Bm(t,JSON.stringify(n))}),issueCredential:(e,t,n,i)=>Z(void 0,null,function*(){return JSON.parse(yield Um(JSON.stringify(t),JSON.stringify(n),JSON.stringify(i)))}),verifyCredential:(e,t)=>Z(void 0,null,function*(){return JSON.parse(yield Fm(JSON.stringify(t),"{}"))}),issuePresentation:(e,t,n)=>Z(void 0,null,function*(){return $m(JSON.stringify(e),JSON.stringify(t),JSON.stringify(n))}),verifyPresentation:(e,t)=>Z(void 0,null,function*(){return JSON.parse(yield qm(JSON.stringify(t),"{}"))})}}}),"getDidKitPlugin");var o5=o((i,...s)=>Z(void 0,[i,...s],function*(r,{ceramicIdx:e=n5,didkit:t,defaultContents:n=[]}={}){yield Oc(t);let a=yield(yield nf(n)).addPlugin(yield i5(t)),f=yield a.addPlugin(yield S4(a,r)),u=yield f.addPlugin(yield um(f)),m=yield u.addPlugin(yield sd(u,e)),p=yield m.addPlugin(M4(m));return{_wallet:p,get did(){return p.pluginMethods.getSubjectDid()},get keypair(){return p.pluginMethods.getSubjectKeypair()},issueCredential:p.pluginMethods.issueCredential,verifyCredential:r5(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
|