@learncard/ceramic-plugin 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- "use strict";var kI=Object.create;var gu=Object.defineProperty;var II=Object.getOwnPropertyDescriptor;var DI=Object.getOwnPropertyNames;var RI=Object.getPrototypeOf,OI=Object.prototype.hasOwnProperty;var o=(r,e)=>gu(r,"name",{value:e,configurable:!0});var Gt=(r,e)=>()=>(r&&(e=r(r=0)),e);var Re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Yt=(r,e)=>{for(var t in e)gu(r,t,{get:e[t],enumerable:!0})},Wy=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of DI(e))!OI.call(r,i)&&i!==t&&gu(r,i,{get:()=>e[i],enumerable:!(n=II(e,i))||n.enumerable});return r};var Bt=(r,e,t)=>(t=r!=null?kI(RI(r)):{},Wy(e||!r||!r.__esModule?gu(t,"default",{value:r,enumerable:!0}):t,r)),Ch=r=>Wy(gu({},"__esModule",{value:!0}),r);var Jy=Re((Kf,vu)=>{(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",g=1,y=2,E=4,O=1,R=2,I=1,N=2,X=4,L=8,J=16,ee=32,Y=64,ie=128,G=256,$=512,K=30,he="...",C=800,h=16,x=1,b=2,l=3,m=1/0,_=9007199254740991,S=17976931348623157e292,A=0/0,v=4294967295,T=v-1,P=v>>>1,w=[["ary",ie],["bind",I],["bindKey",N],["curry",L],["curryRight",J],["flip",$],["partial",ee],["partialRight",Y],["rearg",G]],k="[object Arguments]",fe="[object Array]",D="[object AsyncFunction]",Q="[object Boolean]",se="[object Date]",H="[object DOMException]",z="[object Error]",V="[object Function]",te="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",ne="[object Object]",Me="[object Promise]",ue="[object Proxy]",ve="[object RegExp]",W="[object Set]",pe="[object String]",ke="[object Symbol]",ze="[object Undefined]",Ne="[object WeakMap]",We="[object WeakSet]",br="[object ArrayBuffer]",le="[object DataView]",oe="[object Float32Array]",F="[object Float64Array]",Z="[object Int8Array]",me="[object Int16Array]",ye="[object Int32Array]",we="[object Uint8Array]",Ie="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Fe="[object Uint32Array]",Oe=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Ge=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ye=/&(?:amp|lt|gt|quot|#39);/g,Dn=/[&<>"']/g,it=RegExp(Ye.source),ot=RegExp(Dn.source),ei=/<%-([\s\S]+?)%>/g,st=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,ti=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,at=/^\w*$/,ft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hn=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(hn.source),Ze=/^\s+/,ri=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ni=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/[()=,{}\[\]\/\s]/,ii=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,Rn=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Ht=/^\[object .+?Constructor\]$/,dn=/^0o[0-7]+$/i,pn=/^(?:0|[1-9]\d*)$/,mn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ur=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,oi="\\ud800-\\udfff",Ro="\\u0300-\\u036f",Oo="\\ufe20-\\ufe2f",No="\\u20d0-\\u20ff",ro=Ro+Oo+No,no="\\u2700-\\u27bf",io="a-z\\xdf-\\xf6\\xf8-\\xff",Po="\\xac\\xb1\\xd7\\xf7",Lo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bo="\\u2000-\\u206f",Uo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Cf="A-Z\\xc0-\\xd6\\xd8-\\xde",kf="\\ufe0e\\ufe0f",If=Po+Lo+Bo+Uo,vp="['\u2019]",k7="["+oi+"]",k2="["+If+"]",Hl="["+ro+"]",I2="\\d+",I7="["+no+"]",D2="["+io+"]",R2="[^"+oi+If+I2+no+io+Cf+"]",yp="\\ud83c[\\udffb-\\udfff]",D7="(?:"+Hl+"|"+yp+")",O2="[^"+oi+"]",xp="(?:\\ud83c[\\udde6-\\uddff]){2}",wp="[\\ud800-\\udbff][\\udc00-\\udfff]",Df="["+Cf+"]",N2="\\u200d",P2="(?:"+D2+"|"+R2+")",R7="(?:"+Df+"|"+R2+")",L2="(?:"+vp+"(?:d|ll|m|re|s|t|ve))?",B2="(?:"+vp+"(?:D|LL|M|RE|S|T|VE))?",U2=D7+"?",F2="["+kf+"]?",O7="(?:"+N2+"(?:"+[O2,xp,wp].join("|")+")"+F2+U2+")*",N7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",P7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$2=F2+U2+O7,L7="(?:"+[I7,xp,wp].join("|")+")"+$2,B7="(?:"+[O2+Hl+"?",Hl,xp,wp,k7].join("|")+")",U7=RegExp(vp,"g"),F7=RegExp(Hl,"g"),_p=RegExp(yp+"(?="+yp+")|"+B7+$2,"g"),$7=RegExp([Df+"?"+D2+"+"+L2+"(?="+[k2,Df,"$"].join("|")+")",R7+"+"+B2+"(?="+[k2,Df+P2,"$"].join("|")+")",Df+"?"+P2+"+"+L2,Df+"+"+B2,P7,N7,I2,L7].join("|"),"g"),q7=RegExp("["+N2+oi+ro+kf+"]"),H7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,z7=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],K7=-1,sr={};sr[oe]=sr[F]=sr[Z]=sr[me]=sr[ye]=sr[we]=sr[Ie]=sr[Dt]=sr[Fe]=!0,sr[k]=sr[fe]=sr[br]=sr[Q]=sr[le]=sr[se]=sr[z]=sr[V]=sr[ae]=sr[Ae]=sr[ne]=sr[ve]=sr[W]=sr[pe]=sr[Ne]=!1;var rr={};rr[k]=rr[fe]=rr[br]=rr[le]=rr[Q]=rr[se]=rr[oe]=rr[F]=rr[Z]=rr[me]=rr[ye]=rr[ae]=rr[Ae]=rr[ne]=rr[ve]=rr[W]=rr[pe]=rr[ke]=rr[we]=rr[Ie]=rr[Dt]=rr[Fe]=!0,rr[z]=rr[V]=rr[Ne]=!1;var j7={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},G7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},V7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},W7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},J7=parseFloat,Y7=parseInt,q2=typeof global=="object"&&global&&global.Object===Object&&global,X7=typeof self=="object"&&self&&self.Object===Object&&self,Mr=q2||X7||Function("return this")(),Ep=typeof Kf=="object"&&Kf&&!Kf.nodeType&&Kf,wa=Ep&&typeof vu=="object"&&vu&&!vu.nodeType&&vu,H2=wa&&wa.exports===Ep,Ap=H2&&q2.process,si=function(){try{var de=wa&&wa.require&&wa.require("util").types;return de||Ap&&Ap.binding&&Ap.binding("util")}catch{}}(),z2=si&&si.isArrayBuffer,K2=si&&si.isDate,j2=si&&si.isMap,G2=si&&si.isRegExp,V2=si&&si.isSet,W2=si&&si.isTypedArray;function On(de,Ee,xe){switch(xe.length){case 0:return de.call(Ee);case 1:return de.call(Ee,xe[0]);case 2:return de.call(Ee,xe[0],xe[1]);case 3:return de.call(Ee,xe[0],xe[1],xe[2])}return de.apply(Ee,xe)}o(On,"apply");function Z7(de,Ee,xe,He){for(var gt=-1,zt=de==null?0:de.length;++gt<zt;){var _r=de[gt];Ee(He,_r,xe(_r),de)}return He}o(Z7,"arrayAggregator");function ai(de,Ee){for(var xe=-1,He=de==null?0:de.length;++xe<He&&Ee(de[xe],xe,de)!==!1;);return de}o(ai,"arrayEach");function Q7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(Q7,"arrayEachRight");function J2(de,Ee){for(var xe=-1,He=de==null?0:de.length;++xe<He;)if(!Ee(de[xe],xe,de))return!1;return!0}o(J2,"arrayEvery");function _s(de,Ee){for(var xe=-1,He=de==null?0:de.length,gt=0,zt=[];++xe<He;){var _r=de[xe];Ee(_r,xe,de)&&(zt[gt++]=_r)}return zt}o(_s,"arrayFilter");function zl(de,Ee){var xe=de==null?0:de.length;return!!xe&&Rf(de,Ee,0)>-1}o(zl,"arrayIncludes");function Sp(de,Ee,xe){for(var He=-1,gt=de==null?0:de.length;++He<gt;)if(xe(Ee,de[He]))return!0;return!1}o(Sp,"arrayIncludesWith");function fr(de,Ee){for(var xe=-1,He=de==null?0:de.length,gt=Array(He);++xe<He;)gt[xe]=Ee(de[xe],xe,de);return gt}o(fr,"arrayMap");function Es(de,Ee){for(var xe=-1,He=Ee.length,gt=de.length;++xe<He;)de[gt+xe]=Ee[xe];return de}o(Es,"arrayPush");function Mp(de,Ee,xe,He){var gt=-1,zt=de==null?0:de.length;for(He&&zt&&(xe=de[++gt]);++gt<zt;)xe=Ee(xe,de[gt],gt,de);return xe}o(Mp,"arrayReduce");function eA(de,Ee,xe,He){var gt=de==null?0:de.length;for(He&&gt&&(xe=de[--gt]);gt--;)xe=Ee(xe,de[gt],gt,de);return xe}o(eA,"arrayReduceRight");function Tp(de,Ee){for(var xe=-1,He=de==null?0:de.length;++xe<He;)if(Ee(de[xe],xe,de))return!0;return!1}o(Tp,"arraySome");var tA=Cp("length");function rA(de){return de.split("")}o(rA,"asciiToArray");function nA(de){return de.match(ht)||[]}o(nA,"asciiWords");function Y2(de,Ee,xe){var He;return xe(de,function(gt,zt,_r){if(Ee(gt,zt,_r))return He=zt,!1}),He}o(Y2,"baseFindKey");function Kl(de,Ee,xe,He){for(var gt=de.length,zt=xe+(He?1:-1);He?zt--:++zt<gt;)if(Ee(de[zt],zt,de))return zt;return-1}o(Kl,"baseFindIndex");function Rf(de,Ee,xe){return Ee===Ee?mA(de,Ee,xe):Kl(de,X2,xe)}o(Rf,"baseIndexOf");function iA(de,Ee,xe,He){for(var gt=xe-1,zt=de.length;++gt<zt;)if(He(de[gt],Ee))return gt;return-1}o(iA,"baseIndexOfWith");function X2(de){return de!==de}o(X2,"baseIsNaN");function Z2(de,Ee){var xe=de==null?0:de.length;return xe?Ip(de,Ee)/xe:A}o(Z2,"baseMean");function Cp(de){return function(Ee){return Ee==null?r:Ee[de]}}o(Cp,"baseProperty");function kp(de){return function(Ee){return de==null?r:de[Ee]}}o(kp,"basePropertyOf");function Q2(de,Ee,xe,He,gt){return gt(de,function(zt,_r,Qt){xe=He?(He=!1,zt):Ee(xe,zt,_r,Qt)}),xe}o(Q2,"baseReduce");function oA(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(oA,"baseSortBy");function Ip(de,Ee){for(var xe,He=-1,gt=de.length;++He<gt;){var zt=Ee(de[He]);zt!==r&&(xe=xe===r?zt:xe+zt)}return xe}o(Ip,"baseSum");function Dp(de,Ee){for(var xe=-1,He=Array(de);++xe<de;)He[xe]=Ee(xe);return He}o(Dp,"baseTimes");function sA(de,Ee){return fr(Ee,function(xe){return[xe,de[xe]]})}o(sA,"baseToPairs");function ev(de){return de&&de.slice(0,iv(de)+1).replace(Ze,"")}o(ev,"baseTrim");function Nn(de){return function(Ee){return de(Ee)}}o(Nn,"baseUnary");function Rp(de,Ee){return fr(Ee,function(xe){return de[xe]})}o(Rp,"baseValues");function ru(de,Ee){return de.has(Ee)}o(ru,"cacheHas");function tv(de,Ee){for(var xe=-1,He=de.length;++xe<He&&Rf(Ee,de[xe],0)>-1;);return xe}o(tv,"charsStartIndex");function rv(de,Ee){for(var xe=de.length;xe--&&Rf(Ee,de[xe],0)>-1;);return xe}o(rv,"charsEndIndex");function aA(de,Ee){for(var xe=de.length,He=0;xe--;)de[xe]===Ee&&++He;return He}o(aA,"countHolders");var fA=kp(j7),cA=kp(G7);function uA(de){return"\\"+W7[de]}o(uA,"escapeStringChar");function lA(de,Ee){return de==null?r:de[Ee]}o(lA,"getValue");function Of(de){return q7.test(de)}o(Of,"hasUnicode");function hA(de){return H7.test(de)}o(hA,"hasUnicodeWord");function dA(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(dA,"iteratorToArray");function Op(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(He,gt){xe[++Ee]=[gt,He]}),xe}o(Op,"mapToArray");function nv(de,Ee){return function(xe){return de(Ee(xe))}}o(nv,"overArg");function As(de,Ee){for(var xe=-1,He=de.length,gt=0,zt=[];++xe<He;){var _r=de[xe];(_r===Ee||_r===d)&&(de[xe]=d,zt[gt++]=xe)}return zt}o(As,"replaceHolders");function jl(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(He){xe[++Ee]=He}),xe}o(jl,"setToArray");function pA(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(He){xe[++Ee]=[He,He]}),xe}o(pA,"setToPairs");function mA(de,Ee,xe){for(var He=xe-1,gt=de.length;++He<gt;)if(de[He]===Ee)return He;return-1}o(mA,"strictIndexOf");function bA(de,Ee,xe){for(var He=xe+1;He--;)if(de[He]===Ee)return He;return He}o(bA,"strictLastIndexOf");function Nf(de){return Of(de)?vA(de):tA(de)}o(Nf,"stringSize");function Oi(de){return Of(de)?yA(de):rA(de)}o(Oi,"stringToArray");function iv(de){for(var Ee=de.length;Ee--&&ri.test(de.charAt(Ee)););return Ee}o(iv,"trimmedEndIndex");var gA=kp(V7);function vA(de){for(var Ee=_p.lastIndex=0;_p.test(de);)++Ee;return Ee}o(vA,"unicodeSize");function yA(de){return de.match(_p)||[]}o(yA,"unicodeToArray");function xA(de){return de.match($7)||[]}o(xA,"unicodeWords");var wA=o(function de(Ee){Ee=Ee==null?Mr:Ss.defaults(Mr.Object(),Ee,Ss.pick(Mr,z7));var xe=Ee.Array,He=Ee.Date,gt=Ee.Error,zt=Ee.Function,_r=Ee.Math,Qt=Ee.Object,Np=Ee.RegExp,_A=Ee.String,fi=Ee.TypeError,Gl=xe.prototype,EA=zt.prototype,Pf=Qt.prototype,Vl=Ee["__core-js_shared__"],Wl=EA.toString,Wt=Pf.hasOwnProperty,AA=0,ov=function(){var a=/[^.]+$/.exec(Vl&&Vl.keys&&Vl.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Jl=Pf.toString,SA=Wl.call(Qt),MA=Mr._,TA=Np("^"+Wl.call(Wt).replace(hn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yl=H2?Ee.Buffer:r,Ms=Ee.Symbol,Xl=Ee.Uint8Array,sv=Yl?Yl.allocUnsafe:r,Zl=nv(Qt.getPrototypeOf,Qt),av=Qt.create,fv=Pf.propertyIsEnumerable,Ql=Gl.splice,cv=Ms?Ms.isConcatSpreadable:r,nu=Ms?Ms.iterator:r,_a=Ms?Ms.toStringTag:r,eh=function(){try{var a=Ta(Qt,"defineProperty");return a({},"",{}),a}catch{}}(),CA=Ee.clearTimeout!==Mr.clearTimeout&&Ee.clearTimeout,kA=He&&He.now!==Mr.Date.now&&He.now,IA=Ee.setTimeout!==Mr.setTimeout&&Ee.setTimeout,th=_r.ceil,rh=_r.floor,Pp=Qt.getOwnPropertySymbols,DA=Yl?Yl.isBuffer:r,uv=Ee.isFinite,RA=Gl.join,OA=nv(Qt.keys,Qt),Er=_r.max,Vr=_r.min,NA=He.now,PA=Ee.parseInt,lv=_r.random,LA=Gl.reverse,Lp=Ta(Ee,"DataView"),iu=Ta(Ee,"Map"),Bp=Ta(Ee,"Promise"),Lf=Ta(Ee,"Set"),ou=Ta(Ee,"WeakMap"),su=Ta(Qt,"create"),nh=ou&&new ou,Bf={},BA=Ca(Lp),UA=Ca(iu),FA=Ca(Bp),$A=Ca(Lf),qA=Ca(ou),ih=Ms?Ms.prototype:r,au=ih?ih.valueOf:r,hv=ih?ih.toString:r;function q(a){if(ur(a)&&!yt(a)&&!(a instanceof Rt)){if(a instanceof ci)return a;if(Wt.call(a,"__wrapped__"))return dy(a)}return new ci(a)}o(q,"lodash");var Uf=function(){function a(){}return o(a,"object"),function(c){if(!cr(c))return{};if(av)return av(c);a.prototype=c;var p=new a;return a.prototype=r,p}}();function oh(){}o(oh,"baseLodash");function ci(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}o(ci,"LodashWrapper"),q.templateSettings={escape:ei,evaluate:st,interpolate:tt,variable:"",imports:{_:q}},q.prototype=oh.prototype,q.prototype.constructor=q,ci.prototype=Uf(oh.prototype),ci.prototype.constructor=ci;function Rt(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}o(Rt,"LazyWrapper");function HA(){var a=new Rt(this.__wrapped__);return a.__actions__=gn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=gn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=gn(this.__views__),a}o(HA,"lazyClone");function zA(){if(this.__filtered__){var a=new Rt(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}o(zA,"lazyReverse");function KA(){var a=this.__wrapped__.value(),c=this.__dir__,p=yt(a),M=c<0,U=p?a.length:0,j=rM(0,U,this.__views__),re=j.start,ce=j.end,be=ce-re,Te=M?ce:re-1,Ce=this.__iteratees__,De=Ce.length,Be=0,Ke=Vr(be,this.__takeCount__);if(!p||!M&&U==be&&Ke==be)return Lv(a,this.__actions__);var Qe=[];e:for(;be--&&Be<Ke;){Te+=c;for(var Et=-1,et=a[Te];++Et<De;){var kt=Ce[Et],Nt=kt.iteratee,Bn=kt.type,cn=Nt(et);if(Bn==b)et=cn;else if(!cn){if(Bn==x)continue e;break e}}Qe[Be++]=et}return Qe}o(KA,"lazyValue"),Rt.prototype=Uf(oh.prototype),Rt.prototype.constructor=Rt;function Ea(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var M=a[c];this.set(M[0],M[1])}}o(Ea,"Hash");function jA(){this.__data__=su?su(null):{},this.size=0}o(jA,"hashClear");function GA(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}o(GA,"hashDelete");function VA(a){var c=this.__data__;if(su){var p=c[a];return p===f?r:p}return Wt.call(c,a)?c[a]:r}o(VA,"hashGet");function WA(a){var c=this.__data__;return su?c[a]!==r:Wt.call(c,a)}o(WA,"hashHas");function JA(a,c){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=su&&c===r?f:c,this}o(JA,"hashSet"),Ea.prototype.clear=jA,Ea.prototype.delete=GA,Ea.prototype.get=VA,Ea.prototype.has=WA,Ea.prototype.set=JA;function Fo(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var M=a[c];this.set(M[0],M[1])}}o(Fo,"ListCache");function YA(){this.__data__=[],this.size=0}o(YA,"listCacheClear");function XA(a){var c=this.__data__,p=sh(c,a);if(p<0)return!1;var M=c.length-1;return p==M?c.pop():Ql.call(c,p,1),--this.size,!0}o(XA,"listCacheDelete");function ZA(a){var c=this.__data__,p=sh(c,a);return p<0?r:c[p][1]}o(ZA,"listCacheGet");function QA(a){return sh(this.__data__,a)>-1}o(QA,"listCacheHas");function eS(a,c){var p=this.__data__,M=sh(p,a);return M<0?(++this.size,p.push([a,c])):p[M][1]=c,this}o(eS,"listCacheSet"),Fo.prototype.clear=YA,Fo.prototype.delete=XA,Fo.prototype.get=ZA,Fo.prototype.has=QA,Fo.prototype.set=eS;function $o(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var M=a[c];this.set(M[0],M[1])}}o($o,"MapCache");function tS(){this.size=0,this.__data__={hash:new Ea,map:new(iu||Fo),string:new Ea}}o(tS,"mapCacheClear");function rS(a){var c=vh(this,a).delete(a);return this.size-=c?1:0,c}o(rS,"mapCacheDelete");function nS(a){return vh(this,a).get(a)}o(nS,"mapCacheGet");function iS(a){return vh(this,a).has(a)}o(iS,"mapCacheHas");function oS(a,c){var p=vh(this,a),M=p.size;return p.set(a,c),this.size+=p.size==M?0:1,this}o(oS,"mapCacheSet"),$o.prototype.clear=tS,$o.prototype.delete=rS,$o.prototype.get=nS,$o.prototype.has=iS,$o.prototype.set=oS;function Aa(a){var c=-1,p=a==null?0:a.length;for(this.__data__=new $o;++c<p;)this.add(a[c])}o(Aa,"SetCache");function sS(a){return this.__data__.set(a,f),this}o(sS,"setCacheAdd");function aS(a){return this.__data__.has(a)}o(aS,"setCacheHas"),Aa.prototype.add=Aa.prototype.push=sS,Aa.prototype.has=aS;function Ni(a){var c=this.__data__=new Fo(a);this.size=c.size}o(Ni,"Stack");function fS(){this.__data__=new Fo,this.size=0}o(fS,"stackClear");function cS(a){var c=this.__data__,p=c.delete(a);return this.size=c.size,p}o(cS,"stackDelete");function uS(a){return this.__data__.get(a)}o(uS,"stackGet");function lS(a){return this.__data__.has(a)}o(lS,"stackHas");function hS(a,c){var p=this.__data__;if(p instanceof Fo){var M=p.__data__;if(!iu||M.length<t-1)return M.push([a,c]),this.size=++p.size,this;p=this.__data__=new $o(M)}return p.set(a,c),this.size=p.size,this}o(hS,"stackSet"),Ni.prototype.clear=fS,Ni.prototype.delete=cS,Ni.prototype.get=uS,Ni.prototype.has=lS,Ni.prototype.set=hS;function dv(a,c){var p=yt(a),M=!p&&ka(a),U=!p&&!M&&Ds(a),j=!p&&!M&&!U&&Hf(a),re=p||M||U||j,ce=re?Dp(a.length,_A):[],be=ce.length;for(var Te in a)(c||Wt.call(a,Te))&&!(re&&(Te=="length"||U&&(Te=="offset"||Te=="parent")||j&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Ko(Te,be)))&&ce.push(Te);return ce}o(dv,"arrayLikeKeys");function pv(a){var c=a.length;return c?a[Wp(0,c-1)]:r}o(pv,"arraySample");function dS(a,c){return yh(gn(a),Sa(c,0,a.length))}o(dS,"arraySampleSize");function pS(a){return yh(gn(a))}o(pS,"arrayShuffle");function Up(a,c,p){(p!==r&&!Pi(a[c],p)||p===r&&!(c in a))&&qo(a,c,p)}o(Up,"assignMergeValue");function fu(a,c,p){var M=a[c];(!(Wt.call(a,c)&&Pi(M,p))||p===r&&!(c in a))&&qo(a,c,p)}o(fu,"assignValue");function sh(a,c){for(var p=a.length;p--;)if(Pi(a[p][0],c))return p;return-1}o(sh,"assocIndexOf");function mS(a,c,p,M){return Ts(a,function(U,j,re){c(M,U,p(U),re)}),M}o(mS,"baseAggregator");function mv(a,c){return a&&so(c,Tr(c),a)}o(mv,"baseAssign");function bS(a,c){return a&&so(c,yn(c),a)}o(bS,"baseAssignIn");function qo(a,c,p){c=="__proto__"&&eh?eh(a,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[c]=p}o(qo,"baseAssignValue");function Fp(a,c){for(var p=-1,M=c.length,U=xe(M),j=a==null;++p<M;)U[p]=j?r:ym(a,c[p]);return U}o(Fp,"baseAt");function Sa(a,c,p){return a===a&&(p!==r&&(a=a<=p?a:p),c!==r&&(a=a>=c?a:c)),a}o(Sa,"baseClamp");function ui(a,c,p,M,U,j){var re,ce=c&g,be=c&y,Te=c&E;if(p&&(re=U?p(a,M,U,j):p(a)),re!==r)return re;if(!cr(a))return a;var Ce=yt(a);if(Ce){if(re=iM(a),!ce)return gn(a,re)}else{var De=Wr(a),Be=De==V||De==te;if(Ds(a))return Fv(a,ce);if(De==ne||De==k||Be&&!U){if(re=be||Be?{}:iy(a),!ce)return be?VS(a,bS(re,a)):GS(a,mv(re,a))}else{if(!rr[De])return U?a:{};re=oM(a,De,ce)}}j||(j=new Ni);var Ke=j.get(a);if(Ke)return Ke;j.set(a,re),Oy(a)?a.forEach(function(et){re.add(ui(et,c,p,et,a,j))}):Dy(a)&&a.forEach(function(et,kt){re.set(kt,ui(et,c,p,kt,a,j))});var Qe=Te?be?om:im:be?yn:Tr,Et=Ce?r:Qe(a);return ai(Et||a,function(et,kt){Et&&(kt=et,et=a[kt]),fu(re,kt,ui(et,c,p,kt,a,j))}),re}o(ui,"baseClone");function gS(a){var c=Tr(a);return function(p){return bv(p,a,c)}}o(gS,"baseConforms");function bv(a,c,p){var M=p.length;if(a==null)return!M;for(a=Qt(a);M--;){var U=p[M],j=c[U],re=a[U];if(re===r&&!(U in a)||!j(re))return!1}return!0}o(bv,"baseConformsTo");function gv(a,c,p){if(typeof a!="function")throw new fi(i);return mu(function(){a.apply(r,p)},c)}o(gv,"baseDelay");function cu(a,c,p,M){var U=-1,j=zl,re=!0,ce=a.length,be=[],Te=c.length;if(!ce)return be;p&&(c=fr(c,Nn(p))),M?(j=Sp,re=!1):c.length>=t&&(j=ru,re=!1,c=new Aa(c));e:for(;++U<ce;){var Ce=a[U],De=p==null?Ce:p(Ce);if(Ce=M||Ce!==0?Ce:0,re&&De===De){for(var Be=Te;Be--;)if(c[Be]===De)continue e;be.push(Ce)}else j(c,De,M)||be.push(Ce)}return be}o(cu,"baseDifference");var Ts=Kv(oo),vv=Kv(qp,!0);function vS(a,c){var p=!0;return Ts(a,function(M,U,j){return p=!!c(M,U,j),p}),p}o(vS,"baseEvery");function ah(a,c,p){for(var M=-1,U=a.length;++M<U;){var j=a[M],re=c(j);if(re!=null&&(ce===r?re===re&&!Ln(re):p(re,ce)))var ce=re,be=j}return be}o(ah,"baseExtremum");function yS(a,c,p,M){var U=a.length;for(p=_t(p),p<0&&(p=-p>U?0:U+p),M=M===r||M>U?U:_t(M),M<0&&(M+=U),M=p>M?0:Py(M);p<M;)a[p++]=c;return a}o(yS,"baseFill");function yv(a,c){var p=[];return Ts(a,function(M,U,j){c(M,U,j)&&p.push(M)}),p}o(yv,"baseFilter");function Fr(a,c,p,M,U){var j=-1,re=a.length;for(p||(p=aM),U||(U=[]);++j<re;){var ce=a[j];c>0&&p(ce)?c>1?Fr(ce,c-1,p,M,U):Es(U,ce):M||(U[U.length]=ce)}return U}o(Fr,"baseFlatten");var $p=jv(),xv=jv(!0);function oo(a,c){return a&&$p(a,c,Tr)}o(oo,"baseForOwn");function qp(a,c){return a&&xv(a,c,Tr)}o(qp,"baseForOwnRight");function fh(a,c){return _s(c,function(p){return jo(a[p])})}o(fh,"baseFunctions");function Ma(a,c){c=ks(c,a);for(var p=0,M=c.length;a!=null&&p<M;)a=a[ao(c[p++])];return p&&p==M?a:r}o(Ma,"baseGet");function wv(a,c,p){var M=c(a);return yt(a)?M:Es(M,p(a))}o(wv,"baseGetAllKeys");function an(a){return a==null?a===r?ze:ge:_a&&_a in Qt(a)?tM(a):pM(a)}o(an,"baseGetTag");function Hp(a,c){return a>c}o(Hp,"baseGt");function xS(a,c){return a!=null&&Wt.call(a,c)}o(xS,"baseHas");function wS(a,c){return a!=null&&c in Qt(a)}o(wS,"baseHasIn");function _S(a,c,p){return a>=Vr(c,p)&&a<Er(c,p)}o(_S,"baseInRange");function zp(a,c,p){for(var M=p?Sp:zl,U=a[0].length,j=a.length,re=j,ce=xe(j),be=1/0,Te=[];re--;){var Ce=a[re];re&&c&&(Ce=fr(Ce,Nn(c))),be=Vr(Ce.length,be),ce[re]=!p&&(c||U>=120&&Ce.length>=120)?new Aa(re&&Ce):r}Ce=a[0];var De=-1,Be=ce[0];e:for(;++De<U&&Te.length<be;){var Ke=Ce[De],Qe=c?c(Ke):Ke;if(Ke=p||Ke!==0?Ke:0,!(Be?ru(Be,Qe):M(Te,Qe,p))){for(re=j;--re;){var Et=ce[re];if(!(Et?ru(Et,Qe):M(a[re],Qe,p)))continue e}Be&&Be.push(Qe),Te.push(Ke)}}return Te}o(zp,"baseIntersection");function ES(a,c,p,M){return oo(a,function(U,j,re){c(M,p(U),j,re)}),M}o(ES,"baseInverter");function uu(a,c,p){c=ks(c,a),a=fy(a,c);var M=a==null?a:a[ao(hi(c))];return M==null?r:On(M,a,p)}o(uu,"baseInvoke");function _v(a){return ur(a)&&an(a)==k}o(_v,"baseIsArguments");function AS(a){return ur(a)&&an(a)==br}o(AS,"baseIsArrayBuffer");function SS(a){return ur(a)&&an(a)==se}o(SS,"baseIsDate");function lu(a,c,p,M,U){return a===c?!0:a==null||c==null||!ur(a)&&!ur(c)?a!==a&&c!==c:MS(a,c,p,M,lu,U)}o(lu,"baseIsEqual");function MS(a,c,p,M,U,j){var re=yt(a),ce=yt(c),be=re?fe:Wr(a),Te=ce?fe:Wr(c);be=be==k?ne:be,Te=Te==k?ne:Te;var Ce=be==ne,De=Te==ne,Be=be==Te;if(Be&&Ds(a)){if(!Ds(c))return!1;re=!0,Ce=!1}if(Be&&!Ce)return j||(j=new Ni),re||Hf(a)?ty(a,c,p,M,U,j):QS(a,c,be,p,M,U,j);if(!(p&O)){var Ke=Ce&&Wt.call(a,"__wrapped__"),Qe=De&&Wt.call(c,"__wrapped__");if(Ke||Qe){var Et=Ke?a.value():a,et=Qe?c.value():c;return j||(j=new Ni),U(Et,et,p,M,j)}}return Be?(j||(j=new Ni),eM(a,c,p,M,U,j)):!1}o(MS,"baseIsEqualDeep");function TS(a){return ur(a)&&Wr(a)==ae}o(TS,"baseIsMap");function Kp(a,c,p,M){var U=p.length,j=U,re=!M;if(a==null)return!j;for(a=Qt(a);U--;){var ce=p[U];if(re&&ce[2]?ce[1]!==a[ce[0]]:!(ce[0]in a))return!1}for(;++U<j;){ce=p[U];var be=ce[0],Te=a[be],Ce=ce[1];if(re&&ce[2]){if(Te===r&&!(be in a))return!1}else{var De=new Ni;if(M)var Be=M(Te,Ce,be,a,c,De);if(!(Be===r?lu(Ce,Te,O|R,M,De):Be))return!1}}return!0}o(Kp,"baseIsMatch");function Ev(a){if(!cr(a)||cM(a))return!1;var c=jo(a)?TA:Ht;return c.test(Ca(a))}o(Ev,"baseIsNative");function CS(a){return ur(a)&&an(a)==ve}o(CS,"baseIsRegExp");function kS(a){return ur(a)&&Wr(a)==W}o(kS,"baseIsSet");function IS(a){return ur(a)&&Sh(a.length)&&!!sr[an(a)]}o(IS,"baseIsTypedArray");function Av(a){return typeof a=="function"?a:a==null?xn:typeof a=="object"?yt(a)?Tv(a[0],a[1]):Mv(a):Gy(a)}o(Av,"baseIteratee");function jp(a){if(!pu(a))return OA(a);var c=[];for(var p in Qt(a))Wt.call(a,p)&&p!="constructor"&&c.push(p);return c}o(jp,"baseKeys");function DS(a){if(!cr(a))return dM(a);var c=pu(a),p=[];for(var M in a)M=="constructor"&&(c||!Wt.call(a,M))||p.push(M);return p}o(DS,"baseKeysIn");function Gp(a,c){return a<c}o(Gp,"baseLt");function Sv(a,c){var p=-1,M=vn(a)?xe(a.length):[];return Ts(a,function(U,j,re){M[++p]=c(U,j,re)}),M}o(Sv,"baseMap");function Mv(a){var c=am(a);return c.length==1&&c[0][2]?sy(c[0][0],c[0][1]):function(p){return p===a||Kp(p,a,c)}}o(Mv,"baseMatches");function Tv(a,c){return cm(a)&&oy(c)?sy(ao(a),c):function(p){var M=ym(p,a);return M===r&&M===c?xm(p,a):lu(c,M,O|R)}}o(Tv,"baseMatchesProperty");function ch(a,c,p,M,U){a!==c&&$p(c,function(j,re){if(U||(U=new Ni),cr(j))RS(a,c,re,p,ch,M,U);else{var ce=M?M(lm(a,re),j,re+"",a,c,U):r;ce===r&&(ce=j),Up(a,re,ce)}},yn)}o(ch,"baseMerge");function RS(a,c,p,M,U,j,re){var ce=lm(a,p),be=lm(c,p),Te=re.get(be);if(Te){Up(a,p,Te);return}var Ce=j?j(ce,be,p+"",a,c,re):r,De=Ce===r;if(De){var Be=yt(be),Ke=!Be&&Ds(be),Qe=!Be&&!Ke&&Hf(be);Ce=be,Be||Ke||Qe?yt(ce)?Ce=ce:gr(ce)?Ce=gn(ce):Ke?(De=!1,Ce=Fv(be,!0)):Qe?(De=!1,Ce=$v(be,!0)):Ce=[]:bu(be)||ka(be)?(Ce=ce,ka(ce)?Ce=Ly(ce):(!cr(ce)||jo(ce))&&(Ce=iy(be))):De=!1}De&&(re.set(be,Ce),U(Ce,be,M,j,re),re.delete(be)),Up(a,p,Ce)}o(RS,"baseMergeDeep");function Cv(a,c){var p=a.length;if(!!p)return c+=c<0?p:0,Ko(c,p)?a[c]:r}o(Cv,"baseNth");function kv(a,c,p){c.length?c=fr(c,function(j){return yt(j)?function(re){return Ma(re,j.length===1?j[0]:j)}:j}):c=[xn];var M=-1;c=fr(c,Nn(Xe()));var U=Sv(a,function(j,re,ce){var be=fr(c,function(Te){return Te(j)});return{criteria:be,index:++M,value:j}});return oA(U,function(j,re){return jS(j,re,p)})}o(kv,"baseOrderBy");function OS(a,c){return Iv(a,c,function(p,M){return xm(a,M)})}o(OS,"basePick");function Iv(a,c,p){for(var M=-1,U=c.length,j={};++M<U;){var re=c[M],ce=Ma(a,re);p(ce,re)&&hu(j,ks(re,a),ce)}return j}o(Iv,"basePickBy");function NS(a){return function(c){return Ma(c,a)}}o(NS,"basePropertyDeep");function Vp(a,c,p,M){var U=M?iA:Rf,j=-1,re=c.length,ce=a;for(a===c&&(c=gn(c)),p&&(ce=fr(a,Nn(p)));++j<re;)for(var be=0,Te=c[j],Ce=p?p(Te):Te;(be=U(ce,Ce,be,M))>-1;)ce!==a&&Ql.call(ce,be,1),Ql.call(a,be,1);return a}o(Vp,"basePullAll");function Dv(a,c){for(var p=a?c.length:0,M=p-1;p--;){var U=c[p];if(p==M||U!==j){var j=U;Ko(U)?Ql.call(a,U,1):Xp(a,U)}}return a}o(Dv,"basePullAt");function Wp(a,c){return a+rh(lv()*(c-a+1))}o(Wp,"baseRandom");function PS(a,c,p,M){for(var U=-1,j=Er(th((c-a)/(p||1)),0),re=xe(j);j--;)re[M?j:++U]=a,a+=p;return re}o(PS,"baseRange");function Jp(a,c){var p="";if(!a||c<1||c>_)return p;do c%2&&(p+=a),c=rh(c/2),c&&(a+=a);while(c);return p}o(Jp,"baseRepeat");function Mt(a,c){return hm(ay(a,c,xn),a+"")}o(Mt,"baseRest");function LS(a){return pv(zf(a))}o(LS,"baseSample");function BS(a,c){var p=zf(a);return yh(p,Sa(c,0,p.length))}o(BS,"baseSampleSize");function hu(a,c,p,M){if(!cr(a))return a;c=ks(c,a);for(var U=-1,j=c.length,re=j-1,ce=a;ce!=null&&++U<j;){var be=ao(c[U]),Te=p;if(be==="__proto__"||be==="constructor"||be==="prototype")return a;if(U!=re){var Ce=ce[be];Te=M?M(Ce,be,ce):r,Te===r&&(Te=cr(Ce)?Ce:Ko(c[U+1])?[]:{})}fu(ce,be,Te),ce=ce[be]}return a}o(hu,"baseSet");var Rv=nh?function(a,c){return nh.set(a,c),a}:xn,US=eh?function(a,c){return eh(a,"toString",{configurable:!0,enumerable:!1,value:_m(c),writable:!0})}:xn;function FS(a){return yh(zf(a))}o(FS,"baseShuffle");function li(a,c,p){var M=-1,U=a.length;c<0&&(c=-c>U?0:U+c),p=p>U?U:p,p<0&&(p+=U),U=c>p?0:p-c>>>0,c>>>=0;for(var j=xe(U);++M<U;)j[M]=a[M+c];return j}o(li,"baseSlice");function $S(a,c){var p;return Ts(a,function(M,U,j){return p=c(M,U,j),!p}),!!p}o($S,"baseSome");function uh(a,c,p){var M=0,U=a==null?M:a.length;if(typeof c=="number"&&c===c&&U<=P){for(;M<U;){var j=M+U>>>1,re=a[j];re!==null&&!Ln(re)&&(p?re<=c:re<c)?M=j+1:U=j}return U}return Yp(a,c,xn,p)}o(uh,"baseSortedIndex");function Yp(a,c,p,M){var U=0,j=a==null?0:a.length;if(j===0)return 0;c=p(c);for(var re=c!==c,ce=c===null,be=Ln(c),Te=c===r;U<j;){var Ce=rh((U+j)/2),De=p(a[Ce]),Be=De!==r,Ke=De===null,Qe=De===De,Et=Ln(De);if(re)var et=M||Qe;else Te?et=Qe&&(M||Be):ce?et=Qe&&Be&&(M||!Ke):be?et=Qe&&Be&&!Ke&&(M||!Et):Ke||Et?et=!1:et=M?De<=c:De<c;et?U=Ce+1:j=Ce}return Vr(j,T)}o(Yp,"baseSortedIndexBy");function Ov(a,c){for(var p=-1,M=a.length,U=0,j=[];++p<M;){var re=a[p],ce=c?c(re):re;if(!p||!Pi(ce,be)){var be=ce;j[U++]=re===0?0:re}}return j}o(Ov,"baseSortedUniq");function Nv(a){return typeof a=="number"?a:Ln(a)?A:+a}o(Nv,"baseToNumber");function Pn(a){if(typeof a=="string")return a;if(yt(a))return fr(a,Pn)+"";if(Ln(a))return hv?hv.call(a):"";var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(Pn,"baseToString");function Cs(a,c,p){var M=-1,U=zl,j=a.length,re=!0,ce=[],be=ce;if(p)re=!1,U=Sp;else if(j>=t){var Te=c?null:XS(a);if(Te)return jl(Te);re=!1,U=ru,be=new Aa}else be=c?[]:ce;e:for(;++M<j;){var Ce=a[M],De=c?c(Ce):Ce;if(Ce=p||Ce!==0?Ce:0,re&&De===De){for(var Be=be.length;Be--;)if(be[Be]===De)continue e;c&&be.push(De),ce.push(Ce)}else U(be,De,p)||(be!==ce&&be.push(De),ce.push(Ce))}return ce}o(Cs,"baseUniq");function Xp(a,c){return c=ks(c,a),a=fy(a,c),a==null||delete a[ao(hi(c))]}o(Xp,"baseUnset");function Pv(a,c,p,M){return hu(a,c,p(Ma(a,c)),M)}o(Pv,"baseUpdate");function lh(a,c,p,M){for(var U=a.length,j=M?U:-1;(M?j--:++j<U)&&c(a[j],j,a););return p?li(a,M?0:j,M?j+1:U):li(a,M?j+1:0,M?U:j)}o(lh,"baseWhile");function Lv(a,c){var p=a;return p instanceof Rt&&(p=p.value()),Mp(c,function(M,U){return U.func.apply(U.thisArg,Es([M],U.args))},p)}o(Lv,"baseWrapperValue");function Zp(a,c,p){var M=a.length;if(M<2)return M?Cs(a[0]):[];for(var U=-1,j=xe(M);++U<M;)for(var re=a[U],ce=-1;++ce<M;)ce!=U&&(j[U]=cu(j[U]||re,a[ce],c,p));return Cs(Fr(j,1),c,p)}o(Zp,"baseXor");function Bv(a,c,p){for(var M=-1,U=a.length,j=c.length,re={};++M<U;){var ce=M<j?c[M]:r;p(re,a[M],ce)}return re}o(Bv,"baseZipObject");function Qp(a){return gr(a)?a:[]}o(Qp,"castArrayLikeObject");function em(a){return typeof a=="function"?a:xn}o(em,"castFunction");function ks(a,c){return yt(a)?a:cm(a,c)?[a]:hy(jt(a))}o(ks,"castPath");var qS=Mt;function Is(a,c,p){var M=a.length;return p=p===r?M:p,!c&&p>=M?a:li(a,c,p)}o(Is,"castSlice");var Uv=CA||function(a){return Mr.clearTimeout(a)};function Fv(a,c){if(c)return a.slice();var p=a.length,M=sv?sv(p):new a.constructor(p);return a.copy(M),M}o(Fv,"cloneBuffer");function tm(a){var c=new a.constructor(a.byteLength);return new Xl(c).set(new Xl(a)),c}o(tm,"cloneArrayBuffer");function HS(a,c){var p=c?tm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}o(HS,"cloneDataView");function zS(a){var c=new a.constructor(a.source,rt.exec(a));return c.lastIndex=a.lastIndex,c}o(zS,"cloneRegExp");function KS(a){return au?Qt(au.call(a)):{}}o(KS,"cloneSymbol");function $v(a,c){var p=c?tm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}o($v,"cloneTypedArray");function qv(a,c){if(a!==c){var p=a!==r,M=a===null,U=a===a,j=Ln(a),re=c!==r,ce=c===null,be=c===c,Te=Ln(c);if(!ce&&!Te&&!j&&a>c||j&&re&&be&&!ce&&!Te||M&&re&&be||!p&&be||!U)return 1;if(!M&&!j&&!Te&&a<c||Te&&p&&U&&!M&&!j||ce&&p&&U||!re&&U||!be)return-1}return 0}o(qv,"compareAscending");function jS(a,c,p){for(var M=-1,U=a.criteria,j=c.criteria,re=U.length,ce=p.length;++M<re;){var be=qv(U[M],j[M]);if(be){if(M>=ce)return be;var Te=p[M];return be*(Te=="desc"?-1:1)}}return a.index-c.index}o(jS,"compareMultiple");function Hv(a,c,p,M){for(var U=-1,j=a.length,re=p.length,ce=-1,be=c.length,Te=Er(j-re,0),Ce=xe(be+Te),De=!M;++ce<be;)Ce[ce]=c[ce];for(;++U<re;)(De||U<j)&&(Ce[p[U]]=a[U]);for(;Te--;)Ce[ce++]=a[U++];return Ce}o(Hv,"composeArgs");function zv(a,c,p,M){for(var U=-1,j=a.length,re=-1,ce=p.length,be=-1,Te=c.length,Ce=Er(j-ce,0),De=xe(Ce+Te),Be=!M;++U<Ce;)De[U]=a[U];for(var Ke=U;++be<Te;)De[Ke+be]=c[be];for(;++re<ce;)(Be||U<j)&&(De[Ke+p[re]]=a[U++]);return De}o(zv,"composeArgsRight");function gn(a,c){var p=-1,M=a.length;for(c||(c=xe(M));++p<M;)c[p]=a[p];return c}o(gn,"copyArray");function so(a,c,p,M){var U=!p;p||(p={});for(var j=-1,re=c.length;++j<re;){var ce=c[j],be=M?M(p[ce],a[ce],ce,p,a):r;be===r&&(be=a[ce]),U?qo(p,ce,be):fu(p,ce,be)}return p}o(so,"copyObject");function GS(a,c){return so(a,fm(a),c)}o(GS,"copySymbols");function VS(a,c){return so(a,ry(a),c)}o(VS,"copySymbolsIn");function hh(a,c){return function(p,M){var U=yt(p)?Z7:mS,j=c?c():{};return U(p,a,Xe(M,2),j)}}o(hh,"createAggregator");function Ff(a){return Mt(function(c,p){var M=-1,U=p.length,j=U>1?p[U-1]:r,re=U>2?p[2]:r;for(j=a.length>3&&typeof j=="function"?(U--,j):r,re&&fn(p[0],p[1],re)&&(j=U<3?r:j,U=1),c=Qt(c);++M<U;){var ce=p[M];ce&&a(c,ce,M,j)}return c})}o(Ff,"createAssigner");function Kv(a,c){return function(p,M){if(p==null)return p;if(!vn(p))return a(p,M);for(var U=p.length,j=c?U:-1,re=Qt(p);(c?j--:++j<U)&&M(re[j],j,re)!==!1;);return p}}o(Kv,"createBaseEach");function jv(a){return function(c,p,M){for(var U=-1,j=Qt(c),re=M(c),ce=re.length;ce--;){var be=re[a?ce:++U];if(p(j[be],be,j)===!1)break}return c}}o(jv,"createBaseFor");function WS(a,c,p){var M=c&I,U=du(a);function j(){var re=this&&this!==Mr&&this instanceof j?U:a;return re.apply(M?p:this,arguments)}return o(j,"wrapper"),j}o(WS,"createBind");function Gv(a){return function(c){c=jt(c);var p=Of(c)?Oi(c):r,M=p?p[0]:c.charAt(0),U=p?Is(p,1).join(""):c.slice(1);return M[a]()+U}}o(Gv,"createCaseFirst");function $f(a){return function(c){return Mp(Ky(zy(c).replace(U7,"")),a,"")}}o($f,"createCompounder");function du(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Uf(a.prototype),M=a.apply(p,c);return cr(M)?M:p}}o(du,"createCtor");function JS(a,c,p){var M=du(a);function U(){for(var j=arguments.length,re=xe(j),ce=j,be=qf(U);ce--;)re[ce]=arguments[ce];var Te=j<3&&re[0]!==be&&re[j-1]!==be?[]:As(re,be);if(j-=Te.length,j<p)return Xv(a,c,dh,U.placeholder,r,re,Te,r,r,p-j);var Ce=this&&this!==Mr&&this instanceof U?M:a;return On(Ce,this,re)}return o(U,"wrapper"),U}o(JS,"createCurry");function Vv(a){return function(c,p,M){var U=Qt(c);if(!vn(c)){var j=Xe(p,3);c=Tr(c),p=o(function(ce){return j(U[ce],ce,U)},"predicate")}var re=a(c,p,M);return re>-1?U[j?c[re]:re]:r}}o(Vv,"createFind");function Wv(a){return zo(function(c){var p=c.length,M=p,U=ci.prototype.thru;for(a&&c.reverse();M--;){var j=c[M];if(typeof j!="function")throw new fi(i);if(U&&!re&&gh(j)=="wrapper")var re=new ci([],!0)}for(M=re?M:p;++M<p;){j=c[M];var ce=gh(j),be=ce=="wrapper"?sm(j):r;be&&um(be[0])&&be[1]==(ie|L|ee|G)&&!be[4].length&&be[9]==1?re=re[gh(be[0])].apply(re,be[3]):re=j.length==1&&um(j)?re[ce]():re.thru(j)}return function(){var Te=arguments,Ce=Te[0];if(re&&Te.length==1&&yt(Ce))return re.plant(Ce).value();for(var De=0,Be=p?c[De].apply(this,Te):Ce;++De<p;)Be=c[De].call(this,Be);return Be}})}o(Wv,"createFlow");function dh(a,c,p,M,U,j,re,ce,be,Te){var Ce=c&ie,De=c&I,Be=c&N,Ke=c&(L|J),Qe=c&$,Et=Be?r:du(a);function et(){for(var kt=arguments.length,Nt=xe(kt),Bn=kt;Bn--;)Nt[Bn]=arguments[Bn];if(Ke)var cn=qf(et),Un=aA(Nt,cn);if(M&&(Nt=Hv(Nt,M,U,Ke)),j&&(Nt=zv(Nt,j,re,Ke)),kt-=Un,Ke&&kt<Te){var vr=As(Nt,cn);return Xv(a,c,dh,et.placeholder,p,Nt,vr,ce,be,Te-kt)}var Li=De?p:this,Vo=Be?Li[a]:a;return kt=Nt.length,ce?Nt=mM(Nt,ce):Qe&&kt>1&&Nt.reverse(),Ce&&be<kt&&(Nt.length=be),this&&this!==Mr&&this instanceof et&&(Vo=Et||du(Vo)),Vo.apply(Li,Nt)}return o(et,"wrapper"),et}o(dh,"createHybrid");function Jv(a,c){return function(p,M){return ES(p,a,c(M),{})}}o(Jv,"createInverter");function ph(a,c){return function(p,M){var U;if(p===r&&M===r)return c;if(p!==r&&(U=p),M!==r){if(U===r)return M;typeof p=="string"||typeof M=="string"?(p=Pn(p),M=Pn(M)):(p=Nv(p),M=Nv(M)),U=a(p,M)}return U}}o(ph,"createMathOperation");function rm(a){return zo(function(c){return c=fr(c,Nn(Xe())),Mt(function(p){var M=this;return a(c,function(U){return On(U,M,p)})})})}o(rm,"createOver");function mh(a,c){c=c===r?" ":Pn(c);var p=c.length;if(p<2)return p?Jp(c,a):c;var M=Jp(c,th(a/Nf(c)));return Of(c)?Is(Oi(M),0,a).join(""):M.slice(0,a)}o(mh,"createPadding");function YS(a,c,p,M){var U=c&I,j=du(a);function re(){for(var ce=-1,be=arguments.length,Te=-1,Ce=M.length,De=xe(Ce+be),Be=this&&this!==Mr&&this instanceof re?j:a;++Te<Ce;)De[Te]=M[Te];for(;be--;)De[Te++]=arguments[++ce];return On(Be,U?p:this,De)}return o(re,"wrapper"),re}o(YS,"createPartial");function Yv(a){return function(c,p,M){return M&&typeof M!="number"&&fn(c,p,M)&&(p=M=r),c=Go(c),p===r?(p=c,c=0):p=Go(p),M=M===r?c<p?1:-1:Go(M),PS(c,p,M,a)}}o(Yv,"createRange");function bh(a){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=di(c),p=di(p)),a(c,p)}}o(bh,"createRelationalOperation");function Xv(a,c,p,M,U,j,re,ce,be,Te){var Ce=c&L,De=Ce?re:r,Be=Ce?r:re,Ke=Ce?j:r,Qe=Ce?r:j;c|=Ce?ee:Y,c&=~(Ce?Y:ee),c&X||(c&=~(I|N));var Et=[a,c,U,Ke,De,Qe,Be,ce,be,Te],et=p.apply(r,Et);return um(a)&&cy(et,Et),et.placeholder=M,uy(et,a,c)}o(Xv,"createRecurry");function nm(a){var c=_r[a];return function(p,M){if(p=di(p),M=M==null?0:Vr(_t(M),292),M&&uv(p)){var U=(jt(p)+"e").split("e"),j=c(U[0]+"e"+(+U[1]+M));return U=(jt(j)+"e").split("e"),+(U[0]+"e"+(+U[1]-M))}return c(p)}}o(nm,"createRound");var XS=Lf&&1/jl(new Lf([,-0]))[1]==m?function(a){return new Lf(a)}:Sm;function Zv(a){return function(c){var p=Wr(c);return p==ae?Op(c):p==W?pA(c):sA(c,a(c))}}o(Zv,"createToPairs");function Ho(a,c,p,M,U,j,re,ce){var be=c&N;if(!be&&typeof a!="function")throw new fi(i);var Te=M?M.length:0;if(Te||(c&=~(ee|Y),M=U=r),re=re===r?re:Er(_t(re),0),ce=ce===r?ce:_t(ce),Te-=U?U.length:0,c&Y){var Ce=M,De=U;M=U=r}var Be=be?r:sm(a),Ke=[a,c,p,M,U,Ce,De,j,re,ce];if(Be&&hM(Ke,Be),a=Ke[0],c=Ke[1],p=Ke[2],M=Ke[3],U=Ke[4],ce=Ke[9]=Ke[9]===r?be?0:a.length:Er(Ke[9]-Te,0),!ce&&c&(L|J)&&(c&=~(L|J)),!c||c==I)var Qe=WS(a,c,p);else c==L||c==J?Qe=JS(a,c,ce):(c==ee||c==(I|ee))&&!U.length?Qe=YS(a,c,p,M):Qe=dh.apply(r,Ke);var Et=Be?Rv:cy;return uy(Et(Qe,Ke),a,c)}o(Ho,"createWrap");function Qv(a,c,p,M){return a===r||Pi(a,Pf[p])&&!Wt.call(M,p)?c:a}o(Qv,"customDefaultsAssignIn");function ey(a,c,p,M,U,j){return cr(a)&&cr(c)&&(j.set(c,a),ch(a,c,r,ey,j),j.delete(c)),a}o(ey,"customDefaultsMerge");function ZS(a){return bu(a)?r:a}o(ZS,"customOmitClone");function ty(a,c,p,M,U,j){var re=p&O,ce=a.length,be=c.length;if(ce!=be&&!(re&&be>ce))return!1;var Te=j.get(a),Ce=j.get(c);if(Te&&Ce)return Te==c&&Ce==a;var De=-1,Be=!0,Ke=p&R?new Aa:r;for(j.set(a,c),j.set(c,a);++De<ce;){var Qe=a[De],Et=c[De];if(M)var et=re?M(Et,Qe,De,c,a,j):M(Qe,Et,De,a,c,j);if(et!==r){if(et)continue;Be=!1;break}if(Ke){if(!Tp(c,function(kt,Nt){if(!ru(Ke,Nt)&&(Qe===kt||U(Qe,kt,p,M,j)))return Ke.push(Nt)})){Be=!1;break}}else if(!(Qe===Et||U(Qe,Et,p,M,j))){Be=!1;break}}return j.delete(a),j.delete(c),Be}o(ty,"equalArrays");function QS(a,c,p,M,U,j,re){switch(p){case le:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case br:return!(a.byteLength!=c.byteLength||!j(new Xl(a),new Xl(c)));case Q:case se:case Ae:return Pi(+a,+c);case z:return a.name==c.name&&a.message==c.message;case ve:case pe:return a==c+"";case ae:var ce=Op;case W:var be=M&O;if(ce||(ce=jl),a.size!=c.size&&!be)return!1;var Te=re.get(a);if(Te)return Te==c;M|=R,re.set(a,c);var Ce=ty(ce(a),ce(c),M,U,j,re);return re.delete(a),Ce;case ke:if(au)return au.call(a)==au.call(c)}return!1}o(QS,"equalByTag");function eM(a,c,p,M,U,j){var re=p&O,ce=im(a),be=ce.length,Te=im(c),Ce=Te.length;if(be!=Ce&&!re)return!1;for(var De=be;De--;){var Be=ce[De];if(!(re?Be in c:Wt.call(c,Be)))return!1}var Ke=j.get(a),Qe=j.get(c);if(Ke&&Qe)return Ke==c&&Qe==a;var Et=!0;j.set(a,c),j.set(c,a);for(var et=re;++De<be;){Be=ce[De];var kt=a[Be],Nt=c[Be];if(M)var Bn=re?M(Nt,kt,Be,c,a,j):M(kt,Nt,Be,a,c,j);if(!(Bn===r?kt===Nt||U(kt,Nt,p,M,j):Bn)){Et=!1;break}et||(et=Be=="constructor")}if(Et&&!et){var cn=a.constructor,Un=c.constructor;cn!=Un&&"constructor"in a&&"constructor"in c&&!(typeof cn=="function"&&cn instanceof cn&&typeof Un=="function"&&Un instanceof Un)&&(Et=!1)}return j.delete(a),j.delete(c),Et}o(eM,"equalObjects");function zo(a){return hm(ay(a,r,by),a+"")}o(zo,"flatRest");function im(a){return wv(a,Tr,fm)}o(im,"getAllKeys");function om(a){return wv(a,yn,ry)}o(om,"getAllKeysIn");var sm=nh?function(a){return nh.get(a)}:Sm;function gh(a){for(var c=a.name+"",p=Bf[c],M=Wt.call(Bf,c)?p.length:0;M--;){var U=p[M],j=U.func;if(j==null||j==a)return U.name}return c}o(gh,"getFuncName");function qf(a){var c=Wt.call(q,"placeholder")?q:a;return c.placeholder}o(qf,"getHolder");function Xe(){var a=q.iteratee||Em;return a=a===Em?Av:a,arguments.length?a(arguments[0],arguments[1]):a}o(Xe,"getIteratee");function vh(a,c){var p=a.__data__;return fM(c)?p[typeof c=="string"?"string":"hash"]:p.map}o(vh,"getMapData");function am(a){for(var c=Tr(a),p=c.length;p--;){var M=c[p],U=a[M];c[p]=[M,U,oy(U)]}return c}o(am,"getMatchData");function Ta(a,c){var p=lA(a,c);return Ev(p)?p:r}o(Ta,"getNative");function tM(a){var c=Wt.call(a,_a),p=a[_a];try{a[_a]=r;var M=!0}catch{}var U=Jl.call(a);return M&&(c?a[_a]=p:delete a[_a]),U}o(tM,"getRawTag");var fm=Pp?function(a){return a==null?[]:(a=Qt(a),_s(Pp(a),function(c){return fv.call(a,c)}))}:Mm,ry=Pp?function(a){for(var c=[];a;)Es(c,fm(a)),a=Zl(a);return c}:Mm,Wr=an;(Lp&&Wr(new Lp(new ArrayBuffer(1)))!=le||iu&&Wr(new iu)!=ae||Bp&&Wr(Bp.resolve())!=Me||Lf&&Wr(new Lf)!=W||ou&&Wr(new ou)!=Ne)&&(Wr=o(function(a){var c=an(a),p=c==ne?a.constructor:r,M=p?Ca(p):"";if(M)switch(M){case BA:return le;case UA:return ae;case FA:return Me;case $A:return W;case qA:return Ne}return c},"getTag"));function rM(a,c,p){for(var M=-1,U=p.length;++M<U;){var j=p[M],re=j.size;switch(j.type){case"drop":a+=re;break;case"dropRight":c-=re;break;case"take":c=Vr(c,a+re);break;case"takeRight":a=Er(a,c-re);break}}return{start:a,end:c}}o(rM,"getView");function nM(a){var c=a.match(lt);return c?c[1].split(ni):[]}o(nM,"getWrapDetails");function ny(a,c,p){c=ks(c,a);for(var M=-1,U=c.length,j=!1;++M<U;){var re=ao(c[M]);if(!(j=a!=null&&p(a,re)))break;a=a[re]}return j||++M!=U?j:(U=a==null?0:a.length,!!U&&Sh(U)&&Ko(re,U)&&(yt(a)||ka(a)))}o(ny,"hasPath");function iM(a){var c=a.length,p=new a.constructor(c);return c&&typeof a[0]=="string"&&Wt.call(a,"index")&&(p.index=a.index,p.input=a.input),p}o(iM,"initCloneArray");function iy(a){return typeof a.constructor=="function"&&!pu(a)?Uf(Zl(a)):{}}o(iy,"initCloneObject");function oM(a,c,p){var M=a.constructor;switch(c){case br:return tm(a);case Q:case se:return new M(+a);case le:return HS(a,p);case oe:case F:case Z:case me:case ye:case we:case Ie:case Dt:case Fe:return $v(a,p);case ae:return new M;case Ae:case pe:return new M(a);case ve:return zS(a);case W:return new M;case ke:return KS(a)}}o(oM,"initCloneByTag");function sM(a,c){var p=c.length;if(!p)return a;var M=p-1;return c[M]=(p>1?"& ":"")+c[M],c=c.join(p>2?", ":" "),a.replace(ut,`{
1
+ "use strict";var kI=Object.create;var gu=Object.defineProperty;var II=Object.getOwnPropertyDescriptor;var DI=Object.getOwnPropertyNames;var RI=Object.getPrototypeOf,OI=Object.prototype.hasOwnProperty;var o=(r,e)=>gu(r,"name",{value:e,configurable:!0});var Gt=(r,e)=>()=>(r&&(e=r(r=0)),e);var Re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Yt=(r,e)=>{for(var t in e)gu(r,t,{get:e[t],enumerable:!0})},Wy=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of DI(e))!OI.call(r,i)&&i!==t&&gu(r,i,{get:()=>e[i],enumerable:!(n=II(e,i))||n.enumerable});return r};var Bt=(r,e,t)=>(t=r!=null?kI(RI(r)):{},Wy(e||!r||!r.__esModule?gu(t,"default",{value:r,enumerable:!0}):t,r)),Ch=r=>Wy(gu({},"__esModule",{value:!0}),r);var Jy=Re((Kf,vu)=>{(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",g=1,y=2,E=4,O=1,R=2,I=1,P=2,X=4,B=8,J=16,ee=32,Y=64,ie=128,G=256,$=512,K=30,he="...",C=800,h=16,x=1,b=2,l=3,m=1/0,_=9007199254740991,S=17976931348623157e292,A=0/0,v=4294967295,T=v-1,L=v>>>1,w=[["ary",ie],["bind",I],["bindKey",P],["curry",B],["curryRight",J],["flip",$],["partial",ee],["partialRight",Y],["rearg",G]],k="[object Arguments]",fe="[object Array]",D="[object AsyncFunction]",Q="[object Boolean]",se="[object Date]",H="[object DOMException]",z="[object Error]",V="[object Function]",te="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",ne="[object Object]",Me="[object Promise]",ue="[object Proxy]",ve="[object RegExp]",W="[object Set]",pe="[object String]",ke="[object Symbol]",ze="[object Undefined]",Ne="[object WeakMap]",We="[object WeakSet]",br="[object ArrayBuffer]",le="[object DataView]",oe="[object Float32Array]",F="[object Float64Array]",Z="[object Int8Array]",me="[object Int16Array]",ye="[object Int32Array]",we="[object Uint8Array]",Ie="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Fe="[object Uint32Array]",Oe=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Ge=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ye=/&(?:amp|lt|gt|quot|#39);/g,Dn=/[&<>"']/g,it=RegExp(Ye.source),ot=RegExp(Dn.source),ei=/<%-([\s\S]+?)%>/g,st=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,ti=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,at=/^\w*$/,ft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hn=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(hn.source),Ze=/^\s+/,ri=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ni=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/[()=,{}\[\]\/\s]/,ii=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,Rn=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Ht=/^\[object .+?Constructor\]$/,dn=/^0o[0-7]+$/i,pn=/^(?:0|[1-9]\d*)$/,mn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ur=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,oi="\\ud800-\\udfff",Ro="\\u0300-\\u036f",Oo="\\ufe20-\\ufe2f",No="\\u20d0-\\u20ff",ro=Ro+Oo+No,no="\\u2700-\\u27bf",io="a-z\\xdf-\\xf6\\xf8-\\xff",Po="\\xac\\xb1\\xd7\\xf7",Lo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bo="\\u2000-\\u206f",Uo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Cf="A-Z\\xc0-\\xd6\\xd8-\\xde",kf="\\ufe0e\\ufe0f",If=Po+Lo+Bo+Uo,vp="['\u2019]",k7="["+oi+"]",k2="["+If+"]",Hl="["+ro+"]",I2="\\d+",I7="["+no+"]",D2="["+io+"]",R2="[^"+oi+If+I2+no+io+Cf+"]",yp="\\ud83c[\\udffb-\\udfff]",D7="(?:"+Hl+"|"+yp+")",O2="[^"+oi+"]",xp="(?:\\ud83c[\\udde6-\\uddff]){2}",wp="[\\ud800-\\udbff][\\udc00-\\udfff]",Df="["+Cf+"]",N2="\\u200d",P2="(?:"+D2+"|"+R2+")",R7="(?:"+Df+"|"+R2+")",L2="(?:"+vp+"(?:d|ll|m|re|s|t|ve))?",B2="(?:"+vp+"(?:D|LL|M|RE|S|T|VE))?",U2=D7+"?",F2="["+kf+"]?",O7="(?:"+N2+"(?:"+[O2,xp,wp].join("|")+")"+F2+U2+")*",N7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",P7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$2=F2+U2+O7,L7="(?:"+[I7,xp,wp].join("|")+")"+$2,B7="(?:"+[O2+Hl+"?",Hl,xp,wp,k7].join("|")+")",U7=RegExp(vp,"g"),F7=RegExp(Hl,"g"),_p=RegExp(yp+"(?="+yp+")|"+B7+$2,"g"),$7=RegExp([Df+"?"+D2+"+"+L2+"(?="+[k2,Df,"$"].join("|")+")",R7+"+"+B2+"(?="+[k2,Df+P2,"$"].join("|")+")",Df+"?"+P2+"+"+L2,Df+"+"+B2,P7,N7,I2,L7].join("|"),"g"),q7=RegExp("["+N2+oi+ro+kf+"]"),H7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,z7=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],K7=-1,sr={};sr[oe]=sr[F]=sr[Z]=sr[me]=sr[ye]=sr[we]=sr[Ie]=sr[Dt]=sr[Fe]=!0,sr[k]=sr[fe]=sr[br]=sr[Q]=sr[le]=sr[se]=sr[z]=sr[V]=sr[ae]=sr[Ae]=sr[ne]=sr[ve]=sr[W]=sr[pe]=sr[Ne]=!1;var rr={};rr[k]=rr[fe]=rr[br]=rr[le]=rr[Q]=rr[se]=rr[oe]=rr[F]=rr[Z]=rr[me]=rr[ye]=rr[ae]=rr[Ae]=rr[ne]=rr[ve]=rr[W]=rr[pe]=rr[ke]=rr[we]=rr[Ie]=rr[Dt]=rr[Fe]=!0,rr[z]=rr[V]=rr[Ne]=!1;var j7={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},G7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},V7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},W7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},J7=parseFloat,Y7=parseInt,q2=typeof global=="object"&&global&&global.Object===Object&&global,X7=typeof self=="object"&&self&&self.Object===Object&&self,Mr=q2||X7||Function("return this")(),Ep=typeof Kf=="object"&&Kf&&!Kf.nodeType&&Kf,wa=Ep&&typeof vu=="object"&&vu&&!vu.nodeType&&vu,H2=wa&&wa.exports===Ep,Ap=H2&&q2.process,si=function(){try{var de=wa&&wa.require&&wa.require("util").types;return de||Ap&&Ap.binding&&Ap.binding("util")}catch{}}(),z2=si&&si.isArrayBuffer,K2=si&&si.isDate,j2=si&&si.isMap,G2=si&&si.isRegExp,V2=si&&si.isSet,W2=si&&si.isTypedArray;function On(de,Ee,xe){switch(xe.length){case 0:return de.call(Ee);case 1:return de.call(Ee,xe[0]);case 2:return de.call(Ee,xe[0],xe[1]);case 3:return de.call(Ee,xe[0],xe[1],xe[2])}return de.apply(Ee,xe)}o(On,"apply");function Z7(de,Ee,xe,He){for(var gt=-1,zt=de==null?0:de.length;++gt<zt;){var _r=de[gt];Ee(He,_r,xe(_r),de)}return He}o(Z7,"arrayAggregator");function ai(de,Ee){for(var xe=-1,He=de==null?0:de.length;++xe<He&&Ee(de[xe],xe,de)!==!1;);return de}o(ai,"arrayEach");function Q7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(Q7,"arrayEachRight");function J2(de,Ee){for(var xe=-1,He=de==null?0:de.length;++xe<He;)if(!Ee(de[xe],xe,de))return!1;return!0}o(J2,"arrayEvery");function _s(de,Ee){for(var xe=-1,He=de==null?0:de.length,gt=0,zt=[];++xe<He;){var _r=de[xe];Ee(_r,xe,de)&&(zt[gt++]=_r)}return zt}o(_s,"arrayFilter");function zl(de,Ee){var xe=de==null?0:de.length;return!!xe&&Rf(de,Ee,0)>-1}o(zl,"arrayIncludes");function Sp(de,Ee,xe){for(var He=-1,gt=de==null?0:de.length;++He<gt;)if(xe(Ee,de[He]))return!0;return!1}o(Sp,"arrayIncludesWith");function fr(de,Ee){for(var xe=-1,He=de==null?0:de.length,gt=Array(He);++xe<He;)gt[xe]=Ee(de[xe],xe,de);return gt}o(fr,"arrayMap");function Es(de,Ee){for(var xe=-1,He=Ee.length,gt=de.length;++xe<He;)de[gt+xe]=Ee[xe];return de}o(Es,"arrayPush");function Mp(de,Ee,xe,He){var gt=-1,zt=de==null?0:de.length;for(He&&zt&&(xe=de[++gt]);++gt<zt;)xe=Ee(xe,de[gt],gt,de);return xe}o(Mp,"arrayReduce");function eA(de,Ee,xe,He){var gt=de==null?0:de.length;for(He&&gt&&(xe=de[--gt]);gt--;)xe=Ee(xe,de[gt],gt,de);return xe}o(eA,"arrayReduceRight");function Tp(de,Ee){for(var xe=-1,He=de==null?0:de.length;++xe<He;)if(Ee(de[xe],xe,de))return!0;return!1}o(Tp,"arraySome");var tA=Cp("length");function rA(de){return de.split("")}o(rA,"asciiToArray");function nA(de){return de.match(ht)||[]}o(nA,"asciiWords");function Y2(de,Ee,xe){var He;return xe(de,function(gt,zt,_r){if(Ee(gt,zt,_r))return He=zt,!1}),He}o(Y2,"baseFindKey");function Kl(de,Ee,xe,He){for(var gt=de.length,zt=xe+(He?1:-1);He?zt--:++zt<gt;)if(Ee(de[zt],zt,de))return zt;return-1}o(Kl,"baseFindIndex");function Rf(de,Ee,xe){return Ee===Ee?mA(de,Ee,xe):Kl(de,X2,xe)}o(Rf,"baseIndexOf");function iA(de,Ee,xe,He){for(var gt=xe-1,zt=de.length;++gt<zt;)if(He(de[gt],Ee))return gt;return-1}o(iA,"baseIndexOfWith");function X2(de){return de!==de}o(X2,"baseIsNaN");function Z2(de,Ee){var xe=de==null?0:de.length;return xe?Ip(de,Ee)/xe:A}o(Z2,"baseMean");function Cp(de){return function(Ee){return Ee==null?r:Ee[de]}}o(Cp,"baseProperty");function kp(de){return function(Ee){return de==null?r:de[Ee]}}o(kp,"basePropertyOf");function Q2(de,Ee,xe,He,gt){return gt(de,function(zt,_r,Qt){xe=He?(He=!1,zt):Ee(xe,zt,_r,Qt)}),xe}o(Q2,"baseReduce");function oA(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(oA,"baseSortBy");function Ip(de,Ee){for(var xe,He=-1,gt=de.length;++He<gt;){var zt=Ee(de[He]);zt!==r&&(xe=xe===r?zt:xe+zt)}return xe}o(Ip,"baseSum");function Dp(de,Ee){for(var xe=-1,He=Array(de);++xe<de;)He[xe]=Ee(xe);return He}o(Dp,"baseTimes");function sA(de,Ee){return fr(Ee,function(xe){return[xe,de[xe]]})}o(sA,"baseToPairs");function ev(de){return de&&de.slice(0,iv(de)+1).replace(Ze,"")}o(ev,"baseTrim");function Nn(de){return function(Ee){return de(Ee)}}o(Nn,"baseUnary");function Rp(de,Ee){return fr(Ee,function(xe){return de[xe]})}o(Rp,"baseValues");function ru(de,Ee){return de.has(Ee)}o(ru,"cacheHas");function tv(de,Ee){for(var xe=-1,He=de.length;++xe<He&&Rf(Ee,de[xe],0)>-1;);return xe}o(tv,"charsStartIndex");function rv(de,Ee){for(var xe=de.length;xe--&&Rf(Ee,de[xe],0)>-1;);return xe}o(rv,"charsEndIndex");function aA(de,Ee){for(var xe=de.length,He=0;xe--;)de[xe]===Ee&&++He;return He}o(aA,"countHolders");var fA=kp(j7),cA=kp(G7);function uA(de){return"\\"+W7[de]}o(uA,"escapeStringChar");function lA(de,Ee){return de==null?r:de[Ee]}o(lA,"getValue");function Of(de){return q7.test(de)}o(Of,"hasUnicode");function hA(de){return H7.test(de)}o(hA,"hasUnicodeWord");function dA(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(dA,"iteratorToArray");function Op(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(He,gt){xe[++Ee]=[gt,He]}),xe}o(Op,"mapToArray");function nv(de,Ee){return function(xe){return de(Ee(xe))}}o(nv,"overArg");function As(de,Ee){for(var xe=-1,He=de.length,gt=0,zt=[];++xe<He;){var _r=de[xe];(_r===Ee||_r===d)&&(de[xe]=d,zt[gt++]=xe)}return zt}o(As,"replaceHolders");function jl(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(He){xe[++Ee]=He}),xe}o(jl,"setToArray");function pA(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(He){xe[++Ee]=[He,He]}),xe}o(pA,"setToPairs");function mA(de,Ee,xe){for(var He=xe-1,gt=de.length;++He<gt;)if(de[He]===Ee)return He;return-1}o(mA,"strictIndexOf");function bA(de,Ee,xe){for(var He=xe+1;He--;)if(de[He]===Ee)return He;return He}o(bA,"strictLastIndexOf");function Nf(de){return Of(de)?vA(de):tA(de)}o(Nf,"stringSize");function Oi(de){return Of(de)?yA(de):rA(de)}o(Oi,"stringToArray");function iv(de){for(var Ee=de.length;Ee--&&ri.test(de.charAt(Ee)););return Ee}o(iv,"trimmedEndIndex");var gA=kp(V7);function vA(de){for(var Ee=_p.lastIndex=0;_p.test(de);)++Ee;return Ee}o(vA,"unicodeSize");function yA(de){return de.match(_p)||[]}o(yA,"unicodeToArray");function xA(de){return de.match($7)||[]}o(xA,"unicodeWords");var wA=o(function de(Ee){Ee=Ee==null?Mr:Ss.defaults(Mr.Object(),Ee,Ss.pick(Mr,z7));var xe=Ee.Array,He=Ee.Date,gt=Ee.Error,zt=Ee.Function,_r=Ee.Math,Qt=Ee.Object,Np=Ee.RegExp,_A=Ee.String,fi=Ee.TypeError,Gl=xe.prototype,EA=zt.prototype,Pf=Qt.prototype,Vl=Ee["__core-js_shared__"],Wl=EA.toString,Wt=Pf.hasOwnProperty,AA=0,ov=function(){var a=/[^.]+$/.exec(Vl&&Vl.keys&&Vl.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Jl=Pf.toString,SA=Wl.call(Qt),MA=Mr._,TA=Np("^"+Wl.call(Wt).replace(hn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yl=H2?Ee.Buffer:r,Ms=Ee.Symbol,Xl=Ee.Uint8Array,sv=Yl?Yl.allocUnsafe:r,Zl=nv(Qt.getPrototypeOf,Qt),av=Qt.create,fv=Pf.propertyIsEnumerable,Ql=Gl.splice,cv=Ms?Ms.isConcatSpreadable:r,nu=Ms?Ms.iterator:r,_a=Ms?Ms.toStringTag:r,eh=function(){try{var a=Ta(Qt,"defineProperty");return a({},"",{}),a}catch{}}(),CA=Ee.clearTimeout!==Mr.clearTimeout&&Ee.clearTimeout,kA=He&&He.now!==Mr.Date.now&&He.now,IA=Ee.setTimeout!==Mr.setTimeout&&Ee.setTimeout,th=_r.ceil,rh=_r.floor,Pp=Qt.getOwnPropertySymbols,DA=Yl?Yl.isBuffer:r,uv=Ee.isFinite,RA=Gl.join,OA=nv(Qt.keys,Qt),Er=_r.max,Vr=_r.min,NA=He.now,PA=Ee.parseInt,lv=_r.random,LA=Gl.reverse,Lp=Ta(Ee,"DataView"),iu=Ta(Ee,"Map"),Bp=Ta(Ee,"Promise"),Lf=Ta(Ee,"Set"),ou=Ta(Ee,"WeakMap"),su=Ta(Qt,"create"),nh=ou&&new ou,Bf={},BA=Ca(Lp),UA=Ca(iu),FA=Ca(Bp),$A=Ca(Lf),qA=Ca(ou),ih=Ms?Ms.prototype:r,au=ih?ih.valueOf:r,hv=ih?ih.toString:r;function q(a){if(ur(a)&&!yt(a)&&!(a instanceof Rt)){if(a instanceof ci)return a;if(Wt.call(a,"__wrapped__"))return dy(a)}return new ci(a)}o(q,"lodash");var Uf=function(){function a(){}return o(a,"object"),function(c){if(!cr(c))return{};if(av)return av(c);a.prototype=c;var p=new a;return a.prototype=r,p}}();function oh(){}o(oh,"baseLodash");function ci(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}o(ci,"LodashWrapper"),q.templateSettings={escape:ei,evaluate:st,interpolate:tt,variable:"",imports:{_:q}},q.prototype=oh.prototype,q.prototype.constructor=q,ci.prototype=Uf(oh.prototype),ci.prototype.constructor=ci;function Rt(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}o(Rt,"LazyWrapper");function HA(){var a=new Rt(this.__wrapped__);return a.__actions__=gn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=gn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=gn(this.__views__),a}o(HA,"lazyClone");function zA(){if(this.__filtered__){var a=new Rt(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}o(zA,"lazyReverse");function KA(){var a=this.__wrapped__.value(),c=this.__dir__,p=yt(a),M=c<0,U=p?a.length:0,j=rM(0,U,this.__views__),re=j.start,ce=j.end,be=ce-re,Te=M?ce:re-1,Ce=this.__iteratees__,De=Ce.length,Be=0,Ke=Vr(be,this.__takeCount__);if(!p||!M&&U==be&&Ke==be)return Lv(a,this.__actions__);var Qe=[];e:for(;be--&&Be<Ke;){Te+=c;for(var Et=-1,et=a[Te];++Et<De;){var kt=Ce[Et],Nt=kt.iteratee,Bn=kt.type,cn=Nt(et);if(Bn==b)et=cn;else if(!cn){if(Bn==x)continue e;break e}}Qe[Be++]=et}return Qe}o(KA,"lazyValue"),Rt.prototype=Uf(oh.prototype),Rt.prototype.constructor=Rt;function Ea(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var M=a[c];this.set(M[0],M[1])}}o(Ea,"Hash");function jA(){this.__data__=su?su(null):{},this.size=0}o(jA,"hashClear");function GA(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}o(GA,"hashDelete");function VA(a){var c=this.__data__;if(su){var p=c[a];return p===f?r:p}return Wt.call(c,a)?c[a]:r}o(VA,"hashGet");function WA(a){var c=this.__data__;return su?c[a]!==r:Wt.call(c,a)}o(WA,"hashHas");function JA(a,c){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=su&&c===r?f:c,this}o(JA,"hashSet"),Ea.prototype.clear=jA,Ea.prototype.delete=GA,Ea.prototype.get=VA,Ea.prototype.has=WA,Ea.prototype.set=JA;function Fo(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var M=a[c];this.set(M[0],M[1])}}o(Fo,"ListCache");function YA(){this.__data__=[],this.size=0}o(YA,"listCacheClear");function XA(a){var c=this.__data__,p=sh(c,a);if(p<0)return!1;var M=c.length-1;return p==M?c.pop():Ql.call(c,p,1),--this.size,!0}o(XA,"listCacheDelete");function ZA(a){var c=this.__data__,p=sh(c,a);return p<0?r:c[p][1]}o(ZA,"listCacheGet");function QA(a){return sh(this.__data__,a)>-1}o(QA,"listCacheHas");function eS(a,c){var p=this.__data__,M=sh(p,a);return M<0?(++this.size,p.push([a,c])):p[M][1]=c,this}o(eS,"listCacheSet"),Fo.prototype.clear=YA,Fo.prototype.delete=XA,Fo.prototype.get=ZA,Fo.prototype.has=QA,Fo.prototype.set=eS;function $o(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var M=a[c];this.set(M[0],M[1])}}o($o,"MapCache");function tS(){this.size=0,this.__data__={hash:new Ea,map:new(iu||Fo),string:new Ea}}o(tS,"mapCacheClear");function rS(a){var c=vh(this,a).delete(a);return this.size-=c?1:0,c}o(rS,"mapCacheDelete");function nS(a){return vh(this,a).get(a)}o(nS,"mapCacheGet");function iS(a){return vh(this,a).has(a)}o(iS,"mapCacheHas");function oS(a,c){var p=vh(this,a),M=p.size;return p.set(a,c),this.size+=p.size==M?0:1,this}o(oS,"mapCacheSet"),$o.prototype.clear=tS,$o.prototype.delete=rS,$o.prototype.get=nS,$o.prototype.has=iS,$o.prototype.set=oS;function Aa(a){var c=-1,p=a==null?0:a.length;for(this.__data__=new $o;++c<p;)this.add(a[c])}o(Aa,"SetCache");function sS(a){return this.__data__.set(a,f),this}o(sS,"setCacheAdd");function aS(a){return this.__data__.has(a)}o(aS,"setCacheHas"),Aa.prototype.add=Aa.prototype.push=sS,Aa.prototype.has=aS;function Ni(a){var c=this.__data__=new Fo(a);this.size=c.size}o(Ni,"Stack");function fS(){this.__data__=new Fo,this.size=0}o(fS,"stackClear");function cS(a){var c=this.__data__,p=c.delete(a);return this.size=c.size,p}o(cS,"stackDelete");function uS(a){return this.__data__.get(a)}o(uS,"stackGet");function lS(a){return this.__data__.has(a)}o(lS,"stackHas");function hS(a,c){var p=this.__data__;if(p instanceof Fo){var M=p.__data__;if(!iu||M.length<t-1)return M.push([a,c]),this.size=++p.size,this;p=this.__data__=new $o(M)}return p.set(a,c),this.size=p.size,this}o(hS,"stackSet"),Ni.prototype.clear=fS,Ni.prototype.delete=cS,Ni.prototype.get=uS,Ni.prototype.has=lS,Ni.prototype.set=hS;function dv(a,c){var p=yt(a),M=!p&&ka(a),U=!p&&!M&&Ds(a),j=!p&&!M&&!U&&Hf(a),re=p||M||U||j,ce=re?Dp(a.length,_A):[],be=ce.length;for(var Te in a)(c||Wt.call(a,Te))&&!(re&&(Te=="length"||U&&(Te=="offset"||Te=="parent")||j&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Ko(Te,be)))&&ce.push(Te);return ce}o(dv,"arrayLikeKeys");function pv(a){var c=a.length;return c?a[Wp(0,c-1)]:r}o(pv,"arraySample");function dS(a,c){return yh(gn(a),Sa(c,0,a.length))}o(dS,"arraySampleSize");function pS(a){return yh(gn(a))}o(pS,"arrayShuffle");function Up(a,c,p){(p!==r&&!Pi(a[c],p)||p===r&&!(c in a))&&qo(a,c,p)}o(Up,"assignMergeValue");function fu(a,c,p){var M=a[c];(!(Wt.call(a,c)&&Pi(M,p))||p===r&&!(c in a))&&qo(a,c,p)}o(fu,"assignValue");function sh(a,c){for(var p=a.length;p--;)if(Pi(a[p][0],c))return p;return-1}o(sh,"assocIndexOf");function mS(a,c,p,M){return Ts(a,function(U,j,re){c(M,U,p(U),re)}),M}o(mS,"baseAggregator");function mv(a,c){return a&&so(c,Tr(c),a)}o(mv,"baseAssign");function bS(a,c){return a&&so(c,yn(c),a)}o(bS,"baseAssignIn");function qo(a,c,p){c=="__proto__"&&eh?eh(a,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[c]=p}o(qo,"baseAssignValue");function Fp(a,c){for(var p=-1,M=c.length,U=xe(M),j=a==null;++p<M;)U[p]=j?r:ym(a,c[p]);return U}o(Fp,"baseAt");function Sa(a,c,p){return a===a&&(p!==r&&(a=a<=p?a:p),c!==r&&(a=a>=c?a:c)),a}o(Sa,"baseClamp");function ui(a,c,p,M,U,j){var re,ce=c&g,be=c&y,Te=c&E;if(p&&(re=U?p(a,M,U,j):p(a)),re!==r)return re;if(!cr(a))return a;var Ce=yt(a);if(Ce){if(re=iM(a),!ce)return gn(a,re)}else{var De=Wr(a),Be=De==V||De==te;if(Ds(a))return Fv(a,ce);if(De==ne||De==k||Be&&!U){if(re=be||Be?{}:iy(a),!ce)return be?VS(a,bS(re,a)):GS(a,mv(re,a))}else{if(!rr[De])return U?a:{};re=oM(a,De,ce)}}j||(j=new Ni);var Ke=j.get(a);if(Ke)return Ke;j.set(a,re),Oy(a)?a.forEach(function(et){re.add(ui(et,c,p,et,a,j))}):Dy(a)&&a.forEach(function(et,kt){re.set(kt,ui(et,c,p,kt,a,j))});var Qe=Te?be?om:im:be?yn:Tr,Et=Ce?r:Qe(a);return ai(Et||a,function(et,kt){Et&&(kt=et,et=a[kt]),fu(re,kt,ui(et,c,p,kt,a,j))}),re}o(ui,"baseClone");function gS(a){var c=Tr(a);return function(p){return bv(p,a,c)}}o(gS,"baseConforms");function bv(a,c,p){var M=p.length;if(a==null)return!M;for(a=Qt(a);M--;){var U=p[M],j=c[U],re=a[U];if(re===r&&!(U in a)||!j(re))return!1}return!0}o(bv,"baseConformsTo");function gv(a,c,p){if(typeof a!="function")throw new fi(i);return mu(function(){a.apply(r,p)},c)}o(gv,"baseDelay");function cu(a,c,p,M){var U=-1,j=zl,re=!0,ce=a.length,be=[],Te=c.length;if(!ce)return be;p&&(c=fr(c,Nn(p))),M?(j=Sp,re=!1):c.length>=t&&(j=ru,re=!1,c=new Aa(c));e:for(;++U<ce;){var Ce=a[U],De=p==null?Ce:p(Ce);if(Ce=M||Ce!==0?Ce:0,re&&De===De){for(var Be=Te;Be--;)if(c[Be]===De)continue e;be.push(Ce)}else j(c,De,M)||be.push(Ce)}return be}o(cu,"baseDifference");var Ts=Kv(oo),vv=Kv(qp,!0);function vS(a,c){var p=!0;return Ts(a,function(M,U,j){return p=!!c(M,U,j),p}),p}o(vS,"baseEvery");function ah(a,c,p){for(var M=-1,U=a.length;++M<U;){var j=a[M],re=c(j);if(re!=null&&(ce===r?re===re&&!Ln(re):p(re,ce)))var ce=re,be=j}return be}o(ah,"baseExtremum");function yS(a,c,p,M){var U=a.length;for(p=_t(p),p<0&&(p=-p>U?0:U+p),M=M===r||M>U?U:_t(M),M<0&&(M+=U),M=p>M?0:Py(M);p<M;)a[p++]=c;return a}o(yS,"baseFill");function yv(a,c){var p=[];return Ts(a,function(M,U,j){c(M,U,j)&&p.push(M)}),p}o(yv,"baseFilter");function Fr(a,c,p,M,U){var j=-1,re=a.length;for(p||(p=aM),U||(U=[]);++j<re;){var ce=a[j];c>0&&p(ce)?c>1?Fr(ce,c-1,p,M,U):Es(U,ce):M||(U[U.length]=ce)}return U}o(Fr,"baseFlatten");var $p=jv(),xv=jv(!0);function oo(a,c){return a&&$p(a,c,Tr)}o(oo,"baseForOwn");function qp(a,c){return a&&xv(a,c,Tr)}o(qp,"baseForOwnRight");function fh(a,c){return _s(c,function(p){return jo(a[p])})}o(fh,"baseFunctions");function Ma(a,c){c=ks(c,a);for(var p=0,M=c.length;a!=null&&p<M;)a=a[ao(c[p++])];return p&&p==M?a:r}o(Ma,"baseGet");function wv(a,c,p){var M=c(a);return yt(a)?M:Es(M,p(a))}o(wv,"baseGetAllKeys");function an(a){return a==null?a===r?ze:ge:_a&&_a in Qt(a)?tM(a):pM(a)}o(an,"baseGetTag");function Hp(a,c){return a>c}o(Hp,"baseGt");function xS(a,c){return a!=null&&Wt.call(a,c)}o(xS,"baseHas");function wS(a,c){return a!=null&&c in Qt(a)}o(wS,"baseHasIn");function _S(a,c,p){return a>=Vr(c,p)&&a<Er(c,p)}o(_S,"baseInRange");function zp(a,c,p){for(var M=p?Sp:zl,U=a[0].length,j=a.length,re=j,ce=xe(j),be=1/0,Te=[];re--;){var Ce=a[re];re&&c&&(Ce=fr(Ce,Nn(c))),be=Vr(Ce.length,be),ce[re]=!p&&(c||U>=120&&Ce.length>=120)?new Aa(re&&Ce):r}Ce=a[0];var De=-1,Be=ce[0];e:for(;++De<U&&Te.length<be;){var Ke=Ce[De],Qe=c?c(Ke):Ke;if(Ke=p||Ke!==0?Ke:0,!(Be?ru(Be,Qe):M(Te,Qe,p))){for(re=j;--re;){var Et=ce[re];if(!(Et?ru(Et,Qe):M(a[re],Qe,p)))continue e}Be&&Be.push(Qe),Te.push(Ke)}}return Te}o(zp,"baseIntersection");function ES(a,c,p,M){return oo(a,function(U,j,re){c(M,p(U),j,re)}),M}o(ES,"baseInverter");function uu(a,c,p){c=ks(c,a),a=fy(a,c);var M=a==null?a:a[ao(hi(c))];return M==null?r:On(M,a,p)}o(uu,"baseInvoke");function _v(a){return ur(a)&&an(a)==k}o(_v,"baseIsArguments");function AS(a){return ur(a)&&an(a)==br}o(AS,"baseIsArrayBuffer");function SS(a){return ur(a)&&an(a)==se}o(SS,"baseIsDate");function lu(a,c,p,M,U){return a===c?!0:a==null||c==null||!ur(a)&&!ur(c)?a!==a&&c!==c:MS(a,c,p,M,lu,U)}o(lu,"baseIsEqual");function MS(a,c,p,M,U,j){var re=yt(a),ce=yt(c),be=re?fe:Wr(a),Te=ce?fe:Wr(c);be=be==k?ne:be,Te=Te==k?ne:Te;var Ce=be==ne,De=Te==ne,Be=be==Te;if(Be&&Ds(a)){if(!Ds(c))return!1;re=!0,Ce=!1}if(Be&&!Ce)return j||(j=new Ni),re||Hf(a)?ty(a,c,p,M,U,j):QS(a,c,be,p,M,U,j);if(!(p&O)){var Ke=Ce&&Wt.call(a,"__wrapped__"),Qe=De&&Wt.call(c,"__wrapped__");if(Ke||Qe){var Et=Ke?a.value():a,et=Qe?c.value():c;return j||(j=new Ni),U(Et,et,p,M,j)}}return Be?(j||(j=new Ni),eM(a,c,p,M,U,j)):!1}o(MS,"baseIsEqualDeep");function TS(a){return ur(a)&&Wr(a)==ae}o(TS,"baseIsMap");function Kp(a,c,p,M){var U=p.length,j=U,re=!M;if(a==null)return!j;for(a=Qt(a);U--;){var ce=p[U];if(re&&ce[2]?ce[1]!==a[ce[0]]:!(ce[0]in a))return!1}for(;++U<j;){ce=p[U];var be=ce[0],Te=a[be],Ce=ce[1];if(re&&ce[2]){if(Te===r&&!(be in a))return!1}else{var De=new Ni;if(M)var Be=M(Te,Ce,be,a,c,De);if(!(Be===r?lu(Ce,Te,O|R,M,De):Be))return!1}}return!0}o(Kp,"baseIsMatch");function Ev(a){if(!cr(a)||cM(a))return!1;var c=jo(a)?TA:Ht;return c.test(Ca(a))}o(Ev,"baseIsNative");function CS(a){return ur(a)&&an(a)==ve}o(CS,"baseIsRegExp");function kS(a){return ur(a)&&Wr(a)==W}o(kS,"baseIsSet");function IS(a){return ur(a)&&Sh(a.length)&&!!sr[an(a)]}o(IS,"baseIsTypedArray");function Av(a){return typeof a=="function"?a:a==null?xn:typeof a=="object"?yt(a)?Tv(a[0],a[1]):Mv(a):Gy(a)}o(Av,"baseIteratee");function jp(a){if(!pu(a))return OA(a);var c=[];for(var p in Qt(a))Wt.call(a,p)&&p!="constructor"&&c.push(p);return c}o(jp,"baseKeys");function DS(a){if(!cr(a))return dM(a);var c=pu(a),p=[];for(var M in a)M=="constructor"&&(c||!Wt.call(a,M))||p.push(M);return p}o(DS,"baseKeysIn");function Gp(a,c){return a<c}o(Gp,"baseLt");function Sv(a,c){var p=-1,M=vn(a)?xe(a.length):[];return Ts(a,function(U,j,re){M[++p]=c(U,j,re)}),M}o(Sv,"baseMap");function Mv(a){var c=am(a);return c.length==1&&c[0][2]?sy(c[0][0],c[0][1]):function(p){return p===a||Kp(p,a,c)}}o(Mv,"baseMatches");function Tv(a,c){return cm(a)&&oy(c)?sy(ao(a),c):function(p){var M=ym(p,a);return M===r&&M===c?xm(p,a):lu(c,M,O|R)}}o(Tv,"baseMatchesProperty");function ch(a,c,p,M,U){a!==c&&$p(c,function(j,re){if(U||(U=new Ni),cr(j))RS(a,c,re,p,ch,M,U);else{var ce=M?M(lm(a,re),j,re+"",a,c,U):r;ce===r&&(ce=j),Up(a,re,ce)}},yn)}o(ch,"baseMerge");function RS(a,c,p,M,U,j,re){var ce=lm(a,p),be=lm(c,p),Te=re.get(be);if(Te){Up(a,p,Te);return}var Ce=j?j(ce,be,p+"",a,c,re):r,De=Ce===r;if(De){var Be=yt(be),Ke=!Be&&Ds(be),Qe=!Be&&!Ke&&Hf(be);Ce=be,Be||Ke||Qe?yt(ce)?Ce=ce:gr(ce)?Ce=gn(ce):Ke?(De=!1,Ce=Fv(be,!0)):Qe?(De=!1,Ce=$v(be,!0)):Ce=[]:bu(be)||ka(be)?(Ce=ce,ka(ce)?Ce=Ly(ce):(!cr(ce)||jo(ce))&&(Ce=iy(be))):De=!1}De&&(re.set(be,Ce),U(Ce,be,M,j,re),re.delete(be)),Up(a,p,Ce)}o(RS,"baseMergeDeep");function Cv(a,c){var p=a.length;if(!!p)return c+=c<0?p:0,Ko(c,p)?a[c]:r}o(Cv,"baseNth");function kv(a,c,p){c.length?c=fr(c,function(j){return yt(j)?function(re){return Ma(re,j.length===1?j[0]:j)}:j}):c=[xn];var M=-1;c=fr(c,Nn(Xe()));var U=Sv(a,function(j,re,ce){var be=fr(c,function(Te){return Te(j)});return{criteria:be,index:++M,value:j}});return oA(U,function(j,re){return jS(j,re,p)})}o(kv,"baseOrderBy");function OS(a,c){return Iv(a,c,function(p,M){return xm(a,M)})}o(OS,"basePick");function Iv(a,c,p){for(var M=-1,U=c.length,j={};++M<U;){var re=c[M],ce=Ma(a,re);p(ce,re)&&hu(j,ks(re,a),ce)}return j}o(Iv,"basePickBy");function NS(a){return function(c){return Ma(c,a)}}o(NS,"basePropertyDeep");function Vp(a,c,p,M){var U=M?iA:Rf,j=-1,re=c.length,ce=a;for(a===c&&(c=gn(c)),p&&(ce=fr(a,Nn(p)));++j<re;)for(var be=0,Te=c[j],Ce=p?p(Te):Te;(be=U(ce,Ce,be,M))>-1;)ce!==a&&Ql.call(ce,be,1),Ql.call(a,be,1);return a}o(Vp,"basePullAll");function Dv(a,c){for(var p=a?c.length:0,M=p-1;p--;){var U=c[p];if(p==M||U!==j){var j=U;Ko(U)?Ql.call(a,U,1):Xp(a,U)}}return a}o(Dv,"basePullAt");function Wp(a,c){return a+rh(lv()*(c-a+1))}o(Wp,"baseRandom");function PS(a,c,p,M){for(var U=-1,j=Er(th((c-a)/(p||1)),0),re=xe(j);j--;)re[M?j:++U]=a,a+=p;return re}o(PS,"baseRange");function Jp(a,c){var p="";if(!a||c<1||c>_)return p;do c%2&&(p+=a),c=rh(c/2),c&&(a+=a);while(c);return p}o(Jp,"baseRepeat");function Mt(a,c){return hm(ay(a,c,xn),a+"")}o(Mt,"baseRest");function LS(a){return pv(zf(a))}o(LS,"baseSample");function BS(a,c){var p=zf(a);return yh(p,Sa(c,0,p.length))}o(BS,"baseSampleSize");function hu(a,c,p,M){if(!cr(a))return a;c=ks(c,a);for(var U=-1,j=c.length,re=j-1,ce=a;ce!=null&&++U<j;){var be=ao(c[U]),Te=p;if(be==="__proto__"||be==="constructor"||be==="prototype")return a;if(U!=re){var Ce=ce[be];Te=M?M(Ce,be,ce):r,Te===r&&(Te=cr(Ce)?Ce:Ko(c[U+1])?[]:{})}fu(ce,be,Te),ce=ce[be]}return a}o(hu,"baseSet");var Rv=nh?function(a,c){return nh.set(a,c),a}:xn,US=eh?function(a,c){return eh(a,"toString",{configurable:!0,enumerable:!1,value:_m(c),writable:!0})}:xn;function FS(a){return yh(zf(a))}o(FS,"baseShuffle");function li(a,c,p){var M=-1,U=a.length;c<0&&(c=-c>U?0:U+c),p=p>U?U:p,p<0&&(p+=U),U=c>p?0:p-c>>>0,c>>>=0;for(var j=xe(U);++M<U;)j[M]=a[M+c];return j}o(li,"baseSlice");function $S(a,c){var p;return Ts(a,function(M,U,j){return p=c(M,U,j),!p}),!!p}o($S,"baseSome");function uh(a,c,p){var M=0,U=a==null?M:a.length;if(typeof c=="number"&&c===c&&U<=L){for(;M<U;){var j=M+U>>>1,re=a[j];re!==null&&!Ln(re)&&(p?re<=c:re<c)?M=j+1:U=j}return U}return Yp(a,c,xn,p)}o(uh,"baseSortedIndex");function Yp(a,c,p,M){var U=0,j=a==null?0:a.length;if(j===0)return 0;c=p(c);for(var re=c!==c,ce=c===null,be=Ln(c),Te=c===r;U<j;){var Ce=rh((U+j)/2),De=p(a[Ce]),Be=De!==r,Ke=De===null,Qe=De===De,Et=Ln(De);if(re)var et=M||Qe;else Te?et=Qe&&(M||Be):ce?et=Qe&&Be&&(M||!Ke):be?et=Qe&&Be&&!Ke&&(M||!Et):Ke||Et?et=!1:et=M?De<=c:De<c;et?U=Ce+1:j=Ce}return Vr(j,T)}o(Yp,"baseSortedIndexBy");function Ov(a,c){for(var p=-1,M=a.length,U=0,j=[];++p<M;){var re=a[p],ce=c?c(re):re;if(!p||!Pi(ce,be)){var be=ce;j[U++]=re===0?0:re}}return j}o(Ov,"baseSortedUniq");function Nv(a){return typeof a=="number"?a:Ln(a)?A:+a}o(Nv,"baseToNumber");function Pn(a){if(typeof a=="string")return a;if(yt(a))return fr(a,Pn)+"";if(Ln(a))return hv?hv.call(a):"";var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(Pn,"baseToString");function Cs(a,c,p){var M=-1,U=zl,j=a.length,re=!0,ce=[],be=ce;if(p)re=!1,U=Sp;else if(j>=t){var Te=c?null:XS(a);if(Te)return jl(Te);re=!1,U=ru,be=new Aa}else be=c?[]:ce;e:for(;++M<j;){var Ce=a[M],De=c?c(Ce):Ce;if(Ce=p||Ce!==0?Ce:0,re&&De===De){for(var Be=be.length;Be--;)if(be[Be]===De)continue e;c&&be.push(De),ce.push(Ce)}else U(be,De,p)||(be!==ce&&be.push(De),ce.push(Ce))}return ce}o(Cs,"baseUniq");function Xp(a,c){return c=ks(c,a),a=fy(a,c),a==null||delete a[ao(hi(c))]}o(Xp,"baseUnset");function Pv(a,c,p,M){return hu(a,c,p(Ma(a,c)),M)}o(Pv,"baseUpdate");function lh(a,c,p,M){for(var U=a.length,j=M?U:-1;(M?j--:++j<U)&&c(a[j],j,a););return p?li(a,M?0:j,M?j+1:U):li(a,M?j+1:0,M?U:j)}o(lh,"baseWhile");function Lv(a,c){var p=a;return p instanceof Rt&&(p=p.value()),Mp(c,function(M,U){return U.func.apply(U.thisArg,Es([M],U.args))},p)}o(Lv,"baseWrapperValue");function Zp(a,c,p){var M=a.length;if(M<2)return M?Cs(a[0]):[];for(var U=-1,j=xe(M);++U<M;)for(var re=a[U],ce=-1;++ce<M;)ce!=U&&(j[U]=cu(j[U]||re,a[ce],c,p));return Cs(Fr(j,1),c,p)}o(Zp,"baseXor");function Bv(a,c,p){for(var M=-1,U=a.length,j=c.length,re={};++M<U;){var ce=M<j?c[M]:r;p(re,a[M],ce)}return re}o(Bv,"baseZipObject");function Qp(a){return gr(a)?a:[]}o(Qp,"castArrayLikeObject");function em(a){return typeof a=="function"?a:xn}o(em,"castFunction");function ks(a,c){return yt(a)?a:cm(a,c)?[a]:hy(jt(a))}o(ks,"castPath");var qS=Mt;function Is(a,c,p){var M=a.length;return p=p===r?M:p,!c&&p>=M?a:li(a,c,p)}o(Is,"castSlice");var Uv=CA||function(a){return Mr.clearTimeout(a)};function Fv(a,c){if(c)return a.slice();var p=a.length,M=sv?sv(p):new a.constructor(p);return a.copy(M),M}o(Fv,"cloneBuffer");function tm(a){var c=new a.constructor(a.byteLength);return new Xl(c).set(new Xl(a)),c}o(tm,"cloneArrayBuffer");function HS(a,c){var p=c?tm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}o(HS,"cloneDataView");function zS(a){var c=new a.constructor(a.source,rt.exec(a));return c.lastIndex=a.lastIndex,c}o(zS,"cloneRegExp");function KS(a){return au?Qt(au.call(a)):{}}o(KS,"cloneSymbol");function $v(a,c){var p=c?tm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}o($v,"cloneTypedArray");function qv(a,c){if(a!==c){var p=a!==r,M=a===null,U=a===a,j=Ln(a),re=c!==r,ce=c===null,be=c===c,Te=Ln(c);if(!ce&&!Te&&!j&&a>c||j&&re&&be&&!ce&&!Te||M&&re&&be||!p&&be||!U)return 1;if(!M&&!j&&!Te&&a<c||Te&&p&&U&&!M&&!j||ce&&p&&U||!re&&U||!be)return-1}return 0}o(qv,"compareAscending");function jS(a,c,p){for(var M=-1,U=a.criteria,j=c.criteria,re=U.length,ce=p.length;++M<re;){var be=qv(U[M],j[M]);if(be){if(M>=ce)return be;var Te=p[M];return be*(Te=="desc"?-1:1)}}return a.index-c.index}o(jS,"compareMultiple");function Hv(a,c,p,M){for(var U=-1,j=a.length,re=p.length,ce=-1,be=c.length,Te=Er(j-re,0),Ce=xe(be+Te),De=!M;++ce<be;)Ce[ce]=c[ce];for(;++U<re;)(De||U<j)&&(Ce[p[U]]=a[U]);for(;Te--;)Ce[ce++]=a[U++];return Ce}o(Hv,"composeArgs");function zv(a,c,p,M){for(var U=-1,j=a.length,re=-1,ce=p.length,be=-1,Te=c.length,Ce=Er(j-ce,0),De=xe(Ce+Te),Be=!M;++U<Ce;)De[U]=a[U];for(var Ke=U;++be<Te;)De[Ke+be]=c[be];for(;++re<ce;)(Be||U<j)&&(De[Ke+p[re]]=a[U++]);return De}o(zv,"composeArgsRight");function gn(a,c){var p=-1,M=a.length;for(c||(c=xe(M));++p<M;)c[p]=a[p];return c}o(gn,"copyArray");function so(a,c,p,M){var U=!p;p||(p={});for(var j=-1,re=c.length;++j<re;){var ce=c[j],be=M?M(p[ce],a[ce],ce,p,a):r;be===r&&(be=a[ce]),U?qo(p,ce,be):fu(p,ce,be)}return p}o(so,"copyObject");function GS(a,c){return so(a,fm(a),c)}o(GS,"copySymbols");function VS(a,c){return so(a,ry(a),c)}o(VS,"copySymbolsIn");function hh(a,c){return function(p,M){var U=yt(p)?Z7:mS,j=c?c():{};return U(p,a,Xe(M,2),j)}}o(hh,"createAggregator");function Ff(a){return Mt(function(c,p){var M=-1,U=p.length,j=U>1?p[U-1]:r,re=U>2?p[2]:r;for(j=a.length>3&&typeof j=="function"?(U--,j):r,re&&fn(p[0],p[1],re)&&(j=U<3?r:j,U=1),c=Qt(c);++M<U;){var ce=p[M];ce&&a(c,ce,M,j)}return c})}o(Ff,"createAssigner");function Kv(a,c){return function(p,M){if(p==null)return p;if(!vn(p))return a(p,M);for(var U=p.length,j=c?U:-1,re=Qt(p);(c?j--:++j<U)&&M(re[j],j,re)!==!1;);return p}}o(Kv,"createBaseEach");function jv(a){return function(c,p,M){for(var U=-1,j=Qt(c),re=M(c),ce=re.length;ce--;){var be=re[a?ce:++U];if(p(j[be],be,j)===!1)break}return c}}o(jv,"createBaseFor");function WS(a,c,p){var M=c&I,U=du(a);function j(){var re=this&&this!==Mr&&this instanceof j?U:a;return re.apply(M?p:this,arguments)}return o(j,"wrapper"),j}o(WS,"createBind");function Gv(a){return function(c){c=jt(c);var p=Of(c)?Oi(c):r,M=p?p[0]:c.charAt(0),U=p?Is(p,1).join(""):c.slice(1);return M[a]()+U}}o(Gv,"createCaseFirst");function $f(a){return function(c){return Mp(Ky(zy(c).replace(U7,"")),a,"")}}o($f,"createCompounder");function du(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Uf(a.prototype),M=a.apply(p,c);return cr(M)?M:p}}o(du,"createCtor");function JS(a,c,p){var M=du(a);function U(){for(var j=arguments.length,re=xe(j),ce=j,be=qf(U);ce--;)re[ce]=arguments[ce];var Te=j<3&&re[0]!==be&&re[j-1]!==be?[]:As(re,be);if(j-=Te.length,j<p)return Xv(a,c,dh,U.placeholder,r,re,Te,r,r,p-j);var Ce=this&&this!==Mr&&this instanceof U?M:a;return On(Ce,this,re)}return o(U,"wrapper"),U}o(JS,"createCurry");function Vv(a){return function(c,p,M){var U=Qt(c);if(!vn(c)){var j=Xe(p,3);c=Tr(c),p=o(function(ce){return j(U[ce],ce,U)},"predicate")}var re=a(c,p,M);return re>-1?U[j?c[re]:re]:r}}o(Vv,"createFind");function Wv(a){return zo(function(c){var p=c.length,M=p,U=ci.prototype.thru;for(a&&c.reverse();M--;){var j=c[M];if(typeof j!="function")throw new fi(i);if(U&&!re&&gh(j)=="wrapper")var re=new ci([],!0)}for(M=re?M:p;++M<p;){j=c[M];var ce=gh(j),be=ce=="wrapper"?sm(j):r;be&&um(be[0])&&be[1]==(ie|B|ee|G)&&!be[4].length&&be[9]==1?re=re[gh(be[0])].apply(re,be[3]):re=j.length==1&&um(j)?re[ce]():re.thru(j)}return function(){var Te=arguments,Ce=Te[0];if(re&&Te.length==1&&yt(Ce))return re.plant(Ce).value();for(var De=0,Be=p?c[De].apply(this,Te):Ce;++De<p;)Be=c[De].call(this,Be);return Be}})}o(Wv,"createFlow");function dh(a,c,p,M,U,j,re,ce,be,Te){var Ce=c&ie,De=c&I,Be=c&P,Ke=c&(B|J),Qe=c&$,Et=Be?r:du(a);function et(){for(var kt=arguments.length,Nt=xe(kt),Bn=kt;Bn--;)Nt[Bn]=arguments[Bn];if(Ke)var cn=qf(et),Un=aA(Nt,cn);if(M&&(Nt=Hv(Nt,M,U,Ke)),j&&(Nt=zv(Nt,j,re,Ke)),kt-=Un,Ke&&kt<Te){var vr=As(Nt,cn);return Xv(a,c,dh,et.placeholder,p,Nt,vr,ce,be,Te-kt)}var Li=De?p:this,Vo=Be?Li[a]:a;return kt=Nt.length,ce?Nt=mM(Nt,ce):Qe&&kt>1&&Nt.reverse(),Ce&&be<kt&&(Nt.length=be),this&&this!==Mr&&this instanceof et&&(Vo=Et||du(Vo)),Vo.apply(Li,Nt)}return o(et,"wrapper"),et}o(dh,"createHybrid");function Jv(a,c){return function(p,M){return ES(p,a,c(M),{})}}o(Jv,"createInverter");function ph(a,c){return function(p,M){var U;if(p===r&&M===r)return c;if(p!==r&&(U=p),M!==r){if(U===r)return M;typeof p=="string"||typeof M=="string"?(p=Pn(p),M=Pn(M)):(p=Nv(p),M=Nv(M)),U=a(p,M)}return U}}o(ph,"createMathOperation");function rm(a){return zo(function(c){return c=fr(c,Nn(Xe())),Mt(function(p){var M=this;return a(c,function(U){return On(U,M,p)})})})}o(rm,"createOver");function mh(a,c){c=c===r?" ":Pn(c);var p=c.length;if(p<2)return p?Jp(c,a):c;var M=Jp(c,th(a/Nf(c)));return Of(c)?Is(Oi(M),0,a).join(""):M.slice(0,a)}o(mh,"createPadding");function YS(a,c,p,M){var U=c&I,j=du(a);function re(){for(var ce=-1,be=arguments.length,Te=-1,Ce=M.length,De=xe(Ce+be),Be=this&&this!==Mr&&this instanceof re?j:a;++Te<Ce;)De[Te]=M[Te];for(;be--;)De[Te++]=arguments[++ce];return On(Be,U?p:this,De)}return o(re,"wrapper"),re}o(YS,"createPartial");function Yv(a){return function(c,p,M){return M&&typeof M!="number"&&fn(c,p,M)&&(p=M=r),c=Go(c),p===r?(p=c,c=0):p=Go(p),M=M===r?c<p?1:-1:Go(M),PS(c,p,M,a)}}o(Yv,"createRange");function bh(a){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=di(c),p=di(p)),a(c,p)}}o(bh,"createRelationalOperation");function Xv(a,c,p,M,U,j,re,ce,be,Te){var Ce=c&B,De=Ce?re:r,Be=Ce?r:re,Ke=Ce?j:r,Qe=Ce?r:j;c|=Ce?ee:Y,c&=~(Ce?Y:ee),c&X||(c&=~(I|P));var Et=[a,c,U,Ke,De,Qe,Be,ce,be,Te],et=p.apply(r,Et);return um(a)&&cy(et,Et),et.placeholder=M,uy(et,a,c)}o(Xv,"createRecurry");function nm(a){var c=_r[a];return function(p,M){if(p=di(p),M=M==null?0:Vr(_t(M),292),M&&uv(p)){var U=(jt(p)+"e").split("e"),j=c(U[0]+"e"+(+U[1]+M));return U=(jt(j)+"e").split("e"),+(U[0]+"e"+(+U[1]-M))}return c(p)}}o(nm,"createRound");var XS=Lf&&1/jl(new Lf([,-0]))[1]==m?function(a){return new Lf(a)}:Sm;function Zv(a){return function(c){var p=Wr(c);return p==ae?Op(c):p==W?pA(c):sA(c,a(c))}}o(Zv,"createToPairs");function Ho(a,c,p,M,U,j,re,ce){var be=c&P;if(!be&&typeof a!="function")throw new fi(i);var Te=M?M.length:0;if(Te||(c&=~(ee|Y),M=U=r),re=re===r?re:Er(_t(re),0),ce=ce===r?ce:_t(ce),Te-=U?U.length:0,c&Y){var Ce=M,De=U;M=U=r}var Be=be?r:sm(a),Ke=[a,c,p,M,U,Ce,De,j,re,ce];if(Be&&hM(Ke,Be),a=Ke[0],c=Ke[1],p=Ke[2],M=Ke[3],U=Ke[4],ce=Ke[9]=Ke[9]===r?be?0:a.length:Er(Ke[9]-Te,0),!ce&&c&(B|J)&&(c&=~(B|J)),!c||c==I)var Qe=WS(a,c,p);else c==B||c==J?Qe=JS(a,c,ce):(c==ee||c==(I|ee))&&!U.length?Qe=YS(a,c,p,M):Qe=dh.apply(r,Ke);var Et=Be?Rv:cy;return uy(Et(Qe,Ke),a,c)}o(Ho,"createWrap");function Qv(a,c,p,M){return a===r||Pi(a,Pf[p])&&!Wt.call(M,p)?c:a}o(Qv,"customDefaultsAssignIn");function ey(a,c,p,M,U,j){return cr(a)&&cr(c)&&(j.set(c,a),ch(a,c,r,ey,j),j.delete(c)),a}o(ey,"customDefaultsMerge");function ZS(a){return bu(a)?r:a}o(ZS,"customOmitClone");function ty(a,c,p,M,U,j){var re=p&O,ce=a.length,be=c.length;if(ce!=be&&!(re&&be>ce))return!1;var Te=j.get(a),Ce=j.get(c);if(Te&&Ce)return Te==c&&Ce==a;var De=-1,Be=!0,Ke=p&R?new Aa:r;for(j.set(a,c),j.set(c,a);++De<ce;){var Qe=a[De],Et=c[De];if(M)var et=re?M(Et,Qe,De,c,a,j):M(Qe,Et,De,a,c,j);if(et!==r){if(et)continue;Be=!1;break}if(Ke){if(!Tp(c,function(kt,Nt){if(!ru(Ke,Nt)&&(Qe===kt||U(Qe,kt,p,M,j)))return Ke.push(Nt)})){Be=!1;break}}else if(!(Qe===Et||U(Qe,Et,p,M,j))){Be=!1;break}}return j.delete(a),j.delete(c),Be}o(ty,"equalArrays");function QS(a,c,p,M,U,j,re){switch(p){case le:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case br:return!(a.byteLength!=c.byteLength||!j(new Xl(a),new Xl(c)));case Q:case se:case Ae:return Pi(+a,+c);case z:return a.name==c.name&&a.message==c.message;case ve:case pe:return a==c+"";case ae:var ce=Op;case W:var be=M&O;if(ce||(ce=jl),a.size!=c.size&&!be)return!1;var Te=re.get(a);if(Te)return Te==c;M|=R,re.set(a,c);var Ce=ty(ce(a),ce(c),M,U,j,re);return re.delete(a),Ce;case ke:if(au)return au.call(a)==au.call(c)}return!1}o(QS,"equalByTag");function eM(a,c,p,M,U,j){var re=p&O,ce=im(a),be=ce.length,Te=im(c),Ce=Te.length;if(be!=Ce&&!re)return!1;for(var De=be;De--;){var Be=ce[De];if(!(re?Be in c:Wt.call(c,Be)))return!1}var Ke=j.get(a),Qe=j.get(c);if(Ke&&Qe)return Ke==c&&Qe==a;var Et=!0;j.set(a,c),j.set(c,a);for(var et=re;++De<be;){Be=ce[De];var kt=a[Be],Nt=c[Be];if(M)var Bn=re?M(Nt,kt,Be,c,a,j):M(kt,Nt,Be,a,c,j);if(!(Bn===r?kt===Nt||U(kt,Nt,p,M,j):Bn)){Et=!1;break}et||(et=Be=="constructor")}if(Et&&!et){var cn=a.constructor,Un=c.constructor;cn!=Un&&"constructor"in a&&"constructor"in c&&!(typeof cn=="function"&&cn instanceof cn&&typeof Un=="function"&&Un instanceof Un)&&(Et=!1)}return j.delete(a),j.delete(c),Et}o(eM,"equalObjects");function zo(a){return hm(ay(a,r,by),a+"")}o(zo,"flatRest");function im(a){return wv(a,Tr,fm)}o(im,"getAllKeys");function om(a){return wv(a,yn,ry)}o(om,"getAllKeysIn");var sm=nh?function(a){return nh.get(a)}:Sm;function gh(a){for(var c=a.name+"",p=Bf[c],M=Wt.call(Bf,c)?p.length:0;M--;){var U=p[M],j=U.func;if(j==null||j==a)return U.name}return c}o(gh,"getFuncName");function qf(a){var c=Wt.call(q,"placeholder")?q:a;return c.placeholder}o(qf,"getHolder");function Xe(){var a=q.iteratee||Em;return a=a===Em?Av:a,arguments.length?a(arguments[0],arguments[1]):a}o(Xe,"getIteratee");function vh(a,c){var p=a.__data__;return fM(c)?p[typeof c=="string"?"string":"hash"]:p.map}o(vh,"getMapData");function am(a){for(var c=Tr(a),p=c.length;p--;){var M=c[p],U=a[M];c[p]=[M,U,oy(U)]}return c}o(am,"getMatchData");function Ta(a,c){var p=lA(a,c);return Ev(p)?p:r}o(Ta,"getNative");function tM(a){var c=Wt.call(a,_a),p=a[_a];try{a[_a]=r;var M=!0}catch{}var U=Jl.call(a);return M&&(c?a[_a]=p:delete a[_a]),U}o(tM,"getRawTag");var fm=Pp?function(a){return a==null?[]:(a=Qt(a),_s(Pp(a),function(c){return fv.call(a,c)}))}:Mm,ry=Pp?function(a){for(var c=[];a;)Es(c,fm(a)),a=Zl(a);return c}:Mm,Wr=an;(Lp&&Wr(new Lp(new ArrayBuffer(1)))!=le||iu&&Wr(new iu)!=ae||Bp&&Wr(Bp.resolve())!=Me||Lf&&Wr(new Lf)!=W||ou&&Wr(new ou)!=Ne)&&(Wr=o(function(a){var c=an(a),p=c==ne?a.constructor:r,M=p?Ca(p):"";if(M)switch(M){case BA:return le;case UA:return ae;case FA:return Me;case $A:return W;case qA:return Ne}return c},"getTag"));function rM(a,c,p){for(var M=-1,U=p.length;++M<U;){var j=p[M],re=j.size;switch(j.type){case"drop":a+=re;break;case"dropRight":c-=re;break;case"take":c=Vr(c,a+re);break;case"takeRight":a=Er(a,c-re);break}}return{start:a,end:c}}o(rM,"getView");function nM(a){var c=a.match(lt);return c?c[1].split(ni):[]}o(nM,"getWrapDetails");function ny(a,c,p){c=ks(c,a);for(var M=-1,U=c.length,j=!1;++M<U;){var re=ao(c[M]);if(!(j=a!=null&&p(a,re)))break;a=a[re]}return j||++M!=U?j:(U=a==null?0:a.length,!!U&&Sh(U)&&Ko(re,U)&&(yt(a)||ka(a)))}o(ny,"hasPath");function iM(a){var c=a.length,p=new a.constructor(c);return c&&typeof a[0]=="string"&&Wt.call(a,"index")&&(p.index=a.index,p.input=a.input),p}o(iM,"initCloneArray");function iy(a){return typeof a.constructor=="function"&&!pu(a)?Uf(Zl(a)):{}}o(iy,"initCloneObject");function oM(a,c,p){var M=a.constructor;switch(c){case br:return tm(a);case Q:case se:return new M(+a);case le:return HS(a,p);case oe:case F:case Z:case me:case ye:case we:case Ie:case Dt:case Fe:return $v(a,p);case ae:return new M;case Ae:case pe:return new M(a);case ve:return zS(a);case W:return new M;case ke:return KS(a)}}o(oM,"initCloneByTag");function sM(a,c){var p=c.length;if(!p)return a;var M=p-1;return c[M]=(p>1?"& ":"")+c[M],c=c.join(p>2?", ":" "),a.replace(ut,`{
2
2
  /* [wrapped with `+c+`] */
3
- `)}o(sM,"insertWrapDetails");function aM(a){return yt(a)||ka(a)||!!(cv&&a&&a[cv])}o(aM,"isFlattenable");function Ko(a,c){var p=typeof a;return c=c??_,!!c&&(p=="number"||p!="symbol"&&pn.test(a))&&a>-1&&a%1==0&&a<c}o(Ko,"isIndex");function fn(a,c,p){if(!cr(p))return!1;var M=typeof c;return(M=="number"?vn(p)&&Ko(c,p.length):M=="string"&&c in p)?Pi(p[c],a):!1}o(fn,"isIterateeCall");function cm(a,c){if(yt(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||Ln(a)?!0:at.test(a)||!ti.test(a)||c!=null&&a in Qt(c)}o(cm,"isKey");function fM(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}o(fM,"isKeyable");function um(a){var c=gh(a),p=q[c];if(typeof p!="function"||!(c in Rt.prototype))return!1;if(a===p)return!0;var M=sm(p);return!!M&&a===M[0]}o(um,"isLaziable");function cM(a){return!!ov&&ov in a}o(cM,"isMasked");var uM=Vl?jo:Tm;function pu(a){var c=a&&a.constructor,p=typeof c=="function"&&c.prototype||Pf;return a===p}o(pu,"isPrototype");function oy(a){return a===a&&!cr(a)}o(oy,"isStrictComparable");function sy(a,c){return function(p){return p==null?!1:p[a]===c&&(c!==r||a in Qt(p))}}o(sy,"matchesStrictComparable");function lM(a){var c=Eh(a,function(M){return p.size===u&&p.clear(),M}),p=c.cache;return c}o(lM,"memoizeCapped");function hM(a,c){var p=a[1],M=c[1],U=p|M,j=U<(I|N|ie),re=M==ie&&p==L||M==ie&&p==G&&a[7].length<=c[8]||M==(ie|G)&&c[7].length<=c[8]&&p==L;if(!(j||re))return a;M&I&&(a[2]=c[2],U|=p&I?0:X);var ce=c[3];if(ce){var be=a[3];a[3]=be?Hv(be,ce,c[4]):ce,a[4]=be?As(a[3],d):c[4]}return ce=c[5],ce&&(be=a[5],a[5]=be?zv(be,ce,c[6]):ce,a[6]=be?As(a[5],d):c[6]),ce=c[7],ce&&(a[7]=ce),M&ie&&(a[8]=a[8]==null?c[8]:Vr(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=U,a}o(hM,"mergeData");function dM(a){var c=[];if(a!=null)for(var p in Qt(a))c.push(p);return c}o(dM,"nativeKeysIn");function pM(a){return Jl.call(a)}o(pM,"objectToString");function ay(a,c,p){return c=Er(c===r?a.length-1:c,0),function(){for(var M=arguments,U=-1,j=Er(M.length-c,0),re=xe(j);++U<j;)re[U]=M[c+U];U=-1;for(var ce=xe(c+1);++U<c;)ce[U]=M[U];return ce[c]=p(re),On(a,this,ce)}}o(ay,"overRest");function fy(a,c){return c.length<2?a:Ma(a,li(c,0,-1))}o(fy,"parent");function mM(a,c){for(var p=a.length,M=Vr(c.length,p),U=gn(a);M--;){var j=c[M];a[M]=Ko(j,p)?U[j]:r}return a}o(mM,"reorder");function lm(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}o(lm,"safeGet");var cy=ly(Rv),mu=IA||function(a,c){return Mr.setTimeout(a,c)},hm=ly(US);function uy(a,c,p){var M=c+"";return hm(a,sM(M,bM(nM(M),p)))}o(uy,"setWrapToString");function ly(a){var c=0,p=0;return function(){var M=NA(),U=h-(M-p);if(p=M,U>0){if(++c>=C)return arguments[0]}else c=0;return a.apply(r,arguments)}}o(ly,"shortOut");function yh(a,c){var p=-1,M=a.length,U=M-1;for(c=c===r?M:c;++p<c;){var j=Wp(p,U),re=a[j];a[j]=a[p],a[p]=re}return a.length=c,a}o(yh,"shuffleSelf");var hy=lM(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(ft,function(p,M,U,j){c.push(U?j.replace(ii,"$1"):M||p)}),c});function ao(a){if(typeof a=="string"||Ln(a))return a;var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(ao,"toKey");function Ca(a){if(a!=null){try{return Wl.call(a)}catch{}try{return a+""}catch{}}return""}o(Ca,"toSource");function bM(a,c){return ai(w,function(p){var M="_."+p[0];c&p[1]&&!zl(a,M)&&a.push(M)}),a.sort()}o(bM,"updateWrapDetails");function dy(a){if(a instanceof Rt)return a.clone();var c=new ci(a.__wrapped__,a.__chain__);return c.__actions__=gn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}o(dy,"wrapperClone");function gM(a,c,p){(p?fn(a,c,p):c===r)?c=1:c=Er(_t(c),0);var M=a==null?0:a.length;if(!M||c<1)return[];for(var U=0,j=0,re=xe(th(M/c));U<M;)re[j++]=li(a,U,U+=c);return re}o(gM,"chunk");function vM(a){for(var c=-1,p=a==null?0:a.length,M=0,U=[];++c<p;){var j=a[c];j&&(U[M++]=j)}return U}o(vM,"compact");function yM(){var a=arguments.length;if(!a)return[];for(var c=xe(a-1),p=arguments[0],M=a;M--;)c[M-1]=arguments[M];return Es(yt(p)?gn(p):[p],Fr(c,1))}o(yM,"concat");var xM=Mt(function(a,c){return gr(a)?cu(a,Fr(c,1,gr,!0)):[]}),wM=Mt(function(a,c){var p=hi(c);return gr(p)&&(p=r),gr(a)?cu(a,Fr(c,1,gr,!0),Xe(p,2)):[]}),_M=Mt(function(a,c){var p=hi(c);return gr(p)&&(p=r),gr(a)?cu(a,Fr(c,1,gr,!0),r,p):[]});function EM(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:_t(c),li(a,c<0?0:c,M)):[]}o(EM,"drop");function AM(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:_t(c),c=M-c,li(a,0,c<0?0:c)):[]}o(AM,"dropRight");function SM(a,c){return a&&a.length?lh(a,Xe(c,3),!0,!0):[]}o(SM,"dropRightWhile");function MM(a,c){return a&&a.length?lh(a,Xe(c,3),!0):[]}o(MM,"dropWhile");function TM(a,c,p,M){var U=a==null?0:a.length;return U?(p&&typeof p!="number"&&fn(a,c,p)&&(p=0,M=U),yS(a,c,p,M)):[]}o(TM,"fill");function py(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=p==null?0:_t(p);return U<0&&(U=Er(M+U,0)),Kl(a,Xe(c,3),U)}o(py,"findIndex");function my(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=M-1;return p!==r&&(U=_t(p),U=p<0?Er(M+U,0):Vr(U,M-1)),Kl(a,Xe(c,3),U,!0)}o(my,"findLastIndex");function by(a){var c=a==null?0:a.length;return c?Fr(a,1):[]}o(by,"flatten");function CM(a){var c=a==null?0:a.length;return c?Fr(a,m):[]}o(CM,"flattenDeep");function kM(a,c){var p=a==null?0:a.length;return p?(c=c===r?1:_t(c),Fr(a,c)):[]}o(kM,"flattenDepth");function IM(a){for(var c=-1,p=a==null?0:a.length,M={};++c<p;){var U=a[c];M[U[0]]=U[1]}return M}o(IM,"fromPairs");function gy(a){return a&&a.length?a[0]:r}o(gy,"head");function DM(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=p==null?0:_t(p);return U<0&&(U=Er(M+U,0)),Rf(a,c,U)}o(DM,"indexOf");function RM(a){var c=a==null?0:a.length;return c?li(a,0,-1):[]}o(RM,"initial");var OM=Mt(function(a){var c=fr(a,Qp);return c.length&&c[0]===a[0]?zp(c):[]}),NM=Mt(function(a){var c=hi(a),p=fr(a,Qp);return c===hi(p)?c=r:p.pop(),p.length&&p[0]===a[0]?zp(p,Xe(c,2)):[]}),PM=Mt(function(a){var c=hi(a),p=fr(a,Qp);return c=typeof c=="function"?c:r,c&&p.pop(),p.length&&p[0]===a[0]?zp(p,r,c):[]});function LM(a,c){return a==null?"":RA.call(a,c)}o(LM,"join");function hi(a){var c=a==null?0:a.length;return c?a[c-1]:r}o(hi,"last");function BM(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=M;return p!==r&&(U=_t(p),U=U<0?Er(M+U,0):Vr(U,M-1)),c===c?bA(a,c,U):Kl(a,X2,U,!0)}o(BM,"lastIndexOf");function UM(a,c){return a&&a.length?Cv(a,_t(c)):r}o(UM,"nth");var FM=Mt(vy);function vy(a,c){return a&&a.length&&c&&c.length?Vp(a,c):a}o(vy,"pullAll");function $M(a,c,p){return a&&a.length&&c&&c.length?Vp(a,c,Xe(p,2)):a}o($M,"pullAllBy");function qM(a,c,p){return a&&a.length&&c&&c.length?Vp(a,c,r,p):a}o(qM,"pullAllWith");var HM=zo(function(a,c){var p=a==null?0:a.length,M=Fp(a,c);return Dv(a,fr(c,function(U){return Ko(U,p)?+U:U}).sort(qv)),M});function zM(a,c){var p=[];if(!(a&&a.length))return p;var M=-1,U=[],j=a.length;for(c=Xe(c,3);++M<j;){var re=a[M];c(re,M,a)&&(p.push(re),U.push(M))}return Dv(a,U),p}o(zM,"remove");function dm(a){return a==null?a:LA.call(a)}o(dm,"reverse");function KM(a,c,p){var M=a==null?0:a.length;return M?(p&&typeof p!="number"&&fn(a,c,p)?(c=0,p=M):(c=c==null?0:_t(c),p=p===r?M:_t(p)),li(a,c,p)):[]}o(KM,"slice");function jM(a,c){return uh(a,c)}o(jM,"sortedIndex");function GM(a,c,p){return Yp(a,c,Xe(p,2))}o(GM,"sortedIndexBy");function VM(a,c){var p=a==null?0:a.length;if(p){var M=uh(a,c);if(M<p&&Pi(a[M],c))return M}return-1}o(VM,"sortedIndexOf");function WM(a,c){return uh(a,c,!0)}o(WM,"sortedLastIndex");function JM(a,c,p){return Yp(a,c,Xe(p,2),!0)}o(JM,"sortedLastIndexBy");function YM(a,c){var p=a==null?0:a.length;if(p){var M=uh(a,c,!0)-1;if(Pi(a[M],c))return M}return-1}o(YM,"sortedLastIndexOf");function XM(a){return a&&a.length?Ov(a):[]}o(XM,"sortedUniq");function ZM(a,c){return a&&a.length?Ov(a,Xe(c,2)):[]}o(ZM,"sortedUniqBy");function QM(a){var c=a==null?0:a.length;return c?li(a,1,c):[]}o(QM,"tail");function eT(a,c,p){return a&&a.length?(c=p||c===r?1:_t(c),li(a,0,c<0?0:c)):[]}o(eT,"take");function tT(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:_t(c),c=M-c,li(a,c<0?0:c,M)):[]}o(tT,"takeRight");function rT(a,c){return a&&a.length?lh(a,Xe(c,3),!1,!0):[]}o(rT,"takeRightWhile");function nT(a,c){return a&&a.length?lh(a,Xe(c,3)):[]}o(nT,"takeWhile");var iT=Mt(function(a){return Cs(Fr(a,1,gr,!0))}),oT=Mt(function(a){var c=hi(a);return gr(c)&&(c=r),Cs(Fr(a,1,gr,!0),Xe(c,2))}),sT=Mt(function(a){var c=hi(a);return c=typeof c=="function"?c:r,Cs(Fr(a,1,gr,!0),r,c)});function aT(a){return a&&a.length?Cs(a):[]}o(aT,"uniq");function fT(a,c){return a&&a.length?Cs(a,Xe(c,2)):[]}o(fT,"uniqBy");function cT(a,c){return c=typeof c=="function"?c:r,a&&a.length?Cs(a,r,c):[]}o(cT,"uniqWith");function pm(a){if(!(a&&a.length))return[];var c=0;return a=_s(a,function(p){if(gr(p))return c=Er(p.length,c),!0}),Dp(c,function(p){return fr(a,Cp(p))})}o(pm,"unzip");function yy(a,c){if(!(a&&a.length))return[];var p=pm(a);return c==null?p:fr(p,function(M){return On(c,r,M)})}o(yy,"unzipWith");var uT=Mt(function(a,c){return gr(a)?cu(a,c):[]}),lT=Mt(function(a){return Zp(_s(a,gr))}),hT=Mt(function(a){var c=hi(a);return gr(c)&&(c=r),Zp(_s(a,gr),Xe(c,2))}),dT=Mt(function(a){var c=hi(a);return c=typeof c=="function"?c:r,Zp(_s(a,gr),r,c)}),pT=Mt(pm);function mT(a,c){return Bv(a||[],c||[],fu)}o(mT,"zipObject");function bT(a,c){return Bv(a||[],c||[],hu)}o(bT,"zipObjectDeep");var gT=Mt(function(a){var c=a.length,p=c>1?a[c-1]:r;return p=typeof p=="function"?(a.pop(),p):r,yy(a,p)});function xy(a){var c=q(a);return c.__chain__=!0,c}o(xy,"chain");function vT(a,c){return c(a),a}o(vT,"tap");function xh(a,c){return c(a)}o(xh,"thru");var yT=zo(function(a){var c=a.length,p=c?a[0]:0,M=this.__wrapped__,U=o(function(j){return Fp(j,a)},"interceptor");return c>1||this.__actions__.length||!(M instanceof Rt)||!Ko(p)?this.thru(U):(M=M.slice(p,+p+(c?1:0)),M.__actions__.push({func:xh,args:[U],thisArg:r}),new ci(M,this.__chain__).thru(function(j){return c&&!j.length&&j.push(r),j}))});function xT(){return xy(this)}o(xT,"wrapperChain");function wT(){return new ci(this.value(),this.__chain__)}o(wT,"wrapperCommit");function _T(){this.__values__===r&&(this.__values__=Ny(this.value()));var a=this.__index__>=this.__values__.length,c=a?r:this.__values__[this.__index__++];return{done:a,value:c}}o(_T,"wrapperNext");function ET(){return this}o(ET,"wrapperToIterator");function AT(a){for(var c,p=this;p instanceof oh;){var M=dy(p);M.__index__=0,M.__values__=r,c?U.__wrapped__=M:c=M;var U=M;p=p.__wrapped__}return U.__wrapped__=a,c}o(AT,"wrapperPlant");function ST(){var a=this.__wrapped__;if(a instanceof Rt){var c=a;return this.__actions__.length&&(c=new Rt(this)),c=c.reverse(),c.__actions__.push({func:xh,args:[dm],thisArg:r}),new ci(c,this.__chain__)}return this.thru(dm)}o(ST,"wrapperReverse");function MT(){return Lv(this.__wrapped__,this.__actions__)}o(MT,"wrapperValue");var TT=hh(function(a,c,p){Wt.call(a,p)?++a[p]:qo(a,p,1)});function CT(a,c,p){var M=yt(a)?J2:vS;return p&&fn(a,c,p)&&(c=r),M(a,Xe(c,3))}o(CT,"every");function kT(a,c){var p=yt(a)?_s:yv;return p(a,Xe(c,3))}o(kT,"filter");var IT=Vv(py),DT=Vv(my);function RT(a,c){return Fr(wh(a,c),1)}o(RT,"flatMap");function OT(a,c){return Fr(wh(a,c),m)}o(OT,"flatMapDeep");function NT(a,c,p){return p=p===r?1:_t(p),Fr(wh(a,c),p)}o(NT,"flatMapDepth");function wy(a,c){var p=yt(a)?ai:Ts;return p(a,Xe(c,3))}o(wy,"forEach");function _y(a,c){var p=yt(a)?Q7:vv;return p(a,Xe(c,3))}o(_y,"forEachRight");var PT=hh(function(a,c,p){Wt.call(a,p)?a[p].push(c):qo(a,p,[c])});function LT(a,c,p,M){a=vn(a)?a:zf(a),p=p&&!M?_t(p):0;var U=a.length;return p<0&&(p=Er(U+p,0)),Mh(a)?p<=U&&a.indexOf(c,p)>-1:!!U&&Rf(a,c,p)>-1}o(LT,"includes");var BT=Mt(function(a,c,p){var M=-1,U=typeof c=="function",j=vn(a)?xe(a.length):[];return Ts(a,function(re){j[++M]=U?On(c,re,p):uu(re,c,p)}),j}),UT=hh(function(a,c,p){qo(a,p,c)});function wh(a,c){var p=yt(a)?fr:Sv;return p(a,Xe(c,3))}o(wh,"map");function FT(a,c,p,M){return a==null?[]:(yt(c)||(c=c==null?[]:[c]),p=M?r:p,yt(p)||(p=p==null?[]:[p]),kv(a,c,p))}o(FT,"orderBy");var $T=hh(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function qT(a,c,p){var M=yt(a)?Mp:Q2,U=arguments.length<3;return M(a,Xe(c,4),p,U,Ts)}o(qT,"reduce");function HT(a,c,p){var M=yt(a)?eA:Q2,U=arguments.length<3;return M(a,Xe(c,4),p,U,vv)}o(HT,"reduceRight");function zT(a,c){var p=yt(a)?_s:yv;return p(a,Ah(Xe(c,3)))}o(zT,"reject");function KT(a){var c=yt(a)?pv:LS;return c(a)}o(KT,"sample");function jT(a,c,p){(p?fn(a,c,p):c===r)?c=1:c=_t(c);var M=yt(a)?dS:BS;return M(a,c)}o(jT,"sampleSize");function GT(a){var c=yt(a)?pS:FS;return c(a)}o(GT,"shuffle");function VT(a){if(a==null)return 0;if(vn(a))return Mh(a)?Nf(a):a.length;var c=Wr(a);return c==ae||c==W?a.size:jp(a).length}o(VT,"size");function WT(a,c,p){var M=yt(a)?Tp:$S;return p&&fn(a,c,p)&&(c=r),M(a,Xe(c,3))}o(WT,"some");var JT=Mt(function(a,c){if(a==null)return[];var p=c.length;return p>1&&fn(a,c[0],c[1])?c=[]:p>2&&fn(c[0],c[1],c[2])&&(c=[c[0]]),kv(a,Fr(c,1),[])}),_h=kA||function(){return Mr.Date.now()};function YT(a,c){if(typeof c!="function")throw new fi(i);return a=_t(a),function(){if(--a<1)return c.apply(this,arguments)}}o(YT,"after");function Ey(a,c,p){return c=p?r:c,c=a&&c==null?a.length:c,Ho(a,ie,r,r,r,r,c)}o(Ey,"ary");function Ay(a,c){var p;if(typeof c!="function")throw new fi(i);return a=_t(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=r),p}}o(Ay,"before");var mm=Mt(function(a,c,p){var M=I;if(p.length){var U=As(p,qf(mm));M|=ee}return Ho(a,M,c,p,U)}),Sy=Mt(function(a,c,p){var M=I|N;if(p.length){var U=As(p,qf(Sy));M|=ee}return Ho(c,M,a,p,U)});function My(a,c,p){c=p?r:c;var M=Ho(a,L,r,r,r,r,r,c);return M.placeholder=My.placeholder,M}o(My,"curry");function Ty(a,c,p){c=p?r:c;var M=Ho(a,J,r,r,r,r,r,c);return M.placeholder=Ty.placeholder,M}o(Ty,"curryRight");function Cy(a,c,p){var M,U,j,re,ce,be,Te=0,Ce=!1,De=!1,Be=!0;if(typeof a!="function")throw new fi(i);c=di(c)||0,cr(p)&&(Ce=!!p.leading,De="maxWait"in p,j=De?Er(di(p.maxWait)||0,c):j,Be="trailing"in p?!!p.trailing:Be);function Ke(vr){var Li=M,Vo=U;return M=U=r,Te=vr,re=a.apply(Vo,Li),re}o(Ke,"invokeFunc");function Qe(vr){return Te=vr,ce=mu(kt,c),Ce?Ke(vr):re}o(Qe,"leadingEdge");function Et(vr){var Li=vr-be,Vo=vr-Te,Vy=c-Li;return De?Vr(Vy,j-Vo):Vy}o(Et,"remainingWait");function et(vr){var Li=vr-be,Vo=vr-Te;return be===r||Li>=c||Li<0||De&&Vo>=j}o(et,"shouldInvoke");function kt(){var vr=_h();if(et(vr))return Nt(vr);ce=mu(kt,Et(vr))}o(kt,"timerExpired");function Nt(vr){return ce=r,Be&&M?Ke(vr):(M=U=r,re)}o(Nt,"trailingEdge");function Bn(){ce!==r&&Uv(ce),Te=0,M=be=U=ce=r}o(Bn,"cancel");function cn(){return ce===r?re:Nt(_h())}o(cn,"flush");function Un(){var vr=_h(),Li=et(vr);if(M=arguments,U=this,be=vr,Li){if(ce===r)return Qe(be);if(De)return Uv(ce),ce=mu(kt,c),Ke(be)}return ce===r&&(ce=mu(kt,c)),re}return o(Un,"debounced"),Un.cancel=Bn,Un.flush=cn,Un}o(Cy,"debounce");var XT=Mt(function(a,c){return gv(a,1,c)}),ZT=Mt(function(a,c,p){return gv(a,di(c)||0,p)});function QT(a){return Ho(a,$)}o(QT,"flip");function Eh(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new fi(i);var p=o(function(){var M=arguments,U=c?c.apply(this,M):M[0],j=p.cache;if(j.has(U))return j.get(U);var re=a.apply(this,M);return p.cache=j.set(U,re)||j,re},"memoized");return p.cache=new(Eh.Cache||$o),p}o(Eh,"memoize"),Eh.Cache=$o;function Ah(a){if(typeof a!="function")throw new fi(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}o(Ah,"negate");function eC(a){return Ay(2,a)}o(eC,"once");var tC=qS(function(a,c){c=c.length==1&&yt(c[0])?fr(c[0],Nn(Xe())):fr(Fr(c,1),Nn(Xe()));var p=c.length;return Mt(function(M){for(var U=-1,j=Vr(M.length,p);++U<j;)M[U]=c[U].call(this,M[U]);return On(a,this,M)})}),bm=Mt(function(a,c){var p=As(c,qf(bm));return Ho(a,ee,r,c,p)}),ky=Mt(function(a,c){var p=As(c,qf(ky));return Ho(a,Y,r,c,p)}),rC=zo(function(a,c){return Ho(a,G,r,r,r,c)});function nC(a,c){if(typeof a!="function")throw new fi(i);return c=c===r?c:_t(c),Mt(a,c)}o(nC,"rest");function iC(a,c){if(typeof a!="function")throw new fi(i);return c=c==null?0:Er(_t(c),0),Mt(function(p){var M=p[c],U=Is(p,0,c);return M&&Es(U,M),On(a,this,U)})}o(iC,"spread");function oC(a,c,p){var M=!0,U=!0;if(typeof a!="function")throw new fi(i);return cr(p)&&(M="leading"in p?!!p.leading:M,U="trailing"in p?!!p.trailing:U),Cy(a,c,{leading:M,maxWait:c,trailing:U})}o(oC,"throttle");function sC(a){return Ey(a,1)}o(sC,"unary");function aC(a,c){return bm(em(c),a)}o(aC,"wrap");function fC(){if(!arguments.length)return[];var a=arguments[0];return yt(a)?a:[a]}o(fC,"castArray");function cC(a){return ui(a,E)}o(cC,"clone");function uC(a,c){return c=typeof c=="function"?c:r,ui(a,E,c)}o(uC,"cloneWith");function lC(a){return ui(a,g|E)}o(lC,"cloneDeep");function hC(a,c){return c=typeof c=="function"?c:r,ui(a,g|E,c)}o(hC,"cloneDeepWith");function dC(a,c){return c==null||bv(a,c,Tr(c))}o(dC,"conformsTo");function Pi(a,c){return a===c||a!==a&&c!==c}o(Pi,"eq");var pC=bh(Hp),mC=bh(function(a,c){return a>=c}),ka=_v(function(){return arguments}())?_v:function(a){return ur(a)&&Wt.call(a,"callee")&&!fv.call(a,"callee")},yt=xe.isArray,bC=z2?Nn(z2):AS;function vn(a){return a!=null&&Sh(a.length)&&!jo(a)}o(vn,"isArrayLike");function gr(a){return ur(a)&&vn(a)}o(gr,"isArrayLikeObject");function gC(a){return a===!0||a===!1||ur(a)&&an(a)==Q}o(gC,"isBoolean");var Ds=DA||Tm,vC=K2?Nn(K2):SS;function yC(a){return ur(a)&&a.nodeType===1&&!bu(a)}o(yC,"isElement");function xC(a){if(a==null)return!0;if(vn(a)&&(yt(a)||typeof a=="string"||typeof a.splice=="function"||Ds(a)||Hf(a)||ka(a)))return!a.length;var c=Wr(a);if(c==ae||c==W)return!a.size;if(pu(a))return!jp(a).length;for(var p in a)if(Wt.call(a,p))return!1;return!0}o(xC,"isEmpty");function wC(a,c){return lu(a,c)}o(wC,"isEqual");function _C(a,c,p){p=typeof p=="function"?p:r;var M=p?p(a,c):r;return M===r?lu(a,c,r,p):!!M}o(_C,"isEqualWith");function gm(a){if(!ur(a))return!1;var c=an(a);return c==z||c==H||typeof a.message=="string"&&typeof a.name=="string"&&!bu(a)}o(gm,"isError");function EC(a){return typeof a=="number"&&uv(a)}o(EC,"isFinite");function jo(a){if(!cr(a))return!1;var c=an(a);return c==V||c==te||c==D||c==ue}o(jo,"isFunction");function Iy(a){return typeof a=="number"&&a==_t(a)}o(Iy,"isInteger");function Sh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=_}o(Sh,"isLength");function cr(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}o(cr,"isObject");function ur(a){return a!=null&&typeof a=="object"}o(ur,"isObjectLike");var Dy=j2?Nn(j2):TS;function AC(a,c){return a===c||Kp(a,c,am(c))}o(AC,"isMatch");function SC(a,c,p){return p=typeof p=="function"?p:r,Kp(a,c,am(c),p)}o(SC,"isMatchWith");function MC(a){return Ry(a)&&a!=+a}o(MC,"isNaN");function TC(a){if(uM(a))throw new gt(n);return Ev(a)}o(TC,"isNative");function CC(a){return a===null}o(CC,"isNull");function kC(a){return a==null}o(kC,"isNil");function Ry(a){return typeof a=="number"||ur(a)&&an(a)==Ae}o(Ry,"isNumber");function bu(a){if(!ur(a)||an(a)!=ne)return!1;var c=Zl(a);if(c===null)return!0;var p=Wt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Wl.call(p)==SA}o(bu,"isPlainObject");var vm=G2?Nn(G2):CS;function IC(a){return Iy(a)&&a>=-_&&a<=_}o(IC,"isSafeInteger");var Oy=V2?Nn(V2):kS;function Mh(a){return typeof a=="string"||!yt(a)&&ur(a)&&an(a)==pe}o(Mh,"isString");function Ln(a){return typeof a=="symbol"||ur(a)&&an(a)==ke}o(Ln,"isSymbol");var Hf=W2?Nn(W2):IS;function DC(a){return a===r}o(DC,"isUndefined");function RC(a){return ur(a)&&Wr(a)==Ne}o(RC,"isWeakMap");function OC(a){return ur(a)&&an(a)==We}o(OC,"isWeakSet");var NC=bh(Gp),PC=bh(function(a,c){return a<=c});function Ny(a){if(!a)return[];if(vn(a))return Mh(a)?Oi(a):gn(a);if(nu&&a[nu])return dA(a[nu]());var c=Wr(a),p=c==ae?Op:c==W?jl:zf;return p(a)}o(Ny,"toArray");function Go(a){if(!a)return a===0?a:0;if(a=di(a),a===m||a===-m){var c=a<0?-1:1;return c*S}return a===a?a:0}o(Go,"toFinite");function _t(a){var c=Go(a),p=c%1;return c===c?p?c-p:c:0}o(_t,"toInteger");function Py(a){return a?Sa(_t(a),0,v):0}o(Py,"toLength");function di(a){if(typeof a=="number")return a;if(Ln(a))return A;if(cr(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=cr(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=ev(a);var p=qt.test(a);return p||dn.test(a)?Y7(a.slice(2),p?2:8):Rn.test(a)?A:+a}o(di,"toNumber");function Ly(a){return so(a,yn(a))}o(Ly,"toPlainObject");function LC(a){return a?Sa(_t(a),-_,_):a===0?a:0}o(LC,"toSafeInteger");function jt(a){return a==null?"":Pn(a)}o(jt,"toString");var BC=Ff(function(a,c){if(pu(c)||vn(c)){so(c,Tr(c),a);return}for(var p in c)Wt.call(c,p)&&fu(a,p,c[p])}),By=Ff(function(a,c){so(c,yn(c),a)}),Th=Ff(function(a,c,p,M){so(c,yn(c),a,M)}),UC=Ff(function(a,c,p,M){so(c,Tr(c),a,M)}),FC=zo(Fp);function $C(a,c){var p=Uf(a);return c==null?p:mv(p,c)}o($C,"create");var qC=Mt(function(a,c){a=Qt(a);var p=-1,M=c.length,U=M>2?c[2]:r;for(U&&fn(c[0],c[1],U)&&(M=1);++p<M;)for(var j=c[p],re=yn(j),ce=-1,be=re.length;++ce<be;){var Te=re[ce],Ce=a[Te];(Ce===r||Pi(Ce,Pf[Te])&&!Wt.call(a,Te))&&(a[Te]=j[Te])}return a}),HC=Mt(function(a){return a.push(r,ey),On(Uy,r,a)});function zC(a,c){return Y2(a,Xe(c,3),oo)}o(zC,"findKey");function KC(a,c){return Y2(a,Xe(c,3),qp)}o(KC,"findLastKey");function jC(a,c){return a==null?a:$p(a,Xe(c,3),yn)}o(jC,"forIn");function GC(a,c){return a==null?a:xv(a,Xe(c,3),yn)}o(GC,"forInRight");function VC(a,c){return a&&oo(a,Xe(c,3))}o(VC,"forOwn");function WC(a,c){return a&&qp(a,Xe(c,3))}o(WC,"forOwnRight");function JC(a){return a==null?[]:fh(a,Tr(a))}o(JC,"functions");function YC(a){return a==null?[]:fh(a,yn(a))}o(YC,"functionsIn");function ym(a,c,p){var M=a==null?r:Ma(a,c);return M===r?p:M}o(ym,"get");function XC(a,c){return a!=null&&ny(a,c,xS)}o(XC,"has");function xm(a,c){return a!=null&&ny(a,c,wS)}o(xm,"hasIn");var ZC=Jv(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Jl.call(c)),a[c]=p},_m(xn)),QC=Jv(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Jl.call(c)),Wt.call(a,c)?a[c].push(p):a[c]=[p]},Xe),ek=Mt(uu);function Tr(a){return vn(a)?dv(a):jp(a)}o(Tr,"keys");function yn(a){return vn(a)?dv(a,!0):DS(a)}o(yn,"keysIn");function tk(a,c){var p={};return c=Xe(c,3),oo(a,function(M,U,j){qo(p,c(M,U,j),M)}),p}o(tk,"mapKeys");function rk(a,c){var p={};return c=Xe(c,3),oo(a,function(M,U,j){qo(p,U,c(M,U,j))}),p}o(rk,"mapValues");var nk=Ff(function(a,c,p){ch(a,c,p)}),Uy=Ff(function(a,c,p,M){ch(a,c,p,M)}),ik=zo(function(a,c){var p={};if(a==null)return p;var M=!1;c=fr(c,function(j){return j=ks(j,a),M||(M=j.length>1),j}),so(a,om(a),p),M&&(p=ui(p,g|y|E,ZS));for(var U=c.length;U--;)Xp(p,c[U]);return p});function ok(a,c){return Fy(a,Ah(Xe(c)))}o(ok,"omitBy");var sk=zo(function(a,c){return a==null?{}:OS(a,c)});function Fy(a,c){if(a==null)return{};var p=fr(om(a),function(M){return[M]});return c=Xe(c),Iv(a,p,function(M,U){return c(M,U[0])})}o(Fy,"pickBy");function ak(a,c,p){c=ks(c,a);var M=-1,U=c.length;for(U||(U=1,a=r);++M<U;){var j=a==null?r:a[ao(c[M])];j===r&&(M=U,j=p),a=jo(j)?j.call(a):j}return a}o(ak,"result");function fk(a,c,p){return a==null?a:hu(a,c,p)}o(fk,"set");function ck(a,c,p,M){return M=typeof M=="function"?M:r,a==null?a:hu(a,c,p,M)}o(ck,"setWith");var $y=Zv(Tr),qy=Zv(yn);function uk(a,c,p){var M=yt(a),U=M||Ds(a)||Hf(a);if(c=Xe(c,4),p==null){var j=a&&a.constructor;U?p=M?new j:[]:cr(a)?p=jo(j)?Uf(Zl(a)):{}:p={}}return(U?ai:oo)(a,function(re,ce,be){return c(p,re,ce,be)}),p}o(uk,"transform");function lk(a,c){return a==null?!0:Xp(a,c)}o(lk,"unset");function hk(a,c,p){return a==null?a:Pv(a,c,em(p))}o(hk,"update");function dk(a,c,p,M){return M=typeof M=="function"?M:r,a==null?a:Pv(a,c,em(p),M)}o(dk,"updateWith");function zf(a){return a==null?[]:Rp(a,Tr(a))}o(zf,"values");function pk(a){return a==null?[]:Rp(a,yn(a))}o(pk,"valuesIn");function mk(a,c,p){return p===r&&(p=c,c=r),p!==r&&(p=di(p),p=p===p?p:0),c!==r&&(c=di(c),c=c===c?c:0),Sa(di(a),c,p)}o(mk,"clamp");function bk(a,c,p){return c=Go(c),p===r?(p=c,c=0):p=Go(p),a=di(a),_S(a,c,p)}o(bk,"inRange");function gk(a,c,p){if(p&&typeof p!="boolean"&&fn(a,c,p)&&(c=p=r),p===r&&(typeof c=="boolean"?(p=c,c=r):typeof a=="boolean"&&(p=a,a=r)),a===r&&c===r?(a=0,c=1):(a=Go(a),c===r?(c=a,a=0):c=Go(c)),a>c){var M=a;a=c,c=M}if(p||a%1||c%1){var U=lv();return Vr(a+U*(c-a+J7("1e-"+((U+"").length-1))),c)}return Wp(a,c)}o(gk,"random");var vk=$f(function(a,c,p){return c=c.toLowerCase(),a+(p?Hy(c):c)});function Hy(a){return wm(jt(a).toLowerCase())}o(Hy,"capitalize");function zy(a){return a=jt(a),a&&a.replace(mn,fA).replace(F7,"")}o(zy,"deburr");function yk(a,c,p){a=jt(a),c=Pn(c);var M=a.length;p=p===r?M:Sa(_t(p),0,M);var U=p;return p-=c.length,p>=0&&a.slice(p,U)==c}o(yk,"endsWith");function xk(a){return a=jt(a),a&&ot.test(a)?a.replace(Dn,cA):a}o(xk,"escape");function wk(a){return a=jt(a),a&&ct.test(a)?a.replace(hn,"\\$&"):a}o(wk,"escapeRegExp");var _k=$f(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),Ek=$f(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),Ak=Gv("toLowerCase");function Sk(a,c,p){a=jt(a),c=_t(c);var M=c?Nf(a):0;if(!c||M>=c)return a;var U=(c-M)/2;return mh(rh(U),p)+a+mh(th(U),p)}o(Sk,"pad");function Mk(a,c,p){a=jt(a),c=_t(c);var M=c?Nf(a):0;return c&&M<c?a+mh(c-M,p):a}o(Mk,"padEnd");function Tk(a,c,p){a=jt(a),c=_t(c);var M=c?Nf(a):0;return c&&M<c?mh(c-M,p)+a:a}o(Tk,"padStart");function Ck(a,c,p){return p||c==null?c=0:c&&(c=+c),PA(jt(a).replace(Ze,""),c||0)}o(Ck,"parseInt");function kk(a,c,p){return(p?fn(a,c,p):c===r)?c=1:c=_t(c),Jp(jt(a),c)}o(kk,"repeat");function Ik(){var a=arguments,c=jt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}o(Ik,"replace");var Dk=$f(function(a,c,p){return a+(p?"_":"")+c.toLowerCase()});function Rk(a,c,p){return p&&typeof p!="number"&&fn(a,c,p)&&(c=p=r),p=p===r?v:p>>>0,p?(a=jt(a),a&&(typeof c=="string"||c!=null&&!vm(c))&&(c=Pn(c),!c&&Of(a))?Is(Oi(a),0,p):a.split(c,p)):[]}o(Rk,"split");var Ok=$f(function(a,c,p){return a+(p?" ":"")+wm(c)});function Nk(a,c,p){return a=jt(a),p=p==null?0:Sa(_t(p),0,a.length),c=Pn(c),a.slice(p,p+c.length)==c}o(Nk,"startsWith");function Pk(a,c,p){var M=q.templateSettings;p&&fn(a,c,p)&&(c=r),a=jt(a),c=Th({},c,M,Qv);var U=Th({},c.imports,M.imports,Qv),j=Tr(U),re=Rp(U,j),ce,be,Te=0,Ce=c.interpolate||Ur,De="__p += '",Be=Np((c.escape||Ur).source+"|"+Ce.source+"|"+(Ce===tt?pt:Ur).source+"|"+(c.evaluate||Ur).source+"|$","g"),Ke="//# sourceURL="+(Wt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++K7+"]")+`
3
+ `)}o(sM,"insertWrapDetails");function aM(a){return yt(a)||ka(a)||!!(cv&&a&&a[cv])}o(aM,"isFlattenable");function Ko(a,c){var p=typeof a;return c=c??_,!!c&&(p=="number"||p!="symbol"&&pn.test(a))&&a>-1&&a%1==0&&a<c}o(Ko,"isIndex");function fn(a,c,p){if(!cr(p))return!1;var M=typeof c;return(M=="number"?vn(p)&&Ko(c,p.length):M=="string"&&c in p)?Pi(p[c],a):!1}o(fn,"isIterateeCall");function cm(a,c){if(yt(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||Ln(a)?!0:at.test(a)||!ti.test(a)||c!=null&&a in Qt(c)}o(cm,"isKey");function fM(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}o(fM,"isKeyable");function um(a){var c=gh(a),p=q[c];if(typeof p!="function"||!(c in Rt.prototype))return!1;if(a===p)return!0;var M=sm(p);return!!M&&a===M[0]}o(um,"isLaziable");function cM(a){return!!ov&&ov in a}o(cM,"isMasked");var uM=Vl?jo:Tm;function pu(a){var c=a&&a.constructor,p=typeof c=="function"&&c.prototype||Pf;return a===p}o(pu,"isPrototype");function oy(a){return a===a&&!cr(a)}o(oy,"isStrictComparable");function sy(a,c){return function(p){return p==null?!1:p[a]===c&&(c!==r||a in Qt(p))}}o(sy,"matchesStrictComparable");function lM(a){var c=Eh(a,function(M){return p.size===u&&p.clear(),M}),p=c.cache;return c}o(lM,"memoizeCapped");function hM(a,c){var p=a[1],M=c[1],U=p|M,j=U<(I|P|ie),re=M==ie&&p==B||M==ie&&p==G&&a[7].length<=c[8]||M==(ie|G)&&c[7].length<=c[8]&&p==B;if(!(j||re))return a;M&I&&(a[2]=c[2],U|=p&I?0:X);var ce=c[3];if(ce){var be=a[3];a[3]=be?Hv(be,ce,c[4]):ce,a[4]=be?As(a[3],d):c[4]}return ce=c[5],ce&&(be=a[5],a[5]=be?zv(be,ce,c[6]):ce,a[6]=be?As(a[5],d):c[6]),ce=c[7],ce&&(a[7]=ce),M&ie&&(a[8]=a[8]==null?c[8]:Vr(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=U,a}o(hM,"mergeData");function dM(a){var c=[];if(a!=null)for(var p in Qt(a))c.push(p);return c}o(dM,"nativeKeysIn");function pM(a){return Jl.call(a)}o(pM,"objectToString");function ay(a,c,p){return c=Er(c===r?a.length-1:c,0),function(){for(var M=arguments,U=-1,j=Er(M.length-c,0),re=xe(j);++U<j;)re[U]=M[c+U];U=-1;for(var ce=xe(c+1);++U<c;)ce[U]=M[U];return ce[c]=p(re),On(a,this,ce)}}o(ay,"overRest");function fy(a,c){return c.length<2?a:Ma(a,li(c,0,-1))}o(fy,"parent");function mM(a,c){for(var p=a.length,M=Vr(c.length,p),U=gn(a);M--;){var j=c[M];a[M]=Ko(j,p)?U[j]:r}return a}o(mM,"reorder");function lm(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}o(lm,"safeGet");var cy=ly(Rv),mu=IA||function(a,c){return Mr.setTimeout(a,c)},hm=ly(US);function uy(a,c,p){var M=c+"";return hm(a,sM(M,bM(nM(M),p)))}o(uy,"setWrapToString");function ly(a){var c=0,p=0;return function(){var M=NA(),U=h-(M-p);if(p=M,U>0){if(++c>=C)return arguments[0]}else c=0;return a.apply(r,arguments)}}o(ly,"shortOut");function yh(a,c){var p=-1,M=a.length,U=M-1;for(c=c===r?M:c;++p<c;){var j=Wp(p,U),re=a[j];a[j]=a[p],a[p]=re}return a.length=c,a}o(yh,"shuffleSelf");var hy=lM(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(ft,function(p,M,U,j){c.push(U?j.replace(ii,"$1"):M||p)}),c});function ao(a){if(typeof a=="string"||Ln(a))return a;var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(ao,"toKey");function Ca(a){if(a!=null){try{return Wl.call(a)}catch{}try{return a+""}catch{}}return""}o(Ca,"toSource");function bM(a,c){return ai(w,function(p){var M="_."+p[0];c&p[1]&&!zl(a,M)&&a.push(M)}),a.sort()}o(bM,"updateWrapDetails");function dy(a){if(a instanceof Rt)return a.clone();var c=new ci(a.__wrapped__,a.__chain__);return c.__actions__=gn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}o(dy,"wrapperClone");function gM(a,c,p){(p?fn(a,c,p):c===r)?c=1:c=Er(_t(c),0);var M=a==null?0:a.length;if(!M||c<1)return[];for(var U=0,j=0,re=xe(th(M/c));U<M;)re[j++]=li(a,U,U+=c);return re}o(gM,"chunk");function vM(a){for(var c=-1,p=a==null?0:a.length,M=0,U=[];++c<p;){var j=a[c];j&&(U[M++]=j)}return U}o(vM,"compact");function yM(){var a=arguments.length;if(!a)return[];for(var c=xe(a-1),p=arguments[0],M=a;M--;)c[M-1]=arguments[M];return Es(yt(p)?gn(p):[p],Fr(c,1))}o(yM,"concat");var xM=Mt(function(a,c){return gr(a)?cu(a,Fr(c,1,gr,!0)):[]}),wM=Mt(function(a,c){var p=hi(c);return gr(p)&&(p=r),gr(a)?cu(a,Fr(c,1,gr,!0),Xe(p,2)):[]}),_M=Mt(function(a,c){var p=hi(c);return gr(p)&&(p=r),gr(a)?cu(a,Fr(c,1,gr,!0),r,p):[]});function EM(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:_t(c),li(a,c<0?0:c,M)):[]}o(EM,"drop");function AM(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:_t(c),c=M-c,li(a,0,c<0?0:c)):[]}o(AM,"dropRight");function SM(a,c){return a&&a.length?lh(a,Xe(c,3),!0,!0):[]}o(SM,"dropRightWhile");function MM(a,c){return a&&a.length?lh(a,Xe(c,3),!0):[]}o(MM,"dropWhile");function TM(a,c,p,M){var U=a==null?0:a.length;return U?(p&&typeof p!="number"&&fn(a,c,p)&&(p=0,M=U),yS(a,c,p,M)):[]}o(TM,"fill");function py(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=p==null?0:_t(p);return U<0&&(U=Er(M+U,0)),Kl(a,Xe(c,3),U)}o(py,"findIndex");function my(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=M-1;return p!==r&&(U=_t(p),U=p<0?Er(M+U,0):Vr(U,M-1)),Kl(a,Xe(c,3),U,!0)}o(my,"findLastIndex");function by(a){var c=a==null?0:a.length;return c?Fr(a,1):[]}o(by,"flatten");function CM(a){var c=a==null?0:a.length;return c?Fr(a,m):[]}o(CM,"flattenDeep");function kM(a,c){var p=a==null?0:a.length;return p?(c=c===r?1:_t(c),Fr(a,c)):[]}o(kM,"flattenDepth");function IM(a){for(var c=-1,p=a==null?0:a.length,M={};++c<p;){var U=a[c];M[U[0]]=U[1]}return M}o(IM,"fromPairs");function gy(a){return a&&a.length?a[0]:r}o(gy,"head");function DM(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=p==null?0:_t(p);return U<0&&(U=Er(M+U,0)),Rf(a,c,U)}o(DM,"indexOf");function RM(a){var c=a==null?0:a.length;return c?li(a,0,-1):[]}o(RM,"initial");var OM=Mt(function(a){var c=fr(a,Qp);return c.length&&c[0]===a[0]?zp(c):[]}),NM=Mt(function(a){var c=hi(a),p=fr(a,Qp);return c===hi(p)?c=r:p.pop(),p.length&&p[0]===a[0]?zp(p,Xe(c,2)):[]}),PM=Mt(function(a){var c=hi(a),p=fr(a,Qp);return c=typeof c=="function"?c:r,c&&p.pop(),p.length&&p[0]===a[0]?zp(p,r,c):[]});function LM(a,c){return a==null?"":RA.call(a,c)}o(LM,"join");function hi(a){var c=a==null?0:a.length;return c?a[c-1]:r}o(hi,"last");function BM(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=M;return p!==r&&(U=_t(p),U=U<0?Er(M+U,0):Vr(U,M-1)),c===c?bA(a,c,U):Kl(a,X2,U,!0)}o(BM,"lastIndexOf");function UM(a,c){return a&&a.length?Cv(a,_t(c)):r}o(UM,"nth");var FM=Mt(vy);function vy(a,c){return a&&a.length&&c&&c.length?Vp(a,c):a}o(vy,"pullAll");function $M(a,c,p){return a&&a.length&&c&&c.length?Vp(a,c,Xe(p,2)):a}o($M,"pullAllBy");function qM(a,c,p){return a&&a.length&&c&&c.length?Vp(a,c,r,p):a}o(qM,"pullAllWith");var HM=zo(function(a,c){var p=a==null?0:a.length,M=Fp(a,c);return Dv(a,fr(c,function(U){return Ko(U,p)?+U:U}).sort(qv)),M});function zM(a,c){var p=[];if(!(a&&a.length))return p;var M=-1,U=[],j=a.length;for(c=Xe(c,3);++M<j;){var re=a[M];c(re,M,a)&&(p.push(re),U.push(M))}return Dv(a,U),p}o(zM,"remove");function dm(a){return a==null?a:LA.call(a)}o(dm,"reverse");function KM(a,c,p){var M=a==null?0:a.length;return M?(p&&typeof p!="number"&&fn(a,c,p)?(c=0,p=M):(c=c==null?0:_t(c),p=p===r?M:_t(p)),li(a,c,p)):[]}o(KM,"slice");function jM(a,c){return uh(a,c)}o(jM,"sortedIndex");function GM(a,c,p){return Yp(a,c,Xe(p,2))}o(GM,"sortedIndexBy");function VM(a,c){var p=a==null?0:a.length;if(p){var M=uh(a,c);if(M<p&&Pi(a[M],c))return M}return-1}o(VM,"sortedIndexOf");function WM(a,c){return uh(a,c,!0)}o(WM,"sortedLastIndex");function JM(a,c,p){return Yp(a,c,Xe(p,2),!0)}o(JM,"sortedLastIndexBy");function YM(a,c){var p=a==null?0:a.length;if(p){var M=uh(a,c,!0)-1;if(Pi(a[M],c))return M}return-1}o(YM,"sortedLastIndexOf");function XM(a){return a&&a.length?Ov(a):[]}o(XM,"sortedUniq");function ZM(a,c){return a&&a.length?Ov(a,Xe(c,2)):[]}o(ZM,"sortedUniqBy");function QM(a){var c=a==null?0:a.length;return c?li(a,1,c):[]}o(QM,"tail");function eT(a,c,p){return a&&a.length?(c=p||c===r?1:_t(c),li(a,0,c<0?0:c)):[]}o(eT,"take");function tT(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:_t(c),c=M-c,li(a,c<0?0:c,M)):[]}o(tT,"takeRight");function rT(a,c){return a&&a.length?lh(a,Xe(c,3),!1,!0):[]}o(rT,"takeRightWhile");function nT(a,c){return a&&a.length?lh(a,Xe(c,3)):[]}o(nT,"takeWhile");var iT=Mt(function(a){return Cs(Fr(a,1,gr,!0))}),oT=Mt(function(a){var c=hi(a);return gr(c)&&(c=r),Cs(Fr(a,1,gr,!0),Xe(c,2))}),sT=Mt(function(a){var c=hi(a);return c=typeof c=="function"?c:r,Cs(Fr(a,1,gr,!0),r,c)});function aT(a){return a&&a.length?Cs(a):[]}o(aT,"uniq");function fT(a,c){return a&&a.length?Cs(a,Xe(c,2)):[]}o(fT,"uniqBy");function cT(a,c){return c=typeof c=="function"?c:r,a&&a.length?Cs(a,r,c):[]}o(cT,"uniqWith");function pm(a){if(!(a&&a.length))return[];var c=0;return a=_s(a,function(p){if(gr(p))return c=Er(p.length,c),!0}),Dp(c,function(p){return fr(a,Cp(p))})}o(pm,"unzip");function yy(a,c){if(!(a&&a.length))return[];var p=pm(a);return c==null?p:fr(p,function(M){return On(c,r,M)})}o(yy,"unzipWith");var uT=Mt(function(a,c){return gr(a)?cu(a,c):[]}),lT=Mt(function(a){return Zp(_s(a,gr))}),hT=Mt(function(a){var c=hi(a);return gr(c)&&(c=r),Zp(_s(a,gr),Xe(c,2))}),dT=Mt(function(a){var c=hi(a);return c=typeof c=="function"?c:r,Zp(_s(a,gr),r,c)}),pT=Mt(pm);function mT(a,c){return Bv(a||[],c||[],fu)}o(mT,"zipObject");function bT(a,c){return Bv(a||[],c||[],hu)}o(bT,"zipObjectDeep");var gT=Mt(function(a){var c=a.length,p=c>1?a[c-1]:r;return p=typeof p=="function"?(a.pop(),p):r,yy(a,p)});function xy(a){var c=q(a);return c.__chain__=!0,c}o(xy,"chain");function vT(a,c){return c(a),a}o(vT,"tap");function xh(a,c){return c(a)}o(xh,"thru");var yT=zo(function(a){var c=a.length,p=c?a[0]:0,M=this.__wrapped__,U=o(function(j){return Fp(j,a)},"interceptor");return c>1||this.__actions__.length||!(M instanceof Rt)||!Ko(p)?this.thru(U):(M=M.slice(p,+p+(c?1:0)),M.__actions__.push({func:xh,args:[U],thisArg:r}),new ci(M,this.__chain__).thru(function(j){return c&&!j.length&&j.push(r),j}))});function xT(){return xy(this)}o(xT,"wrapperChain");function wT(){return new ci(this.value(),this.__chain__)}o(wT,"wrapperCommit");function _T(){this.__values__===r&&(this.__values__=Ny(this.value()));var a=this.__index__>=this.__values__.length,c=a?r:this.__values__[this.__index__++];return{done:a,value:c}}o(_T,"wrapperNext");function ET(){return this}o(ET,"wrapperToIterator");function AT(a){for(var c,p=this;p instanceof oh;){var M=dy(p);M.__index__=0,M.__values__=r,c?U.__wrapped__=M:c=M;var U=M;p=p.__wrapped__}return U.__wrapped__=a,c}o(AT,"wrapperPlant");function ST(){var a=this.__wrapped__;if(a instanceof Rt){var c=a;return this.__actions__.length&&(c=new Rt(this)),c=c.reverse(),c.__actions__.push({func:xh,args:[dm],thisArg:r}),new ci(c,this.__chain__)}return this.thru(dm)}o(ST,"wrapperReverse");function MT(){return Lv(this.__wrapped__,this.__actions__)}o(MT,"wrapperValue");var TT=hh(function(a,c,p){Wt.call(a,p)?++a[p]:qo(a,p,1)});function CT(a,c,p){var M=yt(a)?J2:vS;return p&&fn(a,c,p)&&(c=r),M(a,Xe(c,3))}o(CT,"every");function kT(a,c){var p=yt(a)?_s:yv;return p(a,Xe(c,3))}o(kT,"filter");var IT=Vv(py),DT=Vv(my);function RT(a,c){return Fr(wh(a,c),1)}o(RT,"flatMap");function OT(a,c){return Fr(wh(a,c),m)}o(OT,"flatMapDeep");function NT(a,c,p){return p=p===r?1:_t(p),Fr(wh(a,c),p)}o(NT,"flatMapDepth");function wy(a,c){var p=yt(a)?ai:Ts;return p(a,Xe(c,3))}o(wy,"forEach");function _y(a,c){var p=yt(a)?Q7:vv;return p(a,Xe(c,3))}o(_y,"forEachRight");var PT=hh(function(a,c,p){Wt.call(a,p)?a[p].push(c):qo(a,p,[c])});function LT(a,c,p,M){a=vn(a)?a:zf(a),p=p&&!M?_t(p):0;var U=a.length;return p<0&&(p=Er(U+p,0)),Mh(a)?p<=U&&a.indexOf(c,p)>-1:!!U&&Rf(a,c,p)>-1}o(LT,"includes");var BT=Mt(function(a,c,p){var M=-1,U=typeof c=="function",j=vn(a)?xe(a.length):[];return Ts(a,function(re){j[++M]=U?On(c,re,p):uu(re,c,p)}),j}),UT=hh(function(a,c,p){qo(a,p,c)});function wh(a,c){var p=yt(a)?fr:Sv;return p(a,Xe(c,3))}o(wh,"map");function FT(a,c,p,M){return a==null?[]:(yt(c)||(c=c==null?[]:[c]),p=M?r:p,yt(p)||(p=p==null?[]:[p]),kv(a,c,p))}o(FT,"orderBy");var $T=hh(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function qT(a,c,p){var M=yt(a)?Mp:Q2,U=arguments.length<3;return M(a,Xe(c,4),p,U,Ts)}o(qT,"reduce");function HT(a,c,p){var M=yt(a)?eA:Q2,U=arguments.length<3;return M(a,Xe(c,4),p,U,vv)}o(HT,"reduceRight");function zT(a,c){var p=yt(a)?_s:yv;return p(a,Ah(Xe(c,3)))}o(zT,"reject");function KT(a){var c=yt(a)?pv:LS;return c(a)}o(KT,"sample");function jT(a,c,p){(p?fn(a,c,p):c===r)?c=1:c=_t(c);var M=yt(a)?dS:BS;return M(a,c)}o(jT,"sampleSize");function GT(a){var c=yt(a)?pS:FS;return c(a)}o(GT,"shuffle");function VT(a){if(a==null)return 0;if(vn(a))return Mh(a)?Nf(a):a.length;var c=Wr(a);return c==ae||c==W?a.size:jp(a).length}o(VT,"size");function WT(a,c,p){var M=yt(a)?Tp:$S;return p&&fn(a,c,p)&&(c=r),M(a,Xe(c,3))}o(WT,"some");var JT=Mt(function(a,c){if(a==null)return[];var p=c.length;return p>1&&fn(a,c[0],c[1])?c=[]:p>2&&fn(c[0],c[1],c[2])&&(c=[c[0]]),kv(a,Fr(c,1),[])}),_h=kA||function(){return Mr.Date.now()};function YT(a,c){if(typeof c!="function")throw new fi(i);return a=_t(a),function(){if(--a<1)return c.apply(this,arguments)}}o(YT,"after");function Ey(a,c,p){return c=p?r:c,c=a&&c==null?a.length:c,Ho(a,ie,r,r,r,r,c)}o(Ey,"ary");function Ay(a,c){var p;if(typeof c!="function")throw new fi(i);return a=_t(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=r),p}}o(Ay,"before");var mm=Mt(function(a,c,p){var M=I;if(p.length){var U=As(p,qf(mm));M|=ee}return Ho(a,M,c,p,U)}),Sy=Mt(function(a,c,p){var M=I|P;if(p.length){var U=As(p,qf(Sy));M|=ee}return Ho(c,M,a,p,U)});function My(a,c,p){c=p?r:c;var M=Ho(a,B,r,r,r,r,r,c);return M.placeholder=My.placeholder,M}o(My,"curry");function Ty(a,c,p){c=p?r:c;var M=Ho(a,J,r,r,r,r,r,c);return M.placeholder=Ty.placeholder,M}o(Ty,"curryRight");function Cy(a,c,p){var M,U,j,re,ce,be,Te=0,Ce=!1,De=!1,Be=!0;if(typeof a!="function")throw new fi(i);c=di(c)||0,cr(p)&&(Ce=!!p.leading,De="maxWait"in p,j=De?Er(di(p.maxWait)||0,c):j,Be="trailing"in p?!!p.trailing:Be);function Ke(vr){var Li=M,Vo=U;return M=U=r,Te=vr,re=a.apply(Vo,Li),re}o(Ke,"invokeFunc");function Qe(vr){return Te=vr,ce=mu(kt,c),Ce?Ke(vr):re}o(Qe,"leadingEdge");function Et(vr){var Li=vr-be,Vo=vr-Te,Vy=c-Li;return De?Vr(Vy,j-Vo):Vy}o(Et,"remainingWait");function et(vr){var Li=vr-be,Vo=vr-Te;return be===r||Li>=c||Li<0||De&&Vo>=j}o(et,"shouldInvoke");function kt(){var vr=_h();if(et(vr))return Nt(vr);ce=mu(kt,Et(vr))}o(kt,"timerExpired");function Nt(vr){return ce=r,Be&&M?Ke(vr):(M=U=r,re)}o(Nt,"trailingEdge");function Bn(){ce!==r&&Uv(ce),Te=0,M=be=U=ce=r}o(Bn,"cancel");function cn(){return ce===r?re:Nt(_h())}o(cn,"flush");function Un(){var vr=_h(),Li=et(vr);if(M=arguments,U=this,be=vr,Li){if(ce===r)return Qe(be);if(De)return Uv(ce),ce=mu(kt,c),Ke(be)}return ce===r&&(ce=mu(kt,c)),re}return o(Un,"debounced"),Un.cancel=Bn,Un.flush=cn,Un}o(Cy,"debounce");var XT=Mt(function(a,c){return gv(a,1,c)}),ZT=Mt(function(a,c,p){return gv(a,di(c)||0,p)});function QT(a){return Ho(a,$)}o(QT,"flip");function Eh(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new fi(i);var p=o(function(){var M=arguments,U=c?c.apply(this,M):M[0],j=p.cache;if(j.has(U))return j.get(U);var re=a.apply(this,M);return p.cache=j.set(U,re)||j,re},"memoized");return p.cache=new(Eh.Cache||$o),p}o(Eh,"memoize"),Eh.Cache=$o;function Ah(a){if(typeof a!="function")throw new fi(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}o(Ah,"negate");function eC(a){return Ay(2,a)}o(eC,"once");var tC=qS(function(a,c){c=c.length==1&&yt(c[0])?fr(c[0],Nn(Xe())):fr(Fr(c,1),Nn(Xe()));var p=c.length;return Mt(function(M){for(var U=-1,j=Vr(M.length,p);++U<j;)M[U]=c[U].call(this,M[U]);return On(a,this,M)})}),bm=Mt(function(a,c){var p=As(c,qf(bm));return Ho(a,ee,r,c,p)}),ky=Mt(function(a,c){var p=As(c,qf(ky));return Ho(a,Y,r,c,p)}),rC=zo(function(a,c){return Ho(a,G,r,r,r,c)});function nC(a,c){if(typeof a!="function")throw new fi(i);return c=c===r?c:_t(c),Mt(a,c)}o(nC,"rest");function iC(a,c){if(typeof a!="function")throw new fi(i);return c=c==null?0:Er(_t(c),0),Mt(function(p){var M=p[c],U=Is(p,0,c);return M&&Es(U,M),On(a,this,U)})}o(iC,"spread");function oC(a,c,p){var M=!0,U=!0;if(typeof a!="function")throw new fi(i);return cr(p)&&(M="leading"in p?!!p.leading:M,U="trailing"in p?!!p.trailing:U),Cy(a,c,{leading:M,maxWait:c,trailing:U})}o(oC,"throttle");function sC(a){return Ey(a,1)}o(sC,"unary");function aC(a,c){return bm(em(c),a)}o(aC,"wrap");function fC(){if(!arguments.length)return[];var a=arguments[0];return yt(a)?a:[a]}o(fC,"castArray");function cC(a){return ui(a,E)}o(cC,"clone");function uC(a,c){return c=typeof c=="function"?c:r,ui(a,E,c)}o(uC,"cloneWith");function lC(a){return ui(a,g|E)}o(lC,"cloneDeep");function hC(a,c){return c=typeof c=="function"?c:r,ui(a,g|E,c)}o(hC,"cloneDeepWith");function dC(a,c){return c==null||bv(a,c,Tr(c))}o(dC,"conformsTo");function Pi(a,c){return a===c||a!==a&&c!==c}o(Pi,"eq");var pC=bh(Hp),mC=bh(function(a,c){return a>=c}),ka=_v(function(){return arguments}())?_v:function(a){return ur(a)&&Wt.call(a,"callee")&&!fv.call(a,"callee")},yt=xe.isArray,bC=z2?Nn(z2):AS;function vn(a){return a!=null&&Sh(a.length)&&!jo(a)}o(vn,"isArrayLike");function gr(a){return ur(a)&&vn(a)}o(gr,"isArrayLikeObject");function gC(a){return a===!0||a===!1||ur(a)&&an(a)==Q}o(gC,"isBoolean");var Ds=DA||Tm,vC=K2?Nn(K2):SS;function yC(a){return ur(a)&&a.nodeType===1&&!bu(a)}o(yC,"isElement");function xC(a){if(a==null)return!0;if(vn(a)&&(yt(a)||typeof a=="string"||typeof a.splice=="function"||Ds(a)||Hf(a)||ka(a)))return!a.length;var c=Wr(a);if(c==ae||c==W)return!a.size;if(pu(a))return!jp(a).length;for(var p in a)if(Wt.call(a,p))return!1;return!0}o(xC,"isEmpty");function wC(a,c){return lu(a,c)}o(wC,"isEqual");function _C(a,c,p){p=typeof p=="function"?p:r;var M=p?p(a,c):r;return M===r?lu(a,c,r,p):!!M}o(_C,"isEqualWith");function gm(a){if(!ur(a))return!1;var c=an(a);return c==z||c==H||typeof a.message=="string"&&typeof a.name=="string"&&!bu(a)}o(gm,"isError");function EC(a){return typeof a=="number"&&uv(a)}o(EC,"isFinite");function jo(a){if(!cr(a))return!1;var c=an(a);return c==V||c==te||c==D||c==ue}o(jo,"isFunction");function Iy(a){return typeof a=="number"&&a==_t(a)}o(Iy,"isInteger");function Sh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=_}o(Sh,"isLength");function cr(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}o(cr,"isObject");function ur(a){return a!=null&&typeof a=="object"}o(ur,"isObjectLike");var Dy=j2?Nn(j2):TS;function AC(a,c){return a===c||Kp(a,c,am(c))}o(AC,"isMatch");function SC(a,c,p){return p=typeof p=="function"?p:r,Kp(a,c,am(c),p)}o(SC,"isMatchWith");function MC(a){return Ry(a)&&a!=+a}o(MC,"isNaN");function TC(a){if(uM(a))throw new gt(n);return Ev(a)}o(TC,"isNative");function CC(a){return a===null}o(CC,"isNull");function kC(a){return a==null}o(kC,"isNil");function Ry(a){return typeof a=="number"||ur(a)&&an(a)==Ae}o(Ry,"isNumber");function bu(a){if(!ur(a)||an(a)!=ne)return!1;var c=Zl(a);if(c===null)return!0;var p=Wt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Wl.call(p)==SA}o(bu,"isPlainObject");var vm=G2?Nn(G2):CS;function IC(a){return Iy(a)&&a>=-_&&a<=_}o(IC,"isSafeInteger");var Oy=V2?Nn(V2):kS;function Mh(a){return typeof a=="string"||!yt(a)&&ur(a)&&an(a)==pe}o(Mh,"isString");function Ln(a){return typeof a=="symbol"||ur(a)&&an(a)==ke}o(Ln,"isSymbol");var Hf=W2?Nn(W2):IS;function DC(a){return a===r}o(DC,"isUndefined");function RC(a){return ur(a)&&Wr(a)==Ne}o(RC,"isWeakMap");function OC(a){return ur(a)&&an(a)==We}o(OC,"isWeakSet");var NC=bh(Gp),PC=bh(function(a,c){return a<=c});function Ny(a){if(!a)return[];if(vn(a))return Mh(a)?Oi(a):gn(a);if(nu&&a[nu])return dA(a[nu]());var c=Wr(a),p=c==ae?Op:c==W?jl:zf;return p(a)}o(Ny,"toArray");function Go(a){if(!a)return a===0?a:0;if(a=di(a),a===m||a===-m){var c=a<0?-1:1;return c*S}return a===a?a:0}o(Go,"toFinite");function _t(a){var c=Go(a),p=c%1;return c===c?p?c-p:c:0}o(_t,"toInteger");function Py(a){return a?Sa(_t(a),0,v):0}o(Py,"toLength");function di(a){if(typeof a=="number")return a;if(Ln(a))return A;if(cr(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=cr(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=ev(a);var p=qt.test(a);return p||dn.test(a)?Y7(a.slice(2),p?2:8):Rn.test(a)?A:+a}o(di,"toNumber");function Ly(a){return so(a,yn(a))}o(Ly,"toPlainObject");function LC(a){return a?Sa(_t(a),-_,_):a===0?a:0}o(LC,"toSafeInteger");function jt(a){return a==null?"":Pn(a)}o(jt,"toString");var BC=Ff(function(a,c){if(pu(c)||vn(c)){so(c,Tr(c),a);return}for(var p in c)Wt.call(c,p)&&fu(a,p,c[p])}),By=Ff(function(a,c){so(c,yn(c),a)}),Th=Ff(function(a,c,p,M){so(c,yn(c),a,M)}),UC=Ff(function(a,c,p,M){so(c,Tr(c),a,M)}),FC=zo(Fp);function $C(a,c){var p=Uf(a);return c==null?p:mv(p,c)}o($C,"create");var qC=Mt(function(a,c){a=Qt(a);var p=-1,M=c.length,U=M>2?c[2]:r;for(U&&fn(c[0],c[1],U)&&(M=1);++p<M;)for(var j=c[p],re=yn(j),ce=-1,be=re.length;++ce<be;){var Te=re[ce],Ce=a[Te];(Ce===r||Pi(Ce,Pf[Te])&&!Wt.call(a,Te))&&(a[Te]=j[Te])}return a}),HC=Mt(function(a){return a.push(r,ey),On(Uy,r,a)});function zC(a,c){return Y2(a,Xe(c,3),oo)}o(zC,"findKey");function KC(a,c){return Y2(a,Xe(c,3),qp)}o(KC,"findLastKey");function jC(a,c){return a==null?a:$p(a,Xe(c,3),yn)}o(jC,"forIn");function GC(a,c){return a==null?a:xv(a,Xe(c,3),yn)}o(GC,"forInRight");function VC(a,c){return a&&oo(a,Xe(c,3))}o(VC,"forOwn");function WC(a,c){return a&&qp(a,Xe(c,3))}o(WC,"forOwnRight");function JC(a){return a==null?[]:fh(a,Tr(a))}o(JC,"functions");function YC(a){return a==null?[]:fh(a,yn(a))}o(YC,"functionsIn");function ym(a,c,p){var M=a==null?r:Ma(a,c);return M===r?p:M}o(ym,"get");function XC(a,c){return a!=null&&ny(a,c,xS)}o(XC,"has");function xm(a,c){return a!=null&&ny(a,c,wS)}o(xm,"hasIn");var ZC=Jv(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Jl.call(c)),a[c]=p},_m(xn)),QC=Jv(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Jl.call(c)),Wt.call(a,c)?a[c].push(p):a[c]=[p]},Xe),ek=Mt(uu);function Tr(a){return vn(a)?dv(a):jp(a)}o(Tr,"keys");function yn(a){return vn(a)?dv(a,!0):DS(a)}o(yn,"keysIn");function tk(a,c){var p={};return c=Xe(c,3),oo(a,function(M,U,j){qo(p,c(M,U,j),M)}),p}o(tk,"mapKeys");function rk(a,c){var p={};return c=Xe(c,3),oo(a,function(M,U,j){qo(p,U,c(M,U,j))}),p}o(rk,"mapValues");var nk=Ff(function(a,c,p){ch(a,c,p)}),Uy=Ff(function(a,c,p,M){ch(a,c,p,M)}),ik=zo(function(a,c){var p={};if(a==null)return p;var M=!1;c=fr(c,function(j){return j=ks(j,a),M||(M=j.length>1),j}),so(a,om(a),p),M&&(p=ui(p,g|y|E,ZS));for(var U=c.length;U--;)Xp(p,c[U]);return p});function ok(a,c){return Fy(a,Ah(Xe(c)))}o(ok,"omitBy");var sk=zo(function(a,c){return a==null?{}:OS(a,c)});function Fy(a,c){if(a==null)return{};var p=fr(om(a),function(M){return[M]});return c=Xe(c),Iv(a,p,function(M,U){return c(M,U[0])})}o(Fy,"pickBy");function ak(a,c,p){c=ks(c,a);var M=-1,U=c.length;for(U||(U=1,a=r);++M<U;){var j=a==null?r:a[ao(c[M])];j===r&&(M=U,j=p),a=jo(j)?j.call(a):j}return a}o(ak,"result");function fk(a,c,p){return a==null?a:hu(a,c,p)}o(fk,"set");function ck(a,c,p,M){return M=typeof M=="function"?M:r,a==null?a:hu(a,c,p,M)}o(ck,"setWith");var $y=Zv(Tr),qy=Zv(yn);function uk(a,c,p){var M=yt(a),U=M||Ds(a)||Hf(a);if(c=Xe(c,4),p==null){var j=a&&a.constructor;U?p=M?new j:[]:cr(a)?p=jo(j)?Uf(Zl(a)):{}:p={}}return(U?ai:oo)(a,function(re,ce,be){return c(p,re,ce,be)}),p}o(uk,"transform");function lk(a,c){return a==null?!0:Xp(a,c)}o(lk,"unset");function hk(a,c,p){return a==null?a:Pv(a,c,em(p))}o(hk,"update");function dk(a,c,p,M){return M=typeof M=="function"?M:r,a==null?a:Pv(a,c,em(p),M)}o(dk,"updateWith");function zf(a){return a==null?[]:Rp(a,Tr(a))}o(zf,"values");function pk(a){return a==null?[]:Rp(a,yn(a))}o(pk,"valuesIn");function mk(a,c,p){return p===r&&(p=c,c=r),p!==r&&(p=di(p),p=p===p?p:0),c!==r&&(c=di(c),c=c===c?c:0),Sa(di(a),c,p)}o(mk,"clamp");function bk(a,c,p){return c=Go(c),p===r?(p=c,c=0):p=Go(p),a=di(a),_S(a,c,p)}o(bk,"inRange");function gk(a,c,p){if(p&&typeof p!="boolean"&&fn(a,c,p)&&(c=p=r),p===r&&(typeof c=="boolean"?(p=c,c=r):typeof a=="boolean"&&(p=a,a=r)),a===r&&c===r?(a=0,c=1):(a=Go(a),c===r?(c=a,a=0):c=Go(c)),a>c){var M=a;a=c,c=M}if(p||a%1||c%1){var U=lv();return Vr(a+U*(c-a+J7("1e-"+((U+"").length-1))),c)}return Wp(a,c)}o(gk,"random");var vk=$f(function(a,c,p){return c=c.toLowerCase(),a+(p?Hy(c):c)});function Hy(a){return wm(jt(a).toLowerCase())}o(Hy,"capitalize");function zy(a){return a=jt(a),a&&a.replace(mn,fA).replace(F7,"")}o(zy,"deburr");function yk(a,c,p){a=jt(a),c=Pn(c);var M=a.length;p=p===r?M:Sa(_t(p),0,M);var U=p;return p-=c.length,p>=0&&a.slice(p,U)==c}o(yk,"endsWith");function xk(a){return a=jt(a),a&&ot.test(a)?a.replace(Dn,cA):a}o(xk,"escape");function wk(a){return a=jt(a),a&&ct.test(a)?a.replace(hn,"\\$&"):a}o(wk,"escapeRegExp");var _k=$f(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),Ek=$f(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),Ak=Gv("toLowerCase");function Sk(a,c,p){a=jt(a),c=_t(c);var M=c?Nf(a):0;if(!c||M>=c)return a;var U=(c-M)/2;return mh(rh(U),p)+a+mh(th(U),p)}o(Sk,"pad");function Mk(a,c,p){a=jt(a),c=_t(c);var M=c?Nf(a):0;return c&&M<c?a+mh(c-M,p):a}o(Mk,"padEnd");function Tk(a,c,p){a=jt(a),c=_t(c);var M=c?Nf(a):0;return c&&M<c?mh(c-M,p)+a:a}o(Tk,"padStart");function Ck(a,c,p){return p||c==null?c=0:c&&(c=+c),PA(jt(a).replace(Ze,""),c||0)}o(Ck,"parseInt");function kk(a,c,p){return(p?fn(a,c,p):c===r)?c=1:c=_t(c),Jp(jt(a),c)}o(kk,"repeat");function Ik(){var a=arguments,c=jt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}o(Ik,"replace");var Dk=$f(function(a,c,p){return a+(p?"_":"")+c.toLowerCase()});function Rk(a,c,p){return p&&typeof p!="number"&&fn(a,c,p)&&(c=p=r),p=p===r?v:p>>>0,p?(a=jt(a),a&&(typeof c=="string"||c!=null&&!vm(c))&&(c=Pn(c),!c&&Of(a))?Is(Oi(a),0,p):a.split(c,p)):[]}o(Rk,"split");var Ok=$f(function(a,c,p){return a+(p?" ":"")+wm(c)});function Nk(a,c,p){return a=jt(a),p=p==null?0:Sa(_t(p),0,a.length),c=Pn(c),a.slice(p,p+c.length)==c}o(Nk,"startsWith");function Pk(a,c,p){var M=q.templateSettings;p&&fn(a,c,p)&&(c=r),a=jt(a),c=Th({},c,M,Qv);var U=Th({},c.imports,M.imports,Qv),j=Tr(U),re=Rp(U,j),ce,be,Te=0,Ce=c.interpolate||Ur,De="__p += '",Be=Np((c.escape||Ur).source+"|"+Ce.source+"|"+(Ce===tt?pt:Ur).source+"|"+(c.evaluate||Ur).source+"|$","g"),Ke="//# sourceURL="+(Wt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++K7+"]")+`
4
4
  `;a.replace(Be,function(et,kt,Nt,Bn,cn,Un){return Nt||(Nt=Bn),De+=a.slice(Te,Un).replace(bn,uA),kt&&(ce=!0,De+=`' +
5
5
  __e(`+kt+`) +
6
6
  '`),cn&&(be=!0,De+=`';
@@ -17,7 +17,7 @@ __p += '`),Nt&&(De+=`' +
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+De+`return __p
20
- }`;var Et=jy(function(){return zt(j,Ke+"return "+De).apply(r,re)});if(Et.source=De,gm(Et))throw Et;return Et}o(Pk,"template");function Lk(a){return jt(a).toLowerCase()}o(Lk,"toLower");function Bk(a){return jt(a).toUpperCase()}o(Bk,"toUpper");function Uk(a,c,p){if(a=jt(a),a&&(p||c===r))return ev(a);if(!a||!(c=Pn(c)))return a;var M=Oi(a),U=Oi(c),j=tv(M,U),re=rv(M,U)+1;return Is(M,j,re).join("")}o(Uk,"trim");function Fk(a,c,p){if(a=jt(a),a&&(p||c===r))return a.slice(0,iv(a)+1);if(!a||!(c=Pn(c)))return a;var M=Oi(a),U=rv(M,Oi(c))+1;return Is(M,0,U).join("")}o(Fk,"trimEnd");function $k(a,c,p){if(a=jt(a),a&&(p||c===r))return a.replace(Ze,"");if(!a||!(c=Pn(c)))return a;var M=Oi(a),U=tv(M,Oi(c));return Is(M,U).join("")}o($k,"trimStart");function qk(a,c){var p=K,M=he;if(cr(c)){var U="separator"in c?c.separator:U;p="length"in c?_t(c.length):p,M="omission"in c?Pn(c.omission):M}a=jt(a);var j=a.length;if(Of(a)){var re=Oi(a);j=re.length}if(p>=j)return a;var ce=p-Nf(M);if(ce<1)return M;var be=re?Is(re,0,ce).join(""):a.slice(0,ce);if(U===r)return be+M;if(re&&(ce+=be.length-ce),vm(U)){if(a.slice(ce).search(U)){var Te,Ce=be;for(U.global||(U=Np(U.source,jt(rt.exec(U))+"g")),U.lastIndex=0;Te=U.exec(Ce);)var De=Te.index;be=be.slice(0,De===r?ce:De)}}else if(a.indexOf(Pn(U),ce)!=ce){var Be=be.lastIndexOf(U);Be>-1&&(be=be.slice(0,Be))}return be+M}o(qk,"truncate");function Hk(a){return a=jt(a),a&&it.test(a)?a.replace(Ye,gA):a}o(Hk,"unescape");var zk=$f(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),wm=Gv("toUpperCase");function Ky(a,c,p){return a=jt(a),c=p?r:c,c===r?hA(a)?xA(a):nA(a):a.match(c)||[]}o(Ky,"words");var jy=Mt(function(a,c){try{return On(a,r,c)}catch(p){return gm(p)?p:new gt(p)}}),Kk=zo(function(a,c){return ai(c,function(p){p=ao(p),qo(a,p,mm(a[p],a))}),a});function jk(a){var c=a==null?0:a.length,p=Xe();return a=c?fr(a,function(M){if(typeof M[1]!="function")throw new fi(i);return[p(M[0]),M[1]]}):[],Mt(function(M){for(var U=-1;++U<c;){var j=a[U];if(On(j[0],this,M))return On(j[1],this,M)}})}o(jk,"cond");function Gk(a){return gS(ui(a,g))}o(Gk,"conforms");function _m(a){return function(){return a}}o(_m,"constant");function Vk(a,c){return a==null||a!==a?c:a}o(Vk,"defaultTo");var Wk=Wv(),Jk=Wv(!0);function xn(a){return a}o(xn,"identity");function Em(a){return Av(typeof a=="function"?a:ui(a,g))}o(Em,"iteratee");function Yk(a){return Mv(ui(a,g))}o(Yk,"matches");function Xk(a,c){return Tv(a,ui(c,g))}o(Xk,"matchesProperty");var Zk=Mt(function(a,c){return function(p){return uu(p,a,c)}}),Qk=Mt(function(a,c){return function(p){return uu(a,p,c)}});function Am(a,c,p){var M=Tr(c),U=fh(c,M);p==null&&!(cr(c)&&(U.length||!M.length))&&(p=c,c=a,a=this,U=fh(c,Tr(c)));var j=!(cr(p)&&"chain"in p)||!!p.chain,re=jo(a);return ai(U,function(ce){var be=c[ce];a[ce]=be,re&&(a.prototype[ce]=function(){var Te=this.__chain__;if(j||Te){var Ce=a(this.__wrapped__),De=Ce.__actions__=gn(this.__actions__);return De.push({func:be,args:arguments,thisArg:a}),Ce.__chain__=Te,Ce}return be.apply(a,Es([this.value()],arguments))})}),a}o(Am,"mixin");function eI(){return Mr._===this&&(Mr._=MA),this}o(eI,"noConflict");function Sm(){}o(Sm,"noop");function tI(a){return a=_t(a),Mt(function(c){return Cv(c,a)})}o(tI,"nthArg");var rI=rm(fr),nI=rm(J2),iI=rm(Tp);function Gy(a){return cm(a)?Cp(ao(a)):NS(a)}o(Gy,"property");function oI(a){return function(c){return a==null?r:Ma(a,c)}}o(oI,"propertyOf");var sI=Yv(),aI=Yv(!0);function Mm(){return[]}o(Mm,"stubArray");function Tm(){return!1}o(Tm,"stubFalse");function fI(){return{}}o(fI,"stubObject");function cI(){return""}o(cI,"stubString");function uI(){return!0}o(uI,"stubTrue");function lI(a,c){if(a=_t(a),a<1||a>_)return[];var p=v,M=Vr(a,v);c=Xe(c),a-=v;for(var U=Dp(M,c);++p<a;)c(p);return U}o(lI,"times");function hI(a){return yt(a)?fr(a,ao):Ln(a)?[a]:gn(hy(jt(a)))}o(hI,"toPath");function dI(a){var c=++AA;return jt(a)+c}o(dI,"uniqueId");var pI=ph(function(a,c){return a+c},0),mI=nm("ceil"),bI=ph(function(a,c){return a/c},1),gI=nm("floor");function vI(a){return a&&a.length?ah(a,xn,Hp):r}o(vI,"max");function yI(a,c){return a&&a.length?ah(a,Xe(c,2),Hp):r}o(yI,"maxBy");function xI(a){return Z2(a,xn)}o(xI,"mean");function wI(a,c){return Z2(a,Xe(c,2))}o(wI,"meanBy");function _I(a){return a&&a.length?ah(a,xn,Gp):r}o(_I,"min");function EI(a,c){return a&&a.length?ah(a,Xe(c,2),Gp):r}o(EI,"minBy");var AI=ph(function(a,c){return a*c},1),SI=nm("round"),MI=ph(function(a,c){return a-c},0);function TI(a){return a&&a.length?Ip(a,xn):0}o(TI,"sum");function CI(a,c){return a&&a.length?Ip(a,Xe(c,2)):0}return o(CI,"sumBy"),q.after=YT,q.ary=Ey,q.assign=BC,q.assignIn=By,q.assignInWith=Th,q.assignWith=UC,q.at=FC,q.before=Ay,q.bind=mm,q.bindAll=Kk,q.bindKey=Sy,q.castArray=fC,q.chain=xy,q.chunk=gM,q.compact=vM,q.concat=yM,q.cond=jk,q.conforms=Gk,q.constant=_m,q.countBy=TT,q.create=$C,q.curry=My,q.curryRight=Ty,q.debounce=Cy,q.defaults=qC,q.defaultsDeep=HC,q.defer=XT,q.delay=ZT,q.difference=xM,q.differenceBy=wM,q.differenceWith=_M,q.drop=EM,q.dropRight=AM,q.dropRightWhile=SM,q.dropWhile=MM,q.fill=TM,q.filter=kT,q.flatMap=RT,q.flatMapDeep=OT,q.flatMapDepth=NT,q.flatten=by,q.flattenDeep=CM,q.flattenDepth=kM,q.flip=QT,q.flow=Wk,q.flowRight=Jk,q.fromPairs=IM,q.functions=JC,q.functionsIn=YC,q.groupBy=PT,q.initial=RM,q.intersection=OM,q.intersectionBy=NM,q.intersectionWith=PM,q.invert=ZC,q.invertBy=QC,q.invokeMap=BT,q.iteratee=Em,q.keyBy=UT,q.keys=Tr,q.keysIn=yn,q.map=wh,q.mapKeys=tk,q.mapValues=rk,q.matches=Yk,q.matchesProperty=Xk,q.memoize=Eh,q.merge=nk,q.mergeWith=Uy,q.method=Zk,q.methodOf=Qk,q.mixin=Am,q.negate=Ah,q.nthArg=tI,q.omit=ik,q.omitBy=ok,q.once=eC,q.orderBy=FT,q.over=rI,q.overArgs=tC,q.overEvery=nI,q.overSome=iI,q.partial=bm,q.partialRight=ky,q.partition=$T,q.pick=sk,q.pickBy=Fy,q.property=Gy,q.propertyOf=oI,q.pull=FM,q.pullAll=vy,q.pullAllBy=$M,q.pullAllWith=qM,q.pullAt=HM,q.range=sI,q.rangeRight=aI,q.rearg=rC,q.reject=zT,q.remove=zM,q.rest=nC,q.reverse=dm,q.sampleSize=jT,q.set=fk,q.setWith=ck,q.shuffle=GT,q.slice=KM,q.sortBy=JT,q.sortedUniq=XM,q.sortedUniqBy=ZM,q.split=Rk,q.spread=iC,q.tail=QM,q.take=eT,q.takeRight=tT,q.takeRightWhile=rT,q.takeWhile=nT,q.tap=vT,q.throttle=oC,q.thru=xh,q.toArray=Ny,q.toPairs=$y,q.toPairsIn=qy,q.toPath=hI,q.toPlainObject=Ly,q.transform=uk,q.unary=sC,q.union=iT,q.unionBy=oT,q.unionWith=sT,q.uniq=aT,q.uniqBy=fT,q.uniqWith=cT,q.unset=lk,q.unzip=pm,q.unzipWith=yy,q.update=hk,q.updateWith=dk,q.values=zf,q.valuesIn=pk,q.without=uT,q.words=Ky,q.wrap=aC,q.xor=lT,q.xorBy=hT,q.xorWith=dT,q.zip=pT,q.zipObject=mT,q.zipObjectDeep=bT,q.zipWith=gT,q.entries=$y,q.entriesIn=qy,q.extend=By,q.extendWith=Th,Am(q,q),q.add=pI,q.attempt=jy,q.camelCase=vk,q.capitalize=Hy,q.ceil=mI,q.clamp=mk,q.clone=cC,q.cloneDeep=lC,q.cloneDeepWith=hC,q.cloneWith=uC,q.conformsTo=dC,q.deburr=zy,q.defaultTo=Vk,q.divide=bI,q.endsWith=yk,q.eq=Pi,q.escape=xk,q.escapeRegExp=wk,q.every=CT,q.find=IT,q.findIndex=py,q.findKey=zC,q.findLast=DT,q.findLastIndex=my,q.findLastKey=KC,q.floor=gI,q.forEach=wy,q.forEachRight=_y,q.forIn=jC,q.forInRight=GC,q.forOwn=VC,q.forOwnRight=WC,q.get=ym,q.gt=pC,q.gte=mC,q.has=XC,q.hasIn=xm,q.head=gy,q.identity=xn,q.includes=LT,q.indexOf=DM,q.inRange=bk,q.invoke=ek,q.isArguments=ka,q.isArray=yt,q.isArrayBuffer=bC,q.isArrayLike=vn,q.isArrayLikeObject=gr,q.isBoolean=gC,q.isBuffer=Ds,q.isDate=vC,q.isElement=yC,q.isEmpty=xC,q.isEqual=wC,q.isEqualWith=_C,q.isError=gm,q.isFinite=EC,q.isFunction=jo,q.isInteger=Iy,q.isLength=Sh,q.isMap=Dy,q.isMatch=AC,q.isMatchWith=SC,q.isNaN=MC,q.isNative=TC,q.isNil=kC,q.isNull=CC,q.isNumber=Ry,q.isObject=cr,q.isObjectLike=ur,q.isPlainObject=bu,q.isRegExp=vm,q.isSafeInteger=IC,q.isSet=Oy,q.isString=Mh,q.isSymbol=Ln,q.isTypedArray=Hf,q.isUndefined=DC,q.isWeakMap=RC,q.isWeakSet=OC,q.join=LM,q.kebabCase=_k,q.last=hi,q.lastIndexOf=BM,q.lowerCase=Ek,q.lowerFirst=Ak,q.lt=NC,q.lte=PC,q.max=vI,q.maxBy=yI,q.mean=xI,q.meanBy=wI,q.min=_I,q.minBy=EI,q.stubArray=Mm,q.stubFalse=Tm,q.stubObject=fI,q.stubString=cI,q.stubTrue=uI,q.multiply=AI,q.nth=UM,q.noConflict=eI,q.noop=Sm,q.now=_h,q.pad=Sk,q.padEnd=Mk,q.padStart=Tk,q.parseInt=Ck,q.random=gk,q.reduce=qT,q.reduceRight=HT,q.repeat=kk,q.replace=Ik,q.result=ak,q.round=SI,q.runInContext=de,q.sample=KT,q.size=VT,q.snakeCase=Dk,q.some=WT,q.sortedIndex=jM,q.sortedIndexBy=GM,q.sortedIndexOf=VM,q.sortedLastIndex=WM,q.sortedLastIndexBy=JM,q.sortedLastIndexOf=YM,q.startCase=Ok,q.startsWith=Nk,q.subtract=MI,q.sum=TI,q.sumBy=CI,q.template=Pk,q.times=lI,q.toFinite=Go,q.toInteger=_t,q.toLength=Py,q.toLower=Lk,q.toNumber=di,q.toSafeInteger=LC,q.toString=jt,q.toUpper=Bk,q.trim=Uk,q.trimEnd=Fk,q.trimStart=$k,q.truncate=qk,q.unescape=Hk,q.uniqueId=dI,q.upperCase=zk,q.upperFirst=wm,q.each=wy,q.eachRight=_y,q.first=gy,Am(q,function(){var a={};return oo(q,function(c,p){Wt.call(q.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),q.VERSION=e,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){q[a].placeholder=q}),ai(["drop","take"],function(a,c){Rt.prototype[a]=function(p){p=p===r?1:Er(_t(p),0);var M=this.__filtered__&&!c?new Rt(this):this.clone();return M.__filtered__?M.__takeCount__=Vr(p,M.__takeCount__):M.__views__.push({size:Vr(p,v),type:a+(M.__dir__<0?"Right":"")}),M},Rt.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),ai(["filter","map","takeWhile"],function(a,c){var p=c+1,M=p==x||p==l;Rt.prototype[a]=function(U){var j=this.clone();return j.__iteratees__.push({iteratee:Xe(U,3),type:p}),j.__filtered__=j.__filtered__||M,j}}),ai(["head","last"],function(a,c){var p="take"+(c?"Right":"");Rt.prototype[a]=function(){return this[p](1).value()[0]}}),ai(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");Rt.prototype[a]=function(){return this.__filtered__?new Rt(this):this[p](1)}}),Rt.prototype.compact=function(){return this.filter(xn)},Rt.prototype.find=function(a){return this.filter(a).head()},Rt.prototype.findLast=function(a){return this.reverse().find(a)},Rt.prototype.invokeMap=Mt(function(a,c){return typeof a=="function"?new Rt(this):this.map(function(p){return uu(p,a,c)})}),Rt.prototype.reject=function(a){return this.filter(Ah(Xe(a)))},Rt.prototype.slice=function(a,c){a=_t(a);var p=this;return p.__filtered__&&(a>0||c<0)?new Rt(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==r&&(c=_t(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Rt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Rt.prototype.toArray=function(){return this.take(v)},oo(Rt.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),M=/^(?:head|last)$/.test(c),U=q[M?"take"+(c=="last"?"Right":""):c],j=M||/^find/.test(c);!U||(q.prototype[c]=function(){var re=this.__wrapped__,ce=M?[1]:arguments,be=re instanceof Rt,Te=ce[0],Ce=be||yt(re),De=o(function(kt){var Nt=U.apply(q,Es([kt],ce));return M&&Be?Nt[0]:Nt},"interceptor");Ce&&p&&typeof Te=="function"&&Te.length!=1&&(be=Ce=!1);var Be=this.__chain__,Ke=!!this.__actions__.length,Qe=j&&!Be,Et=be&&!Ke;if(!j&&Ce){re=Et?re:new Rt(this);var et=a.apply(re,ce);return et.__actions__.push({func:xh,args:[De],thisArg:r}),new ci(et,Be)}return Qe&&Et?a.apply(this,ce):(et=this.thru(De),Qe?M?et.value()[0]:et.value():et)})}),ai(["pop","push","shift","sort","splice","unshift"],function(a){var c=Gl[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",M=/^(?:pop|shift)$/.test(a);q.prototype[a]=function(){var U=arguments;if(M&&!this.__chain__){var j=this.value();return c.apply(yt(j)?j:[],U)}return this[p](function(re){return c.apply(yt(re)?re:[],U)})}}),oo(Rt.prototype,function(a,c){var p=q[c];if(p){var M=p.name+"";Wt.call(Bf,M)||(Bf[M]=[]),Bf[M].push({name:c,func:p})}}),Bf[dh(r,N).name]=[{name:"wrapper",func:r}],Rt.prototype.clone=HA,Rt.prototype.reverse=zA,Rt.prototype.value=KA,q.prototype.at=yT,q.prototype.chain=xT,q.prototype.commit=wT,q.prototype.next=_T,q.prototype.plant=AT,q.prototype.reverse=ST,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=MT,q.prototype.first=q.prototype.head,nu&&(q.prototype[nu]=ET),q},"runInContext"),Ss=wA();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Mr._=Ss,define(function(){return Ss})):wa?((wa.exports=Ss)._=Ss,Ep._=Ss):Mr._=Ss}).call(Kf)});function Ia(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var xu=Gt(()=>{o(Ia,"asUint8Array")});function wu(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ia(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var Ih=Gt(()=>{xu();o(wu,"allocUnsafe")});var Zy={};Yt(Zy,{concat:()=>Bi});function Bi(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=wu(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ia(t)}var Cm=Gt(()=>{Ih();xu();o(Bi,"concat")});function WI(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),f=s.charCodeAt(0);if(t[f]!==255)throw new TypeError(s+" is ambiguous");t[f]=i}var u=r.length,d=r.charAt(0),g=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function E(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 N=0,X=0,L=0,J=I.length;L!==J&&I[L]===0;)L++,N++;for(var ee=(J-L)*y+1>>>0,Y=new Uint8Array(ee);L!==J;){for(var ie=I[L],G=0,$=ee-1;(ie!==0||G<X)&&$!==-1;$--,G++)ie+=256*Y[$]>>>0,Y[$]=ie%u>>>0,ie=ie/u>>>0;if(ie!==0)throw new Error("Non-zero carry");X=G,L++}for(var K=ee-X;K!==ee&&Y[K]===0;)K++;for(var he=d.repeat(N);K<ee;++K)he+=r.charAt(Y[K]);return he}o(E,"encode");function O(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var N=0;if(I[N]!==" "){for(var X=0,L=0;I[N]===d;)X++,N++;for(var J=(I.length-N)*g+1>>>0,ee=new Uint8Array(J);I[N];){var Y=t[I.charCodeAt(N)];if(Y===255)return;for(var ie=0,G=J-1;(Y!==0||ie<L)&&G!==-1;G--,ie++)Y+=u*ee[G]>>>0,ee[G]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");L=ie,N++}if(I[N]!==" "){for(var $=J-L;$!==J&&ee[$]===0;)$++;for(var K=new Uint8Array(X+(J-$)),he=X;$!==J;)K[he++]=ee[$++];return K}}}o(O,"decodeUnsafe");function R(I){var N=O(I);if(N)return N;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:E,decodeUnsafe:O,decode:R}}var JI,YI,Qy,e3=Gt(()=>{o(WI,"base");JI=WI,YI=JI,Qy=YI});var OK,t3,Wo,r3,n3,Rs=Gt(()=>{OK=new Uint8Array(0),t3=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"),Wo=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"),r3=o(r=>new TextEncoder().encode(r),"fromString"),n3=o(r=>new TextDecoder().decode(r),"toString")});var Dh,Rh,Oh,i3,Nh,jf,Os,XI,ZI,lr,Ui=Gt(()=>{e3();Rs();Dh=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(Dh,"Encoder");Rh=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 i3(this,e)}};o(Rh,"Decoder");Oh=class{constructor(e){this.decoders=e}or(e){return i3(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(Oh,"ComposedDecoder");i3=o((r,e)=>new Oh({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),"or"),Nh=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Dh(e,t,n),this.decoder=new Rh(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Nh,"Codec");jf=o(({name:r,prefix:e,encode:t,decode:n})=>new Nh(r,e,t,n),"from"),Os=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Qy(t,e);return jf({prefix:r,name:e,encode:n,decode:s=>Wo(i(s))})},"baseX"),XI=o((r,e,t,n)=>{let i={};for(let y=0;y<e.length;++y)i[e[y]]=y;let s=r.length;for(;r[s-1]==="=";)--s;let f=new Uint8Array(s*t/8|0),u=0,d=0,g=0;for(let y=0;y<s;++y){let E=i[r[y]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|E,u+=t,u>=8&&(u-=8,f[g++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return f},"decode"),ZI=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),lr=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>jf({prefix:e,name:r,encode(i){return ZI(i,n,t)},decode(i){return XI(i,n,t,r)}}),"rfc4648")});var Im={};Yt(Im,{identity:()=>QI});var QI,o3=Gt(()=>{Ui();Rs();QI=jf({prefix:"\0",name:"identity",encode:r=>n3(r),decode:r=>r3(r)})});var Dm={};Yt(Dm,{base2:()=>eD});var eD,s3=Gt(()=>{Ui();eD=lr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Rm={};Yt(Rm,{base8:()=>tD});var tD,a3=Gt(()=>{Ui();tD=lr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Om={};Yt(Om,{base10:()=>rD});var rD,f3=Gt(()=>{Ui();rD=Os({prefix:"9",name:"base10",alphabet:"0123456789"})});var Nm={};Yt(Nm,{base16:()=>nD,base16upper:()=>iD});var nD,iD,c3=Gt(()=>{Ui();nD=lr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),iD=lr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Pm={};Yt(Pm,{base32:()=>Gf,base32hex:()=>fD,base32hexpad:()=>uD,base32hexpadupper:()=>lD,base32hexupper:()=>cD,base32pad:()=>sD,base32padupper:()=>aD,base32upper:()=>oD,base32z:()=>hD});var Gf,oD,sD,aD,fD,cD,uD,lD,hD,Lm=Gt(()=>{Ui();Gf=lr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oD=lr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sD=lr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),aD=lr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),fD=lr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),cD=lr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),uD=lr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),lD=lr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),hD=lr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Bm={};Yt(Bm,{base36:()=>Fi,base36upper:()=>dD});var Fi,dD,Vf=Gt(()=>{Ui();Fi=Os({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),dD=Os({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Um={};Yt(Um,{base58btc:()=>pi,base58flickr:()=>pD});var pi,pD,Ph=Gt(()=>{Ui();pi=Os({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pD=Os({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Fm={};Yt(Fm,{base64:()=>mD,base64pad:()=>bD,base64url:()=>Da,base64urlpad:()=>gD});var mD,bD,Da,gD,Lh=Gt(()=>{Ui();mD=lr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bD=lr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Da=lr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),gD=lr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var $m={};Yt($m,{base256emoji:()=>_D});function xD(r){return r.reduce((e,t)=>(e+=vD[t],e),"")}function wD(r){let e=[];for(let t of r){let n=yD[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var u3,vD,yD,_D,l3=Gt(()=>{Ui();u3=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}"),vD=u3.reduce((r,e,t)=>(r[t]=e,r),[]),yD=u3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(xD,"encode");o(wD,"decode");_D=jf({prefix:"\u{1F680}",name:"base256emoji",encode:xD,decode:wD})});function p3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=MD;)e[t++]=r&255|h3,r/=128;for(;r&SD;)e[t++]=r&255|h3,r>>>=7;return e[t]=r|0,p3.bytes=t-n+1,e}function qm(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw qm.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&d3)<<i:(f&d3)*Math.pow(2,i),i+=7}while(f>=CD);return qm.bytes=s-n,t}var ED,h3,AD,SD,MD,TD,CD,d3,kD,ID,DD,RD,OD,ND,PD,LD,BD,UD,FD,$D,_u,m3=Gt(()=>{ED=p3,h3=128,AD=127,SD=~AD,MD=Math.pow(2,31);o(p3,"encode");TD=qm,CD=128,d3=127;o(qm,"read");kD=Math.pow(2,7),ID=Math.pow(2,14),DD=Math.pow(2,21),RD=Math.pow(2,28),OD=Math.pow(2,35),ND=Math.pow(2,42),PD=Math.pow(2,49),LD=Math.pow(2,56),BD=Math.pow(2,63),UD=o(function(r){return r<kD?1:r<ID?2:r<DD?3:r<RD?4:r<OD?5:r<ND?6:r<PD?7:r<LD?8:r<BD?9:10},"length"),FD={encode:ED,decode:TD,encodingLength:UD},$D=FD,_u=$D});var Eu,Wf,Jf,Uh=Gt(()=>{m3();Eu=o((r,e=0)=>[_u.decode(r,e),_u.decode.bytes],"decode"),Wf=o((r,e,t=0)=>(_u.encode(r,e,t),e),"encodeTo"),Jf=o(r=>_u.encodingLength(r),"encodingLength")});var Jo,Fh,b3,Ra,Oa=Gt(()=>{Rs();Uh();Jo=o((r,e)=>{let t=e.byteLength,n=Jf(r),i=n+Jf(t),s=new Uint8Array(i+t);return Wf(r,s,0),Wf(t,s,n),s.set(e,i),new Ra(r,t,e,s)},"create"),Fh=o(r=>{let e=Wo(r),[t,n]=Eu(e),[i,s]=Eu(e.subarray(n)),f=e.subarray(n+s);if(f.byteLength!==i)throw new Error("Incorrect length");return new Ra(t,i,f,e)},"decode"),b3=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&t3(r.bytes,e.bytes),"equals"),Ra=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Ra,"Digest")});var Hm,$h,zm=Gt(()=>{Oa();Hm=o(({name:r,code:e,encode:t})=>new $h(r,e,t),"from"),$h=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?Jo(this.code,t):t.then(n=>Jo(this.code,n))}else throw Error("Unknown type, must be binary type")}};o($h,"Hasher")});var Km={};Yt(Km,{sha256:()=>Ns,sha512:()=>qD});var v3,Ns,qD,Su=Gt(()=>{zm();v3=o(r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),"sha"),Ns=Hm({name:"sha2-256",code:18,encode:v3("SHA-256")}),qD=Hm({name:"sha2-512",code:19,encode:v3("SHA-512")})});var jm={};Yt(jm,{identity:()=>qh});var y3,HD,x3,zD,qh,Gm=Gt(()=>{Rs();Oa();y3=0,HD="identity",x3=Wo,zD=o(r=>Jo(y3,x3(r)),"digest"),qh={code:y3,name:HD,encode:x3,digest:zD}});var w3=Gt(()=>{Rs()});var ej,tj,_3=Gt(()=>{ej=new TextEncoder,tj=new TextDecoder});var Je,GD,VD,WD,Mu,JD,E3,A3,Hh,zh,YD,XD,ZD,$i=Gt(()=>{Uh();Oa();Ph();Lm();Rs();Je=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:zh,byteLength:zh,code:Hh,version:Hh,multihash:Hh,bytes:Hh,_baseCache:zh,asCID:zh})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Mu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==JD)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Je.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Jo(e,t);return Je.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&&b3(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return VD(t,i,e||pi.encoder);default:return WD(t,i,e||Gf.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 XD(/^0\.0/,ZD),!!(e&&(e[A3]||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 Je)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Je(t,n,i,s||E3(t,n,i.bytes))}else if(e!=null&&e[A3]===!0){let{version:t,multihash:n,code:i}=e,s=Fh(n);return Je.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!==Mu)throw new Error(`Version 0 CID must use dag-pb (code: ${Mu}) block encoding`);return new Je(e,t,n,n.bytes)}case 1:{let i=E3(e,t,n.bytes);return new Je(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Je.create(0,Mu,e)}static createV1(e,t){return Je.create(1,e,t)}static decode(e){let[t,n]=Je.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Je.inspectBytes(e),n=t.size-t.multihashSize,i=Wo(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),f=new Ra(t.multihashCode,t.digestSize,s,i);return[t.version===0?Je.createV0(f):Je.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[E,O]=Eu(e.subarray(t));return t+=O,E},"next"),i=n(),s=Mu;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let f=t,u=n(),d=n(),g=t+d,y=g-f;return{version:i,codec:s,multihashCode:u,digestSize:d,multihashSize:y,size:g}}static parse(e,t){let[n,i]=GD(e,t),s=Je.decode(i);return s._baseCache.set(n,e),s}};o(Je,"CID");GD=o((r,e)=>{switch(r[0]){case"Q":{let t=e||pi;return[pi.prefix,t.decode(`${pi.prefix}${r}`)]}case pi.prefix:{let t=e||pi;return[pi.prefix,t.decode(r)]}case Gf.prefix:{let t=e||Gf;return[Gf.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"),VD=o((r,e,t)=>{let{prefix:n}=t;if(n!==pi.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"),WD=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"),Mu=112,JD=18,E3=o((r,e,t)=>{let n=Jf(r),i=n+Jf(e),s=new Uint8Array(i+t.byteLength);return Wf(r,s,0),Wf(e,s,n),s.set(t,i),s},"encodeCID"),A3=Symbol.for("@ipld/js-cid/CID"),Hh={writable:!1,configurable:!1,enumerable:!0},zh={writable:!1,enumerable:!1,configurable:!1},YD="0.0.0-dev",XD=o((r,e)=>{if(r.test(YD))console.warn(e);else throw new Error(e)},"deprecate"),ZD=`CID.isCID(v) is deprecated and will be removed in the next major release.
20
+ }`;var Et=jy(function(){return zt(j,Ke+"return "+De).apply(r,re)});if(Et.source=De,gm(Et))throw Et;return Et}o(Pk,"template");function Lk(a){return jt(a).toLowerCase()}o(Lk,"toLower");function Bk(a){return jt(a).toUpperCase()}o(Bk,"toUpper");function Uk(a,c,p){if(a=jt(a),a&&(p||c===r))return ev(a);if(!a||!(c=Pn(c)))return a;var M=Oi(a),U=Oi(c),j=tv(M,U),re=rv(M,U)+1;return Is(M,j,re).join("")}o(Uk,"trim");function Fk(a,c,p){if(a=jt(a),a&&(p||c===r))return a.slice(0,iv(a)+1);if(!a||!(c=Pn(c)))return a;var M=Oi(a),U=rv(M,Oi(c))+1;return Is(M,0,U).join("")}o(Fk,"trimEnd");function $k(a,c,p){if(a=jt(a),a&&(p||c===r))return a.replace(Ze,"");if(!a||!(c=Pn(c)))return a;var M=Oi(a),U=tv(M,Oi(c));return Is(M,U).join("")}o($k,"trimStart");function qk(a,c){var p=K,M=he;if(cr(c)){var U="separator"in c?c.separator:U;p="length"in c?_t(c.length):p,M="omission"in c?Pn(c.omission):M}a=jt(a);var j=a.length;if(Of(a)){var re=Oi(a);j=re.length}if(p>=j)return a;var ce=p-Nf(M);if(ce<1)return M;var be=re?Is(re,0,ce).join(""):a.slice(0,ce);if(U===r)return be+M;if(re&&(ce+=be.length-ce),vm(U)){if(a.slice(ce).search(U)){var Te,Ce=be;for(U.global||(U=Np(U.source,jt(rt.exec(U))+"g")),U.lastIndex=0;Te=U.exec(Ce);)var De=Te.index;be=be.slice(0,De===r?ce:De)}}else if(a.indexOf(Pn(U),ce)!=ce){var Be=be.lastIndexOf(U);Be>-1&&(be=be.slice(0,Be))}return be+M}o(qk,"truncate");function Hk(a){return a=jt(a),a&&it.test(a)?a.replace(Ye,gA):a}o(Hk,"unescape");var zk=$f(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),wm=Gv("toUpperCase");function Ky(a,c,p){return a=jt(a),c=p?r:c,c===r?hA(a)?xA(a):nA(a):a.match(c)||[]}o(Ky,"words");var jy=Mt(function(a,c){try{return On(a,r,c)}catch(p){return gm(p)?p:new gt(p)}}),Kk=zo(function(a,c){return ai(c,function(p){p=ao(p),qo(a,p,mm(a[p],a))}),a});function jk(a){var c=a==null?0:a.length,p=Xe();return a=c?fr(a,function(M){if(typeof M[1]!="function")throw new fi(i);return[p(M[0]),M[1]]}):[],Mt(function(M){for(var U=-1;++U<c;){var j=a[U];if(On(j[0],this,M))return On(j[1],this,M)}})}o(jk,"cond");function Gk(a){return gS(ui(a,g))}o(Gk,"conforms");function _m(a){return function(){return a}}o(_m,"constant");function Vk(a,c){return a==null||a!==a?c:a}o(Vk,"defaultTo");var Wk=Wv(),Jk=Wv(!0);function xn(a){return a}o(xn,"identity");function Em(a){return Av(typeof a=="function"?a:ui(a,g))}o(Em,"iteratee");function Yk(a){return Mv(ui(a,g))}o(Yk,"matches");function Xk(a,c){return Tv(a,ui(c,g))}o(Xk,"matchesProperty");var Zk=Mt(function(a,c){return function(p){return uu(p,a,c)}}),Qk=Mt(function(a,c){return function(p){return uu(a,p,c)}});function Am(a,c,p){var M=Tr(c),U=fh(c,M);p==null&&!(cr(c)&&(U.length||!M.length))&&(p=c,c=a,a=this,U=fh(c,Tr(c)));var j=!(cr(p)&&"chain"in p)||!!p.chain,re=jo(a);return ai(U,function(ce){var be=c[ce];a[ce]=be,re&&(a.prototype[ce]=function(){var Te=this.__chain__;if(j||Te){var Ce=a(this.__wrapped__),De=Ce.__actions__=gn(this.__actions__);return De.push({func:be,args:arguments,thisArg:a}),Ce.__chain__=Te,Ce}return be.apply(a,Es([this.value()],arguments))})}),a}o(Am,"mixin");function eI(){return Mr._===this&&(Mr._=MA),this}o(eI,"noConflict");function Sm(){}o(Sm,"noop");function tI(a){return a=_t(a),Mt(function(c){return Cv(c,a)})}o(tI,"nthArg");var rI=rm(fr),nI=rm(J2),iI=rm(Tp);function Gy(a){return cm(a)?Cp(ao(a)):NS(a)}o(Gy,"property");function oI(a){return function(c){return a==null?r:Ma(a,c)}}o(oI,"propertyOf");var sI=Yv(),aI=Yv(!0);function Mm(){return[]}o(Mm,"stubArray");function Tm(){return!1}o(Tm,"stubFalse");function fI(){return{}}o(fI,"stubObject");function cI(){return""}o(cI,"stubString");function uI(){return!0}o(uI,"stubTrue");function lI(a,c){if(a=_t(a),a<1||a>_)return[];var p=v,M=Vr(a,v);c=Xe(c),a-=v;for(var U=Dp(M,c);++p<a;)c(p);return U}o(lI,"times");function hI(a){return yt(a)?fr(a,ao):Ln(a)?[a]:gn(hy(jt(a)))}o(hI,"toPath");function dI(a){var c=++AA;return jt(a)+c}o(dI,"uniqueId");var pI=ph(function(a,c){return a+c},0),mI=nm("ceil"),bI=ph(function(a,c){return a/c},1),gI=nm("floor");function vI(a){return a&&a.length?ah(a,xn,Hp):r}o(vI,"max");function yI(a,c){return a&&a.length?ah(a,Xe(c,2),Hp):r}o(yI,"maxBy");function xI(a){return Z2(a,xn)}o(xI,"mean");function wI(a,c){return Z2(a,Xe(c,2))}o(wI,"meanBy");function _I(a){return a&&a.length?ah(a,xn,Gp):r}o(_I,"min");function EI(a,c){return a&&a.length?ah(a,Xe(c,2),Gp):r}o(EI,"minBy");var AI=ph(function(a,c){return a*c},1),SI=nm("round"),MI=ph(function(a,c){return a-c},0);function TI(a){return a&&a.length?Ip(a,xn):0}o(TI,"sum");function CI(a,c){return a&&a.length?Ip(a,Xe(c,2)):0}return o(CI,"sumBy"),q.after=YT,q.ary=Ey,q.assign=BC,q.assignIn=By,q.assignInWith=Th,q.assignWith=UC,q.at=FC,q.before=Ay,q.bind=mm,q.bindAll=Kk,q.bindKey=Sy,q.castArray=fC,q.chain=xy,q.chunk=gM,q.compact=vM,q.concat=yM,q.cond=jk,q.conforms=Gk,q.constant=_m,q.countBy=TT,q.create=$C,q.curry=My,q.curryRight=Ty,q.debounce=Cy,q.defaults=qC,q.defaultsDeep=HC,q.defer=XT,q.delay=ZT,q.difference=xM,q.differenceBy=wM,q.differenceWith=_M,q.drop=EM,q.dropRight=AM,q.dropRightWhile=SM,q.dropWhile=MM,q.fill=TM,q.filter=kT,q.flatMap=RT,q.flatMapDeep=OT,q.flatMapDepth=NT,q.flatten=by,q.flattenDeep=CM,q.flattenDepth=kM,q.flip=QT,q.flow=Wk,q.flowRight=Jk,q.fromPairs=IM,q.functions=JC,q.functionsIn=YC,q.groupBy=PT,q.initial=RM,q.intersection=OM,q.intersectionBy=NM,q.intersectionWith=PM,q.invert=ZC,q.invertBy=QC,q.invokeMap=BT,q.iteratee=Em,q.keyBy=UT,q.keys=Tr,q.keysIn=yn,q.map=wh,q.mapKeys=tk,q.mapValues=rk,q.matches=Yk,q.matchesProperty=Xk,q.memoize=Eh,q.merge=nk,q.mergeWith=Uy,q.method=Zk,q.methodOf=Qk,q.mixin=Am,q.negate=Ah,q.nthArg=tI,q.omit=ik,q.omitBy=ok,q.once=eC,q.orderBy=FT,q.over=rI,q.overArgs=tC,q.overEvery=nI,q.overSome=iI,q.partial=bm,q.partialRight=ky,q.partition=$T,q.pick=sk,q.pickBy=Fy,q.property=Gy,q.propertyOf=oI,q.pull=FM,q.pullAll=vy,q.pullAllBy=$M,q.pullAllWith=qM,q.pullAt=HM,q.range=sI,q.rangeRight=aI,q.rearg=rC,q.reject=zT,q.remove=zM,q.rest=nC,q.reverse=dm,q.sampleSize=jT,q.set=fk,q.setWith=ck,q.shuffle=GT,q.slice=KM,q.sortBy=JT,q.sortedUniq=XM,q.sortedUniqBy=ZM,q.split=Rk,q.spread=iC,q.tail=QM,q.take=eT,q.takeRight=tT,q.takeRightWhile=rT,q.takeWhile=nT,q.tap=vT,q.throttle=oC,q.thru=xh,q.toArray=Ny,q.toPairs=$y,q.toPairsIn=qy,q.toPath=hI,q.toPlainObject=Ly,q.transform=uk,q.unary=sC,q.union=iT,q.unionBy=oT,q.unionWith=sT,q.uniq=aT,q.uniqBy=fT,q.uniqWith=cT,q.unset=lk,q.unzip=pm,q.unzipWith=yy,q.update=hk,q.updateWith=dk,q.values=zf,q.valuesIn=pk,q.without=uT,q.words=Ky,q.wrap=aC,q.xor=lT,q.xorBy=hT,q.xorWith=dT,q.zip=pT,q.zipObject=mT,q.zipObjectDeep=bT,q.zipWith=gT,q.entries=$y,q.entriesIn=qy,q.extend=By,q.extendWith=Th,Am(q,q),q.add=pI,q.attempt=jy,q.camelCase=vk,q.capitalize=Hy,q.ceil=mI,q.clamp=mk,q.clone=cC,q.cloneDeep=lC,q.cloneDeepWith=hC,q.cloneWith=uC,q.conformsTo=dC,q.deburr=zy,q.defaultTo=Vk,q.divide=bI,q.endsWith=yk,q.eq=Pi,q.escape=xk,q.escapeRegExp=wk,q.every=CT,q.find=IT,q.findIndex=py,q.findKey=zC,q.findLast=DT,q.findLastIndex=my,q.findLastKey=KC,q.floor=gI,q.forEach=wy,q.forEachRight=_y,q.forIn=jC,q.forInRight=GC,q.forOwn=VC,q.forOwnRight=WC,q.get=ym,q.gt=pC,q.gte=mC,q.has=XC,q.hasIn=xm,q.head=gy,q.identity=xn,q.includes=LT,q.indexOf=DM,q.inRange=bk,q.invoke=ek,q.isArguments=ka,q.isArray=yt,q.isArrayBuffer=bC,q.isArrayLike=vn,q.isArrayLikeObject=gr,q.isBoolean=gC,q.isBuffer=Ds,q.isDate=vC,q.isElement=yC,q.isEmpty=xC,q.isEqual=wC,q.isEqualWith=_C,q.isError=gm,q.isFinite=EC,q.isFunction=jo,q.isInteger=Iy,q.isLength=Sh,q.isMap=Dy,q.isMatch=AC,q.isMatchWith=SC,q.isNaN=MC,q.isNative=TC,q.isNil=kC,q.isNull=CC,q.isNumber=Ry,q.isObject=cr,q.isObjectLike=ur,q.isPlainObject=bu,q.isRegExp=vm,q.isSafeInteger=IC,q.isSet=Oy,q.isString=Mh,q.isSymbol=Ln,q.isTypedArray=Hf,q.isUndefined=DC,q.isWeakMap=RC,q.isWeakSet=OC,q.join=LM,q.kebabCase=_k,q.last=hi,q.lastIndexOf=BM,q.lowerCase=Ek,q.lowerFirst=Ak,q.lt=NC,q.lte=PC,q.max=vI,q.maxBy=yI,q.mean=xI,q.meanBy=wI,q.min=_I,q.minBy=EI,q.stubArray=Mm,q.stubFalse=Tm,q.stubObject=fI,q.stubString=cI,q.stubTrue=uI,q.multiply=AI,q.nth=UM,q.noConflict=eI,q.noop=Sm,q.now=_h,q.pad=Sk,q.padEnd=Mk,q.padStart=Tk,q.parseInt=Ck,q.random=gk,q.reduce=qT,q.reduceRight=HT,q.repeat=kk,q.replace=Ik,q.result=ak,q.round=SI,q.runInContext=de,q.sample=KT,q.size=VT,q.snakeCase=Dk,q.some=WT,q.sortedIndex=jM,q.sortedIndexBy=GM,q.sortedIndexOf=VM,q.sortedLastIndex=WM,q.sortedLastIndexBy=JM,q.sortedLastIndexOf=YM,q.startCase=Ok,q.startsWith=Nk,q.subtract=MI,q.sum=TI,q.sumBy=CI,q.template=Pk,q.times=lI,q.toFinite=Go,q.toInteger=_t,q.toLength=Py,q.toLower=Lk,q.toNumber=di,q.toSafeInteger=LC,q.toString=jt,q.toUpper=Bk,q.trim=Uk,q.trimEnd=Fk,q.trimStart=$k,q.truncate=qk,q.unescape=Hk,q.uniqueId=dI,q.upperCase=zk,q.upperFirst=wm,q.each=wy,q.eachRight=_y,q.first=gy,Am(q,function(){var a={};return oo(q,function(c,p){Wt.call(q.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),q.VERSION=e,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){q[a].placeholder=q}),ai(["drop","take"],function(a,c){Rt.prototype[a]=function(p){p=p===r?1:Er(_t(p),0);var M=this.__filtered__&&!c?new Rt(this):this.clone();return M.__filtered__?M.__takeCount__=Vr(p,M.__takeCount__):M.__views__.push({size:Vr(p,v),type:a+(M.__dir__<0?"Right":"")}),M},Rt.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),ai(["filter","map","takeWhile"],function(a,c){var p=c+1,M=p==x||p==l;Rt.prototype[a]=function(U){var j=this.clone();return j.__iteratees__.push({iteratee:Xe(U,3),type:p}),j.__filtered__=j.__filtered__||M,j}}),ai(["head","last"],function(a,c){var p="take"+(c?"Right":"");Rt.prototype[a]=function(){return this[p](1).value()[0]}}),ai(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");Rt.prototype[a]=function(){return this.__filtered__?new Rt(this):this[p](1)}}),Rt.prototype.compact=function(){return this.filter(xn)},Rt.prototype.find=function(a){return this.filter(a).head()},Rt.prototype.findLast=function(a){return this.reverse().find(a)},Rt.prototype.invokeMap=Mt(function(a,c){return typeof a=="function"?new Rt(this):this.map(function(p){return uu(p,a,c)})}),Rt.prototype.reject=function(a){return this.filter(Ah(Xe(a)))},Rt.prototype.slice=function(a,c){a=_t(a);var p=this;return p.__filtered__&&(a>0||c<0)?new Rt(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==r&&(c=_t(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Rt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Rt.prototype.toArray=function(){return this.take(v)},oo(Rt.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),M=/^(?:head|last)$/.test(c),U=q[M?"take"+(c=="last"?"Right":""):c],j=M||/^find/.test(c);!U||(q.prototype[c]=function(){var re=this.__wrapped__,ce=M?[1]:arguments,be=re instanceof Rt,Te=ce[0],Ce=be||yt(re),De=o(function(kt){var Nt=U.apply(q,Es([kt],ce));return M&&Be?Nt[0]:Nt},"interceptor");Ce&&p&&typeof Te=="function"&&Te.length!=1&&(be=Ce=!1);var Be=this.__chain__,Ke=!!this.__actions__.length,Qe=j&&!Be,Et=be&&!Ke;if(!j&&Ce){re=Et?re:new Rt(this);var et=a.apply(re,ce);return et.__actions__.push({func:xh,args:[De],thisArg:r}),new ci(et,Be)}return Qe&&Et?a.apply(this,ce):(et=this.thru(De),Qe?M?et.value()[0]:et.value():et)})}),ai(["pop","push","shift","sort","splice","unshift"],function(a){var c=Gl[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",M=/^(?:pop|shift)$/.test(a);q.prototype[a]=function(){var U=arguments;if(M&&!this.__chain__){var j=this.value();return c.apply(yt(j)?j:[],U)}return this[p](function(re){return c.apply(yt(re)?re:[],U)})}}),oo(Rt.prototype,function(a,c){var p=q[c];if(p){var M=p.name+"";Wt.call(Bf,M)||(Bf[M]=[]),Bf[M].push({name:c,func:p})}}),Bf[dh(r,P).name]=[{name:"wrapper",func:r}],Rt.prototype.clone=HA,Rt.prototype.reverse=zA,Rt.prototype.value=KA,q.prototype.at=yT,q.prototype.chain=xT,q.prototype.commit=wT,q.prototype.next=_T,q.prototype.plant=AT,q.prototype.reverse=ST,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=MT,q.prototype.first=q.prototype.head,nu&&(q.prototype[nu]=ET),q},"runInContext"),Ss=wA();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Mr._=Ss,define(function(){return Ss})):wa?((wa.exports=Ss)._=Ss,Ep._=Ss):Mr._=Ss}).call(Kf)});function Ia(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var xu=Gt(()=>{o(Ia,"asUint8Array")});function wu(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ia(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var Ih=Gt(()=>{xu();o(wu,"allocUnsafe")});var Zy={};Yt(Zy,{concat:()=>Bi});function Bi(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=wu(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ia(t)}var Cm=Gt(()=>{Ih();xu();o(Bi,"concat")});function WI(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),f=s.charCodeAt(0);if(t[f]!==255)throw new TypeError(s+" is ambiguous");t[f]=i}var u=r.length,d=r.charAt(0),g=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function E(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 P=0,X=0,B=0,J=I.length;B!==J&&I[B]===0;)B++,P++;for(var ee=(J-B)*y+1>>>0,Y=new Uint8Array(ee);B!==J;){for(var ie=I[B],G=0,$=ee-1;(ie!==0||G<X)&&$!==-1;$--,G++)ie+=256*Y[$]>>>0,Y[$]=ie%u>>>0,ie=ie/u>>>0;if(ie!==0)throw new Error("Non-zero carry");X=G,B++}for(var K=ee-X;K!==ee&&Y[K]===0;)K++;for(var he=d.repeat(P);K<ee;++K)he+=r.charAt(Y[K]);return he}o(E,"encode");function O(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var P=0;if(I[P]!==" "){for(var X=0,B=0;I[P]===d;)X++,P++;for(var J=(I.length-P)*g+1>>>0,ee=new Uint8Array(J);I[P];){var Y=t[I.charCodeAt(P)];if(Y===255)return;for(var ie=0,G=J-1;(Y!==0||ie<B)&&G!==-1;G--,ie++)Y+=u*ee[G]>>>0,ee[G]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");B=ie,P++}if(I[P]!==" "){for(var $=J-B;$!==J&&ee[$]===0;)$++;for(var K=new Uint8Array(X+(J-$)),he=X;$!==J;)K[he++]=ee[$++];return K}}}o(O,"decodeUnsafe");function R(I){var P=O(I);if(P)return P;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:E,decodeUnsafe:O,decode:R}}var JI,YI,Qy,e3=Gt(()=>{o(WI,"base");JI=WI,YI=JI,Qy=YI});var OK,t3,Wo,r3,n3,Rs=Gt(()=>{OK=new Uint8Array(0),t3=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"),Wo=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"),r3=o(r=>new TextEncoder().encode(r),"fromString"),n3=o(r=>new TextDecoder().decode(r),"toString")});var Dh,Rh,Oh,i3,Nh,jf,Os,XI,ZI,lr,Ui=Gt(()=>{e3();Rs();Dh=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(Dh,"Encoder");Rh=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 i3(this,e)}};o(Rh,"Decoder");Oh=class{constructor(e){this.decoders=e}or(e){return i3(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(Oh,"ComposedDecoder");i3=o((r,e)=>new Oh({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),"or"),Nh=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Dh(e,t,n),this.decoder=new Rh(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Nh,"Codec");jf=o(({name:r,prefix:e,encode:t,decode:n})=>new Nh(r,e,t,n),"from"),Os=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Qy(t,e);return jf({prefix:r,name:e,encode:n,decode:s=>Wo(i(s))})},"baseX"),XI=o((r,e,t,n)=>{let i={};for(let y=0;y<e.length;++y)i[e[y]]=y;let s=r.length;for(;r[s-1]==="=";)--s;let f=new Uint8Array(s*t/8|0),u=0,d=0,g=0;for(let y=0;y<s;++y){let E=i[r[y]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|E,u+=t,u>=8&&(u-=8,f[g++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return f},"decode"),ZI=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),lr=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>jf({prefix:e,name:r,encode(i){return ZI(i,n,t)},decode(i){return XI(i,n,t,r)}}),"rfc4648")});var Im={};Yt(Im,{identity:()=>QI});var QI,o3=Gt(()=>{Ui();Rs();QI=jf({prefix:"\0",name:"identity",encode:r=>n3(r),decode:r=>r3(r)})});var Dm={};Yt(Dm,{base2:()=>eD});var eD,s3=Gt(()=>{Ui();eD=lr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Rm={};Yt(Rm,{base8:()=>tD});var tD,a3=Gt(()=>{Ui();tD=lr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Om={};Yt(Om,{base10:()=>rD});var rD,f3=Gt(()=>{Ui();rD=Os({prefix:"9",name:"base10",alphabet:"0123456789"})});var Nm={};Yt(Nm,{base16:()=>nD,base16upper:()=>iD});var nD,iD,c3=Gt(()=>{Ui();nD=lr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),iD=lr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Pm={};Yt(Pm,{base32:()=>Gf,base32hex:()=>fD,base32hexpad:()=>uD,base32hexpadupper:()=>lD,base32hexupper:()=>cD,base32pad:()=>sD,base32padupper:()=>aD,base32upper:()=>oD,base32z:()=>hD});var Gf,oD,sD,aD,fD,cD,uD,lD,hD,Lm=Gt(()=>{Ui();Gf=lr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oD=lr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sD=lr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),aD=lr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),fD=lr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),cD=lr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),uD=lr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),lD=lr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),hD=lr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Bm={};Yt(Bm,{base36:()=>Fi,base36upper:()=>dD});var Fi,dD,Vf=Gt(()=>{Ui();Fi=Os({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),dD=Os({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Um={};Yt(Um,{base58btc:()=>pi,base58flickr:()=>pD});var pi,pD,Ph=Gt(()=>{Ui();pi=Os({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pD=Os({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Fm={};Yt(Fm,{base64:()=>mD,base64pad:()=>bD,base64url:()=>Da,base64urlpad:()=>gD});var mD,bD,Da,gD,Lh=Gt(()=>{Ui();mD=lr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bD=lr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Da=lr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),gD=lr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var $m={};Yt($m,{base256emoji:()=>_D});function xD(r){return r.reduce((e,t)=>(e+=vD[t],e),"")}function wD(r){let e=[];for(let t of r){let n=yD[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var u3,vD,yD,_D,l3=Gt(()=>{Ui();u3=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}"),vD=u3.reduce((r,e,t)=>(r[t]=e,r),[]),yD=u3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(xD,"encode");o(wD,"decode");_D=jf({prefix:"\u{1F680}",name:"base256emoji",encode:xD,decode:wD})});function p3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=MD;)e[t++]=r&255|h3,r/=128;for(;r&SD;)e[t++]=r&255|h3,r>>>=7;return e[t]=r|0,p3.bytes=t-n+1,e}function qm(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw qm.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&d3)<<i:(f&d3)*Math.pow(2,i),i+=7}while(f>=CD);return qm.bytes=s-n,t}var ED,h3,AD,SD,MD,TD,CD,d3,kD,ID,DD,RD,OD,ND,PD,LD,BD,UD,FD,$D,_u,m3=Gt(()=>{ED=p3,h3=128,AD=127,SD=~AD,MD=Math.pow(2,31);o(p3,"encode");TD=qm,CD=128,d3=127;o(qm,"read");kD=Math.pow(2,7),ID=Math.pow(2,14),DD=Math.pow(2,21),RD=Math.pow(2,28),OD=Math.pow(2,35),ND=Math.pow(2,42),PD=Math.pow(2,49),LD=Math.pow(2,56),BD=Math.pow(2,63),UD=o(function(r){return r<kD?1:r<ID?2:r<DD?3:r<RD?4:r<OD?5:r<ND?6:r<PD?7:r<LD?8:r<BD?9:10},"length"),FD={encode:ED,decode:TD,encodingLength:UD},$D=FD,_u=$D});var Eu,Wf,Jf,Uh=Gt(()=>{m3();Eu=o((r,e=0)=>[_u.decode(r,e),_u.decode.bytes],"decode"),Wf=o((r,e,t=0)=>(_u.encode(r,e,t),e),"encodeTo"),Jf=o(r=>_u.encodingLength(r),"encodingLength")});var Jo,Fh,b3,Ra,Oa=Gt(()=>{Rs();Uh();Jo=o((r,e)=>{let t=e.byteLength,n=Jf(r),i=n+Jf(t),s=new Uint8Array(i+t);return Wf(r,s,0),Wf(t,s,n),s.set(e,i),new Ra(r,t,e,s)},"create"),Fh=o(r=>{let e=Wo(r),[t,n]=Eu(e),[i,s]=Eu(e.subarray(n)),f=e.subarray(n+s);if(f.byteLength!==i)throw new Error("Incorrect length");return new Ra(t,i,f,e)},"decode"),b3=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&t3(r.bytes,e.bytes),"equals"),Ra=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Ra,"Digest")});var Hm,$h,zm=Gt(()=>{Oa();Hm=o(({name:r,code:e,encode:t})=>new $h(r,e,t),"from"),$h=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?Jo(this.code,t):t.then(n=>Jo(this.code,n))}else throw Error("Unknown type, must be binary type")}};o($h,"Hasher")});var Km={};Yt(Km,{sha256:()=>Ns,sha512:()=>qD});var v3,Ns,qD,Su=Gt(()=>{zm();v3=o(r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),"sha"),Ns=Hm({name:"sha2-256",code:18,encode:v3("SHA-256")}),qD=Hm({name:"sha2-512",code:19,encode:v3("SHA-512")})});var jm={};Yt(jm,{identity:()=>qh});var y3,HD,x3,zD,qh,Gm=Gt(()=>{Rs();Oa();y3=0,HD="identity",x3=Wo,zD=o(r=>Jo(y3,x3(r)),"digest"),qh={code:y3,name:HD,encode:x3,digest:zD}});var w3=Gt(()=>{Rs()});var ej,tj,_3=Gt(()=>{ej=new TextEncoder,tj=new TextDecoder});var Je,GD,VD,WD,Mu,JD,E3,A3,Hh,zh,YD,XD,ZD,$i=Gt(()=>{Uh();Oa();Ph();Lm();Rs();Je=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:zh,byteLength:zh,code:Hh,version:Hh,multihash:Hh,bytes:Hh,_baseCache:zh,asCID:zh})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Mu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==JD)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Je.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Jo(e,t);return Je.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&&b3(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return VD(t,i,e||pi.encoder);default:return WD(t,i,e||Gf.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 XD(/^0\.0/,ZD),!!(e&&(e[A3]||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 Je)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Je(t,n,i,s||E3(t,n,i.bytes))}else if(e!=null&&e[A3]===!0){let{version:t,multihash:n,code:i}=e,s=Fh(n);return Je.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!==Mu)throw new Error(`Version 0 CID must use dag-pb (code: ${Mu}) block encoding`);return new Je(e,t,n,n.bytes)}case 1:{let i=E3(e,t,n.bytes);return new Je(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Je.create(0,Mu,e)}static createV1(e,t){return Je.create(1,e,t)}static decode(e){let[t,n]=Je.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Je.inspectBytes(e),n=t.size-t.multihashSize,i=Wo(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),f=new Ra(t.multihashCode,t.digestSize,s,i);return[t.version===0?Je.createV0(f):Je.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[E,O]=Eu(e.subarray(t));return t+=O,E},"next"),i=n(),s=Mu;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let f=t,u=n(),d=n(),g=t+d,y=g-f;return{version:i,codec:s,multihashCode:u,digestSize:d,multihashSize:y,size:g}}static parse(e,t){let[n,i]=GD(e,t),s=Je.decode(i);return s._baseCache.set(n,e),s}};o(Je,"CID");GD=o((r,e)=>{switch(r[0]){case"Q":{let t=e||pi;return[pi.prefix,t.decode(`${pi.prefix}${r}`)]}case pi.prefix:{let t=e||pi;return[pi.prefix,t.decode(r)]}case Gf.prefix:{let t=e||Gf;return[Gf.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"),VD=o((r,e,t)=>{let{prefix:n}=t;if(n!==pi.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"),WD=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"),Mu=112,JD=18,E3=o((r,e,t)=>{let n=Jf(r),i=n+Jf(e),s=new Uint8Array(i+t.byteLength);return Wf(r,s,0),Wf(e,s,n),s.set(t,i),s},"encodeCID"),A3=Symbol.for("@ipld/js-cid/CID"),Hh={writable:!1,configurable:!1,enumerable:!0},zh={writable:!1,enumerable:!1,configurable:!1},YD="0.0.0-dev",XD=o((r,e)=>{if(r.test(YD))console.warn(e);else throw new Error(e)},"deprecate"),ZD=`CID.isCID(v) is deprecated and will be removed in the next major release.
21
21
  Following code pattern:
22
22
 
23
23
  if (CID.isCID(value)) {
@@ -31,7 +31,7 @@ if (cid) {
31
31
  // Make sure to use cid instead of value
32
32
  doSomethingWithCID(cid)
33
33
  }
34
- `});var Vm=Gt(()=>{$i();Uh();Rs();zm();Oa()});var Tu,cj,Wm=Gt(()=>{o3();s3();a3();f3();c3();Lm();Vf();Ph();Lh();l3();Su();Gm();w3();_3();Vm();Tu={...Im,...Dm,...Rm,...Om,...Nm,...Pm,...Bm,...Um,...Fm,...$m},cj={...Km,...jm}});function M3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var S3,Jm,QD,Kh,Ym=Gt(()=>{Wm();Ih();o(M3,"createCodec");S3=M3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Jm=M3("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=wu(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),QD={utf8:S3,"utf-8":S3,hex:Tu.base16,latin1:Jm,ascii:Jm,binary:Jm,...Tu},Kh=QD});var T3={};Yt(T3,{fromString:()=>Ut});function Ut(r,e="utf8"){let t=Kh[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ia(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var jh=Gt(()=>{Ym();xu();o(Ut,"fromString")});var C3={};Yt(C3,{toString:()=>It});function It(r,e="utf8"){let t=Kh[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var Yf=Gt(()=>{Ym();o(It,"toString")});var k3=Re(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});function eR(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(eR,"imulShim");Fn.mul=Math.imul||eR;function tR(r,e){return r+e|0}o(tR,"add");Fn.add=tR;function rR(r,e){return r-e|0}o(rR,"sub");Fn.sub=rR;function nR(r,e){return r<<e|r>>>32-e}o(nR,"rotl");Fn.rotl=nR;function iR(r,e){return r<<32-e|r>>>e}o(iR,"rotr");Fn.rotr=iR;function oR(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(oR,"isIntegerShim");Fn.isInteger=Number.isInteger||oR;Fn.MAX_SAFE_INTEGER=9007199254740991;Fn.isSafeInteger=function(r){return Fn.isInteger(r)&&r>=-Fn.MAX_SAFE_INTEGER&&r<=Fn.MAX_SAFE_INTEGER}});var Na=Re(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});var I3=k3();function sR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(sR,"readInt16BE");Tt.readInt16BE=sR;function aR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(aR,"readUint16BE");Tt.readUint16BE=aR;function fR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(fR,"readInt16LE");Tt.readInt16LE=fR;function cR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(cR,"readUint16LE");Tt.readUint16LE=cR;function D3(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(D3,"writeUint16BE");Tt.writeUint16BE=D3;Tt.writeInt16BE=D3;function R3(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(R3,"writeUint16LE");Tt.writeUint16LE=R3;Tt.writeInt16LE=R3;function Xm(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Xm,"readInt32BE");Tt.readInt32BE=Xm;function Zm(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Zm,"readUint32BE");Tt.readUint32BE=Zm;function Qm(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Qm,"readInt32LE");Tt.readInt32LE=Qm;function e1(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(e1,"readUint32LE");Tt.readUint32LE=e1;function Gh(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(Gh,"writeUint32BE");Tt.writeUint32BE=Gh;Tt.writeInt32BE=Gh;function Vh(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(Vh,"writeUint32LE");Tt.writeUint32LE=Vh;Tt.writeInt32LE=Vh;function uR(r,e){e===void 0&&(e=0);var t=Xm(r,e),n=Xm(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(uR,"readInt64BE");Tt.readInt64BE=uR;function lR(r,e){e===void 0&&(e=0);var t=Zm(r,e),n=Zm(r,e+4);return t*4294967296+n}o(lR,"readUint64BE");Tt.readUint64BE=lR;function hR(r,e){e===void 0&&(e=0);var t=Qm(r,e),n=Qm(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(hR,"readInt64LE");Tt.readInt64LE=hR;function dR(r,e){e===void 0&&(e=0);var t=e1(r,e),n=e1(r,e+4);return n*4294967296+t}o(dR,"readUint64LE");Tt.readUint64LE=dR;function O3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Gh(r/4294967296>>>0,e,t),Gh(r>>>0,e,t+4),e}o(O3,"writeUint64BE");Tt.writeUint64BE=O3;Tt.writeInt64BE=O3;function N3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Vh(r>>>0,e,t),Vh(r/4294967296>>>0,e,t+4),e}o(N3,"writeUint64LE");Tt.writeUint64LE=N3;Tt.writeInt64LE=N3;function pR(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(pR,"readUintBE");Tt.readUintBE=pR;function mR(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(mR,"readUintLE");Tt.readUintLE=mR;function bR(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(!I3.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(bR,"writeUintBE");Tt.writeUintBE=bR;function gR(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(!I3.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(gR,"writeUintLE");Tt.writeUintLE=gR;function vR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(vR,"readFloat32BE");Tt.readFloat32BE=vR;function yR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(yR,"readFloat32LE");Tt.readFloat32LE=yR;function xR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(xR,"readFloat64BE");Tt.readFloat64BE=xR;function wR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(wR,"readFloat64LE");Tt.readFloat64LE=wR;function _R(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(_R,"writeFloat32BE");Tt.writeFloat32BE=_R;function ER(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(ER,"writeFloat32LE");Tt.writeFloat32LE=ER;function AR(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(AR,"writeFloat64BE");Tt.writeFloat64BE=AR;function SR(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(SR,"writeFloat64LE");Tt.writeFloat64LE=SR});var bi=Re(t1=>{"use strict";Object.defineProperty(t1,"__esModule",{value:!0});function MR(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(MR,"wipe");t1.wipe=MR});var L3=Re(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var Jh=Na(),Wh=bi();Ps.DIGEST_LENGTH=32;Ps.BLOCK_SIZE=64;var P3=function(){function r(){this.digestLength=Ps.DIGEST_LENGTH,this.blockSize=Ps.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(){Wh.wipe(this._buffer),Wh.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&&(r1(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=r1(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,f=t%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;Jh.writeUint32BE(i,this._buffer,f-8),Jh.writeUint32BE(s,this._buffer,f-4),r1(this._temp,this._state,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)Jh.writeUint32BE(this._state[u],e,u*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){Wh.wipe(e.state),e.buffer&&Wh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Ps.SHA256=P3;var TR=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 r1(r,e,t,n,i){for(;i>=64;){for(var s=e[0],f=e[1],u=e[2],d=e[3],g=e[4],y=e[5],E=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;r[R]=Jh.readUint32BE(t,I)}for(var R=16;R<64;R++){var N=r[R-2],X=(N>>>17|N<<32-17)^(N>>>19|N<<32-19)^N>>>10;N=r[R-15];var L=(N>>>7|N<<32-7)^(N>>>18|N<<32-18)^N>>>3;r[R]=(X+r[R-7]|0)+(L+r[R-16]|0)}for(var R=0;R<64;R++){var X=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&E)|0)+(O+(TR[R]+r[R]|0)|0)|0,L=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&f^s&u^f&u)|0;O=E,E=y,y=g,g=d+X|0,d=u,u=f,f=s,s=X+L|0}e[0]+=s,e[1]+=f,e[2]+=u,e[3]+=d,e[4]+=g,e[5]+=y,e[6]+=E,e[7]+=O,n+=64,i-=64}return n}o(r1,"hashBlocks");function CR(r){var e=new P3;e.update(r);var t=e.digest();return e.clean(),t}o(CR,"hash");Ps.hash=CR});var n1=Re((Oj,Yh)=>{(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 f=!n.JS_SHA3_NO_COMMON_JS&&typeof Yh=="object"&&Yh.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],E=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],N=[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],X=[224,256,384,512],L=[128,256],J=["hex","buffer","arrayBuffer","array","digest"],ee={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),d&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var Y=o(function(D,Q,se){return function(H){return new w(D,Q,D).update(H)[se]()}},"createOutputMethod"),ie=o(function(D,Q,se){return function(H,z){return new w(D,Q,z).update(H)[se]()}},"createShakeOutputMethod"),G=o(function(D,Q,se){return function(H,z,V,te){return l["cshake"+D].update(H,z,V,te)[se]()}},"createCshakeOutputMethod"),$=o(function(D,Q,se){return function(H,z,V,te){return l["kmac"+D].update(H,z,V,te)[se]()}},"createKmacOutputMethod"),K=o(function(D,Q,se,H){for(var z=0;z<J.length;++z){var V=J[z];D[V]=Q(se,H,V)}return D},"createOutputMethods"),he=o(function(D,Q){var se=Y(D,Q,"hex");return se.create=function(){return new w(D,Q,D)},se.update=function(H){return se.create().update(H)},K(se,Y,D,Q)},"createMethod"),C=o(function(D,Q){var se=ie(D,Q,"hex");return se.create=function(H){return new w(D,Q,H)},se.update=function(H,z){return se.create(z).update(H)},K(se,ie,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=ee[D],H=G(D,Q,"hex");return H.create=function(z,V,te){return!V&&!te?l["shake"+D].create(z):new w(D,Q,z).bytepad([V,te],se)},H.update=function(z,V,te,ae){return H.create(V,te,ae).update(z)},K(H,G,D,Q)},"createCshakeMethod"),x=o(function(D,Q){var se=ee[D],H=$(D,Q,"hex");return H.create=function(z,V,te){return new k(D,Q,V).bytepad(["KMAC",te],se).bytepad([z],se)},H.update=function(z,V,te,ae){return H.create(z,te,ae).update(V)},K(H,$,D,Q)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:X,createMethod:he},{name:"sha3",padding:R,bits:X,createMethod:he},{name:"shake",padding:y,bits:L,createMethod:C},{name:"cshake",padding:E,bits:L,createMethod:h},{name:"kmac",padding:E,bits:L,createMethod:x}],l={},m=[],_=0;_<b.length;++_)for(var S=b[_],A=S.bits,v=0;v<A.length;++v){var T=S.name+"_"+A[v];if(m.push(T),l[T]=S.createMethod(A[v],S.padding),S.name!=="sha3"){var P=S.name+A[v];m.push(P),l[P]=l[T]}}function w(D,Q,se){this.blocks=[],this.s=[],this.padding=Q,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=se>>5,this.extraBytes=(se&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}o(w,"Keccak"),w.prototype.update=function(D){if(this.finalized)throw new Error(e);var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}for(var H=this.blocks,z=this.byteCount,V=D.length,te=this.blockCount,ae=0,Ae=this.s,ge,ne;ae<V;){if(this.reset)for(this.reset=!1,H[0]=this.block,ge=1;ge<te+1;++ge)H[ge]=0;if(Q)for(ge=this.start;ae<V&&ge<z;++ae)H[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<V&&ge<z;++ae)ne=D.charCodeAt(ae),ne<128?H[ge>>2]|=ne<<I[ge++&3]:ne<2048?(H[ge>>2]|=(192|ne>>6)<<I[ge++&3],H[ge>>2]|=(128|ne&63)<<I[ge++&3]):ne<55296||ne>=57344?(H[ge>>2]|=(224|ne>>12)<<I[ge++&3],H[ge>>2]|=(128|ne>>6&63)<<I[ge++&3],H[ge>>2]|=(128|ne&63)<<I[ge++&3]):(ne=65536+((ne&1023)<<10|D.charCodeAt(++ae)&1023),H[ge>>2]|=(240|ne>>18)<<I[ge++&3],H[ge>>2]|=(128|ne>>12&63)<<I[ge++&3],H[ge>>2]|=(128|ne>>6&63)<<I[ge++&3],H[ge>>2]|=(128|ne&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=z){for(this.start=ge-z,this.block=H[te],ge=0;ge<te;++ge)Ae[ge]^=H[ge];fe(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(D,Q){var se=D&255,H=1,z=[se];for(D=D>>8,se=D&255;se>0;)z.unshift(se),D=D>>8,se=D&255,++H;return Q?z.push(H):z.unshift(H),this.update(z),z.length},w.prototype.encodeString=function(D){var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}var H=0,z=D.length;if(Q)H=z;else for(var V=0;V<D.length;++V){var te=D.charCodeAt(V);te<128?H+=1:te<2048?H+=2:te<55296||te>=57344?H+=3:(te=65536+((te&1023)<<10|D.charCodeAt(++V)&1023),H+=4)}return H+=this.encode(H*8),this.update(D),H},w.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),H=0;H<D.length;++H)se+=this.encodeString(D[H]);var z=Q-se%Q,V=[];return V.length=z,this.update(V),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,H=this.s;if(D[Q>>2]|=this.padding[Q&3],this.lastByteIndex===this.byteCount)for(D[0]=D[se],Q=1;Q<se+1;++Q)D[Q]=0;for(D[se-1]|=2147483648,Q=0;Q<se;++Q)H[Q]^=D[Q];fe(H)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,H=this.extraBytes,z=0,V=0,te="",ae;V<se;){for(z=0;z<D&&V<se;++z,++V)ae=Q[z],te+=g[ae>>4&15]+g[ae&15]+g[ae>>12&15]+g[ae>>8&15]+g[ae>>20&15]+g[ae>>16&15]+g[ae>>28&15]+g[ae>>24&15];V%D===0&&(fe(Q),z=0)}return H&&(ae=Q[z],te+=g[ae>>4&15]+g[ae&15],H>1&&(te+=g[ae>>12&15]+g[ae>>8&15]),H>2&&(te+=g[ae>>20&15]+g[ae>>16&15])),te},w.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,H=this.extraBytes,z=0,V=0,te=this.outputBits>>3,ae;H?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(te);for(var Ae=new Uint32Array(ae);V<se;){for(z=0;z<D&&V<se;++z,++V)Ae[V]=Q[z];V%D===0&&fe(Q)}return H&&(Ae[z]=Q[z],ae=ae.slice(0,te)),ae},w.prototype.buffer=w.prototype.arrayBuffer,w.prototype.digest=w.prototype.array=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,H=this.extraBytes,z=0,V=0,te=[],ae,Ae;V<se;){for(z=0;z<D&&V<se;++z,++V)ae=V<<2,Ae=Q[z],te[ae]=Ae&255,te[ae+1]=Ae>>8&255,te[ae+2]=Ae>>16&255,te[ae+3]=Ae>>24&255;V%D===0&&fe(Q)}return H&&(ae=V<<2,Ae=Q[z],te[ae]=Ae&255,H>1&&(te[ae+1]=Ae>>8&255),H>2&&(te[ae+2]=Ae>>16&255)),te};function k(D,Q,se){w.call(this,D,Q,se)}o(k,"Kmac"),k.prototype=new w,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),w.prototype.finalize.call(this)};var fe=o(function(D){var Q,se,H,z,V,te,ae,Ae,ge,ne,Me,ue,ve,W,pe,ke,ze,Ne,We,br,le,oe,F,Z,me,ye,we,Ie,Dt,Fe,Oe,Lt,Ge,Ye,Dn,it,ot,ei,st,tt,ti,at,ft,hn,ct,Ze,ri,ut,lt,ni,ht,dt,ii,pt,rt,Rn,qt,Ht,dn,pn,mn,Ur,bn;for(H=0;H<48;H+=2)z=D[0]^D[10]^D[20]^D[30]^D[40],V=D[1]^D[11]^D[21]^D[31]^D[41],te=D[2]^D[12]^D[22]^D[32]^D[42],ae=D[3]^D[13]^D[23]^D[33]^D[43],Ae=D[4]^D[14]^D[24]^D[34]^D[44],ge=D[5]^D[15]^D[25]^D[35]^D[45],ne=D[6]^D[16]^D[26]^D[36]^D[46],Me=D[7]^D[17]^D[27]^D[37]^D[47],ue=D[8]^D[18]^D[28]^D[38]^D[48],ve=D[9]^D[19]^D[29]^D[39]^D[49],Q=ue^(te<<1|ae>>>31),se=ve^(ae<<1|te>>>31),D[0]^=Q,D[1]^=se,D[10]^=Q,D[11]^=se,D[20]^=Q,D[21]^=se,D[30]^=Q,D[31]^=se,D[40]^=Q,D[41]^=se,Q=z^(Ae<<1|ge>>>31),se=V^(ge<<1|Ae>>>31),D[2]^=Q,D[3]^=se,D[12]^=Q,D[13]^=se,D[22]^=Q,D[23]^=se,D[32]^=Q,D[33]^=se,D[42]^=Q,D[43]^=se,Q=te^(ne<<1|Me>>>31),se=ae^(Me<<1|ne>>>31),D[4]^=Q,D[5]^=se,D[14]^=Q,D[15]^=se,D[24]^=Q,D[25]^=se,D[34]^=Q,D[35]^=se,D[44]^=Q,D[45]^=se,Q=Ae^(ue<<1|ve>>>31),se=ge^(ve<<1|ue>>>31),D[6]^=Q,D[7]^=se,D[16]^=Q,D[17]^=se,D[26]^=Q,D[27]^=se,D[36]^=Q,D[37]^=se,D[46]^=Q,D[47]^=se,Q=ne^(z<<1|V>>>31),se=Me^(V<<1|z>>>31),D[8]^=Q,D[9]^=se,D[18]^=Q,D[19]^=se,D[28]^=Q,D[29]^=se,D[38]^=Q,D[39]^=se,D[48]^=Q,D[49]^=se,W=D[0],pe=D[1],Ze=D[11]<<4|D[10]>>>28,ri=D[10]<<4|D[11]>>>28,Ie=D[20]<<3|D[21]>>>29,Dt=D[21]<<3|D[20]>>>29,pn=D[31]<<9|D[30]>>>23,mn=D[30]<<9|D[31]>>>23,at=D[40]<<18|D[41]>>>14,ft=D[41]<<18|D[40]>>>14,Ye=D[2]<<1|D[3]>>>31,Dn=D[3]<<1|D[2]>>>31,ke=D[13]<<12|D[12]>>>20,ze=D[12]<<12|D[13]>>>20,ut=D[22]<<10|D[23]>>>22,lt=D[23]<<10|D[22]>>>22,Fe=D[33]<<13|D[32]>>>19,Oe=D[32]<<13|D[33]>>>19,Ur=D[42]<<2|D[43]>>>30,bn=D[43]<<2|D[42]>>>30,pt=D[5]<<30|D[4]>>>2,rt=D[4]<<30|D[5]>>>2,it=D[14]<<6|D[15]>>>26,ot=D[15]<<6|D[14]>>>26,Ne=D[25]<<11|D[24]>>>21,We=D[24]<<11|D[25]>>>21,ni=D[34]<<15|D[35]>>>17,ht=D[35]<<15|D[34]>>>17,Lt=D[45]<<29|D[44]>>>3,Ge=D[44]<<29|D[45]>>>3,Z=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Rn=D[17]<<23|D[16]>>>9,qt=D[16]<<23|D[17]>>>9,ei=D[26]<<25|D[27]>>>7,st=D[27]<<25|D[26]>>>7,br=D[36]<<21|D[37]>>>11,le=D[37]<<21|D[36]>>>11,dt=D[47]<<24|D[46]>>>8,ii=D[46]<<24|D[47]>>>8,hn=D[8]<<27|D[9]>>>5,ct=D[9]<<27|D[8]>>>5,ye=D[18]<<20|D[19]>>>12,we=D[19]<<20|D[18]>>>12,Ht=D[29]<<7|D[28]>>>25,dn=D[28]<<7|D[29]>>>25,tt=D[38]<<8|D[39]>>>24,ti=D[39]<<8|D[38]>>>24,oe=D[48]<<14|D[49]>>>18,F=D[49]<<14|D[48]>>>18,D[0]=W^~ke&Ne,D[1]=pe^~ze&We,D[10]=Z^~ye&Ie,D[11]=me^~we&Dt,D[20]=Ye^~it&ei,D[21]=Dn^~ot&st,D[30]=hn^~Ze&ut,D[31]=ct^~ri&lt,D[40]=pt^~Rn&Ht,D[41]=rt^~qt&dn,D[2]=ke^~Ne&br,D[3]=ze^~We&le,D[12]=ye^~Ie&Fe,D[13]=we^~Dt&Oe,D[22]=it^~ei&tt,D[23]=ot^~st&ti,D[32]=Ze^~ut&ni,D[33]=ri^~lt&ht,D[42]=Rn^~Ht&pn,D[43]=qt^~dn&mn,D[4]=Ne^~br&oe,D[5]=We^~le&F,D[14]=Ie^~Fe&Lt,D[15]=Dt^~Oe&Ge,D[24]=ei^~tt&at,D[25]=st^~ti&ft,D[34]=ut^~ni&dt,D[35]=lt^~ht&ii,D[44]=Ht^~pn&Ur,D[45]=dn^~mn&bn,D[6]=br^~oe&W,D[7]=le^~F&pe,D[16]=Fe^~Lt&Z,D[17]=Oe^~Ge&me,D[26]=tt^~at&Ye,D[27]=ti^~ft&Dn,D[36]=ni^~dt&hn,D[37]=ht^~ii&ct,D[46]=pn^~Ur&pt,D[47]=mn^~bn&rt,D[8]=oe^~W&ke,D[9]=F^~pe&ze,D[18]=Lt^~Z&ye,D[19]=Ge^~me&we,D[28]=at^~Ye&it,D[29]=ft^~Dn&ot,D[38]=dt^~hn&Ze,D[39]=ii^~ct&ri,D[48]=Ur^~pt&Rn,D[49]=bn^~rt&qt,D[0]^=N[H],D[1]^=N[H+1]},"f");if(f)Yh.exports=l;else{for(_=0;_<m.length;++_)n[m[_]]=l[m[_]];u&&define(function(){return l})}})()});var B3=Re((Nj,kR)=>{kR.exports={name:"elliptic",version:"6.5.7",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 i1=Re(()=>{});var fo=Re((U3,o1)=>{(function(r,e){"use strict";function t(C,h){if(!C)throw new Error(h||"Assertion failed")}o(t,"assert");function n(C,h){C.super_=h;var x=o(function(){},"TempCtor");x.prototype=h.prototype,C.prototype=new x,C.prototype.constructor=C}o(n,"inherits");function i(C,h,x){if(i.isBN(C))return C;this.negative=0,this.words=null,this.length=0,this.red=null,C!==null&&((h==="le"||h==="be")&&(x=h,h=10),this._init(C||0,h||10,x||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=i1().Buffer}catch{}i.isBN=o(function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},"isBN"),i.max=o(function(h,x){return h.cmp(x)>0?h:x},"max"),i.min=o(function(h,x){return h.cmp(x)<0?h:x},"min"),i.prototype._init=o(function(h,x,b){if(typeof h=="number")return this._initNumber(h,x,b);if(typeof h=="object")return this._initArray(h,x,b);x==="hex"&&(x=16),t(x===(x|0)&&x>=2&&x<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(x===16?this._parseHex(h,l,b):(this._parseBase(h,x,l),b==="le"&&this._initArray(this.toArray(),x,b)))},"init"),i.prototype._initNumber=o(function(h,x,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(t(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),x,b)},"_initNumber"),i.prototype._initArray=o(function(h,x,b){if(t(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m,_,S=0;if(b==="be")for(l=h.length-1,m=0;l>=0;l-=3)_=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[m]|=_<<S&67108863,this.words[m+1]=_>>>26-S&67108863,S+=24,S>=26&&(S-=26,m++);else if(b==="le")for(l=0,m=0;l<h.length;l+=3)_=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[m]|=_<<S&67108863,this.words[m+1]=_>>>26-S&67108863,S+=24,S>=26&&(S-=26,m++);return this.strip()},"_initArray");function f(C,h){var x=C.charCodeAt(h);return x>=65&&x<=70?x-55:x>=97&&x<=102?x-87:x-48&15}o(f,"parseHex4Bits");function u(C,h,x){var b=f(C,x);return x-1>=h&&(b|=f(C,x-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,x,b){this.length=Math.ceil((h.length-x)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m=0,_=0,S;if(b==="be")for(l=h.length-1;l>=x;l-=2)S=u(h,x,l)<<m,this.words[_]|=S&67108863,m>=18?(m-=18,_+=1,this.words[_]|=S>>>26):m+=8;else{var A=h.length-x;for(l=A%2===0?x+1:x;l<h.length;l+=2)S=u(h,x,l)<<m,this.words[_]|=S&67108863,m>=18?(m-=18,_+=1,this.words[_]|=S>>>26):m+=8}this.strip()},"_parseHex");function d(C,h,x,b){for(var l=0,m=Math.min(C.length,x),_=h;_<m;_++){var S=C.charCodeAt(_)-48;l*=b,S>=49?l+=S-49+10:S>=17?l+=S-17+10:l+=S}return l}o(d,"parseBase"),i.prototype._parseBase=o(function(h,x,b){this.words=[0],this.length=1;for(var l=0,m=1;m<=67108863;m*=x)l++;l--,m=m/x|0;for(var _=h.length-b,S=_%l,A=Math.min(_,_-S)+b,v=0,T=b;T<A;T+=l)v=d(h,T,T+l,x),this.imuln(m),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(S!==0){var P=1;for(v=d(h,T,h.length,x),T=0;T<S;T++)P*=x;this.imuln(P),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var x=0;x<this.length;x++)h.words[x]=this.words[x];h.length=this.length,h.negative=this.negative,h.red=this.red},"copy"),i.prototype.clone=o(function(){var h=new i(null);return this.copy(h),h},"clone"),i.prototype._expand=o(function(h){for(;this.length<h;)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 g=["","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"],y=[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],E=[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(h,x){h=h||10,x=x|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,m=0,_=0;_<this.length;_++){var S=this.words[_],A=((S<<l|m)&16777215).toString(16);m=S>>>24-l&16777215,m!==0||_!==this.length-1?b=g[6-A.length]+A+b:b=A+b,l+=2,l>=26&&(l-=26,_--)}for(m!==0&&(b=m.toString(16)+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var v=y[h],T=E[h];b="";var P=this.clone();for(P.negative=0;!P.isZero();){var w=P.modn(T).toString(h);P=P.idivn(T),P.isZero()?b=w+b:b=g[v-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(h,x){return t(typeof s<"u"),this.toArrayLike(s,h,x)},"toBuffer"),i.prototype.toArray=o(function(h,x){return this.toArrayLike(Array,h,x)},"toArray"),i.prototype.toArrayLike=o(function(h,x,b){var l=this.byteLength(),m=b||Math.max(1,l);t(l<=m,"byte array longer than desired length"),t(m>0,"Requested array length <= 0"),this.strip();var _=x==="le",S=new h(m),A,v,T=this.clone();if(_){for(v=0;!T.isZero();v++)A=T.andln(255),T.iushrn(8),S[v]=A;for(;v<m;v++)S[v]=0}else{for(v=0;v<m-l;v++)S[v]=0;for(v=0;!T.isZero();v++)A=T.andln(255),T.iushrn(8),S[m-v-1]=A}return S},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var x=h,b=0;return x>=4096&&(b+=13,x>>>=13),x>=64&&(b+=7,x>>>=7),x>=8&&(b+=4,x>>>=4),x>=2&&(b+=2,x>>>=2),b+x},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var x=h,b=0;return(x&8191)===0&&(b+=13,x>>>=13),(x&127)===0&&(b+=7,x>>>=7),(x&15)===0&&(b+=4,x>>>=4),(x&3)===0&&(b+=2,x>>>=2),(x&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],x=this._countBits(h);return(this.length-1)*26+x},"bitLength");function O(C){for(var h=new Array(C.bitLength()),x=0;x<h.length;x++){var b=x/26|0,l=x%26;h[x]=(C.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,x=0;x<this.length;x++){var b=this._zeroBits(this.words[x]);if(h+=b,b!==26)break}return h},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]|h.words[x];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return t((this.negative|h.negative)===0),this.iuor(h)},"ior"),i.prototype.or=o(function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},"or"),i.prototype.uor=o(function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(h){var x;this.length>h.length?x=h:x=this;for(var b=0;b<x.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=x.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return t((this.negative|h.negative)===0),this.iuand(h)},"iand"),i.prototype.and=o(function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},"and"),i.prototype.uand=o(function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(h){var x,b;this.length>h.length?(x=this,b=h):(x=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=x.words[l]^b.words[l];if(this!==x)for(;l<x.length;l++)this.words[l]=x.words[l];return this.length=x.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return t((this.negative|h.negative)===0),this.iuxor(h)},"ixor"),i.prototype.xor=o(function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(h){t(typeof h=="number"&&h>=0);var x=Math.ceil(h/26)|0,b=h%26;this._expand(x),b>0&&x--;for(var l=0;l<x;l++)this.words[l]=~this.words[l]&67108863;return b>0&&(this.words[l]=~this.words[l]&67108863>>26-b),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,x){t(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),x?this.words[b]=this.words[b]|1<<l:this.words[b]=this.words[b]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var x;if(this.negative!==0&&h.negative===0)return this.negative=0,x=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,x=this.isub(h),h.negative=1,x._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var m=0,_=0;_<l.length;_++)x=(b.words[_]|0)+(l.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;for(;m!==0&&_<b.length;_++)x=(b.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;if(this.length=b.length,m!==0)this.words[this.length]=m,this.length++;else if(b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this},"iadd"),i.prototype.add=o(function(h){var x;return h.negative!==0&&this.negative===0?(h.negative=0,x=this.sub(h),h.negative^=1,x):h.negative===0&&this.negative!==0?(this.negative=0,x=h.sub(this),this.negative=1,x):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},"add"),i.prototype.isub=o(function(h){if(h.negative!==0){h.negative=0;var x=this.iadd(h);return h.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,m;b>0?(l=this,m=h):(l=h,m=this);for(var _=0,S=0;S<m.length;S++)x=(l.words[S]|0)-(m.words[S]|0)+_,_=x>>26,this.words[S]=x&67108863;for(;_!==0&&S<l.length;S++)x=(l.words[S]|0)+_,_=x>>26,this.words[S]=x&67108863;if(_===0&&S<l.length&&l!==this)for(;S<l.length;S++)this.words[S]=l.words[S];return this.length=Math.max(this.length,S),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(C,h,x){x.negative=h.negative^C.negative;var b=C.length+h.length|0;x.length=b,b=b-1|0;var l=C.words[0]|0,m=h.words[0]|0,_=l*m,S=_&67108863,A=_/67108864|0;x.words[0]=S;for(var v=1;v<b;v++){for(var T=A>>>26,P=A&67108863,w=Math.min(v,h.length-1),k=Math.max(0,v-C.length+1);k<=w;k++){var fe=v-k|0;l=C.words[fe]|0,m=h.words[k]|0,_=l*m+P,T+=_/67108864|0,P=_&67108863}x.words[v]=P|0,A=T|0}return A!==0?x.words[v]=A|0:x.length--,x.strip()}o(R,"smallMulTo");var I=o(function(h,x,b){var l=h.words,m=x.words,_=b.words,S=0,A,v,T,P=l[0]|0,w=P&8191,k=P>>>13,fe=l[1]|0,D=fe&8191,Q=fe>>>13,se=l[2]|0,H=se&8191,z=se>>>13,V=l[3]|0,te=V&8191,ae=V>>>13,Ae=l[4]|0,ge=Ae&8191,ne=Ae>>>13,Me=l[5]|0,ue=Me&8191,ve=Me>>>13,W=l[6]|0,pe=W&8191,ke=W>>>13,ze=l[7]|0,Ne=ze&8191,We=ze>>>13,br=l[8]|0,le=br&8191,oe=br>>>13,F=l[9]|0,Z=F&8191,me=F>>>13,ye=m[0]|0,we=ye&8191,Ie=ye>>>13,Dt=m[1]|0,Fe=Dt&8191,Oe=Dt>>>13,Lt=m[2]|0,Ge=Lt&8191,Ye=Lt>>>13,Dn=m[3]|0,it=Dn&8191,ot=Dn>>>13,ei=m[4]|0,st=ei&8191,tt=ei>>>13,ti=m[5]|0,at=ti&8191,ft=ti>>>13,hn=m[6]|0,ct=hn&8191,Ze=hn>>>13,ri=m[7]|0,ut=ri&8191,lt=ri>>>13,ni=m[8]|0,ht=ni&8191,dt=ni>>>13,ii=m[9]|0,pt=ii&8191,rt=ii>>>13;b.negative=h.negative^x.negative,b.length=19,A=Math.imul(w,we),v=Math.imul(w,Ie),v=v+Math.imul(k,we)|0,T=Math.imul(k,Ie);var Rn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,A=Math.imul(D,we),v=Math.imul(D,Ie),v=v+Math.imul(Q,we)|0,T=Math.imul(Q,Ie),A=A+Math.imul(w,Fe)|0,v=v+Math.imul(w,Oe)|0,v=v+Math.imul(k,Fe)|0,T=T+Math.imul(k,Oe)|0;var qt=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(qt>>>26)|0,qt&=67108863,A=Math.imul(H,we),v=Math.imul(H,Ie),v=v+Math.imul(z,we)|0,T=Math.imul(z,Ie),A=A+Math.imul(D,Fe)|0,v=v+Math.imul(D,Oe)|0,v=v+Math.imul(Q,Fe)|0,T=T+Math.imul(Q,Oe)|0,A=A+Math.imul(w,Ge)|0,v=v+Math.imul(w,Ye)|0,v=v+Math.imul(k,Ge)|0,T=T+Math.imul(k,Ye)|0;var Ht=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,A=Math.imul(te,we),v=Math.imul(te,Ie),v=v+Math.imul(ae,we)|0,T=Math.imul(ae,Ie),A=A+Math.imul(H,Fe)|0,v=v+Math.imul(H,Oe)|0,v=v+Math.imul(z,Fe)|0,T=T+Math.imul(z,Oe)|0,A=A+Math.imul(D,Ge)|0,v=v+Math.imul(D,Ye)|0,v=v+Math.imul(Q,Ge)|0,T=T+Math.imul(Q,Ye)|0,A=A+Math.imul(w,it)|0,v=v+Math.imul(w,ot)|0,v=v+Math.imul(k,it)|0,T=T+Math.imul(k,ot)|0;var dn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(dn>>>26)|0,dn&=67108863,A=Math.imul(ge,we),v=Math.imul(ge,Ie),v=v+Math.imul(ne,we)|0,T=Math.imul(ne,Ie),A=A+Math.imul(te,Fe)|0,v=v+Math.imul(te,Oe)|0,v=v+Math.imul(ae,Fe)|0,T=T+Math.imul(ae,Oe)|0,A=A+Math.imul(H,Ge)|0,v=v+Math.imul(H,Ye)|0,v=v+Math.imul(z,Ge)|0,T=T+Math.imul(z,Ye)|0,A=A+Math.imul(D,it)|0,v=v+Math.imul(D,ot)|0,v=v+Math.imul(Q,it)|0,T=T+Math.imul(Q,ot)|0,A=A+Math.imul(w,st)|0,v=v+Math.imul(w,tt)|0,v=v+Math.imul(k,st)|0,T=T+Math.imul(k,tt)|0;var pn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(pn>>>26)|0,pn&=67108863,A=Math.imul(ue,we),v=Math.imul(ue,Ie),v=v+Math.imul(ve,we)|0,T=Math.imul(ve,Ie),A=A+Math.imul(ge,Fe)|0,v=v+Math.imul(ge,Oe)|0,v=v+Math.imul(ne,Fe)|0,T=T+Math.imul(ne,Oe)|0,A=A+Math.imul(te,Ge)|0,v=v+Math.imul(te,Ye)|0,v=v+Math.imul(ae,Ge)|0,T=T+Math.imul(ae,Ye)|0,A=A+Math.imul(H,it)|0,v=v+Math.imul(H,ot)|0,v=v+Math.imul(z,it)|0,T=T+Math.imul(z,ot)|0,A=A+Math.imul(D,st)|0,v=v+Math.imul(D,tt)|0,v=v+Math.imul(Q,st)|0,T=T+Math.imul(Q,tt)|0,A=A+Math.imul(w,at)|0,v=v+Math.imul(w,ft)|0,v=v+Math.imul(k,at)|0,T=T+Math.imul(k,ft)|0;var mn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(mn>>>26)|0,mn&=67108863,A=Math.imul(pe,we),v=Math.imul(pe,Ie),v=v+Math.imul(ke,we)|0,T=Math.imul(ke,Ie),A=A+Math.imul(ue,Fe)|0,v=v+Math.imul(ue,Oe)|0,v=v+Math.imul(ve,Fe)|0,T=T+Math.imul(ve,Oe)|0,A=A+Math.imul(ge,Ge)|0,v=v+Math.imul(ge,Ye)|0,v=v+Math.imul(ne,Ge)|0,T=T+Math.imul(ne,Ye)|0,A=A+Math.imul(te,it)|0,v=v+Math.imul(te,ot)|0,v=v+Math.imul(ae,it)|0,T=T+Math.imul(ae,ot)|0,A=A+Math.imul(H,st)|0,v=v+Math.imul(H,tt)|0,v=v+Math.imul(z,st)|0,T=T+Math.imul(z,tt)|0,A=A+Math.imul(D,at)|0,v=v+Math.imul(D,ft)|0,v=v+Math.imul(Q,at)|0,T=T+Math.imul(Q,ft)|0,A=A+Math.imul(w,ct)|0,v=v+Math.imul(w,Ze)|0,v=v+Math.imul(k,ct)|0,T=T+Math.imul(k,Ze)|0;var Ur=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,A=Math.imul(Ne,we),v=Math.imul(Ne,Ie),v=v+Math.imul(We,we)|0,T=Math.imul(We,Ie),A=A+Math.imul(pe,Fe)|0,v=v+Math.imul(pe,Oe)|0,v=v+Math.imul(ke,Fe)|0,T=T+Math.imul(ke,Oe)|0,A=A+Math.imul(ue,Ge)|0,v=v+Math.imul(ue,Ye)|0,v=v+Math.imul(ve,Ge)|0,T=T+Math.imul(ve,Ye)|0,A=A+Math.imul(ge,it)|0,v=v+Math.imul(ge,ot)|0,v=v+Math.imul(ne,it)|0,T=T+Math.imul(ne,ot)|0,A=A+Math.imul(te,st)|0,v=v+Math.imul(te,tt)|0,v=v+Math.imul(ae,st)|0,T=T+Math.imul(ae,tt)|0,A=A+Math.imul(H,at)|0,v=v+Math.imul(H,ft)|0,v=v+Math.imul(z,at)|0,T=T+Math.imul(z,ft)|0,A=A+Math.imul(D,ct)|0,v=v+Math.imul(D,Ze)|0,v=v+Math.imul(Q,ct)|0,T=T+Math.imul(Q,Ze)|0,A=A+Math.imul(w,ut)|0,v=v+Math.imul(w,lt)|0,v=v+Math.imul(k,ut)|0,T=T+Math.imul(k,lt)|0;var bn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(bn>>>26)|0,bn&=67108863,A=Math.imul(le,we),v=Math.imul(le,Ie),v=v+Math.imul(oe,we)|0,T=Math.imul(oe,Ie),A=A+Math.imul(Ne,Fe)|0,v=v+Math.imul(Ne,Oe)|0,v=v+Math.imul(We,Fe)|0,T=T+Math.imul(We,Oe)|0,A=A+Math.imul(pe,Ge)|0,v=v+Math.imul(pe,Ye)|0,v=v+Math.imul(ke,Ge)|0,T=T+Math.imul(ke,Ye)|0,A=A+Math.imul(ue,it)|0,v=v+Math.imul(ue,ot)|0,v=v+Math.imul(ve,it)|0,T=T+Math.imul(ve,ot)|0,A=A+Math.imul(ge,st)|0,v=v+Math.imul(ge,tt)|0,v=v+Math.imul(ne,st)|0,T=T+Math.imul(ne,tt)|0,A=A+Math.imul(te,at)|0,v=v+Math.imul(te,ft)|0,v=v+Math.imul(ae,at)|0,T=T+Math.imul(ae,ft)|0,A=A+Math.imul(H,ct)|0,v=v+Math.imul(H,Ze)|0,v=v+Math.imul(z,ct)|0,T=T+Math.imul(z,Ze)|0,A=A+Math.imul(D,ut)|0,v=v+Math.imul(D,lt)|0,v=v+Math.imul(Q,ut)|0,T=T+Math.imul(Q,lt)|0,A=A+Math.imul(w,ht)|0,v=v+Math.imul(w,dt)|0,v=v+Math.imul(k,ht)|0,T=T+Math.imul(k,dt)|0;var oi=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(oi>>>26)|0,oi&=67108863,A=Math.imul(Z,we),v=Math.imul(Z,Ie),v=v+Math.imul(me,we)|0,T=Math.imul(me,Ie),A=A+Math.imul(le,Fe)|0,v=v+Math.imul(le,Oe)|0,v=v+Math.imul(oe,Fe)|0,T=T+Math.imul(oe,Oe)|0,A=A+Math.imul(Ne,Ge)|0,v=v+Math.imul(Ne,Ye)|0,v=v+Math.imul(We,Ge)|0,T=T+Math.imul(We,Ye)|0,A=A+Math.imul(pe,it)|0,v=v+Math.imul(pe,ot)|0,v=v+Math.imul(ke,it)|0,T=T+Math.imul(ke,ot)|0,A=A+Math.imul(ue,st)|0,v=v+Math.imul(ue,tt)|0,v=v+Math.imul(ve,st)|0,T=T+Math.imul(ve,tt)|0,A=A+Math.imul(ge,at)|0,v=v+Math.imul(ge,ft)|0,v=v+Math.imul(ne,at)|0,T=T+Math.imul(ne,ft)|0,A=A+Math.imul(te,ct)|0,v=v+Math.imul(te,Ze)|0,v=v+Math.imul(ae,ct)|0,T=T+Math.imul(ae,Ze)|0,A=A+Math.imul(H,ut)|0,v=v+Math.imul(H,lt)|0,v=v+Math.imul(z,ut)|0,T=T+Math.imul(z,lt)|0,A=A+Math.imul(D,ht)|0,v=v+Math.imul(D,dt)|0,v=v+Math.imul(Q,ht)|0,T=T+Math.imul(Q,dt)|0,A=A+Math.imul(w,pt)|0,v=v+Math.imul(w,rt)|0,v=v+Math.imul(k,pt)|0,T=T+Math.imul(k,rt)|0;var Ro=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,A=Math.imul(Z,Fe),v=Math.imul(Z,Oe),v=v+Math.imul(me,Fe)|0,T=Math.imul(me,Oe),A=A+Math.imul(le,Ge)|0,v=v+Math.imul(le,Ye)|0,v=v+Math.imul(oe,Ge)|0,T=T+Math.imul(oe,Ye)|0,A=A+Math.imul(Ne,it)|0,v=v+Math.imul(Ne,ot)|0,v=v+Math.imul(We,it)|0,T=T+Math.imul(We,ot)|0,A=A+Math.imul(pe,st)|0,v=v+Math.imul(pe,tt)|0,v=v+Math.imul(ke,st)|0,T=T+Math.imul(ke,tt)|0,A=A+Math.imul(ue,at)|0,v=v+Math.imul(ue,ft)|0,v=v+Math.imul(ve,at)|0,T=T+Math.imul(ve,ft)|0,A=A+Math.imul(ge,ct)|0,v=v+Math.imul(ge,Ze)|0,v=v+Math.imul(ne,ct)|0,T=T+Math.imul(ne,Ze)|0,A=A+Math.imul(te,ut)|0,v=v+Math.imul(te,lt)|0,v=v+Math.imul(ae,ut)|0,T=T+Math.imul(ae,lt)|0,A=A+Math.imul(H,ht)|0,v=v+Math.imul(H,dt)|0,v=v+Math.imul(z,ht)|0,T=T+Math.imul(z,dt)|0,A=A+Math.imul(D,pt)|0,v=v+Math.imul(D,rt)|0,v=v+Math.imul(Q,pt)|0,T=T+Math.imul(Q,rt)|0;var Oo=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,A=Math.imul(Z,Ge),v=Math.imul(Z,Ye),v=v+Math.imul(me,Ge)|0,T=Math.imul(me,Ye),A=A+Math.imul(le,it)|0,v=v+Math.imul(le,ot)|0,v=v+Math.imul(oe,it)|0,T=T+Math.imul(oe,ot)|0,A=A+Math.imul(Ne,st)|0,v=v+Math.imul(Ne,tt)|0,v=v+Math.imul(We,st)|0,T=T+Math.imul(We,tt)|0,A=A+Math.imul(pe,at)|0,v=v+Math.imul(pe,ft)|0,v=v+Math.imul(ke,at)|0,T=T+Math.imul(ke,ft)|0,A=A+Math.imul(ue,ct)|0,v=v+Math.imul(ue,Ze)|0,v=v+Math.imul(ve,ct)|0,T=T+Math.imul(ve,Ze)|0,A=A+Math.imul(ge,ut)|0,v=v+Math.imul(ge,lt)|0,v=v+Math.imul(ne,ut)|0,T=T+Math.imul(ne,lt)|0,A=A+Math.imul(te,ht)|0,v=v+Math.imul(te,dt)|0,v=v+Math.imul(ae,ht)|0,T=T+Math.imul(ae,dt)|0,A=A+Math.imul(H,pt)|0,v=v+Math.imul(H,rt)|0,v=v+Math.imul(z,pt)|0,T=T+Math.imul(z,rt)|0;var No=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(No>>>26)|0,No&=67108863,A=Math.imul(Z,it),v=Math.imul(Z,ot),v=v+Math.imul(me,it)|0,T=Math.imul(me,ot),A=A+Math.imul(le,st)|0,v=v+Math.imul(le,tt)|0,v=v+Math.imul(oe,st)|0,T=T+Math.imul(oe,tt)|0,A=A+Math.imul(Ne,at)|0,v=v+Math.imul(Ne,ft)|0,v=v+Math.imul(We,at)|0,T=T+Math.imul(We,ft)|0,A=A+Math.imul(pe,ct)|0,v=v+Math.imul(pe,Ze)|0,v=v+Math.imul(ke,ct)|0,T=T+Math.imul(ke,Ze)|0,A=A+Math.imul(ue,ut)|0,v=v+Math.imul(ue,lt)|0,v=v+Math.imul(ve,ut)|0,T=T+Math.imul(ve,lt)|0,A=A+Math.imul(ge,ht)|0,v=v+Math.imul(ge,dt)|0,v=v+Math.imul(ne,ht)|0,T=T+Math.imul(ne,dt)|0,A=A+Math.imul(te,pt)|0,v=v+Math.imul(te,rt)|0,v=v+Math.imul(ae,pt)|0,T=T+Math.imul(ae,rt)|0;var ro=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(ro>>>26)|0,ro&=67108863,A=Math.imul(Z,st),v=Math.imul(Z,tt),v=v+Math.imul(me,st)|0,T=Math.imul(me,tt),A=A+Math.imul(le,at)|0,v=v+Math.imul(le,ft)|0,v=v+Math.imul(oe,at)|0,T=T+Math.imul(oe,ft)|0,A=A+Math.imul(Ne,ct)|0,v=v+Math.imul(Ne,Ze)|0,v=v+Math.imul(We,ct)|0,T=T+Math.imul(We,Ze)|0,A=A+Math.imul(pe,ut)|0,v=v+Math.imul(pe,lt)|0,v=v+Math.imul(ke,ut)|0,T=T+Math.imul(ke,lt)|0,A=A+Math.imul(ue,ht)|0,v=v+Math.imul(ue,dt)|0,v=v+Math.imul(ve,ht)|0,T=T+Math.imul(ve,dt)|0,A=A+Math.imul(ge,pt)|0,v=v+Math.imul(ge,rt)|0,v=v+Math.imul(ne,pt)|0,T=T+Math.imul(ne,rt)|0;var no=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(no>>>26)|0,no&=67108863,A=Math.imul(Z,at),v=Math.imul(Z,ft),v=v+Math.imul(me,at)|0,T=Math.imul(me,ft),A=A+Math.imul(le,ct)|0,v=v+Math.imul(le,Ze)|0,v=v+Math.imul(oe,ct)|0,T=T+Math.imul(oe,Ze)|0,A=A+Math.imul(Ne,ut)|0,v=v+Math.imul(Ne,lt)|0,v=v+Math.imul(We,ut)|0,T=T+Math.imul(We,lt)|0,A=A+Math.imul(pe,ht)|0,v=v+Math.imul(pe,dt)|0,v=v+Math.imul(ke,ht)|0,T=T+Math.imul(ke,dt)|0,A=A+Math.imul(ue,pt)|0,v=v+Math.imul(ue,rt)|0,v=v+Math.imul(ve,pt)|0,T=T+Math.imul(ve,rt)|0;var io=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(io>>>26)|0,io&=67108863,A=Math.imul(Z,ct),v=Math.imul(Z,Ze),v=v+Math.imul(me,ct)|0,T=Math.imul(me,Ze),A=A+Math.imul(le,ut)|0,v=v+Math.imul(le,lt)|0,v=v+Math.imul(oe,ut)|0,T=T+Math.imul(oe,lt)|0,A=A+Math.imul(Ne,ht)|0,v=v+Math.imul(Ne,dt)|0,v=v+Math.imul(We,ht)|0,T=T+Math.imul(We,dt)|0,A=A+Math.imul(pe,pt)|0,v=v+Math.imul(pe,rt)|0,v=v+Math.imul(ke,pt)|0,T=T+Math.imul(ke,rt)|0;var Po=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Po>>>26)|0,Po&=67108863,A=Math.imul(Z,ut),v=Math.imul(Z,lt),v=v+Math.imul(me,ut)|0,T=Math.imul(me,lt),A=A+Math.imul(le,ht)|0,v=v+Math.imul(le,dt)|0,v=v+Math.imul(oe,ht)|0,T=T+Math.imul(oe,dt)|0,A=A+Math.imul(Ne,pt)|0,v=v+Math.imul(Ne,rt)|0,v=v+Math.imul(We,pt)|0,T=T+Math.imul(We,rt)|0;var Lo=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,A=Math.imul(Z,ht),v=Math.imul(Z,dt),v=v+Math.imul(me,ht)|0,T=Math.imul(me,dt),A=A+Math.imul(le,pt)|0,v=v+Math.imul(le,rt)|0,v=v+Math.imul(oe,pt)|0,T=T+Math.imul(oe,rt)|0;var Bo=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,A=Math.imul(Z,pt),v=Math.imul(Z,rt),v=v+Math.imul(me,pt)|0,T=Math.imul(me,rt);var Uo=(S+A|0)+((v&8191)<<13)|0;return S=(T+(v>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,_[0]=Rn,_[1]=qt,_[2]=Ht,_[3]=dn,_[4]=pn,_[5]=mn,_[6]=Ur,_[7]=bn,_[8]=oi,_[9]=Ro,_[10]=Oo,_[11]=No,_[12]=ro,_[13]=no,_[14]=io,_[15]=Po,_[16]=Lo,_[17]=Bo,_[18]=Uo,S!==0&&(_[19]=S,b.length++),b},"comb10MulTo");Math.imul||(I=R);function N(C,h,x){x.negative=h.negative^C.negative,x.length=C.length+h.length;for(var b=0,l=0,m=0;m<x.length-1;m++){var _=l;l=0;for(var S=b&67108863,A=Math.min(m,h.length-1),v=Math.max(0,m-C.length+1);v<=A;v++){var T=m-v,P=C.words[T]|0,w=h.words[v]|0,k=P*w,fe=k&67108863;_=_+(k/67108864|0)|0,fe=fe+S|0,S=fe&67108863,_=_+(fe>>>26)|0,l+=_>>>26,_&=67108863}x.words[m]=S,b=_,_=l}return b!==0?x.words[m]=b:x.length--,x.strip()}o(N,"bigMulTo");function X(C,h,x){var b=new L;return b.mulp(C,h,x)}o(X,"jumboMulTo"),i.prototype.mulTo=o(function(h,x){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=I(this,h,x):l<63?b=R(this,h,x):l<1024?b=N(this,h,x):b=X(this,h,x),b},"mulTo");function L(C,h){this.x=C,this.y=h}o(L,"FFTM"),L.prototype.makeRBT=o(function(h){for(var x=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)x[l]=this.revBin(l,b,h);return x},"makeRBT"),L.prototype.revBin=o(function(h,x,b){if(h===0||h===b-1)return h;for(var l=0,m=0;m<x;m++)l|=(h&1)<<x-m-1,h>>=1;return l},"revBin"),L.prototype.permute=o(function(h,x,b,l,m,_){for(var S=0;S<_;S++)l[S]=x[h[S]],m[S]=b[h[S]]},"permute"),L.prototype.transform=o(function(h,x,b,l,m,_){this.permute(_,h,x,b,l,m);for(var S=1;S<m;S<<=1)for(var A=S<<1,v=Math.cos(2*Math.PI/A),T=Math.sin(2*Math.PI/A),P=0;P<m;P+=A)for(var w=v,k=T,fe=0;fe<S;fe++){var D=b[P+fe],Q=l[P+fe],se=b[P+fe+S],H=l[P+fe+S],z=w*se-k*H;H=w*H+k*se,se=z,b[P+fe]=D+se,l[P+fe]=Q+H,b[P+fe+S]=D-se,l[P+fe+S]=Q-H,fe!==A&&(z=v*w-T*k,k=v*k+T*w,w=z)}},"transform"),L.prototype.guessLen13b=o(function(h,x){var b=Math.max(x,h)|1,l=b&1,m=0;for(b=b/2|0;b;b=b>>>1)m++;return 1<<m+1+l},"guessLen13b"),L.prototype.conjugate=o(function(h,x,b){if(!(b<=1))for(var l=0;l<b/2;l++){var m=h[l];h[l]=h[b-l-1],h[b-l-1]=m,m=x[l],x[l]=-x[b-l-1],x[b-l-1]=-m}},"conjugate"),L.prototype.normalize13b=o(function(h,x){for(var b=0,l=0;l<x/2;l++){var m=Math.round(h[2*l+1]/x)*8192+Math.round(h[2*l]/x)+b;h[l]=m&67108863,m<67108864?b=0:b=m/67108864|0}return h},"normalize13b"),L.prototype.convert13b=o(function(h,x,b,l){for(var m=0,_=0;_<x;_++)m=m+(h[_]|0),b[2*_]=m&8191,m=m>>>13,b[2*_+1]=m&8191,m=m>>>13;for(_=2*x;_<l;++_)b[_]=0;t(m===0),t((m&-8192)===0)},"convert13b"),L.prototype.stub=o(function(h){for(var x=new Array(h),b=0;b<h;b++)x[b]=0;return x},"stub"),L.prototype.mulp=o(function(h,x,b){var l=2*this.guessLen13b(h.length,x.length),m=this.makeRBT(l),_=this.stub(l),S=new Array(l),A=new Array(l),v=new Array(l),T=new Array(l),P=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,S,l),this.convert13b(x.words,x.length,T,l),this.transform(S,_,A,v,l,m),this.transform(T,_,P,w,l,m);for(var fe=0;fe<l;fe++){var D=A[fe]*P[fe]-v[fe]*w[fe];v[fe]=A[fe]*w[fe]+v[fe]*P[fe],A[fe]=D}return this.conjugate(A,v,l),this.transform(A,v,k,_,l,m),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^x.negative,b.length=h.length+x.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),this.mulTo(h,x)},"mul"),i.prototype.mulf=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),X(this,h,x)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){t(typeof h=="number"),t(h<67108864);for(var x=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,m=(l&67108863)+(x&67108863);x>>=26,x+=l/67108864|0,x+=m>>>26,this.words[b]=m&67108863}return x!==0&&(this.words[b]=x,this.length++),this},"imuln"),i.prototype.muln=o(function(h){return this.clone().imuln(h)},"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(h){var x=O(h);if(x.length===0)return new i(1);for(var b=this,l=0;l<x.length&&x[l]===0;l++,b=b.sqr());if(++l<x.length)for(var m=b.sqr();l<x.length;l++,m=m.sqr())x[l]!==0&&(b=b.mul(m));return b},"pow"),i.prototype.iushln=o(function(h){t(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=67108863>>>26-x<<26-x,m;if(x!==0){var _=0;for(m=0;m<this.length;m++){var S=this.words[m]&l,A=(this.words[m]|0)-S<<x;this.words[m]=A|_,_=S>>>26-x}_&&(this.words[m]=_,this.length++)}if(b!==0){for(m=this.length-1;m>=0;m--)this.words[m+b]=this.words[m];for(m=0;m<b;m++)this.words[m]=0;this.length+=b}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return t(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,x,b){t(typeof h=="number"&&h>=0);var l;x?l=(x-x%26)/26:l=0;var m=h%26,_=Math.min((h-m)/26,this.length),S=67108863^67108863>>>m<<m,A=b;if(l-=_,l=Math.max(0,l),A){for(var v=0;v<_;v++)A.words[v]=this.words[v];A.length=_}if(_!==0)if(this.length>_)for(this.length-=_,v=0;v<this.length;v++)this.words[v]=this.words[v+_];else this.words[0]=0,this.length=1;var T=0;for(v=this.length-1;v>=0&&(T!==0||v>=l);v--){var P=this.words[v]|0;this.words[v]=T<<26-m|P>>>m,T=P&S}return A&&T!==0&&(A.words[A.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,x,b){return t(this.negative===0),this.iushrn(h,x,b)},"ishrn"),i.prototype.shln=o(function(h){return this.clone().ishln(h)},"shln"),i.prototype.ushln=o(function(h){return this.clone().iushln(h)},"ushln"),i.prototype.shrn=o(function(h){return this.clone().ishrn(h)},"shrn"),i.prototype.ushrn=o(function(h){return this.clone().iushrn(h)},"ushrn"),i.prototype.testn=o(function(h){t(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return!1;var m=this.words[b];return!!(m&l)},"testn"),i.prototype.imaskn=o(function(h){t(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(x!==0&&b++,this.length=Math.min(b,this.length),x!==0){var l=67108863^67108863>>>x<<x;this.words[this.length-1]&=l}return this.strip()},"imaskn"),i.prototype.maskn=o(function(h){return this.clone().imaskn(h)},"maskn"),i.prototype.iaddn=o(function(h){return t(typeof h=="number"),t(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},"iaddn"),i.prototype._iaddn=o(function(h){this.words[0]+=h;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},"_iaddn"),i.prototype.isubn=o(function(h){if(t(typeof h=="number"),t(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(h){return this.clone().iaddn(h)},"addn"),i.prototype.subn=o(function(h){return this.clone().isubn(h)},"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(h,x,b){var l=h.length+b,m;this._expand(l);var _,S=0;for(m=0;m<h.length;m++){_=(this.words[m+b]|0)+S;var A=(h.words[m]|0)*x;_-=A&67108863,S=(_>>26)-(A/67108864|0),this.words[m+b]=_&67108863}for(;m<this.length-b;m++)_=(this.words[m+b]|0)+S,S=_>>26,this.words[m+b]=_&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,m=0;m<this.length;m++)_=-(this.words[m]|0)+S,S=_>>26,this.words[m]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,x){var b=this.length-h.length,l=this.clone(),m=h,_=m.words[m.length-1]|0,S=this._countBits(_);b=26-S,b!==0&&(m=m.ushln(b),l.iushln(b),_=m.words[m.length-1]|0);var A=l.length-m.length,v;if(x!=="mod"){v=new i(null),v.length=A+1,v.words=new Array(v.length);for(var T=0;T<v.length;T++)v.words[T]=0}var P=l.clone()._ishlnsubmul(m,1,A);P.negative===0&&(l=P,v&&(v.words[A]=1));for(var w=A-1;w>=0;w--){var k=(l.words[m.length+w]|0)*67108864+(l.words[m.length+w-1]|0);for(k=Math.min(k/_|0,67108863),l._ishlnsubmul(m,k,w);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(m,1,w),l.isZero()||(l.negative^=1);v&&(v.words[w]=k)}return v&&v.strip(),l.strip(),x!=="div"&&b!==0&&l.iushrn(b),{div:v||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,x,b){if(t(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,m,_;return this.negative!==0&&h.negative===0?(_=this.neg().divmod(h,x),x!=="mod"&&(l=_.div.neg()),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.iadd(h)),{div:l,mod:m}):this.negative===0&&h.negative!==0?(_=this.divmod(h.neg(),x),x!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),x),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.isub(h)),{div:_.div,mod:m}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?x==="div"?{div:this.divn(h.words[0]),mod:null}:x==="mod"?{div:null,mod:new i(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modn(h.words[0]))}:this._wordDiv(h,x)},"divmod"),i.prototype.div=o(function(h){return this.divmod(h,"div",!1).div},"div"),i.prototype.mod=o(function(h){return this.divmod(h,"mod",!1).mod},"mod"),i.prototype.umod=o(function(h){return this.divmod(h,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(h){var x=this.divmod(h);if(x.mod.isZero())return x.div;var b=x.div.negative!==0?x.mod.isub(h):x.mod,l=h.ushrn(1),m=h.andln(1),_=b.cmp(l);return _<0||m===1&&_===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){t(h<=67108863);for(var x=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(x*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){t(h<=67108863);for(var x=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+x*67108864;this.words[b]=l/h|0,x=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){t(h.negative===0),t(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=new i(0),S=new i(1),A=0;x.isEven()&&b.isEven();)x.iushrn(1),b.iushrn(1),++A;for(var v=b.clone(),T=x.clone();!x.isZero();){for(var P=0,w=1;(x.words[0]&w)===0&&P<26;++P,w<<=1);if(P>0)for(x.iushrn(P);P-- >0;)(l.isOdd()||m.isOdd())&&(l.iadd(v),m.isub(T)),l.iushrn(1),m.iushrn(1);for(var k=0,fe=1;(b.words[0]&fe)===0&&k<26;++k,fe<<=1);if(k>0)for(b.iushrn(k);k-- >0;)(_.isOdd()||S.isOdd())&&(_.iadd(v),S.isub(T)),_.iushrn(1),S.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(_),m.isub(S)):(b.isub(x),_.isub(l),S.isub(m))}return{a:_,b:S,gcd:b.iushln(A)}},"egcd"),i.prototype._invmp=o(function(h){t(h.negative===0),t(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=b.clone();x.cmpn(1)>0&&b.cmpn(1)>0;){for(var S=0,A=1;(x.words[0]&A)===0&&S<26;++S,A<<=1);if(S>0)for(x.iushrn(S);S-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var v=0,T=1;(b.words[0]&T)===0&&v<26;++v,T<<=1);if(v>0)for(b.iushrn(v);v-- >0;)m.isOdd()&&m.iadd(_),m.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(m)):(b.isub(x),m.isub(l))}var P;return x.cmpn(1)===0?P=l:P=m,P.cmpn(0)<0&&P.iadd(h),P},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var x=this.clone(),b=h.clone();x.negative=0,b.negative=0;for(var l=0;x.isEven()&&b.isEven();l++)x.iushrn(1),b.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;b.isEven();)b.iushrn(1);var m=x.cmp(b);if(m<0){var _=x;x=b,b=_}else if(m===0||b.cmpn(1)===0)break;x.isub(b)}while(!0);return b.iushln(l)},"gcd"),i.prototype.invm=o(function(h){return this.egcd(h).a.umod(h)},"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(h){return this.words[0]&h},"andln"),i.prototype.bincn=o(function(h){t(typeof h=="number");var x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var m=l,_=b;m!==0&&_<this.length;_++){var S=this.words[_]|0;S+=m,m=S>>>26,S&=67108863,this.words[_]=S}return m!==0&&(this.words[_]=m,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(h){var x=h<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this.strip();var b;if(this.length>1)b=1;else{x&&(h=-h),t(h<=67108863,"Number is too big");var l=this.words[0]|0;b=l===h?0:l<h?-1:1}return this.negative!==0?-b|0:b},"cmpn"),i.prototype.cmp=o(function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var x=this.ucmp(h);return this.negative!==0?-x|0:x},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var x=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,m=h.words[b]|0;if(l!==m){l<m?x=-1:l>m&&(x=1);break}}return x},"ucmp"),i.prototype.gtn=o(function(h){return this.cmpn(h)===1},"gtn"),i.prototype.gt=o(function(h){return this.cmp(h)===1},"gt"),i.prototype.gten=o(function(h){return this.cmpn(h)>=0},"gten"),i.prototype.gte=o(function(h){return this.cmp(h)>=0},"gte"),i.prototype.ltn=o(function(h){return this.cmpn(h)===-1},"ltn"),i.prototype.lt=o(function(h){return this.cmp(h)===-1},"lt"),i.prototype.lten=o(function(h){return this.cmpn(h)<=0},"lten"),i.prototype.lte=o(function(h){return this.cmp(h)<=0},"lte"),i.prototype.eqn=o(function(h){return this.cmpn(h)===0},"eqn"),i.prototype.eq=o(function(h){return this.cmp(h)===0},"eq"),i.red=o(function(h){return new K(h)},"red"),i.prototype.toRed=o(function(h){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"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(h){return this.red=h,this},"_forceRed"),i.prototype.forceRed=o(function(h){return t(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},"redMul"),i.prototype.redIMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},"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(h){return t(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var J={k256:null,p224:null,p192:null,p25519:null};function ee(C,h){this.name=C,this.p=new i(h,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(ee,"MPrime"),ee.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),ee.prototype.ireduce=o(function(h){var x=h,b;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),b=x.bitLength();while(b>this.n);var l=b<this.n?-1:x.ucmp(this.p);return l===0?(x.words[0]=0,x.length=1):l>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},"ireduce"),ee.prototype.split=o(function(h,x){h.iushrn(this.n,0,x)},"split"),ee.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Y(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Y,"K256"),n(Y,ee),Y.prototype.split=o(function(h,x){for(var b=4194303,l=Math.min(h.length,9),m=0;m<l;m++)x.words[m]=h.words[m];if(x.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(x.words[x.length++]=_&b,m=10;m<h.length;m++){var S=h.words[m]|0;h.words[m-10]=(S&b)<<4|_>>>22,_=S}_>>>=22,h.words[m-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},"split"),Y.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var x=0,b=0;b<h.length;b++){var l=h.words[b]|0;x+=l*977,h.words[b]=x&67108863,x=l*64+(x/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function ie(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,"P224"),n(ie,ee);function G(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(G,"P192"),n(G,ee);function $(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o($,"P25519"),n($,ee),$.prototype.imulK=o(function(h){for(var x=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+x,m=l&67108863;l>>>=26,h.words[b]=m,x=l}return x!==0&&(h.words[h.length++]=x),h},"imulK"),i._prime=o(function(h){if(J[h])return J[h];var x;if(h==="k256")x=new Y;else if(h==="p224")x=new ie;else if(h==="p192")x=new G;else if(h==="p25519")x=new $;else throw new Error("Unknown prime "+h);return J[h]=x,x},"prime");function K(C){if(typeof C=="string"){var h=i._prime(C);this.m=h.p,this.prime=h}else t(C.gtn(1),"modulus must be greater than 1"),this.m=C,this.prime=null}o(K,"Red"),K.prototype._verify1=o(function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},"_verify1"),K.prototype._verify2=o(function(h,x){t((h.negative|x.negative)===0,"red works only with positives"),t(h.red&&h.red===x.red,"red works only with red numbers")},"_verify2"),K.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),K.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),K.prototype.add=o(function(h,x){this._verify2(h,x);var b=h.add(x);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),K.prototype.iadd=o(function(h,x){this._verify2(h,x);var b=h.iadd(x);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),K.prototype.sub=o(function(h,x){this._verify2(h,x);var b=h.sub(x);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),K.prototype.isub=o(function(h,x){this._verify2(h,x);var b=h.isub(x);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),K.prototype.shl=o(function(h,x){return this._verify1(h),this.imod(h.ushln(x))},"shl"),K.prototype.imul=o(function(h,x){return this._verify2(h,x),this.imod(h.imul(x))},"imul"),K.prototype.mul=o(function(h,x){return this._verify2(h,x),this.imod(h.mul(x))},"mul"),K.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),K.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),K.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var x=this.m.andln(3);if(t(x%2===1),x===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var l=this.m.subn(1),m=0;!l.isZero()&&l.andln(1)===0;)m++,l.iushrn(1);t(!l.isZero());var _=new i(1).toRed(this),S=_.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,A).cmp(S)!==0;)v.redIAdd(S);for(var T=this.pow(v,l),P=this.pow(h,l.addn(1).iushrn(1)),w=this.pow(h,l),k=m;w.cmp(_)!==0;){for(var fe=w,D=0;fe.cmp(_)!==0;D++)fe=fe.redSqr();t(D<k);var Q=this.pow(T,new i(1).iushln(k-D-1));P=P.redMul(Q),T=Q.redSqr(),w=w.redMul(T),k=D}return P},"sqrt"),K.prototype.invm=o(function(h){var x=h._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},"invm"),K.prototype.pow=o(function(h,x){if(x.isZero())return new i(1).toRed(this);if(x.cmpn(1)===0)return h.clone();var b=4,l=new Array(1<<b);l[0]=new i(1).toRed(this),l[1]=h;for(var m=2;m<l.length;m++)l[m]=this.mul(l[m-1],h);var _=l[0],S=0,A=0,v=x.bitLength()%26;for(v===0&&(v=26),m=x.length-1;m>=0;m--){for(var T=x.words[m],P=v-1;P>=0;P--){var w=T>>P&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&S===0){A=0;continue}S<<=1,S|=w,A++,!(A!==b&&(m!==0||P!==0))&&(_=this.mul(_,l[S]),A=0,S=0)}v=26}return _},"pow"),K.prototype.convertTo=o(function(h){var x=h.umod(this.m);return x===h?x.clone():x},"convertTo"),K.prototype.convertFrom=o(function(h){var x=h.clone();return x.red=null,x},"convertFrom"),i.mont=o(function(h){return new he(h)},"mont");function he(C){K.call(this,C),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(he,"Mont"),n(he,K),he.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),he.prototype.convertFrom=o(function(h){var x=this.imod(h.mul(this.rinv));return x.red=null,x},"convertFrom"),he.prototype.imul=o(function(h,x){if(h.isZero()||x.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"imul"),he.prototype.mul=o(function(h,x){if(h.isZero()||x.isZero())return new i(0)._forceRed(this);var b=h.mul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"mul"),he.prototype.invm=o(function(h){var x=this.imod(h._invmp(this.m).mul(this.r2));return x._forceRed(this)},"invm")})(typeof o1>"u"||o1,U3)});var Ls=Re((Bj,$3)=>{$3.exports=F3;function F3(r,e){if(!r)throw new Error(e||"Assertion failed")}o(F3,"assert");F3.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var s1=Re(z3=>{"use strict";var Xh=z3;function IR(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,f=i&255;s?t.push(s,f):t.push(f)}return t}o(IR,"toArray");Xh.toArray=IR;function q3(r){return r.length===1?"0"+r:r}o(q3,"zero2");Xh.zero2=q3;function H3(r){for(var e="",t=0;t<r.length;t++)e+=q3(r[t].toString(16));return e}o(H3,"toHex");Xh.toHex=H3;Xh.encode=o(function(e,t){return t==="hex"?H3(e):e},"encode")});var $n=Re(K3=>{"use strict";var qi=K3,DR=fo(),RR=Ls(),Zh=s1();qi.assert=RR;qi.toArray=Zh.toArray;qi.zero2=Zh.zero2;qi.toHex=Zh.toHex;qi.encode=Zh.encode;function OR(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1),i;for(i=0;i<n.length;i+=1)n[i]=0;var s=1<<e+1,f=r.clone();for(i=0;i<n.length;i++){var u,d=f.andln(s-1);f.isOdd()?(d>(s>>1)-1?u=(s>>1)-d:u=d,f.isubn(u)):u=0,n[i]=u,f.iushrn(1)}return n}o(OR,"getNAF");qi.getNAF=OR;function NR(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 f=r.andln(3)+n&3,u=e.andln(3)+i&3;f===3&&(f=-1),u===3&&(u=-1);var d;(f&1)===0?d=0:(s=r.andln(7)+n&7,(s===3||s===5)&&u===2?d=-f:d=f),t[0].push(d);var g;(u&1)===0?g=0:(s=e.andln(7)+i&7,(s===3||s===5)&&f===2?g=-u:g=u),t[1].push(g),2*n===d+1&&(n=1-n),2*i===g+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(NR,"getJSF");qi.getJSF=NR;function PR(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(PR,"cachedProperty");qi.cachedProperty=PR;function LR(r){return typeof r=="string"?qi.toArray(r,"hex"):r}o(LR,"parseBytes");qi.parseBytes=LR;function BR(r){return new DR(r,"hex","le")}o(BR,"intFromLE");qi.intFromLE=BR});var u1=Re(($j,c1)=>{var a1;c1.exports=o(function(e){return a1||(a1=new Bs(null)),a1.generate(e)},"rand");function Bs(r){this.rand=r}o(Bs,"Rand");c1.exports.Rand=Bs;Bs.prototype.generate=o(function(e){return this._rand(e)},"generate");Bs.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?Bs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Bs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(Bs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(f1=require("crypto"),typeof f1.randomBytes!="function")throw new Error("Not supported");Bs.prototype._rand=o(function(e){return f1.randomBytes(e)},"_rand")}catch{}var f1});var ku=Re((qj,j3)=>{"use strict";var Pa=fo(),Cu=$n(),Qh=Cu.getNAF,UR=Cu.getJSF,ed=Cu.assert;function Us(r,e){this.type=r,this.p=new Pa(e.p,16),this.red=e.prime?Pa.red(e.prime):Pa.mont(this.p),this.zero=new Pa(0).toRed(this.red),this.one=new Pa(1).toRed(this.red),this.two=new Pa(2).toRed(this.red),this.n=e.n&&new Pa(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(Us,"BaseCurve");j3.exports=Us;Us.prototype.point=o(function(){throw new Error("Not implemented")},"point");Us.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Us.prototype._fixedNafMul=o(function(e,t){ed(e.precomputed);var n=e._getDoubles(),i=Qh(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var g=u+n.step-1;g>=u;g--)d=(d<<1)+i[g];f.push(d)}for(var y=this.jpoint(null,null,null),E=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?E=E.mixedAdd(n.points[u]):d===-O&&(E=E.mixedAdd(n.points[u].neg()));y=y.add(E)}return y.toP()},"_fixedNafMul");Us.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=Qh(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var g=0;d>=0&&f[d]===0;d--)g++;if(d>=0&&g++,u=u.dblp(g),d<0)break;var y=f[d];ed(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(s[y-1>>1]):u=u.mixedAdd(s[-y-1>>1].neg()):y>0?u=u.add(s[y-1>>1]):u=u.add(s[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Us.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,g=0,y,E,O;for(y=0;y<i;y++){O=t[y];var R=O._getNAFPoints(e);f[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,N=y;if(f[I]!==1||f[N]!==1){d[I]=Qh(n[I],f[I],this._bitLength),d[N]=Qh(n[N],f[N],this._bitLength),g=Math.max(d[I].length,g),g=Math.max(d[N].length,g);continue}var X=[t[I],null,null,t[N]];t[I].y.cmp(t[N].y)===0?(X[1]=t[I].add(t[N]),X[2]=t[I].toJ().mixedAdd(t[N].neg())):t[I].y.cmp(t[N].y.redNeg())===0?(X[1]=t[I].toJ().mixedAdd(t[N]),X[2]=t[I].add(t[N].neg())):(X[1]=t[I].toJ().mixedAdd(t[N]),X[2]=t[I].toJ().mixedAdd(t[N].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],J=UR(n[I],n[N]);for(g=Math.max(J[0].length,g),d[I]=new Array(g),d[N]=new Array(g),E=0;E<g;E++){var ee=J[0][E]|0,Y=J[1][E]|0;d[I][E]=L[(ee+1)*3+(Y+1)],d[N][E]=0,u[I]=X}}var ie=this.jpoint(null,null,null),G=this._wnafT4;for(y=g;y>=0;y--){for(var $=0;y>=0;){var K=!0;for(E=0;E<i;E++)G[E]=d[E][y]|0,G[E]!==0&&(K=!1);if(!K)break;$++,y--}if(y>=0&&$++,ie=ie.dblp($),y<0)break;for(E=0;E<i;E++){var he=G[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ie=ie.mixedAdd(O):ie=ie.add(O))}}for(y=0;y<i;y++)u[y]=null;return s?ie:ie.toP()},"_wnafMulAdd");function gi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(gi,"BasePoint");Us.BasePoint=gi;gi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");gi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Us.prototype.decodePoint=o(function(e,t){e=Cu.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?ed(e[e.length-1]%2===0):e[0]===7&&ed(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");gi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");gi.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");gi.prototype.encode=o(function(e,t){return Cu.encode(this._encode(t),e)},"encode");gi.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");gi.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");gi.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");gi.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");gi.prototype._getBeta=o(function(){return null},"_getBeta");gi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var Iu=Re((Hj,l1)=>{typeof Object.create=="function"?l1.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"):l1.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 V3=Re((zj,G3)=>{"use strict";var FR=$n(),hr=fo(),h1=Iu(),Xf=ku(),$R=FR.assert;function vi(r){Xf.call(this,"short",r),this.a=new hr(r.a,16).toRed(this.red),this.b=new hr(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(vi,"ShortCurve");h1(vi,Xf);G3.exports=vi;vi.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 hr(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 hr(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],$R(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new hr(u.a,16),b:new hr(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");vi.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:hr.mont(e),n=new hr(2).toRed(t).redInvm(),i=n.redNeg(),s=new hr(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");vi.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 hr(1),f=new hr(0),u=new hr(0),d=new hr(1),g,y,E,O,R,I,N,X=0,L,J;n.cmpn(0)!==0;){var ee=i.div(n);L=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Y=d.sub(ee.mul(f));if(!E&&L.cmp(t)<0)g=N.neg(),y=s,E=L.neg(),O=J;else if(E&&++X===2)break;N=L,i=n,n=L,u=s,s=J,d=f,f=Y}R=L.neg(),I=J;var ie=E.sqr().add(O.sqr()),G=R.sqr().add(I.sqr());return G.cmp(ie)>=0&&(R=g,I=y),E.negative&&(E=E.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:E,b:O},{a:R,b:I}]},"_getEndoBasis");vi.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),g=s.mul(n.b),y=f.mul(i.b),E=e.sub(u).sub(d),O=g.add(y).neg();return{k1:E,k2:O}},"_endoSplit");vi.prototype.pointFromX=o(function(e,t){e=new hr(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");vi.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");vi.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],g=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),g=g.neg(!0)),i[f*2]=d,i[f*2+1]=g,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return y},"_endoWnafMulAdd");function Cr(r,e,t,n){Xf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new hr(e,16),this.y=new hr(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(Cr,"Point");h1(Cr,Xf.BasePoint);vi.prototype.point=o(function(e,t,n){return new Cr(this,e,t,n)},"point");vi.prototype.pointFromJSON=o(function(e,t){return Cr.fromJSON(this,e,t)},"pointFromJSON");Cr.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");Cr.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");Cr.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Cr.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");Cr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Cr.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");Cr.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Cr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Cr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Cr.prototype.mul=o(function(e){return e=new hr(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");Cr.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");Cr.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");Cr.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");Cr.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");Cr.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 $r(r,e,t,n){Xf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new hr(0)):(this.x=new hr(e,16),this.y=new hr(t,16),this.z=new hr(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($r,"JPoint");h1($r,Xf.BasePoint);vi.prototype.jpoint=o(function(e,t,n){return new $r(this,e,t,n)},"jpoint");$r.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");$r.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");$r.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),g=f.redSub(u);if(d.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),E=y.redMul(d),O=i.redMul(y),R=g.redSqr().redIAdd(E).redISub(O).redISub(O),I=g.redMul(O.redISub(R)).redISub(f.redMul(E)),N=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,N)},"add");$r.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=u.redSqr(),y=g.redMul(u),E=n.redMul(g),O=d.redSqr().redIAdd(y).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");$r.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,f=this.x,u=this.y,d=this.z,g=d.redSqr().redSqr(),y=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=y.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(g)),N=f.redMul(O),X=I.redSqr().redISub(N.redAdd(N)),L=N.redISub(X),J=I.redMul(L);J=J.redIAdd(J).redISub(R);var ee=y.redMul(d);t+1<e&&(g=g.redMul(R)),f=X,d=ee,y=J}return this.curve.jpoint(f,y.redMul(s),d)},"dblp");$r.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");$r.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),g=d.redSqr().redISub(u).redISub(u),y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),e=g,t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(E).redISub(R);I=I.redIAdd(I);var N=E.redAdd(E).redIAdd(E),X=N.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=X.redISub(I).redISub(I),t=N.redMul(I.redISub(e)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");$r.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=d.redSqr().redISub(u).redISub(u);e=g;var y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(E).redMul(this.x.redAdd(E));I=I.redAdd(I).redIAdd(I);var N=R.redIAdd(R);N=N.redIAdd(N);var X=N.redAdd(N);e=I.redSqr().redISub(X),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var L=O.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),t=I.redMul(N.redISub(e)).redISub(L)}return this.curve.jpoint(e,t,n)},"_threeDbl");$r.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),g=t.redAdd(t);g=g.redIAdd(g);var y=g.redMul(u),E=d.redSqr().redISub(y.redAdd(y)),O=y.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),N=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,N)},"_dbl");$r.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(g),E=t.redMul(y);E=E.redIAdd(E),E=E.redIAdd(E);var O=this.x.redMul(d).redISub(E);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(g.redISub(y)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");$r.prototype.mul=o(function(e,t){return e=new hr(e,t),this.curve._wnafMul(this,e)},"mul");$r.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");$r.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");$r.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");$r.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var Y3=Re((Kj,J3)=>{"use strict";var Zf=fo(),W3=Iu(),td=ku(),qR=$n();function Qf(r){td.call(this,"mont",r),this.a=new Zf(r.a,16).toRed(this.red),this.b=new Zf(r.b,16).toRed(this.red),this.i4=new Zf(4).toRed(this.red).redInvm(),this.two=new Zf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Qf,"MontCurve");W3(Qf,td);J3.exports=Qf;Qf.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 kr(r,e,t){td.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zf(e,16),this.z=new Zf(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(kr,"Point");W3(kr,td.BasePoint);Qf.prototype.decodePoint=o(function(e,t){return this.point(qR.toArray(e,t),1)},"decodePoint");Qf.prototype.point=o(function(e,t){return new kr(this,e,t)},"point");Qf.prototype.pointFromJSON=o(function(e){return kr.fromJSON(this,e)},"pointFromJSON");kr.prototype.precompute=o(function(){},"precompute");kr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");kr.fromJSON=o(function(e,t){return new kr(e,t[0],t[1]||e.one)},"fromJSON");kr.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");kr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");kr.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),f=t.redMul(i),u=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(f,u)},"dbl");kr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");kr.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),f=e.x.redSub(e.z),u=f.redMul(n),d=s.redMul(i),g=t.z.redMul(u.redAdd(d).redSqr()),y=t.x.redMul(u.redISub(d).redSqr());return this.curve.point(g,y)},"diffAdd");kr.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var u=f.length-1;u>=0;u--)f[u]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");kr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");kr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");kr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");kr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");kr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var Q3=Re((jj,Z3)=>{"use strict";var HR=$n(),Yo=fo(),X3=Iu(),rd=ku(),zR=HR.assert;function co(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,rd.call(this,"edwards",r),this.a=new Yo(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Yo(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Yo(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),zR(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(co,"EdwardsCurve");X3(co,rd);Z3.exports=co;co.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");co.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");co.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");co.prototype.pointFromX=o(function(e,t){e=new Yo(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)),f=i.redMul(s.redInvm()),u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(t&&!d||!t&&d)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");co.prototype.pointFromY=o(function(e,t){e=new Yo(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),f=i.redMul(s.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)},"pointFromY");co.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 nr(r,e,t,n,i){rd.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 Yo(e,16),this.y=new Yo(t,16),this.z=n?new Yo(n,16):this.curve.one,this.t=i&&new Yo(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(nr,"Point");X3(nr,rd.BasePoint);co.prototype.pointFromJSON=o(function(e){return nr.fromJSON(this,e)},"pointFromJSON");co.prototype.point=o(function(e,t,n,i){return new nr(this,e,t,n,i)},"point");nr.fromJSON=o(function(e,t){return new nr(e,t[0],t[1],t[2])},"fromJSON");nr.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");nr.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");nr.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),f=i.redAdd(t),u=f.redSub(n),d=i.redSub(t),g=s.redMul(u),y=f.redMul(d),E=s.redMul(d),O=u.redMul(f);return this.curve.point(g,y,O,E)},"_extDbl");nr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,f,u,d,g;if(this.curve.twisted){u=this.curve._mulA(t);var y=u.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(y.redSub(this.curve.two)),s=y.redMul(u.redSub(n)),f=y.redSqr().redSub(y).redSub(y)):(d=this.z.redSqr(),g=y.redSub(d).redISub(d),i=e.redSub(t).redISub(n).redMul(g),s=y.redMul(u.redSub(n)),f=y.redMul(g))}else u=t.redAdd(n),d=this.curve._mulC(this.z).redSqr(),g=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(g),s=this.curve._mulC(u).redMul(t.redISub(n)),f=u.redMul(g);return this.curve.point(i,s,f)},"_projDbl");nr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");nr.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)),f=n.redSub(t),u=s.redSub(i),d=s.redAdd(i),g=n.redAdd(t),y=f.redMul(u),E=d.redMul(g),O=f.redMul(g),R=u.redMul(d);return this.curve.point(y,E,R,O)},"_extAdd");nr.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),f=this.curve.d.redMul(i).redMul(s),u=n.redSub(f),d=n.redAdd(f),g=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),y=t.redMul(u).redMul(g),E,O;return this.curve.twisted?(E=t.redMul(d).redMul(s.redSub(this.curve._mulA(i))),O=u.redMul(d)):(E=t.redMul(d).redMul(s.redSub(i)),O=this.curve._mulC(u).redMul(d)),this.curve.point(y,E,O)},"_projAdd");nr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");nr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");nr.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");nr.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");nr.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");nr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");nr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");nr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");nr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");nr.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");nr.prototype.toP=nr.prototype.normalize;nr.prototype.mixedAdd=nr.prototype.add});var d1=Re(ex=>{"use strict";var nd=ex;nd.base=ku();nd.short=V3();nd.mont=Y3();nd.edwards=Q3()});var Hi=Re(er=>{"use strict";var KR=Ls(),jR=Iu();er.inherits=jR;function GR(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(GR,"isSurrogatePair");function VR(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):GR(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(VR,"toArray");er.toArray=VR;function WR(r){for(var e="",t=0;t<r.length;t++)e+=rx(r[t].toString(16));return e}o(WR,"toHex");er.toHex=WR;function tx(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(tx,"htonl");er.htonl=tx;function JR(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=tx(i)),t+=nx(i.toString(16))}return t}o(JR,"toHex32");er.toHex32=JR;function rx(r){return r.length===1?"0"+r:r}o(rx,"zero2");er.zero2=rx;function nx(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(nx,"zero8");er.zero8=nx;function YR(r,e,t,n){var i=t-e;KR(i%4===0);for(var s=new Array(i/4),f=0,u=e;f<s.length;f++,u+=4){var d;n==="big"?d=r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:d=r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],s[f]=d>>>0}return s}o(YR,"join32");er.join32=YR;function XR(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(XR,"split32");er.split32=XR;function ZR(r,e){return r>>>e|r<<32-e}o(ZR,"rotr32");er.rotr32=ZR;function QR(r,e){return r<<e|r>>>32-e}o(QR,"rotl32");er.rotl32=QR;function eO(r,e){return r+e>>>0}o(eO,"sum32");er.sum32=eO;function tO(r,e,t){return r+e+t>>>0}o(tO,"sum32_3");er.sum32_3=tO;function rO(r,e,t,n){return r+e+t+n>>>0}o(rO,"sum32_4");er.sum32_4=rO;function nO(r,e,t,n,i){return r+e+t+n+i>>>0}o(nO,"sum32_5");er.sum32_5=nO;function iO(r,e,t,n){var i=r[e],s=r[e+1],f=n+s>>>0,u=(f<n?1:0)+t+i;r[e]=u>>>0,r[e+1]=f}o(iO,"sum64");er.sum64=iO;function oO(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(oO,"sum64_hi");er.sum64_hi=oO;function sO(r,e,t,n){var i=e+n;return i>>>0}o(sO,"sum64_lo");er.sum64_lo=sO;function aO(r,e,t,n,i,s,f,u){var d=0,g=e;g=g+n>>>0,d+=g<e?1:0,g=g+s>>>0,d+=g<s?1:0,g=g+u>>>0,d+=g<u?1:0;var y=r+t+i+f+d;return y>>>0}o(aO,"sum64_4_hi");er.sum64_4_hi=aO;function fO(r,e,t,n,i,s,f,u){var d=e+n+s+u;return d>>>0}o(fO,"sum64_4_lo");er.sum64_4_lo=fO;function cO(r,e,t,n,i,s,f,u,d,g){var y=0,E=e;E=E+n>>>0,y+=E<e?1:0,E=E+s>>>0,y+=E<s?1:0,E=E+u>>>0,y+=E<u?1:0,E=E+g>>>0,y+=E<g?1:0;var O=r+t+i+f+d+y;return O>>>0}o(cO,"sum64_5_hi");er.sum64_5_hi=cO;function uO(r,e,t,n,i,s,f,u,d,g){var y=e+n+s+u+g;return y>>>0}o(uO,"sum64_5_lo");er.sum64_5_lo=uO;function lO(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(lO,"rotr64_hi");er.rotr64_hi=lO;function hO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(hO,"rotr64_lo");er.rotr64_lo=hO;function dO(r,e,t){return r>>>t}o(dO,"shr64_hi");er.shr64_hi=dO;function pO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(pO,"shr64_lo");er.shr64_lo=pO});var ec=Re(ox=>{"use strict";var ix=Hi(),mO=Ls();function id(){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(id,"BlockHash");ox.BlockHash=id;id.prototype.update=o(function(e,t){if(e=ix.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=ix.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");id.prototype.digest=o(function(e){return this.update(this._pad()),mO(this.pending===null),this._digest(e)},"digest");id.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 f=8;f<this.padLength;f++)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,f=8;f<this.padLength;f++)i[s++]=0;return i},"pad")});var p1=Re(Xo=>{"use strict";var bO=Hi(),uo=bO.rotr32;function gO(r,e,t,n){if(r===0)return sx(e,t,n);if(r===1||r===3)return fx(e,t,n);if(r===2)return ax(e,t,n)}o(gO,"ft_1");Xo.ft_1=gO;function sx(r,e,t){return r&e^~r&t}o(sx,"ch32");Xo.ch32=sx;function ax(r,e,t){return r&e^r&t^e&t}o(ax,"maj32");Xo.maj32=ax;function fx(r,e,t){return r^e^t}o(fx,"p32");Xo.p32=fx;function vO(r){return uo(r,2)^uo(r,13)^uo(r,22)}o(vO,"s0_256");Xo.s0_256=vO;function yO(r){return uo(r,6)^uo(r,11)^uo(r,25)}o(yO,"s1_256");Xo.s1_256=yO;function xO(r){return uo(r,7)^uo(r,18)^r>>>3}o(xO,"g0_256");Xo.g0_256=xO;function wO(r){return uo(r,17)^uo(r,19)^r>>>10}o(wO,"g1_256");Xo.g1_256=wO});var lx=Re((Yj,ux)=>{"use strict";var tc=Hi(),_O=ec(),EO=p1(),m1=tc.rotl32,Du=tc.sum32,AO=tc.sum32_5,SO=EO.ft_1,cx=_O.BlockHash,MO=[1518500249,1859775393,2400959708,3395469782];function lo(){if(!(this instanceof lo))return new lo;cx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(lo,"SHA1");tc.inherits(lo,cx);ux.exports=lo;lo.blockSize=512;lo.outSize=160;lo.hmacStrength=80;lo.padLength=64;lo.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]=m1(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],g=this.h[4];for(i=0;i<n.length;i++){var y=~~(i/20),E=AO(m1(s,5),SO(y,f,u,d),g,n[i],MO[y]);g=d,d=u,u=m1(f,30),f=s,s=E}this.h[0]=Du(this.h[0],s),this.h[1]=Du(this.h[1],f),this.h[2]=Du(this.h[2],u),this.h[3]=Du(this.h[3],d),this.h[4]=Du(this.h[4],g)},"_update");lo.prototype._digest=o(function(e){return e==="hex"?tc.toHex32(this.h,"big"):tc.split32(this.h,"big")},"digest")});var b1=Re((Xj,dx)=>{"use strict";var rc=Hi(),TO=ec(),nc=p1(),CO=Ls(),zi=rc.sum32,kO=rc.sum32_4,IO=rc.sum32_5,DO=nc.ch32,RO=nc.maj32,OO=nc.s0_256,NO=nc.s1_256,PO=nc.g0_256,LO=nc.g1_256,hx=TO.BlockHash,BO=[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 ho(){if(!(this instanceof ho))return new ho;hx.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=BO,this.W=new Array(64)}o(ho,"SHA256");rc.inherits(ho,hx);dx.exports=ho;ho.blockSize=512;ho.outSize=256;ho.hmacStrength=192;ho.padLength=64;ho.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]=kO(LO(n[i-2]),n[i-7],PO(n[i-15]),n[i-16]);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],g=this.h[4],y=this.h[5],E=this.h[6],O=this.h[7];for(CO(this.k.length===n.length),i=0;i<n.length;i++){var R=IO(O,NO(g),DO(g,y,E),this.k[i],n[i]),I=zi(OO(s),RO(s,f,u));O=E,E=y,y=g,g=zi(d,R),d=u,u=f,f=s,s=zi(R,I)}this.h[0]=zi(this.h[0],s),this.h[1]=zi(this.h[1],f),this.h[2]=zi(this.h[2],u),this.h[3]=zi(this.h[3],d),this.h[4]=zi(this.h[4],g),this.h[5]=zi(this.h[5],y),this.h[6]=zi(this.h[6],E),this.h[7]=zi(this.h[7],O)},"_update");ho.prototype._digest=o(function(e){return e==="hex"?rc.toHex32(this.h,"big"):rc.split32(this.h,"big")},"digest")});var bx=Re((Zj,mx)=>{"use strict";var g1=Hi(),px=b1();function Zo(){if(!(this instanceof Zo))return new Zo;px.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(Zo,"SHA224");g1.inherits(Zo,px);mx.exports=Zo;Zo.blockSize=512;Zo.outSize=224;Zo.hmacStrength=192;Zo.padLength=64;Zo.prototype._digest=o(function(e){return e==="hex"?g1.toHex32(this.h.slice(0,7),"big"):g1.split32(this.h.slice(0,7),"big")},"digest")});var x1=Re((Qj,xx)=>{"use strict";var wn=Hi(),UO=ec(),FO=Ls(),po=wn.rotr64_hi,mo=wn.rotr64_lo,gx=wn.shr64_hi,vx=wn.shr64_lo,Fs=wn.sum64,v1=wn.sum64_hi,y1=wn.sum64_lo,$O=wn.sum64_4_hi,qO=wn.sum64_4_lo,HO=wn.sum64_5_hi,zO=wn.sum64_5_lo,yx=UO.BlockHash,KO=[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 Ki(){if(!(this instanceof Ki))return new Ki;yx.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=KO,this.W=new Array(160)}o(Ki,"SHA512");wn.inherits(Ki,yx);xx.exports=Ki;Ki.blockSize=1024;Ki.outSize=512;Ki.hmacStrength=192;Ki.padLength=128;Ki.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=tN(n[i-4],n[i-3]),f=rN(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],g=QO(n[i-30],n[i-29]),y=eN(n[i-30],n[i-29]),E=n[i-32],O=n[i-31];n[i]=$O(s,f,u,d,g,y,E,O),n[i+1]=qO(s,f,u,d,g,y,E,O)}},"_prepareBlock");Ki.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],f=this.h[2],u=this.h[3],d=this.h[4],g=this.h[5],y=this.h[6],E=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],N=this.h[11],X=this.h[12],L=this.h[13],J=this.h[14],ee=this.h[15];FO(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var ie=J,G=ee,$=XO(O,R),K=ZO(O,R),he=jO(O,R,I,N,X,L),C=GO(O,R,I,N,X,L),h=this.k[Y],x=this.k[Y+1],b=n[Y],l=n[Y+1],m=HO(ie,G,$,K,he,C,h,x,b,l),_=zO(ie,G,$,K,he,C,h,x,b,l);ie=JO(i,s),G=YO(i,s),$=VO(i,s,f,u,d,g),K=WO(i,s,f,u,d,g);var S=v1(ie,G,$,K),A=y1(ie,G,$,K);J=X,ee=L,X=I,L=N,I=O,N=R,O=v1(y,E,m,_),R=y1(E,E,m,_),y=d,E=g,d=f,g=u,f=i,u=s,i=v1(m,_,S,A),s=y1(m,_,S,A)}Fs(this.h,0,i,s),Fs(this.h,2,f,u),Fs(this.h,4,d,g),Fs(this.h,6,y,E),Fs(this.h,8,O,R),Fs(this.h,10,I,N),Fs(this.h,12,X,L),Fs(this.h,14,J,ee)},"_update");Ki.prototype._digest=o(function(e){return e==="hex"?wn.toHex32(this.h,"big"):wn.split32(this.h,"big")},"digest");function jO(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(jO,"ch64_hi");function GO(r,e,t,n,i,s){var f=e&n^~e&s;return f<0&&(f+=4294967296),f}o(GO,"ch64_lo");function VO(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(VO,"maj64_hi");function WO(r,e,t,n,i,s){var f=e&n^e&s^n&s;return f<0&&(f+=4294967296),f}o(WO,"maj64_lo");function JO(r,e){var t=po(r,e,28),n=po(e,r,2),i=po(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(JO,"s0_512_hi");function YO(r,e){var t=mo(r,e,28),n=mo(e,r,2),i=mo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(YO,"s0_512_lo");function XO(r,e){var t=po(r,e,14),n=po(r,e,18),i=po(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(XO,"s1_512_hi");function ZO(r,e){var t=mo(r,e,14),n=mo(r,e,18),i=mo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(ZO,"s1_512_lo");function QO(r,e){var t=po(r,e,1),n=po(r,e,8),i=gx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(QO,"g0_512_hi");function eN(r,e){var t=mo(r,e,1),n=mo(r,e,8),i=vx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(eN,"g0_512_lo");function tN(r,e){var t=po(r,e,19),n=po(e,r,29),i=gx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(tN,"g1_512_hi");function rN(r,e){var t=mo(r,e,19),n=mo(e,r,29),i=vx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(rN,"g1_512_lo")});var Ex=Re((eG,_x)=>{"use strict";var w1=Hi(),wx=x1();function Qo(){if(!(this instanceof Qo))return new Qo;wx.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(Qo,"SHA384");w1.inherits(Qo,wx);_x.exports=Qo;Qo.blockSize=1024;Qo.outSize=384;Qo.hmacStrength=192;Qo.padLength=128;Qo.prototype._digest=o(function(e){return e==="hex"?w1.toHex32(this.h.slice(0,12),"big"):w1.split32(this.h.slice(0,12),"big")},"digest")});var Ax=Re(ic=>{"use strict";ic.sha1=lx();ic.sha224=bx();ic.sha256=b1();ic.sha384=Ex();ic.sha512=x1()});var Ix=Re(kx=>{"use strict";var La=Hi(),nN=ec(),od=La.rotl32,Sx=La.sum32,Ru=La.sum32_3,Mx=La.sum32_4,Cx=nN.BlockHash;function bo(){if(!(this instanceof bo))return new bo;Cx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(bo,"RIPEMD160");La.inherits(bo,Cx);kx.ripemd160=bo;bo.blockSize=512;bo.outSize=160;bo.hmacStrength=192;bo.padLength=64;bo.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],f=this.h[3],u=this.h[4],d=n,g=i,y=s,E=f,O=u,R=0;R<80;R++){var I=Sx(od(Mx(n,Tx(R,i,s,f),e[sN[R]+t],iN(R)),fN[R]),u);n=u,u=f,f=od(s,10),s=i,i=I,I=Sx(od(Mx(d,Tx(79-R,g,y,E),e[aN[R]+t],oN(R)),cN[R]),O),d=O,O=E,E=od(y,10),y=g,g=I}I=Ru(this.h[1],s,E),this.h[1]=Ru(this.h[2],f,O),this.h[2]=Ru(this.h[3],u,d),this.h[3]=Ru(this.h[4],n,g),this.h[4]=Ru(this.h[0],i,y),this.h[0]=I},"update");bo.prototype._digest=o(function(e){return e==="hex"?La.toHex32(this.h,"little"):La.split32(this.h,"little")},"digest");function Tx(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(Tx,"f");function iN(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(iN,"K");function oN(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(oN,"Kh");var sN=[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],aN=[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],fN=[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],cN=[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 Rx=Re((nG,Dx)=>{"use strict";var uN=Hi(),lN=Ls();function oc(r,e,t){if(!(this instanceof oc))return new oc(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(uN.toArray(e,t))}o(oc,"Hmac");Dx.exports=oc;oc.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),lN(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");oc.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");oc.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var Ou=Re(Ox=>{var qr=Ox;qr.utils=Hi();qr.common=ec();qr.sha=Ax();qr.ripemd=Ix();qr.hmac=Rx();qr.sha1=qr.sha.sha1;qr.sha256=qr.sha.sha256;qr.sha224=qr.sha.sha224;qr.sha384=qr.sha.sha384;qr.sha512=qr.sha.sha512;qr.ripemd160=qr.ripemd.ripemd160});var Px=Re((oG,Nx)=>{Nx.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 sd=Re(Ux=>{"use strict";var E1=Ux,$s=Ou(),_1=d1(),hN=$n(),Lx=hN.assert;function Bx(r){r.type==="short"?this.curve=new _1.short(r):r.type==="edwards"?this.curve=new _1.edwards(r):this.curve=new _1.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,Lx(this.g.validate(),"Invalid curve"),Lx(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(Bx,"PresetCurve");E1.PresetCurve=Bx;function qs(r,e){Object.defineProperty(E1,r,{configurable:!0,enumerable:!0,get:function(){var t=new Bx(e);return Object.defineProperty(E1,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(qs,"defineCurve");qs("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:$s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});qs("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:$s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});qs("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:$s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});qs("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:$s.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"]});qs("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:$s.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"]});qs("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$s.sha256,gRed:!1,g:["9"]});qs("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:$s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var A1;try{A1=Px()}catch{A1=void 0}qs("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:$s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",A1]})});var qx=Re((aG,$x)=>{"use strict";var dN=Ou(),Ba=s1(),Fx=Ls();function Hs(r){if(!(this instanceof Hs))return new Hs(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=Ba.toArray(r.entropy,r.entropyEnc||"hex"),t=Ba.toArray(r.nonce,r.nonceEnc||"hex"),n=Ba.toArray(r.pers,r.persEnc||"hex");Fx(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(Hs,"HmacDRBG");$x.exports=Hs;Hs.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");Hs.prototype._hmac=o(function(){return new dN.hmac(this.hash,this.K)},"hmac");Hs.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");Hs.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Ba.toArray(e,t),n=Ba.toArray(n,i),Fx(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Hs.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=Ba.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 f=s.slice(0,e);return this._update(n),this._reseed++,Ba.encode(f,t)},"generate")});var zx=Re((fG,Hx)=>{"use strict";var pN=fo(),mN=$n(),S1=mN.assert;function Jr(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(Jr,"KeyPair");Hx.exports=Jr;Jr.fromPublic=o(function(e,t,n){return t instanceof Jr?t:new Jr(e,{pub:t,pubEnc:n})},"fromPublic");Jr.fromPrivate=o(function(e,t,n){return t instanceof Jr?t:new Jr(e,{priv:t,privEnc:n})},"fromPrivate");Jr.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");Jr.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");Jr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Jr.prototype._importPrivate=o(function(e,t){this.priv=new pN(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Jr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?S1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&S1(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");Jr.prototype.derive=o(function(e){return e.validate()||S1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Jr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");Jr.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");Jr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var Gx=Re((cG,jx)=>{"use strict";var ad=fo(),C1=$n(),bN=C1.assert;function fd(r,e){if(r instanceof fd)return r;this._importDER(r,e)||(bN(r.r&&r.s,"Signature without r or s"),this.r=new ad(r.r,16),this.s=new ad(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(fd,"Signature");jx.exports=fd;function gN(){this.place=0}o(gN,"Position");function M1(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4||r[e.place]===0)return!1;for(var i=0,s=0,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(M1,"getLength");function Kx(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(Kx,"rmPadding");fd.prototype._importDER=o(function(e,t){e=C1.toArray(e,t);var n=new gN;if(e[n.place++]!==48)return!1;var i=M1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=M1(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=M1(e,n);if(u===!1||e.length!==u+n.place||(e[n.place]&128)!==0)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new ad(f),this.s=new ad(d),this.recoveryParam=null,!0},"_importDER");function T1(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(T1,"constructLength");fd.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=Kx(t),n=Kx(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];T1(i,t.length),i=i.concat(t),i.push(2),T1(i,n.length);var s=i.concat(n),f=[48];return T1(f,s.length),f=f.concat(s),C1.encode(f,e)},"toDER")});var Yx=Re((uG,Jx)=>{"use strict";var Ua=fo(),Vx=qx(),vN=$n(),k1=sd(),yN=u1(),Wx=vN.assert,I1=zx(),cd=Gx();function yi(r){if(!(this instanceof yi))return new yi(r);typeof r=="string"&&(Wx(Object.prototype.hasOwnProperty.call(k1,r),"Unknown curve "+r),r=k1[r]),r instanceof k1.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(yi,"EC");Jx.exports=yi;yi.prototype.keyPair=o(function(e){return new I1(this,e)},"keyPair");yi.prototype.keyFromPrivate=o(function(e,t){return I1.fromPrivate(this,e,t)},"keyFromPrivate");yi.prototype.keyFromPublic=o(function(e,t){return I1.fromPublic(this,e,t)},"keyFromPublic");yi.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Vx({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||yN(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ua(2));;){var s=new Ua(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");yi.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");yi.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 Ua(e,16));for(var s=this.n.byteLength(),f=t.getPrivate().toArray("be",s),u=e.toArray("be",s),d=new Vx({hash:this.hash,entropy:f,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new Ua(1)),y=0;;y++){var E=i.k?i.k(y):new Ua(d.generate(this.n.byteLength()));if(E=this._truncateToN(E,!0),!(E.cmpn(1)<=0||E.cmp(g)>=0)){var O=this.g.mul(E);if(!O.isInfinity()){var R=O.getX(),I=R.umod(this.n);if(I.cmpn(0)!==0){var N=E.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(N=N.umod(this.n),N.cmpn(0)!==0){var X=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),X^=1),new cd({r:I,s:N,recoveryParam:X})}}}}}},"sign");yi.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Ua(e,16)),n=this.keyFromPublic(n,i),t=new cd(t,"hex");var s=t.r,f=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var u=f.invm(this.n),d=u.mul(e).umod(this.n),g=u.mul(s).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.eqXToP(s)):(y=this.g.mulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(s)===0)},"verify");yi.prototype.recoverPubKey=function(r,e,t,n){Wx((3&t)===t,"The recovery param is more than two bits"),e=new cd(e,n);var i=this.n,s=new Ua(r),f=e.r,u=e.s,d=t&1,g=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var y=e.r.invm(i),E=i.sub(s).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(E,f,O)};yi.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new cd(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var e6=Re((lG,Qx)=>{"use strict";var Nu=$n(),Zx=Nu.assert,Xx=Nu.parseBytes,sc=Nu.cachedProperty;function Ir(r,e){this.eddsa=r,this._secret=Xx(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Xx(e.pub)}o(Ir,"KeyPair");Ir.fromPublic=o(function(e,t){return t instanceof Ir?t:new Ir(e,{pub:t})},"fromPublic");Ir.fromSecret=o(function(e,t){return t instanceof Ir?t:new Ir(e,{secret:t})},"fromSecret");Ir.prototype.secret=o(function(){return this._secret},"secret");sc(Ir,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));sc(Ir,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));sc(Ir,"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"));sc(Ir,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));sc(Ir,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));sc(Ir,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Ir.prototype.sign=o(function(e){return Zx(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Ir.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Ir.prototype.getSecret=o(function(e){return Zx(this._secret,"KeyPair is public only"),Nu.encode(this.secret(),e)},"getSecret");Ir.prototype.getPublic=o(function(e){return Nu.encode(this.pubBytes(),e)},"getPublic");Qx.exports=Ir});var n6=Re((hG,r6)=>{"use strict";var xN=fo(),ud=$n(),t6=ud.assert,ld=ud.cachedProperty,wN=ud.parseBytes;function Fa(r,e){this.eddsa=r,typeof e!="object"&&(e=wN(e)),Array.isArray(e)&&(t6(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),t6(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof xN&&(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(Fa,"Signature");ld(Fa,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));ld(Fa,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));ld(Fa,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));ld(Fa,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Fa.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Fa.prototype.toHex=o(function(){return ud.encode(this.toBytes(),"hex").toUpperCase()},"toHex");r6.exports=Fa});var f6=Re((dG,a6)=>{"use strict";var _N=Ou(),EN=sd(),ac=$n(),AN=ac.assert,o6=ac.parseBytes,s6=e6(),i6=n6();function _n(r){if(AN(r==="ed25519","only tested with ed25519 so far"),!(this instanceof _n))return new _n(r);r=EN[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=_N.sha512}o(_n,"EDDSA");a6.exports=_n;_n.prototype.sign=o(function(e,t){e=o6(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),f=this.encodePoint(s),u=this.hashInt(f,n.pubBytes(),e).mul(n.priv()),d=i.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:d,Rencoded:f})},"sign");_n.prototype.verify=o(function(e,t,n){if(e=o6(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),f=this.g.mul(t.S()),u=t.R().add(i.pub().mul(s));return u.eq(f)},"verify");_n.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return ac.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");_n.prototype.keyFromPublic=o(function(e){return s6.fromPublic(this,e)},"keyFromPublic");_n.prototype.keyFromSecret=o(function(e){return s6.fromSecret(this,e)},"keyFromSecret");_n.prototype.makeSignature=o(function(e){return e instanceof i6?e:new i6(this,e)},"makeSignature");_n.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");_n.prototype.decodePoint=o(function(e){e=ac.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=ac.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");_n.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");_n.prototype.decodeInt=o(function(e){return ac.intFromLE(e)},"decodeInt");_n.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var u6=Re(c6=>{"use strict";var $a=c6;$a.version=B3().version;$a.utils=$n();$a.rand=u1();$a.curve=d1();$a.curves=sd();$a.ec=Yx();$a.eddsa=f6()});var h6=Re(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.BrowserRandomSource=void 0;var l6=65536,hd=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=l6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,l6)));return t}};o(hd,"BrowserRandomSource");dd.BrowserRandomSource=hd});var d6=Re(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.NodeRandomSource=void 0;var SN=bi(),pd=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=t[i];return(0,SN.wipe)(t),n}};o(pd,"NodeRandomSource");md.NodeRandomSource=pd});var p6=Re(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.SystemRandomSource=void 0;var MN=h6(),TN=d6(),bd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new MN.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new TN.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};o(bd,"SystemRandomSource");gd.SystemRandomSource=bd});var qa=Re(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.randomStringForEntropy=Yr.randomString=Yr.randomUint32=Yr.randomBytes=Yr.defaultRandomSource=void 0;var CN=p6(),kN=Na(),m6=bi();Yr.defaultRandomSource=new CN.SystemRandomSource;function D1(r,e=Yr.defaultRandomSource){return e.randomBytes(r)}o(D1,"randomBytes");Yr.randomBytes=D1;function IN(r=Yr.defaultRandomSource){let e=D1(4,r),t=(0,kN.readUint32LE)(e);return(0,m6.wipe)(e),t}o(IN,"randomUint32");Yr.randomUint32=IN;var b6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function g6(r,e=b6,t=Yr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",i=e.length,s=256-256%i;for(;r>0;){let f=D1(Math.ceil(r*256/s),t);for(let u=0;u<f.length&&r>0;u++){let d=f[u];d<s&&(n+=e.charAt(d%i),r--)}(0,m6.wipe)(f)}return n}o(g6,"randomString");Yr.randomString=g6;function DN(r,e=b6,t=Yr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return g6(n,e,t)}o(DN,"randomStringForEntropy");Yr.randomStringForEntropy=DN});var x6=Re(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var cc=Na(),fc=bi();es.DIGEST_LENGTH=64;es.BLOCK_SIZE=128;var y6=function(){function r(){this.digestLength=es.DIGEST_LENGTH,this.blockSize=es.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(){fc.wipe(this._buffer),fc.wipe(this._tempHi),fc.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<es.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(R1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=R1(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,f=t%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;cc.writeUint32BE(i,this._buffer,f-8),cc.writeUint32BE(s,this._buffer,f-4),R1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)cc.writeUint32BE(this._stateHi[u],e,u*8),cc.writeUint32BE(this._stateLo[u],e,u*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){fc.wipe(e.stateHi),fc.wipe(e.stateLo),e.buffer&&fc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();es.SHA512=y6;var v6=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 R1(r,e,t,n,i,s,f){for(var u=t[0],d=t[1],g=t[2],y=t[3],E=t[4],O=t[5],R=t[6],I=t[7],N=n[0],X=n[1],L=n[2],J=n[3],ee=n[4],Y=n[5],ie=n[6],G=n[7],$,K,he,C,h,x,b,l;f>=128;){for(var m=0;m<16;m++){var _=8*m+s;r[m]=cc.readUint32BE(i,_),e[m]=cc.readUint32BE(i,_+4)}for(var m=0;m<80;m++){var S=u,A=d,v=g,T=y,P=E,w=O,k=R,fe=I,D=N,Q=X,se=L,H=J,z=ee,V=Y,te=ie,ae=G;if($=I,K=G,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=(E>>>14|ee<<32-14)^(E>>>18|ee<<32-18)^(ee>>>41-32|E<<32-(41-32)),K=(ee>>>14|E<<32-14)^(ee>>>18|E<<32-18)^(E>>>41-32|ee<<32-(41-32)),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=E&O^~E&R,K=ee&Y^~ee&ie,h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=v6[m*2],K=v6[m*2+1],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=r[m%16],K=e[m%16],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,he=b&65535|l<<16,C=h&65535|x<<16,$=he,K=C,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=(u>>>28|N<<32-28)^(N>>>34-32|u<<32-(34-32))^(N>>>39-32|u<<32-(39-32)),K=(N>>>28|u<<32-28)^(u>>>34-32|N<<32-(34-32))^(u>>>39-32|N<<32-(39-32)),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=u&d^u&g^d&g,K=N&X^N&L^X&L,h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,fe=b&65535|l<<16,ae=h&65535|x<<16,$=T,K=H,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=he,K=C,h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,T=b&65535|l<<16,H=h&65535|x<<16,d=S,g=A,y=v,E=T,O=P,R=w,I=k,u=fe,X=D,L=Q,J=se,ee=H,Y=z,ie=V,G=te,N=ae,m%16===15)for(var _=0;_<16;_++)$=r[_],K=e[_],h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=r[(_+9)%16],K=e[(_+9)%16],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,he=r[(_+1)%16],C=e[(_+1)%16],$=(he>>>1|C<<32-1)^(he>>>8|C<<32-8)^he>>>7,K=(C>>>1|he<<32-1)^(C>>>8|he<<32-8)^(C>>>7|he<<32-7),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,he=r[(_+14)%16],C=e[(_+14)%16],$=(he>>>19|C<<32-19)^(C>>>61-32|he<<32-(61-32))^he>>>6,K=(C>>>19|he<<32-19)^(he>>>61-32|C<<32-(61-32))^(C>>>6|he<<32-6),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[_]=b&65535|l<<16,e[_]=h&65535|x<<16}$=u,K=N,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[0],K=n[0],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[0]=u=b&65535|l<<16,n[0]=N=h&65535|x<<16,$=d,K=X,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[1],K=n[1],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[1]=d=b&65535|l<<16,n[1]=X=h&65535|x<<16,$=g,K=L,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[2],K=n[2],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[2]=g=b&65535|l<<16,n[2]=L=h&65535|x<<16,$=y,K=J,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[3],K=n[3],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[3]=y=b&65535|l<<16,n[3]=J=h&65535|x<<16,$=E,K=ee,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[4],K=n[4],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[4]=E=b&65535|l<<16,n[4]=ee=h&65535|x<<16,$=O,K=Y,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[5],K=n[5],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[5]=O=b&65535|l<<16,n[5]=Y=h&65535|x<<16,$=R,K=ie,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[6],K=n[6],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[6]=R=b&65535|l<<16,n[6]=ie=h&65535|x<<16,$=I,K=G,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[7],K=n[7],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[7]=I=b&65535|l<<16,n[7]=G=h&65535|x<<16,s+=128,f-=128}return s}o(R1,"hashBlocks");function RN(r){var e=new y6;e.update(r);var t=e.digest();return e.clean(),t}o(RN,"hash");es.hash=RN});var vd=Re(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.convertSecretKeyToX25519=Vt.convertPublicKeyToX25519=Vt.verify=Vt.sign=Vt.extractPublicKeyFromSecretKey=Vt.generateKeyPair=Vt.generateKeyPairFromSeed=Vt.SEED_LENGTH=Vt.SECRET_KEY_LENGTH=Vt.PUBLIC_KEY_LENGTH=Vt.SIGNATURE_LENGTH=void 0;var ON=qa(),Pu=x6(),S6=bi();Vt.SIGNATURE_LENGTH=64;Vt.PUBLIC_KEY_LENGTH=32;Vt.SECRET_KEY_LENGTH=64;Vt.SEED_LENGTH=32;function Ve(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(Ve,"gf");var NN=new Uint8Array(32);NN[0]=9;var P1=Ve(),uc=Ve([1]),PN=Ve([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),LN=Ve([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),w6=Ve([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_6=Ve([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),BN=Ve([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function zs(r,e){for(let t=0;t<16;t++)r[t]=e[t]|0}o(zs,"set25519");function O1(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(O1,"car25519");function M6(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(M6,"sel25519");function Lu(r,e){let t=Ve(),n=Ve();for(let i=0;i<16;i++)n[i]=e[i];O1(n),O1(n),O1(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,M6(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(Lu,"pack25519");function T6(r,e){let t=0;for(let n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(T6,"verify32");function E6(r,e){let t=new Uint8Array(32),n=new Uint8Array(32);return Lu(t,r),Lu(n,e),T6(t,n)}o(E6,"neq25519");function C6(r){let e=new Uint8Array(32);return Lu(e,r),e[0]&1}o(C6,"par25519");function UN(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(UN,"unpack25519");function Ha(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Ha,"add");function Ka(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ka,"sub");function Xt(r,e,t){let n,i,s=0,f=0,u=0,d=0,g=0,y=0,E=0,O=0,R=0,I=0,N=0,X=0,L=0,J=0,ee=0,Y=0,ie=0,G=0,$=0,K=0,he=0,C=0,h=0,x=0,b=0,l=0,m=0,_=0,S=0,A=0,v=0,T=t[0],P=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],H=t[8],z=t[9],V=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ne=t[15];n=e[0],s+=n*T,f+=n*P,u+=n*w,d+=n*k,g+=n*fe,y+=n*D,E+=n*Q,O+=n*se,R+=n*H,I+=n*z,N+=n*V,X+=n*te,L+=n*ae,J+=n*Ae,ee+=n*ge,Y+=n*ne,n=e[1],f+=n*T,u+=n*P,d+=n*w,g+=n*k,y+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*H,N+=n*z,X+=n*V,L+=n*te,J+=n*ae,ee+=n*Ae,Y+=n*ge,ie+=n*ne,n=e[2],u+=n*T,d+=n*P,g+=n*w,y+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,N+=n*H,X+=n*z,L+=n*V,J+=n*te,ee+=n*ae,Y+=n*Ae,ie+=n*ge,G+=n*ne,n=e[3],d+=n*T,g+=n*P,y+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,N+=n*se,X+=n*H,L+=n*z,J+=n*V,ee+=n*te,Y+=n*ae,ie+=n*Ae,G+=n*ge,$+=n*ne,n=e[4],g+=n*T,y+=n*P,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,N+=n*Q,X+=n*se,L+=n*H,J+=n*z,ee+=n*V,Y+=n*te,ie+=n*ae,G+=n*Ae,$+=n*ge,K+=n*ne,n=e[5],y+=n*T,E+=n*P,O+=n*w,R+=n*k,I+=n*fe,N+=n*D,X+=n*Q,L+=n*se,J+=n*H,ee+=n*z,Y+=n*V,ie+=n*te,G+=n*ae,$+=n*Ae,K+=n*ge,he+=n*ne,n=e[6],E+=n*T,O+=n*P,R+=n*w,I+=n*k,N+=n*fe,X+=n*D,L+=n*Q,J+=n*se,ee+=n*H,Y+=n*z,ie+=n*V,G+=n*te,$+=n*ae,K+=n*Ae,he+=n*ge,C+=n*ne,n=e[7],O+=n*T,R+=n*P,I+=n*w,N+=n*k,X+=n*fe,L+=n*D,J+=n*Q,ee+=n*se,Y+=n*H,ie+=n*z,G+=n*V,$+=n*te,K+=n*ae,he+=n*Ae,C+=n*ge,h+=n*ne,n=e[8],R+=n*T,I+=n*P,N+=n*w,X+=n*k,L+=n*fe,J+=n*D,ee+=n*Q,Y+=n*se,ie+=n*H,G+=n*z,$+=n*V,K+=n*te,he+=n*ae,C+=n*Ae,h+=n*ge,x+=n*ne,n=e[9],I+=n*T,N+=n*P,X+=n*w,L+=n*k,J+=n*fe,ee+=n*D,Y+=n*Q,ie+=n*se,G+=n*H,$+=n*z,K+=n*V,he+=n*te,C+=n*ae,h+=n*Ae,x+=n*ge,b+=n*ne,n=e[10],N+=n*T,X+=n*P,L+=n*w,J+=n*k,ee+=n*fe,Y+=n*D,ie+=n*Q,G+=n*se,$+=n*H,K+=n*z,he+=n*V,C+=n*te,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*ne,n=e[11],X+=n*T,L+=n*P,J+=n*w,ee+=n*k,Y+=n*fe,ie+=n*D,G+=n*Q,$+=n*se,K+=n*H,he+=n*z,C+=n*V,h+=n*te,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ne,n=e[12],L+=n*T,J+=n*P,ee+=n*w,Y+=n*k,ie+=n*fe,G+=n*D,$+=n*Q,K+=n*se,he+=n*H,C+=n*z,h+=n*V,x+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ne,n=e[13],J+=n*T,ee+=n*P,Y+=n*w,ie+=n*k,G+=n*fe,$+=n*D,K+=n*Q,he+=n*se,C+=n*H,h+=n*z,x+=n*V,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,S+=n*ne,n=e[14],ee+=n*T,Y+=n*P,ie+=n*w,G+=n*k,$+=n*fe,K+=n*D,he+=n*Q,C+=n*se,h+=n*H,x+=n*z,b+=n*V,l+=n*te,m+=n*ae,_+=n*Ae,S+=n*ge,A+=n*ne,n=e[15],Y+=n*T,ie+=n*P,G+=n*w,$+=n*k,K+=n*fe,he+=n*D,C+=n*Q,h+=n*se,x+=n*H,b+=n*z,l+=n*V,m+=n*te,_+=n*ae,S+=n*Ae,A+=n*ge,v+=n*ne,s+=38*ie,f+=38*G,u+=38*$,d+=38*K,g+=38*he,y+=38*C,E+=38*h,O+=38*x,R+=38*b,I+=38*l,N+=38*m,X+=38*_,L+=38*S,J+=38*A,ee+=38*v,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=g,r[5]=y,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=N,r[11]=X,r[12]=L,r[13]=J,r[14]=ee,r[15]=Y}o(Xt,"mul");function za(r,e){Xt(r,e,e)}o(za,"square");function k6(r,e){let t=Ve(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)za(t,t),n!==2&&n!==4&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(k6,"inv25519");function FN(r,e){let t=Ve(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)za(t,t),n!==1&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(FN,"pow2523");function L1(r,e){let t=Ve(),n=Ve(),i=Ve(),s=Ve(),f=Ve(),u=Ve(),d=Ve(),g=Ve(),y=Ve();Ka(t,r[1],r[0]),Ka(y,e[1],e[0]),Xt(t,t,y),Ha(n,r[0],r[1]),Ha(y,e[0],e[1]),Xt(n,n,y),Xt(i,r[3],e[3]),Xt(i,i,LN),Xt(s,r[2],e[2]),Ha(s,s,s),Ka(f,n,t),Ka(u,s,i),Ha(d,s,i),Ha(g,n,t),Xt(r[0],f,u),Xt(r[1],g,d),Xt(r[2],d,u),Xt(r[3],f,g)}o(L1,"edadd");function A6(r,e,t){for(let n=0;n<4;n++)M6(r[n],e[n],t)}o(A6,"cswap");function U1(r,e){let t=Ve(),n=Ve(),i=Ve();k6(i,e[2]),Xt(t,e[0],i),Xt(n,e[1],i),Lu(r,n),r[31]^=C6(t)<<7}o(U1,"pack");function I6(r,e,t){zs(r[0],P1),zs(r[1],uc),zs(r[2],uc),zs(r[3],P1);for(let n=255;n>=0;--n){let i=t[n/8|0]>>(n&7)&1;A6(r,e,i),L1(e,r),L1(r,r),A6(r,e,i)}}o(I6,"scalarmult");function F1(r,e){let t=[Ve(),Ve(),Ve(),Ve()];zs(t[0],w6),zs(t[1],_6),zs(t[2],uc),Xt(t[3],w6,_6),I6(r,t,e)}o(F1,"scalarbase");function D6(r){if(r.length!==Vt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Vt.SEED_LENGTH} bytes`);let e=(0,Pu.hash)(r);e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(32),n=[Ve(),Ve(),Ve(),Ve()];F1(n,e),U1(t,n);let i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(D6,"generateKeyPairFromSeed");Vt.generateKeyPairFromSeed=D6;function $N(r){let e=(0,ON.randomBytes)(32,r),t=D6(e);return(0,S6.wipe)(e),t}o($N,"generateKeyPair");Vt.generateKeyPair=$N;function qN(r){if(r.length!==Vt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Vt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(r.subarray(32))}o(qN,"extractPublicKeyFromSecretKey");Vt.extractPublicKeyFromSecretKey=qN;var N1=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 R6(r,e){let 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]*N1[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)*N1[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*N1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(R6,"modL");function B1(r){let e=new Float64Array(64);for(let t=0;t<64;t++)e[t]=r[t];for(let t=0;t<64;t++)r[t]=0;R6(r,e)}o(B1,"reduce");function HN(r,e){let t=new Float64Array(64),n=[Ve(),Ve(),Ve(),Ve()],i=(0,Pu.hash)(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let s=new Uint8Array(64);s.set(i.subarray(32),32);let f=new Pu.SHA512;f.update(s.subarray(32)),f.update(e);let u=f.digest();f.clean(),B1(u),F1(n,u),U1(s,n),f.reset(),f.update(s.subarray(0,32)),f.update(r.subarray(32)),f.update(e);let d=f.digest();B1(d);for(let g=0;g<32;g++)t[g]=u[g];for(let g=0;g<32;g++)for(let y=0;y<32;y++)t[g+y]+=d[g]*i[y];return R6(s.subarray(32),t),s}o(HN,"sign");Vt.sign=HN;function O6(r,e){let t=Ve(),n=Ve(),i=Ve(),s=Ve(),f=Ve(),u=Ve(),d=Ve();return zs(r[2],uc),UN(r[1],e),za(i,r[1]),Xt(s,i,PN),Ka(i,i,r[2]),Ha(s,r[2],s),za(f,s),za(u,f),Xt(d,u,f),Xt(t,d,i),Xt(t,t,s),FN(t,t),Xt(t,t,i),Xt(t,t,s),Xt(t,t,s),Xt(r[0],t,s),za(n,r[0]),Xt(n,n,s),E6(n,i)&&Xt(r[0],r[0],BN),za(n,r[0]),Xt(n,n,s),E6(n,i)?-1:(C6(r[0])===e[31]>>7&&Ka(r[0],P1,r[0]),Xt(r[3],r[0],r[1]),0)}o(O6,"unpackneg");function zN(r,e,t){let n=new Uint8Array(32),i=[Ve(),Ve(),Ve(),Ve()],s=[Ve(),Ve(),Ve(),Ve()];if(t.length!==Vt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Vt.SIGNATURE_LENGTH} bytes`);if(O6(s,r))return!1;let f=new Pu.SHA512;f.update(t.subarray(0,32)),f.update(r),f.update(e);let u=f.digest();return B1(u),I6(i,s,u),F1(s,t.subarray(32)),L1(i,s),U1(n,i),!T6(t,n)}o(zN,"verify");Vt.verify=zN;function KN(r){let e=[Ve(),Ve(),Ve(),Ve()];if(O6(e,r))throw new Error("Ed25519: invalid public key");let t=Ve(),n=Ve(),i=e[1];Ha(t,uc,i),Ka(n,uc,i),k6(n,n),Xt(t,t,n);let s=new Uint8Array(32);return Lu(s,t),s}o(KN,"convertPublicKeyToX25519");Vt.convertPublicKeyToX25519=KN;function jN(r){let e=(0,Pu.hash)(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(e.subarray(0,32));return(0,S6.wipe)(e),t}o(jN,"convertSecretKeyToX25519");Vt.convertSecretKeyToX25519=jN});var P6=Re((wG,N6)=>{"use strict";N6.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?"":",",f=n===void 0||typeof n=="symbol"?null:n;return t+s+r(f)},"")+"]":"{"+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 F6=Re(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.sharedKey=dr.generateKeyPair=dr.generateKeyPairFromSeed=dr.scalarMultBase=dr.scalarMult=dr.SHARED_KEY_LENGTH=dr.SECRET_KEY_LENGTH=dr.PUBLIC_KEY_LENGTH=void 0;var GN=qa(),VN=bi();dr.PUBLIC_KEY_LENGTH=32;dr.SECRET_KEY_LENGTH=32;dr.SHARED_KEY_LENGTH=32;function go(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(go,"gf");var L6=new Uint8Array(32);L6[0]=9;var WN=go([56129,1]);function $1(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o($1,"car25519");function Bu(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(Bu,"sel25519");function JN(r,e){let t=go(),n=go();for(let i=0;i<16;i++)n[i]=e[i];$1(n),$1(n),$1(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,Bu(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(JN,"pack25519");function YN(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(YN,"unpack25519");function yd(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(yd,"add");function xd(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(xd,"sub");function ts(r,e,t){let n,i,s=0,f=0,u=0,d=0,g=0,y=0,E=0,O=0,R=0,I=0,N=0,X=0,L=0,J=0,ee=0,Y=0,ie=0,G=0,$=0,K=0,he=0,C=0,h=0,x=0,b=0,l=0,m=0,_=0,S=0,A=0,v=0,T=t[0],P=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],H=t[8],z=t[9],V=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ne=t[15];n=e[0],s+=n*T,f+=n*P,u+=n*w,d+=n*k,g+=n*fe,y+=n*D,E+=n*Q,O+=n*se,R+=n*H,I+=n*z,N+=n*V,X+=n*te,L+=n*ae,J+=n*Ae,ee+=n*ge,Y+=n*ne,n=e[1],f+=n*T,u+=n*P,d+=n*w,g+=n*k,y+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*H,N+=n*z,X+=n*V,L+=n*te,J+=n*ae,ee+=n*Ae,Y+=n*ge,ie+=n*ne,n=e[2],u+=n*T,d+=n*P,g+=n*w,y+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,N+=n*H,X+=n*z,L+=n*V,J+=n*te,ee+=n*ae,Y+=n*Ae,ie+=n*ge,G+=n*ne,n=e[3],d+=n*T,g+=n*P,y+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,N+=n*se,X+=n*H,L+=n*z,J+=n*V,ee+=n*te,Y+=n*ae,ie+=n*Ae,G+=n*ge,$+=n*ne,n=e[4],g+=n*T,y+=n*P,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,N+=n*Q,X+=n*se,L+=n*H,J+=n*z,ee+=n*V,Y+=n*te,ie+=n*ae,G+=n*Ae,$+=n*ge,K+=n*ne,n=e[5],y+=n*T,E+=n*P,O+=n*w,R+=n*k,I+=n*fe,N+=n*D,X+=n*Q,L+=n*se,J+=n*H,ee+=n*z,Y+=n*V,ie+=n*te,G+=n*ae,$+=n*Ae,K+=n*ge,he+=n*ne,n=e[6],E+=n*T,O+=n*P,R+=n*w,I+=n*k,N+=n*fe,X+=n*D,L+=n*Q,J+=n*se,ee+=n*H,Y+=n*z,ie+=n*V,G+=n*te,$+=n*ae,K+=n*Ae,he+=n*ge,C+=n*ne,n=e[7],O+=n*T,R+=n*P,I+=n*w,N+=n*k,X+=n*fe,L+=n*D,J+=n*Q,ee+=n*se,Y+=n*H,ie+=n*z,G+=n*V,$+=n*te,K+=n*ae,he+=n*Ae,C+=n*ge,h+=n*ne,n=e[8],R+=n*T,I+=n*P,N+=n*w,X+=n*k,L+=n*fe,J+=n*D,ee+=n*Q,Y+=n*se,ie+=n*H,G+=n*z,$+=n*V,K+=n*te,he+=n*ae,C+=n*Ae,h+=n*ge,x+=n*ne,n=e[9],I+=n*T,N+=n*P,X+=n*w,L+=n*k,J+=n*fe,ee+=n*D,Y+=n*Q,ie+=n*se,G+=n*H,$+=n*z,K+=n*V,he+=n*te,C+=n*ae,h+=n*Ae,x+=n*ge,b+=n*ne,n=e[10],N+=n*T,X+=n*P,L+=n*w,J+=n*k,ee+=n*fe,Y+=n*D,ie+=n*Q,G+=n*se,$+=n*H,K+=n*z,he+=n*V,C+=n*te,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*ne,n=e[11],X+=n*T,L+=n*P,J+=n*w,ee+=n*k,Y+=n*fe,ie+=n*D,G+=n*Q,$+=n*se,K+=n*H,he+=n*z,C+=n*V,h+=n*te,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ne,n=e[12],L+=n*T,J+=n*P,ee+=n*w,Y+=n*k,ie+=n*fe,G+=n*D,$+=n*Q,K+=n*se,he+=n*H,C+=n*z,h+=n*V,x+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ne,n=e[13],J+=n*T,ee+=n*P,Y+=n*w,ie+=n*k,G+=n*fe,$+=n*D,K+=n*Q,he+=n*se,C+=n*H,h+=n*z,x+=n*V,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,S+=n*ne,n=e[14],ee+=n*T,Y+=n*P,ie+=n*w,G+=n*k,$+=n*fe,K+=n*D,he+=n*Q,C+=n*se,h+=n*H,x+=n*z,b+=n*V,l+=n*te,m+=n*ae,_+=n*Ae,S+=n*ge,A+=n*ne,n=e[15],Y+=n*T,ie+=n*P,G+=n*w,$+=n*k,K+=n*fe,he+=n*D,C+=n*Q,h+=n*se,x+=n*H,b+=n*z,l+=n*V,m+=n*te,_+=n*ae,S+=n*Ae,A+=n*ge,v+=n*ne,s+=38*ie,f+=38*G,u+=38*$,d+=38*K,g+=38*he,y+=38*C,E+=38*h,O+=38*x,R+=38*b,I+=38*l,N+=38*m,X+=38*_,L+=38*S,J+=38*A,ee+=38*v,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=g,r[5]=y,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=N,r[11]=X,r[12]=L,r[13]=J,r[14]=ee,r[15]=Y}o(ts,"mul");function Uu(r,e){ts(r,e,e)}o(Uu,"square");function XN(r,e){let t=go();for(let n=0;n<16;n++)t[n]=e[n];for(let n=253;n>=0;n--)Uu(t,t),n!==2&&n!==4&&ts(t,t,e);for(let n=0;n<16;n++)r[n]=t[n]}o(XN,"inv25519");function q1(r,e){let t=new Uint8Array(32),n=new Float64Array(80),i=go(),s=go(),f=go(),u=go(),d=go(),g=go();for(let R=0;R<31;R++)t[R]=r[R];t[31]=r[31]&127|64,t[0]&=248,YN(n,e);for(let R=0;R<16;R++)s[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let I=t[R>>>3]>>>(R&7)&1;Bu(i,s,I),Bu(f,u,I),yd(d,i,f),xd(i,i,f),yd(f,s,u),xd(s,s,u),Uu(u,d),Uu(g,i),ts(i,f,i),ts(f,s,d),yd(d,i,f),xd(i,i,f),Uu(s,i),xd(f,u,g),ts(i,f,WN),yd(i,i,u),ts(f,f,i),ts(i,u,g),ts(u,s,n),Uu(s,d),Bu(i,s,I),Bu(f,u,I)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=f[R],n[R+48]=s[R],n[R+64]=u[R];let y=n.subarray(32),E=n.subarray(16);XN(y,y),ts(E,E,y);let O=new Uint8Array(32);return JN(O,E),O}o(q1,"scalarMult");dr.scalarMult=q1;function B6(r){return q1(r,L6)}o(B6,"scalarMultBase");dr.scalarMultBase=B6;function U6(r){if(r.length!==dr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${dr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(r);return{publicKey:B6(e),secretKey:e}}o(U6,"generateKeyPairFromSeed");dr.generateKeyPairFromSeed=U6;function ZN(r){let e=(0,GN.randomBytes)(32,r),t=U6(e);return(0,VN.wipe)(e),t}o(ZN,"generateKeyPair");dr.generateKeyPair=ZN;function QN(r,e,t=!1){if(r.length!==dr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==dr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=q1(r,e);if(t){let i=0;for(let s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(QN,"sharedKey");dr.sharedKey=QN});var z1=Re(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var Xr=Na(),H1=bi(),eP=20;function tP(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],g=t[11]<<24|t[10]<<16|t[9]<<8|t[8],y=t[15]<<24|t[14]<<16|t[13]<<8|t[12],E=t[19]<<24|t[18]<<16|t[17]<<8|t[16],O=t[23]<<24|t[22]<<16|t[21]<<8|t[20],R=t[27]<<24|t[26]<<16|t[25]<<8|t[24],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],N=e[3]<<24|e[2]<<16|e[1]<<8|e[0],X=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Y=i,ie=s,G=f,$=u,K=d,he=g,C=y,h=E,x=O,b=R,l=I,m=N,_=X,S=L,A=J,v=0;v<eP;v+=2)ee=ee+$|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,$^=h,$=$>>>32-12|$<<12,Y=Y+K|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,K^=x,K=K>>>32-12|K<<12,ie=ie+he|0,S^=ie,S=S>>>32-16|S<<16,b=b+S|0,he^=b,he=he>>>32-12|he<<12,G=G+C|0,A^=G,A=A>>>32-16|A<<16,l=l+A|0,C^=l,C=C>>>32-12|C<<12,ie=ie+he|0,S^=ie,S=S>>>32-8|S<<8,b=b+S|0,he^=b,he=he>>>32-7|he<<7,G=G+C|0,A^=G,A=A>>>32-8|A<<8,l=l+A|0,C^=l,C=C>>>32-7|C<<7,Y=Y+K|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,K^=x,K=K>>>32-7|K<<7,ee=ee+$|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,$^=h,$=$>>>32-7|$<<7,ee=ee+K|0,A^=ee,A=A>>>32-16|A<<16,b=b+A|0,K^=b,K=K>>>32-12|K<<12,Y=Y+he|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ie=ie+C|0,_^=ie,_=_>>>32-16|_<<16,h=h+_|0,C^=h,C=C>>>32-12|C<<12,G=G+$|0,S^=G,S=S>>>32-16|S<<16,x=x+S|0,$^=x,$=$>>>32-12|$<<12,ie=ie+C|0,_^=ie,_=_>>>32-8|_<<8,h=h+_|0,C^=h,C=C>>>32-7|C<<7,G=G+$|0,S^=G,S=S>>>32-8|S<<8,x=x+S|0,$^=x,$=$>>>32-7|$<<7,Y=Y+he|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+K|0,A^=ee,A=A>>>32-8|A<<8,b=b+A|0,K^=b,K=K>>>32-7|K<<7;Xr.writeUint32LE(ee+n|0,r,0),Xr.writeUint32LE(Y+i|0,r,4),Xr.writeUint32LE(ie+s|0,r,8),Xr.writeUint32LE(G+f|0,r,12),Xr.writeUint32LE($+u|0,r,16),Xr.writeUint32LE(K+d|0,r,20),Xr.writeUint32LE(he+g|0,r,24),Xr.writeUint32LE(C+y|0,r,28),Xr.writeUint32LE(h+E|0,r,32),Xr.writeUint32LE(x+O|0,r,36),Xr.writeUint32LE(b+R|0,r,40),Xr.writeUint32LE(l+I|0,r,44),Xr.writeUint32LE(m+N|0,r,48),Xr.writeUint32LE(_+X|0,r,52),Xr.writeUint32LE(S+L|0,r,56),Xr.writeUint32LE(A+J|0,r,60)}o(tP,"core");function $6(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,f;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),f=s.length-e.length,s.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,f=i}for(var u=new Uint8Array(64),d=0;d<t.length;d+=64){tP(u,s,r);for(var g=d;g<d+64&&g<t.length;g++)n[g]=t[g]^u[g-d];nP(s,0,f)}return H1.wipe(u),i===0&&H1.wipe(s),n}o($6,"streamXOR");wd.streamXOR=$6;function rP(r,e,t,n){return n===void 0&&(n=0),H1.wipe(t),$6(r,e,t,t,n)}o(rP,"stream");wd.stream=rP;function nP(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(nP,"incrementCounter")});var K6=Re(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});var Ks=Na(),q6=bi(),iP=z1(),oP=20;function H6(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=z6(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var f=iP.streamXOR(i,s,t,n);return q6.wipe(i),f}o(H6,"streamXOR");Fu.streamXOR=H6;function sP(r,e,t){return q6.wipe(t),H6(r,e,t,t)}o(sP,"stream");Fu.stream=sP;function z6(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],d=r[7]<<24|r[6]<<16|r[5]<<8|r[4],g=r[11]<<24|r[10]<<16|r[9]<<8|r[8],y=r[15]<<24|r[14]<<16|r[13]<<8|r[12],E=r[19]<<24|r[18]<<16|r[17]<<8|r[16],O=r[23]<<24|r[22]<<16|r[21]<<8|r[20],R=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],N=e[3]<<24|e[2]<<16|e[1]<<8|e[0],X=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Y=i,ie=s,G=f,$=u,K=d,he=g,C=y,h=E,x=O,b=R,l=I,m=N,_=X,S=L,A=J,v=0;v<oP;v+=2)ee=ee+$|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,$^=h,$=$>>>32-12|$<<12,Y=Y+K|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,K^=x,K=K>>>32-12|K<<12,ie=ie+he|0,S^=ie,S=S>>>32-16|S<<16,b=b+S|0,he^=b,he=he>>>32-12|he<<12,G=G+C|0,A^=G,A=A>>>32-16|A<<16,l=l+A|0,C^=l,C=C>>>32-12|C<<12,ie=ie+he|0,S^=ie,S=S>>>32-8|S<<8,b=b+S|0,he^=b,he=he>>>32-7|he<<7,G=G+C|0,A^=G,A=A>>>32-8|A<<8,l=l+A|0,C^=l,C=C>>>32-7|C<<7,Y=Y+K|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,K^=x,K=K>>>32-7|K<<7,ee=ee+$|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,$^=h,$=$>>>32-7|$<<7,ee=ee+K|0,A^=ee,A=A>>>32-16|A<<16,b=b+A|0,K^=b,K=K>>>32-12|K<<12,Y=Y+he|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ie=ie+C|0,_^=ie,_=_>>>32-16|_<<16,h=h+_|0,C^=h,C=C>>>32-12|C<<12,G=G+$|0,S^=G,S=S>>>32-16|S<<16,x=x+S|0,$^=x,$=$>>>32-12|$<<12,ie=ie+C|0,_^=ie,_=_>>>32-8|_<<8,h=h+_|0,C^=h,C=C>>>32-7|C<<7,G=G+$|0,S^=G,S=S>>>32-8|S<<8,x=x+S|0,$^=x,$=$>>>32-7|$<<7,Y=Y+he|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+K|0,A^=ee,A=A>>>32-8|A<<8,b=b+A|0,K^=b,K=K>>>32-7|K<<7;return Ks.writeUint32LE(ee,t,0),Ks.writeUint32LE(Y,t,4),Ks.writeUint32LE(ie,t,8),Ks.writeUint32LE(G,t,12),Ks.writeUint32LE(m,t,16),Ks.writeUint32LE(_,t,20),Ks.writeUint32LE(S,t,24),Ks.writeUint32LE(A,t,28),t}o(z6,"hchacha");Fu.hchacha=z6});var K1=Re(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});function aP(r,e,t){return~(r-1)&e|r-1&t}o(aP,"select");lc.select=aP;function fP(r,e){return(r|0)-(e|0)-1>>>31&1}o(fP,"lessOrEqual");lc.lessOrEqual=fP;function j6(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(j6,"compare");lc.compare=j6;function cP(r,e){return r.length===0||e.length===0?!1:j6(r,e)!==0}o(cP,"equal");lc.equal=cP});var V6=Re(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var uP=K1(),_d=bi();rs.DIGEST_LENGTH=16;var G6=function(){function r(e){this.digestLength=rs.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 f=e[8]|e[9]<<8;this._r[4]=(s>>>4|f<<12)&255,this._r[5]=f>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(f>>>14|u<<2)&8191;var d=e[12]|e[13]<<8;this._r[7]=(u>>>11|d<<5)&8065;var g=e[14]|e[15]<<8;this._r[8]=(d>>>8|g<<8)&8191,this._r[9]=g>>>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],f=this._h[1],u=this._h[2],d=this._h[3],g=this._h[4],y=this._h[5],E=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],N=this._r[0],X=this._r[1],L=this._r[2],J=this._r[3],ee=this._r[4],Y=this._r[5],ie=this._r[6],G=this._r[7],$=this._r[8],K=this._r[9];n>=16;){var he=e[t+0]|e[t+1]<<8;s+=he&8191;var C=e[t+2]|e[t+3]<<8;f+=(he>>>13|C<<3)&8191;var h=e[t+4]|e[t+5]<<8;u+=(C>>>10|h<<6)&8191;var x=e[t+6]|e[t+7]<<8;d+=(h>>>7|x<<9)&8191;var b=e[t+8]|e[t+9]<<8;g+=(x>>>4|b<<12)&8191,y+=b>>>1&8191;var l=e[t+10]|e[t+11]<<8;E+=(b>>>14|l<<2)&8191;var m=e[t+12]|e[t+13]<<8;O+=(l>>>11|m<<5)&8191;var _=e[t+14]|e[t+15]<<8;R+=(m>>>8|_<<8)&8191,I+=_>>>5|i;var S=0,A=S;A+=s*N,A+=f*(5*K),A+=u*(5*$),A+=d*(5*G),A+=g*(5*ie),S=A>>>13,A&=8191,A+=y*(5*Y),A+=E*(5*ee),A+=O*(5*J),A+=R*(5*L),A+=I*(5*X),S+=A>>>13,A&=8191;var v=S;v+=s*X,v+=f*N,v+=u*(5*K),v+=d*(5*$),v+=g*(5*G),S=v>>>13,v&=8191,v+=y*(5*ie),v+=E*(5*Y),v+=O*(5*ee),v+=R*(5*J),v+=I*(5*L),S+=v>>>13,v&=8191;var T=S;T+=s*L,T+=f*X,T+=u*N,T+=d*(5*K),T+=g*(5*$),S=T>>>13,T&=8191,T+=y*(5*G),T+=E*(5*ie),T+=O*(5*Y),T+=R*(5*ee),T+=I*(5*J),S+=T>>>13,T&=8191;var P=S;P+=s*J,P+=f*L,P+=u*X,P+=d*N,P+=g*(5*K),S=P>>>13,P&=8191,P+=y*(5*$),P+=E*(5*G),P+=O*(5*ie),P+=R*(5*Y),P+=I*(5*ee),S+=P>>>13,P&=8191;var w=S;w+=s*ee,w+=f*J,w+=u*L,w+=d*X,w+=g*N,S=w>>>13,w&=8191,w+=y*(5*K),w+=E*(5*$),w+=O*(5*G),w+=R*(5*ie),w+=I*(5*Y),S+=w>>>13,w&=8191;var k=S;k+=s*Y,k+=f*ee,k+=u*J,k+=d*L,k+=g*X,S=k>>>13,k&=8191,k+=y*N,k+=E*(5*K),k+=O*(5*$),k+=R*(5*G),k+=I*(5*ie),S+=k>>>13,k&=8191;var fe=S;fe+=s*ie,fe+=f*Y,fe+=u*ee,fe+=d*J,fe+=g*L,S=fe>>>13,fe&=8191,fe+=y*X,fe+=E*N,fe+=O*(5*K),fe+=R*(5*$),fe+=I*(5*G),S+=fe>>>13,fe&=8191;var D=S;D+=s*G,D+=f*ie,D+=u*Y,D+=d*ee,D+=g*J,S=D>>>13,D&=8191,D+=y*L,D+=E*X,D+=O*N,D+=R*(5*K),D+=I*(5*$),S+=D>>>13,D&=8191;var Q=S;Q+=s*$,Q+=f*G,Q+=u*ie,Q+=d*Y,Q+=g*ee,S=Q>>>13,Q&=8191,Q+=y*J,Q+=E*L,Q+=O*X,Q+=R*N,Q+=I*(5*K),S+=Q>>>13,Q&=8191;var se=S;se+=s*K,se+=f*$,se+=u*G,se+=d*ie,se+=g*Y,S=se>>>13,se&=8191,se+=y*ee,se+=E*J,se+=O*L,se+=R*X,se+=I*N,S+=se>>>13,se&=8191,S=(S<<2)+S|0,S=S+A|0,A=S&8191,S=S>>>13,v+=S,s=A,f=v,u=T,d=P,g=w,y=k,E=fe,O=D,R=Q,I=se,t+=16,n-=16}this._h[0]=s,this._h[1]=f,this._h[2]=u,this._h[3]=d,this._h[4]=g,this._h[5]=y,this._h[6]=E,this._h[7]=O,this._h[8]=R,this._h[9]=I},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,f,u;if(this._leftover){for(u=this._leftover,this._buffer[u++]=1;u<16;u++)this._buffer[u]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,u=2;u<10;u++)this._h[u]+=i,i=this._h[u]>>>13,this._h[u]&=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,u=1;u<10;u++)n[u]=this._h[u]+i,i=n[u]>>>13,n[u]&=8191;for(n[9]-=1<<13,s=(i^1)-1,u=0;u<10;u++)n[u]&=s;for(s=~s,u=0;u<10;u++)this._h[u]=this._h[u]&s|n[u];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,f=this._h[0]+this._pad[0],this._h[0]=f&65535,u=1;u<8;u++)f=(this._h[u]+this._pad[u]|0)+(f>>>16)|0,this._h[u]=f&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 _d.wipe(this._buffer),_d.wipe(this._r),_d.wipe(this._h),_d.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();rs.Poly1305=G6;function lP(r,e){var t=new G6(r);t.update(e);var n=t.digest();return t.clean(),n}o(lP,"oneTimeAuth");rs.oneTimeAuth=lP;function hP(r,e){return r.length!==rs.DIGEST_LENGTH||e.length!==rs.DIGEST_LENGTH?!1:uP.equal(r,e)}o(hP,"equal");rs.equal=hP});var Y6=Re(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var Ed=z1(),dP=V6(),$u=bi(),W6=Na(),pP=K1();ns.KEY_LENGTH=32;ns.NONCE_LENGTH=12;ns.TAG_LENGTH=16;var J6=new Uint8Array(16),mP=function(){function r(e){if(this.nonceLength=ns.NONCE_LENGTH,this.tagLength=ns.TAG_LENGTH,e.length!==ns.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 f=new Uint8Array(32);Ed.stream(this._key,s,f,4);var u=t.length+this.tagLength,d;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");d=i}else d=new Uint8Array(u);return Ed.streamXOR(this._key,s,t,d,4),this._authenticate(d.subarray(d.length-this.tagLength,d.length),f,d.subarray(0,d.length-this.tagLength),n),$u.wipe(s),d},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 f=new Uint8Array(32);Ed.stream(this._key,s,f,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,f,t.subarray(0,t.length-this.tagLength),n),!pP.equal(u,t.subarray(t.length-this.tagLength,t.length)))return null;var d=t.length-this.tagLength,g;if(i){if(i.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");g=i}else g=new Uint8Array(d);return Ed.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),g,4),$u.wipe(s),g},r.prototype.clean=function(){return $u.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new dP.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(J6.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(J6.subarray(n.length%16));var f=new Uint8Array(8);i&&W6.writeUint64LE(i.length,f),s.update(f),W6.writeUint64LE(n.length,f),s.update(f);for(var u=s.digest(),d=0;d<u.length;d++)e[d]=u[d];s.clean(),$u.wipe(u),$u.wipe(f)},r}();ns.ChaCha20Poly1305=mP});var Q6=Re(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var X6=K6(),Z6=Y6(),qu=bi();is.KEY_LENGTH=32;is.NONCE_LENGTH=24;is.TAG_LENGTH=16;var bP=function(){function r(e){if(this.nonceLength=is.NONCE_LENGTH,this.tagLength=is.TAG_LENGTH,e.length!==is.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=X6.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new Z6.ChaCha20Poly1305(s),d=u.seal(f,t,n,i);return qu.wipe(s),qu.wipe(f),u.clean(),d},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=X6.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new Z6.ChaCha20Poly1305(s),d=u.open(f,t,n,i);return qu.wipe(s),qu.wipe(f),u.clean(),d},r.prototype.clean=function(){return qu.wipe(this._key),this},r}();is.XChaCha20Poly1305=bP});var K4=Re(qd=>{"use strict";qd.byteLength=BL;qd.toByteArray=FL;qd.fromByteArray=HL;var yo=[],Ei=[],LL=typeof Uint8Array<"u"?Uint8Array:Array,bb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Xa=0,H4=bb.length;Xa<H4;++Xa)yo[Xa]=bb[Xa],Ei[bb.charCodeAt(Xa)]=Xa;var Xa,H4;Ei["-".charCodeAt(0)]=62;Ei["_".charCodeAt(0)]=63;function z4(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}o(z4,"getLens");function BL(r){var e=z4(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(BL,"byteLength");function UL(r,e,t){return(e+t)*3/4-t}o(UL,"_byteLength");function FL(r){var e,t=z4(r),n=t[0],i=t[1],s=new LL(UL(r,n,i)),f=0,u=i>0?n-4:n,d;for(d=0;d<u;d+=4)e=Ei[r.charCodeAt(d)]<<18|Ei[r.charCodeAt(d+1)]<<12|Ei[r.charCodeAt(d+2)]<<6|Ei[r.charCodeAt(d+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return i===2&&(e=Ei[r.charCodeAt(d)]<<2|Ei[r.charCodeAt(d+1)]>>4,s[f++]=e&255),i===1&&(e=Ei[r.charCodeAt(d)]<<10|Ei[r.charCodeAt(d+1)]<<4|Ei[r.charCodeAt(d+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}o(FL,"toByteArray");function $L(r){return yo[r>>18&63]+yo[r>>12&63]+yo[r>>6&63]+yo[r&63]}o($L,"tripletToBase64");function qL(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push($L(n));return i.join("")}o(qL,"encodeChunk");function HL(r){for(var e,t=r.length,n=t%3,i=[],s=16383,f=0,u=t-n;f<u;f+=s)i.push(qL(r,f,f+s>u?u:f+s));return n===1?(e=r[t-1],i.push(yo[e>>2]+yo[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yo[e>>10]+yo[e>>4&63]+yo[e<<2&63]+"=")),i.join("")}o(HL,"fromByteArray")});var j4=Re(gb=>{gb.read=function(r,e,t,n,i){var s,f,u=i*8-n-1,d=(1<<u)-1,g=d>>1,y=-7,E=t?i-1:0,O=t?-1:1,R=r[e+E];for(E+=O,s=R&(1<<-y)-1,R>>=-y,y+=u;y>0;s=s*256+r[e+E],E+=O,y-=8);for(f=s&(1<<-y)-1,s>>=-y,y+=n;y>0;f=f*256+r[e+E],E+=O,y-=8);if(s===0)s=1-g;else{if(s===d)return f?NaN:(R?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-g}return(R?-1:1)*f*Math.pow(2,s-n)};gb.write=function(r,e,t,n,i,s){var f,u,d,g=s*8-i-1,y=(1<<g)-1,E=y>>1,O=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:s-1,I=n?1:-1,N=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,f=y):(f=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-f))<1&&(f--,d*=2),f+E>=1?e+=O/d:e+=O*Math.pow(2,1-E),e*d>=2&&(f++,d/=2),f+E>=y?(u=0,f=y):f+E>=1?(u=(e*d-1)*Math.pow(2,i),f=f+E):(u=e*Math.pow(2,E-1)*Math.pow(2,i),f=0));i>=8;r[t+R]=u&255,R+=I,u/=256,i-=8);for(f=f<<i|u,g+=i;g>0;r[t+R]=f&255,R+=I,f/=256,g-=8);r[t+R-I]|=N*128}});var Kd=Re(wc=>{"use strict";var vb=K4(),xc=j4(),G4=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;wc.Buffer=Se;wc.SlowBuffer=WL;wc.INSPECT_MAX_BYTES=50;var Hd=2147483647;wc.kMaxLength=Hd;Se.TYPED_ARRAY_SUPPORT=zL();!Se.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function zL(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}o(zL,"typedArraySupport");Object.defineProperty(Se.prototype,"parent",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.buffer}});Object.defineProperty(Se.prototype,"offset",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.byteOffset}});function ss(r){if(r>Hd)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Se.prototype),e}o(ss,"createBuffer");function Se(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _b(r)}return J4(r,e,t)}o(Se,"Buffer");Se.poolSize=8192;function J4(r,e,t){if(typeof r=="string")return jL(r,e);if(ArrayBuffer.isView(r))return GL(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(xo(r,ArrayBuffer)||r&&xo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xo(r,SharedArrayBuffer)||r&&xo(r.buffer,SharedArrayBuffer)))return xb(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return Se.from(n,e,t);var i=VL(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Se.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o(J4,"from");Se.from=function(r,e,t){return J4(r,e,t)};Object.setPrototypeOf(Se.prototype,Uint8Array.prototype);Object.setPrototypeOf(Se,Uint8Array);function Y4(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}o(Y4,"assertSize");function KL(r,e,t){return Y4(r),r<=0?ss(r):e!==void 0?typeof t=="string"?ss(r).fill(e,t):ss(r).fill(e):ss(r)}o(KL,"alloc");Se.alloc=function(r,e,t){return KL(r,e,t)};function _b(r){return Y4(r),ss(r<0?0:Eb(r)|0)}o(_b,"allocUnsafe");Se.allocUnsafe=function(r){return _b(r)};Se.allocUnsafeSlow=function(r){return _b(r)};function jL(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Se.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=X4(r,e)|0,n=ss(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(jL,"fromString");function yb(r){for(var e=r.length<0?0:Eb(r.length)|0,t=ss(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}o(yb,"fromArrayLike");function GL(r){if(xo(r,Uint8Array)){var e=new Uint8Array(r);return xb(e.buffer,e.byteOffset,e.byteLength)}return yb(r)}o(GL,"fromArrayView");function xb(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,Se.prototype),n}o(xb,"fromArrayBuffer");function VL(r){if(Se.isBuffer(r)){var e=Eb(r.length)|0,t=ss(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Ab(r.length)?ss(0):yb(r);if(r.type==="Buffer"&&Array.isArray(r.data))return yb(r.data)}o(VL,"fromObject");function Eb(r){if(r>=Hd)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Hd.toString(16)+" bytes");return r|0}o(Eb,"checked");function WL(r){return+r!=r&&(r=0),Se.alloc(+r)}o(WL,"SlowBuffer");Se.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==Se.prototype},"isBuffer");Se.compare=o(function(e,t){if(xo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),xo(t,Uint8Array)&&(t=Se.from(t,t.offset,t.byteLength)),!Se.isBuffer(e)||!Se.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,s=0,f=Math.min(n,i);s<f;++s)if(e[s]!==t[s]){n=e[s],i=t[s];break}return n<i?-1:i<n?1:0},"compare");Se.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");Se.concat=o(function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Se.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=Se.allocUnsafe(t),s=0;for(n=0;n<e.length;++n){var f=e[n];if(xo(f,Uint8Array))s+f.length>i.length?Se.from(f).copy(i,s):Uint8Array.prototype.set.call(i,f,s);else if(Se.isBuffer(f))f.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=f.length}return i},"concat");function X4(r,e){if(Se.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||xo(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wb(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return n5(r).length;default:if(i)return n?-1:wb(r).length;e=(""+e).toLowerCase(),i=!0}}o(X4,"byteLength");Se.byteLength=X4;function JL(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return oB(this,e,t);case"utf8":case"utf-8":return Q4(this,e,t);case"ascii":return nB(this,e,t);case"latin1":case"binary":return iB(this,e,t);case"base64":return tB(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sB(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o(JL,"slowToString");Se.prototype._isBuffer=!0;function Za(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}o(Za,"swap");Se.prototype.swap16=o(function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Za(this,t,t+1);return this},"swap16");Se.prototype.swap32=o(function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Za(this,t,t+3),Za(this,t+1,t+2);return this},"swap32");Se.prototype.swap64=o(function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Za(this,t,t+7),Za(this,t+1,t+6),Za(this,t+2,t+5),Za(this,t+3,t+4);return this},"swap64");Se.prototype.toString=o(function(){var e=this.length;return e===0?"":arguments.length===0?Q4(this,0,e):JL.apply(this,arguments)},"toString");Se.prototype.toLocaleString=Se.prototype.toString;Se.prototype.equals=o(function(e){if(!Se.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Se.compare(this,e)===0},"equals");Se.prototype.inspect=o(function(){var e="",t=wc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");G4&&(Se.prototype[G4]=Se.prototype.inspect);Se.prototype.compare=o(function(e,t,n,i,s){if(xo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),!Se.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var f=s-i,u=n-t,d=Math.min(f,u),g=this.slice(i,s),y=e.slice(t,n),E=0;E<d;++E)if(g[E]!==y[E]){f=g[E],u=y[E];break}return f<u?-1:u<f?1:0},"compare");function Z4(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ab(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=Se.from(e,n)),Se.isBuffer(e))return e.length===0?-1:V4(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):V4(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(Z4,"bidirectionalIndexOf");function V4(r,e,t,n,i){var s=1,f=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,f/=2,u/=2,t/=2}function d(R,I){return s===1?R[I]:R.readUInt16BE(I*s)}o(d,"read");var g;if(i){var y=-1;for(g=t;g<f;g++)if(d(r,g)===d(e,y===-1?0:g-y)){if(y===-1&&(y=g),g-y+1===u)return y*s}else y!==-1&&(g-=g-y),y=-1}else for(t+u>f&&(t=f-u),g=t;g>=0;g--){for(var E=!0,O=0;O<u;O++)if(d(r,g+O)!==d(e,O)){E=!1;break}if(E)return g}return-1}o(V4,"arrayIndexOf");Se.prototype.includes=o(function(e,t,n){return this.indexOf(e,t,n)!==-1},"includes");Se.prototype.indexOf=o(function(e,t,n){return Z4(this,e,t,n,!0)},"indexOf");Se.prototype.lastIndexOf=o(function(e,t,n){return Z4(this,e,t,n,!1)},"lastIndexOf");function YL(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var s=e.length;n>s/2&&(n=s/2);for(var f=0;f<n;++f){var u=parseInt(e.substr(f*2,2),16);if(Ab(u))return f;r[t+f]=u}return f}o(YL,"hexWrite");function XL(r,e,t,n){return zd(wb(e,r.length-t),r,t,n)}o(XL,"utf8Write");function ZL(r,e,t,n){return zd(cB(e),r,t,n)}o(ZL,"asciiWrite");function QL(r,e,t,n){return zd(n5(e),r,t,n)}o(QL,"base64Write");function eB(r,e,t,n){return zd(uB(e,r.length-t),r,t,n)}o(eB,"ucs2Write");Se.prototype.write=o(function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return YL(this,e,t,n);case"utf8":case"utf-8":return XL(this,e,t,n);case"ascii":case"latin1":case"binary":return ZL(this,e,t,n);case"base64":return QL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eB(this,e,t,n);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},"write");Se.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function tB(r,e,t){return e===0&&t===r.length?vb.fromByteArray(r):vb.fromByteArray(r.slice(e,t))}o(tB,"base64Slice");function Q4(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var s=r[i],f=null,u=s>239?4:s>223?3:s>191?2:1;if(i+u<=t){var d,g,y,E;switch(u){case 1:s<128&&(f=s);break;case 2:d=r[i+1],(d&192)===128&&(E=(s&31)<<6|d&63,E>127&&(f=E));break;case 3:d=r[i+1],g=r[i+2],(d&192)===128&&(g&192)===128&&(E=(s&15)<<12|(d&63)<<6|g&63,E>2047&&(E<55296||E>57343)&&(f=E));break;case 4:d=r[i+1],g=r[i+2],y=r[i+3],(d&192)===128&&(g&192)===128&&(y&192)===128&&(E=(s&15)<<18|(d&63)<<12|(g&63)<<6|y&63,E>65535&&E<1114112&&(f=E))}}f===null?(f=65533,u=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),i+=u}return rB(n)}o(Q4,"utf8Slice");var W4=4096;function rB(r){var e=r.length;if(e<=W4)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=W4));return t}o(rB,"decodeCodePointsArray");function nB(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}o(nB,"asciiSlice");function iB(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}o(iB,"latin1Slice");function oB(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",s=e;s<t;++s)i+=lB[r[s]];return i}o(oB,"hexSlice");function sB(r,e,t){for(var n=r.slice(e,t),i="",s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}o(sB,"utf16leSlice");Se.prototype.slice=o(function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,Se.prototype),i},"slice");function Rr(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o(Rr,"checkOffset");Se.prototype.readUintLE=Se.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return i},"readUIntLE");Se.prototype.readUintBE=Se.prototype.readUIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=this[e+--t],s=1;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");Se.prototype.readUint8=Se.prototype.readUInt8=o(function(e,t){return e=e>>>0,t||Rr(e,1,this.length),this[e]},"readUInt8");Se.prototype.readUint16LE=Se.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||Rr(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");Se.prototype.readUint16BE=Se.prototype.readUInt16BE=o(function(e,t){return e=e>>>0,t||Rr(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");Se.prototype.readUint32LE=Se.prototype.readUInt32LE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");Se.prototype.readUint32BE=Se.prototype.readUInt32BE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");Se.prototype.readIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");Se.prototype.readIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=t,s=1,f=this[e+--i];i>0&&(s*=256);)f+=this[e+--i]*s;return s*=128,f>=s&&(f-=Math.pow(2,8*t)),f},"readIntBE");Se.prototype.readInt8=o(function(e,t){return e=e>>>0,t||Rr(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");Se.prototype.readInt16LE=o(function(e,t){e=e>>>0,t||Rr(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");Se.prototype.readInt16BE=o(function(e,t){e=e>>>0,t||Rr(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");Se.prototype.readInt32LE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");Se.prototype.readInt32BE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");Se.prototype.readFloatLE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),xc.read(this,e,!0,23,4)},"readFloatLE");Se.prototype.readFloatBE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),xc.read(this,e,!1,23,4)},"readFloatBE");Se.prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||Rr(e,8,this.length),xc.read(this,e,!0,52,8)},"readDoubleLE");Se.prototype.readDoubleBE=o(function(e,t){return e=e>>>0,t||Rr(e,8,this.length),xc.read(this,e,!1,52,8)},"readDoubleBE");function Sn(r,e,t,n,i,s){if(!Se.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}o(Sn,"checkInt");Se.prototype.writeUintLE=Se.prototype.writeUIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Sn(this,e,t,n,s,0)}var f=1,u=0;for(this[t]=e&255;++u<n&&(f*=256);)this[t+u]=e/f&255;return t+n},"writeUIntLE");Se.prototype.writeUintBE=Se.prototype.writeUIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Sn(this,e,t,n,s,0)}var f=n-1,u=1;for(this[t+f]=e&255;--f>=0&&(u*=256);)this[t+f]=e/u&255;return t+n},"writeUIntBE");Se.prototype.writeUint8=Se.prototype.writeUInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");Se.prototype.writeUint16LE=Se.prototype.writeUInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");Se.prototype.writeUint16BE=Se.prototype.writeUInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");Se.prototype.writeUint32LE=Se.prototype.writeUInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},"writeUInt32LE");Se.prototype.writeUint32BE=Se.prototype.writeUInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");Se.prototype.writeIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Sn(this,e,t,n,s-1,-s)}var f=0,u=1,d=0;for(this[t]=e&255;++f<n&&(u*=256);)e<0&&d===0&&this[t+f-1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntLE");Se.prototype.writeIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Sn(this,e,t,n,s-1,-s)}var f=n-1,u=1,d=0;for(this[t+f]=e&255;--f>=0&&(u*=256);)e<0&&d===0&&this[t+f+1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntBE");Se.prototype.writeInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");Se.prototype.writeInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");Se.prototype.writeInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");Se.prototype.writeInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");Se.prototype.writeInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");function e5(r,e,t,n,i,s){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}o(e5,"checkIEEE754");function t5(r,e,t,n,i){return e=+e,t=t>>>0,i||e5(r,e,t,4,34028234663852886e22,-34028234663852886e22),xc.write(r,e,t,n,23,4),t+4}o(t5,"writeFloat");Se.prototype.writeFloatLE=o(function(e,t,n){return t5(this,e,t,!0,n)},"writeFloatLE");Se.prototype.writeFloatBE=o(function(e,t,n){return t5(this,e,t,!1,n)},"writeFloatBE");function r5(r,e,t,n,i){return e=+e,t=t>>>0,i||e5(r,e,t,8,17976931348623157e292,-17976931348623157e292),xc.write(r,e,t,n,52,8),t+8}o(r5,"writeDouble");Se.prototype.writeDoubleLE=o(function(e,t,n){return r5(this,e,t,!0,n)},"writeDoubleLE");Se.prototype.writeDoubleBE=o(function(e,t,n){return r5(this,e,t,!1,n)},"writeDoubleBE");Se.prototype.copy=o(function(e,t,n,i){if(!Se.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var s=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),s},"copy");Se.prototype.fill=o(function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Se.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var f;if(typeof e=="number")for(f=t;f<n;++f)this[f]=e;else{var u=Se.isBuffer(e)?e:Se.from(e,i),d=u.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(f=0;f<n-t;++f)this[f+t]=u[f%d]}return this},"fill");var aB=/[^+/0-9A-Za-z-_]/g;function fB(r){if(r=r.split("=")[0],r=r.trim().replace(aB,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}o(fB,"base64clean");function wb(r,e){e=e||1/0;for(var t,n=r.length,i=null,s=[],f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(wb,"utf8ToBytes");function cB(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}o(cB,"asciiToBytes");function uB(r,e){for(var t,n,i,s=[],f=0;f<r.length&&!((e-=2)<0);++f)t=r.charCodeAt(f),n=t>>8,i=t%256,s.push(i),s.push(n);return s}o(uB,"utf16leToBytes");function n5(r){return vb.toByteArray(fB(r))}o(n5,"base64ToBytes");function zd(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}o(zd,"blitBuffer");function xo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}o(xo,"isInstance");function Ab(r){return r!==r}o(Ab,"numberIsNaN");var lB=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)e[n+i]=r[t]+r[i];return e}()});var Wi=Re((oW,i5)=>{i5.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 Xu=Re((sW,o5)=>{o5.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 a5=Re(Or=>{var{Buffer:Sr}=Kd(),jd=4294967292,Gd=4294967293,Sb=4294967294,s5=4294967295,Ue=[0,1,3,7,15,31,63,127,255,511,1023],Ws=["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"],hB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),jn=[];hB.forEach(r=>{jn.push(r.charCodeAt(0))});Or.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&Ue[5])),e.push(128+(t&Ue[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]));else if(t>=65536&&t<=1114111){let n=t>>16&Ue[5];e.push(240+(n>>2)),e.push(128+((n&Ue[2])<<4)+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Sr.from(e)},decode(r,e){function t(I,N){if((N&192)!==128)return Gd;let X=((I&Ue[5])<<6)+(N&Ue[6]);return X<128?jd:X}o(t,"bytes2");function n(I,N,X){if((X&192)!==128||(N&192)!==128)return Gd;let L=((I&Ue[4])<<12)+((N&Ue[6])<<6)+(X&Ue[6]);return L<2048?jd:L>=55296&&L<=57343?Sb:L}o(n,"bytes3");function i(I,N,X,L){if((L&192)!==128||(X&192)!==128||(N&192)!==128)return Gd;let J=(((I&Ue[3])<<2)+(N>>4&Ue[2])<<16)+((N&Ue[4])<<12)+((X&Ue[6])<<6)+(L&Ue[6]);return J<65536?jd:J>1114111?Sb:J}o(i,"bytes4");let s,f,u,d,g,y,E=r.length,O=e?3:0,R=[];for(;O<E;){f=r[O],s=s5;let I=!0;for(;I;){if(f>=0&&f<=127){s=f,y=1;break}if(u=O+1,u<E&&f>=194&&f<=223){s=t(f,r[u]),y=2;break}if(d=O+2,d<E&&f>=224&&f<=239){s=n(f,r[u],r[d]),y=3;break}if(g=O+3,g<E&&f>=240&&f<=244){s=i(f,r[u],r[d],r[g]),y=4;break}break}if(s>1114111){let N=`byte[${O}]`;throw s===s5?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${N}`):s===Gd?new RangeError(`utf8.decode: illegal trailing byte found at: ${N}`):s===Sb?new RangeError(`utf8.decode: code point out of range found at: ${N}`):s===jd?new RangeError(`utf8.decode: non-shortest form found at: ${N}`):new RangeError(`utf8.decode: unrecognized error found at: ${N}`)}R.push(s),O+=y}return R}};Or.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&Ue[8]),e.push(t&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n>>8&Ue[8]),e.push(n&Ue[8]),e.push(i>>8&Ue[8]),e.push(i&Ue[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Sr.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,f,u,d,g,y,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(y=(r[i]<<8)+r[d],y<55296||y>57343){f=y,u=2;break}if(g=i+3,g<n&&(E=(r[i+2]<<8)+r[g],y<=56319&&E>=56320&&E<=57343)){f=65536+(y-55296<<10)+(E-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Or.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&Ue[8]),e.push(t>>8&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n&Ue[8]),e.push(n>>8&Ue[8]),e.push(i&Ue[8]),e.push(i>>8&Ue[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Sr.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,f,u,d,g,y,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(y=(r[d]<<8)+r[i],y<55296||y>57343){f=y,u=2;break}if(g=i+3,g<n&&(E=(r[g]<<8)+r[i+2],y<=56319&&E>=56320&&E<=57343)){f=65536+(y-55296<<10)+(E-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Or.utf32be={encode(r){let e=Sr.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&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Or.utf32le={encode(r){let e=Sr.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&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Or.uint7={encode(r){let e=Sr.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}};Or.uint8={encode(r){let e=Sr.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}};Or.uint16be={encode(r){let e=Sr.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&Ue[8],e[t++]=n&Ue[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}};Or.uint16le={encode(r){let e=Sr.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&Ue[8],e[t++]=n>>8&Ue[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}};Or.uint32be={encode(r){let e=Sr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Or.uint32le={encode(r){let e=Sr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Or.string={encode(r){return Or.utf16le.encode(r).toString("utf16le")},decode(r){return Or.utf16le.decode(Sr.from(r,"utf16le"),0)}};Or.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${Ws[n]}`;else if(n>=127&&n<=255)i+=`\`x${Ws[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Ws[n>>8&Ue[8]]}${Ws[n&Ue[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let f=n>>24&Ue[8];f>0&&(i+=Ws[f]),i+=`${Ws[n>>16&Ue[8]]+Ws[n>>8&Ue[8]]+Ws[n&Ue[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Sr.from(i).forEach(f=>{e.push(f)})}}return Sr.from(e)},decode(r){function e(E){return E>=48&&E<=57||E>=65&&E<=70||E>=97&&E<=102}o(e,"isHex");function t(E,O,R){let I={char:null,nexti:E+2,error:!0};if(E+1<O&&e(R[E])&&e(R[E+1])){let N=String.fromCodePoint(R[E],R[E+1]);I.char=parseInt(N,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(t,"getx");function n(E,O,R){let I={char:null,nexti:E+4,error:!0};if(E+3<O&&e(R[E])&&e(R[E+1])&&e(R[E+2])&&e(R[E+3])){let N=String.fromCodePoint(R[E],R[E+1],R[E+2],R[E+3]);I.char=parseInt(N,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(n,"getu");function i(E,O,R){let I={char:null,nexti:E+4,error:!0},N="";for(;E<O&&e(R[E]);)N+=String.fromCodePoint(R[E]),E+=1;return I.char=parseInt(N,16),R[E]===125&&!Number.isNaN(I.char)&&(I.error=!1),I.nexti=E+1,I}o(i,"getU");let s=[],f=r.length,u,d,g,y=0;for(;y<f;){for(;;){if(g=!0,r[y]!==96){s.push(r[y]),y+=1,g=!1;break}if(u=y+1,u>=f)break;if(r[u]===96){s.push(96),y+=2,g=!1;break}if(r[u]===120){if(d=t(u+1,f,r),d.error)break;s.push(d.char),y=d.nexti,g=!1;break}if(r[u]===117){if(r[u+1]===123){if(d=i(u+2,f,r),d.error)break;s.push(d.char),y=d.nexti,g=!1;break}if(d=n(u+1,f,r),d.error)break;s.push(d.char),y=d.nexti,g=!1;break}break}if(g)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${y}]`)}return s}};var Zu=13,Ai=10;Or.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Zu:t+1<r.length&&r[t+1]===Ai?t+=2:t+=1,e.push(Zu),e.push(Ai);break;case Ai:e.push(Zu),e.push(Ai),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ai&&(e.push(Zu),e.push(Ai)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Zu:t+1<r.length&&r[t+1]===Ai?t+=2:t+=1,e.push(Ai);break;case Ai:e.push(Ai),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ai&&e.push(Ai),e}};Or.base64={encode(r){if(r.length===0)return Sr.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,f=Sr.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let u=0;u<s;u+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],f[t++]=jn[n>>18&Ue[6]],f[t++]=jn[n>>12&Ue[6]],f[t++]=jn[n>>6&Ue[6]],f[t++]=jn[n&Ue[6]];if(i===0)return f;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,f[t++]=jn[n>>18&Ue[6]],f[t++]=jn[n>>12&Ue[6]],f[t++]=jn[n>>6&Ue[6]],f[t]=jn[64],f;if(i===2)return n=r[e]<<16,f[t++]=jn[n>>18&Ue[6]],f[t++]=jn[n>>12&Ue[6]],f[t++]=jn[64],f[t]=jn[64],f},decode(r){function e(y){let E=[],O=0;for(let R=0;R<y.length;R+=1){let I=y[R],N=!0;for(;N&&!(I===32||I===9||I===10||I===13);){if(I>=65&&I<=90){E.push(I-65);break}if(I>=97&&I<=122){E.push(I-71);break}if(I>=48&&I<=57){E.push(I+4);break}if(I===43){E.push(62);break}if(I===47){E.push(63);break}if(I===61){E.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${I}`)}}if(E.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${E.length}`);switch(O){case 0:break;case 1:if(E[E.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(E[E.length-1]!==64||E[E.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: ${O}`)}return{tail:O,buf:Sr.from(E)}}if(o(e,"validate"),r.length===0)return Sr.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,f,u,d=i.length/4,g=Sr.alloc(d*3-n);n>0&&(d-=1),f=0,s=0;for(let y=0;y<d;y+=1)u=i[s++]<<18,u+=i[s++]<<12,u+=i[s++]<<6,u+=i[s++],g[f++]=u>>16&Ue[8],g[f++]=u>>8&Ue[8],g[f++]=u&Ue[8];return n===1&&(u=i[s++]<<18,u+=i[s++]<<12,u+=i[s]<<6,g[f++]=u>>16&Ue[8],g[f]=u>>8&Ue[8]),n===2&&(u=i[s++]<<18,u+=i[s++]<<12,g[f]=u>>16&Ue[8]),g},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,f,u,d){switch(t){case 76:e+=`\r
34
+ `});var Vm=Gt(()=>{$i();Uh();Rs();zm();Oa()});var Tu,cj,Wm=Gt(()=>{o3();s3();a3();f3();c3();Lm();Vf();Ph();Lh();l3();Su();Gm();w3();_3();Vm();Tu={...Im,...Dm,...Rm,...Om,...Nm,...Pm,...Bm,...Um,...Fm,...$m},cj={...Km,...jm}});function M3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var S3,Jm,QD,Kh,Ym=Gt(()=>{Wm();Ih();o(M3,"createCodec");S3=M3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),Jm=M3("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=wu(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),QD={utf8:S3,"utf-8":S3,hex:Tu.base16,latin1:Jm,ascii:Jm,binary:Jm,...Tu},Kh=QD});var T3={};Yt(T3,{fromString:()=>Ut});function Ut(r,e="utf8"){let t=Kh[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ia(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var jh=Gt(()=>{Ym();xu();o(Ut,"fromString")});var C3={};Yt(C3,{toString:()=>It});function It(r,e="utf8"){let t=Kh[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var Yf=Gt(()=>{Ym();o(It,"toString")});var k3=Re(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});function eR(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(eR,"imulShim");Fn.mul=Math.imul||eR;function tR(r,e){return r+e|0}o(tR,"add");Fn.add=tR;function rR(r,e){return r-e|0}o(rR,"sub");Fn.sub=rR;function nR(r,e){return r<<e|r>>>32-e}o(nR,"rotl");Fn.rotl=nR;function iR(r,e){return r<<32-e|r>>>e}o(iR,"rotr");Fn.rotr=iR;function oR(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(oR,"isIntegerShim");Fn.isInteger=Number.isInteger||oR;Fn.MAX_SAFE_INTEGER=9007199254740991;Fn.isSafeInteger=function(r){return Fn.isInteger(r)&&r>=-Fn.MAX_SAFE_INTEGER&&r<=Fn.MAX_SAFE_INTEGER}});var Na=Re(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});var I3=k3();function sR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(sR,"readInt16BE");Tt.readInt16BE=sR;function aR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(aR,"readUint16BE");Tt.readUint16BE=aR;function fR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(fR,"readInt16LE");Tt.readInt16LE=fR;function cR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(cR,"readUint16LE");Tt.readUint16LE=cR;function D3(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(D3,"writeUint16BE");Tt.writeUint16BE=D3;Tt.writeInt16BE=D3;function R3(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(R3,"writeUint16LE");Tt.writeUint16LE=R3;Tt.writeInt16LE=R3;function Xm(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Xm,"readInt32BE");Tt.readInt32BE=Xm;function Zm(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Zm,"readUint32BE");Tt.readUint32BE=Zm;function Qm(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Qm,"readInt32LE");Tt.readInt32LE=Qm;function e1(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(e1,"readUint32LE");Tt.readUint32LE=e1;function Gh(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(Gh,"writeUint32BE");Tt.writeUint32BE=Gh;Tt.writeInt32BE=Gh;function Vh(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(Vh,"writeUint32LE");Tt.writeUint32LE=Vh;Tt.writeInt32LE=Vh;function uR(r,e){e===void 0&&(e=0);var t=Xm(r,e),n=Xm(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(uR,"readInt64BE");Tt.readInt64BE=uR;function lR(r,e){e===void 0&&(e=0);var t=Zm(r,e),n=Zm(r,e+4);return t*4294967296+n}o(lR,"readUint64BE");Tt.readUint64BE=lR;function hR(r,e){e===void 0&&(e=0);var t=Qm(r,e),n=Qm(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(hR,"readInt64LE");Tt.readInt64LE=hR;function dR(r,e){e===void 0&&(e=0);var t=e1(r,e),n=e1(r,e+4);return n*4294967296+t}o(dR,"readUint64LE");Tt.readUint64LE=dR;function O3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Gh(r/4294967296>>>0,e,t),Gh(r>>>0,e,t+4),e}o(O3,"writeUint64BE");Tt.writeUint64BE=O3;Tt.writeInt64BE=O3;function N3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Vh(r>>>0,e,t),Vh(r/4294967296>>>0,e,t+4),e}o(N3,"writeUint64LE");Tt.writeUint64LE=N3;Tt.writeInt64LE=N3;function pR(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(pR,"readUintBE");Tt.readUintBE=pR;function mR(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(mR,"readUintLE");Tt.readUintLE=mR;function bR(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(!I3.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(bR,"writeUintBE");Tt.writeUintBE=bR;function gR(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(!I3.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(gR,"writeUintLE");Tt.writeUintLE=gR;function vR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(vR,"readFloat32BE");Tt.readFloat32BE=vR;function yR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(yR,"readFloat32LE");Tt.readFloat32LE=yR;function xR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(xR,"readFloat64BE");Tt.readFloat64BE=xR;function wR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(wR,"readFloat64LE");Tt.readFloat64LE=wR;function _R(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(_R,"writeFloat32BE");Tt.writeFloat32BE=_R;function ER(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(ER,"writeFloat32LE");Tt.writeFloat32LE=ER;function AR(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(AR,"writeFloat64BE");Tt.writeFloat64BE=AR;function SR(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(SR,"writeFloat64LE");Tt.writeFloat64LE=SR});var bi=Re(t1=>{"use strict";Object.defineProperty(t1,"__esModule",{value:!0});function MR(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(MR,"wipe");t1.wipe=MR});var L3=Re(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var Jh=Na(),Wh=bi();Ps.DIGEST_LENGTH=32;Ps.BLOCK_SIZE=64;var P3=function(){function r(){this.digestLength=Ps.DIGEST_LENGTH,this.blockSize=Ps.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(){Wh.wipe(this._buffer),Wh.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&&(r1(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=r1(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,f=t%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;Jh.writeUint32BE(i,this._buffer,f-8),Jh.writeUint32BE(s,this._buffer,f-4),r1(this._temp,this._state,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)Jh.writeUint32BE(this._state[u],e,u*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){Wh.wipe(e.state),e.buffer&&Wh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Ps.SHA256=P3;var TR=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 r1(r,e,t,n,i){for(;i>=64;){for(var s=e[0],f=e[1],u=e[2],d=e[3],g=e[4],y=e[5],E=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;r[R]=Jh.readUint32BE(t,I)}for(var R=16;R<64;R++){var P=r[R-2],X=(P>>>17|P<<32-17)^(P>>>19|P<<32-19)^P>>>10;P=r[R-15];var B=(P>>>7|P<<32-7)^(P>>>18|P<<32-18)^P>>>3;r[R]=(X+r[R-7]|0)+(B+r[R-16]|0)}for(var R=0;R<64;R++){var X=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&E)|0)+(O+(TR[R]+r[R]|0)|0)|0,B=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&f^s&u^f&u)|0;O=E,E=y,y=g,g=d+X|0,d=u,u=f,f=s,s=X+B|0}e[0]+=s,e[1]+=f,e[2]+=u,e[3]+=d,e[4]+=g,e[5]+=y,e[6]+=E,e[7]+=O,n+=64,i-=64}return n}o(r1,"hashBlocks");function CR(r){var e=new P3;e.update(r);var t=e.digest();return e.clean(),t}o(CR,"hash");Ps.hash=CR});var n1=Re((Oj,Yh)=>{(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 f=!n.JS_SHA3_NO_COMMON_JS&&typeof Yh=="object"&&Yh.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],E=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],P=[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],X=[224,256,384,512],B=[128,256],J=["hex","buffer","arrayBuffer","array","digest"],ee={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),d&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var Y=o(function(D,Q,se){return function(H){return new w(D,Q,D).update(H)[se]()}},"createOutputMethod"),ie=o(function(D,Q,se){return function(H,z){return new w(D,Q,z).update(H)[se]()}},"createShakeOutputMethod"),G=o(function(D,Q,se){return function(H,z,V,te){return l["cshake"+D].update(H,z,V,te)[se]()}},"createCshakeOutputMethod"),$=o(function(D,Q,se){return function(H,z,V,te){return l["kmac"+D].update(H,z,V,te)[se]()}},"createKmacOutputMethod"),K=o(function(D,Q,se,H){for(var z=0;z<J.length;++z){var V=J[z];D[V]=Q(se,H,V)}return D},"createOutputMethods"),he=o(function(D,Q){var se=Y(D,Q,"hex");return se.create=function(){return new w(D,Q,D)},se.update=function(H){return se.create().update(H)},K(se,Y,D,Q)},"createMethod"),C=o(function(D,Q){var se=ie(D,Q,"hex");return se.create=function(H){return new w(D,Q,H)},se.update=function(H,z){return se.create(z).update(H)},K(se,ie,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=ee[D],H=G(D,Q,"hex");return H.create=function(z,V,te){return!V&&!te?l["shake"+D].create(z):new w(D,Q,z).bytepad([V,te],se)},H.update=function(z,V,te,ae){return H.create(V,te,ae).update(z)},K(H,G,D,Q)},"createCshakeMethod"),x=o(function(D,Q){var se=ee[D],H=$(D,Q,"hex");return H.create=function(z,V,te){return new k(D,Q,V).bytepad(["KMAC",te],se).bytepad([z],se)},H.update=function(z,V,te,ae){return H.create(z,te,ae).update(V)},K(H,$,D,Q)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:X,createMethod:he},{name:"sha3",padding:R,bits:X,createMethod:he},{name:"shake",padding:y,bits:B,createMethod:C},{name:"cshake",padding:E,bits:B,createMethod:h},{name:"kmac",padding:E,bits:B,createMethod:x}],l={},m=[],_=0;_<b.length;++_)for(var S=b[_],A=S.bits,v=0;v<A.length;++v){var T=S.name+"_"+A[v];if(m.push(T),l[T]=S.createMethod(A[v],S.padding),S.name!=="sha3"){var L=S.name+A[v];m.push(L),l[L]=l[T]}}function w(D,Q,se){this.blocks=[],this.s=[],this.padding=Q,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=se>>5,this.extraBytes=(se&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}o(w,"Keccak"),w.prototype.update=function(D){if(this.finalized)throw new Error(e);var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}for(var H=this.blocks,z=this.byteCount,V=D.length,te=this.blockCount,ae=0,Ae=this.s,ge,ne;ae<V;){if(this.reset)for(this.reset=!1,H[0]=this.block,ge=1;ge<te+1;++ge)H[ge]=0;if(Q)for(ge=this.start;ae<V&&ge<z;++ae)H[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<V&&ge<z;++ae)ne=D.charCodeAt(ae),ne<128?H[ge>>2]|=ne<<I[ge++&3]:ne<2048?(H[ge>>2]|=(192|ne>>6)<<I[ge++&3],H[ge>>2]|=(128|ne&63)<<I[ge++&3]):ne<55296||ne>=57344?(H[ge>>2]|=(224|ne>>12)<<I[ge++&3],H[ge>>2]|=(128|ne>>6&63)<<I[ge++&3],H[ge>>2]|=(128|ne&63)<<I[ge++&3]):(ne=65536+((ne&1023)<<10|D.charCodeAt(++ae)&1023),H[ge>>2]|=(240|ne>>18)<<I[ge++&3],H[ge>>2]|=(128|ne>>12&63)<<I[ge++&3],H[ge>>2]|=(128|ne>>6&63)<<I[ge++&3],H[ge>>2]|=(128|ne&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=z){for(this.start=ge-z,this.block=H[te],ge=0;ge<te;++ge)Ae[ge]^=H[ge];fe(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(D,Q){var se=D&255,H=1,z=[se];for(D=D>>8,se=D&255;se>0;)z.unshift(se),D=D>>8,se=D&255,++H;return Q?z.push(H):z.unshift(H),this.update(z),z.length},w.prototype.encodeString=function(D){var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}var H=0,z=D.length;if(Q)H=z;else for(var V=0;V<D.length;++V){var te=D.charCodeAt(V);te<128?H+=1:te<2048?H+=2:te<55296||te>=57344?H+=3:(te=65536+((te&1023)<<10|D.charCodeAt(++V)&1023),H+=4)}return H+=this.encode(H*8),this.update(D),H},w.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),H=0;H<D.length;++H)se+=this.encodeString(D[H]);var z=Q-se%Q,V=[];return V.length=z,this.update(V),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,H=this.s;if(D[Q>>2]|=this.padding[Q&3],this.lastByteIndex===this.byteCount)for(D[0]=D[se],Q=1;Q<se+1;++Q)D[Q]=0;for(D[se-1]|=2147483648,Q=0;Q<se;++Q)H[Q]^=D[Q];fe(H)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,H=this.extraBytes,z=0,V=0,te="",ae;V<se;){for(z=0;z<D&&V<se;++z,++V)ae=Q[z],te+=g[ae>>4&15]+g[ae&15]+g[ae>>12&15]+g[ae>>8&15]+g[ae>>20&15]+g[ae>>16&15]+g[ae>>28&15]+g[ae>>24&15];V%D===0&&(fe(Q),z=0)}return H&&(ae=Q[z],te+=g[ae>>4&15]+g[ae&15],H>1&&(te+=g[ae>>12&15]+g[ae>>8&15]),H>2&&(te+=g[ae>>20&15]+g[ae>>16&15])),te},w.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,H=this.extraBytes,z=0,V=0,te=this.outputBits>>3,ae;H?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(te);for(var Ae=new Uint32Array(ae);V<se;){for(z=0;z<D&&V<se;++z,++V)Ae[V]=Q[z];V%D===0&&fe(Q)}return H&&(Ae[z]=Q[z],ae=ae.slice(0,te)),ae},w.prototype.buffer=w.prototype.arrayBuffer,w.prototype.digest=w.prototype.array=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,H=this.extraBytes,z=0,V=0,te=[],ae,Ae;V<se;){for(z=0;z<D&&V<se;++z,++V)ae=V<<2,Ae=Q[z],te[ae]=Ae&255,te[ae+1]=Ae>>8&255,te[ae+2]=Ae>>16&255,te[ae+3]=Ae>>24&255;V%D===0&&fe(Q)}return H&&(ae=V<<2,Ae=Q[z],te[ae]=Ae&255,H>1&&(te[ae+1]=Ae>>8&255),H>2&&(te[ae+2]=Ae>>16&255)),te};function k(D,Q,se){w.call(this,D,Q,se)}o(k,"Kmac"),k.prototype=new w,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),w.prototype.finalize.call(this)};var fe=o(function(D){var Q,se,H,z,V,te,ae,Ae,ge,ne,Me,ue,ve,W,pe,ke,ze,Ne,We,br,le,oe,F,Z,me,ye,we,Ie,Dt,Fe,Oe,Lt,Ge,Ye,Dn,it,ot,ei,st,tt,ti,at,ft,hn,ct,Ze,ri,ut,lt,ni,ht,dt,ii,pt,rt,Rn,qt,Ht,dn,pn,mn,Ur,bn;for(H=0;H<48;H+=2)z=D[0]^D[10]^D[20]^D[30]^D[40],V=D[1]^D[11]^D[21]^D[31]^D[41],te=D[2]^D[12]^D[22]^D[32]^D[42],ae=D[3]^D[13]^D[23]^D[33]^D[43],Ae=D[4]^D[14]^D[24]^D[34]^D[44],ge=D[5]^D[15]^D[25]^D[35]^D[45],ne=D[6]^D[16]^D[26]^D[36]^D[46],Me=D[7]^D[17]^D[27]^D[37]^D[47],ue=D[8]^D[18]^D[28]^D[38]^D[48],ve=D[9]^D[19]^D[29]^D[39]^D[49],Q=ue^(te<<1|ae>>>31),se=ve^(ae<<1|te>>>31),D[0]^=Q,D[1]^=se,D[10]^=Q,D[11]^=se,D[20]^=Q,D[21]^=se,D[30]^=Q,D[31]^=se,D[40]^=Q,D[41]^=se,Q=z^(Ae<<1|ge>>>31),se=V^(ge<<1|Ae>>>31),D[2]^=Q,D[3]^=se,D[12]^=Q,D[13]^=se,D[22]^=Q,D[23]^=se,D[32]^=Q,D[33]^=se,D[42]^=Q,D[43]^=se,Q=te^(ne<<1|Me>>>31),se=ae^(Me<<1|ne>>>31),D[4]^=Q,D[5]^=se,D[14]^=Q,D[15]^=se,D[24]^=Q,D[25]^=se,D[34]^=Q,D[35]^=se,D[44]^=Q,D[45]^=se,Q=Ae^(ue<<1|ve>>>31),se=ge^(ve<<1|ue>>>31),D[6]^=Q,D[7]^=se,D[16]^=Q,D[17]^=se,D[26]^=Q,D[27]^=se,D[36]^=Q,D[37]^=se,D[46]^=Q,D[47]^=se,Q=ne^(z<<1|V>>>31),se=Me^(V<<1|z>>>31),D[8]^=Q,D[9]^=se,D[18]^=Q,D[19]^=se,D[28]^=Q,D[29]^=se,D[38]^=Q,D[39]^=se,D[48]^=Q,D[49]^=se,W=D[0],pe=D[1],Ze=D[11]<<4|D[10]>>>28,ri=D[10]<<4|D[11]>>>28,Ie=D[20]<<3|D[21]>>>29,Dt=D[21]<<3|D[20]>>>29,pn=D[31]<<9|D[30]>>>23,mn=D[30]<<9|D[31]>>>23,at=D[40]<<18|D[41]>>>14,ft=D[41]<<18|D[40]>>>14,Ye=D[2]<<1|D[3]>>>31,Dn=D[3]<<1|D[2]>>>31,ke=D[13]<<12|D[12]>>>20,ze=D[12]<<12|D[13]>>>20,ut=D[22]<<10|D[23]>>>22,lt=D[23]<<10|D[22]>>>22,Fe=D[33]<<13|D[32]>>>19,Oe=D[32]<<13|D[33]>>>19,Ur=D[42]<<2|D[43]>>>30,bn=D[43]<<2|D[42]>>>30,pt=D[5]<<30|D[4]>>>2,rt=D[4]<<30|D[5]>>>2,it=D[14]<<6|D[15]>>>26,ot=D[15]<<6|D[14]>>>26,Ne=D[25]<<11|D[24]>>>21,We=D[24]<<11|D[25]>>>21,ni=D[34]<<15|D[35]>>>17,ht=D[35]<<15|D[34]>>>17,Lt=D[45]<<29|D[44]>>>3,Ge=D[44]<<29|D[45]>>>3,Z=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Rn=D[17]<<23|D[16]>>>9,qt=D[16]<<23|D[17]>>>9,ei=D[26]<<25|D[27]>>>7,st=D[27]<<25|D[26]>>>7,br=D[36]<<21|D[37]>>>11,le=D[37]<<21|D[36]>>>11,dt=D[47]<<24|D[46]>>>8,ii=D[46]<<24|D[47]>>>8,hn=D[8]<<27|D[9]>>>5,ct=D[9]<<27|D[8]>>>5,ye=D[18]<<20|D[19]>>>12,we=D[19]<<20|D[18]>>>12,Ht=D[29]<<7|D[28]>>>25,dn=D[28]<<7|D[29]>>>25,tt=D[38]<<8|D[39]>>>24,ti=D[39]<<8|D[38]>>>24,oe=D[48]<<14|D[49]>>>18,F=D[49]<<14|D[48]>>>18,D[0]=W^~ke&Ne,D[1]=pe^~ze&We,D[10]=Z^~ye&Ie,D[11]=me^~we&Dt,D[20]=Ye^~it&ei,D[21]=Dn^~ot&st,D[30]=hn^~Ze&ut,D[31]=ct^~ri&lt,D[40]=pt^~Rn&Ht,D[41]=rt^~qt&dn,D[2]=ke^~Ne&br,D[3]=ze^~We&le,D[12]=ye^~Ie&Fe,D[13]=we^~Dt&Oe,D[22]=it^~ei&tt,D[23]=ot^~st&ti,D[32]=Ze^~ut&ni,D[33]=ri^~lt&ht,D[42]=Rn^~Ht&pn,D[43]=qt^~dn&mn,D[4]=Ne^~br&oe,D[5]=We^~le&F,D[14]=Ie^~Fe&Lt,D[15]=Dt^~Oe&Ge,D[24]=ei^~tt&at,D[25]=st^~ti&ft,D[34]=ut^~ni&dt,D[35]=lt^~ht&ii,D[44]=Ht^~pn&Ur,D[45]=dn^~mn&bn,D[6]=br^~oe&W,D[7]=le^~F&pe,D[16]=Fe^~Lt&Z,D[17]=Oe^~Ge&me,D[26]=tt^~at&Ye,D[27]=ti^~ft&Dn,D[36]=ni^~dt&hn,D[37]=ht^~ii&ct,D[46]=pn^~Ur&pt,D[47]=mn^~bn&rt,D[8]=oe^~W&ke,D[9]=F^~pe&ze,D[18]=Lt^~Z&ye,D[19]=Ge^~me&we,D[28]=at^~Ye&it,D[29]=ft^~Dn&ot,D[38]=dt^~hn&Ze,D[39]=ii^~ct&ri,D[48]=Ur^~pt&Rn,D[49]=bn^~rt&qt,D[0]^=P[H],D[1]^=P[H+1]},"f");if(f)Yh.exports=l;else{for(_=0;_<m.length;++_)n[m[_]]=l[m[_]];u&&define(function(){return l})}})()});var B3=Re((Nj,kR)=>{kR.exports={name:"elliptic",version:"6.5.7",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 i1=Re(()=>{});var fo=Re((U3,o1)=>{(function(r,e){"use strict";function t(C,h){if(!C)throw new Error(h||"Assertion failed")}o(t,"assert");function n(C,h){C.super_=h;var x=o(function(){},"TempCtor");x.prototype=h.prototype,C.prototype=new x,C.prototype.constructor=C}o(n,"inherits");function i(C,h,x){if(i.isBN(C))return C;this.negative=0,this.words=null,this.length=0,this.red=null,C!==null&&((h==="le"||h==="be")&&(x=h,h=10),this._init(C||0,h||10,x||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=i1().Buffer}catch{}i.isBN=o(function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},"isBN"),i.max=o(function(h,x){return h.cmp(x)>0?h:x},"max"),i.min=o(function(h,x){return h.cmp(x)<0?h:x},"min"),i.prototype._init=o(function(h,x,b){if(typeof h=="number")return this._initNumber(h,x,b);if(typeof h=="object")return this._initArray(h,x,b);x==="hex"&&(x=16),t(x===(x|0)&&x>=2&&x<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(x===16?this._parseHex(h,l,b):(this._parseBase(h,x,l),b==="le"&&this._initArray(this.toArray(),x,b)))},"init"),i.prototype._initNumber=o(function(h,x,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(t(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),x,b)},"_initNumber"),i.prototype._initArray=o(function(h,x,b){if(t(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m,_,S=0;if(b==="be")for(l=h.length-1,m=0;l>=0;l-=3)_=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[m]|=_<<S&67108863,this.words[m+1]=_>>>26-S&67108863,S+=24,S>=26&&(S-=26,m++);else if(b==="le")for(l=0,m=0;l<h.length;l+=3)_=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[m]|=_<<S&67108863,this.words[m+1]=_>>>26-S&67108863,S+=24,S>=26&&(S-=26,m++);return this.strip()},"_initArray");function f(C,h){var x=C.charCodeAt(h);return x>=65&&x<=70?x-55:x>=97&&x<=102?x-87:x-48&15}o(f,"parseHex4Bits");function u(C,h,x){var b=f(C,x);return x-1>=h&&(b|=f(C,x-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,x,b){this.length=Math.ceil((h.length-x)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m=0,_=0,S;if(b==="be")for(l=h.length-1;l>=x;l-=2)S=u(h,x,l)<<m,this.words[_]|=S&67108863,m>=18?(m-=18,_+=1,this.words[_]|=S>>>26):m+=8;else{var A=h.length-x;for(l=A%2===0?x+1:x;l<h.length;l+=2)S=u(h,x,l)<<m,this.words[_]|=S&67108863,m>=18?(m-=18,_+=1,this.words[_]|=S>>>26):m+=8}this.strip()},"_parseHex");function d(C,h,x,b){for(var l=0,m=Math.min(C.length,x),_=h;_<m;_++){var S=C.charCodeAt(_)-48;l*=b,S>=49?l+=S-49+10:S>=17?l+=S-17+10:l+=S}return l}o(d,"parseBase"),i.prototype._parseBase=o(function(h,x,b){this.words=[0],this.length=1;for(var l=0,m=1;m<=67108863;m*=x)l++;l--,m=m/x|0;for(var _=h.length-b,S=_%l,A=Math.min(_,_-S)+b,v=0,T=b;T<A;T+=l)v=d(h,T,T+l,x),this.imuln(m),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(S!==0){var L=1;for(v=d(h,T,h.length,x),T=0;T<S;T++)L*=x;this.imuln(L),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var x=0;x<this.length;x++)h.words[x]=this.words[x];h.length=this.length,h.negative=this.negative,h.red=this.red},"copy"),i.prototype.clone=o(function(){var h=new i(null);return this.copy(h),h},"clone"),i.prototype._expand=o(function(h){for(;this.length<h;)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 g=["","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"],y=[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],E=[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(h,x){h=h||10,x=x|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,m=0,_=0;_<this.length;_++){var S=this.words[_],A=((S<<l|m)&16777215).toString(16);m=S>>>24-l&16777215,m!==0||_!==this.length-1?b=g[6-A.length]+A+b:b=A+b,l+=2,l>=26&&(l-=26,_--)}for(m!==0&&(b=m.toString(16)+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var v=y[h],T=E[h];b="";var L=this.clone();for(L.negative=0;!L.isZero();){var w=L.modn(T).toString(h);L=L.idivn(T),L.isZero()?b=w+b:b=g[v-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(h,x){return t(typeof s<"u"),this.toArrayLike(s,h,x)},"toBuffer"),i.prototype.toArray=o(function(h,x){return this.toArrayLike(Array,h,x)},"toArray"),i.prototype.toArrayLike=o(function(h,x,b){var l=this.byteLength(),m=b||Math.max(1,l);t(l<=m,"byte array longer than desired length"),t(m>0,"Requested array length <= 0"),this.strip();var _=x==="le",S=new h(m),A,v,T=this.clone();if(_){for(v=0;!T.isZero();v++)A=T.andln(255),T.iushrn(8),S[v]=A;for(;v<m;v++)S[v]=0}else{for(v=0;v<m-l;v++)S[v]=0;for(v=0;!T.isZero();v++)A=T.andln(255),T.iushrn(8),S[m-v-1]=A}return S},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var x=h,b=0;return x>=4096&&(b+=13,x>>>=13),x>=64&&(b+=7,x>>>=7),x>=8&&(b+=4,x>>>=4),x>=2&&(b+=2,x>>>=2),b+x},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var x=h,b=0;return(x&8191)===0&&(b+=13,x>>>=13),(x&127)===0&&(b+=7,x>>>=7),(x&15)===0&&(b+=4,x>>>=4),(x&3)===0&&(b+=2,x>>>=2),(x&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],x=this._countBits(h);return(this.length-1)*26+x},"bitLength");function O(C){for(var h=new Array(C.bitLength()),x=0;x<h.length;x++){var b=x/26|0,l=x%26;h[x]=(C.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,x=0;x<this.length;x++){var b=this._zeroBits(this.words[x]);if(h+=b,b!==26)break}return h},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]|h.words[x];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return t((this.negative|h.negative)===0),this.iuor(h)},"ior"),i.prototype.or=o(function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},"or"),i.prototype.uor=o(function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(h){var x;this.length>h.length?x=h:x=this;for(var b=0;b<x.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=x.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return t((this.negative|h.negative)===0),this.iuand(h)},"iand"),i.prototype.and=o(function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},"and"),i.prototype.uand=o(function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(h){var x,b;this.length>h.length?(x=this,b=h):(x=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=x.words[l]^b.words[l];if(this!==x)for(;l<x.length;l++)this.words[l]=x.words[l];return this.length=x.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return t((this.negative|h.negative)===0),this.iuxor(h)},"ixor"),i.prototype.xor=o(function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(h){t(typeof h=="number"&&h>=0);var x=Math.ceil(h/26)|0,b=h%26;this._expand(x),b>0&&x--;for(var l=0;l<x;l++)this.words[l]=~this.words[l]&67108863;return b>0&&(this.words[l]=~this.words[l]&67108863>>26-b),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,x){t(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),x?this.words[b]=this.words[b]|1<<l:this.words[b]=this.words[b]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var x;if(this.negative!==0&&h.negative===0)return this.negative=0,x=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,x=this.isub(h),h.negative=1,x._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var m=0,_=0;_<l.length;_++)x=(b.words[_]|0)+(l.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;for(;m!==0&&_<b.length;_++)x=(b.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;if(this.length=b.length,m!==0)this.words[this.length]=m,this.length++;else if(b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this},"iadd"),i.prototype.add=o(function(h){var x;return h.negative!==0&&this.negative===0?(h.negative=0,x=this.sub(h),h.negative^=1,x):h.negative===0&&this.negative!==0?(this.negative=0,x=h.sub(this),this.negative=1,x):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},"add"),i.prototype.isub=o(function(h){if(h.negative!==0){h.negative=0;var x=this.iadd(h);return h.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,m;b>0?(l=this,m=h):(l=h,m=this);for(var _=0,S=0;S<m.length;S++)x=(l.words[S]|0)-(m.words[S]|0)+_,_=x>>26,this.words[S]=x&67108863;for(;_!==0&&S<l.length;S++)x=(l.words[S]|0)+_,_=x>>26,this.words[S]=x&67108863;if(_===0&&S<l.length&&l!==this)for(;S<l.length;S++)this.words[S]=l.words[S];return this.length=Math.max(this.length,S),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(C,h,x){x.negative=h.negative^C.negative;var b=C.length+h.length|0;x.length=b,b=b-1|0;var l=C.words[0]|0,m=h.words[0]|0,_=l*m,S=_&67108863,A=_/67108864|0;x.words[0]=S;for(var v=1;v<b;v++){for(var T=A>>>26,L=A&67108863,w=Math.min(v,h.length-1),k=Math.max(0,v-C.length+1);k<=w;k++){var fe=v-k|0;l=C.words[fe]|0,m=h.words[k]|0,_=l*m+L,T+=_/67108864|0,L=_&67108863}x.words[v]=L|0,A=T|0}return A!==0?x.words[v]=A|0:x.length--,x.strip()}o(R,"smallMulTo");var I=o(function(h,x,b){var l=h.words,m=x.words,_=b.words,S=0,A,v,T,L=l[0]|0,w=L&8191,k=L>>>13,fe=l[1]|0,D=fe&8191,Q=fe>>>13,se=l[2]|0,H=se&8191,z=se>>>13,V=l[3]|0,te=V&8191,ae=V>>>13,Ae=l[4]|0,ge=Ae&8191,ne=Ae>>>13,Me=l[5]|0,ue=Me&8191,ve=Me>>>13,W=l[6]|0,pe=W&8191,ke=W>>>13,ze=l[7]|0,Ne=ze&8191,We=ze>>>13,br=l[8]|0,le=br&8191,oe=br>>>13,F=l[9]|0,Z=F&8191,me=F>>>13,ye=m[0]|0,we=ye&8191,Ie=ye>>>13,Dt=m[1]|0,Fe=Dt&8191,Oe=Dt>>>13,Lt=m[2]|0,Ge=Lt&8191,Ye=Lt>>>13,Dn=m[3]|0,it=Dn&8191,ot=Dn>>>13,ei=m[4]|0,st=ei&8191,tt=ei>>>13,ti=m[5]|0,at=ti&8191,ft=ti>>>13,hn=m[6]|0,ct=hn&8191,Ze=hn>>>13,ri=m[7]|0,ut=ri&8191,lt=ri>>>13,ni=m[8]|0,ht=ni&8191,dt=ni>>>13,ii=m[9]|0,pt=ii&8191,rt=ii>>>13;b.negative=h.negative^x.negative,b.length=19,A=Math.imul(w,we),v=Math.imul(w,Ie),v=v+Math.imul(k,we)|0,T=Math.imul(k,Ie);var Rn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,A=Math.imul(D,we),v=Math.imul(D,Ie),v=v+Math.imul(Q,we)|0,T=Math.imul(Q,Ie),A=A+Math.imul(w,Fe)|0,v=v+Math.imul(w,Oe)|0,v=v+Math.imul(k,Fe)|0,T=T+Math.imul(k,Oe)|0;var qt=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(qt>>>26)|0,qt&=67108863,A=Math.imul(H,we),v=Math.imul(H,Ie),v=v+Math.imul(z,we)|0,T=Math.imul(z,Ie),A=A+Math.imul(D,Fe)|0,v=v+Math.imul(D,Oe)|0,v=v+Math.imul(Q,Fe)|0,T=T+Math.imul(Q,Oe)|0,A=A+Math.imul(w,Ge)|0,v=v+Math.imul(w,Ye)|0,v=v+Math.imul(k,Ge)|0,T=T+Math.imul(k,Ye)|0;var Ht=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,A=Math.imul(te,we),v=Math.imul(te,Ie),v=v+Math.imul(ae,we)|0,T=Math.imul(ae,Ie),A=A+Math.imul(H,Fe)|0,v=v+Math.imul(H,Oe)|0,v=v+Math.imul(z,Fe)|0,T=T+Math.imul(z,Oe)|0,A=A+Math.imul(D,Ge)|0,v=v+Math.imul(D,Ye)|0,v=v+Math.imul(Q,Ge)|0,T=T+Math.imul(Q,Ye)|0,A=A+Math.imul(w,it)|0,v=v+Math.imul(w,ot)|0,v=v+Math.imul(k,it)|0,T=T+Math.imul(k,ot)|0;var dn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(dn>>>26)|0,dn&=67108863,A=Math.imul(ge,we),v=Math.imul(ge,Ie),v=v+Math.imul(ne,we)|0,T=Math.imul(ne,Ie),A=A+Math.imul(te,Fe)|0,v=v+Math.imul(te,Oe)|0,v=v+Math.imul(ae,Fe)|0,T=T+Math.imul(ae,Oe)|0,A=A+Math.imul(H,Ge)|0,v=v+Math.imul(H,Ye)|0,v=v+Math.imul(z,Ge)|0,T=T+Math.imul(z,Ye)|0,A=A+Math.imul(D,it)|0,v=v+Math.imul(D,ot)|0,v=v+Math.imul(Q,it)|0,T=T+Math.imul(Q,ot)|0,A=A+Math.imul(w,st)|0,v=v+Math.imul(w,tt)|0,v=v+Math.imul(k,st)|0,T=T+Math.imul(k,tt)|0;var pn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(pn>>>26)|0,pn&=67108863,A=Math.imul(ue,we),v=Math.imul(ue,Ie),v=v+Math.imul(ve,we)|0,T=Math.imul(ve,Ie),A=A+Math.imul(ge,Fe)|0,v=v+Math.imul(ge,Oe)|0,v=v+Math.imul(ne,Fe)|0,T=T+Math.imul(ne,Oe)|0,A=A+Math.imul(te,Ge)|0,v=v+Math.imul(te,Ye)|0,v=v+Math.imul(ae,Ge)|0,T=T+Math.imul(ae,Ye)|0,A=A+Math.imul(H,it)|0,v=v+Math.imul(H,ot)|0,v=v+Math.imul(z,it)|0,T=T+Math.imul(z,ot)|0,A=A+Math.imul(D,st)|0,v=v+Math.imul(D,tt)|0,v=v+Math.imul(Q,st)|0,T=T+Math.imul(Q,tt)|0,A=A+Math.imul(w,at)|0,v=v+Math.imul(w,ft)|0,v=v+Math.imul(k,at)|0,T=T+Math.imul(k,ft)|0;var mn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(mn>>>26)|0,mn&=67108863,A=Math.imul(pe,we),v=Math.imul(pe,Ie),v=v+Math.imul(ke,we)|0,T=Math.imul(ke,Ie),A=A+Math.imul(ue,Fe)|0,v=v+Math.imul(ue,Oe)|0,v=v+Math.imul(ve,Fe)|0,T=T+Math.imul(ve,Oe)|0,A=A+Math.imul(ge,Ge)|0,v=v+Math.imul(ge,Ye)|0,v=v+Math.imul(ne,Ge)|0,T=T+Math.imul(ne,Ye)|0,A=A+Math.imul(te,it)|0,v=v+Math.imul(te,ot)|0,v=v+Math.imul(ae,it)|0,T=T+Math.imul(ae,ot)|0,A=A+Math.imul(H,st)|0,v=v+Math.imul(H,tt)|0,v=v+Math.imul(z,st)|0,T=T+Math.imul(z,tt)|0,A=A+Math.imul(D,at)|0,v=v+Math.imul(D,ft)|0,v=v+Math.imul(Q,at)|0,T=T+Math.imul(Q,ft)|0,A=A+Math.imul(w,ct)|0,v=v+Math.imul(w,Ze)|0,v=v+Math.imul(k,ct)|0,T=T+Math.imul(k,Ze)|0;var Ur=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,A=Math.imul(Ne,we),v=Math.imul(Ne,Ie),v=v+Math.imul(We,we)|0,T=Math.imul(We,Ie),A=A+Math.imul(pe,Fe)|0,v=v+Math.imul(pe,Oe)|0,v=v+Math.imul(ke,Fe)|0,T=T+Math.imul(ke,Oe)|0,A=A+Math.imul(ue,Ge)|0,v=v+Math.imul(ue,Ye)|0,v=v+Math.imul(ve,Ge)|0,T=T+Math.imul(ve,Ye)|0,A=A+Math.imul(ge,it)|0,v=v+Math.imul(ge,ot)|0,v=v+Math.imul(ne,it)|0,T=T+Math.imul(ne,ot)|0,A=A+Math.imul(te,st)|0,v=v+Math.imul(te,tt)|0,v=v+Math.imul(ae,st)|0,T=T+Math.imul(ae,tt)|0,A=A+Math.imul(H,at)|0,v=v+Math.imul(H,ft)|0,v=v+Math.imul(z,at)|0,T=T+Math.imul(z,ft)|0,A=A+Math.imul(D,ct)|0,v=v+Math.imul(D,Ze)|0,v=v+Math.imul(Q,ct)|0,T=T+Math.imul(Q,Ze)|0,A=A+Math.imul(w,ut)|0,v=v+Math.imul(w,lt)|0,v=v+Math.imul(k,ut)|0,T=T+Math.imul(k,lt)|0;var bn=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(bn>>>26)|0,bn&=67108863,A=Math.imul(le,we),v=Math.imul(le,Ie),v=v+Math.imul(oe,we)|0,T=Math.imul(oe,Ie),A=A+Math.imul(Ne,Fe)|0,v=v+Math.imul(Ne,Oe)|0,v=v+Math.imul(We,Fe)|0,T=T+Math.imul(We,Oe)|0,A=A+Math.imul(pe,Ge)|0,v=v+Math.imul(pe,Ye)|0,v=v+Math.imul(ke,Ge)|0,T=T+Math.imul(ke,Ye)|0,A=A+Math.imul(ue,it)|0,v=v+Math.imul(ue,ot)|0,v=v+Math.imul(ve,it)|0,T=T+Math.imul(ve,ot)|0,A=A+Math.imul(ge,st)|0,v=v+Math.imul(ge,tt)|0,v=v+Math.imul(ne,st)|0,T=T+Math.imul(ne,tt)|0,A=A+Math.imul(te,at)|0,v=v+Math.imul(te,ft)|0,v=v+Math.imul(ae,at)|0,T=T+Math.imul(ae,ft)|0,A=A+Math.imul(H,ct)|0,v=v+Math.imul(H,Ze)|0,v=v+Math.imul(z,ct)|0,T=T+Math.imul(z,Ze)|0,A=A+Math.imul(D,ut)|0,v=v+Math.imul(D,lt)|0,v=v+Math.imul(Q,ut)|0,T=T+Math.imul(Q,lt)|0,A=A+Math.imul(w,ht)|0,v=v+Math.imul(w,dt)|0,v=v+Math.imul(k,ht)|0,T=T+Math.imul(k,dt)|0;var oi=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(oi>>>26)|0,oi&=67108863,A=Math.imul(Z,we),v=Math.imul(Z,Ie),v=v+Math.imul(me,we)|0,T=Math.imul(me,Ie),A=A+Math.imul(le,Fe)|0,v=v+Math.imul(le,Oe)|0,v=v+Math.imul(oe,Fe)|0,T=T+Math.imul(oe,Oe)|0,A=A+Math.imul(Ne,Ge)|0,v=v+Math.imul(Ne,Ye)|0,v=v+Math.imul(We,Ge)|0,T=T+Math.imul(We,Ye)|0,A=A+Math.imul(pe,it)|0,v=v+Math.imul(pe,ot)|0,v=v+Math.imul(ke,it)|0,T=T+Math.imul(ke,ot)|0,A=A+Math.imul(ue,st)|0,v=v+Math.imul(ue,tt)|0,v=v+Math.imul(ve,st)|0,T=T+Math.imul(ve,tt)|0,A=A+Math.imul(ge,at)|0,v=v+Math.imul(ge,ft)|0,v=v+Math.imul(ne,at)|0,T=T+Math.imul(ne,ft)|0,A=A+Math.imul(te,ct)|0,v=v+Math.imul(te,Ze)|0,v=v+Math.imul(ae,ct)|0,T=T+Math.imul(ae,Ze)|0,A=A+Math.imul(H,ut)|0,v=v+Math.imul(H,lt)|0,v=v+Math.imul(z,ut)|0,T=T+Math.imul(z,lt)|0,A=A+Math.imul(D,ht)|0,v=v+Math.imul(D,dt)|0,v=v+Math.imul(Q,ht)|0,T=T+Math.imul(Q,dt)|0,A=A+Math.imul(w,pt)|0,v=v+Math.imul(w,rt)|0,v=v+Math.imul(k,pt)|0,T=T+Math.imul(k,rt)|0;var Ro=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,A=Math.imul(Z,Fe),v=Math.imul(Z,Oe),v=v+Math.imul(me,Fe)|0,T=Math.imul(me,Oe),A=A+Math.imul(le,Ge)|0,v=v+Math.imul(le,Ye)|0,v=v+Math.imul(oe,Ge)|0,T=T+Math.imul(oe,Ye)|0,A=A+Math.imul(Ne,it)|0,v=v+Math.imul(Ne,ot)|0,v=v+Math.imul(We,it)|0,T=T+Math.imul(We,ot)|0,A=A+Math.imul(pe,st)|0,v=v+Math.imul(pe,tt)|0,v=v+Math.imul(ke,st)|0,T=T+Math.imul(ke,tt)|0,A=A+Math.imul(ue,at)|0,v=v+Math.imul(ue,ft)|0,v=v+Math.imul(ve,at)|0,T=T+Math.imul(ve,ft)|0,A=A+Math.imul(ge,ct)|0,v=v+Math.imul(ge,Ze)|0,v=v+Math.imul(ne,ct)|0,T=T+Math.imul(ne,Ze)|0,A=A+Math.imul(te,ut)|0,v=v+Math.imul(te,lt)|0,v=v+Math.imul(ae,ut)|0,T=T+Math.imul(ae,lt)|0,A=A+Math.imul(H,ht)|0,v=v+Math.imul(H,dt)|0,v=v+Math.imul(z,ht)|0,T=T+Math.imul(z,dt)|0,A=A+Math.imul(D,pt)|0,v=v+Math.imul(D,rt)|0,v=v+Math.imul(Q,pt)|0,T=T+Math.imul(Q,rt)|0;var Oo=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,A=Math.imul(Z,Ge),v=Math.imul(Z,Ye),v=v+Math.imul(me,Ge)|0,T=Math.imul(me,Ye),A=A+Math.imul(le,it)|0,v=v+Math.imul(le,ot)|0,v=v+Math.imul(oe,it)|0,T=T+Math.imul(oe,ot)|0,A=A+Math.imul(Ne,st)|0,v=v+Math.imul(Ne,tt)|0,v=v+Math.imul(We,st)|0,T=T+Math.imul(We,tt)|0,A=A+Math.imul(pe,at)|0,v=v+Math.imul(pe,ft)|0,v=v+Math.imul(ke,at)|0,T=T+Math.imul(ke,ft)|0,A=A+Math.imul(ue,ct)|0,v=v+Math.imul(ue,Ze)|0,v=v+Math.imul(ve,ct)|0,T=T+Math.imul(ve,Ze)|0,A=A+Math.imul(ge,ut)|0,v=v+Math.imul(ge,lt)|0,v=v+Math.imul(ne,ut)|0,T=T+Math.imul(ne,lt)|0,A=A+Math.imul(te,ht)|0,v=v+Math.imul(te,dt)|0,v=v+Math.imul(ae,ht)|0,T=T+Math.imul(ae,dt)|0,A=A+Math.imul(H,pt)|0,v=v+Math.imul(H,rt)|0,v=v+Math.imul(z,pt)|0,T=T+Math.imul(z,rt)|0;var No=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(No>>>26)|0,No&=67108863,A=Math.imul(Z,it),v=Math.imul(Z,ot),v=v+Math.imul(me,it)|0,T=Math.imul(me,ot),A=A+Math.imul(le,st)|0,v=v+Math.imul(le,tt)|0,v=v+Math.imul(oe,st)|0,T=T+Math.imul(oe,tt)|0,A=A+Math.imul(Ne,at)|0,v=v+Math.imul(Ne,ft)|0,v=v+Math.imul(We,at)|0,T=T+Math.imul(We,ft)|0,A=A+Math.imul(pe,ct)|0,v=v+Math.imul(pe,Ze)|0,v=v+Math.imul(ke,ct)|0,T=T+Math.imul(ke,Ze)|0,A=A+Math.imul(ue,ut)|0,v=v+Math.imul(ue,lt)|0,v=v+Math.imul(ve,ut)|0,T=T+Math.imul(ve,lt)|0,A=A+Math.imul(ge,ht)|0,v=v+Math.imul(ge,dt)|0,v=v+Math.imul(ne,ht)|0,T=T+Math.imul(ne,dt)|0,A=A+Math.imul(te,pt)|0,v=v+Math.imul(te,rt)|0,v=v+Math.imul(ae,pt)|0,T=T+Math.imul(ae,rt)|0;var ro=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(ro>>>26)|0,ro&=67108863,A=Math.imul(Z,st),v=Math.imul(Z,tt),v=v+Math.imul(me,st)|0,T=Math.imul(me,tt),A=A+Math.imul(le,at)|0,v=v+Math.imul(le,ft)|0,v=v+Math.imul(oe,at)|0,T=T+Math.imul(oe,ft)|0,A=A+Math.imul(Ne,ct)|0,v=v+Math.imul(Ne,Ze)|0,v=v+Math.imul(We,ct)|0,T=T+Math.imul(We,Ze)|0,A=A+Math.imul(pe,ut)|0,v=v+Math.imul(pe,lt)|0,v=v+Math.imul(ke,ut)|0,T=T+Math.imul(ke,lt)|0,A=A+Math.imul(ue,ht)|0,v=v+Math.imul(ue,dt)|0,v=v+Math.imul(ve,ht)|0,T=T+Math.imul(ve,dt)|0,A=A+Math.imul(ge,pt)|0,v=v+Math.imul(ge,rt)|0,v=v+Math.imul(ne,pt)|0,T=T+Math.imul(ne,rt)|0;var no=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(no>>>26)|0,no&=67108863,A=Math.imul(Z,at),v=Math.imul(Z,ft),v=v+Math.imul(me,at)|0,T=Math.imul(me,ft),A=A+Math.imul(le,ct)|0,v=v+Math.imul(le,Ze)|0,v=v+Math.imul(oe,ct)|0,T=T+Math.imul(oe,Ze)|0,A=A+Math.imul(Ne,ut)|0,v=v+Math.imul(Ne,lt)|0,v=v+Math.imul(We,ut)|0,T=T+Math.imul(We,lt)|0,A=A+Math.imul(pe,ht)|0,v=v+Math.imul(pe,dt)|0,v=v+Math.imul(ke,ht)|0,T=T+Math.imul(ke,dt)|0,A=A+Math.imul(ue,pt)|0,v=v+Math.imul(ue,rt)|0,v=v+Math.imul(ve,pt)|0,T=T+Math.imul(ve,rt)|0;var io=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(io>>>26)|0,io&=67108863,A=Math.imul(Z,ct),v=Math.imul(Z,Ze),v=v+Math.imul(me,ct)|0,T=Math.imul(me,Ze),A=A+Math.imul(le,ut)|0,v=v+Math.imul(le,lt)|0,v=v+Math.imul(oe,ut)|0,T=T+Math.imul(oe,lt)|0,A=A+Math.imul(Ne,ht)|0,v=v+Math.imul(Ne,dt)|0,v=v+Math.imul(We,ht)|0,T=T+Math.imul(We,dt)|0,A=A+Math.imul(pe,pt)|0,v=v+Math.imul(pe,rt)|0,v=v+Math.imul(ke,pt)|0,T=T+Math.imul(ke,rt)|0;var Po=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Po>>>26)|0,Po&=67108863,A=Math.imul(Z,ut),v=Math.imul(Z,lt),v=v+Math.imul(me,ut)|0,T=Math.imul(me,lt),A=A+Math.imul(le,ht)|0,v=v+Math.imul(le,dt)|0,v=v+Math.imul(oe,ht)|0,T=T+Math.imul(oe,dt)|0,A=A+Math.imul(Ne,pt)|0,v=v+Math.imul(Ne,rt)|0,v=v+Math.imul(We,pt)|0,T=T+Math.imul(We,rt)|0;var Lo=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,A=Math.imul(Z,ht),v=Math.imul(Z,dt),v=v+Math.imul(me,ht)|0,T=Math.imul(me,dt),A=A+Math.imul(le,pt)|0,v=v+Math.imul(le,rt)|0,v=v+Math.imul(oe,pt)|0,T=T+Math.imul(oe,rt)|0;var Bo=(S+A|0)+((v&8191)<<13)|0;S=(T+(v>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,A=Math.imul(Z,pt),v=Math.imul(Z,rt),v=v+Math.imul(me,pt)|0,T=Math.imul(me,rt);var Uo=(S+A|0)+((v&8191)<<13)|0;return S=(T+(v>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,_[0]=Rn,_[1]=qt,_[2]=Ht,_[3]=dn,_[4]=pn,_[5]=mn,_[6]=Ur,_[7]=bn,_[8]=oi,_[9]=Ro,_[10]=Oo,_[11]=No,_[12]=ro,_[13]=no,_[14]=io,_[15]=Po,_[16]=Lo,_[17]=Bo,_[18]=Uo,S!==0&&(_[19]=S,b.length++),b},"comb10MulTo");Math.imul||(I=R);function P(C,h,x){x.negative=h.negative^C.negative,x.length=C.length+h.length;for(var b=0,l=0,m=0;m<x.length-1;m++){var _=l;l=0;for(var S=b&67108863,A=Math.min(m,h.length-1),v=Math.max(0,m-C.length+1);v<=A;v++){var T=m-v,L=C.words[T]|0,w=h.words[v]|0,k=L*w,fe=k&67108863;_=_+(k/67108864|0)|0,fe=fe+S|0,S=fe&67108863,_=_+(fe>>>26)|0,l+=_>>>26,_&=67108863}x.words[m]=S,b=_,_=l}return b!==0?x.words[m]=b:x.length--,x.strip()}o(P,"bigMulTo");function X(C,h,x){var b=new B;return b.mulp(C,h,x)}o(X,"jumboMulTo"),i.prototype.mulTo=o(function(h,x){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=I(this,h,x):l<63?b=R(this,h,x):l<1024?b=P(this,h,x):b=X(this,h,x),b},"mulTo");function B(C,h){this.x=C,this.y=h}o(B,"FFTM"),B.prototype.makeRBT=o(function(h){for(var x=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)x[l]=this.revBin(l,b,h);return x},"makeRBT"),B.prototype.revBin=o(function(h,x,b){if(h===0||h===b-1)return h;for(var l=0,m=0;m<x;m++)l|=(h&1)<<x-m-1,h>>=1;return l},"revBin"),B.prototype.permute=o(function(h,x,b,l,m,_){for(var S=0;S<_;S++)l[S]=x[h[S]],m[S]=b[h[S]]},"permute"),B.prototype.transform=o(function(h,x,b,l,m,_){this.permute(_,h,x,b,l,m);for(var S=1;S<m;S<<=1)for(var A=S<<1,v=Math.cos(2*Math.PI/A),T=Math.sin(2*Math.PI/A),L=0;L<m;L+=A)for(var w=v,k=T,fe=0;fe<S;fe++){var D=b[L+fe],Q=l[L+fe],se=b[L+fe+S],H=l[L+fe+S],z=w*se-k*H;H=w*H+k*se,se=z,b[L+fe]=D+se,l[L+fe]=Q+H,b[L+fe+S]=D-se,l[L+fe+S]=Q-H,fe!==A&&(z=v*w-T*k,k=v*k+T*w,w=z)}},"transform"),B.prototype.guessLen13b=o(function(h,x){var b=Math.max(x,h)|1,l=b&1,m=0;for(b=b/2|0;b;b=b>>>1)m++;return 1<<m+1+l},"guessLen13b"),B.prototype.conjugate=o(function(h,x,b){if(!(b<=1))for(var l=0;l<b/2;l++){var m=h[l];h[l]=h[b-l-1],h[b-l-1]=m,m=x[l],x[l]=-x[b-l-1],x[b-l-1]=-m}},"conjugate"),B.prototype.normalize13b=o(function(h,x){for(var b=0,l=0;l<x/2;l++){var m=Math.round(h[2*l+1]/x)*8192+Math.round(h[2*l]/x)+b;h[l]=m&67108863,m<67108864?b=0:b=m/67108864|0}return h},"normalize13b"),B.prototype.convert13b=o(function(h,x,b,l){for(var m=0,_=0;_<x;_++)m=m+(h[_]|0),b[2*_]=m&8191,m=m>>>13,b[2*_+1]=m&8191,m=m>>>13;for(_=2*x;_<l;++_)b[_]=0;t(m===0),t((m&-8192)===0)},"convert13b"),B.prototype.stub=o(function(h){for(var x=new Array(h),b=0;b<h;b++)x[b]=0;return x},"stub"),B.prototype.mulp=o(function(h,x,b){var l=2*this.guessLen13b(h.length,x.length),m=this.makeRBT(l),_=this.stub(l),S=new Array(l),A=new Array(l),v=new Array(l),T=new Array(l),L=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,S,l),this.convert13b(x.words,x.length,T,l),this.transform(S,_,A,v,l,m),this.transform(T,_,L,w,l,m);for(var fe=0;fe<l;fe++){var D=A[fe]*L[fe]-v[fe]*w[fe];v[fe]=A[fe]*w[fe]+v[fe]*L[fe],A[fe]=D}return this.conjugate(A,v,l),this.transform(A,v,k,_,l,m),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^x.negative,b.length=h.length+x.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),this.mulTo(h,x)},"mul"),i.prototype.mulf=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),X(this,h,x)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){t(typeof h=="number"),t(h<67108864);for(var x=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,m=(l&67108863)+(x&67108863);x>>=26,x+=l/67108864|0,x+=m>>>26,this.words[b]=m&67108863}return x!==0&&(this.words[b]=x,this.length++),this},"imuln"),i.prototype.muln=o(function(h){return this.clone().imuln(h)},"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(h){var x=O(h);if(x.length===0)return new i(1);for(var b=this,l=0;l<x.length&&x[l]===0;l++,b=b.sqr());if(++l<x.length)for(var m=b.sqr();l<x.length;l++,m=m.sqr())x[l]!==0&&(b=b.mul(m));return b},"pow"),i.prototype.iushln=o(function(h){t(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=67108863>>>26-x<<26-x,m;if(x!==0){var _=0;for(m=0;m<this.length;m++){var S=this.words[m]&l,A=(this.words[m]|0)-S<<x;this.words[m]=A|_,_=S>>>26-x}_&&(this.words[m]=_,this.length++)}if(b!==0){for(m=this.length-1;m>=0;m--)this.words[m+b]=this.words[m];for(m=0;m<b;m++)this.words[m]=0;this.length+=b}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return t(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,x,b){t(typeof h=="number"&&h>=0);var l;x?l=(x-x%26)/26:l=0;var m=h%26,_=Math.min((h-m)/26,this.length),S=67108863^67108863>>>m<<m,A=b;if(l-=_,l=Math.max(0,l),A){for(var v=0;v<_;v++)A.words[v]=this.words[v];A.length=_}if(_!==0)if(this.length>_)for(this.length-=_,v=0;v<this.length;v++)this.words[v]=this.words[v+_];else this.words[0]=0,this.length=1;var T=0;for(v=this.length-1;v>=0&&(T!==0||v>=l);v--){var L=this.words[v]|0;this.words[v]=T<<26-m|L>>>m,T=L&S}return A&&T!==0&&(A.words[A.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,x,b){return t(this.negative===0),this.iushrn(h,x,b)},"ishrn"),i.prototype.shln=o(function(h){return this.clone().ishln(h)},"shln"),i.prototype.ushln=o(function(h){return this.clone().iushln(h)},"ushln"),i.prototype.shrn=o(function(h){return this.clone().ishrn(h)},"shrn"),i.prototype.ushrn=o(function(h){return this.clone().iushrn(h)},"ushrn"),i.prototype.testn=o(function(h){t(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return!1;var m=this.words[b];return!!(m&l)},"testn"),i.prototype.imaskn=o(function(h){t(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(x!==0&&b++,this.length=Math.min(b,this.length),x!==0){var l=67108863^67108863>>>x<<x;this.words[this.length-1]&=l}return this.strip()},"imaskn"),i.prototype.maskn=o(function(h){return this.clone().imaskn(h)},"maskn"),i.prototype.iaddn=o(function(h){return t(typeof h=="number"),t(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},"iaddn"),i.prototype._iaddn=o(function(h){this.words[0]+=h;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},"_iaddn"),i.prototype.isubn=o(function(h){if(t(typeof h=="number"),t(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(h){return this.clone().iaddn(h)},"addn"),i.prototype.subn=o(function(h){return this.clone().isubn(h)},"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(h,x,b){var l=h.length+b,m;this._expand(l);var _,S=0;for(m=0;m<h.length;m++){_=(this.words[m+b]|0)+S;var A=(h.words[m]|0)*x;_-=A&67108863,S=(_>>26)-(A/67108864|0),this.words[m+b]=_&67108863}for(;m<this.length-b;m++)_=(this.words[m+b]|0)+S,S=_>>26,this.words[m+b]=_&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,m=0;m<this.length;m++)_=-(this.words[m]|0)+S,S=_>>26,this.words[m]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,x){var b=this.length-h.length,l=this.clone(),m=h,_=m.words[m.length-1]|0,S=this._countBits(_);b=26-S,b!==0&&(m=m.ushln(b),l.iushln(b),_=m.words[m.length-1]|0);var A=l.length-m.length,v;if(x!=="mod"){v=new i(null),v.length=A+1,v.words=new Array(v.length);for(var T=0;T<v.length;T++)v.words[T]=0}var L=l.clone()._ishlnsubmul(m,1,A);L.negative===0&&(l=L,v&&(v.words[A]=1));for(var w=A-1;w>=0;w--){var k=(l.words[m.length+w]|0)*67108864+(l.words[m.length+w-1]|0);for(k=Math.min(k/_|0,67108863),l._ishlnsubmul(m,k,w);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(m,1,w),l.isZero()||(l.negative^=1);v&&(v.words[w]=k)}return v&&v.strip(),l.strip(),x!=="div"&&b!==0&&l.iushrn(b),{div:v||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,x,b){if(t(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,m,_;return this.negative!==0&&h.negative===0?(_=this.neg().divmod(h,x),x!=="mod"&&(l=_.div.neg()),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.iadd(h)),{div:l,mod:m}):this.negative===0&&h.negative!==0?(_=this.divmod(h.neg(),x),x!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),x),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.isub(h)),{div:_.div,mod:m}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?x==="div"?{div:this.divn(h.words[0]),mod:null}:x==="mod"?{div:null,mod:new i(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modn(h.words[0]))}:this._wordDiv(h,x)},"divmod"),i.prototype.div=o(function(h){return this.divmod(h,"div",!1).div},"div"),i.prototype.mod=o(function(h){return this.divmod(h,"mod",!1).mod},"mod"),i.prototype.umod=o(function(h){return this.divmod(h,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(h){var x=this.divmod(h);if(x.mod.isZero())return x.div;var b=x.div.negative!==0?x.mod.isub(h):x.mod,l=h.ushrn(1),m=h.andln(1),_=b.cmp(l);return _<0||m===1&&_===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){t(h<=67108863);for(var x=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(x*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){t(h<=67108863);for(var x=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+x*67108864;this.words[b]=l/h|0,x=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){t(h.negative===0),t(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=new i(0),S=new i(1),A=0;x.isEven()&&b.isEven();)x.iushrn(1),b.iushrn(1),++A;for(var v=b.clone(),T=x.clone();!x.isZero();){for(var L=0,w=1;(x.words[0]&w)===0&&L<26;++L,w<<=1);if(L>0)for(x.iushrn(L);L-- >0;)(l.isOdd()||m.isOdd())&&(l.iadd(v),m.isub(T)),l.iushrn(1),m.iushrn(1);for(var k=0,fe=1;(b.words[0]&fe)===0&&k<26;++k,fe<<=1);if(k>0)for(b.iushrn(k);k-- >0;)(_.isOdd()||S.isOdd())&&(_.iadd(v),S.isub(T)),_.iushrn(1),S.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(_),m.isub(S)):(b.isub(x),_.isub(l),S.isub(m))}return{a:_,b:S,gcd:b.iushln(A)}},"egcd"),i.prototype._invmp=o(function(h){t(h.negative===0),t(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=b.clone();x.cmpn(1)>0&&b.cmpn(1)>0;){for(var S=0,A=1;(x.words[0]&A)===0&&S<26;++S,A<<=1);if(S>0)for(x.iushrn(S);S-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var v=0,T=1;(b.words[0]&T)===0&&v<26;++v,T<<=1);if(v>0)for(b.iushrn(v);v-- >0;)m.isOdd()&&m.iadd(_),m.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(m)):(b.isub(x),m.isub(l))}var L;return x.cmpn(1)===0?L=l:L=m,L.cmpn(0)<0&&L.iadd(h),L},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var x=this.clone(),b=h.clone();x.negative=0,b.negative=0;for(var l=0;x.isEven()&&b.isEven();l++)x.iushrn(1),b.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;b.isEven();)b.iushrn(1);var m=x.cmp(b);if(m<0){var _=x;x=b,b=_}else if(m===0||b.cmpn(1)===0)break;x.isub(b)}while(!0);return b.iushln(l)},"gcd"),i.prototype.invm=o(function(h){return this.egcd(h).a.umod(h)},"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(h){return this.words[0]&h},"andln"),i.prototype.bincn=o(function(h){t(typeof h=="number");var x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var m=l,_=b;m!==0&&_<this.length;_++){var S=this.words[_]|0;S+=m,m=S>>>26,S&=67108863,this.words[_]=S}return m!==0&&(this.words[_]=m,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(h){var x=h<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this.strip();var b;if(this.length>1)b=1;else{x&&(h=-h),t(h<=67108863,"Number is too big");var l=this.words[0]|0;b=l===h?0:l<h?-1:1}return this.negative!==0?-b|0:b},"cmpn"),i.prototype.cmp=o(function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var x=this.ucmp(h);return this.negative!==0?-x|0:x},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var x=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,m=h.words[b]|0;if(l!==m){l<m?x=-1:l>m&&(x=1);break}}return x},"ucmp"),i.prototype.gtn=o(function(h){return this.cmpn(h)===1},"gtn"),i.prototype.gt=o(function(h){return this.cmp(h)===1},"gt"),i.prototype.gten=o(function(h){return this.cmpn(h)>=0},"gten"),i.prototype.gte=o(function(h){return this.cmp(h)>=0},"gte"),i.prototype.ltn=o(function(h){return this.cmpn(h)===-1},"ltn"),i.prototype.lt=o(function(h){return this.cmp(h)===-1},"lt"),i.prototype.lten=o(function(h){return this.cmpn(h)<=0},"lten"),i.prototype.lte=o(function(h){return this.cmp(h)<=0},"lte"),i.prototype.eqn=o(function(h){return this.cmpn(h)===0},"eqn"),i.prototype.eq=o(function(h){return this.cmp(h)===0},"eq"),i.red=o(function(h){return new K(h)},"red"),i.prototype.toRed=o(function(h){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"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(h){return this.red=h,this},"_forceRed"),i.prototype.forceRed=o(function(h){return t(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},"redMul"),i.prototype.redIMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},"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(h){return t(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var J={k256:null,p224:null,p192:null,p25519:null};function ee(C,h){this.name=C,this.p=new i(h,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(ee,"MPrime"),ee.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),ee.prototype.ireduce=o(function(h){var x=h,b;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),b=x.bitLength();while(b>this.n);var l=b<this.n?-1:x.ucmp(this.p);return l===0?(x.words[0]=0,x.length=1):l>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},"ireduce"),ee.prototype.split=o(function(h,x){h.iushrn(this.n,0,x)},"split"),ee.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Y(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Y,"K256"),n(Y,ee),Y.prototype.split=o(function(h,x){for(var b=4194303,l=Math.min(h.length,9),m=0;m<l;m++)x.words[m]=h.words[m];if(x.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(x.words[x.length++]=_&b,m=10;m<h.length;m++){var S=h.words[m]|0;h.words[m-10]=(S&b)<<4|_>>>22,_=S}_>>>=22,h.words[m-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},"split"),Y.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var x=0,b=0;b<h.length;b++){var l=h.words[b]|0;x+=l*977,h.words[b]=x&67108863,x=l*64+(x/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function ie(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,"P224"),n(ie,ee);function G(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(G,"P192"),n(G,ee);function $(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o($,"P25519"),n($,ee),$.prototype.imulK=o(function(h){for(var x=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+x,m=l&67108863;l>>>=26,h.words[b]=m,x=l}return x!==0&&(h.words[h.length++]=x),h},"imulK"),i._prime=o(function(h){if(J[h])return J[h];var x;if(h==="k256")x=new Y;else if(h==="p224")x=new ie;else if(h==="p192")x=new G;else if(h==="p25519")x=new $;else throw new Error("Unknown prime "+h);return J[h]=x,x},"prime");function K(C){if(typeof C=="string"){var h=i._prime(C);this.m=h.p,this.prime=h}else t(C.gtn(1),"modulus must be greater than 1"),this.m=C,this.prime=null}o(K,"Red"),K.prototype._verify1=o(function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},"_verify1"),K.prototype._verify2=o(function(h,x){t((h.negative|x.negative)===0,"red works only with positives"),t(h.red&&h.red===x.red,"red works only with red numbers")},"_verify2"),K.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),K.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),K.prototype.add=o(function(h,x){this._verify2(h,x);var b=h.add(x);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),K.prototype.iadd=o(function(h,x){this._verify2(h,x);var b=h.iadd(x);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),K.prototype.sub=o(function(h,x){this._verify2(h,x);var b=h.sub(x);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),K.prototype.isub=o(function(h,x){this._verify2(h,x);var b=h.isub(x);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),K.prototype.shl=o(function(h,x){return this._verify1(h),this.imod(h.ushln(x))},"shl"),K.prototype.imul=o(function(h,x){return this._verify2(h,x),this.imod(h.imul(x))},"imul"),K.prototype.mul=o(function(h,x){return this._verify2(h,x),this.imod(h.mul(x))},"mul"),K.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),K.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),K.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var x=this.m.andln(3);if(t(x%2===1),x===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var l=this.m.subn(1),m=0;!l.isZero()&&l.andln(1)===0;)m++,l.iushrn(1);t(!l.isZero());var _=new i(1).toRed(this),S=_.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,A).cmp(S)!==0;)v.redIAdd(S);for(var T=this.pow(v,l),L=this.pow(h,l.addn(1).iushrn(1)),w=this.pow(h,l),k=m;w.cmp(_)!==0;){for(var fe=w,D=0;fe.cmp(_)!==0;D++)fe=fe.redSqr();t(D<k);var Q=this.pow(T,new i(1).iushln(k-D-1));L=L.redMul(Q),T=Q.redSqr(),w=w.redMul(T),k=D}return L},"sqrt"),K.prototype.invm=o(function(h){var x=h._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},"invm"),K.prototype.pow=o(function(h,x){if(x.isZero())return new i(1).toRed(this);if(x.cmpn(1)===0)return h.clone();var b=4,l=new Array(1<<b);l[0]=new i(1).toRed(this),l[1]=h;for(var m=2;m<l.length;m++)l[m]=this.mul(l[m-1],h);var _=l[0],S=0,A=0,v=x.bitLength()%26;for(v===0&&(v=26),m=x.length-1;m>=0;m--){for(var T=x.words[m],L=v-1;L>=0;L--){var w=T>>L&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&S===0){A=0;continue}S<<=1,S|=w,A++,!(A!==b&&(m!==0||L!==0))&&(_=this.mul(_,l[S]),A=0,S=0)}v=26}return _},"pow"),K.prototype.convertTo=o(function(h){var x=h.umod(this.m);return x===h?x.clone():x},"convertTo"),K.prototype.convertFrom=o(function(h){var x=h.clone();return x.red=null,x},"convertFrom"),i.mont=o(function(h){return new he(h)},"mont");function he(C){K.call(this,C),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(he,"Mont"),n(he,K),he.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),he.prototype.convertFrom=o(function(h){var x=this.imod(h.mul(this.rinv));return x.red=null,x},"convertFrom"),he.prototype.imul=o(function(h,x){if(h.isZero()||x.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"imul"),he.prototype.mul=o(function(h,x){if(h.isZero()||x.isZero())return new i(0)._forceRed(this);var b=h.mul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"mul"),he.prototype.invm=o(function(h){var x=this.imod(h._invmp(this.m).mul(this.r2));return x._forceRed(this)},"invm")})(typeof o1>"u"||o1,U3)});var Ls=Re((Bj,$3)=>{$3.exports=F3;function F3(r,e){if(!r)throw new Error(e||"Assertion failed")}o(F3,"assert");F3.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var s1=Re(z3=>{"use strict";var Xh=z3;function IR(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,f=i&255;s?t.push(s,f):t.push(f)}return t}o(IR,"toArray");Xh.toArray=IR;function q3(r){return r.length===1?"0"+r:r}o(q3,"zero2");Xh.zero2=q3;function H3(r){for(var e="",t=0;t<r.length;t++)e+=q3(r[t].toString(16));return e}o(H3,"toHex");Xh.toHex=H3;Xh.encode=o(function(e,t){return t==="hex"?H3(e):e},"encode")});var $n=Re(K3=>{"use strict";var qi=K3,DR=fo(),RR=Ls(),Zh=s1();qi.assert=RR;qi.toArray=Zh.toArray;qi.zero2=Zh.zero2;qi.toHex=Zh.toHex;qi.encode=Zh.encode;function OR(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1),i;for(i=0;i<n.length;i+=1)n[i]=0;var s=1<<e+1,f=r.clone();for(i=0;i<n.length;i++){var u,d=f.andln(s-1);f.isOdd()?(d>(s>>1)-1?u=(s>>1)-d:u=d,f.isubn(u)):u=0,n[i]=u,f.iushrn(1)}return n}o(OR,"getNAF");qi.getNAF=OR;function NR(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 f=r.andln(3)+n&3,u=e.andln(3)+i&3;f===3&&(f=-1),u===3&&(u=-1);var d;(f&1)===0?d=0:(s=r.andln(7)+n&7,(s===3||s===5)&&u===2?d=-f:d=f),t[0].push(d);var g;(u&1)===0?g=0:(s=e.andln(7)+i&7,(s===3||s===5)&&f===2?g=-u:g=u),t[1].push(g),2*n===d+1&&(n=1-n),2*i===g+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(NR,"getJSF");qi.getJSF=NR;function PR(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(PR,"cachedProperty");qi.cachedProperty=PR;function LR(r){return typeof r=="string"?qi.toArray(r,"hex"):r}o(LR,"parseBytes");qi.parseBytes=LR;function BR(r){return new DR(r,"hex","le")}o(BR,"intFromLE");qi.intFromLE=BR});var u1=Re(($j,c1)=>{var a1;c1.exports=o(function(e){return a1||(a1=new Bs(null)),a1.generate(e)},"rand");function Bs(r){this.rand=r}o(Bs,"Rand");c1.exports.Rand=Bs;Bs.prototype.generate=o(function(e){return this._rand(e)},"generate");Bs.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?Bs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Bs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(Bs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(f1=require("crypto"),typeof f1.randomBytes!="function")throw new Error("Not supported");Bs.prototype._rand=o(function(e){return f1.randomBytes(e)},"_rand")}catch{}var f1});var ku=Re((qj,j3)=>{"use strict";var Pa=fo(),Cu=$n(),Qh=Cu.getNAF,UR=Cu.getJSF,ed=Cu.assert;function Us(r,e){this.type=r,this.p=new Pa(e.p,16),this.red=e.prime?Pa.red(e.prime):Pa.mont(this.p),this.zero=new Pa(0).toRed(this.red),this.one=new Pa(1).toRed(this.red),this.two=new Pa(2).toRed(this.red),this.n=e.n&&new Pa(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(Us,"BaseCurve");j3.exports=Us;Us.prototype.point=o(function(){throw new Error("Not implemented")},"point");Us.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Us.prototype._fixedNafMul=o(function(e,t){ed(e.precomputed);var n=e._getDoubles(),i=Qh(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var g=u+n.step-1;g>=u;g--)d=(d<<1)+i[g];f.push(d)}for(var y=this.jpoint(null,null,null),E=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?E=E.mixedAdd(n.points[u]):d===-O&&(E=E.mixedAdd(n.points[u].neg()));y=y.add(E)}return y.toP()},"_fixedNafMul");Us.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=Qh(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var g=0;d>=0&&f[d]===0;d--)g++;if(d>=0&&g++,u=u.dblp(g),d<0)break;var y=f[d];ed(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(s[y-1>>1]):u=u.mixedAdd(s[-y-1>>1].neg()):y>0?u=u.add(s[y-1>>1]):u=u.add(s[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Us.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,g=0,y,E,O;for(y=0;y<i;y++){O=t[y];var R=O._getNAFPoints(e);f[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,P=y;if(f[I]!==1||f[P]!==1){d[I]=Qh(n[I],f[I],this._bitLength),d[P]=Qh(n[P],f[P],this._bitLength),g=Math.max(d[I].length,g),g=Math.max(d[P].length,g);continue}var X=[t[I],null,null,t[P]];t[I].y.cmp(t[P].y)===0?(X[1]=t[I].add(t[P]),X[2]=t[I].toJ().mixedAdd(t[P].neg())):t[I].y.cmp(t[P].y.redNeg())===0?(X[1]=t[I].toJ().mixedAdd(t[P]),X[2]=t[I].add(t[P].neg())):(X[1]=t[I].toJ().mixedAdd(t[P]),X[2]=t[I].toJ().mixedAdd(t[P].neg()));var B=[-3,-1,-5,-7,0,7,5,1,3],J=UR(n[I],n[P]);for(g=Math.max(J[0].length,g),d[I]=new Array(g),d[P]=new Array(g),E=0;E<g;E++){var ee=J[0][E]|0,Y=J[1][E]|0;d[I][E]=B[(ee+1)*3+(Y+1)],d[P][E]=0,u[I]=X}}var ie=this.jpoint(null,null,null),G=this._wnafT4;for(y=g;y>=0;y--){for(var $=0;y>=0;){var K=!0;for(E=0;E<i;E++)G[E]=d[E][y]|0,G[E]!==0&&(K=!1);if(!K)break;$++,y--}if(y>=0&&$++,ie=ie.dblp($),y<0)break;for(E=0;E<i;E++){var he=G[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ie=ie.mixedAdd(O):ie=ie.add(O))}}for(y=0;y<i;y++)u[y]=null;return s?ie:ie.toP()},"_wnafMulAdd");function gi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(gi,"BasePoint");Us.BasePoint=gi;gi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");gi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Us.prototype.decodePoint=o(function(e,t){e=Cu.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?ed(e[e.length-1]%2===0):e[0]===7&&ed(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");gi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");gi.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");gi.prototype.encode=o(function(e,t){return Cu.encode(this._encode(t),e)},"encode");gi.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");gi.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");gi.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");gi.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");gi.prototype._getBeta=o(function(){return null},"_getBeta");gi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var Iu=Re((Hj,l1)=>{typeof Object.create=="function"?l1.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"):l1.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 V3=Re((zj,G3)=>{"use strict";var FR=$n(),hr=fo(),h1=Iu(),Xf=ku(),$R=FR.assert;function vi(r){Xf.call(this,"short",r),this.a=new hr(r.a,16).toRed(this.red),this.b=new hr(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(vi,"ShortCurve");h1(vi,Xf);G3.exports=vi;vi.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 hr(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 hr(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],$R(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new hr(u.a,16),b:new hr(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");vi.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:hr.mont(e),n=new hr(2).toRed(t).redInvm(),i=n.redNeg(),s=new hr(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");vi.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 hr(1),f=new hr(0),u=new hr(0),d=new hr(1),g,y,E,O,R,I,P,X=0,B,J;n.cmpn(0)!==0;){var ee=i.div(n);B=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Y=d.sub(ee.mul(f));if(!E&&B.cmp(t)<0)g=P.neg(),y=s,E=B.neg(),O=J;else if(E&&++X===2)break;P=B,i=n,n=B,u=s,s=J,d=f,f=Y}R=B.neg(),I=J;var ie=E.sqr().add(O.sqr()),G=R.sqr().add(I.sqr());return G.cmp(ie)>=0&&(R=g,I=y),E.negative&&(E=E.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:E,b:O},{a:R,b:I}]},"_getEndoBasis");vi.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),g=s.mul(n.b),y=f.mul(i.b),E=e.sub(u).sub(d),O=g.add(y).neg();return{k1:E,k2:O}},"_endoSplit");vi.prototype.pointFromX=o(function(e,t){e=new hr(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");vi.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");vi.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],g=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),g=g.neg(!0)),i[f*2]=d,i[f*2+1]=g,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return y},"_endoWnafMulAdd");function Cr(r,e,t,n){Xf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new hr(e,16),this.y=new hr(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(Cr,"Point");h1(Cr,Xf.BasePoint);vi.prototype.point=o(function(e,t,n){return new Cr(this,e,t,n)},"point");vi.prototype.pointFromJSON=o(function(e,t){return Cr.fromJSON(this,e,t)},"pointFromJSON");Cr.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");Cr.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");Cr.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Cr.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");Cr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Cr.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");Cr.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Cr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Cr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Cr.prototype.mul=o(function(e){return e=new hr(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");Cr.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");Cr.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");Cr.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");Cr.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");Cr.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 $r(r,e,t,n){Xf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new hr(0)):(this.x=new hr(e,16),this.y=new hr(t,16),this.z=new hr(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($r,"JPoint");h1($r,Xf.BasePoint);vi.prototype.jpoint=o(function(e,t,n){return new $r(this,e,t,n)},"jpoint");$r.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");$r.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");$r.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),g=f.redSub(u);if(d.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),E=y.redMul(d),O=i.redMul(y),R=g.redSqr().redIAdd(E).redISub(O).redISub(O),I=g.redMul(O.redISub(R)).redISub(f.redMul(E)),P=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,P)},"add");$r.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=u.redSqr(),y=g.redMul(u),E=n.redMul(g),O=d.redSqr().redIAdd(y).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");$r.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,f=this.x,u=this.y,d=this.z,g=d.redSqr().redSqr(),y=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=y.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(g)),P=f.redMul(O),X=I.redSqr().redISub(P.redAdd(P)),B=P.redISub(X),J=I.redMul(B);J=J.redIAdd(J).redISub(R);var ee=y.redMul(d);t+1<e&&(g=g.redMul(R)),f=X,d=ee,y=J}return this.curve.jpoint(f,y.redMul(s),d)},"dblp");$r.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");$r.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),g=d.redSqr().redISub(u).redISub(u),y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),e=g,t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(E).redISub(R);I=I.redIAdd(I);var P=E.redAdd(E).redIAdd(E),X=P.redSqr(),B=R.redIAdd(R);B=B.redIAdd(B),B=B.redIAdd(B),e=X.redISub(I).redISub(I),t=P.redMul(I.redISub(e)).redISub(B),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");$r.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=d.redSqr().redISub(u).redISub(u);e=g;var y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(E).redMul(this.x.redAdd(E));I=I.redAdd(I).redIAdd(I);var P=R.redIAdd(R);P=P.redIAdd(P);var X=P.redAdd(P);e=I.redSqr().redISub(X),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var B=O.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B),t=I.redMul(P.redISub(e)).redISub(B)}return this.curve.jpoint(e,t,n)},"_threeDbl");$r.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),g=t.redAdd(t);g=g.redIAdd(g);var y=g.redMul(u),E=d.redSqr().redISub(y.redAdd(y)),O=y.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),P=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,P)},"_dbl");$r.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(g),E=t.redMul(y);E=E.redIAdd(E),E=E.redIAdd(E);var O=this.x.redMul(d).redISub(E);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(g.redISub(y)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");$r.prototype.mul=o(function(e,t){return e=new hr(e,t),this.curve._wnafMul(this,e)},"mul");$r.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");$r.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");$r.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");$r.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var Y3=Re((Kj,J3)=>{"use strict";var Zf=fo(),W3=Iu(),td=ku(),qR=$n();function Qf(r){td.call(this,"mont",r),this.a=new Zf(r.a,16).toRed(this.red),this.b=new Zf(r.b,16).toRed(this.red),this.i4=new Zf(4).toRed(this.red).redInvm(),this.two=new Zf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Qf,"MontCurve");W3(Qf,td);J3.exports=Qf;Qf.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 kr(r,e,t){td.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zf(e,16),this.z=new Zf(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(kr,"Point");W3(kr,td.BasePoint);Qf.prototype.decodePoint=o(function(e,t){return this.point(qR.toArray(e,t),1)},"decodePoint");Qf.prototype.point=o(function(e,t){return new kr(this,e,t)},"point");Qf.prototype.pointFromJSON=o(function(e){return kr.fromJSON(this,e)},"pointFromJSON");kr.prototype.precompute=o(function(){},"precompute");kr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");kr.fromJSON=o(function(e,t){return new kr(e,t[0],t[1]||e.one)},"fromJSON");kr.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");kr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");kr.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),f=t.redMul(i),u=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(f,u)},"dbl");kr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");kr.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),f=e.x.redSub(e.z),u=f.redMul(n),d=s.redMul(i),g=t.z.redMul(u.redAdd(d).redSqr()),y=t.x.redMul(u.redISub(d).redSqr());return this.curve.point(g,y)},"diffAdd");kr.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var u=f.length-1;u>=0;u--)f[u]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");kr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");kr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");kr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");kr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");kr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var Q3=Re((jj,Z3)=>{"use strict";var HR=$n(),Yo=fo(),X3=Iu(),rd=ku(),zR=HR.assert;function co(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,rd.call(this,"edwards",r),this.a=new Yo(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Yo(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Yo(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),zR(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(co,"EdwardsCurve");X3(co,rd);Z3.exports=co;co.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");co.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");co.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");co.prototype.pointFromX=o(function(e,t){e=new Yo(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)),f=i.redMul(s.redInvm()),u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(t&&!d||!t&&d)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");co.prototype.pointFromY=o(function(e,t){e=new Yo(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),f=i.redMul(s.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)},"pointFromY");co.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 nr(r,e,t,n,i){rd.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 Yo(e,16),this.y=new Yo(t,16),this.z=n?new Yo(n,16):this.curve.one,this.t=i&&new Yo(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(nr,"Point");X3(nr,rd.BasePoint);co.prototype.pointFromJSON=o(function(e){return nr.fromJSON(this,e)},"pointFromJSON");co.prototype.point=o(function(e,t,n,i){return new nr(this,e,t,n,i)},"point");nr.fromJSON=o(function(e,t){return new nr(e,t[0],t[1],t[2])},"fromJSON");nr.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");nr.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");nr.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),f=i.redAdd(t),u=f.redSub(n),d=i.redSub(t),g=s.redMul(u),y=f.redMul(d),E=s.redMul(d),O=u.redMul(f);return this.curve.point(g,y,O,E)},"_extDbl");nr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,f,u,d,g;if(this.curve.twisted){u=this.curve._mulA(t);var y=u.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(y.redSub(this.curve.two)),s=y.redMul(u.redSub(n)),f=y.redSqr().redSub(y).redSub(y)):(d=this.z.redSqr(),g=y.redSub(d).redISub(d),i=e.redSub(t).redISub(n).redMul(g),s=y.redMul(u.redSub(n)),f=y.redMul(g))}else u=t.redAdd(n),d=this.curve._mulC(this.z).redSqr(),g=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(g),s=this.curve._mulC(u).redMul(t.redISub(n)),f=u.redMul(g);return this.curve.point(i,s,f)},"_projDbl");nr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");nr.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)),f=n.redSub(t),u=s.redSub(i),d=s.redAdd(i),g=n.redAdd(t),y=f.redMul(u),E=d.redMul(g),O=f.redMul(g),R=u.redMul(d);return this.curve.point(y,E,R,O)},"_extAdd");nr.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),f=this.curve.d.redMul(i).redMul(s),u=n.redSub(f),d=n.redAdd(f),g=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),y=t.redMul(u).redMul(g),E,O;return this.curve.twisted?(E=t.redMul(d).redMul(s.redSub(this.curve._mulA(i))),O=u.redMul(d)):(E=t.redMul(d).redMul(s.redSub(i)),O=this.curve._mulC(u).redMul(d)),this.curve.point(y,E,O)},"_projAdd");nr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");nr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");nr.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");nr.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");nr.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");nr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");nr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");nr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");nr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");nr.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");nr.prototype.toP=nr.prototype.normalize;nr.prototype.mixedAdd=nr.prototype.add});var d1=Re(ex=>{"use strict";var nd=ex;nd.base=ku();nd.short=V3();nd.mont=Y3();nd.edwards=Q3()});var Hi=Re(er=>{"use strict";var KR=Ls(),jR=Iu();er.inherits=jR;function GR(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(GR,"isSurrogatePair");function VR(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):GR(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(VR,"toArray");er.toArray=VR;function WR(r){for(var e="",t=0;t<r.length;t++)e+=rx(r[t].toString(16));return e}o(WR,"toHex");er.toHex=WR;function tx(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(tx,"htonl");er.htonl=tx;function JR(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=tx(i)),t+=nx(i.toString(16))}return t}o(JR,"toHex32");er.toHex32=JR;function rx(r){return r.length===1?"0"+r:r}o(rx,"zero2");er.zero2=rx;function nx(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(nx,"zero8");er.zero8=nx;function YR(r,e,t,n){var i=t-e;KR(i%4===0);for(var s=new Array(i/4),f=0,u=e;f<s.length;f++,u+=4){var d;n==="big"?d=r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:d=r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],s[f]=d>>>0}return s}o(YR,"join32");er.join32=YR;function XR(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(XR,"split32");er.split32=XR;function ZR(r,e){return r>>>e|r<<32-e}o(ZR,"rotr32");er.rotr32=ZR;function QR(r,e){return r<<e|r>>>32-e}o(QR,"rotl32");er.rotl32=QR;function eO(r,e){return r+e>>>0}o(eO,"sum32");er.sum32=eO;function tO(r,e,t){return r+e+t>>>0}o(tO,"sum32_3");er.sum32_3=tO;function rO(r,e,t,n){return r+e+t+n>>>0}o(rO,"sum32_4");er.sum32_4=rO;function nO(r,e,t,n,i){return r+e+t+n+i>>>0}o(nO,"sum32_5");er.sum32_5=nO;function iO(r,e,t,n){var i=r[e],s=r[e+1],f=n+s>>>0,u=(f<n?1:0)+t+i;r[e]=u>>>0,r[e+1]=f}o(iO,"sum64");er.sum64=iO;function oO(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(oO,"sum64_hi");er.sum64_hi=oO;function sO(r,e,t,n){var i=e+n;return i>>>0}o(sO,"sum64_lo");er.sum64_lo=sO;function aO(r,e,t,n,i,s,f,u){var d=0,g=e;g=g+n>>>0,d+=g<e?1:0,g=g+s>>>0,d+=g<s?1:0,g=g+u>>>0,d+=g<u?1:0;var y=r+t+i+f+d;return y>>>0}o(aO,"sum64_4_hi");er.sum64_4_hi=aO;function fO(r,e,t,n,i,s,f,u){var d=e+n+s+u;return d>>>0}o(fO,"sum64_4_lo");er.sum64_4_lo=fO;function cO(r,e,t,n,i,s,f,u,d,g){var y=0,E=e;E=E+n>>>0,y+=E<e?1:0,E=E+s>>>0,y+=E<s?1:0,E=E+u>>>0,y+=E<u?1:0,E=E+g>>>0,y+=E<g?1:0;var O=r+t+i+f+d+y;return O>>>0}o(cO,"sum64_5_hi");er.sum64_5_hi=cO;function uO(r,e,t,n,i,s,f,u,d,g){var y=e+n+s+u+g;return y>>>0}o(uO,"sum64_5_lo");er.sum64_5_lo=uO;function lO(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(lO,"rotr64_hi");er.rotr64_hi=lO;function hO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(hO,"rotr64_lo");er.rotr64_lo=hO;function dO(r,e,t){return r>>>t}o(dO,"shr64_hi");er.shr64_hi=dO;function pO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(pO,"shr64_lo");er.shr64_lo=pO});var ec=Re(ox=>{"use strict";var ix=Hi(),mO=Ls();function id(){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(id,"BlockHash");ox.BlockHash=id;id.prototype.update=o(function(e,t){if(e=ix.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=ix.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");id.prototype.digest=o(function(e){return this.update(this._pad()),mO(this.pending===null),this._digest(e)},"digest");id.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 f=8;f<this.padLength;f++)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,f=8;f<this.padLength;f++)i[s++]=0;return i},"pad")});var p1=Re(Xo=>{"use strict";var bO=Hi(),uo=bO.rotr32;function gO(r,e,t,n){if(r===0)return sx(e,t,n);if(r===1||r===3)return fx(e,t,n);if(r===2)return ax(e,t,n)}o(gO,"ft_1");Xo.ft_1=gO;function sx(r,e,t){return r&e^~r&t}o(sx,"ch32");Xo.ch32=sx;function ax(r,e,t){return r&e^r&t^e&t}o(ax,"maj32");Xo.maj32=ax;function fx(r,e,t){return r^e^t}o(fx,"p32");Xo.p32=fx;function vO(r){return uo(r,2)^uo(r,13)^uo(r,22)}o(vO,"s0_256");Xo.s0_256=vO;function yO(r){return uo(r,6)^uo(r,11)^uo(r,25)}o(yO,"s1_256");Xo.s1_256=yO;function xO(r){return uo(r,7)^uo(r,18)^r>>>3}o(xO,"g0_256");Xo.g0_256=xO;function wO(r){return uo(r,17)^uo(r,19)^r>>>10}o(wO,"g1_256");Xo.g1_256=wO});var lx=Re((Yj,ux)=>{"use strict";var tc=Hi(),_O=ec(),EO=p1(),m1=tc.rotl32,Du=tc.sum32,AO=tc.sum32_5,SO=EO.ft_1,cx=_O.BlockHash,MO=[1518500249,1859775393,2400959708,3395469782];function lo(){if(!(this instanceof lo))return new lo;cx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(lo,"SHA1");tc.inherits(lo,cx);ux.exports=lo;lo.blockSize=512;lo.outSize=160;lo.hmacStrength=80;lo.padLength=64;lo.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]=m1(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],g=this.h[4];for(i=0;i<n.length;i++){var y=~~(i/20),E=AO(m1(s,5),SO(y,f,u,d),g,n[i],MO[y]);g=d,d=u,u=m1(f,30),f=s,s=E}this.h[0]=Du(this.h[0],s),this.h[1]=Du(this.h[1],f),this.h[2]=Du(this.h[2],u),this.h[3]=Du(this.h[3],d),this.h[4]=Du(this.h[4],g)},"_update");lo.prototype._digest=o(function(e){return e==="hex"?tc.toHex32(this.h,"big"):tc.split32(this.h,"big")},"digest")});var b1=Re((Xj,dx)=>{"use strict";var rc=Hi(),TO=ec(),nc=p1(),CO=Ls(),zi=rc.sum32,kO=rc.sum32_4,IO=rc.sum32_5,DO=nc.ch32,RO=nc.maj32,OO=nc.s0_256,NO=nc.s1_256,PO=nc.g0_256,LO=nc.g1_256,hx=TO.BlockHash,BO=[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 ho(){if(!(this instanceof ho))return new ho;hx.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=BO,this.W=new Array(64)}o(ho,"SHA256");rc.inherits(ho,hx);dx.exports=ho;ho.blockSize=512;ho.outSize=256;ho.hmacStrength=192;ho.padLength=64;ho.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]=kO(LO(n[i-2]),n[i-7],PO(n[i-15]),n[i-16]);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],g=this.h[4],y=this.h[5],E=this.h[6],O=this.h[7];for(CO(this.k.length===n.length),i=0;i<n.length;i++){var R=IO(O,NO(g),DO(g,y,E),this.k[i],n[i]),I=zi(OO(s),RO(s,f,u));O=E,E=y,y=g,g=zi(d,R),d=u,u=f,f=s,s=zi(R,I)}this.h[0]=zi(this.h[0],s),this.h[1]=zi(this.h[1],f),this.h[2]=zi(this.h[2],u),this.h[3]=zi(this.h[3],d),this.h[4]=zi(this.h[4],g),this.h[5]=zi(this.h[5],y),this.h[6]=zi(this.h[6],E),this.h[7]=zi(this.h[7],O)},"_update");ho.prototype._digest=o(function(e){return e==="hex"?rc.toHex32(this.h,"big"):rc.split32(this.h,"big")},"digest")});var bx=Re((Zj,mx)=>{"use strict";var g1=Hi(),px=b1();function Zo(){if(!(this instanceof Zo))return new Zo;px.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(Zo,"SHA224");g1.inherits(Zo,px);mx.exports=Zo;Zo.blockSize=512;Zo.outSize=224;Zo.hmacStrength=192;Zo.padLength=64;Zo.prototype._digest=o(function(e){return e==="hex"?g1.toHex32(this.h.slice(0,7),"big"):g1.split32(this.h.slice(0,7),"big")},"digest")});var x1=Re((Qj,xx)=>{"use strict";var wn=Hi(),UO=ec(),FO=Ls(),po=wn.rotr64_hi,mo=wn.rotr64_lo,gx=wn.shr64_hi,vx=wn.shr64_lo,Fs=wn.sum64,v1=wn.sum64_hi,y1=wn.sum64_lo,$O=wn.sum64_4_hi,qO=wn.sum64_4_lo,HO=wn.sum64_5_hi,zO=wn.sum64_5_lo,yx=UO.BlockHash,KO=[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 Ki(){if(!(this instanceof Ki))return new Ki;yx.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=KO,this.W=new Array(160)}o(Ki,"SHA512");wn.inherits(Ki,yx);xx.exports=Ki;Ki.blockSize=1024;Ki.outSize=512;Ki.hmacStrength=192;Ki.padLength=128;Ki.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=tN(n[i-4],n[i-3]),f=rN(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],g=QO(n[i-30],n[i-29]),y=eN(n[i-30],n[i-29]),E=n[i-32],O=n[i-31];n[i]=$O(s,f,u,d,g,y,E,O),n[i+1]=qO(s,f,u,d,g,y,E,O)}},"_prepareBlock");Ki.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],f=this.h[2],u=this.h[3],d=this.h[4],g=this.h[5],y=this.h[6],E=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],P=this.h[11],X=this.h[12],B=this.h[13],J=this.h[14],ee=this.h[15];FO(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var ie=J,G=ee,$=XO(O,R),K=ZO(O,R),he=jO(O,R,I,P,X,B),C=GO(O,R,I,P,X,B),h=this.k[Y],x=this.k[Y+1],b=n[Y],l=n[Y+1],m=HO(ie,G,$,K,he,C,h,x,b,l),_=zO(ie,G,$,K,he,C,h,x,b,l);ie=JO(i,s),G=YO(i,s),$=VO(i,s,f,u,d,g),K=WO(i,s,f,u,d,g);var S=v1(ie,G,$,K),A=y1(ie,G,$,K);J=X,ee=B,X=I,B=P,I=O,P=R,O=v1(y,E,m,_),R=y1(E,E,m,_),y=d,E=g,d=f,g=u,f=i,u=s,i=v1(m,_,S,A),s=y1(m,_,S,A)}Fs(this.h,0,i,s),Fs(this.h,2,f,u),Fs(this.h,4,d,g),Fs(this.h,6,y,E),Fs(this.h,8,O,R),Fs(this.h,10,I,P),Fs(this.h,12,X,B),Fs(this.h,14,J,ee)},"_update");Ki.prototype._digest=o(function(e){return e==="hex"?wn.toHex32(this.h,"big"):wn.split32(this.h,"big")},"digest");function jO(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(jO,"ch64_hi");function GO(r,e,t,n,i,s){var f=e&n^~e&s;return f<0&&(f+=4294967296),f}o(GO,"ch64_lo");function VO(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(VO,"maj64_hi");function WO(r,e,t,n,i,s){var f=e&n^e&s^n&s;return f<0&&(f+=4294967296),f}o(WO,"maj64_lo");function JO(r,e){var t=po(r,e,28),n=po(e,r,2),i=po(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(JO,"s0_512_hi");function YO(r,e){var t=mo(r,e,28),n=mo(e,r,2),i=mo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(YO,"s0_512_lo");function XO(r,e){var t=po(r,e,14),n=po(r,e,18),i=po(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(XO,"s1_512_hi");function ZO(r,e){var t=mo(r,e,14),n=mo(r,e,18),i=mo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(ZO,"s1_512_lo");function QO(r,e){var t=po(r,e,1),n=po(r,e,8),i=gx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(QO,"g0_512_hi");function eN(r,e){var t=mo(r,e,1),n=mo(r,e,8),i=vx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(eN,"g0_512_lo");function tN(r,e){var t=po(r,e,19),n=po(e,r,29),i=gx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(tN,"g1_512_hi");function rN(r,e){var t=mo(r,e,19),n=mo(e,r,29),i=vx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(rN,"g1_512_lo")});var Ex=Re((eG,_x)=>{"use strict";var w1=Hi(),wx=x1();function Qo(){if(!(this instanceof Qo))return new Qo;wx.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(Qo,"SHA384");w1.inherits(Qo,wx);_x.exports=Qo;Qo.blockSize=1024;Qo.outSize=384;Qo.hmacStrength=192;Qo.padLength=128;Qo.prototype._digest=o(function(e){return e==="hex"?w1.toHex32(this.h.slice(0,12),"big"):w1.split32(this.h.slice(0,12),"big")},"digest")});var Ax=Re(ic=>{"use strict";ic.sha1=lx();ic.sha224=bx();ic.sha256=b1();ic.sha384=Ex();ic.sha512=x1()});var Ix=Re(kx=>{"use strict";var La=Hi(),nN=ec(),od=La.rotl32,Sx=La.sum32,Ru=La.sum32_3,Mx=La.sum32_4,Cx=nN.BlockHash;function bo(){if(!(this instanceof bo))return new bo;Cx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(bo,"RIPEMD160");La.inherits(bo,Cx);kx.ripemd160=bo;bo.blockSize=512;bo.outSize=160;bo.hmacStrength=192;bo.padLength=64;bo.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],f=this.h[3],u=this.h[4],d=n,g=i,y=s,E=f,O=u,R=0;R<80;R++){var I=Sx(od(Mx(n,Tx(R,i,s,f),e[sN[R]+t],iN(R)),fN[R]),u);n=u,u=f,f=od(s,10),s=i,i=I,I=Sx(od(Mx(d,Tx(79-R,g,y,E),e[aN[R]+t],oN(R)),cN[R]),O),d=O,O=E,E=od(y,10),y=g,g=I}I=Ru(this.h[1],s,E),this.h[1]=Ru(this.h[2],f,O),this.h[2]=Ru(this.h[3],u,d),this.h[3]=Ru(this.h[4],n,g),this.h[4]=Ru(this.h[0],i,y),this.h[0]=I},"update");bo.prototype._digest=o(function(e){return e==="hex"?La.toHex32(this.h,"little"):La.split32(this.h,"little")},"digest");function Tx(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(Tx,"f");function iN(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(iN,"K");function oN(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(oN,"Kh");var sN=[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],aN=[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],fN=[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],cN=[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 Rx=Re((nG,Dx)=>{"use strict";var uN=Hi(),lN=Ls();function oc(r,e,t){if(!(this instanceof oc))return new oc(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(uN.toArray(e,t))}o(oc,"Hmac");Dx.exports=oc;oc.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),lN(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");oc.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");oc.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var Ou=Re(Ox=>{var qr=Ox;qr.utils=Hi();qr.common=ec();qr.sha=Ax();qr.ripemd=Ix();qr.hmac=Rx();qr.sha1=qr.sha.sha1;qr.sha256=qr.sha.sha256;qr.sha224=qr.sha.sha224;qr.sha384=qr.sha.sha384;qr.sha512=qr.sha.sha512;qr.ripemd160=qr.ripemd.ripemd160});var Px=Re((oG,Nx)=>{Nx.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 sd=Re(Ux=>{"use strict";var E1=Ux,$s=Ou(),_1=d1(),hN=$n(),Lx=hN.assert;function Bx(r){r.type==="short"?this.curve=new _1.short(r):r.type==="edwards"?this.curve=new _1.edwards(r):this.curve=new _1.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,Lx(this.g.validate(),"Invalid curve"),Lx(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(Bx,"PresetCurve");E1.PresetCurve=Bx;function qs(r,e){Object.defineProperty(E1,r,{configurable:!0,enumerable:!0,get:function(){var t=new Bx(e);return Object.defineProperty(E1,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(qs,"defineCurve");qs("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:$s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});qs("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:$s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});qs("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:$s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});qs("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:$s.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"]});qs("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:$s.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"]});qs("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$s.sha256,gRed:!1,g:["9"]});qs("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:$s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var A1;try{A1=Px()}catch{A1=void 0}qs("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:$s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",A1]})});var qx=Re((aG,$x)=>{"use strict";var dN=Ou(),Ba=s1(),Fx=Ls();function Hs(r){if(!(this instanceof Hs))return new Hs(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=Ba.toArray(r.entropy,r.entropyEnc||"hex"),t=Ba.toArray(r.nonce,r.nonceEnc||"hex"),n=Ba.toArray(r.pers,r.persEnc||"hex");Fx(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(Hs,"HmacDRBG");$x.exports=Hs;Hs.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");Hs.prototype._hmac=o(function(){return new dN.hmac(this.hash,this.K)},"hmac");Hs.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");Hs.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Ba.toArray(e,t),n=Ba.toArray(n,i),Fx(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Hs.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=Ba.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 f=s.slice(0,e);return this._update(n),this._reseed++,Ba.encode(f,t)},"generate")});var zx=Re((fG,Hx)=>{"use strict";var pN=fo(),mN=$n(),S1=mN.assert;function Jr(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(Jr,"KeyPair");Hx.exports=Jr;Jr.fromPublic=o(function(e,t,n){return t instanceof Jr?t:new Jr(e,{pub:t,pubEnc:n})},"fromPublic");Jr.fromPrivate=o(function(e,t,n){return t instanceof Jr?t:new Jr(e,{priv:t,privEnc:n})},"fromPrivate");Jr.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");Jr.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");Jr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Jr.prototype._importPrivate=o(function(e,t){this.priv=new pN(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Jr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?S1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&S1(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");Jr.prototype.derive=o(function(e){return e.validate()||S1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Jr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");Jr.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");Jr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var Gx=Re((cG,jx)=>{"use strict";var ad=fo(),C1=$n(),bN=C1.assert;function fd(r,e){if(r instanceof fd)return r;this._importDER(r,e)||(bN(r.r&&r.s,"Signature without r or s"),this.r=new ad(r.r,16),this.s=new ad(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(fd,"Signature");jx.exports=fd;function gN(){this.place=0}o(gN,"Position");function M1(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4||r[e.place]===0)return!1;for(var i=0,s=0,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(M1,"getLength");function Kx(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(Kx,"rmPadding");fd.prototype._importDER=o(function(e,t){e=C1.toArray(e,t);var n=new gN;if(e[n.place++]!==48)return!1;var i=M1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=M1(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=M1(e,n);if(u===!1||e.length!==u+n.place||(e[n.place]&128)!==0)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new ad(f),this.s=new ad(d),this.recoveryParam=null,!0},"_importDER");function T1(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(T1,"constructLength");fd.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=Kx(t),n=Kx(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];T1(i,t.length),i=i.concat(t),i.push(2),T1(i,n.length);var s=i.concat(n),f=[48];return T1(f,s.length),f=f.concat(s),C1.encode(f,e)},"toDER")});var Yx=Re((uG,Jx)=>{"use strict";var Ua=fo(),Vx=qx(),vN=$n(),k1=sd(),yN=u1(),Wx=vN.assert,I1=zx(),cd=Gx();function yi(r){if(!(this instanceof yi))return new yi(r);typeof r=="string"&&(Wx(Object.prototype.hasOwnProperty.call(k1,r),"Unknown curve "+r),r=k1[r]),r instanceof k1.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(yi,"EC");Jx.exports=yi;yi.prototype.keyPair=o(function(e){return new I1(this,e)},"keyPair");yi.prototype.keyFromPrivate=o(function(e,t){return I1.fromPrivate(this,e,t)},"keyFromPrivate");yi.prototype.keyFromPublic=o(function(e,t){return I1.fromPublic(this,e,t)},"keyFromPublic");yi.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Vx({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||yN(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ua(2));;){var s=new Ua(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");yi.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");yi.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 Ua(e,16));for(var s=this.n.byteLength(),f=t.getPrivate().toArray("be",s),u=e.toArray("be",s),d=new Vx({hash:this.hash,entropy:f,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new Ua(1)),y=0;;y++){var E=i.k?i.k(y):new Ua(d.generate(this.n.byteLength()));if(E=this._truncateToN(E,!0),!(E.cmpn(1)<=0||E.cmp(g)>=0)){var O=this.g.mul(E);if(!O.isInfinity()){var R=O.getX(),I=R.umod(this.n);if(I.cmpn(0)!==0){var P=E.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var X=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),X^=1),new cd({r:I,s:P,recoveryParam:X})}}}}}},"sign");yi.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Ua(e,16)),n=this.keyFromPublic(n,i),t=new cd(t,"hex");var s=t.r,f=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var u=f.invm(this.n),d=u.mul(e).umod(this.n),g=u.mul(s).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.eqXToP(s)):(y=this.g.mulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(s)===0)},"verify");yi.prototype.recoverPubKey=function(r,e,t,n){Wx((3&t)===t,"The recovery param is more than two bits"),e=new cd(e,n);var i=this.n,s=new Ua(r),f=e.r,u=e.s,d=t&1,g=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var y=e.r.invm(i),E=i.sub(s).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(E,f,O)};yi.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new cd(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var e6=Re((lG,Qx)=>{"use strict";var Nu=$n(),Zx=Nu.assert,Xx=Nu.parseBytes,sc=Nu.cachedProperty;function Ir(r,e){this.eddsa=r,this._secret=Xx(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Xx(e.pub)}o(Ir,"KeyPair");Ir.fromPublic=o(function(e,t){return t instanceof Ir?t:new Ir(e,{pub:t})},"fromPublic");Ir.fromSecret=o(function(e,t){return t instanceof Ir?t:new Ir(e,{secret:t})},"fromSecret");Ir.prototype.secret=o(function(){return this._secret},"secret");sc(Ir,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));sc(Ir,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));sc(Ir,"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"));sc(Ir,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));sc(Ir,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));sc(Ir,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Ir.prototype.sign=o(function(e){return Zx(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Ir.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Ir.prototype.getSecret=o(function(e){return Zx(this._secret,"KeyPair is public only"),Nu.encode(this.secret(),e)},"getSecret");Ir.prototype.getPublic=o(function(e){return Nu.encode(this.pubBytes(),e)},"getPublic");Qx.exports=Ir});var n6=Re((hG,r6)=>{"use strict";var xN=fo(),ud=$n(),t6=ud.assert,ld=ud.cachedProperty,wN=ud.parseBytes;function Fa(r,e){this.eddsa=r,typeof e!="object"&&(e=wN(e)),Array.isArray(e)&&(t6(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),t6(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof xN&&(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(Fa,"Signature");ld(Fa,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));ld(Fa,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));ld(Fa,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));ld(Fa,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Fa.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Fa.prototype.toHex=o(function(){return ud.encode(this.toBytes(),"hex").toUpperCase()},"toHex");r6.exports=Fa});var f6=Re((dG,a6)=>{"use strict";var _N=Ou(),EN=sd(),ac=$n(),AN=ac.assert,o6=ac.parseBytes,s6=e6(),i6=n6();function _n(r){if(AN(r==="ed25519","only tested with ed25519 so far"),!(this instanceof _n))return new _n(r);r=EN[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=_N.sha512}o(_n,"EDDSA");a6.exports=_n;_n.prototype.sign=o(function(e,t){e=o6(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),f=this.encodePoint(s),u=this.hashInt(f,n.pubBytes(),e).mul(n.priv()),d=i.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:d,Rencoded:f})},"sign");_n.prototype.verify=o(function(e,t,n){if(e=o6(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),f=this.g.mul(t.S()),u=t.R().add(i.pub().mul(s));return u.eq(f)},"verify");_n.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return ac.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");_n.prototype.keyFromPublic=o(function(e){return s6.fromPublic(this,e)},"keyFromPublic");_n.prototype.keyFromSecret=o(function(e){return s6.fromSecret(this,e)},"keyFromSecret");_n.prototype.makeSignature=o(function(e){return e instanceof i6?e:new i6(this,e)},"makeSignature");_n.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");_n.prototype.decodePoint=o(function(e){e=ac.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=ac.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");_n.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");_n.prototype.decodeInt=o(function(e){return ac.intFromLE(e)},"decodeInt");_n.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var u6=Re(c6=>{"use strict";var $a=c6;$a.version=B3().version;$a.utils=$n();$a.rand=u1();$a.curve=d1();$a.curves=sd();$a.ec=Yx();$a.eddsa=f6()});var h6=Re(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.BrowserRandomSource=void 0;var l6=65536,hd=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=l6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,l6)));return t}};o(hd,"BrowserRandomSource");dd.BrowserRandomSource=hd});var d6=Re(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.NodeRandomSource=void 0;var SN=bi(),pd=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=t[i];return(0,SN.wipe)(t),n}};o(pd,"NodeRandomSource");md.NodeRandomSource=pd});var p6=Re(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.SystemRandomSource=void 0;var MN=h6(),TN=d6(),bd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new MN.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new TN.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};o(bd,"SystemRandomSource");gd.SystemRandomSource=bd});var qa=Re(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.randomStringForEntropy=Yr.randomString=Yr.randomUint32=Yr.randomBytes=Yr.defaultRandomSource=void 0;var CN=p6(),kN=Na(),m6=bi();Yr.defaultRandomSource=new CN.SystemRandomSource;function D1(r,e=Yr.defaultRandomSource){return e.randomBytes(r)}o(D1,"randomBytes");Yr.randomBytes=D1;function IN(r=Yr.defaultRandomSource){let e=D1(4,r),t=(0,kN.readUint32LE)(e);return(0,m6.wipe)(e),t}o(IN,"randomUint32");Yr.randomUint32=IN;var b6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function g6(r,e=b6,t=Yr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",i=e.length,s=256-256%i;for(;r>0;){let f=D1(Math.ceil(r*256/s),t);for(let u=0;u<f.length&&r>0;u++){let d=f[u];d<s&&(n+=e.charAt(d%i),r--)}(0,m6.wipe)(f)}return n}o(g6,"randomString");Yr.randomString=g6;function DN(r,e=b6,t=Yr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return g6(n,e,t)}o(DN,"randomStringForEntropy");Yr.randomStringForEntropy=DN});var x6=Re(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var cc=Na(),fc=bi();es.DIGEST_LENGTH=64;es.BLOCK_SIZE=128;var y6=function(){function r(){this.digestLength=es.DIGEST_LENGTH,this.blockSize=es.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(){fc.wipe(this._buffer),fc.wipe(this._tempHi),fc.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<es.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(R1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=R1(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,f=t%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;cc.writeUint32BE(i,this._buffer,f-8),cc.writeUint32BE(s,this._buffer,f-4),R1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)cc.writeUint32BE(this._stateHi[u],e,u*8),cc.writeUint32BE(this._stateLo[u],e,u*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){fc.wipe(e.stateHi),fc.wipe(e.stateLo),e.buffer&&fc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();es.SHA512=y6;var v6=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 R1(r,e,t,n,i,s,f){for(var u=t[0],d=t[1],g=t[2],y=t[3],E=t[4],O=t[5],R=t[6],I=t[7],P=n[0],X=n[1],B=n[2],J=n[3],ee=n[4],Y=n[5],ie=n[6],G=n[7],$,K,he,C,h,x,b,l;f>=128;){for(var m=0;m<16;m++){var _=8*m+s;r[m]=cc.readUint32BE(i,_),e[m]=cc.readUint32BE(i,_+4)}for(var m=0;m<80;m++){var S=u,A=d,v=g,T=y,L=E,w=O,k=R,fe=I,D=P,Q=X,se=B,H=J,z=ee,V=Y,te=ie,ae=G;if($=I,K=G,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=(E>>>14|ee<<32-14)^(E>>>18|ee<<32-18)^(ee>>>41-32|E<<32-(41-32)),K=(ee>>>14|E<<32-14)^(ee>>>18|E<<32-18)^(E>>>41-32|ee<<32-(41-32)),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=E&O^~E&R,K=ee&Y^~ee&ie,h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=v6[m*2],K=v6[m*2+1],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=r[m%16],K=e[m%16],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,he=b&65535|l<<16,C=h&65535|x<<16,$=he,K=C,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=(u>>>28|P<<32-28)^(P>>>34-32|u<<32-(34-32))^(P>>>39-32|u<<32-(39-32)),K=(P>>>28|u<<32-28)^(u>>>34-32|P<<32-(34-32))^(u>>>39-32|P<<32-(39-32)),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,$=u&d^u&g^d&g,K=P&X^P&B^X&B,h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,fe=b&65535|l<<16,ae=h&65535|x<<16,$=T,K=H,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=he,K=C,h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,T=b&65535|l<<16,H=h&65535|x<<16,d=S,g=A,y=v,E=T,O=L,R=w,I=k,u=fe,X=D,B=Q,J=se,ee=H,Y=z,ie=V,G=te,P=ae,m%16===15)for(var _=0;_<16;_++)$=r[_],K=e[_],h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=r[(_+9)%16],K=e[(_+9)%16],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,he=r[(_+1)%16],C=e[(_+1)%16],$=(he>>>1|C<<32-1)^(he>>>8|C<<32-8)^he>>>7,K=(C>>>1|he<<32-1)^(C>>>8|he<<32-8)^(C>>>7|he<<32-7),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,he=r[(_+14)%16],C=e[(_+14)%16],$=(he>>>19|C<<32-19)^(C>>>61-32|he<<32-(61-32))^he>>>6,K=(C>>>19|he<<32-19)^(he>>>61-32|C<<32-(61-32))^(C>>>6|he<<32-6),h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[_]=b&65535|l<<16,e[_]=h&65535|x<<16}$=u,K=P,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[0],K=n[0],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[0]=u=b&65535|l<<16,n[0]=P=h&65535|x<<16,$=d,K=X,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[1],K=n[1],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[1]=d=b&65535|l<<16,n[1]=X=h&65535|x<<16,$=g,K=B,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[2],K=n[2],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[2]=g=b&65535|l<<16,n[2]=B=h&65535|x<<16,$=y,K=J,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[3],K=n[3],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[3]=y=b&65535|l<<16,n[3]=J=h&65535|x<<16,$=E,K=ee,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[4],K=n[4],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[4]=E=b&65535|l<<16,n[4]=ee=h&65535|x<<16,$=O,K=Y,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[5],K=n[5],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[5]=O=b&65535|l<<16,n[5]=Y=h&65535|x<<16,$=R,K=ie,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[6],K=n[6],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[6]=R=b&65535|l<<16,n[6]=ie=h&65535|x<<16,$=I,K=G,h=K&65535,x=K>>>16,b=$&65535,l=$>>>16,$=t[7],K=n[7],h+=K&65535,x+=K>>>16,b+=$&65535,l+=$>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[7]=I=b&65535|l<<16,n[7]=G=h&65535|x<<16,s+=128,f-=128}return s}o(R1,"hashBlocks");function RN(r){var e=new y6;e.update(r);var t=e.digest();return e.clean(),t}o(RN,"hash");es.hash=RN});var vd=Re(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.convertSecretKeyToX25519=Vt.convertPublicKeyToX25519=Vt.verify=Vt.sign=Vt.extractPublicKeyFromSecretKey=Vt.generateKeyPair=Vt.generateKeyPairFromSeed=Vt.SEED_LENGTH=Vt.SECRET_KEY_LENGTH=Vt.PUBLIC_KEY_LENGTH=Vt.SIGNATURE_LENGTH=void 0;var ON=qa(),Pu=x6(),S6=bi();Vt.SIGNATURE_LENGTH=64;Vt.PUBLIC_KEY_LENGTH=32;Vt.SECRET_KEY_LENGTH=64;Vt.SEED_LENGTH=32;function Ve(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(Ve,"gf");var NN=new Uint8Array(32);NN[0]=9;var P1=Ve(),uc=Ve([1]),PN=Ve([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),LN=Ve([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),w6=Ve([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_6=Ve([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),BN=Ve([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function zs(r,e){for(let t=0;t<16;t++)r[t]=e[t]|0}o(zs,"set25519");function O1(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(O1,"car25519");function M6(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(M6,"sel25519");function Lu(r,e){let t=Ve(),n=Ve();for(let i=0;i<16;i++)n[i]=e[i];O1(n),O1(n),O1(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,M6(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(Lu,"pack25519");function T6(r,e){let t=0;for(let n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(T6,"verify32");function E6(r,e){let t=new Uint8Array(32),n=new Uint8Array(32);return Lu(t,r),Lu(n,e),T6(t,n)}o(E6,"neq25519");function C6(r){let e=new Uint8Array(32);return Lu(e,r),e[0]&1}o(C6,"par25519");function UN(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(UN,"unpack25519");function Ha(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Ha,"add");function Ka(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ka,"sub");function Xt(r,e,t){let n,i,s=0,f=0,u=0,d=0,g=0,y=0,E=0,O=0,R=0,I=0,P=0,X=0,B=0,J=0,ee=0,Y=0,ie=0,G=0,$=0,K=0,he=0,C=0,h=0,x=0,b=0,l=0,m=0,_=0,S=0,A=0,v=0,T=t[0],L=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],H=t[8],z=t[9],V=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ne=t[15];n=e[0],s+=n*T,f+=n*L,u+=n*w,d+=n*k,g+=n*fe,y+=n*D,E+=n*Q,O+=n*se,R+=n*H,I+=n*z,P+=n*V,X+=n*te,B+=n*ae,J+=n*Ae,ee+=n*ge,Y+=n*ne,n=e[1],f+=n*T,u+=n*L,d+=n*w,g+=n*k,y+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*H,P+=n*z,X+=n*V,B+=n*te,J+=n*ae,ee+=n*Ae,Y+=n*ge,ie+=n*ne,n=e[2],u+=n*T,d+=n*L,g+=n*w,y+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,P+=n*H,X+=n*z,B+=n*V,J+=n*te,ee+=n*ae,Y+=n*Ae,ie+=n*ge,G+=n*ne,n=e[3],d+=n*T,g+=n*L,y+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,P+=n*se,X+=n*H,B+=n*z,J+=n*V,ee+=n*te,Y+=n*ae,ie+=n*Ae,G+=n*ge,$+=n*ne,n=e[4],g+=n*T,y+=n*L,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,P+=n*Q,X+=n*se,B+=n*H,J+=n*z,ee+=n*V,Y+=n*te,ie+=n*ae,G+=n*Ae,$+=n*ge,K+=n*ne,n=e[5],y+=n*T,E+=n*L,O+=n*w,R+=n*k,I+=n*fe,P+=n*D,X+=n*Q,B+=n*se,J+=n*H,ee+=n*z,Y+=n*V,ie+=n*te,G+=n*ae,$+=n*Ae,K+=n*ge,he+=n*ne,n=e[6],E+=n*T,O+=n*L,R+=n*w,I+=n*k,P+=n*fe,X+=n*D,B+=n*Q,J+=n*se,ee+=n*H,Y+=n*z,ie+=n*V,G+=n*te,$+=n*ae,K+=n*Ae,he+=n*ge,C+=n*ne,n=e[7],O+=n*T,R+=n*L,I+=n*w,P+=n*k,X+=n*fe,B+=n*D,J+=n*Q,ee+=n*se,Y+=n*H,ie+=n*z,G+=n*V,$+=n*te,K+=n*ae,he+=n*Ae,C+=n*ge,h+=n*ne,n=e[8],R+=n*T,I+=n*L,P+=n*w,X+=n*k,B+=n*fe,J+=n*D,ee+=n*Q,Y+=n*se,ie+=n*H,G+=n*z,$+=n*V,K+=n*te,he+=n*ae,C+=n*Ae,h+=n*ge,x+=n*ne,n=e[9],I+=n*T,P+=n*L,X+=n*w,B+=n*k,J+=n*fe,ee+=n*D,Y+=n*Q,ie+=n*se,G+=n*H,$+=n*z,K+=n*V,he+=n*te,C+=n*ae,h+=n*Ae,x+=n*ge,b+=n*ne,n=e[10],P+=n*T,X+=n*L,B+=n*w,J+=n*k,ee+=n*fe,Y+=n*D,ie+=n*Q,G+=n*se,$+=n*H,K+=n*z,he+=n*V,C+=n*te,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*ne,n=e[11],X+=n*T,B+=n*L,J+=n*w,ee+=n*k,Y+=n*fe,ie+=n*D,G+=n*Q,$+=n*se,K+=n*H,he+=n*z,C+=n*V,h+=n*te,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ne,n=e[12],B+=n*T,J+=n*L,ee+=n*w,Y+=n*k,ie+=n*fe,G+=n*D,$+=n*Q,K+=n*se,he+=n*H,C+=n*z,h+=n*V,x+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ne,n=e[13],J+=n*T,ee+=n*L,Y+=n*w,ie+=n*k,G+=n*fe,$+=n*D,K+=n*Q,he+=n*se,C+=n*H,h+=n*z,x+=n*V,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,S+=n*ne,n=e[14],ee+=n*T,Y+=n*L,ie+=n*w,G+=n*k,$+=n*fe,K+=n*D,he+=n*Q,C+=n*se,h+=n*H,x+=n*z,b+=n*V,l+=n*te,m+=n*ae,_+=n*Ae,S+=n*ge,A+=n*ne,n=e[15],Y+=n*T,ie+=n*L,G+=n*w,$+=n*k,K+=n*fe,he+=n*D,C+=n*Q,h+=n*se,x+=n*H,b+=n*z,l+=n*V,m+=n*te,_+=n*ae,S+=n*Ae,A+=n*ge,v+=n*ne,s+=38*ie,f+=38*G,u+=38*$,d+=38*K,g+=38*he,y+=38*C,E+=38*h,O+=38*x,R+=38*b,I+=38*l,P+=38*m,X+=38*_,B+=38*S,J+=38*A,ee+=38*v,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=g,r[5]=y,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=P,r[11]=X,r[12]=B,r[13]=J,r[14]=ee,r[15]=Y}o(Xt,"mul");function za(r,e){Xt(r,e,e)}o(za,"square");function k6(r,e){let t=Ve(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)za(t,t),n!==2&&n!==4&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(k6,"inv25519");function FN(r,e){let t=Ve(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)za(t,t),n!==1&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(FN,"pow2523");function L1(r,e){let t=Ve(),n=Ve(),i=Ve(),s=Ve(),f=Ve(),u=Ve(),d=Ve(),g=Ve(),y=Ve();Ka(t,r[1],r[0]),Ka(y,e[1],e[0]),Xt(t,t,y),Ha(n,r[0],r[1]),Ha(y,e[0],e[1]),Xt(n,n,y),Xt(i,r[3],e[3]),Xt(i,i,LN),Xt(s,r[2],e[2]),Ha(s,s,s),Ka(f,n,t),Ka(u,s,i),Ha(d,s,i),Ha(g,n,t),Xt(r[0],f,u),Xt(r[1],g,d),Xt(r[2],d,u),Xt(r[3],f,g)}o(L1,"edadd");function A6(r,e,t){for(let n=0;n<4;n++)M6(r[n],e[n],t)}o(A6,"cswap");function U1(r,e){let t=Ve(),n=Ve(),i=Ve();k6(i,e[2]),Xt(t,e[0],i),Xt(n,e[1],i),Lu(r,n),r[31]^=C6(t)<<7}o(U1,"pack");function I6(r,e,t){zs(r[0],P1),zs(r[1],uc),zs(r[2],uc),zs(r[3],P1);for(let n=255;n>=0;--n){let i=t[n/8|0]>>(n&7)&1;A6(r,e,i),L1(e,r),L1(r,r),A6(r,e,i)}}o(I6,"scalarmult");function F1(r,e){let t=[Ve(),Ve(),Ve(),Ve()];zs(t[0],w6),zs(t[1],_6),zs(t[2],uc),Xt(t[3],w6,_6),I6(r,t,e)}o(F1,"scalarbase");function D6(r){if(r.length!==Vt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Vt.SEED_LENGTH} bytes`);let e=(0,Pu.hash)(r);e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(32),n=[Ve(),Ve(),Ve(),Ve()];F1(n,e),U1(t,n);let i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(D6,"generateKeyPairFromSeed");Vt.generateKeyPairFromSeed=D6;function $N(r){let e=(0,ON.randomBytes)(32,r),t=D6(e);return(0,S6.wipe)(e),t}o($N,"generateKeyPair");Vt.generateKeyPair=$N;function qN(r){if(r.length!==Vt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Vt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(r.subarray(32))}o(qN,"extractPublicKeyFromSecretKey");Vt.extractPublicKeyFromSecretKey=qN;var N1=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 R6(r,e){let 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]*N1[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)*N1[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*N1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(R6,"modL");function B1(r){let e=new Float64Array(64);for(let t=0;t<64;t++)e[t]=r[t];for(let t=0;t<64;t++)r[t]=0;R6(r,e)}o(B1,"reduce");function HN(r,e){let t=new Float64Array(64),n=[Ve(),Ve(),Ve(),Ve()],i=(0,Pu.hash)(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let s=new Uint8Array(64);s.set(i.subarray(32),32);let f=new Pu.SHA512;f.update(s.subarray(32)),f.update(e);let u=f.digest();f.clean(),B1(u),F1(n,u),U1(s,n),f.reset(),f.update(s.subarray(0,32)),f.update(r.subarray(32)),f.update(e);let d=f.digest();B1(d);for(let g=0;g<32;g++)t[g]=u[g];for(let g=0;g<32;g++)for(let y=0;y<32;y++)t[g+y]+=d[g]*i[y];return R6(s.subarray(32),t),s}o(HN,"sign");Vt.sign=HN;function O6(r,e){let t=Ve(),n=Ve(),i=Ve(),s=Ve(),f=Ve(),u=Ve(),d=Ve();return zs(r[2],uc),UN(r[1],e),za(i,r[1]),Xt(s,i,PN),Ka(i,i,r[2]),Ha(s,r[2],s),za(f,s),za(u,f),Xt(d,u,f),Xt(t,d,i),Xt(t,t,s),FN(t,t),Xt(t,t,i),Xt(t,t,s),Xt(t,t,s),Xt(r[0],t,s),za(n,r[0]),Xt(n,n,s),E6(n,i)&&Xt(r[0],r[0],BN),za(n,r[0]),Xt(n,n,s),E6(n,i)?-1:(C6(r[0])===e[31]>>7&&Ka(r[0],P1,r[0]),Xt(r[3],r[0],r[1]),0)}o(O6,"unpackneg");function zN(r,e,t){let n=new Uint8Array(32),i=[Ve(),Ve(),Ve(),Ve()],s=[Ve(),Ve(),Ve(),Ve()];if(t.length!==Vt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Vt.SIGNATURE_LENGTH} bytes`);if(O6(s,r))return!1;let f=new Pu.SHA512;f.update(t.subarray(0,32)),f.update(r),f.update(e);let u=f.digest();return B1(u),I6(i,s,u),F1(s,t.subarray(32)),L1(i,s),U1(n,i),!T6(t,n)}o(zN,"verify");Vt.verify=zN;function KN(r){let e=[Ve(),Ve(),Ve(),Ve()];if(O6(e,r))throw new Error("Ed25519: invalid public key");let t=Ve(),n=Ve(),i=e[1];Ha(t,uc,i),Ka(n,uc,i),k6(n,n),Xt(t,t,n);let s=new Uint8Array(32);return Lu(s,t),s}o(KN,"convertPublicKeyToX25519");Vt.convertPublicKeyToX25519=KN;function jN(r){let e=(0,Pu.hash)(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(e.subarray(0,32));return(0,S6.wipe)(e),t}o(jN,"convertSecretKeyToX25519");Vt.convertSecretKeyToX25519=jN});var P6=Re((wG,N6)=>{"use strict";N6.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?"":",",f=n===void 0||typeof n=="symbol"?null:n;return t+s+r(f)},"")+"]":"{"+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 F6=Re(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.sharedKey=dr.generateKeyPair=dr.generateKeyPairFromSeed=dr.scalarMultBase=dr.scalarMult=dr.SHARED_KEY_LENGTH=dr.SECRET_KEY_LENGTH=dr.PUBLIC_KEY_LENGTH=void 0;var GN=qa(),VN=bi();dr.PUBLIC_KEY_LENGTH=32;dr.SECRET_KEY_LENGTH=32;dr.SHARED_KEY_LENGTH=32;function go(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(go,"gf");var L6=new Uint8Array(32);L6[0]=9;var WN=go([56129,1]);function $1(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o($1,"car25519");function Bu(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(Bu,"sel25519");function JN(r,e){let t=go(),n=go();for(let i=0;i<16;i++)n[i]=e[i];$1(n),$1(n),$1(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,Bu(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(JN,"pack25519");function YN(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(YN,"unpack25519");function yd(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(yd,"add");function xd(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(xd,"sub");function ts(r,e,t){let n,i,s=0,f=0,u=0,d=0,g=0,y=0,E=0,O=0,R=0,I=0,P=0,X=0,B=0,J=0,ee=0,Y=0,ie=0,G=0,$=0,K=0,he=0,C=0,h=0,x=0,b=0,l=0,m=0,_=0,S=0,A=0,v=0,T=t[0],L=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],H=t[8],z=t[9],V=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ne=t[15];n=e[0],s+=n*T,f+=n*L,u+=n*w,d+=n*k,g+=n*fe,y+=n*D,E+=n*Q,O+=n*se,R+=n*H,I+=n*z,P+=n*V,X+=n*te,B+=n*ae,J+=n*Ae,ee+=n*ge,Y+=n*ne,n=e[1],f+=n*T,u+=n*L,d+=n*w,g+=n*k,y+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*H,P+=n*z,X+=n*V,B+=n*te,J+=n*ae,ee+=n*Ae,Y+=n*ge,ie+=n*ne,n=e[2],u+=n*T,d+=n*L,g+=n*w,y+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,P+=n*H,X+=n*z,B+=n*V,J+=n*te,ee+=n*ae,Y+=n*Ae,ie+=n*ge,G+=n*ne,n=e[3],d+=n*T,g+=n*L,y+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,P+=n*se,X+=n*H,B+=n*z,J+=n*V,ee+=n*te,Y+=n*ae,ie+=n*Ae,G+=n*ge,$+=n*ne,n=e[4],g+=n*T,y+=n*L,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,P+=n*Q,X+=n*se,B+=n*H,J+=n*z,ee+=n*V,Y+=n*te,ie+=n*ae,G+=n*Ae,$+=n*ge,K+=n*ne,n=e[5],y+=n*T,E+=n*L,O+=n*w,R+=n*k,I+=n*fe,P+=n*D,X+=n*Q,B+=n*se,J+=n*H,ee+=n*z,Y+=n*V,ie+=n*te,G+=n*ae,$+=n*Ae,K+=n*ge,he+=n*ne,n=e[6],E+=n*T,O+=n*L,R+=n*w,I+=n*k,P+=n*fe,X+=n*D,B+=n*Q,J+=n*se,ee+=n*H,Y+=n*z,ie+=n*V,G+=n*te,$+=n*ae,K+=n*Ae,he+=n*ge,C+=n*ne,n=e[7],O+=n*T,R+=n*L,I+=n*w,P+=n*k,X+=n*fe,B+=n*D,J+=n*Q,ee+=n*se,Y+=n*H,ie+=n*z,G+=n*V,$+=n*te,K+=n*ae,he+=n*Ae,C+=n*ge,h+=n*ne,n=e[8],R+=n*T,I+=n*L,P+=n*w,X+=n*k,B+=n*fe,J+=n*D,ee+=n*Q,Y+=n*se,ie+=n*H,G+=n*z,$+=n*V,K+=n*te,he+=n*ae,C+=n*Ae,h+=n*ge,x+=n*ne,n=e[9],I+=n*T,P+=n*L,X+=n*w,B+=n*k,J+=n*fe,ee+=n*D,Y+=n*Q,ie+=n*se,G+=n*H,$+=n*z,K+=n*V,he+=n*te,C+=n*ae,h+=n*Ae,x+=n*ge,b+=n*ne,n=e[10],P+=n*T,X+=n*L,B+=n*w,J+=n*k,ee+=n*fe,Y+=n*D,ie+=n*Q,G+=n*se,$+=n*H,K+=n*z,he+=n*V,C+=n*te,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*ne,n=e[11],X+=n*T,B+=n*L,J+=n*w,ee+=n*k,Y+=n*fe,ie+=n*D,G+=n*Q,$+=n*se,K+=n*H,he+=n*z,C+=n*V,h+=n*te,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ne,n=e[12],B+=n*T,J+=n*L,ee+=n*w,Y+=n*k,ie+=n*fe,G+=n*D,$+=n*Q,K+=n*se,he+=n*H,C+=n*z,h+=n*V,x+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ne,n=e[13],J+=n*T,ee+=n*L,Y+=n*w,ie+=n*k,G+=n*fe,$+=n*D,K+=n*Q,he+=n*se,C+=n*H,h+=n*z,x+=n*V,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,S+=n*ne,n=e[14],ee+=n*T,Y+=n*L,ie+=n*w,G+=n*k,$+=n*fe,K+=n*D,he+=n*Q,C+=n*se,h+=n*H,x+=n*z,b+=n*V,l+=n*te,m+=n*ae,_+=n*Ae,S+=n*ge,A+=n*ne,n=e[15],Y+=n*T,ie+=n*L,G+=n*w,$+=n*k,K+=n*fe,he+=n*D,C+=n*Q,h+=n*se,x+=n*H,b+=n*z,l+=n*V,m+=n*te,_+=n*ae,S+=n*Ae,A+=n*ge,v+=n*ne,s+=38*ie,f+=38*G,u+=38*$,d+=38*K,g+=38*he,y+=38*C,E+=38*h,O+=38*x,R+=38*b,I+=38*l,P+=38*m,X+=38*_,B+=38*S,J+=38*A,ee+=38*v,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=g+i+65535,i=Math.floor(n/65536),g=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=E+i+65535,i=Math.floor(n/65536),E=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=g,r[5]=y,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=P,r[11]=X,r[12]=B,r[13]=J,r[14]=ee,r[15]=Y}o(ts,"mul");function Uu(r,e){ts(r,e,e)}o(Uu,"square");function XN(r,e){let t=go();for(let n=0;n<16;n++)t[n]=e[n];for(let n=253;n>=0;n--)Uu(t,t),n!==2&&n!==4&&ts(t,t,e);for(let n=0;n<16;n++)r[n]=t[n]}o(XN,"inv25519");function q1(r,e){let t=new Uint8Array(32),n=new Float64Array(80),i=go(),s=go(),f=go(),u=go(),d=go(),g=go();for(let R=0;R<31;R++)t[R]=r[R];t[31]=r[31]&127|64,t[0]&=248,YN(n,e);for(let R=0;R<16;R++)s[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let I=t[R>>>3]>>>(R&7)&1;Bu(i,s,I),Bu(f,u,I),yd(d,i,f),xd(i,i,f),yd(f,s,u),xd(s,s,u),Uu(u,d),Uu(g,i),ts(i,f,i),ts(f,s,d),yd(d,i,f),xd(i,i,f),Uu(s,i),xd(f,u,g),ts(i,f,WN),yd(i,i,u),ts(f,f,i),ts(i,u,g),ts(u,s,n),Uu(s,d),Bu(i,s,I),Bu(f,u,I)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=f[R],n[R+48]=s[R],n[R+64]=u[R];let y=n.subarray(32),E=n.subarray(16);XN(y,y),ts(E,E,y);let O=new Uint8Array(32);return JN(O,E),O}o(q1,"scalarMult");dr.scalarMult=q1;function B6(r){return q1(r,L6)}o(B6,"scalarMultBase");dr.scalarMultBase=B6;function U6(r){if(r.length!==dr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${dr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(r);return{publicKey:B6(e),secretKey:e}}o(U6,"generateKeyPairFromSeed");dr.generateKeyPairFromSeed=U6;function ZN(r){let e=(0,GN.randomBytes)(32,r),t=U6(e);return(0,VN.wipe)(e),t}o(ZN,"generateKeyPair");dr.generateKeyPair=ZN;function QN(r,e,t=!1){if(r.length!==dr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==dr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=q1(r,e);if(t){let i=0;for(let s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(QN,"sharedKey");dr.sharedKey=QN});var z1=Re(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var Xr=Na(),H1=bi(),eP=20;function tP(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],g=t[11]<<24|t[10]<<16|t[9]<<8|t[8],y=t[15]<<24|t[14]<<16|t[13]<<8|t[12],E=t[19]<<24|t[18]<<16|t[17]<<8|t[16],O=t[23]<<24|t[22]<<16|t[21]<<8|t[20],R=t[27]<<24|t[26]<<16|t[25]<<8|t[24],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],X=e[7]<<24|e[6]<<16|e[5]<<8|e[4],B=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Y=i,ie=s,G=f,$=u,K=d,he=g,C=y,h=E,x=O,b=R,l=I,m=P,_=X,S=B,A=J,v=0;v<eP;v+=2)ee=ee+$|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,$^=h,$=$>>>32-12|$<<12,Y=Y+K|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,K^=x,K=K>>>32-12|K<<12,ie=ie+he|0,S^=ie,S=S>>>32-16|S<<16,b=b+S|0,he^=b,he=he>>>32-12|he<<12,G=G+C|0,A^=G,A=A>>>32-16|A<<16,l=l+A|0,C^=l,C=C>>>32-12|C<<12,ie=ie+he|0,S^=ie,S=S>>>32-8|S<<8,b=b+S|0,he^=b,he=he>>>32-7|he<<7,G=G+C|0,A^=G,A=A>>>32-8|A<<8,l=l+A|0,C^=l,C=C>>>32-7|C<<7,Y=Y+K|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,K^=x,K=K>>>32-7|K<<7,ee=ee+$|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,$^=h,$=$>>>32-7|$<<7,ee=ee+K|0,A^=ee,A=A>>>32-16|A<<16,b=b+A|0,K^=b,K=K>>>32-12|K<<12,Y=Y+he|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ie=ie+C|0,_^=ie,_=_>>>32-16|_<<16,h=h+_|0,C^=h,C=C>>>32-12|C<<12,G=G+$|0,S^=G,S=S>>>32-16|S<<16,x=x+S|0,$^=x,$=$>>>32-12|$<<12,ie=ie+C|0,_^=ie,_=_>>>32-8|_<<8,h=h+_|0,C^=h,C=C>>>32-7|C<<7,G=G+$|0,S^=G,S=S>>>32-8|S<<8,x=x+S|0,$^=x,$=$>>>32-7|$<<7,Y=Y+he|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+K|0,A^=ee,A=A>>>32-8|A<<8,b=b+A|0,K^=b,K=K>>>32-7|K<<7;Xr.writeUint32LE(ee+n|0,r,0),Xr.writeUint32LE(Y+i|0,r,4),Xr.writeUint32LE(ie+s|0,r,8),Xr.writeUint32LE(G+f|0,r,12),Xr.writeUint32LE($+u|0,r,16),Xr.writeUint32LE(K+d|0,r,20),Xr.writeUint32LE(he+g|0,r,24),Xr.writeUint32LE(C+y|0,r,28),Xr.writeUint32LE(h+E|0,r,32),Xr.writeUint32LE(x+O|0,r,36),Xr.writeUint32LE(b+R|0,r,40),Xr.writeUint32LE(l+I|0,r,44),Xr.writeUint32LE(m+P|0,r,48),Xr.writeUint32LE(_+X|0,r,52),Xr.writeUint32LE(S+B|0,r,56),Xr.writeUint32LE(A+J|0,r,60)}o(tP,"core");function $6(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,f;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),f=s.length-e.length,s.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,f=i}for(var u=new Uint8Array(64),d=0;d<t.length;d+=64){tP(u,s,r);for(var g=d;g<d+64&&g<t.length;g++)n[g]=t[g]^u[g-d];nP(s,0,f)}return H1.wipe(u),i===0&&H1.wipe(s),n}o($6,"streamXOR");wd.streamXOR=$6;function rP(r,e,t,n){return n===void 0&&(n=0),H1.wipe(t),$6(r,e,t,t,n)}o(rP,"stream");wd.stream=rP;function nP(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(nP,"incrementCounter")});var K6=Re(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});var Ks=Na(),q6=bi(),iP=z1(),oP=20;function H6(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=z6(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var f=iP.streamXOR(i,s,t,n);return q6.wipe(i),f}o(H6,"streamXOR");Fu.streamXOR=H6;function sP(r,e,t){return q6.wipe(t),H6(r,e,t,t)}o(sP,"stream");Fu.stream=sP;function z6(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],d=r[7]<<24|r[6]<<16|r[5]<<8|r[4],g=r[11]<<24|r[10]<<16|r[9]<<8|r[8],y=r[15]<<24|r[14]<<16|r[13]<<8|r[12],E=r[19]<<24|r[18]<<16|r[17]<<8|r[16],O=r[23]<<24|r[22]<<16|r[21]<<8|r[20],R=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],X=e[7]<<24|e[6]<<16|e[5]<<8|e[4],B=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Y=i,ie=s,G=f,$=u,K=d,he=g,C=y,h=E,x=O,b=R,l=I,m=P,_=X,S=B,A=J,v=0;v<oP;v+=2)ee=ee+$|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,$^=h,$=$>>>32-12|$<<12,Y=Y+K|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,K^=x,K=K>>>32-12|K<<12,ie=ie+he|0,S^=ie,S=S>>>32-16|S<<16,b=b+S|0,he^=b,he=he>>>32-12|he<<12,G=G+C|0,A^=G,A=A>>>32-16|A<<16,l=l+A|0,C^=l,C=C>>>32-12|C<<12,ie=ie+he|0,S^=ie,S=S>>>32-8|S<<8,b=b+S|0,he^=b,he=he>>>32-7|he<<7,G=G+C|0,A^=G,A=A>>>32-8|A<<8,l=l+A|0,C^=l,C=C>>>32-7|C<<7,Y=Y+K|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,K^=x,K=K>>>32-7|K<<7,ee=ee+$|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,$^=h,$=$>>>32-7|$<<7,ee=ee+K|0,A^=ee,A=A>>>32-16|A<<16,b=b+A|0,K^=b,K=K>>>32-12|K<<12,Y=Y+he|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ie=ie+C|0,_^=ie,_=_>>>32-16|_<<16,h=h+_|0,C^=h,C=C>>>32-12|C<<12,G=G+$|0,S^=G,S=S>>>32-16|S<<16,x=x+S|0,$^=x,$=$>>>32-12|$<<12,ie=ie+C|0,_^=ie,_=_>>>32-8|_<<8,h=h+_|0,C^=h,C=C>>>32-7|C<<7,G=G+$|0,S^=G,S=S>>>32-8|S<<8,x=x+S|0,$^=x,$=$>>>32-7|$<<7,Y=Y+he|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+K|0,A^=ee,A=A>>>32-8|A<<8,b=b+A|0,K^=b,K=K>>>32-7|K<<7;return Ks.writeUint32LE(ee,t,0),Ks.writeUint32LE(Y,t,4),Ks.writeUint32LE(ie,t,8),Ks.writeUint32LE(G,t,12),Ks.writeUint32LE(m,t,16),Ks.writeUint32LE(_,t,20),Ks.writeUint32LE(S,t,24),Ks.writeUint32LE(A,t,28),t}o(z6,"hchacha");Fu.hchacha=z6});var K1=Re(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});function aP(r,e,t){return~(r-1)&e|r-1&t}o(aP,"select");lc.select=aP;function fP(r,e){return(r|0)-(e|0)-1>>>31&1}o(fP,"lessOrEqual");lc.lessOrEqual=fP;function j6(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(j6,"compare");lc.compare=j6;function cP(r,e){return r.length===0||e.length===0?!1:j6(r,e)!==0}o(cP,"equal");lc.equal=cP});var V6=Re(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var uP=K1(),_d=bi();rs.DIGEST_LENGTH=16;var G6=function(){function r(e){this.digestLength=rs.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 f=e[8]|e[9]<<8;this._r[4]=(s>>>4|f<<12)&255,this._r[5]=f>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(f>>>14|u<<2)&8191;var d=e[12]|e[13]<<8;this._r[7]=(u>>>11|d<<5)&8065;var g=e[14]|e[15]<<8;this._r[8]=(d>>>8|g<<8)&8191,this._r[9]=g>>>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],f=this._h[1],u=this._h[2],d=this._h[3],g=this._h[4],y=this._h[5],E=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],P=this._r[0],X=this._r[1],B=this._r[2],J=this._r[3],ee=this._r[4],Y=this._r[5],ie=this._r[6],G=this._r[7],$=this._r[8],K=this._r[9];n>=16;){var he=e[t+0]|e[t+1]<<8;s+=he&8191;var C=e[t+2]|e[t+3]<<8;f+=(he>>>13|C<<3)&8191;var h=e[t+4]|e[t+5]<<8;u+=(C>>>10|h<<6)&8191;var x=e[t+6]|e[t+7]<<8;d+=(h>>>7|x<<9)&8191;var b=e[t+8]|e[t+9]<<8;g+=(x>>>4|b<<12)&8191,y+=b>>>1&8191;var l=e[t+10]|e[t+11]<<8;E+=(b>>>14|l<<2)&8191;var m=e[t+12]|e[t+13]<<8;O+=(l>>>11|m<<5)&8191;var _=e[t+14]|e[t+15]<<8;R+=(m>>>8|_<<8)&8191,I+=_>>>5|i;var S=0,A=S;A+=s*P,A+=f*(5*K),A+=u*(5*$),A+=d*(5*G),A+=g*(5*ie),S=A>>>13,A&=8191,A+=y*(5*Y),A+=E*(5*ee),A+=O*(5*J),A+=R*(5*B),A+=I*(5*X),S+=A>>>13,A&=8191;var v=S;v+=s*X,v+=f*P,v+=u*(5*K),v+=d*(5*$),v+=g*(5*G),S=v>>>13,v&=8191,v+=y*(5*ie),v+=E*(5*Y),v+=O*(5*ee),v+=R*(5*J),v+=I*(5*B),S+=v>>>13,v&=8191;var T=S;T+=s*B,T+=f*X,T+=u*P,T+=d*(5*K),T+=g*(5*$),S=T>>>13,T&=8191,T+=y*(5*G),T+=E*(5*ie),T+=O*(5*Y),T+=R*(5*ee),T+=I*(5*J),S+=T>>>13,T&=8191;var L=S;L+=s*J,L+=f*B,L+=u*X,L+=d*P,L+=g*(5*K),S=L>>>13,L&=8191,L+=y*(5*$),L+=E*(5*G),L+=O*(5*ie),L+=R*(5*Y),L+=I*(5*ee),S+=L>>>13,L&=8191;var w=S;w+=s*ee,w+=f*J,w+=u*B,w+=d*X,w+=g*P,S=w>>>13,w&=8191,w+=y*(5*K),w+=E*(5*$),w+=O*(5*G),w+=R*(5*ie),w+=I*(5*Y),S+=w>>>13,w&=8191;var k=S;k+=s*Y,k+=f*ee,k+=u*J,k+=d*B,k+=g*X,S=k>>>13,k&=8191,k+=y*P,k+=E*(5*K),k+=O*(5*$),k+=R*(5*G),k+=I*(5*ie),S+=k>>>13,k&=8191;var fe=S;fe+=s*ie,fe+=f*Y,fe+=u*ee,fe+=d*J,fe+=g*B,S=fe>>>13,fe&=8191,fe+=y*X,fe+=E*P,fe+=O*(5*K),fe+=R*(5*$),fe+=I*(5*G),S+=fe>>>13,fe&=8191;var D=S;D+=s*G,D+=f*ie,D+=u*Y,D+=d*ee,D+=g*J,S=D>>>13,D&=8191,D+=y*B,D+=E*X,D+=O*P,D+=R*(5*K),D+=I*(5*$),S+=D>>>13,D&=8191;var Q=S;Q+=s*$,Q+=f*G,Q+=u*ie,Q+=d*Y,Q+=g*ee,S=Q>>>13,Q&=8191,Q+=y*J,Q+=E*B,Q+=O*X,Q+=R*P,Q+=I*(5*K),S+=Q>>>13,Q&=8191;var se=S;se+=s*K,se+=f*$,se+=u*G,se+=d*ie,se+=g*Y,S=se>>>13,se&=8191,se+=y*ee,se+=E*J,se+=O*B,se+=R*X,se+=I*P,S+=se>>>13,se&=8191,S=(S<<2)+S|0,S=S+A|0,A=S&8191,S=S>>>13,v+=S,s=A,f=v,u=T,d=L,g=w,y=k,E=fe,O=D,R=Q,I=se,t+=16,n-=16}this._h[0]=s,this._h[1]=f,this._h[2]=u,this._h[3]=d,this._h[4]=g,this._h[5]=y,this._h[6]=E,this._h[7]=O,this._h[8]=R,this._h[9]=I},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,f,u;if(this._leftover){for(u=this._leftover,this._buffer[u++]=1;u<16;u++)this._buffer[u]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,u=2;u<10;u++)this._h[u]+=i,i=this._h[u]>>>13,this._h[u]&=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,u=1;u<10;u++)n[u]=this._h[u]+i,i=n[u]>>>13,n[u]&=8191;for(n[9]-=1<<13,s=(i^1)-1,u=0;u<10;u++)n[u]&=s;for(s=~s,u=0;u<10;u++)this._h[u]=this._h[u]&s|n[u];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,f=this._h[0]+this._pad[0],this._h[0]=f&65535,u=1;u<8;u++)f=(this._h[u]+this._pad[u]|0)+(f>>>16)|0,this._h[u]=f&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 _d.wipe(this._buffer),_d.wipe(this._r),_d.wipe(this._h),_d.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();rs.Poly1305=G6;function lP(r,e){var t=new G6(r);t.update(e);var n=t.digest();return t.clean(),n}o(lP,"oneTimeAuth");rs.oneTimeAuth=lP;function hP(r,e){return r.length!==rs.DIGEST_LENGTH||e.length!==rs.DIGEST_LENGTH?!1:uP.equal(r,e)}o(hP,"equal");rs.equal=hP});var Y6=Re(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var Ed=z1(),dP=V6(),$u=bi(),W6=Na(),pP=K1();ns.KEY_LENGTH=32;ns.NONCE_LENGTH=12;ns.TAG_LENGTH=16;var J6=new Uint8Array(16),mP=function(){function r(e){if(this.nonceLength=ns.NONCE_LENGTH,this.tagLength=ns.TAG_LENGTH,e.length!==ns.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 f=new Uint8Array(32);Ed.stream(this._key,s,f,4);var u=t.length+this.tagLength,d;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");d=i}else d=new Uint8Array(u);return Ed.streamXOR(this._key,s,t,d,4),this._authenticate(d.subarray(d.length-this.tagLength,d.length),f,d.subarray(0,d.length-this.tagLength),n),$u.wipe(s),d},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 f=new Uint8Array(32);Ed.stream(this._key,s,f,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,f,t.subarray(0,t.length-this.tagLength),n),!pP.equal(u,t.subarray(t.length-this.tagLength,t.length)))return null;var d=t.length-this.tagLength,g;if(i){if(i.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");g=i}else g=new Uint8Array(d);return Ed.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),g,4),$u.wipe(s),g},r.prototype.clean=function(){return $u.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new dP.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(J6.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(J6.subarray(n.length%16));var f=new Uint8Array(8);i&&W6.writeUint64LE(i.length,f),s.update(f),W6.writeUint64LE(n.length,f),s.update(f);for(var u=s.digest(),d=0;d<u.length;d++)e[d]=u[d];s.clean(),$u.wipe(u),$u.wipe(f)},r}();ns.ChaCha20Poly1305=mP});var Q6=Re(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var X6=K6(),Z6=Y6(),qu=bi();is.KEY_LENGTH=32;is.NONCE_LENGTH=24;is.TAG_LENGTH=16;var bP=function(){function r(e){if(this.nonceLength=is.NONCE_LENGTH,this.tagLength=is.TAG_LENGTH,e.length!==is.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=X6.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new Z6.ChaCha20Poly1305(s),d=u.seal(f,t,n,i);return qu.wipe(s),qu.wipe(f),u.clean(),d},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=X6.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new Z6.ChaCha20Poly1305(s),d=u.open(f,t,n,i);return qu.wipe(s),qu.wipe(f),u.clean(),d},r.prototype.clean=function(){return qu.wipe(this._key),this},r}();is.XChaCha20Poly1305=bP});var K4=Re(qd=>{"use strict";qd.byteLength=BL;qd.toByteArray=FL;qd.fromByteArray=HL;var yo=[],Ei=[],LL=typeof Uint8Array<"u"?Uint8Array:Array,bb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Xa=0,H4=bb.length;Xa<H4;++Xa)yo[Xa]=bb[Xa],Ei[bb.charCodeAt(Xa)]=Xa;var Xa,H4;Ei["-".charCodeAt(0)]=62;Ei["_".charCodeAt(0)]=63;function z4(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}o(z4,"getLens");function BL(r){var e=z4(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(BL,"byteLength");function UL(r,e,t){return(e+t)*3/4-t}o(UL,"_byteLength");function FL(r){var e,t=z4(r),n=t[0],i=t[1],s=new LL(UL(r,n,i)),f=0,u=i>0?n-4:n,d;for(d=0;d<u;d+=4)e=Ei[r.charCodeAt(d)]<<18|Ei[r.charCodeAt(d+1)]<<12|Ei[r.charCodeAt(d+2)]<<6|Ei[r.charCodeAt(d+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return i===2&&(e=Ei[r.charCodeAt(d)]<<2|Ei[r.charCodeAt(d+1)]>>4,s[f++]=e&255),i===1&&(e=Ei[r.charCodeAt(d)]<<10|Ei[r.charCodeAt(d+1)]<<4|Ei[r.charCodeAt(d+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}o(FL,"toByteArray");function $L(r){return yo[r>>18&63]+yo[r>>12&63]+yo[r>>6&63]+yo[r&63]}o($L,"tripletToBase64");function qL(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push($L(n));return i.join("")}o(qL,"encodeChunk");function HL(r){for(var e,t=r.length,n=t%3,i=[],s=16383,f=0,u=t-n;f<u;f+=s)i.push(qL(r,f,f+s>u?u:f+s));return n===1?(e=r[t-1],i.push(yo[e>>2]+yo[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yo[e>>10]+yo[e>>4&63]+yo[e<<2&63]+"=")),i.join("")}o(HL,"fromByteArray")});var j4=Re(gb=>{gb.read=function(r,e,t,n,i){var s,f,u=i*8-n-1,d=(1<<u)-1,g=d>>1,y=-7,E=t?i-1:0,O=t?-1:1,R=r[e+E];for(E+=O,s=R&(1<<-y)-1,R>>=-y,y+=u;y>0;s=s*256+r[e+E],E+=O,y-=8);for(f=s&(1<<-y)-1,s>>=-y,y+=n;y>0;f=f*256+r[e+E],E+=O,y-=8);if(s===0)s=1-g;else{if(s===d)return f?NaN:(R?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-g}return(R?-1:1)*f*Math.pow(2,s-n)};gb.write=function(r,e,t,n,i,s){var f,u,d,g=s*8-i-1,y=(1<<g)-1,E=y>>1,O=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:s-1,I=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,f=y):(f=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-f))<1&&(f--,d*=2),f+E>=1?e+=O/d:e+=O*Math.pow(2,1-E),e*d>=2&&(f++,d/=2),f+E>=y?(u=0,f=y):f+E>=1?(u=(e*d-1)*Math.pow(2,i),f=f+E):(u=e*Math.pow(2,E-1)*Math.pow(2,i),f=0));i>=8;r[t+R]=u&255,R+=I,u/=256,i-=8);for(f=f<<i|u,g+=i;g>0;r[t+R]=f&255,R+=I,f/=256,g-=8);r[t+R-I]|=P*128}});var Kd=Re(wc=>{"use strict";var vb=K4(),xc=j4(),G4=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;wc.Buffer=Se;wc.SlowBuffer=WL;wc.INSPECT_MAX_BYTES=50;var Hd=2147483647;wc.kMaxLength=Hd;Se.TYPED_ARRAY_SUPPORT=zL();!Se.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function zL(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}o(zL,"typedArraySupport");Object.defineProperty(Se.prototype,"parent",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.buffer}});Object.defineProperty(Se.prototype,"offset",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.byteOffset}});function ss(r){if(r>Hd)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Se.prototype),e}o(ss,"createBuffer");function Se(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _b(r)}return J4(r,e,t)}o(Se,"Buffer");Se.poolSize=8192;function J4(r,e,t){if(typeof r=="string")return jL(r,e);if(ArrayBuffer.isView(r))return GL(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(xo(r,ArrayBuffer)||r&&xo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xo(r,SharedArrayBuffer)||r&&xo(r.buffer,SharedArrayBuffer)))return xb(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return Se.from(n,e,t);var i=VL(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Se.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o(J4,"from");Se.from=function(r,e,t){return J4(r,e,t)};Object.setPrototypeOf(Se.prototype,Uint8Array.prototype);Object.setPrototypeOf(Se,Uint8Array);function Y4(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}o(Y4,"assertSize");function KL(r,e,t){return Y4(r),r<=0?ss(r):e!==void 0?typeof t=="string"?ss(r).fill(e,t):ss(r).fill(e):ss(r)}o(KL,"alloc");Se.alloc=function(r,e,t){return KL(r,e,t)};function _b(r){return Y4(r),ss(r<0?0:Eb(r)|0)}o(_b,"allocUnsafe");Se.allocUnsafe=function(r){return _b(r)};Se.allocUnsafeSlow=function(r){return _b(r)};function jL(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Se.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=X4(r,e)|0,n=ss(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(jL,"fromString");function yb(r){for(var e=r.length<0?0:Eb(r.length)|0,t=ss(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}o(yb,"fromArrayLike");function GL(r){if(xo(r,Uint8Array)){var e=new Uint8Array(r);return xb(e.buffer,e.byteOffset,e.byteLength)}return yb(r)}o(GL,"fromArrayView");function xb(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,Se.prototype),n}o(xb,"fromArrayBuffer");function VL(r){if(Se.isBuffer(r)){var e=Eb(r.length)|0,t=ss(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Ab(r.length)?ss(0):yb(r);if(r.type==="Buffer"&&Array.isArray(r.data))return yb(r.data)}o(VL,"fromObject");function Eb(r){if(r>=Hd)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Hd.toString(16)+" bytes");return r|0}o(Eb,"checked");function WL(r){return+r!=r&&(r=0),Se.alloc(+r)}o(WL,"SlowBuffer");Se.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==Se.prototype},"isBuffer");Se.compare=o(function(e,t){if(xo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),xo(t,Uint8Array)&&(t=Se.from(t,t.offset,t.byteLength)),!Se.isBuffer(e)||!Se.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,s=0,f=Math.min(n,i);s<f;++s)if(e[s]!==t[s]){n=e[s],i=t[s];break}return n<i?-1:i<n?1:0},"compare");Se.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");Se.concat=o(function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Se.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=Se.allocUnsafe(t),s=0;for(n=0;n<e.length;++n){var f=e[n];if(xo(f,Uint8Array))s+f.length>i.length?Se.from(f).copy(i,s):Uint8Array.prototype.set.call(i,f,s);else if(Se.isBuffer(f))f.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=f.length}return i},"concat");function X4(r,e){if(Se.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||xo(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wb(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return n5(r).length;default:if(i)return n?-1:wb(r).length;e=(""+e).toLowerCase(),i=!0}}o(X4,"byteLength");Se.byteLength=X4;function JL(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return oB(this,e,t);case"utf8":case"utf-8":return Q4(this,e,t);case"ascii":return nB(this,e,t);case"latin1":case"binary":return iB(this,e,t);case"base64":return tB(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sB(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o(JL,"slowToString");Se.prototype._isBuffer=!0;function Za(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}o(Za,"swap");Se.prototype.swap16=o(function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Za(this,t,t+1);return this},"swap16");Se.prototype.swap32=o(function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Za(this,t,t+3),Za(this,t+1,t+2);return this},"swap32");Se.prototype.swap64=o(function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Za(this,t,t+7),Za(this,t+1,t+6),Za(this,t+2,t+5),Za(this,t+3,t+4);return this},"swap64");Se.prototype.toString=o(function(){var e=this.length;return e===0?"":arguments.length===0?Q4(this,0,e):JL.apply(this,arguments)},"toString");Se.prototype.toLocaleString=Se.prototype.toString;Se.prototype.equals=o(function(e){if(!Se.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Se.compare(this,e)===0},"equals");Se.prototype.inspect=o(function(){var e="",t=wc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");G4&&(Se.prototype[G4]=Se.prototype.inspect);Se.prototype.compare=o(function(e,t,n,i,s){if(xo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),!Se.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var f=s-i,u=n-t,d=Math.min(f,u),g=this.slice(i,s),y=e.slice(t,n),E=0;E<d;++E)if(g[E]!==y[E]){f=g[E],u=y[E];break}return f<u?-1:u<f?1:0},"compare");function Z4(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ab(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=Se.from(e,n)),Se.isBuffer(e))return e.length===0?-1:V4(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):V4(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(Z4,"bidirectionalIndexOf");function V4(r,e,t,n,i){var s=1,f=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,f/=2,u/=2,t/=2}function d(R,I){return s===1?R[I]:R.readUInt16BE(I*s)}o(d,"read");var g;if(i){var y=-1;for(g=t;g<f;g++)if(d(r,g)===d(e,y===-1?0:g-y)){if(y===-1&&(y=g),g-y+1===u)return y*s}else y!==-1&&(g-=g-y),y=-1}else for(t+u>f&&(t=f-u),g=t;g>=0;g--){for(var E=!0,O=0;O<u;O++)if(d(r,g+O)!==d(e,O)){E=!1;break}if(E)return g}return-1}o(V4,"arrayIndexOf");Se.prototype.includes=o(function(e,t,n){return this.indexOf(e,t,n)!==-1},"includes");Se.prototype.indexOf=o(function(e,t,n){return Z4(this,e,t,n,!0)},"indexOf");Se.prototype.lastIndexOf=o(function(e,t,n){return Z4(this,e,t,n,!1)},"lastIndexOf");function YL(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var s=e.length;n>s/2&&(n=s/2);for(var f=0;f<n;++f){var u=parseInt(e.substr(f*2,2),16);if(Ab(u))return f;r[t+f]=u}return f}o(YL,"hexWrite");function XL(r,e,t,n){return zd(wb(e,r.length-t),r,t,n)}o(XL,"utf8Write");function ZL(r,e,t,n){return zd(cB(e),r,t,n)}o(ZL,"asciiWrite");function QL(r,e,t,n){return zd(n5(e),r,t,n)}o(QL,"base64Write");function eB(r,e,t,n){return zd(uB(e,r.length-t),r,t,n)}o(eB,"ucs2Write");Se.prototype.write=o(function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return YL(this,e,t,n);case"utf8":case"utf-8":return XL(this,e,t,n);case"ascii":case"latin1":case"binary":return ZL(this,e,t,n);case"base64":return QL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eB(this,e,t,n);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},"write");Se.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function tB(r,e,t){return e===0&&t===r.length?vb.fromByteArray(r):vb.fromByteArray(r.slice(e,t))}o(tB,"base64Slice");function Q4(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var s=r[i],f=null,u=s>239?4:s>223?3:s>191?2:1;if(i+u<=t){var d,g,y,E;switch(u){case 1:s<128&&(f=s);break;case 2:d=r[i+1],(d&192)===128&&(E=(s&31)<<6|d&63,E>127&&(f=E));break;case 3:d=r[i+1],g=r[i+2],(d&192)===128&&(g&192)===128&&(E=(s&15)<<12|(d&63)<<6|g&63,E>2047&&(E<55296||E>57343)&&(f=E));break;case 4:d=r[i+1],g=r[i+2],y=r[i+3],(d&192)===128&&(g&192)===128&&(y&192)===128&&(E=(s&15)<<18|(d&63)<<12|(g&63)<<6|y&63,E>65535&&E<1114112&&(f=E))}}f===null?(f=65533,u=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),i+=u}return rB(n)}o(Q4,"utf8Slice");var W4=4096;function rB(r){var e=r.length;if(e<=W4)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=W4));return t}o(rB,"decodeCodePointsArray");function nB(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}o(nB,"asciiSlice");function iB(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}o(iB,"latin1Slice");function oB(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",s=e;s<t;++s)i+=lB[r[s]];return i}o(oB,"hexSlice");function sB(r,e,t){for(var n=r.slice(e,t),i="",s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}o(sB,"utf16leSlice");Se.prototype.slice=o(function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,Se.prototype),i},"slice");function Rr(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o(Rr,"checkOffset");Se.prototype.readUintLE=Se.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return i},"readUIntLE");Se.prototype.readUintBE=Se.prototype.readUIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=this[e+--t],s=1;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");Se.prototype.readUint8=Se.prototype.readUInt8=o(function(e,t){return e=e>>>0,t||Rr(e,1,this.length),this[e]},"readUInt8");Se.prototype.readUint16LE=Se.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||Rr(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");Se.prototype.readUint16BE=Se.prototype.readUInt16BE=o(function(e,t){return e=e>>>0,t||Rr(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");Se.prototype.readUint32LE=Se.prototype.readUInt32LE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");Se.prototype.readUint32BE=Se.prototype.readUInt32BE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");Se.prototype.readIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");Se.prototype.readIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Rr(e,t,this.length);for(var i=t,s=1,f=this[e+--i];i>0&&(s*=256);)f+=this[e+--i]*s;return s*=128,f>=s&&(f-=Math.pow(2,8*t)),f},"readIntBE");Se.prototype.readInt8=o(function(e,t){return e=e>>>0,t||Rr(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");Se.prototype.readInt16LE=o(function(e,t){e=e>>>0,t||Rr(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");Se.prototype.readInt16BE=o(function(e,t){e=e>>>0,t||Rr(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");Se.prototype.readInt32LE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");Se.prototype.readInt32BE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");Se.prototype.readFloatLE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),xc.read(this,e,!0,23,4)},"readFloatLE");Se.prototype.readFloatBE=o(function(e,t){return e=e>>>0,t||Rr(e,4,this.length),xc.read(this,e,!1,23,4)},"readFloatBE");Se.prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||Rr(e,8,this.length),xc.read(this,e,!0,52,8)},"readDoubleLE");Se.prototype.readDoubleBE=o(function(e,t){return e=e>>>0,t||Rr(e,8,this.length),xc.read(this,e,!1,52,8)},"readDoubleBE");function Sn(r,e,t,n,i,s){if(!Se.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}o(Sn,"checkInt");Se.prototype.writeUintLE=Se.prototype.writeUIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Sn(this,e,t,n,s,0)}var f=1,u=0;for(this[t]=e&255;++u<n&&(f*=256);)this[t+u]=e/f&255;return t+n},"writeUIntLE");Se.prototype.writeUintBE=Se.prototype.writeUIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Sn(this,e,t,n,s,0)}var f=n-1,u=1;for(this[t+f]=e&255;--f>=0&&(u*=256);)this[t+f]=e/u&255;return t+n},"writeUIntBE");Se.prototype.writeUint8=Se.prototype.writeUInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");Se.prototype.writeUint16LE=Se.prototype.writeUInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");Se.prototype.writeUint16BE=Se.prototype.writeUInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");Se.prototype.writeUint32LE=Se.prototype.writeUInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},"writeUInt32LE");Se.prototype.writeUint32BE=Se.prototype.writeUInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");Se.prototype.writeIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Sn(this,e,t,n,s-1,-s)}var f=0,u=1,d=0;for(this[t]=e&255;++f<n&&(u*=256);)e<0&&d===0&&this[t+f-1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntLE");Se.prototype.writeIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Sn(this,e,t,n,s-1,-s)}var f=n-1,u=1,d=0;for(this[t+f]=e&255;--f>=0&&(u*=256);)e<0&&d===0&&this[t+f+1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntBE");Se.prototype.writeInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");Se.prototype.writeInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");Se.prototype.writeInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");Se.prototype.writeInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");Se.prototype.writeInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Sn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");function e5(r,e,t,n,i,s){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}o(e5,"checkIEEE754");function t5(r,e,t,n,i){return e=+e,t=t>>>0,i||e5(r,e,t,4,34028234663852886e22,-34028234663852886e22),xc.write(r,e,t,n,23,4),t+4}o(t5,"writeFloat");Se.prototype.writeFloatLE=o(function(e,t,n){return t5(this,e,t,!0,n)},"writeFloatLE");Se.prototype.writeFloatBE=o(function(e,t,n){return t5(this,e,t,!1,n)},"writeFloatBE");function r5(r,e,t,n,i){return e=+e,t=t>>>0,i||e5(r,e,t,8,17976931348623157e292,-17976931348623157e292),xc.write(r,e,t,n,52,8),t+8}o(r5,"writeDouble");Se.prototype.writeDoubleLE=o(function(e,t,n){return r5(this,e,t,!0,n)},"writeDoubleLE");Se.prototype.writeDoubleBE=o(function(e,t,n){return r5(this,e,t,!1,n)},"writeDoubleBE");Se.prototype.copy=o(function(e,t,n,i){if(!Se.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var s=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),s},"copy");Se.prototype.fill=o(function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Se.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var f;if(typeof e=="number")for(f=t;f<n;++f)this[f]=e;else{var u=Se.isBuffer(e)?e:Se.from(e,i),d=u.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(f=0;f<n-t;++f)this[f+t]=u[f%d]}return this},"fill");var aB=/[^+/0-9A-Za-z-_]/g;function fB(r){if(r=r.split("=")[0],r=r.trim().replace(aB,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}o(fB,"base64clean");function wb(r,e){e=e||1/0;for(var t,n=r.length,i=null,s=[],f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(wb,"utf8ToBytes");function cB(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}o(cB,"asciiToBytes");function uB(r,e){for(var t,n,i,s=[],f=0;f<r.length&&!((e-=2)<0);++f)t=r.charCodeAt(f),n=t>>8,i=t%256,s.push(i),s.push(n);return s}o(uB,"utf16leToBytes");function n5(r){return vb.toByteArray(fB(r))}o(n5,"base64ToBytes");function zd(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}o(zd,"blitBuffer");function xo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}o(xo,"isInstance");function Ab(r){return r!==r}o(Ab,"numberIsNaN");var lB=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)e[n+i]=r[t]+r[i];return e}()});var Wi=Re((oW,i5)=>{i5.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 Xu=Re((sW,o5)=>{o5.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 a5=Re(Or=>{var{Buffer:Sr}=Kd(),jd=4294967292,Gd=4294967293,Sb=4294967294,s5=4294967295,Ue=[0,1,3,7,15,31,63,127,255,511,1023],Ws=["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"],hB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),jn=[];hB.forEach(r=>{jn.push(r.charCodeAt(0))});Or.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&Ue[5])),e.push(128+(t&Ue[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]));else if(t>=65536&&t<=1114111){let n=t>>16&Ue[5];e.push(240+(n>>2)),e.push(128+((n&Ue[2])<<4)+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Sr.from(e)},decode(r,e){function t(I,P){if((P&192)!==128)return Gd;let X=((I&Ue[5])<<6)+(P&Ue[6]);return X<128?jd:X}o(t,"bytes2");function n(I,P,X){if((X&192)!==128||(P&192)!==128)return Gd;let B=((I&Ue[4])<<12)+((P&Ue[6])<<6)+(X&Ue[6]);return B<2048?jd:B>=55296&&B<=57343?Sb:B}o(n,"bytes3");function i(I,P,X,B){if((B&192)!==128||(X&192)!==128||(P&192)!==128)return Gd;let J=(((I&Ue[3])<<2)+(P>>4&Ue[2])<<16)+((P&Ue[4])<<12)+((X&Ue[6])<<6)+(B&Ue[6]);return J<65536?jd:J>1114111?Sb:J}o(i,"bytes4");let s,f,u,d,g,y,E=r.length,O=e?3:0,R=[];for(;O<E;){f=r[O],s=s5;let I=!0;for(;I;){if(f>=0&&f<=127){s=f,y=1;break}if(u=O+1,u<E&&f>=194&&f<=223){s=t(f,r[u]),y=2;break}if(d=O+2,d<E&&f>=224&&f<=239){s=n(f,r[u],r[d]),y=3;break}if(g=O+3,g<E&&f>=240&&f<=244){s=i(f,r[u],r[d],r[g]),y=4;break}break}if(s>1114111){let P=`byte[${O}]`;throw s===s5?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${P}`):s===Gd?new RangeError(`utf8.decode: illegal trailing byte found at: ${P}`):s===Sb?new RangeError(`utf8.decode: code point out of range found at: ${P}`):s===jd?new RangeError(`utf8.decode: non-shortest form found at: ${P}`):new RangeError(`utf8.decode: unrecognized error found at: ${P}`)}R.push(s),O+=y}return R}};Or.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&Ue[8]),e.push(t&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n>>8&Ue[8]),e.push(n&Ue[8]),e.push(i>>8&Ue[8]),e.push(i&Ue[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Sr.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,f,u,d,g,y,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(y=(r[i]<<8)+r[d],y<55296||y>57343){f=y,u=2;break}if(g=i+3,g<n&&(E=(r[i+2]<<8)+r[g],y<=56319&&E>=56320&&E<=57343)){f=65536+(y-55296<<10)+(E-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Or.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&Ue[8]),e.push(t>>8&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n&Ue[8]),e.push(n>>8&Ue[8]),e.push(i&Ue[8]),e.push(i>>8&Ue[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Sr.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,f,u,d,g,y,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(y=(r[d]<<8)+r[i],y<55296||y>57343){f=y,u=2;break}if(g=i+3,g<n&&(E=(r[g]<<8)+r[i+2],y<=56319&&E>=56320&&E<=57343)){f=65536+(y-55296<<10)+(E-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Or.utf32be={encode(r){let e=Sr.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&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Or.utf32le={encode(r){let e=Sr.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&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Or.uint7={encode(r){let e=Sr.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}};Or.uint8={encode(r){let e=Sr.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}};Or.uint16be={encode(r){let e=Sr.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&Ue[8],e[t++]=n&Ue[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}};Or.uint16le={encode(r){let e=Sr.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&Ue[8],e[t++]=n>>8&Ue[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}};Or.uint32be={encode(r){let e=Sr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Or.uint32le={encode(r){let e=Sr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Or.string={encode(r){return Or.utf16le.encode(r).toString("utf16le")},decode(r){return Or.utf16le.decode(Sr.from(r,"utf16le"),0)}};Or.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${Ws[n]}`;else if(n>=127&&n<=255)i+=`\`x${Ws[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Ws[n>>8&Ue[8]]}${Ws[n&Ue[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let f=n>>24&Ue[8];f>0&&(i+=Ws[f]),i+=`${Ws[n>>16&Ue[8]]+Ws[n>>8&Ue[8]]+Ws[n&Ue[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Sr.from(i).forEach(f=>{e.push(f)})}}return Sr.from(e)},decode(r){function e(E){return E>=48&&E<=57||E>=65&&E<=70||E>=97&&E<=102}o(e,"isHex");function t(E,O,R){let I={char:null,nexti:E+2,error:!0};if(E+1<O&&e(R[E])&&e(R[E+1])){let P=String.fromCodePoint(R[E],R[E+1]);I.char=parseInt(P,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(t,"getx");function n(E,O,R){let I={char:null,nexti:E+4,error:!0};if(E+3<O&&e(R[E])&&e(R[E+1])&&e(R[E+2])&&e(R[E+3])){let P=String.fromCodePoint(R[E],R[E+1],R[E+2],R[E+3]);I.char=parseInt(P,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(n,"getu");function i(E,O,R){let I={char:null,nexti:E+4,error:!0},P="";for(;E<O&&e(R[E]);)P+=String.fromCodePoint(R[E]),E+=1;return I.char=parseInt(P,16),R[E]===125&&!Number.isNaN(I.char)&&(I.error=!1),I.nexti=E+1,I}o(i,"getU");let s=[],f=r.length,u,d,g,y=0;for(;y<f;){for(;;){if(g=!0,r[y]!==96){s.push(r[y]),y+=1,g=!1;break}if(u=y+1,u>=f)break;if(r[u]===96){s.push(96),y+=2,g=!1;break}if(r[u]===120){if(d=t(u+1,f,r),d.error)break;s.push(d.char),y=d.nexti,g=!1;break}if(r[u]===117){if(r[u+1]===123){if(d=i(u+2,f,r),d.error)break;s.push(d.char),y=d.nexti,g=!1;break}if(d=n(u+1,f,r),d.error)break;s.push(d.char),y=d.nexti,g=!1;break}break}if(g)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${y}]`)}return s}};var Zu=13,Ai=10;Or.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Zu:t+1<r.length&&r[t+1]===Ai?t+=2:t+=1,e.push(Zu),e.push(Ai);break;case Ai:e.push(Zu),e.push(Ai),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ai&&(e.push(Zu),e.push(Ai)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Zu:t+1<r.length&&r[t+1]===Ai?t+=2:t+=1,e.push(Ai);break;case Ai:e.push(Ai),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ai&&e.push(Ai),e}};Or.base64={encode(r){if(r.length===0)return Sr.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,f=Sr.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let u=0;u<s;u+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],f[t++]=jn[n>>18&Ue[6]],f[t++]=jn[n>>12&Ue[6]],f[t++]=jn[n>>6&Ue[6]],f[t++]=jn[n&Ue[6]];if(i===0)return f;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,f[t++]=jn[n>>18&Ue[6]],f[t++]=jn[n>>12&Ue[6]],f[t++]=jn[n>>6&Ue[6]],f[t]=jn[64],f;if(i===2)return n=r[e]<<16,f[t++]=jn[n>>18&Ue[6]],f[t++]=jn[n>>12&Ue[6]],f[t++]=jn[64],f[t]=jn[64],f},decode(r){function e(y){let E=[],O=0;for(let R=0;R<y.length;R+=1){let I=y[R],P=!0;for(;P&&!(I===32||I===9||I===10||I===13);){if(I>=65&&I<=90){E.push(I-65);break}if(I>=97&&I<=122){E.push(I-71);break}if(I>=48&&I<=57){E.push(I+4);break}if(I===43){E.push(62);break}if(I===47){E.push(63);break}if(I===61){E.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${I}`)}}if(E.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${E.length}`);switch(O){case 0:break;case 1:if(E[E.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(E[E.length-1]!==64||E[E.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: ${O}`)}return{tail:O,buf:Sr.from(E)}}if(o(e,"validate"),r.length===0)return Sr.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,f,u,d=i.length/4,g=Sr.alloc(d*3-n);n>0&&(d-=1),f=0,s=0;for(let y=0;y<d;y+=1)u=i[s++]<<18,u+=i[s++]<<12,u+=i[s++]<<6,u+=i[s++],g[f++]=u>>16&Ue[8],g[f++]=u>>8&Ue[8],g[f++]=u&Ue[8];return n===1&&(u=i[s++]<<18,u+=i[s++]<<12,u+=i[s]<<6,g[f++]=u>>16&Ue[8],g[f]=u>>8&Ue[8]),n===2&&(u=i[s++]<<18,u+=i[s++]<<12,g[f]=u>>16&Ue[8]),g},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,f,u,d){switch(t){case 76:e+=`\r
35
35
  ${s}${f}${u}${d}`,t=4;break;case 75:e+=`${s}\r
36
36
  ${f}${u}${d}`,t=3;break;case 74:e+=`${s+f}\r
37
37
  ${u}${d}`,t=2;break;case 73:e+=`${s+f+u}\r
@@ -280,22 +280,22 @@ table.apg-attrs a:hover {
280
280
  `,s+=`<tr><td>sub-string end</td><td>${r.subEnd}</td><td>sub-string end-of-string index</td></tr>
281
281
  `,s+=`<tr><td>sub-string length</td><td>${r.subLength}</td><td>sub-string length</td></tr>
282
282
  `,s+=`</table>
283
- `,s};ir.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?Rb.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};ir.stringToChars=function(r){return Rb.decode("STRING",r)};ir.opcodeToString=function(r){let e="unknown";switch(r){case pr.ALT:e="ALT";break;case pr.CAT:e="CAT";break;case pr.RNM:e="RNM";break;case pr.UDT:e="UDT";break;case pr.AND:e="AND";break;case pr.NOT:e="NOT";break;case pr.REP:e="REP";break;case pr.TRG:e="TRG";break;case pr.TBS:e="TBS";break;case pr.TLS:e="TLS";break;case pr.BKR:e="BKR";break;case pr.BKA:e="BKA";break;case pr.BKN:e="BKN";break;case pr.ABG:e="ABG";break;case pr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};ir.stateToString=function(r){let e="unknown";switch(r){case pr.ACTIVE:e="ACTIVE";break;case pr.MATCH:e="MATCH";break;case pr.EMPTY:e="EMPTY";break;case pr.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};ir.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US","&nbsp;","!","&#34;","#","$","%","&#38;","&#39;","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&#60;","=","&#62;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","&#92;","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];ir.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};ir.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToDec: input must be an array of integers`);let i=Qa(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};ir.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToHex: input must be an array of integers`);let i=Qa(r.length,e,t);if(i.end>i.beg){n+=`\\x${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${ir.charToHex(r[s])}`}return n};ir.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToHex: input must be an array of integers`);let i=Qa(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 wB(r){return!(r>=55296&&r<=57343||r>1114111)}o(wB,"isUnicode");ir.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToUnicode: input must be an array of integers`);let i=Qa(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)wB(r[s])?n+=`&#${r[s]};`:n+=` U+${ir.charToHex(r[s])}`;return n};ir.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToJsUnicode: input must be an array of integers`);let i=Qa(r.length,e,t);if(i.end>i.beg){n+=`\\u${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${ir.charToHex(r[s])}`}return n};ir.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToAscii: input must be an array of integers`);let i=Qa(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let f=r[s];f>=32&&f<=126?n+=String.fromCharCode(f):n+=`\\x${ir.charToHex(f)}`}return n};ir.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${Ys}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=Qa(r.length,e,t);for(let f=s.beg;f<s.end;f+=1)i=r[f],i<32||i===127?n+=`<span class="${Mn.CLASS_CTRLCHAR}">${ir.asciiChars[i]}</span>`:i>127?n+=`<span class="${Mn.CLASS_CTRLCHAR}">U+${ir.charToHex(i)}</span>`:n+=ir.asciiChars[i];return n};ir.stringToAsciiHtml=function(r){let e=Rb.decode("STRING",r);return this.charsToAsciiHtml(e)}});var p5=Re((lW,d5)=>{d5.exports=o(function(){let e=Wi(),t=ef(),n="ast.js: ",i=this,s=null,f=null,u=null,d=0,g=[],y=[],E=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(N,X,L){E.length=0,O.length=0,g.length=0,d=0,s=N,f=X,u=L;let J,ee=[];for(J=0;J<s.length;J+=1)ee.push(s[J].lower);for(J=0;J<f.length;J+=1)ee.push(f[J].lower);for(d=s.length+f.length,J=0;J<d;J+=1)g[J]=!1,y[J]=null;for(let Y in i.callbacks){let ie=Y.toLowerCase();if(J=ee.indexOf(ie),J<0)throw new Error(`${n}init: node '${Y}' not a rule or udt name`);typeof i.callbacks[Y]=="function"&&(g[J]=!0,y[J]=i.callbacks[Y]),i.callbacks[Y]===!0&&(g[J]=!0)}},"init"),this.ruleDefined=o(function(N){return g[N]!==!1},"ruleDefined"),this.udtDefined=o(function(N){return g[s.length+N]!==!1},"udtDefined"),this.down=o(function(N,X){let L=O.length;return E.push(L),O.push({name:X,thisIndex:L,thatIndex:null,state:e.SEM_PRE,callbackIndex:N,phraseIndex:null,phraseLength:null,stack:E.length}),L},"down"),this.up=o(function(N,X,L,J){let ee=O.length,Y=E.pop();return O.push({name:X,thisIndex:ee,thatIndex:Y,state:e.SEM_POST,callbackIndex:N,phraseIndex:L,phraseLength:J,stack:E.length}),O[Y].thatIndex=ee,O[Y].phraseIndex=L,O[Y].phraseLength=J,ee},"up"),this.translate=o(function(N){let X,L,J;for(let ee=0;ee<O.length;ee+=1)J=O[ee],L=y[J.callbackIndex],J.state===e.SEM_PRE?L!==null&&(X=L(e.SEM_PRE,u,J.phraseIndex,J.phraseLength,N),X===e.SEM_SKIP&&(ee=J.thatIndex)):L!==null&&L(e.SEM_POST,u,J.phraseIndex,J.phraseLength,N)},"translate"),this.setLength=o(function(N){O.length=N,N>0?E.length=O[N-1].stack:E.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let N="";for(let X=0;X<I;X+=1)N+=" ";return N}o(R,"indent"),this.toXml=o(function(N){let X=t.charsToDec,L="decimal integer character codes";if(typeof N=="string"&&N.length>=3){let Y=N.slice(0,3).toLowerCase();Y==="asc"?(X=t.charsToAscii,L="ASCII for printing characters, hex for non-printing"):Y==="hex"?(X=t.charsToHex,L="hexadecimal integer character codes"):Y==="uni"&&(X=t.charsToUnicode,L="Unicode UTF-32 integer character codes")}let J="",ee=0;return J+=`<?xml version="1.0" encoding="utf-8"?>
283
+ `,s};ir.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?Rb.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};ir.stringToChars=function(r){return Rb.decode("STRING",r)};ir.opcodeToString=function(r){let e="unknown";switch(r){case pr.ALT:e="ALT";break;case pr.CAT:e="CAT";break;case pr.RNM:e="RNM";break;case pr.UDT:e="UDT";break;case pr.AND:e="AND";break;case pr.NOT:e="NOT";break;case pr.REP:e="REP";break;case pr.TRG:e="TRG";break;case pr.TBS:e="TBS";break;case pr.TLS:e="TLS";break;case pr.BKR:e="BKR";break;case pr.BKA:e="BKA";break;case pr.BKN:e="BKN";break;case pr.ABG:e="ABG";break;case pr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};ir.stateToString=function(r){let e="unknown";switch(r){case pr.ACTIVE:e="ACTIVE";break;case pr.MATCH:e="MATCH";break;case pr.EMPTY:e="EMPTY";break;case pr.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};ir.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US","&nbsp;","!","&#34;","#","$","%","&#38;","&#39;","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&#60;","=","&#62;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","&#92;","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];ir.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};ir.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToDec: input must be an array of integers`);let i=Qa(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};ir.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToHex: input must be an array of integers`);let i=Qa(r.length,e,t);if(i.end>i.beg){n+=`\\x${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${ir.charToHex(r[s])}`}return n};ir.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToHex: input must be an array of integers`);let i=Qa(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 wB(r){return!(r>=55296&&r<=57343||r>1114111)}o(wB,"isUnicode");ir.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToUnicode: input must be an array of integers`);let i=Qa(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)wB(r[s])?n+=`&#${r[s]};`:n+=` U+${ir.charToHex(r[s])}`;return n};ir.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToJsUnicode: input must be an array of integers`);let i=Qa(r.length,e,t);if(i.end>i.beg){n+=`\\u${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${ir.charToHex(r[s])}`}return n};ir.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ys}charsToAscii: input must be an array of integers`);let i=Qa(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let f=r[s];f>=32&&f<=126?n+=String.fromCharCode(f):n+=`\\x${ir.charToHex(f)}`}return n};ir.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${Ys}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=Qa(r.length,e,t);for(let f=s.beg;f<s.end;f+=1)i=r[f],i<32||i===127?n+=`<span class="${Mn.CLASS_CTRLCHAR}">${ir.asciiChars[i]}</span>`:i>127?n+=`<span class="${Mn.CLASS_CTRLCHAR}">U+${ir.charToHex(i)}</span>`:n+=ir.asciiChars[i];return n};ir.stringToAsciiHtml=function(r){let e=Rb.decode("STRING",r);return this.charsToAsciiHtml(e)}});var p5=Re((lW,d5)=>{d5.exports=o(function(){let e=Wi(),t=ef(),n="ast.js: ",i=this,s=null,f=null,u=null,d=0,g=[],y=[],E=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(P,X,B){E.length=0,O.length=0,g.length=0,d=0,s=P,f=X,u=B;let J,ee=[];for(J=0;J<s.length;J+=1)ee.push(s[J].lower);for(J=0;J<f.length;J+=1)ee.push(f[J].lower);for(d=s.length+f.length,J=0;J<d;J+=1)g[J]=!1,y[J]=null;for(let Y in i.callbacks){let ie=Y.toLowerCase();if(J=ee.indexOf(ie),J<0)throw new Error(`${n}init: node '${Y}' not a rule or udt name`);typeof i.callbacks[Y]=="function"&&(g[J]=!0,y[J]=i.callbacks[Y]),i.callbacks[Y]===!0&&(g[J]=!0)}},"init"),this.ruleDefined=o(function(P){return g[P]!==!1},"ruleDefined"),this.udtDefined=o(function(P){return g[s.length+P]!==!1},"udtDefined"),this.down=o(function(P,X){let B=O.length;return E.push(B),O.push({name:X,thisIndex:B,thatIndex:null,state:e.SEM_PRE,callbackIndex:P,phraseIndex:null,phraseLength:null,stack:E.length}),B},"down"),this.up=o(function(P,X,B,J){let ee=O.length,Y=E.pop();return O.push({name:X,thisIndex:ee,thatIndex:Y,state:e.SEM_POST,callbackIndex:P,phraseIndex:B,phraseLength:J,stack:E.length}),O[Y].thatIndex=ee,O[Y].phraseIndex=B,O[Y].phraseLength=J,ee},"up"),this.translate=o(function(P){let X,B,J;for(let ee=0;ee<O.length;ee+=1)J=O[ee],B=y[J.callbackIndex],J.state===e.SEM_PRE?B!==null&&(X=B(e.SEM_PRE,u,J.phraseIndex,J.phraseLength,P),X===e.SEM_SKIP&&(ee=J.thatIndex)):B!==null&&B(e.SEM_POST,u,J.phraseIndex,J.phraseLength,P)},"translate"),this.setLength=o(function(P){O.length=P,P>0?E.length=O[P-1].stack:E.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let P="";for(let X=0;X<I;X+=1)P+=" ";return P}o(R,"indent"),this.toXml=o(function(P){let X=t.charsToDec,B="decimal integer character codes";if(typeof P=="string"&&P.length>=3){let Y=P.slice(0,3).toLowerCase();Y==="asc"?(X=t.charsToAscii,B="ASCII for printing characters, hex for non-printing"):Y==="hex"?(X=t.charsToHex,B="hexadecimal integer character codes"):Y==="uni"&&(X=t.charsToUnicode,B="Unicode UTF-32 integer character codes")}let J="",ee=0;return J+=`<?xml version="1.0" encoding="utf-8"?>
284
284
  `,J+=`<root nodes="${O.length/2}" characters="${u.length}">
285
- `,J+=`<!-- input string, ${L} -->
285
+ `,J+=`<!-- input string, ${B} -->
286
286
  `,J+=R(ee+2),J+=X(u),J+=`
287
287
  `,O.forEach(Y=>{Y.state===e.SEM_PRE?(ee+=1,J+=R(ee),J+=`<node name="${Y.name}" index="${Y.phraseIndex}" length="${Y.phraseLength}">
288
288
  `,J+=R(ee+2),J+=X(u,Y.phraseIndex,Y.phraseLength),J+=`
289
289
  `):(J+=R(ee),J+=`</node><!-- name="${Y.name}" -->
290
290
  `,ee-=1)}),J+=`</root>
291
- `,J},"toSml"),this.phrases=o(function(){let N={},X,L;for(X=0;X<O.length;X+=1)L=O[X],L.state===e.SEM_PRE&&(Array.isArray(N[L.name])||(N[L.name]=[]),N[L.name].push({index:L.phraseIndex,length:L.phraseLength}));return N},"phrases")},"exportsAst")});var Ob=Re((hW,m5)=>{m5.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 f=0;f<=t;f+=1)s(f,f);return}for(let f=t-n+1;f<=t;f+=1){let u=(f+n)%n;s(u,f)}}},"forEach")},"exportsCircularBuffer")});var g5=Re((dW,b5)=>{b5.exports=o(function(){let e=Wi(),t=ef(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let f=null,u=null,d,g,y,E,O=0,R=0,I=0,N=null,X=null,L=null,J=null,ee=null,Y=0,ie=1/0,G=1/0,$=o(function(oe,F,Z){let me=`${n}evaluateRule(): `;if(oe>=L.length)throw new Error(`${me}rule index: ${oe} out of range`);if(F>=y)throw new Error(`${me}phrase index: ${F} out of range`);let{length:ye}=f;f.push({type:e.RNM,index:oe}),s(ye,F,Z),f.pop()},"evaluateRule"),K=o(function(le,oe,F){let Z=`${n}evaluateUdt(): `;if(le>=J.length)throw new Error(`${Z}udt index: ${le} out of range`);if(oe>=y)throw new Error(`${Z}phrase index: ${oe} out of range`);let{length:me}=f;f.push({type:e.UDT,empty:J[le].empty,index:le}),s(me,oe,F),f.pop()},"evaluateUdt"),he=o(function(){O=0,R=0,I=0,Y=0,E=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],L=null,J=null,u=null,d=0,g=0,y=0,N=null,X=null,ee=null,f=null},"clear"),C=o(function(){let le=[],oe=o(function(){let Z={};L.forEach(me=>{me.isBkr&&(Z[me.lower]=null)}),J.length>0&&J.forEach(me=>{me.isBkr&&(Z[me.lower]=null)}),le.push(Z)},"init"),F=o(function(){let Z=le[le.length-1],me={};for(let ye in Z)me[ye]=Z[ye];return me},"copy");this.push=o(function(){le.push(F())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=le.length-1),ye<1||ye>le.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return le.length=ye,le[le.length-1]},"pop"),this.length=o(function(){return le.length},"length"),this.savePhrase=o(function(me,ye,we){le[le.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(Z){return le[le.length-1][Z]},oe()},"backRef"),h=o(function(){let oe=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=E[E.length-1],this.uFrame=new C,this.pFrame=new C,this.evaluateRule=$,this.evaluateUdt=K,this.refresh=o(function(){oe.state=e.ACTIVE,oe.phraseLength=0,oe.lookAround=E[E.length-1]},"refresh")},"systemData"),x=o(function(){return E[E.length-1]},"lookAroundValue"),b=o(function(){return E.length>1},"inLookAround"),l=o(function(){return E[E.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),m=o(function(){let le=`${n}initializeAst(): `,oe=!0;for(;oe;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${le}ast object not recognized`);break}i.ast!==null&&i.ast.init(L,J,u)},"initializeAst"),_=o(function(){let le=`${n}initializeTrace(): `,oe=!0;for(;oe;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${le}trace object not recognized`);break}i.trace!==null&&i.trace.init(L,J,u)},"initializeTrace"),S=o(function(){let le=`${n}initializeStats(): `,oe=!0;for(;oe;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${le}stats object not recognized`);break}i.stats!==null&&i.stats.init(L,J)},"initializeStats"),A=o(function(le){let oe=`${n}initializeGrammar(): `;if(!le)throw new Error(`${oe}grammar object undefined`);if(le.grammarObject!=="grammarObject")throw new Error(`${oe}bad grammar object`);L=le.rules,J=le.udts},"initializeGrammar"),v=o(function(le){let oe=`${n}initializeStartRule(): `,F=null;if(typeof le=="number"){if(le>=L.length)throw new Error(`${oe}start rule index too large: max: ${L.length}: index: ${le}`);F=le}else if(typeof le=="string"){let Z=le.toLowerCase();for(let me=0;me<L.length;me+=1)if(Z===L[me].lower){F=L[me].index;break}if(F===null)throw new Error(`${oe}start rule name '${le}' not recognized`)}else throw new Error(`${oe}type of start rule '${typeof le}' not recognized`);return F},"initializeStartRule"),T=o(function(oe,F,Z){let me=`${n}initializeInputChars(): `,ye=oe,we=F,Ie=Z;if(ye===void 0)throw new Error(`${me}input string is undefined`);if(ye===null)throw new Error(`${me}input string is null`);if(typeof ye=="string")ye=t.stringToChars(ye);else if(!Array.isArray(ye))throw new Error(`${me}input string is not a string or array`);if(ye.length>0&&typeof ye[0]!="number")throw new Error(`${me}input string not an array of integers`);if(typeof we!="number")we=0;else if(we=Math.floor(we),we<0||we>ye.length)throw new Error(`${me}input beginning index out of range: ${we}`);if(typeof Ie!="number")Ie=ye.length-we;else if(Ie=Math.floor(Ie),Ie<0||Ie>ye.length-we)throw new Error(`${me}input length out of range: ${Ie}`);u=ye,d=we,g=Ie,y=d+g},"initializeInputChars"),P=o(function(){let le=`${n}initializeCallbacks(): `,oe;for(N=[],X=[],oe=0;oe<L.length;oe+=1)N[oe]=null;for(oe=0;oe<J.length;oe+=1)X[oe]=null;let F,Z=[];for(oe=0;oe<L.length;oe+=1)Z.push(L[oe].lower);for(oe=0;oe<J.length;oe+=1)Z.push(J[oe].lower);for(let me in i.callbacks){if(oe=Z.indexOf(me.toLowerCase()),oe<0)throw new Error(`${le}syntax callback '${me}' not a rule or udt name`);if(F=i.callbacks[me],F||(F=null),typeof F=="function"||F===null)oe<L.length?N[oe]=F:X[oe-L.length]=F;else throw new Error(`${le}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(oe=0;oe<J.length;oe+=1)if(X[oe]===null)throw new Error(`${le}all UDT callbacks must be defined. UDT callback[${J[oe].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(le){if(typeof le!="number")throw new Error(`parser: max tree depth must be integer > 0: ${le}`);if(ie=Math.floor(le),ie<=0)throw new Error(`parser: max tree depth must be integer > 0: ${le}`)},this.setMaxNodeHits=function(le){if(typeof le!="number")throw new Error(`parser: max node hits must be integer > 0: ${le}`);if(G=Math.floor(le),G<=0)throw new Error(`parser: max node hits must be integer > 0: ${le}`)};let w=o(function(le,oe,F){let Z,me=`${n}parse(): `;A(le);let ye=v(oe);P(),_(),S(),m();let we=new h;switch(F!=null&&(ee=F),f=[{type:e.RNM,index:ye}],s(0,d,we),f=null,we.state){case e.ACTIVE:throw new Error(`${me}final state should never be 'ACTIVE'`);case e.NOMATCH:Z=!1;break;case e.EMPTY:case e.MATCH:we.phraseLength===g?Z=!0:Z=!1;break;default:throw new Error("unrecognized state")}return{success:Z,state:we.state,length:g,matched:we.phraseLength,maxMatched:Y,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:y,subLength:g}},"privateParse");this.parseSubstring=o(function(oe,F,Z,me,ye,we){return he(),T(Z,me,ye),w(oe,F,we)},"parseSubstring"),this.parse=o(function(oe,F,Z,me){return he(),T(Z,0,Z.length),w(oe,F,me)},"parse");let k=o(function(le,oe,F){let Z=f[le];for(let me=0;me<Z.children.length&&(s(Z.children[me],oe,F),F.state===e.NOMATCH);me+=1);},"opALT"),fe=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le],Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Oe=0;Oe<Ie.children.length;Oe+=1)if(s(Ie.children[Oe],ye,F),F.state===e.NOMATCH){Z=!1;break}else ye+=F.phraseLength,we+=F.phraseLength;Z?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCAT"),D=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];if(Ie.max===0){F.state=e.EMPTY,F.phraseLength=0;return}me=oe,ye=0,we=0;let Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=y||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me+=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(Z))},"opREP"),Q=o(function(le,oe,F,Z){if(oe.phraseLength>F){let me=`${n}opRNM(${le.name}): callback function error: `;throw me+=`sysData.phraseLength: ${oe.phraseLength}`,me+=` must be <= remaining chars: ${F}`,new Error(me)}switch(oe.state){case e.ACTIVE:if(Z!==!0)throw new Error(`${n}opRNM(${le.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:oe.phraseLength=0;break;case e.MATCH:oe.phraseLength===0&&(oe.state=e.EMPTY);break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opRNM(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateRnmCallbackResult"),se=o(function(le,oe,F){let Z,me,ye,we,Ie,Dt,Fe=f[le],Oe=L[Fe.index],Lt=N[Oe.index],Ge=!b();if(Ge&&(me=i.ast&&i.ast.ruleDefined(Fe.index),me&&(Z=i.ast.getLength(),i.ast.down(Fe.index,L[Fe.index].name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Dt=F.pFrame,F.pFrame=new C),Lt===null)ye=f,f=Oe.opcodes,s(0,oe,F),f=ye;else{let Ye=y-oe;F.ruleIndex=Oe.index,Lt(F,u,oe,ee),Q(Oe,F,Ye,!0),F.state===e.ACTIVE&&(ye=f,f=Oe.opcodes,s(0,oe,F),f=ye,F.ruleIndex=Oe.index,Lt(F,u,oe,ee),Q(Oe,F,Ye,!1))}Ge&&(me&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(Fe.index,Oe.name,oe,F.phraseLength)),F.pFrame=Dt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Oe.isBkr&&(F.pFrame.savePhrase(Oe.lower,oe,F.phraseLength),F.uFrame.savePhrase(Oe.lower,oe,F.phraseLength)))},"opRNM"),H=o(function(le,oe,F){if(oe.phraseLength>F){let Z=`${n}opUDT(${le.name}): callback function error: `;throw Z+=`sysData.phraseLength: ${oe.phraseLength}`,Z+=` must be <= remaining chars: ${F}`,new Error(Z)}switch(oe.state){case e.ACTIVE:throw new Error(`${n}opUDT(${le.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.phraseLength=0;break;case e.MATCH:if(oe.phraseLength===0){if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.state=e.EMPTY}break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opUDT(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateUdtCallbackResult"),z=o(function(le,oe,F){let Z,me,ye,we,Ie,Dt,Fe=f[le],Oe=J[Fe.index];F.UdtIndex=Oe.index;let Lt=!b();Lt&&(ye=i.ast&&i.ast.udtDefined(Fe.index),ye&&(me=L.length+Fe.index,Z=i.ast.getLength(),i.ast.down(me,Oe.name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Dt=F.pFrame,F.pFrame=new C);let Ge=y-oe;X[Fe.index](F,u,oe,ee),H(Oe,F,Ge),Lt&&(ye&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(me,Oe.name,oe,F.phraseLength)),F.pFrame=Dt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Oe.isBkr&&(F.pFrame.savePhrase(Oe.lower,oe,F.phraseLength),F.uFrame.savePhrase(Oe.lower,oe,F.phraseLength)))},"opUDT"),V=o(function(le,oe,F){E.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:y,charsLength:g}),y=u.length,g=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(y=Z.charsEnd,g=Z.charsLength,F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${F.state}`)}},"opAND"),te=o(function(le,oe,F){E.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:y,charsLength:g}),y=u.length,g=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(y=Z.charsEnd,g=Z.charsLength,F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${F.state}`)}},"opNOT"),ae=o(function(le,oe,F){let Z=f[le];F.state=e.NOMATCH,oe<y&&Z.min<=u[oe]&&u[oe]<=Z.max&&(F.state=e.MATCH,F.phraseLength=1)},"opTRG"),Ae=o(function(le,oe,F){let Z,me=f[le],ye=me.string.length;if(F.state=e.NOMATCH,oe+ye<=y){for(Z=0;Z<ye;Z+=1)if(u[oe+Z]!==me.string[Z])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBS"),ge=o(function(le,oe,F){let Z,me,ye=f[le];F.state=e.NOMATCH;let we=ye.string.length;if(we===0){F.state=e.EMPTY;return}if(oe+we<=y){for(Z=0;Z<we;Z+=1)if(me=u[oe+Z],me>=65&&me<=90&&(me+=32),me!==ye.string[Z])return;F.state=e.MATCH,F.phraseLength=we}},"opTLS"),ne=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===0?e.EMPTY:e.NOMATCH},"opABG"),Me=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ue=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];F.state=e.NOMATCH,Ie.index<L.length?we=L[Ie.index].lower:we=J[Ie.index-L.length].lower;let Dt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Dt===null)return;let Oe=Dt.phraseIndex,Lt=Dt.phraseLength;if(Lt===0){F.state=e.EMPTY;return}if(oe+Lt<=y){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[oe+Z],ye=u[Oe+Z],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}else for(Z=0;Z<Lt;Z+=1)if(me=u[oe+Z],ye=u[Oe+Z],me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}},"opBKR"),ve=o(function(le,oe,F){switch(E.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),E.pop(),F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${F.state}`)}},"opBKA"),W=o(function(le,oe,F){switch(E.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),E.pop(),F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${F.state}`)}},"opBKN"),pe=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le],Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Oe=Ie.children.length-1;Oe>=0;Oe-=1)if(s(Ie.children[Oe],ye,F),ye-=F.phraseLength,we+=F.phraseLength,F.state===e.NOMATCH){Z=!1;break}Z?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCATBehind"),ke=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];me=oe,ye=0,we=0;let Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me-=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(Z))},"opREPBehind"),ze=o(function(le,oe,F){let Z=f[le];if(F.state=e.NOMATCH,F.phraseLength=0,oe>0){let me=u[oe-1];Z.min<=me&&me<=Z.max&&(F.state=e.MATCH,F.phraseLength=1)}},"opTRGBehind"),Ne=o(function(le,oe,F){let Z,me=f[le];F.state=e.NOMATCH;let ye=me.string.length,we=oe-ye;if(we>=0){for(Z=0;Z<ye;Z+=1)if(u[we+Z]!==me.string[Z])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBSBehind"),We=o(function(le,oe,F){let Z,me=f[le];F.state=e.NOMATCH;let ye=me.string.length;if(ye===0){F.state=e.EMPTY;return}let we=oe-ye;if(we>=0){for(let Ie=0;Ie<ye;Ie+=1)if(Z=u[we+Ie],Z>=65&&Z<=90&&(Z+=32),Z!==me.string[Ie])return;F.state=e.MATCH,F.phraseLength=ye}},"opTLSBehind"),br=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];F.state=e.NOMATCH,F.phraseLength=0,Ie.index<L.length?we=L[Ie.index].lower:we=J[Ie.index-L.length].lower;let Dt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Dt===null)return;let Oe=Dt.phraseIndex,Lt=Dt.phraseLength;if(Lt===0){F.state=e.EMPTY,F.phraseLength=0;return}let Ge=oe-Lt;if(Ge>=0){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[Ge+Z],ye=u[Oe+Z],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}else for(Z=0;Z<Lt;Z+=1)if(me=u[Ge+Z],ye=u[Oe+Z],me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}},"opBKRBehind");s=o(function(oe,F,Z){let me=!0,ye=f[oe];if(I+=1,I>G)throw new Error(`parser: maximum number of node hits exceeded: ${G}`);if(O+=1,O>R&&(R=O,R>ie))throw new Error(`parser: maximum parse tree depth exceeded: ${ie}`);if(Z.refresh(),i.trace!==null){let we=x();i.trace.down(ye,Z.state,F,Z.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(oe,F,Z);break;case e.CAT:pe(oe,F,Z);break;case e.REP:ke(oe,F,Z);break;case e.RNM:se(oe,F,Z);break;case e.UDT:z(oe,F,Z);break;case e.AND:V(oe,F,Z);break;case e.NOT:te(oe,F,Z);break;case e.TRG:ze(oe,F,Z);break;case e.TBS:Ne(oe,F,Z);break;case e.TLS:We(oe,F,Z);break;case e.BKR:br(oe,F,Z);break;case e.BKA:ve(oe,F,Z);break;case e.BKN:W(oe,F,Z);break;case e.ABG:ne(oe,F,Z);break;case e.AEN:Me(oe,F,Z);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(oe,F,Z);break;case e.CAT:fe(oe,F,Z);break;case e.REP:D(oe,F,Z);break;case e.RNM:se(oe,F,Z);break;case e.UDT:z(oe,F,Z);break;case e.AND:V(oe,F,Z);break;case e.NOT:te(oe,F,Z);break;case e.TRG:ae(oe,F,Z);break;case e.TBS:Ae(oe,F,Z);break;case e.TLS:ge(oe,F,Z);break;case e.BKR:ue(oe,F,Z);break;case e.BKA:ve(oe,F,Z);break;case e.BKN:W(oe,F,Z);break;case e.ABG:ne(oe,F,Z);break;case e.AEN:Me(oe,F,Z);break;default:me=!1;break}if(!b()&&F+Z.phraseLength>Y&&(Y=F+Z.phraseLength),i.stats!==null&&i.stats.collect(ye,Z),i.trace!==null){let we=x();i.trace.up(ye,Z.state,F,Z.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var y5=Re((pW,v5)=>{v5.exports=o(function(){let e=Wi(),t=ef(),n=Xu(),i="stats.js: ",s=[],f=[],u=[],d,g=[],y=[];this.statsObject="statsObject";let E="stats",O=o(function(G,$){return G.lower<$.lower?-1:G.lower>$.lower?1:0},"sortAlpha"),R=o(function(G,$){return G.total<$.total?1:G.total>$.total?-1:O(G,$)},"sortHits"),I=o(function(G,$){return G.index<$.index?-1:G.index>$.index?1:0},"sortIndex"),N=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),X=o(function(){u.length=0,d=new N,u[e.ALT]=new N,u[e.CAT]=new N,u[e.REP]=new N,u[e.RNM]=new N,u[e.TRG]=new N,u[e.TBS]=new N,u[e.TLS]=new N,u[e.UDT]=new N,u[e.AND]=new N,u[e.NOT]=new N,u[e.BKR]=new N,u[e.BKA]=new N,u[e.BKN]=new N,u[e.ABG]=new N,u[e.AEN]=new N,g.length=0;for(let G=0;G<s.length;G+=1)g.push({empty:0,match:0,nomatch:0,total:0,name:s[G].name,lower:s[G].lower,index:s[G].index});if(f.length>0){y.length=0;for(let G=0;G<f.length;G+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:f[G].name,lower:f[G].lower,index:f[G].index})}},"clear"),L=o(function(G,$){switch(G.total+=1,$){case e.EMPTY:G.empty+=1;break;case e.MATCH:G.match+=1;break;case e.NOMATCH:G.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${$}`)}},"incStat"),J=o(function(G,$){let K="";return K+="<tr>",K+=`<td class="${n.CLASS_ACTIVE}">${G}</td>`,K+=`<td class="${n.CLASS_EMPTY}">${$.empty}</td>`,K+=`<td class="${n.CLASS_MATCH}">${$.match}</td>`,K+=`<td class="${n.CLASS_NOMATCH}">${$.nomatch}</td>`,K+=`<td class="${n.CLASS_ACTIVE}">${$.total}</td>`,K+=`</tr>
291
+ `,J},"toSml"),this.phrases=o(function(){let P={},X,B;for(X=0;X<O.length;X+=1)B=O[X],B.state===e.SEM_PRE&&(Array.isArray(P[B.name])||(P[B.name]=[]),P[B.name].push({index:B.phraseIndex,length:B.phraseLength}));return P},"phrases")},"exportsAst")});var Ob=Re((hW,m5)=>{m5.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 f=0;f<=t;f+=1)s(f,f);return}for(let f=t-n+1;f<=t;f+=1){let u=(f+n)%n;s(u,f)}}},"forEach")},"exportsCircularBuffer")});var g5=Re((dW,b5)=>{b5.exports=o(function(){let e=Wi(),t=ef(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let f=null,u=null,d,g,y,E,O=0,R=0,I=0,P=null,X=null,B=null,J=null,ee=null,Y=0,ie=1/0,G=1/0,$=o(function(oe,F,Z){let me=`${n}evaluateRule(): `;if(oe>=B.length)throw new Error(`${me}rule index: ${oe} out of range`);if(F>=y)throw new Error(`${me}phrase index: ${F} out of range`);let{length:ye}=f;f.push({type:e.RNM,index:oe}),s(ye,F,Z),f.pop()},"evaluateRule"),K=o(function(le,oe,F){let Z=`${n}evaluateUdt(): `;if(le>=J.length)throw new Error(`${Z}udt index: ${le} out of range`);if(oe>=y)throw new Error(`${Z}phrase index: ${oe} out of range`);let{length:me}=f;f.push({type:e.UDT,empty:J[le].empty,index:le}),s(me,oe,F),f.pop()},"evaluateUdt"),he=o(function(){O=0,R=0,I=0,Y=0,E=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],B=null,J=null,u=null,d=0,g=0,y=0,P=null,X=null,ee=null,f=null},"clear"),C=o(function(){let le=[],oe=o(function(){let Z={};B.forEach(me=>{me.isBkr&&(Z[me.lower]=null)}),J.length>0&&J.forEach(me=>{me.isBkr&&(Z[me.lower]=null)}),le.push(Z)},"init"),F=o(function(){let Z=le[le.length-1],me={};for(let ye in Z)me[ye]=Z[ye];return me},"copy");this.push=o(function(){le.push(F())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=le.length-1),ye<1||ye>le.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return le.length=ye,le[le.length-1]},"pop"),this.length=o(function(){return le.length},"length"),this.savePhrase=o(function(me,ye,we){le[le.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(Z){return le[le.length-1][Z]},oe()},"backRef"),h=o(function(){let oe=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=E[E.length-1],this.uFrame=new C,this.pFrame=new C,this.evaluateRule=$,this.evaluateUdt=K,this.refresh=o(function(){oe.state=e.ACTIVE,oe.phraseLength=0,oe.lookAround=E[E.length-1]},"refresh")},"systemData"),x=o(function(){return E[E.length-1]},"lookAroundValue"),b=o(function(){return E.length>1},"inLookAround"),l=o(function(){return E[E.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),m=o(function(){let le=`${n}initializeAst(): `,oe=!0;for(;oe;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${le}ast object not recognized`);break}i.ast!==null&&i.ast.init(B,J,u)},"initializeAst"),_=o(function(){let le=`${n}initializeTrace(): `,oe=!0;for(;oe;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${le}trace object not recognized`);break}i.trace!==null&&i.trace.init(B,J,u)},"initializeTrace"),S=o(function(){let le=`${n}initializeStats(): `,oe=!0;for(;oe;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${le}stats object not recognized`);break}i.stats!==null&&i.stats.init(B,J)},"initializeStats"),A=o(function(le){let oe=`${n}initializeGrammar(): `;if(!le)throw new Error(`${oe}grammar object undefined`);if(le.grammarObject!=="grammarObject")throw new Error(`${oe}bad grammar object`);B=le.rules,J=le.udts},"initializeGrammar"),v=o(function(le){let oe=`${n}initializeStartRule(): `,F=null;if(typeof le=="number"){if(le>=B.length)throw new Error(`${oe}start rule index too large: max: ${B.length}: index: ${le}`);F=le}else if(typeof le=="string"){let Z=le.toLowerCase();for(let me=0;me<B.length;me+=1)if(Z===B[me].lower){F=B[me].index;break}if(F===null)throw new Error(`${oe}start rule name '${le}' not recognized`)}else throw new Error(`${oe}type of start rule '${typeof le}' not recognized`);return F},"initializeStartRule"),T=o(function(oe,F,Z){let me=`${n}initializeInputChars(): `,ye=oe,we=F,Ie=Z;if(ye===void 0)throw new Error(`${me}input string is undefined`);if(ye===null)throw new Error(`${me}input string is null`);if(typeof ye=="string")ye=t.stringToChars(ye);else if(!Array.isArray(ye))throw new Error(`${me}input string is not a string or array`);if(ye.length>0&&typeof ye[0]!="number")throw new Error(`${me}input string not an array of integers`);if(typeof we!="number")we=0;else if(we=Math.floor(we),we<0||we>ye.length)throw new Error(`${me}input beginning index out of range: ${we}`);if(typeof Ie!="number")Ie=ye.length-we;else if(Ie=Math.floor(Ie),Ie<0||Ie>ye.length-we)throw new Error(`${me}input length out of range: ${Ie}`);u=ye,d=we,g=Ie,y=d+g},"initializeInputChars"),L=o(function(){let le=`${n}initializeCallbacks(): `,oe;for(P=[],X=[],oe=0;oe<B.length;oe+=1)P[oe]=null;for(oe=0;oe<J.length;oe+=1)X[oe]=null;let F,Z=[];for(oe=0;oe<B.length;oe+=1)Z.push(B[oe].lower);for(oe=0;oe<J.length;oe+=1)Z.push(J[oe].lower);for(let me in i.callbacks){if(oe=Z.indexOf(me.toLowerCase()),oe<0)throw new Error(`${le}syntax callback '${me}' not a rule or udt name`);if(F=i.callbacks[me],F||(F=null),typeof F=="function"||F===null)oe<B.length?P[oe]=F:X[oe-B.length]=F;else throw new Error(`${le}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(oe=0;oe<J.length;oe+=1)if(X[oe]===null)throw new Error(`${le}all UDT callbacks must be defined. UDT callback[${J[oe].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(le){if(typeof le!="number")throw new Error(`parser: max tree depth must be integer > 0: ${le}`);if(ie=Math.floor(le),ie<=0)throw new Error(`parser: max tree depth must be integer > 0: ${le}`)},this.setMaxNodeHits=function(le){if(typeof le!="number")throw new Error(`parser: max node hits must be integer > 0: ${le}`);if(G=Math.floor(le),G<=0)throw new Error(`parser: max node hits must be integer > 0: ${le}`)};let w=o(function(le,oe,F){let Z,me=`${n}parse(): `;A(le);let ye=v(oe);L(),_(),S(),m();let we=new h;switch(F!=null&&(ee=F),f=[{type:e.RNM,index:ye}],s(0,d,we),f=null,we.state){case e.ACTIVE:throw new Error(`${me}final state should never be 'ACTIVE'`);case e.NOMATCH:Z=!1;break;case e.EMPTY:case e.MATCH:we.phraseLength===g?Z=!0:Z=!1;break;default:throw new Error("unrecognized state")}return{success:Z,state:we.state,length:g,matched:we.phraseLength,maxMatched:Y,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:y,subLength:g}},"privateParse");this.parseSubstring=o(function(oe,F,Z,me,ye,we){return he(),T(Z,me,ye),w(oe,F,we)},"parseSubstring"),this.parse=o(function(oe,F,Z,me){return he(),T(Z,0,Z.length),w(oe,F,me)},"parse");let k=o(function(le,oe,F){let Z=f[le];for(let me=0;me<Z.children.length&&(s(Z.children[me],oe,F),F.state===e.NOMATCH);me+=1);},"opALT"),fe=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le],Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Oe=0;Oe<Ie.children.length;Oe+=1)if(s(Ie.children[Oe],ye,F),F.state===e.NOMATCH){Z=!1;break}else ye+=F.phraseLength,we+=F.phraseLength;Z?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCAT"),D=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];if(Ie.max===0){F.state=e.EMPTY,F.phraseLength=0;return}me=oe,ye=0,we=0;let Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=y||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me+=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(Z))},"opREP"),Q=o(function(le,oe,F,Z){if(oe.phraseLength>F){let me=`${n}opRNM(${le.name}): callback function error: `;throw me+=`sysData.phraseLength: ${oe.phraseLength}`,me+=` must be <= remaining chars: ${F}`,new Error(me)}switch(oe.state){case e.ACTIVE:if(Z!==!0)throw new Error(`${n}opRNM(${le.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:oe.phraseLength=0;break;case e.MATCH:oe.phraseLength===0&&(oe.state=e.EMPTY);break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opRNM(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateRnmCallbackResult"),se=o(function(le,oe,F){let Z,me,ye,we,Ie,Dt,Fe=f[le],Oe=B[Fe.index],Lt=P[Oe.index],Ge=!b();if(Ge&&(me=i.ast&&i.ast.ruleDefined(Fe.index),me&&(Z=i.ast.getLength(),i.ast.down(Fe.index,B[Fe.index].name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Dt=F.pFrame,F.pFrame=new C),Lt===null)ye=f,f=Oe.opcodes,s(0,oe,F),f=ye;else{let Ye=y-oe;F.ruleIndex=Oe.index,Lt(F,u,oe,ee),Q(Oe,F,Ye,!0),F.state===e.ACTIVE&&(ye=f,f=Oe.opcodes,s(0,oe,F),f=ye,F.ruleIndex=Oe.index,Lt(F,u,oe,ee),Q(Oe,F,Ye,!1))}Ge&&(me&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(Fe.index,Oe.name,oe,F.phraseLength)),F.pFrame=Dt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Oe.isBkr&&(F.pFrame.savePhrase(Oe.lower,oe,F.phraseLength),F.uFrame.savePhrase(Oe.lower,oe,F.phraseLength)))},"opRNM"),H=o(function(le,oe,F){if(oe.phraseLength>F){let Z=`${n}opUDT(${le.name}): callback function error: `;throw Z+=`sysData.phraseLength: ${oe.phraseLength}`,Z+=` must be <= remaining chars: ${F}`,new Error(Z)}switch(oe.state){case e.ACTIVE:throw new Error(`${n}opUDT(${le.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.phraseLength=0;break;case e.MATCH:if(oe.phraseLength===0){if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.state=e.EMPTY}break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opUDT(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateUdtCallbackResult"),z=o(function(le,oe,F){let Z,me,ye,we,Ie,Dt,Fe=f[le],Oe=J[Fe.index];F.UdtIndex=Oe.index;let Lt=!b();Lt&&(ye=i.ast&&i.ast.udtDefined(Fe.index),ye&&(me=B.length+Fe.index,Z=i.ast.getLength(),i.ast.down(me,Oe.name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Dt=F.pFrame,F.pFrame=new C);let Ge=y-oe;X[Fe.index](F,u,oe,ee),H(Oe,F,Ge),Lt&&(ye&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(me,Oe.name,oe,F.phraseLength)),F.pFrame=Dt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Oe.isBkr&&(F.pFrame.savePhrase(Oe.lower,oe,F.phraseLength),F.uFrame.savePhrase(Oe.lower,oe,F.phraseLength)))},"opUDT"),V=o(function(le,oe,F){E.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:y,charsLength:g}),y=u.length,g=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(y=Z.charsEnd,g=Z.charsLength,F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${F.state}`)}},"opAND"),te=o(function(le,oe,F){E.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:y,charsLength:g}),y=u.length,g=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(y=Z.charsEnd,g=Z.charsLength,F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${F.state}`)}},"opNOT"),ae=o(function(le,oe,F){let Z=f[le];F.state=e.NOMATCH,oe<y&&Z.min<=u[oe]&&u[oe]<=Z.max&&(F.state=e.MATCH,F.phraseLength=1)},"opTRG"),Ae=o(function(le,oe,F){let Z,me=f[le],ye=me.string.length;if(F.state=e.NOMATCH,oe+ye<=y){for(Z=0;Z<ye;Z+=1)if(u[oe+Z]!==me.string[Z])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBS"),ge=o(function(le,oe,F){let Z,me,ye=f[le];F.state=e.NOMATCH;let we=ye.string.length;if(we===0){F.state=e.EMPTY;return}if(oe+we<=y){for(Z=0;Z<we;Z+=1)if(me=u[oe+Z],me>=65&&me<=90&&(me+=32),me!==ye.string[Z])return;F.state=e.MATCH,F.phraseLength=we}},"opTLS"),ne=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===0?e.EMPTY:e.NOMATCH},"opABG"),Me=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ue=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];F.state=e.NOMATCH,Ie.index<B.length?we=B[Ie.index].lower:we=J[Ie.index-B.length].lower;let Dt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Dt===null)return;let Oe=Dt.phraseIndex,Lt=Dt.phraseLength;if(Lt===0){F.state=e.EMPTY;return}if(oe+Lt<=y){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[oe+Z],ye=u[Oe+Z],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}else for(Z=0;Z<Lt;Z+=1)if(me=u[oe+Z],ye=u[Oe+Z],me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}},"opBKR"),ve=o(function(le,oe,F){switch(E.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),E.pop(),F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${F.state}`)}},"opBKA"),W=o(function(le,oe,F){switch(E.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),E.pop(),F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${F.state}`)}},"opBKN"),pe=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le],Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Oe=Ie.children.length-1;Oe>=0;Oe-=1)if(s(Ie.children[Oe],ye,F),ye-=F.phraseLength,we+=F.phraseLength,F.state===e.NOMATCH){Z=!1;break}Z?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCATBehind"),ke=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];me=oe,ye=0,we=0;let Dt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me-=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Dt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(Z))},"opREPBehind"),ze=o(function(le,oe,F){let Z=f[le];if(F.state=e.NOMATCH,F.phraseLength=0,oe>0){let me=u[oe-1];Z.min<=me&&me<=Z.max&&(F.state=e.MATCH,F.phraseLength=1)}},"opTRGBehind"),Ne=o(function(le,oe,F){let Z,me=f[le];F.state=e.NOMATCH;let ye=me.string.length,we=oe-ye;if(we>=0){for(Z=0;Z<ye;Z+=1)if(u[we+Z]!==me.string[Z])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBSBehind"),We=o(function(le,oe,F){let Z,me=f[le];F.state=e.NOMATCH;let ye=me.string.length;if(ye===0){F.state=e.EMPTY;return}let we=oe-ye;if(we>=0){for(let Ie=0;Ie<ye;Ie+=1)if(Z=u[we+Ie],Z>=65&&Z<=90&&(Z+=32),Z!==me.string[Ie])return;F.state=e.MATCH,F.phraseLength=ye}},"opTLSBehind"),br=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];F.state=e.NOMATCH,F.phraseLength=0,Ie.index<B.length?we=B[Ie.index].lower:we=J[Ie.index-B.length].lower;let Dt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Dt===null)return;let Oe=Dt.phraseIndex,Lt=Dt.phraseLength;if(Lt===0){F.state=e.EMPTY,F.phraseLength=0;return}let Ge=oe-Lt;if(Ge>=0){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[Ge+Z],ye=u[Oe+Z],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}else for(Z=0;Z<Lt;Z+=1)if(me=u[Ge+Z],ye=u[Oe+Z],me!==ye)return;F.state=e.MATCH,F.phraseLength=Lt}},"opBKRBehind");s=o(function(oe,F,Z){let me=!0,ye=f[oe];if(I+=1,I>G)throw new Error(`parser: maximum number of node hits exceeded: ${G}`);if(O+=1,O>R&&(R=O,R>ie))throw new Error(`parser: maximum parse tree depth exceeded: ${ie}`);if(Z.refresh(),i.trace!==null){let we=x();i.trace.down(ye,Z.state,F,Z.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(oe,F,Z);break;case e.CAT:pe(oe,F,Z);break;case e.REP:ke(oe,F,Z);break;case e.RNM:se(oe,F,Z);break;case e.UDT:z(oe,F,Z);break;case e.AND:V(oe,F,Z);break;case e.NOT:te(oe,F,Z);break;case e.TRG:ze(oe,F,Z);break;case e.TBS:Ne(oe,F,Z);break;case e.TLS:We(oe,F,Z);break;case e.BKR:br(oe,F,Z);break;case e.BKA:ve(oe,F,Z);break;case e.BKN:W(oe,F,Z);break;case e.ABG:ne(oe,F,Z);break;case e.AEN:Me(oe,F,Z);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(oe,F,Z);break;case e.CAT:fe(oe,F,Z);break;case e.REP:D(oe,F,Z);break;case e.RNM:se(oe,F,Z);break;case e.UDT:z(oe,F,Z);break;case e.AND:V(oe,F,Z);break;case e.NOT:te(oe,F,Z);break;case e.TRG:ae(oe,F,Z);break;case e.TBS:Ae(oe,F,Z);break;case e.TLS:ge(oe,F,Z);break;case e.BKR:ue(oe,F,Z);break;case e.BKA:ve(oe,F,Z);break;case e.BKN:W(oe,F,Z);break;case e.ABG:ne(oe,F,Z);break;case e.AEN:Me(oe,F,Z);break;default:me=!1;break}if(!b()&&F+Z.phraseLength>Y&&(Y=F+Z.phraseLength),i.stats!==null&&i.stats.collect(ye,Z),i.trace!==null){let we=x();i.trace.up(ye,Z.state,F,Z.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var y5=Re((pW,v5)=>{v5.exports=o(function(){let e=Wi(),t=ef(),n=Xu(),i="stats.js: ",s=[],f=[],u=[],d,g=[],y=[];this.statsObject="statsObject";let E="stats",O=o(function(G,$){return G.lower<$.lower?-1:G.lower>$.lower?1:0},"sortAlpha"),R=o(function(G,$){return G.total<$.total?1:G.total>$.total?-1:O(G,$)},"sortHits"),I=o(function(G,$){return G.index<$.index?-1:G.index>$.index?1:0},"sortIndex"),P=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),X=o(function(){u.length=0,d=new P,u[e.ALT]=new P,u[e.CAT]=new P,u[e.REP]=new P,u[e.RNM]=new P,u[e.TRG]=new P,u[e.TBS]=new P,u[e.TLS]=new P,u[e.UDT]=new P,u[e.AND]=new P,u[e.NOT]=new P,u[e.BKR]=new P,u[e.BKA]=new P,u[e.BKN]=new P,u[e.ABG]=new P,u[e.AEN]=new P,g.length=0;for(let G=0;G<s.length;G+=1)g.push({empty:0,match:0,nomatch:0,total:0,name:s[G].name,lower:s[G].lower,index:s[G].index});if(f.length>0){y.length=0;for(let G=0;G<f.length;G+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:f[G].name,lower:f[G].lower,index:f[G].index})}},"clear"),B=o(function(G,$){switch(G.total+=1,$){case e.EMPTY:G.empty+=1;break;case e.MATCH:G.match+=1;break;case e.NOMATCH:G.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${$}`)}},"incStat"),J=o(function(G,$){let K="";return K+="<tr>",K+=`<td class="${n.CLASS_ACTIVE}">${G}</td>`,K+=`<td class="${n.CLASS_EMPTY}">${$.empty}</td>`,K+=`<td class="${n.CLASS_MATCH}">${$.match}</td>`,K+=`<td class="${n.CLASS_NOMATCH}">${$.nomatch}</td>`,K+=`<td class="${n.CLASS_ACTIVE}">${$.total}</td>`,K+=`</tr>
292
292
  `,K},"displayRow"),ee=o(function(){let G="";return G+=J("ALT",u[e.ALT]),G+=J("CAT",u[e.CAT]),G+=J("REP",u[e.REP]),G+=J("RNM",u[e.RNM]),G+=J("TRG",u[e.TRG]),G+=J("TBS",u[e.TBS]),G+=J("TLS",u[e.TLS]),G+=J("UDT",u[e.UDT]),G+=J("AND",u[e.AND]),G+=J("NOT",u[e.NOT]),G+=J("BKR",u[e.BKR]),G+=J("BKA",u[e.BKA]),G+=J("BKN",u[e.BKN]),G+=J("ABG",u[e.ABG]),G+=J("AEN",u[e.AEN]),G+=J("totals",d),G},"displayOpsOnly"),Y=o(function(){let G="";G+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
293
293
  `,G+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
294
294
  `;for(let $=0;$<s.length;$+=1)g[$].total>0&&(G+="<tr>",G+=`<td class="${n.CLASS_ACTIVE}">${g[$].name}</td>`,G+=`<td class="${n.CLASS_EMPTY}">${g[$].empty}</td>`,G+=`<td class="${n.CLASS_MATCH}">${g[$].match}</td>`,G+=`<td class="${n.CLASS_NOMATCH}">${g[$].nomatch}</td>`,G+=`<td class="${n.CLASS_ACTIVE}">${g[$].total}</td>`,G+=`</tr>
295
295
  `);if(f.length>0){G+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
296
296
  `,G+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
297
297
  `;for(let $=0;$<f.length;$+=1)y[$].total>0&&(G+="<tr>",G+=`<td class="${n.CLASS_ACTIVE}">${y[$].name}</td>`,G+=`<td class="${n.CLASS_EMPTY}">${y[$].empty}</td>`,G+=`<td class="${n.CLASS_MATCH}">${y[$].match}</td>`,G+=`<td class="${n.CLASS_NOMATCH}">${y[$].nomatch}</td>`,G+=`<td class="${n.CLASS_ACTIVE}">${y[$].total}</td>`,G+=`</tr>
298
- `)}return G},"displayRules");this.validate=o(function(G){let $=!1;return typeof G=="string"&&E===G&&($=!0),$},"validate"),this.init=o(function(G,$){s=G,f=$,X()},"init"),this.collect=o(function(G,$){L(d,$.state,$.phraseLength),L(u[G.type],$.state,$.phraseLength),G.type===e.RNM&&L(g[G.index],$.state,$.phraseLength),G.type===e.UDT&&L(y[G.index],$.state,$.phraseLength)},"collect"),this.toHtml=o(function(G,$){let K="";K+=`<table class="${n.CLASS_STATS}">
298
+ `)}return G},"displayRules");this.validate=o(function(G){let $=!1;return typeof G=="string"&&E===G&&($=!0),$},"validate"),this.init=o(function(G,$){s=G,f=$,X()},"init"),this.collect=o(function(G,$){B(d,$.state,$.phraseLength),B(u[G.type],$.state,$.phraseLength),G.type===e.RNM&&B(g[G.index],$.state,$.phraseLength),G.type===e.UDT&&B(y[G.index],$.state,$.phraseLength)},"collect"),this.toHtml=o(function(G,$){let K="";K+=`<table class="${n.CLASS_STATS}">
299
299
  `,typeof $=="string"&&(K+=`<caption>${$}</caption>
300
300
  `),K+=`<tr><th class="${n.CLASS_ACTIVE}">ops</th>
301
301
  `,K+=`<th class="${n.CLASS_EMPTY}">EMPTY</th>
@@ -303,7 +303,7 @@ table.apg-attrs a:hover {
303
303
  `,K+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
304
304
  `,K+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
305
305
  `;let he=!0;for(;he;){if(G===void 0){K+=ee();break}if(G===null){K+=ee();break}if(G==="ops"){K+=ee();break}if(G==="index"){g.sort(I),y.length>0&&y.sort(I),K+=ee(),K+=Y();break}if(G==="hits"){g.sort(R),y.length>0&&y.sort(I),K+=ee(),K+=Y();break}if(G==="alpha"){g.sort(O),y.length>0&&y.sort(O),K+=ee(),K+=Y();break}break}return K+=`</table>
306
- `,K},"toHtml"),this.toHtmlPage=o(function(G,$,K){return t.htmlToPage(this.toHtml(G,$),K)},"toHtmlPage")},"statsFunc")});var w5=Re((mW,x5)=>{x5.exports=o(function(){let e=ef(),t=Xu(),n=new(Ob()),i=Wi(),s="trace.js: ",f=this,u=16,d=10,g=8,y=32,E=80,O=5,R=[],I=5e3,N=-1,X=0,L=0,J=[],ee=null,Y=null,ie=null,G=[],$=[],K=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,he=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,C=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let H=o(function(V){G[i.ALT]=V,G[i.CAT]=V,G[i.REP]=V,G[i.TLS]=V,G[i.TBS]=V,G[i.TRG]=V,G[i.AND]=V,G[i.NOT]=V,G[i.BKR]=V,G[i.BKA]=V,G[i.BKN]=V,G[i.ABG]=V,G[i.AEN]=V},"setOperators"),z=0;for(let V in f.filter.operators)z+=1;if(z===0){H(!1);return}for(let V in f.filter.operators){let te=V.toUpperCase();if(te==="<ALL>"){H(!0);return}if(te==="<NONE>"){H(!1);return}}H(!1);for(let V in f.filter.operators){let te=V.toUpperCase();if(te==="ALT")G[i.ALT]=f.filter.operators[V]===!0;else if(te==="CAT")G[i.CAT]=f.filter.operators[V]===!0;else if(te==="REP")G[i.REP]=f.filter.operators[V]===!0;else if(te==="AND")G[i.AND]=f.filter.operators[V]===!0;else if(te==="NOT")G[i.NOT]=f.filter.operators[V]===!0;else if(te==="TLS")G[i.TLS]=f.filter.operators[V]===!0;else if(te==="TBS")G[i.TBS]=f.filter.operators[V]===!0;else if(te==="TRG")G[i.TRG]=f.filter.operators[V]===!0;else if(te==="BKR")G[i.BKR]=f.filter.operators[V]===!0;else if(te==="BKA")G[i.BKA]=f.filter.operators[V]===!0;else if(te==="BKN")G[i.BKN]=f.filter.operators[V]===!0;else if(te==="ABG")G[i.ABG]=f.filter.operators[V]===!0;else if(te==="AEN")G[i.AEN]=f.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"),x=o(function(){let H=o(function(ae){G[i.RNM]=ae,G[i.UDT]=ae;let Ae=Y.length+ie.length;$.length=0;for(let ge=0;ge<Ae;ge+=1)$.push(ae)},"setRules"),z,V,te=[];for(V=0;V<Y.length;V+=1)te.push(Y[V].lower);for(V=0;V<ie.length;V+=1)te.push(ie[V].lower);$.length=0,z=0;for(let ae in f.filter.rules)z+=1;if(z===0){H(!0);return}for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){H(!0);return}if(Ae==="<none>"){H(!1);return}}H(!1),G[i.RNM]=!0,G[i.UDT]=!0;for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(V=te.indexOf(Ae),V<0)throw new Error(`${s}initRuleFilter: '${ae}' not a valid rule or udt name`);$[V]=f.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(H,z){if(N=-1,typeof H=="number"&&H>0)I=Math.ceil(H);else{I=0;return}typeof z=="number"&&(N=Math.floor(z),N<0&&(N=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return N},this.init=function(H,z,V){R.length=0,J.length=0,X=0,L=0,ee=V,Y=H,ie=z,h(),x(),n.init(I)};let b=o(function(H){let z=!1;return H.type===i.RNM?G[H.type]&&$[H.index]?z=!0:z=!1:H.type===i.UDT?G[H.type]&&$[Y.length+H.index]?z=!0:z=!1:z=G[H.type],z},"filterOps"),l=o(function(H){return N===-1||H<=N},"filterRecords");this.down=function(H,z,V,te,ae,Ae){l(X)&&b(H)&&(J.push(X),R[n.increment()]={dirUp:!1,depth:L,thisLine:X,thatLine:void 0,opcode:H,state:z,phraseIndex:V,phraseLength:te,lookAnchor:ae,lookAround:Ae},X+=1,L+=1)},this.up=function(H,z,V,te,ae,Ae){if(l(X)&&b(H)){let ge=X,ne=J.pop(),Me=n.getListIndex(ne);Me!==-1&&(R[Me].thatLine=ge),L-=1,R[n.increment()]={dirUp:!0,depth:L,thisLine:ge,thatLine:ne,opcode:H,state:z,phraseIndex:V,phraseLength:te,lookAnchor:ae,lookAround:Ae},X+=1}};let m=o(function(){function H(F,Z){let me,ye,we;if(Z)switch(F.op={id:Z.type,name:e.opcodeToString(Z.type)},F.opData=void 0,Z.type){case i.RNM:F.opData=Y[Z.index].name;break;case i.UDT:F.opData=ie[Z.index].name;break;case i.BKR:Z.index<Y.length?me=Y[Z.index].name:me=ie[Z.index-Y.length].name,ye=Z.bkrCase===i.BKR_MODE_CI?"%i":"%s",we=Z.bkrMode===i.BKR_MODE_UM?"%u":"%p",F.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:F.opData=[];for(let Ie=0;Ie<Z.string.length;Ie+=1)F.opData.push(Z.string[Ie]);break;case i.TBS:F.opData=[];for(let Ie=0;Ie<Z.string.length;Ie+=1)F.opData.push(Z.string[Ie]);break;case i.TRG:F.opData=[Z.min,Z.max];break;case i.REP:F.opData=[Z.min,Z.max];break;default:throw new Error("unrecognized opcode")}else F.op={id:void 0,name:void 0},F.opData=void 0}o(H,"nodeOpcode");function z(F,Z,me){return F===i.MATCH?{index:Z,length:me}:F===i.NOMATCH?{index:Z,length:0}:F===i.EMPTY?{index:Z,length:0}:null}o(z,"nodePhrase");let V=-1;function te(F,Z,me){let ye={id:V++,branch:-1,parent:F,up:!1,down:!1,depth:me,children:[]};return Z?(ye.down=!0,ye.state={id:Z.state,name:e.stateToString(Z.state)},ye.phrase=null,H(ye,Z.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=z(),H(ye,void 0)),ye}o(te,"nodeDown");function ae(F,Z){Z&&(F.up=!0,F.state={id:Z.state,name:e.stateToString(Z.state)},F.phrase=z(Z.state,Z.phraseIndex,Z.phraseLength),F.down||H(F,Z.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,ne=1;function Me(F){if(ge+=1,F.branch=ne,ge>L&&(L=ge),F.children.length===0)Ae+=1;else for(let Z=0;Z<F.children.length;Z+=1)Z>0&&(ne+=1),F.children[Z].leftMost=!1,F.children[Z].rightMost=!1,F.leftMost&&(F.children[Z].leftMost=Z===0),F.rightMost&&(F.children[Z].rightMost=Z===F.children.length-1),Me(F.children[Z]);ge-=1}o(Me,"walk");function ue(F,Z){let me,ye={};if(ye.id=F.id,ye.branch=F.branch,ye.leftMost=F.leftMost,ye.rightMost=F.rightMost,me=F.state.name?F.state.name:"ACTIVE",ye.state={id:F.state.id,name:me},me=F.op.name?F.op.name:"?",ye.op={id:F.op.id,name:me},typeof F.opData=="string")ye.opData=F.opData;else if(Array.isArray(F.opData)){ye.opData=[];for(let we=0;we<F.opData.length;we+=1)ye.opData[we]=F.opData[we]}else ye.opData=void 0;F.phrase?ye.phrase={index:F.phrase.index,length:F.phrase.length}:ye.phrase=null,ye.depth=F.depth,ye.children=[];for(let we=0;we<F.children.length;we+=1){let Ie=we!==F.children.length-1;ye.children[we]=ue(F.children[we],Z,Ie)}return ye}o(ue,"display");let ve=[],W,pe,ke,ze,Ne=!0,We=te(null,null,-1);for(ve.push(We),pe=We,n.forEach(F=>{if(ze=R[F],Ne&&(Ne=!1,ze.depth>0)){let Z=ze.dirUp?ze.depth+1:ze.depth;for(let me=0;me<Z;me+=1)ke=pe,pe=te(pe,null,me),ve.push(pe),ke.children.push(pe)}ze.dirUp?(pe=ve.pop(),ae(pe,ze),pe=ve[ve.length-1]):(ke=pe,pe=te(pe,ze,ze.depth),ve.push(pe),ke.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(We.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ve.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");W=We.children[0];let br=W;for(;W&&!W.down&&!W.up;)br=W,W=W.children[0];W=br,W.leftMost=!0,W.rightMost=!0,Me(W),W.branch=0;let le={};le.string=[];for(let F=0;F<ee.length;F+=1)le.string[F]=ee[F];le.rules=[];for(let F=0;F<Y.length;F+=1)le.rules[F]=Y[F].name;le.udts=[];for(let F=0;F<ie.length;F+=1)le.udts[F]=ie[F].name;le.id={},le.id.ALT={id:i.ALT,name:"ALT"},le.id.CAT={id:i.CAT,name:"CAT"},le.id.REP={id:i.REP,name:"REP"},le.id.RNM={id:i.RNM,name:"RNM"},le.id.TLS={id:i.TLS,name:"TLS"},le.id.TBS={id:i.TBS,name:"TBS"},le.id.TRG={id:i.TRG,name:"TRG"},le.id.UDT={id:i.UDT,name:"UDT"},le.id.AND={id:i.AND,name:"AND"},le.id.NOT={id:i.NOT,name:"NOT"},le.id.BKR={id:i.BKR,name:"BKR"},le.id.BKA={id:i.BKA,name:"BKA"},le.id.BKN={id:i.BKN,name:"BKN"},le.id.ABG={id:i.ABG,name:"ABG"},le.id.AEN={id:i.AEN,name:"AEN"},le.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},le.id.MATCH={id:i.MATCH,name:"MATCH"},le.id.EMPTY={id:i.EMPTY,name:"EMPTY"},le.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},le.treeDepth=L,le.leafNodes=Ae;let oe;return W.down?W.up?oe="none":oe="right":W.up?oe="left":oe="both",le.branchesIncomplete=oe,le.tree=ue(W,W.depth,!1),le},"toTreeObj");this.toTree=function(H){let z=m();return H?JSON.stringify(z):z},this.toHtmlPage=function(H,z,V){return e.htmlToPage(this.toHtml(H,z),V)};let _=o(function(H,z){let V;switch(H){case u:V="hexadecimal";break;case d:V="decimal";break;case g:V="ASCII";break;case y:V="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${H}`)}let te="";return te+=`<p>display mode: ${V}</p>
306
+ `,K},"toHtml"),this.toHtmlPage=o(function(G,$,K){return t.htmlToPage(this.toHtml(G,$),K)},"toHtmlPage")},"statsFunc")});var w5=Re((mW,x5)=>{x5.exports=o(function(){let e=ef(),t=Xu(),n=new(Ob()),i=Wi(),s="trace.js: ",f=this,u=16,d=10,g=8,y=32,E=80,O=5,R=[],I=5e3,P=-1,X=0,B=0,J=[],ee=null,Y=null,ie=null,G=[],$=[],K=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,he=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,C=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let H=o(function(V){G[i.ALT]=V,G[i.CAT]=V,G[i.REP]=V,G[i.TLS]=V,G[i.TBS]=V,G[i.TRG]=V,G[i.AND]=V,G[i.NOT]=V,G[i.BKR]=V,G[i.BKA]=V,G[i.BKN]=V,G[i.ABG]=V,G[i.AEN]=V},"setOperators"),z=0;for(let V in f.filter.operators)z+=1;if(z===0){H(!1);return}for(let V in f.filter.operators){let te=V.toUpperCase();if(te==="<ALL>"){H(!0);return}if(te==="<NONE>"){H(!1);return}}H(!1);for(let V in f.filter.operators){let te=V.toUpperCase();if(te==="ALT")G[i.ALT]=f.filter.operators[V]===!0;else if(te==="CAT")G[i.CAT]=f.filter.operators[V]===!0;else if(te==="REP")G[i.REP]=f.filter.operators[V]===!0;else if(te==="AND")G[i.AND]=f.filter.operators[V]===!0;else if(te==="NOT")G[i.NOT]=f.filter.operators[V]===!0;else if(te==="TLS")G[i.TLS]=f.filter.operators[V]===!0;else if(te==="TBS")G[i.TBS]=f.filter.operators[V]===!0;else if(te==="TRG")G[i.TRG]=f.filter.operators[V]===!0;else if(te==="BKR")G[i.BKR]=f.filter.operators[V]===!0;else if(te==="BKA")G[i.BKA]=f.filter.operators[V]===!0;else if(te==="BKN")G[i.BKN]=f.filter.operators[V]===!0;else if(te==="ABG")G[i.ABG]=f.filter.operators[V]===!0;else if(te==="AEN")G[i.AEN]=f.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"),x=o(function(){let H=o(function(ae){G[i.RNM]=ae,G[i.UDT]=ae;let Ae=Y.length+ie.length;$.length=0;for(let ge=0;ge<Ae;ge+=1)$.push(ae)},"setRules"),z,V,te=[];for(V=0;V<Y.length;V+=1)te.push(Y[V].lower);for(V=0;V<ie.length;V+=1)te.push(ie[V].lower);$.length=0,z=0;for(let ae in f.filter.rules)z+=1;if(z===0){H(!0);return}for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){H(!0);return}if(Ae==="<none>"){H(!1);return}}H(!1),G[i.RNM]=!0,G[i.UDT]=!0;for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(V=te.indexOf(Ae),V<0)throw new Error(`${s}initRuleFilter: '${ae}' not a valid rule or udt name`);$[V]=f.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(H,z){if(P=-1,typeof H=="number"&&H>0)I=Math.ceil(H);else{I=0;return}typeof z=="number"&&(P=Math.floor(z),P<0&&(P=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return P},this.init=function(H,z,V){R.length=0,J.length=0,X=0,B=0,ee=V,Y=H,ie=z,h(),x(),n.init(I)};let b=o(function(H){let z=!1;return H.type===i.RNM?G[H.type]&&$[H.index]?z=!0:z=!1:H.type===i.UDT?G[H.type]&&$[Y.length+H.index]?z=!0:z=!1:z=G[H.type],z},"filterOps"),l=o(function(H){return P===-1||H<=P},"filterRecords");this.down=function(H,z,V,te,ae,Ae){l(X)&&b(H)&&(J.push(X),R[n.increment()]={dirUp:!1,depth:B,thisLine:X,thatLine:void 0,opcode:H,state:z,phraseIndex:V,phraseLength:te,lookAnchor:ae,lookAround:Ae},X+=1,B+=1)},this.up=function(H,z,V,te,ae,Ae){if(l(X)&&b(H)){let ge=X,ne=J.pop(),Me=n.getListIndex(ne);Me!==-1&&(R[Me].thatLine=ge),B-=1,R[n.increment()]={dirUp:!0,depth:B,thisLine:ge,thatLine:ne,opcode:H,state:z,phraseIndex:V,phraseLength:te,lookAnchor:ae,lookAround:Ae},X+=1}};let m=o(function(){function H(F,Z){let me,ye,we;if(Z)switch(F.op={id:Z.type,name:e.opcodeToString(Z.type)},F.opData=void 0,Z.type){case i.RNM:F.opData=Y[Z.index].name;break;case i.UDT:F.opData=ie[Z.index].name;break;case i.BKR:Z.index<Y.length?me=Y[Z.index].name:me=ie[Z.index-Y.length].name,ye=Z.bkrCase===i.BKR_MODE_CI?"%i":"%s",we=Z.bkrMode===i.BKR_MODE_UM?"%u":"%p",F.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:F.opData=[];for(let Ie=0;Ie<Z.string.length;Ie+=1)F.opData.push(Z.string[Ie]);break;case i.TBS:F.opData=[];for(let Ie=0;Ie<Z.string.length;Ie+=1)F.opData.push(Z.string[Ie]);break;case i.TRG:F.opData=[Z.min,Z.max];break;case i.REP:F.opData=[Z.min,Z.max];break;default:throw new Error("unrecognized opcode")}else F.op={id:void 0,name:void 0},F.opData=void 0}o(H,"nodeOpcode");function z(F,Z,me){return F===i.MATCH?{index:Z,length:me}:F===i.NOMATCH?{index:Z,length:0}:F===i.EMPTY?{index:Z,length:0}:null}o(z,"nodePhrase");let V=-1;function te(F,Z,me){let ye={id:V++,branch:-1,parent:F,up:!1,down:!1,depth:me,children:[]};return Z?(ye.down=!0,ye.state={id:Z.state,name:e.stateToString(Z.state)},ye.phrase=null,H(ye,Z.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=z(),H(ye,void 0)),ye}o(te,"nodeDown");function ae(F,Z){Z&&(F.up=!0,F.state={id:Z.state,name:e.stateToString(Z.state)},F.phrase=z(Z.state,Z.phraseIndex,Z.phraseLength),F.down||H(F,Z.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,ne=1;function Me(F){if(ge+=1,F.branch=ne,ge>B&&(B=ge),F.children.length===0)Ae+=1;else for(let Z=0;Z<F.children.length;Z+=1)Z>0&&(ne+=1),F.children[Z].leftMost=!1,F.children[Z].rightMost=!1,F.leftMost&&(F.children[Z].leftMost=Z===0),F.rightMost&&(F.children[Z].rightMost=Z===F.children.length-1),Me(F.children[Z]);ge-=1}o(Me,"walk");function ue(F,Z){let me,ye={};if(ye.id=F.id,ye.branch=F.branch,ye.leftMost=F.leftMost,ye.rightMost=F.rightMost,me=F.state.name?F.state.name:"ACTIVE",ye.state={id:F.state.id,name:me},me=F.op.name?F.op.name:"?",ye.op={id:F.op.id,name:me},typeof F.opData=="string")ye.opData=F.opData;else if(Array.isArray(F.opData)){ye.opData=[];for(let we=0;we<F.opData.length;we+=1)ye.opData[we]=F.opData[we]}else ye.opData=void 0;F.phrase?ye.phrase={index:F.phrase.index,length:F.phrase.length}:ye.phrase=null,ye.depth=F.depth,ye.children=[];for(let we=0;we<F.children.length;we+=1){let Ie=we!==F.children.length-1;ye.children[we]=ue(F.children[we],Z,Ie)}return ye}o(ue,"display");let ve=[],W,pe,ke,ze,Ne=!0,We=te(null,null,-1);for(ve.push(We),pe=We,n.forEach(F=>{if(ze=R[F],Ne&&(Ne=!1,ze.depth>0)){let Z=ze.dirUp?ze.depth+1:ze.depth;for(let me=0;me<Z;me+=1)ke=pe,pe=te(pe,null,me),ve.push(pe),ke.children.push(pe)}ze.dirUp?(pe=ve.pop(),ae(pe,ze),pe=ve[ve.length-1]):(ke=pe,pe=te(pe,ze,ze.depth),ve.push(pe),ke.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(We.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ve.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");W=We.children[0];let br=W;for(;W&&!W.down&&!W.up;)br=W,W=W.children[0];W=br,W.leftMost=!0,W.rightMost=!0,Me(W),W.branch=0;let le={};le.string=[];for(let F=0;F<ee.length;F+=1)le.string[F]=ee[F];le.rules=[];for(let F=0;F<Y.length;F+=1)le.rules[F]=Y[F].name;le.udts=[];for(let F=0;F<ie.length;F+=1)le.udts[F]=ie[F].name;le.id={},le.id.ALT={id:i.ALT,name:"ALT"},le.id.CAT={id:i.CAT,name:"CAT"},le.id.REP={id:i.REP,name:"REP"},le.id.RNM={id:i.RNM,name:"RNM"},le.id.TLS={id:i.TLS,name:"TLS"},le.id.TBS={id:i.TBS,name:"TBS"},le.id.TRG={id:i.TRG,name:"TRG"},le.id.UDT={id:i.UDT,name:"UDT"},le.id.AND={id:i.AND,name:"AND"},le.id.NOT={id:i.NOT,name:"NOT"},le.id.BKR={id:i.BKR,name:"BKR"},le.id.BKA={id:i.BKA,name:"BKA"},le.id.BKN={id:i.BKN,name:"BKN"},le.id.ABG={id:i.ABG,name:"ABG"},le.id.AEN={id:i.AEN,name:"AEN"},le.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},le.id.MATCH={id:i.MATCH,name:"MATCH"},le.id.EMPTY={id:i.EMPTY,name:"EMPTY"},le.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},le.treeDepth=B,le.leafNodes=Ae;let oe;return W.down?W.up?oe="none":oe="right":W.up?oe="left":oe="both",le.branchesIncomplete=oe,le.tree=ue(W,W.depth,!1),le},"toTreeObj");this.toTree=function(H){let z=m();return H?JSON.stringify(z):z},this.toHtmlPage=function(H,z,V){return e.htmlToPage(this.toHtml(H,z),V)};let _=o(function(H,z){let V;switch(H){case u:V="hexadecimal";break;case d:V="decimal";break;case g:V="ASCII";break;case y:V="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${H}`)}let te="";return te+=`<p>display mode: ${V}</p>
307
307
  `,te+=`<table class="${t.CLASS_TRACE}">
308
308
  `,typeof z=="string"&&(te+=`<caption>${z}</caption>`),te},"htmlHeader"),S=o(function(){let H="";return H+=`</table>
309
309
  `,H+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
@@ -348,8 +348,8 @@ table.apg-attrs a:hover {
348
348
  `,H+=`ABG - anchor - begin of input string<br>
349
349
  `,H+=`AEN - anchor - end of input string<br>
350
350
  `,H+=`</p>
351
- `,H},"htmlFooter");this.indent=function(H){let z="";for(let V=0;V<H;V+=1)z+=".";return z};let A=o(function(H,z){let V="";if(z.type===i.TRG)if(H===u||H===y){let te=z.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),V+=H===u?"%x":"U+",V+=te,te=z.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`),V+=`&ndash;${te}`}else V=`%d${z.min.toString(10)}&ndash;${z.max.toString(10)}`;return V},"displayTrg"),v=o(function(H,z){let V="";if(z.type===i.REP)if(H===u){let te=z.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),V=`x${te}`,z.max<1/0?(te=z.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`)):te="inf",V+=`&ndash;${te}`}else z.max<1/0?V=`${z.min.toString(10)}&ndash;${z.max.toString(10)}`:V=`${z.min.toString(10)}&ndash;inf`;return V},"displayRep"),T=o(function(H,z){let V="";if(z.type===i.TBS){let te=Math.min(z.string.length,O*2);if(H===u||H===y){V+=H===u?"%x":"U+";for(let ae=0;ae<te;ae+=1){let Ae;ae>0&&(V+="."),Ae=z.string[ae].toString(16).toUpperCase(),Ae.length%2!==0&&(Ae=`0${Ae}`),V+=Ae}}else{V="%d";for(let ae=0;ae<te;ae+=1)ae>0&&(V+="."),V+=z.string[ae].toString(10)}te<z.string.length&&(V+=he)}return V},"displayTbs"),P=o(function(H,z){let V="";if(z.type===i.TLS){let te=Math.min(z.string.length,O);if(H===u||H===d){let ae,Ae,ge;H===u?(V="%x",ge=16):(V="%d",ge=10);for(let ne=0;ne<te;ne+=1)ne>0&&(V+="."),Ae=z.string[ne],Ae>=97&&Ae<=122?(ae=Ae-32,V+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):Ae>=65&&Ae<=90?(ae=Ae,Ae+=32,V+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):V+=Ae.toString(ge).toUpperCase();te<z.string.length&&(V+=he)}else{V='"';for(let ae=0;ae<te;ae+=1)V+=e.asciiChars[z.string[ae]];te<z.string.length&&(V+=he),V+='"'}}return V},"displayTls"),w=o(function(H,z,V,te,ae){if(te===0)return"";let Ae="",ge=ae?",":"";switch(H){case u:Ae=ge+e.charsToHex(z,V,te);break;case d:if(ae)return`,${e.charsToDec(z,V,te)}`;Ae=ge+e.charsToDec(z,V,te);break;case y:Ae=e.charsToUnicode(z,V,te);break;case g:default:Ae=e.charsToAsciiHtml(z,V,te);break}return Ae},"subPhrase"),k=o(function(H,z,V,te,ae,Ae){let ge="",ne,Me,ue,ve,W=K,pe=`<span class="${t.CLASS_LOOKBEHIND}">`,ke=`<span class="${t.CLASS_REMAINDER}">`,ze="</span>",Ne=!1;switch(V){case i.EMPTY:ge+=C;case i.NOMATCH:case i.MATCH:case i.ACTIVE:ne=te-ae,Me=Ae-ne,ue=Ae,ve=z.length-ue;break;default:throw new Error("unrecognized state")}return W=K,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=pe,ge+=w(H,z,ne,Me,Ne),ge+=ze,Ne=!0),ve>0&&(ge+=ke,ge+=w(H,z,ue,ve,Ne),ge+=ze),ge+W},"displayBehind"),fe=o(function(H,z,V,te,ae,Ae){let ge="",ne,Me,ue,ve,W=K,pe=`<span class="${t.CLASS_REMAINDER}">`,ke="</span>",ze=!1;switch(V){case i.EMPTY:ge+=C;case i.NOMATCH:case i.ACTIVE:ne=te,Me=0,ue=te,ve=z.length-ue;break;case i.MATCH:ne=te,Me=ae,ue=te+Me,ve=z.length-ue;break;default:throw new Error("unrecognized state")}return W=K,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=Ae,ge+=w(H,z,ne,Me,ze),ge+=ke,ze=!0),ve>0&&(ge+=pe,ge+=w(H,z,ue,ve,ze),ge+=ke),ge+W},"displayForward"),D=o(function(H,z,V,te,ae){let Ae=`<span class="${t.CLASS_LOOKAHEAD}">`;return fe(H,z,V,te,ae,Ae)},"displayAhead"),Q=o(function(H,z,V,te,ae){let Ae=`<span class="${t.CLASS_MATCH}">`;return fe(H,z,V,te,ae,Ae)},"displayNone"),se=o(function(H){if(Y===null)return"";let z="",V,te,ae,Ae,ge,ne;return z+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",z+=`<th>operator</th><th>phrase</th></tr>
352
- `,n.forEach(Me=>{let ue=R[Me];switch(V=ue.thisLine,te=ue.thatLine!==void 0?ue.thatLine:"--",ae=!1,Ae=!1,ge=!1,ue.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,ne=ue.lookAnchor),(ue.opcode.type===i.AND||ue.opcode.type===i.NOT)&&(ae=!0,ge=!0,ne=ue.phraseIndex),ue.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,ne=ue.lookAnchor),(ue.opcode.type===i.BKA||ue.opcode.type===i.BKN)&&(Ae=!0,ge=!0,ne=ue.phraseIndex),z+="<tr>",z+=`<td>${V}</td><td>${te}</td>`,z+=`<td>${ue.phraseIndex}</td>`,z+=`<td>${ue.phraseLength}</td>`,z+=`<td>${ue.depth}</td>`,z+="<td>",ue.state){case i.ACTIVE:z+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:z+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:z+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:z+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:z+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(z+="</td>",z+="<td>",z+=f.indent(ue.depth),ae?z+=`<span class="${t.CLASS_LOOKAHEAD}">`:Ae&&(z+=`<span class="${t.CLASS_LOOKBEHIND}">`),z+=e.opcodeToString(ue.opcode.type),ue.opcode.type===i.RNM&&(z+=`(${Y[ue.opcode.index].name}) `),ue.opcode.type===i.BKR){let ve=ue.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",W=ue.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";z+=`(\\${ve}${W}${Y[ue.opcode.index].name}) `}ue.opcode.type===i.UDT&&(z+=`(${ie[ue.opcode.index].name}) `),ue.opcode.type===i.TRG&&(z+=`(${A(H,ue.opcode)}) `),ue.opcode.type===i.TBS&&(z+=`(${T(H,ue.opcode)}) `),ue.opcode.type===i.TLS&&(z+=`(${P(H,ue.opcode)}) `),ue.opcode.type===i.REP&&(z+=`(${v(H,ue.opcode)}) `),ge&&(z+="</span>"),z+="</td>",z+="<td>",Ae?z+=k(H,ee,ue.state,ue.phraseIndex,ue.phraseLength,ne):ae?z+=D(H,ee,ue.state,ue.phraseIndex,ue.phraseLength):z+=Q(H,ee,ue.state,ue.phraseIndex,ue.phraseLength),z+=`</td></tr>
351
+ `,H},"htmlFooter");this.indent=function(H){let z="";for(let V=0;V<H;V+=1)z+=".";return z};let A=o(function(H,z){let V="";if(z.type===i.TRG)if(H===u||H===y){let te=z.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),V+=H===u?"%x":"U+",V+=te,te=z.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`),V+=`&ndash;${te}`}else V=`%d${z.min.toString(10)}&ndash;${z.max.toString(10)}`;return V},"displayTrg"),v=o(function(H,z){let V="";if(z.type===i.REP)if(H===u){let te=z.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),V=`x${te}`,z.max<1/0?(te=z.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`)):te="inf",V+=`&ndash;${te}`}else z.max<1/0?V=`${z.min.toString(10)}&ndash;${z.max.toString(10)}`:V=`${z.min.toString(10)}&ndash;inf`;return V},"displayRep"),T=o(function(H,z){let V="";if(z.type===i.TBS){let te=Math.min(z.string.length,O*2);if(H===u||H===y){V+=H===u?"%x":"U+";for(let ae=0;ae<te;ae+=1){let Ae;ae>0&&(V+="."),Ae=z.string[ae].toString(16).toUpperCase(),Ae.length%2!==0&&(Ae=`0${Ae}`),V+=Ae}}else{V="%d";for(let ae=0;ae<te;ae+=1)ae>0&&(V+="."),V+=z.string[ae].toString(10)}te<z.string.length&&(V+=he)}return V},"displayTbs"),L=o(function(H,z){let V="";if(z.type===i.TLS){let te=Math.min(z.string.length,O);if(H===u||H===d){let ae,Ae,ge;H===u?(V="%x",ge=16):(V="%d",ge=10);for(let ne=0;ne<te;ne+=1)ne>0&&(V+="."),Ae=z.string[ne],Ae>=97&&Ae<=122?(ae=Ae-32,V+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):Ae>=65&&Ae<=90?(ae=Ae,Ae+=32,V+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):V+=Ae.toString(ge).toUpperCase();te<z.string.length&&(V+=he)}else{V='"';for(let ae=0;ae<te;ae+=1)V+=e.asciiChars[z.string[ae]];te<z.string.length&&(V+=he),V+='"'}}return V},"displayTls"),w=o(function(H,z,V,te,ae){if(te===0)return"";let Ae="",ge=ae?",":"";switch(H){case u:Ae=ge+e.charsToHex(z,V,te);break;case d:if(ae)return`,${e.charsToDec(z,V,te)}`;Ae=ge+e.charsToDec(z,V,te);break;case y:Ae=e.charsToUnicode(z,V,te);break;case g:default:Ae=e.charsToAsciiHtml(z,V,te);break}return Ae},"subPhrase"),k=o(function(H,z,V,te,ae,Ae){let ge="",ne,Me,ue,ve,W=K,pe=`<span class="${t.CLASS_LOOKBEHIND}">`,ke=`<span class="${t.CLASS_REMAINDER}">`,ze="</span>",Ne=!1;switch(V){case i.EMPTY:ge+=C;case i.NOMATCH:case i.MATCH:case i.ACTIVE:ne=te-ae,Me=Ae-ne,ue=Ae,ve=z.length-ue;break;default:throw new Error("unrecognized state")}return W=K,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=pe,ge+=w(H,z,ne,Me,Ne),ge+=ze,Ne=!0),ve>0&&(ge+=ke,ge+=w(H,z,ue,ve,Ne),ge+=ze),ge+W},"displayBehind"),fe=o(function(H,z,V,te,ae,Ae){let ge="",ne,Me,ue,ve,W=K,pe=`<span class="${t.CLASS_REMAINDER}">`,ke="</span>",ze=!1;switch(V){case i.EMPTY:ge+=C;case i.NOMATCH:case i.ACTIVE:ne=te,Me=0,ue=te,ve=z.length-ue;break;case i.MATCH:ne=te,Me=ae,ue=te+Me,ve=z.length-ue;break;default:throw new Error("unrecognized state")}return W=K,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=Ae,ge+=w(H,z,ne,Me,ze),ge+=ke,ze=!0),ve>0&&(ge+=pe,ge+=w(H,z,ue,ve,ze),ge+=ke),ge+W},"displayForward"),D=o(function(H,z,V,te,ae){let Ae=`<span class="${t.CLASS_LOOKAHEAD}">`;return fe(H,z,V,te,ae,Ae)},"displayAhead"),Q=o(function(H,z,V,te,ae){let Ae=`<span class="${t.CLASS_MATCH}">`;return fe(H,z,V,te,ae,Ae)},"displayNone"),se=o(function(H){if(Y===null)return"";let z="",V,te,ae,Ae,ge,ne;return z+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",z+=`<th>operator</th><th>phrase</th></tr>
352
+ `,n.forEach(Me=>{let ue=R[Me];switch(V=ue.thisLine,te=ue.thatLine!==void 0?ue.thatLine:"--",ae=!1,Ae=!1,ge=!1,ue.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,ne=ue.lookAnchor),(ue.opcode.type===i.AND||ue.opcode.type===i.NOT)&&(ae=!0,ge=!0,ne=ue.phraseIndex),ue.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,ne=ue.lookAnchor),(ue.opcode.type===i.BKA||ue.opcode.type===i.BKN)&&(Ae=!0,ge=!0,ne=ue.phraseIndex),z+="<tr>",z+=`<td>${V}</td><td>${te}</td>`,z+=`<td>${ue.phraseIndex}</td>`,z+=`<td>${ue.phraseLength}</td>`,z+=`<td>${ue.depth}</td>`,z+="<td>",ue.state){case i.ACTIVE:z+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:z+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:z+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:z+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:z+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(z+="</td>",z+="<td>",z+=f.indent(ue.depth),ae?z+=`<span class="${t.CLASS_LOOKAHEAD}">`:Ae&&(z+=`<span class="${t.CLASS_LOOKBEHIND}">`),z+=e.opcodeToString(ue.opcode.type),ue.opcode.type===i.RNM&&(z+=`(${Y[ue.opcode.index].name}) `),ue.opcode.type===i.BKR){let ve=ue.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",W=ue.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";z+=`(\\${ve}${W}${Y[ue.opcode.index].name}) `}ue.opcode.type===i.UDT&&(z+=`(${ie[ue.opcode.index].name}) `),ue.opcode.type===i.TRG&&(z+=`(${A(H,ue.opcode)}) `),ue.opcode.type===i.TBS&&(z+=`(${T(H,ue.opcode)}) `),ue.opcode.type===i.TLS&&(z+=`(${L(H,ue.opcode)}) `),ue.opcode.type===i.REP&&(z+=`(${v(H,ue.opcode)}) `),ge&&(z+="</span>"),z+="</td>",z+="<td>",Ae?z+=k(H,ee,ue.state,ue.phraseIndex,ue.phraseLength,ne):ae?z+=D(H,ee,ue.state,ue.phraseIndex,ue.phraseLength):z+=Q(H,ee,ue.state,ue.phraseIndex,ue.phraseLength),z+=`</td></tr>
353
353
  `}),z+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",z+=`<th>operator</th><th>phrase</th></tr>
354
354
  `,z+=`</table>
355
355
  `,z},"htmlTable");this.toHtml=function(H,z){let V=g;if(typeof H=="string"&&H.length>=3){let ae=H.toLowerCase().slice(0,3);ae==="hex"?V=u:ae==="dec"?V=d:ae==="uni"&&(V=y)}let te="";return te+=_(V,z),te+=se(V),te+=S(),te}},"exportTrace")});var tf=Re((bW,_5)=>{_5.exports={ast:p5(),circular:Ob(),ids:Wi(),parser:g5(),stats:y5(),trace:w5(),utils:ef(),emitcss:Db(),style:Xu()}});var A5=Re((gW,E5)=>{E5.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]
@@ -362,7 +362,7 @@ table.apg-attrs a:hover {
362
362
  `,t+=`CRLF = %d13.10
363
363
  `,t+=`LF = %d10
364
364
  `,t+=`CR = %d13
365
- `,t},"toString")},"grammar")});var M5=Re(S5=>{var Zr=Wi(),_B=ef();function EB(r,e,t,n,i){return r===Zr.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}),Zr.SEM_OK}o(EB,"semLine");function AB(r,e,t,n,i){return r===Zr.SEM_PRE&&(i.textLength=n),Zr.SEM_OK}o(AB,"semLineText");function SB(r,e,t,n,i){return r===Zr.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})),Zr.SEM_OK}o(SB,"semLastLine");function MB(r,e,t,n,i){return r===Zr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${_B.charToHex(e[t])}'`}),Zr.SEM_OK}o(MB,"semInvalid");function TB(r,e,t,n,i){return r===Zr.SEM_POST&&(i.lineNo+=1),Zr.SEM_OK}o(TB,"semEnd");function CB(r,e,t,n,i){return r===Zr.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)"})),Zr.SEM_OK}o(CB,"semLF");function kB(r,e,t,n,i){return r===Zr.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)"})),Zr.SEM_OK}o(kB,"semCR");function IB(r,e,t,n,i){return r===Zr.SEM_PRE&&(i.endType="CRLF"),Zr.SEM_OK}o(IB,"semCRLF");var cs=[];cs.line=EB;cs["line-text"]=AB;cs["last-line"]=SB;cs.invalid=MB;cs.end=TB;cs.lf=CB;cs.cr=kB;cs.crlf=IB;S5.callbacks=cs});var C5=Re((yW,T5)=>{T5.exports=o(function(e,t,n,i){let s="scanner.js: ",f=tf(),u=new(A5()),{callbacks:d}=M5(),g=[],y=new f.parser;if(y.ast=new f.ast,y.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);y.trace=i}if(y.parse(u,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:g,lineNo:0,errors:t,strict:!!n};return y.ast.translate(O),g},"exfn")});var I5=Re((xW,k5)=>{k5.exports=o(function(){let e="syntax-callbacks.js: ",t=tf(),n=t.ids,i,s=o(function(P,w,k,fe){switch(P.state){case n.ACTIVE:fe.altStack=[],fe.repCount=0;break;case n.EMPTY:fe.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:fe.ruleCount===0&&fe.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"),f=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:k.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:k.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),u=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),d=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),g=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),y=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),E=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),O=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),I=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),N=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"End of string anchor(%$) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),X=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(P,w,T.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${fe}) found - strict ABNF specified.`})}else if(k.lite){let fe=t.utils.charsToString(P,w,T.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${fe}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),L=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(P,w,T.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`UDT operator found(${fe}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),J=o(function(T,P,w){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),ee=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.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"),Y=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),ie=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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"),G=o(function(T,P,w){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),$=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),K=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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:k.strict&&k.errors.push({line:k.findLine(k.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"),he=o(function(T,P,w){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),C=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),h=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:k.errors.push({line:k.findLine(k.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"),x=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:w,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),b=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=k.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),l=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:w,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),m=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=k.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),_=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),S=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(T.phraseLength===1&&k.strict){let fe=P[w]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Line end '${fe}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),A=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),v=o(function(T,P,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.repCount+=1;break;case n.MATCH:k.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=y,this.callbacks.basicelementerr=_,this.callbacks.clsclose=K,this.callbacks.clsopen=G,this.callbacks.clsstring=$,this.callbacks.definedaserror=g,this.callbacks.file=s,this.callbacks.groupclose=b,this.callbacks.groupopen=x,this.callbacks.lineenderror=A,this.callbacks.lineend=S,this.callbacks.notop=E,this.callbacks.optionclose=m,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=he,this.callbacks.prosvalstring=C,this.callbacks.repetition=v,this.callbacks.rule=f,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=Y,this.callbacks.tlsclose=ie,this.callbacks.tlsopen=J,this.callbacks.tlsstring=ee,this.callbacks.udtop=L,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=X,this.callbacks.abgop=I,this.callbacks.aenop=N},"exfn")});var R5=Re((wW,D5)=>{D5.exports=o(function(){let e=tf(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(ue){let ve=-1;return this.get(ue)===-1&&(ve={name:ue,lower:ue.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ue){let ve=-1,W=ue.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===W){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=10*W+Me[pe]-48;return W},"decnum"),s=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=2*W+Me[pe]-48;return W},"binnum"),f=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1){let ke=Me[pe];if(ke>=48&&ke<=57)ke-=48;else if(ke>=65&&ke<=70)ke-=55;else if(ke>=97&&ke<=102)ke-=87;else throw new Error("hexnum out of range");W=16*W+ke}return W},"hexnum");function u(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_PRE)W.ruleNames=new n,W.udtNames=new n,W.rules=[],W.udts=[],W.rulesLineMap=[],W.opcodes=[],W.altStack=[],W.topStack=null,W.topRule=null;else if(ne===t.SEM_POST){let ke;W.rules.forEach(ze=>{ze.isBkr=!1,ze.opcodes.forEach(Ne=>{Ne.type===t.RNM&&(ke=W.ruleNames.get(Ne.index.name),ke===-1?(W.errors.push({line:W.findLine(W.lines,Ne.index.phraseIndex,W.charsLength),char:Ne.index.phraseIndex,msg:`Rule name '${Ne.index.name}' used but not defined.`}),Ne.index=-1):Ne.index=ke.index)})}),W.udts.forEach(ze=>{ze.isBkr=!1}),W.rules.forEach(ze=>{ze.opcodes.forEach(Ne=>{Ne.type===t.BKR&&(ze.hasBkr=!0,ke=W.ruleNames.get(Ne.index.name),ke!==-1?(W.rules[ke.index].isBkr=!0,Ne.index=ke.index):(ke=W.udtNames.get(Ne.index.name),ke!==-1?(W.udts[ke.index].isBkr=!0,Ne.index=W.rules.length+ke.index):(W.errors.push({line:W.findLine(W.lines,Ne.index.phraseIndex,W.charsLength),char:Ne.index.phraseIndex,msg:`Back reference name '${Ne.index.name}' refers to undefined rule or unamed UDT.`}),Ne.index=-1)))})})}return pe}o(u,"semFile");function d(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&(W.altStack.length=0,W.topStack=null,W.rulesLineMap.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue})),pe}o(d,"semRule");function g(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_PRE)W.ruleName="",W.definedas="";else if(ne===t.SEM_POST){let ke;W.definedas==="="?(ke=W.ruleNames.add(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' previously defined.`})):(W.topRule={name:ke.name,lower:ke.lower,opcodes:[],index:ke.index},W.rules.push(W.topRule),W.opcodes=W.topRule.opcodes)):(ke=W.ruleNames.get(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' for incremental alternate not previously defined.`})):(W.topRule=W.rules[ke.index],W.opcodes=W.topRule.opcodes))}return pe}o(g,"semRuleLookup");function y(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_PRE)for(;;){if(W.definedas===null){pe=t.SEM_SKIP;break}if(W.topStack===null){if(W.definedas==="="){W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}W.topStack={alt:W.opcodes[0],cat:null},W.altStack.push(W.topStack);break}W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}else ne===t.SEM_POST&&(W.altStack.pop(),W.altStack.length>0?W.topStack=W.altStack[W.altStack.length-1]:W.topStack=null);return pe}o(y,"semAlternation");function E(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.topStack.alt.children.push(W.opcodes.length),W.topStack.cat={type:t.CAT,children:[]},W.opcodes.push(W.topStack.cat)):ne===t.SEM_POST&&(W.topStack.cat=null),pe}o(E,"semConcatenation");function O(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&W.topStack.cat.children.push(W.opcodes.length),pe}o(O,"semRepetition");function R(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.REP,min:0,max:1,char:ue}),pe}o(R,"semOptionOpen");function I(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&(W.ruleName=e.utils.charsToString(Me,ue,ve)),pe}o(I,"semRuleName");function N(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.definedas="="),pe}o(N,"semDefined");function X(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.definedas="=/"),pe}o(X,"semIncAlt");function L(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.min=0,W.max=1/0,W.topRep={type:t.REP,min:0,max:1/0},W.opcodes.push(W.topRep)):ne===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`repetition min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.topRep.min=W.min,W.topRep.max=W.max),pe}o(L,"semRepOp");function J(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(J,"semRepMin");function ee(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(ee,"semRepMax");function Y(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=i(Me,ue,ve),W.min=W.max),pe}o(Y,"semRepMinMax");function ie(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.AND}),pe}o(ie,"semAndOp");function G(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.NOT}),pe}o(G,"semNotOp");function $(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.RNM,index:{phraseIndex:ue,name:e.utils.charsToString(Me,ue,ve)}}),pe}o($,"semRnmOp");function K(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.ABG}),pe}o(K,"semAbgOp");function he(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.AEN}),pe}o(he,"semAenOp");function C(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.BKA}),pe}o(C,"semBkaOp");function h(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.BKN}),pe}o(h,"semBknOp");function x(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.ci=!0,W.cs=!1,W.um=!0,W.pm=!1):ne===t.SEM_POST&&W.opcodes.push({type:t.BKR,bkrCase:W.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:W.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:W.bkrname.phraseIndex,name:e.utils.charsToString(Me,W.bkrname.phraseIndex,W.bkrname.phraseLength)}}),pe}o(x,"semBkrOp");function b(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.ci=!0),pe}o(b,"semBkrCi");function l(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.cs=!0),pe}o(l,"semBkrCs");function m(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.um=!0),pe}o(m,"semBkrUm");function _(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.pm=!0),pe}o(_,"semBkrPm");function S(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.bkrname={phraseIndex:ue,phraseLength:ve}),pe}o(S,"semBkrName");function A(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!0});W.opcodes.push({type:t.UDT,empty:!0,index:ze.index})}return pe}o(A,"semUdtEmpty");function v(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtNonEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!1});W.opcodes.push({type:t.UDT,empty:!1,index:ze.index,syntax:null,semantic:null})}return pe}o(v,"semUdtNonEmpty");function T(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&(W.tlscase=!0),pe}o(T,"semTlsOp");function P(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&ve>0&&(Me[ue+1]===83||Me[ue+1]===115)&&(W.tlscase=!1),pe}o(P,"semTlsCase");function w(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_POST)if(W.tlscase){let ke=Me.slice(ue,ue+ve);for(let ze=0;ze<ke.length;ze+=1)ke[ze]>=65&&ke[ze]<=90&&(ke[ze]+=32);W.opcodes.push({type:t.TLS,string:ke})}else W.opcodes.push({type:t.TBS,string:Me.slice(ue,ue+ve)});return pe}o(w,"semTlsString");function k(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(ve<=2?W.opcodes.push({type:t.TLS,string:[]}):W.opcodes.push({type:t.TBS,string:Me.slice(ue+1,ue+ve-1)})),pe}o(k,"semClsOp");function fe(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?W.tbsstr=[]:ne===t.SEM_POST&&W.opcodes.push({type:t.TBS,string:W.tbsstr}),pe}o(fe,"semTbsOp");function D(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.min=0,W.max=0):ne===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.opcodes.push({type:t.TRG,min:W.min,max:W.max})),pe}o(D,"semTrgOp");function Q(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(Q,"semDmin");function se(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(se,"semDmax");function H(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=s(Me,ue,ve)),pe}o(H,"semBmin");function z(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=s(Me,ue,ve)),pe}o(z,"semBmax");function V(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=f(Me,ue,ve)),pe}o(V,"semXmin");function te(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=f(Me,ue,ve)),pe}o(te,"semXmax");function ae(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.tbsstr.push(i(Me,ue,ve)),pe}o(ae,"semDstring");function Ae(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.tbsstr.push(s(Me,ue,ve)),pe}o(Ae,"semBstring");function ge(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.tbsstr.push(f(Me,ue,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=K,this.callbacks.aenop=he,this.callbacks.alternation=y,this.callbacks.andop=ie,this.callbacks.bmax=z,this.callbacks.bmin=H,this.callbacks.bkaop=C,this.callbacks.bknop=h,this.callbacks.bkrop=x,this.callbacks["bkr-name"]=S,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=b,this.callbacks.cs=l,this.callbacks.um=m,this.callbacks.pm=_,this.callbacks.concatenation=E,this.callbacks.defined=N,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=X,this.callbacks.notop=G,this.callbacks.optionopen=R,this.callbacks["rep-max"]=ee,this.callbacks["rep-min"]=J,this.callbacks["rep-min-max"]=Y,this.callbacks.repetition=O,this.callbacks.repop=L,this.callbacks.rnmop=$,this.callbacks.rule=d,this.callbacks.rulelookup=g,this.callbacks.rulename=I,this.callbacks.tbsop=fe,this.callbacks.tlscase=P,this.callbacks.tlsstring=w,this.callbacks.tlsop=T,this.callbacks.trgop=D,this.callbacks["udt-empty"]=A,this.callbacks["udt-non-empty"]=v,this.callbacks.xmax=te,this.callbacks.xmin=V,this.callbacks.xstring=ge},"exfn")});var N5=Re((_W,O5)=>{O5.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+=`;
365
+ `,t},"toString")},"grammar")});var M5=Re(S5=>{var Zr=Wi(),_B=ef();function EB(r,e,t,n,i){return r===Zr.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}),Zr.SEM_OK}o(EB,"semLine");function AB(r,e,t,n,i){return r===Zr.SEM_PRE&&(i.textLength=n),Zr.SEM_OK}o(AB,"semLineText");function SB(r,e,t,n,i){return r===Zr.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})),Zr.SEM_OK}o(SB,"semLastLine");function MB(r,e,t,n,i){return r===Zr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${_B.charToHex(e[t])}'`}),Zr.SEM_OK}o(MB,"semInvalid");function TB(r,e,t,n,i){return r===Zr.SEM_POST&&(i.lineNo+=1),Zr.SEM_OK}o(TB,"semEnd");function CB(r,e,t,n,i){return r===Zr.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)"})),Zr.SEM_OK}o(CB,"semLF");function kB(r,e,t,n,i){return r===Zr.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)"})),Zr.SEM_OK}o(kB,"semCR");function IB(r,e,t,n,i){return r===Zr.SEM_PRE&&(i.endType="CRLF"),Zr.SEM_OK}o(IB,"semCRLF");var cs=[];cs.line=EB;cs["line-text"]=AB;cs["last-line"]=SB;cs.invalid=MB;cs.end=TB;cs.lf=CB;cs.cr=kB;cs.crlf=IB;S5.callbacks=cs});var C5=Re((yW,T5)=>{T5.exports=o(function(e,t,n,i){let s="scanner.js: ",f=tf(),u=new(A5()),{callbacks:d}=M5(),g=[],y=new f.parser;if(y.ast=new f.ast,y.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);y.trace=i}if(y.parse(u,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:g,lineNo:0,errors:t,strict:!!n};return y.ast.translate(O),g},"exfn")});var I5=Re((xW,k5)=>{k5.exports=o(function(){let e="syntax-callbacks.js: ",t=tf(),n=t.ids,i,s=o(function(L,w,k,fe){switch(L.state){case n.ACTIVE:fe.altStack=[],fe.repCount=0;break;case n.EMPTY:fe.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:fe.ruleCount===0&&fe.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"),f=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:k.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:k.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),u=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),d=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),g=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),y=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),E=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),O=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),I=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),P=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"End of string anchor(%$) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),X=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(L,w,T.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${fe}) found - strict ABNF specified.`})}else if(k.lite){let fe=t.utils.charsToString(L,w,T.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${fe}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),B=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(L,w,T.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`UDT operator found(${fe}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),J=o(function(T,L,w){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),ee=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.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"),Y=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),ie=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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"),G=o(function(T,L,w){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),$=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),K=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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:k.strict&&k.errors.push({line:k.findLine(k.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"),he=o(function(T,L,w){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),C=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),h=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:k.errors.push({line:k.findLine(k.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"),x=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:w,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),b=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=k.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),l=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:w,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),m=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=k.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),_=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),S=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(T.phraseLength===1&&k.strict){let fe=L[w]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Line end '${fe}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),A=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),v=o(function(T,L,w,k){switch(T.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.repCount+=1;break;case n.MATCH:k.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=y,this.callbacks.basicelementerr=_,this.callbacks.clsclose=K,this.callbacks.clsopen=G,this.callbacks.clsstring=$,this.callbacks.definedaserror=g,this.callbacks.file=s,this.callbacks.groupclose=b,this.callbacks.groupopen=x,this.callbacks.lineenderror=A,this.callbacks.lineend=S,this.callbacks.notop=E,this.callbacks.optionclose=m,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=he,this.callbacks.prosvalstring=C,this.callbacks.repetition=v,this.callbacks.rule=f,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=Y,this.callbacks.tlsclose=ie,this.callbacks.tlsopen=J,this.callbacks.tlsstring=ee,this.callbacks.udtop=B,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=X,this.callbacks.abgop=I,this.callbacks.aenop=P},"exfn")});var R5=Re((wW,D5)=>{D5.exports=o(function(){let e=tf(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(ue){let ve=-1;return this.get(ue)===-1&&(ve={name:ue,lower:ue.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ue){let ve=-1,W=ue.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===W){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=10*W+Me[pe]-48;return W},"decnum"),s=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=2*W+Me[pe]-48;return W},"binnum"),f=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1){let ke=Me[pe];if(ke>=48&&ke<=57)ke-=48;else if(ke>=65&&ke<=70)ke-=55;else if(ke>=97&&ke<=102)ke-=87;else throw new Error("hexnum out of range");W=16*W+ke}return W},"hexnum");function u(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_PRE)W.ruleNames=new n,W.udtNames=new n,W.rules=[],W.udts=[],W.rulesLineMap=[],W.opcodes=[],W.altStack=[],W.topStack=null,W.topRule=null;else if(ne===t.SEM_POST){let ke;W.rules.forEach(ze=>{ze.isBkr=!1,ze.opcodes.forEach(Ne=>{Ne.type===t.RNM&&(ke=W.ruleNames.get(Ne.index.name),ke===-1?(W.errors.push({line:W.findLine(W.lines,Ne.index.phraseIndex,W.charsLength),char:Ne.index.phraseIndex,msg:`Rule name '${Ne.index.name}' used but not defined.`}),Ne.index=-1):Ne.index=ke.index)})}),W.udts.forEach(ze=>{ze.isBkr=!1}),W.rules.forEach(ze=>{ze.opcodes.forEach(Ne=>{Ne.type===t.BKR&&(ze.hasBkr=!0,ke=W.ruleNames.get(Ne.index.name),ke!==-1?(W.rules[ke.index].isBkr=!0,Ne.index=ke.index):(ke=W.udtNames.get(Ne.index.name),ke!==-1?(W.udts[ke.index].isBkr=!0,Ne.index=W.rules.length+ke.index):(W.errors.push({line:W.findLine(W.lines,Ne.index.phraseIndex,W.charsLength),char:Ne.index.phraseIndex,msg:`Back reference name '${Ne.index.name}' refers to undefined rule or unamed UDT.`}),Ne.index=-1)))})})}return pe}o(u,"semFile");function d(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&(W.altStack.length=0,W.topStack=null,W.rulesLineMap.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue})),pe}o(d,"semRule");function g(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_PRE)W.ruleName="",W.definedas="";else if(ne===t.SEM_POST){let ke;W.definedas==="="?(ke=W.ruleNames.add(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' previously defined.`})):(W.topRule={name:ke.name,lower:ke.lower,opcodes:[],index:ke.index},W.rules.push(W.topRule),W.opcodes=W.topRule.opcodes)):(ke=W.ruleNames.get(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' for incremental alternate not previously defined.`})):(W.topRule=W.rules[ke.index],W.opcodes=W.topRule.opcodes))}return pe}o(g,"semRuleLookup");function y(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_PRE)for(;;){if(W.definedas===null){pe=t.SEM_SKIP;break}if(W.topStack===null){if(W.definedas==="="){W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}W.topStack={alt:W.opcodes[0],cat:null},W.altStack.push(W.topStack);break}W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}else ne===t.SEM_POST&&(W.altStack.pop(),W.altStack.length>0?W.topStack=W.altStack[W.altStack.length-1]:W.topStack=null);return pe}o(y,"semAlternation");function E(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.topStack.alt.children.push(W.opcodes.length),W.topStack.cat={type:t.CAT,children:[]},W.opcodes.push(W.topStack.cat)):ne===t.SEM_POST&&(W.topStack.cat=null),pe}o(E,"semConcatenation");function O(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&W.topStack.cat.children.push(W.opcodes.length),pe}o(O,"semRepetition");function R(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.REP,min:0,max:1,char:ue}),pe}o(R,"semOptionOpen");function I(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&(W.ruleName=e.utils.charsToString(Me,ue,ve)),pe}o(I,"semRuleName");function P(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.definedas="="),pe}o(P,"semDefined");function X(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.definedas="=/"),pe}o(X,"semIncAlt");function B(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.min=0,W.max=1/0,W.topRep={type:t.REP,min:0,max:1/0},W.opcodes.push(W.topRep)):ne===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`repetition min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.topRep.min=W.min,W.topRep.max=W.max),pe}o(B,"semRepOp");function J(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(J,"semRepMin");function ee(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(ee,"semRepMax");function Y(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=i(Me,ue,ve),W.min=W.max),pe}o(Y,"semRepMinMax");function ie(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.AND}),pe}o(ie,"semAndOp");function G(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.NOT}),pe}o(G,"semNotOp");function $(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.RNM,index:{phraseIndex:ue,name:e.utils.charsToString(Me,ue,ve)}}),pe}o($,"semRnmOp");function K(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.ABG}),pe}o(K,"semAbgOp");function he(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.AEN}),pe}o(he,"semAenOp");function C(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.BKA}),pe}o(C,"semBkaOp");function h(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.opcodes.push({type:t.BKN}),pe}o(h,"semBknOp");function x(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.ci=!0,W.cs=!1,W.um=!0,W.pm=!1):ne===t.SEM_POST&&W.opcodes.push({type:t.BKR,bkrCase:W.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:W.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:W.bkrname.phraseIndex,name:e.utils.charsToString(Me,W.bkrname.phraseIndex,W.bkrname.phraseLength)}}),pe}o(x,"semBkrOp");function b(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.ci=!0),pe}o(b,"semBkrCi");function l(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.cs=!0),pe}o(l,"semBkrCs");function m(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.um=!0),pe}o(m,"semBkrUm");function _(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.pm=!0),pe}o(_,"semBkrPm");function S(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.bkrname={phraseIndex:ue,phraseLength:ve}),pe}o(S,"semBkrName");function A(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!0});W.opcodes.push({type:t.UDT,empty:!0,index:ze.index})}return pe}o(A,"semUdtEmpty");function v(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtNonEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!1});W.opcodes.push({type:t.UDT,empty:!1,index:ze.index,syntax:null,semantic:null})}return pe}o(v,"semUdtNonEmpty");function T(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE&&(W.tlscase=!0),pe}o(T,"semTlsOp");function L(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&ve>0&&(Me[ue+1]===83||Me[ue+1]===115)&&(W.tlscase=!1),pe}o(L,"semTlsCase");function w(ne,Me,ue,ve,W){let pe=t.SEM_OK;if(ne===t.SEM_POST)if(W.tlscase){let ke=Me.slice(ue,ue+ve);for(let ze=0;ze<ke.length;ze+=1)ke[ze]>=65&&ke[ze]<=90&&(ke[ze]+=32);W.opcodes.push({type:t.TLS,string:ke})}else W.opcodes.push({type:t.TBS,string:Me.slice(ue,ue+ve)});return pe}o(w,"semTlsString");function k(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(ve<=2?W.opcodes.push({type:t.TLS,string:[]}):W.opcodes.push({type:t.TBS,string:Me.slice(ue+1,ue+ve-1)})),pe}o(k,"semClsOp");function fe(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?W.tbsstr=[]:ne===t.SEM_POST&&W.opcodes.push({type:t.TBS,string:W.tbsstr}),pe}o(fe,"semTbsOp");function D(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_PRE?(W.min=0,W.max=0):ne===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.opcodes.push({type:t.TRG,min:W.min,max:W.max})),pe}o(D,"semTrgOp");function Q(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(Q,"semDmin");function se(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(se,"semDmax");function H(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=s(Me,ue,ve)),pe}o(H,"semBmin");function z(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=s(Me,ue,ve)),pe}o(z,"semBmax");function V(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.min=f(Me,ue,ve)),pe}o(V,"semXmin");function te(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&(W.max=f(Me,ue,ve)),pe}o(te,"semXmax");function ae(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.tbsstr.push(i(Me,ue,ve)),pe}o(ae,"semDstring");function Ae(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.tbsstr.push(s(Me,ue,ve)),pe}o(Ae,"semBstring");function ge(ne,Me,ue,ve,W){let pe=t.SEM_OK;return ne===t.SEM_POST&&W.tbsstr.push(f(Me,ue,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=K,this.callbacks.aenop=he,this.callbacks.alternation=y,this.callbacks.andop=ie,this.callbacks.bmax=z,this.callbacks.bmin=H,this.callbacks.bkaop=C,this.callbacks.bknop=h,this.callbacks.bkrop=x,this.callbacks["bkr-name"]=S,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=b,this.callbacks.cs=l,this.callbacks.um=m,this.callbacks.pm=_,this.callbacks.concatenation=E,this.callbacks.defined=P,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=X,this.callbacks.notop=G,this.callbacks.optionopen=R,this.callbacks["rep-max"]=ee,this.callbacks["rep-min"]=J,this.callbacks["rep-min-max"]=Y,this.callbacks.repetition=O,this.callbacks.repop=B,this.callbacks.rnmop=$,this.callbacks.rule=d,this.callbacks.rulelookup=g,this.callbacks.rulename=I,this.callbacks.tbsop=fe,this.callbacks.tlscase=L,this.callbacks.tlsstring=w,this.callbacks.tlsop=T,this.callbacks.trgop=D,this.callbacks["udt-empty"]=A,this.callbacks["udt-non-empty"]=v,this.callbacks.xmax=te,this.callbacks.xmin=V,this.callbacks.xstring=ge},"exfn")});var N5=Re((_W,O5)=>{O5.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+=`;
366
366
  `,t+=`; ABNF for JavaScript APG 2.0 SABNF
367
367
  `,t+=`; RFC 5234 with some restrictions and additions.
368
368
  `,t+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
@@ -533,90 +533,90 @@ table.apg-attrs a:hover {
533
533
  `,t+=` / %d10
534
534
  `,t+=` / %d13
535
535
  `,t+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
536
- `,t},"toString")},"grammar")});var L5=Re((EW,P5)=>{P5.exports=o(function(){let e="parser: ",t=tf(),n=t.ids,i=new(I5()),s=new(R5()),f=new(N5()),u=new t.parser;u.ast=new t.ast,u.callbacks=i.callbacks,u.ast.callbacks=s.callbacks;let d=o(function(O,R,I){if(R<0||R>=I)return-1;for(let N=0;N<O.length;N+=1)if(R>=O[N].beginChar&&R<O[N].beginChar+O[N].length)return N;return-1},"findLine"),g=o(function(O,R){let I=-1;if(R<O.length){for(let N=R;N<O.length;N+=1)if(O[N]!==null){I=O[N];break}}return I},"translateIndex"),y=o(function(O){O.forEach(R=>{let I=[],N=[],X=0;R.opcodes.forEach(L=>{L.type===n.ALT&&L.children.length===1||L.type===n.CAT&&L.children.length===1||L.type===n.REP&&L.min===1&&L.max===1?N.push(null):(N.push(X),I.push(L),X+=1)}),N.push(X),I.forEach(L=>{if(L.type===n.ALT||L.type===n.CAT)for(let J=0;J<L.children.length;J+=1)L.children[J]=g(N,L.children[J])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,N,X,L){if(L){if(L.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=L}let J={};J.errors=I,J.strict=!!N,J.lite=!!X,J.lines=R,J.findLine=d,J.charsLength=O.length,J.ruleCount=0,u.parse(f,"file",O,J).success||I.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(O,R,I){let N={};return N.errors=I,N.lines=R,N.findLine=d,N.charsLength=O.length,u.ast.translate(N),I.length?null:(y(N.rules),{rules:N.rules,udts:N.udts,lineMap:N.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,N,X){let L="",J=!1,ee=!1;X&&(X.typescript?(J=!0,ee=!1):X.lite&&(J=!1,ee=!0));let Y,ie,G,$=0,K=1/0,he=0,C=[],h=[],x=0,b=0,l=0,m=0,_=0,S=0,A=0,v=0,T=0,P=0,w=0,k=0,fe=0,D=0,Q=0;I.forEach(H=>{C.push(H.lower),$+=H.opcodes.length,H.opcodes.forEach(z=>{switch(z.type){case n.ALT:x+=1;break;case n.CAT:b+=1;break;case n.RNM:l+=1;break;case n.UDT:m+=1;break;case n.REP:_+=1;break;case n.AND:S+=1;break;case n.NOT:A+=1;break;case n.BKA:k+=1;break;case n.BKN:fe+=1;break;case n.BKR:w+=1;break;case n.ABG:D+=1;break;case n.AEN:Q+=1;break;case n.TLS:for(v+=1,Y=0;Y<z.string.length;Y+=1)z.string[Y]<K&&(K=z.string[Y]),z.string[Y]>he&&(he=z.string[Y]);break;case n.TBS:for(T+=1,Y=0;Y<z.string.length;Y+=1)z.string[Y]<K&&(K=z.string[Y]),z.string[Y]>he&&(he=z.string[Y]);break;case n.TRG:P+=1,z.min<K&&(K=z.min),z.max>he&&(he=z.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),C.sort(),N.length>0&&(N.forEach(H=>{h.push(H.lower)}),h.sort()),L+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
537
- `,L+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
538
- `,L+=`//
539
- `,L+=`// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
540
- `,X?X.funcName?L+=`const ${X.funcName} = function grammar(){
541
- `:J?L+=`export function grammar(){
542
- `:ee?L+=`export default function grammar(){
543
- `:L+=`module.exports = function grammar(){
544
- `:L+=`module.exports = function grammar(){
545
- `,L+=" // ```\n",L+=` // SUMMARY
546
- `,L+=` // rules = ${I.length}
547
- `,L+=` // udts = ${N.length}
548
- `,L+=` // opcodes = ${$}
549
- `,L+=` // --- ABNF original opcodes
550
- `,L+=` // ALT = ${x}
551
- `,L+=` // CAT = ${b}
552
- `,L+=` // REP = ${_}
553
- `,L+=` // RNM = ${l}
554
- `,L+=` // TLS = ${v}
555
- `,L+=` // TBS = ${T}
556
- `,L+=` // TRG = ${P}
557
- `,L+=` // --- SABNF superset opcodes
558
- `,L+=` // UDT = ${m}
559
- `,L+=` // AND = ${S}
560
- `,L+=` // NOT = ${A}
561
- `,ee||(L+=` // BKA = ${k}
562
- `,L+=` // BKN = ${fe}
563
- `,L+=` // BKR = ${w}
564
- `,L+=` // ABG = ${D}
565
- `,L+=` // AEN = ${Q}
566
- `),L+=" // characters = [",v+T+P===0?L+=" none defined ]":L+=`${K} - ${he}]`,m>0&&(L+=" + user defined"),L+=`
567
- `,L+=" // ```\n",L+=` /* OBJECT IDENTIFIER (for internal parser use) */
568
- `,L+=` this.grammarObject = 'grammarObject';
569
- `,L+=`
570
- `,L+=` /* RULES */
571
- `,L+=` this.rules = [];
536
+ `,t},"toString")},"grammar")});var L5=Re((EW,P5)=>{P5.exports=o(function(){let e="parser: ",t=tf(),n=t.ids,i=new(I5()),s=new(R5()),f=new(N5()),u=new t.parser;u.ast=new t.ast,u.callbacks=i.callbacks,u.ast.callbacks=s.callbacks;let d=o(function(O,R,I){if(R<0||R>=I)return-1;for(let P=0;P<O.length;P+=1)if(R>=O[P].beginChar&&R<O[P].beginChar+O[P].length)return P;return-1},"findLine"),g=o(function(O,R){let I=-1;if(R<O.length){for(let P=R;P<O.length;P+=1)if(O[P]!==null){I=O[P];break}}return I},"translateIndex"),y=o(function(O){O.forEach(R=>{let I=[],P=[],X=0;R.opcodes.forEach(B=>{B.type===n.ALT&&B.children.length===1||B.type===n.CAT&&B.children.length===1||B.type===n.REP&&B.min===1&&B.max===1?P.push(null):(P.push(X),I.push(B),X+=1)}),P.push(X),I.forEach(B=>{if(B.type===n.ALT||B.type===n.CAT)for(let J=0;J<B.children.length;J+=1)B.children[J]=g(P,B.children[J])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,P,X,B){if(B){if(B.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=B}let J={};J.errors=I,J.strict=!!P,J.lite=!!X,J.lines=R,J.findLine=d,J.charsLength=O.length,J.ruleCount=0,u.parse(f,"file",O,J).success||I.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(O,R,I){let P={};return P.errors=I,P.lines=R,P.findLine=d,P.charsLength=O.length,u.ast.translate(P),I.length?null:(y(P.rules),{rules:P.rules,udts:P.udts,lineMap:P.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,P,X){let B="",J=!1,ee=!1;X&&(X.typescript?(J=!0,ee=!1):X.lite&&(J=!1,ee=!0));let Y,ie,G,$=0,K=1/0,he=0,C=[],h=[],x=0,b=0,l=0,m=0,_=0,S=0,A=0,v=0,T=0,L=0,w=0,k=0,fe=0,D=0,Q=0;I.forEach(H=>{C.push(H.lower),$+=H.opcodes.length,H.opcodes.forEach(z=>{switch(z.type){case n.ALT:x+=1;break;case n.CAT:b+=1;break;case n.RNM:l+=1;break;case n.UDT:m+=1;break;case n.REP:_+=1;break;case n.AND:S+=1;break;case n.NOT:A+=1;break;case n.BKA:k+=1;break;case n.BKN:fe+=1;break;case n.BKR:w+=1;break;case n.ABG:D+=1;break;case n.AEN:Q+=1;break;case n.TLS:for(v+=1,Y=0;Y<z.string.length;Y+=1)z.string[Y]<K&&(K=z.string[Y]),z.string[Y]>he&&(he=z.string[Y]);break;case n.TBS:for(T+=1,Y=0;Y<z.string.length;Y+=1)z.string[Y]<K&&(K=z.string[Y]),z.string[Y]>he&&(he=z.string[Y]);break;case n.TRG:L+=1,z.min<K&&(K=z.min),z.max>he&&(he=z.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),C.sort(),P.length>0&&(P.forEach(H=>{h.push(H.lower)}),h.sort()),B+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
537
+ `,B+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
538
+ `,B+=`//
539
+ `,B+=`// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
540
+ `,X?X.funcName?B+=`const ${X.funcName} = function grammar(){
541
+ `:J?B+=`export function grammar(){
542
+ `:ee?B+=`export default function grammar(){
543
+ `:B+=`module.exports = function grammar(){
544
+ `:B+=`module.exports = function grammar(){
545
+ `,B+=" // ```\n",B+=` // SUMMARY
546
+ `,B+=` // rules = ${I.length}
547
+ `,B+=` // udts = ${P.length}
548
+ `,B+=` // opcodes = ${$}
549
+ `,B+=` // --- ABNF original opcodes
550
+ `,B+=` // ALT = ${x}
551
+ `,B+=` // CAT = ${b}
552
+ `,B+=` // REP = ${_}
553
+ `,B+=` // RNM = ${l}
554
+ `,B+=` // TLS = ${v}
555
+ `,B+=` // TBS = ${T}
556
+ `,B+=` // TRG = ${L}
557
+ `,B+=` // --- SABNF superset opcodes
558
+ `,B+=` // UDT = ${m}
559
+ `,B+=` // AND = ${S}
560
+ `,B+=` // NOT = ${A}
561
+ `,ee||(B+=` // BKA = ${k}
562
+ `,B+=` // BKN = ${fe}
563
+ `,B+=` // BKR = ${w}
564
+ `,B+=` // ABG = ${D}
565
+ `,B+=` // AEN = ${Q}
566
+ `),B+=" // characters = [",v+T+L===0?B+=" none defined ]":B+=`${K} - ${he}]`,m>0&&(B+=" + user defined"),B+=`
567
+ `,B+=" // ```\n",B+=` /* OBJECT IDENTIFIER (for internal parser use) */
568
+ `,B+=` this.grammarObject = 'grammarObject';
569
+ `,B+=`
570
+ `,B+=` /* RULES */
571
+ `,B+=` this.rules = [];
572
572
  `,I.forEach((H,z)=>{let V=" this.rules[";V+=z,V+="] = { name: '",V+=H.name,V+="', lower: '",V+=H.lower,V+="', index: ",V+=H.index,V+=", isBkr: ",V+=H.isBkr,V+=` };
573
- `,L+=V}),L+=`
574
- `,L+=` /* UDTS */
575
- `,L+=` this.udts = [];
576
- `,N.length>0&&N.forEach((H,z)=>{let V=" this.udts[";V+=z,V+="] = { name: '",V+=H.name,V+="', lower: '",V+=H.lower,V+="', index: ",V+=H.index,V+=", empty: ",V+=H.empty,V+=", isBkr: ",V+=H.isBkr,V+=` };
577
- `,L+=V}),L+=`
578
- `,L+=` /* OPCODES */
579
- `,I.forEach((H,z)=>{z>0&&(L+=`
580
- `),L+=` /* ${H.name} */
581
- `,L+=` this.rules[${z}].opcodes = [];
582
- `,H.opcodes.forEach((V,te)=>{let ae;switch(V.type){case n.ALT:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, children: [${V.children.toString()}] };// ALT
583
- `;break;case n.CAT:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, children: [${V.children.toString()}] };// CAT
584
- `;break;case n.RNM:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, index: ${V.index} };// RNM(${I[V.index].name})
585
- `;break;case n.BKR:V.index>=I.length?(ie=N[V.index-I.length].name,G=N[V.index-I.length].lower):(ie=I[V.index].name,G=I[V.index].lower),ae="%i",V.bkrCase===n.BKR_MODE_CS&&(ae="%s"),V.bkrMode===n.BKR_MODE_UM?ae+="%u":ae+="%p",ie=ae+ie,L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, index: ${V.index}, lower: '${G}', bkrCase: ${V.bkrCase}, bkrMode: ${V.bkrMode} };// BKR(\\${ie})
586
- `;break;case n.UDT:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, empty: ${V.empty}, index: ${V.index} };// UDT(${N[V.index].name})
587
- `;break;case n.REP:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, min: ${V.min}, max: ${V.max} };// REP
588
- `;break;case n.AND:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// AND
589
- `;break;case n.NOT:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// NOT
590
- `;break;case n.ABG:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// ABG(%^)
591
- `;break;case n.AEN:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// AEN(%$)
592
- `;break;case n.BKA:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// BKA
593
- `;break;case n.BKN:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// BKN
594
- `;break;case n.TLS:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, string: [${V.string.toString()}] };// TLS
595
- `;break;case n.TBS:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, string: [${V.string.toString()}] };// TBS
596
- `;break;case n.TRG:L+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, min: ${V.min}, max: ${V.max} };// TRG
597
- `;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),L+=`
598
- `,L+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",L+=` this.toString = function toString(){
599
- `,L+=` let str = "";
600
- `;let se;return R.forEach(H=>{let z=H.beginChar+H.length;se="",L+=' str += "';for(let V=H.beginChar;V<z;V+=1){switch(O[V]){case 9:se=" ";break;case 10:se="\\n";break;case 13:se="\\r";break;case 34:se='\\"';break;case 92:se="\\\\";break;default:se=String.fromCharCode(O[V]);break}L+=se}L+=`";
601
- `}),L+=` return str;
602
- `,L+=` }
603
- `,L+=`}
604
- `,L},"generateSource"),this.generateObject=o(function(O,R,I){let N={},X=[],L=[],J=O.slice(0);return N.grammarObject="grammarObject",R.forEach(ee=>{X.push(ee.lower)}),X.sort(),I.length>0&&(I.forEach(ee=>{L.push(ee.lower)}),L.sort()),N.callbacks=[],X.forEach(ee=>{N.callbacks[ee]=!1}),I.length>0&&L.forEach(ee=>{N.callbacks[ee]=!1}),N.rules=R,N.udts=I,N.toString=o(function(){return J},"toStringFunc"),N},"generateObject")},"exportParser")});var U5=Re((AW,B5)=>{B5.exports=o(function(){let e=Wi(),t="rule-attributes.js",n=null;function i(C){return C.left||C.nested||C.right||C.cyclic?!1:C.empty}o(i,"isEmptyOnly");function s(C){return!!(C.left||C.nested||C.right||C.cyclic)}o(s,"isRecursive");function f(C,h){let x=0,b=0,l=0;for(x=0;x<h;x+=1)if(C[x].nested)return!0;for(x=0;x<h;x+=1)if(C[x].right&&!C[x].leaf){for(b=x+1;b<h;b+=1)if(!i(C[b]))return!0}for(x=h-1;x>=0;x-=1)if(C[x].left&&!C[x].leaf){for(b=x-1;b>=0;b-=1)if(!i(C[b]))return!0}for(x=0;x<h;x+=1)if(!C[x].empty&&!s(C[x])){for(b=x+1;b<h;b+=1)if(s(C[b])){for(l=b+1;l<h;l+=1)if(!C[l].empty&&!s(C[l]))return!0}}return!1}o(f,"isCatNested");function u(C,h){for(let x=0;x<h;x+=1)if(!C[x].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(C,h){for(let x=0;x<h;x+=1){if(C[x].left)return!0;if(!C[x].empty)return!1}return!1}o(d,"isCatLeft");function g(C,h){for(let x=h-1;x>=0;x-=1){if(C[x].right)return!0;if(!C[x].empty)return!1}return!1}o(g,"isCatRight");function y(C,h){for(let x=0;x<h;x+=1)if(!C[x].empty)return!1;return!0}o(y,"isCatEmpty");function E(C,h){for(let x=0;x<h;x+=1)if(!C[x].finite)return!1;return!0}o(E,"isCatFinite");function O(C,h,x,b){let l=0,m=h[x],_=m.children.length,S=[];for(l=0;l<_;l+=1)S.push(C.attrGen());for(l=0;l<_;l+=1)N(C,h,m.children[l],S[l]);b.left=d(S,_),b.right=g(S,_),b.nested=f(S,_),b.empty=y(S,_),b.finite=E(S,_),b.cyclic=u(S,_)}o(O,"cat");function R(C,h,x,b){let l=0,m=h[x],_=m.children.length,S=[];for(l=0;l<_;l+=1)S.push(C.attrGen());for(l=0;l<_;l+=1)N(C,h,m.children[l],S[l]);for(b.left=!1,b.right=!1,b.nested=!1,b.empty=!1,b.finite=!1,b.cyclic=!1,l=0;l<_;l+=1)S[l].left&&(b.left=!0),S[l].nested&&(b.nested=!0),S[l].right&&(b.right=!0),S[l].empty&&(b.empty=!0),S[l].finite&&(b.finite=!0),S[l].cyclic&&(b.cyclic=!0)}o(R,"alt");function I(C,h,x,b){let l=h[x];l.index>=C.ruleCount?(b.empty=C.udts[l.index-C.ruleCount].empty,b.finite=!0):(X(C,l.index,b),b.left=!1,b.nested=!1,b.right=!1,b.cyclic=!1)}o(I,"bkr");function N(C,h,x,b){C.attrInit(b);let l=h[x];switch(l.type){case e.ALT:R(C,h,x,b);break;case e.CAT:O(C,h,x,b);break;case e.REP:N(C,h,x+1,b),l.min===0&&(b.empty=!0,b.finite=!0);break;case e.RNM:X(C,h[x].index,b);break;case e.BKR:I(C,h,x,b);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:N(C,h,x+1,b),b.empty=!0;break;case e.TLS:b.empty=!h[x].string.length,b.finite=!0,b.cyclic=!1;break;case e.TBS:case e.TRG:b.empty=!1,b.finite=!0,b.cyclic=!1;break;case e.UDT:b.empty=l.empty,b.finite=!0,b.cyclic=!1;break;case e.ABG:case e.AEN:b.empty=!0,b.finite=!0,b.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${l}`)}}o(N,"opEval");function X(C,h,x){let b=C.attrsWorking[h];b.isComplete?C.attrCopy(x,b):b.isOpen?h===C.startRule?h===C.startRule&&(x.left=!0,x.right=!0,x.cyclic=!0,x.leaf=!0):x.finite=!0:(b.isOpen=!0,N(C,b.rule.opcodes,0,x),b.left=x.left,b.right=x.right,b.nested=x.nested,b.empty=x.empty,b.finite=x.finite,b.cyclic=x.cyclic,b.leaf=!1,b.isOpen=!1,b.isComplete=!0)}o(X,"ruleAttrsEval");let L=o(C=>{n=C;let h=0,x=0,b=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(x=0;x<n.ruleCount;x+=1)n.attrInit(n.attrsWorking[x]);n.startRule=h,X(n,h,b),n.attrCopy(n.attrs[h],n.attrsWorking[h])}n.attributesComplete=!0;let l=null;for(h=0;h<n.ruleCount;h+=1)if(l=n.attrs[h],l.left||!l.finite||l.cyclic){let m=n.attrGen(l.rule);n.attrCopy(m,l),n.attrsErrors.push(m),n.attrsErrorCount+=1}},"ruleAttributes"),J=o(C=>C?"t":"f","truth"),ee=o(C=>C?"e":"f","tError"),Y=o(C=>C?"t":"e","fError"),ie=o((C,h,x,b)=>{let l=`${C}:${h}:`;return l+=`${ee(x.left)} `,l+=`${J(x.nested)} `,l+=`${J(x.right)} `,l+=`${ee(x.cyclic)} `,l+=`${Y(x.finite)} `,l+=`${J(x.empty)}:`,l+=`${n.typeToString(b.recursiveType)}:`,l+=b.recursiveType===e.ATTR_MR?b.groupNumber:"-",l+=`:${x.rule.name}
573
+ `,B+=V}),B+=`
574
+ `,B+=` /* UDTS */
575
+ `,B+=` this.udts = [];
576
+ `,P.length>0&&P.forEach((H,z)=>{let V=" this.udts[";V+=z,V+="] = { name: '",V+=H.name,V+="', lower: '",V+=H.lower,V+="', index: ",V+=H.index,V+=", empty: ",V+=H.empty,V+=", isBkr: ",V+=H.isBkr,V+=` };
577
+ `,B+=V}),B+=`
578
+ `,B+=` /* OPCODES */
579
+ `,I.forEach((H,z)=>{z>0&&(B+=`
580
+ `),B+=` /* ${H.name} */
581
+ `,B+=` this.rules[${z}].opcodes = [];
582
+ `,H.opcodes.forEach((V,te)=>{let ae;switch(V.type){case n.ALT:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, children: [${V.children.toString()}] };// ALT
583
+ `;break;case n.CAT:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, children: [${V.children.toString()}] };// CAT
584
+ `;break;case n.RNM:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, index: ${V.index} };// RNM(${I[V.index].name})
585
+ `;break;case n.BKR:V.index>=I.length?(ie=P[V.index-I.length].name,G=P[V.index-I.length].lower):(ie=I[V.index].name,G=I[V.index].lower),ae="%i",V.bkrCase===n.BKR_MODE_CS&&(ae="%s"),V.bkrMode===n.BKR_MODE_UM?ae+="%u":ae+="%p",ie=ae+ie,B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, index: ${V.index}, lower: '${G}', bkrCase: ${V.bkrCase}, bkrMode: ${V.bkrMode} };// BKR(\\${ie})
586
+ `;break;case n.UDT:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, empty: ${V.empty}, index: ${V.index} };// UDT(${P[V.index].name})
587
+ `;break;case n.REP:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, min: ${V.min}, max: ${V.max} };// REP
588
+ `;break;case n.AND:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// AND
589
+ `;break;case n.NOT:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// NOT
590
+ `;break;case n.ABG:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// ABG(%^)
591
+ `;break;case n.AEN:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// AEN(%$)
592
+ `;break;case n.BKA:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// BKA
593
+ `;break;case n.BKN:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type} };// BKN
594
+ `;break;case n.TLS:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, string: [${V.string.toString()}] };// TLS
595
+ `;break;case n.TBS:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, string: [${V.string.toString()}] };// TBS
596
+ `;break;case n.TRG:B+=` this.rules[${z}].opcodes[${te}] = { type: ${V.type}, min: ${V.min}, max: ${V.max} };// TRG
597
+ `;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),B+=`
598
+ `,B+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",B+=` this.toString = function toString(){
599
+ `,B+=` let str = "";
600
+ `;let se;return R.forEach(H=>{let z=H.beginChar+H.length;se="",B+=' str += "';for(let V=H.beginChar;V<z;V+=1){switch(O[V]){case 9:se=" ";break;case 10:se="\\n";break;case 13:se="\\r";break;case 34:se='\\"';break;case 92:se="\\\\";break;default:se=String.fromCharCode(O[V]);break}B+=se}B+=`";
601
+ `}),B+=` return str;
602
+ `,B+=` }
603
+ `,B+=`}
604
+ `,B},"generateSource"),this.generateObject=o(function(O,R,I){let P={},X=[],B=[],J=O.slice(0);return P.grammarObject="grammarObject",R.forEach(ee=>{X.push(ee.lower)}),X.sort(),I.length>0&&(I.forEach(ee=>{B.push(ee.lower)}),B.sort()),P.callbacks=[],X.forEach(ee=>{P.callbacks[ee]=!1}),I.length>0&&B.forEach(ee=>{P.callbacks[ee]=!1}),P.rules=R,P.udts=I,P.toString=o(function(){return J},"toStringFunc"),P},"generateObject")},"exportParser")});var U5=Re((AW,B5)=>{B5.exports=o(function(){let e=Wi(),t="rule-attributes.js",n=null;function i(C){return C.left||C.nested||C.right||C.cyclic?!1:C.empty}o(i,"isEmptyOnly");function s(C){return!!(C.left||C.nested||C.right||C.cyclic)}o(s,"isRecursive");function f(C,h){let x=0,b=0,l=0;for(x=0;x<h;x+=1)if(C[x].nested)return!0;for(x=0;x<h;x+=1)if(C[x].right&&!C[x].leaf){for(b=x+1;b<h;b+=1)if(!i(C[b]))return!0}for(x=h-1;x>=0;x-=1)if(C[x].left&&!C[x].leaf){for(b=x-1;b>=0;b-=1)if(!i(C[b]))return!0}for(x=0;x<h;x+=1)if(!C[x].empty&&!s(C[x])){for(b=x+1;b<h;b+=1)if(s(C[b])){for(l=b+1;l<h;l+=1)if(!C[l].empty&&!s(C[l]))return!0}}return!1}o(f,"isCatNested");function u(C,h){for(let x=0;x<h;x+=1)if(!C[x].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(C,h){for(let x=0;x<h;x+=1){if(C[x].left)return!0;if(!C[x].empty)return!1}return!1}o(d,"isCatLeft");function g(C,h){for(let x=h-1;x>=0;x-=1){if(C[x].right)return!0;if(!C[x].empty)return!1}return!1}o(g,"isCatRight");function y(C,h){for(let x=0;x<h;x+=1)if(!C[x].empty)return!1;return!0}o(y,"isCatEmpty");function E(C,h){for(let x=0;x<h;x+=1)if(!C[x].finite)return!1;return!0}o(E,"isCatFinite");function O(C,h,x,b){let l=0,m=h[x],_=m.children.length,S=[];for(l=0;l<_;l+=1)S.push(C.attrGen());for(l=0;l<_;l+=1)P(C,h,m.children[l],S[l]);b.left=d(S,_),b.right=g(S,_),b.nested=f(S,_),b.empty=y(S,_),b.finite=E(S,_),b.cyclic=u(S,_)}o(O,"cat");function R(C,h,x,b){let l=0,m=h[x],_=m.children.length,S=[];for(l=0;l<_;l+=1)S.push(C.attrGen());for(l=0;l<_;l+=1)P(C,h,m.children[l],S[l]);for(b.left=!1,b.right=!1,b.nested=!1,b.empty=!1,b.finite=!1,b.cyclic=!1,l=0;l<_;l+=1)S[l].left&&(b.left=!0),S[l].nested&&(b.nested=!0),S[l].right&&(b.right=!0),S[l].empty&&(b.empty=!0),S[l].finite&&(b.finite=!0),S[l].cyclic&&(b.cyclic=!0)}o(R,"alt");function I(C,h,x,b){let l=h[x];l.index>=C.ruleCount?(b.empty=C.udts[l.index-C.ruleCount].empty,b.finite=!0):(X(C,l.index,b),b.left=!1,b.nested=!1,b.right=!1,b.cyclic=!1)}o(I,"bkr");function P(C,h,x,b){C.attrInit(b);let l=h[x];switch(l.type){case e.ALT:R(C,h,x,b);break;case e.CAT:O(C,h,x,b);break;case e.REP:P(C,h,x+1,b),l.min===0&&(b.empty=!0,b.finite=!0);break;case e.RNM:X(C,h[x].index,b);break;case e.BKR:I(C,h,x,b);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:P(C,h,x+1,b),b.empty=!0;break;case e.TLS:b.empty=!h[x].string.length,b.finite=!0,b.cyclic=!1;break;case e.TBS:case e.TRG:b.empty=!1,b.finite=!0,b.cyclic=!1;break;case e.UDT:b.empty=l.empty,b.finite=!0,b.cyclic=!1;break;case e.ABG:case e.AEN:b.empty=!0,b.finite=!0,b.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${l}`)}}o(P,"opEval");function X(C,h,x){let b=C.attrsWorking[h];b.isComplete?C.attrCopy(x,b):b.isOpen?h===C.startRule?h===C.startRule&&(x.left=!0,x.right=!0,x.cyclic=!0,x.leaf=!0):x.finite=!0:(b.isOpen=!0,P(C,b.rule.opcodes,0,x),b.left=x.left,b.right=x.right,b.nested=x.nested,b.empty=x.empty,b.finite=x.finite,b.cyclic=x.cyclic,b.leaf=!1,b.isOpen=!1,b.isComplete=!0)}o(X,"ruleAttrsEval");let B=o(C=>{n=C;let h=0,x=0,b=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(x=0;x<n.ruleCount;x+=1)n.attrInit(n.attrsWorking[x]);n.startRule=h,X(n,h,b),n.attrCopy(n.attrs[h],n.attrsWorking[h])}n.attributesComplete=!0;let l=null;for(h=0;h<n.ruleCount;h+=1)if(l=n.attrs[h],l.left||!l.finite||l.cyclic){let m=n.attrGen(l.rule);n.attrCopy(m,l),n.attrsErrors.push(m),n.attrsErrorCount+=1}},"ruleAttributes"),J=o(C=>C?"t":"f","truth"),ee=o(C=>C?"e":"f","tError"),Y=o(C=>C?"t":"e","fError"),ie=o((C,h,x,b)=>{let l=`${C}:${h}:`;return l+=`${ee(x.left)} `,l+=`${J(x.nested)} `,l+=`${J(x.right)} `,l+=`${ee(x.cyclic)} `,l+=`${Y(x.finite)} `,l+=`${J(x.empty)}:`,l+=`${n.typeToString(b.recursiveType)}:`,l+=b.recursiveType===e.ATTR_MR?b.groupNumber:"-",l+=`:${x.rule.name}
605
605
  `,l},"showAttr"),G=o(()=>{let C=`LEGEND - t=true, f=false, e=error
606
606
  `;return C+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
607
607
  `,C},"showLegend"),$=o(()=>{let C=null,h=null,x="";if(x+=`RULE ATTRIBUTES WITH ERRORS
608
608
  `,x+=G(),n.attrsErrorCount)for(let b=0;b<n.attrsErrorCount;b+=1)C=n.attrsErrors[b],h=n.ruleDeps[C.rule.index],x+=ie(b,C.rule.index,C,h);else x+=`<none>
609
- `;return x},"showAttributeErrors"),K=o(C=>{let h=0,x=0,b=null,l=null,m="",{ruleIndexes:_}=n;for(C===97?_=n.ruleAlphaIndexes:C===116&&(_=n.ruleTypeIndexes),h=0;h<n.ruleCount;h+=1)x=_[h],b=n.attrs[x],l=n.ruleDeps[x],m+=ie(h,x,b,l);return m},"show");return{ruleAttributes:L,showAttributes:o((C="index")=>{if(!n.attributesComplete)throw new Error(`${t}:showAttributes: attributes not available`);let h="",x=`RULE ATTRIBUTES
609
+ `;return x},"showAttributeErrors"),K=o(C=>{let h=0,x=0,b=null,l=null,m="",{ruleIndexes:_}=n;for(C===97?_=n.ruleAlphaIndexes:C===116&&(_=n.ruleTypeIndexes),h=0;h<n.ruleCount;h+=1)x=_[h],b=n.attrs[x],l=n.ruleDeps[x],m+=ie(h,x,b,l);return m},"show");return{ruleAttributes:B,showAttributes:o((C="index")=>{if(!n.attributesComplete)throw new Error(`${t}:showAttributes: attributes not available`);let h="",x=`RULE ATTRIBUTES
610
610
  `;return C.charCodeAt(0)===97?(h+=`alphabetical by rule name
611
611
  `,h+=x,h+=G(),h+=K(97)):C.charCodeAt(0)===116?(h+=`ordered by rule type
612
612
  `,h+=x,h+=G(),h+=K(116)):(h+=`ordered by rule index
613
- `,h+=x,h+=G(),h+=K()),h},"showAttributes"),showAttributeErrors:$}},"exportRuleAttributes")()});var $5=Re((SW,F5)=>{F5.exports=(()=>{let r=Wi(),e=null,t=o((f,u,d,g)=>{let y=0,E=0,O=u[d];g[d]=!0;let R=O.rule.opcodes;for(y=0;y<R.length;y+=1){let I=R[y];if(I.type===r.RNM)for(O.refersTo[I.index]=!0,g[I.index]||t(f,u,I.index,g),E=0;E<f;E+=1)u[I.index].refersTo[E]&&(O.refersTo[E]=!0);else I.type===r.UDT?O.refersToUdt[I.index]=!0:I.type===r.BKR&&(I.index<f?(O.refersTo[I.index]=!0,g[I.index]||t(f,u,I.index,g)):O.refersToUdt[f-I.index]=!0)}},"scan"),n=o(f=>{e=f;let u=0,d=0,g=0,y=null,E=null,O=!1;e.dependenciesComplete=!1;let R=e.falseArray(e.ruleCount);for(u=0;u<e.ruleCount;u+=1)e.falsifyArray(R),t(e.ruleCount,e.ruleDeps,u,R);for(u=0;u<e.ruleCount;u+=1)for(d=0;d<e.ruleCount;d+=1)u!==d&&e.ruleDeps[d].refersTo[u]&&(e.ruleDeps[u].referencedBy[d]=!0);for(u=0;u<e.ruleCount;u+=1)e.ruleDeps[u].recursiveType=r.ATTR_N,e.ruleDeps[u].refersTo[u]&&(e.ruleDeps[u].recursiveType=r.ATTR_R);for(g=-1,u=0;u<e.ruleCount;u+=1)if(y=e.ruleDeps[u],y.recursiveType===r.ATTR_R)for(O=!0,d=0;d<e.ruleCount;d+=1)u!==d&&(E=e.ruleDeps[d],E.recursiveType===r.ATTR_R&&y.refersTo[d]&&E.refersTo[u]&&(O&&(g+=1,y.recursiveType=r.ATTR_MR,y.groupNumber=g,O=!1),E.recursiveType=r.ATTR_MR,E.groupNumber=g));e.isMutuallyRecursive=g>-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((f=null)=>{let u=0,d=0,g=0,y=0,E=e.ruleCount-1,O=e.udtCount-1,R=100,I="",N="",X="=> ",L="<= ",J=!1,ee=null,{ruleIndexes:Y}=e,{udtIndexes:ie}=e;for(f===97?(Y=e.ruleAlphaIndexes,ie=e.udtAlphaIndexes):f===116&&(Y=e.ruleTypeIndexes,ie=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(ee=e.ruleDeps[Y[u]],N=`${Y[u]}:${e.typeToString(ee.recursiveType)}:`,e.isMutuallyRecursive&&(N+=ee.groupNumber>-1?ee.groupNumber:"-",N+=":"),N+=" ",I+=`${N+e.rules[Y[u]].name}
614
- `,J=!0,g=0,y=I.length,I+=N,d=0;d<e.ruleCount;d+=1)ee.refersTo[Y[d]]&&(J?(I+=X,J=!1,I+=e.ruleDeps[Y[d]].rule.name):I+=`, ${e.ruleDeps[Y[d]].rule.name}`,g+=1),I.length-y>R&&d!==E&&(I+=`
615
- ${N}${X}`,y=I.length);if(e.udtCount)for(d=0;d<e.udtCount;d+=1)ee.refersToUdt[ie[d]]&&(J?(I+=X,J=!1,I+=e.udts[ie[d]].name):I+=`, ${e.udts[ie[d]].name}`,g+=1),I.length-y>R&&d!==O&&(I+=`
616
- ${N}${X}`,y=I.length);for(g===0&&(I+=`=> <none>
613
+ `,h+=x,h+=G(),h+=K()),h},"showAttributes"),showAttributeErrors:$}},"exportRuleAttributes")()});var $5=Re((SW,F5)=>{F5.exports=(()=>{let r=Wi(),e=null,t=o((f,u,d,g)=>{let y=0,E=0,O=u[d];g[d]=!0;let R=O.rule.opcodes;for(y=0;y<R.length;y+=1){let I=R[y];if(I.type===r.RNM)for(O.refersTo[I.index]=!0,g[I.index]||t(f,u,I.index,g),E=0;E<f;E+=1)u[I.index].refersTo[E]&&(O.refersTo[E]=!0);else I.type===r.UDT?O.refersToUdt[I.index]=!0:I.type===r.BKR&&(I.index<f?(O.refersTo[I.index]=!0,g[I.index]||t(f,u,I.index,g)):O.refersToUdt[f-I.index]=!0)}},"scan"),n=o(f=>{e=f;let u=0,d=0,g=0,y=null,E=null,O=!1;e.dependenciesComplete=!1;let R=e.falseArray(e.ruleCount);for(u=0;u<e.ruleCount;u+=1)e.falsifyArray(R),t(e.ruleCount,e.ruleDeps,u,R);for(u=0;u<e.ruleCount;u+=1)for(d=0;d<e.ruleCount;d+=1)u!==d&&e.ruleDeps[d].refersTo[u]&&(e.ruleDeps[u].referencedBy[d]=!0);for(u=0;u<e.ruleCount;u+=1)e.ruleDeps[u].recursiveType=r.ATTR_N,e.ruleDeps[u].refersTo[u]&&(e.ruleDeps[u].recursiveType=r.ATTR_R);for(g=-1,u=0;u<e.ruleCount;u+=1)if(y=e.ruleDeps[u],y.recursiveType===r.ATTR_R)for(O=!0,d=0;d<e.ruleCount;d+=1)u!==d&&(E=e.ruleDeps[d],E.recursiveType===r.ATTR_R&&y.refersTo[d]&&E.refersTo[u]&&(O&&(g+=1,y.recursiveType=r.ATTR_MR,y.groupNumber=g,O=!1),E.recursiveType=r.ATTR_MR,E.groupNumber=g));e.isMutuallyRecursive=g>-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((f=null)=>{let u=0,d=0,g=0,y=0,E=e.ruleCount-1,O=e.udtCount-1,R=100,I="",P="",X="=> ",B="<= ",J=!1,ee=null,{ruleIndexes:Y}=e,{udtIndexes:ie}=e;for(f===97?(Y=e.ruleAlphaIndexes,ie=e.udtAlphaIndexes):f===116&&(Y=e.ruleTypeIndexes,ie=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(ee=e.ruleDeps[Y[u]],P=`${Y[u]}:${e.typeToString(ee.recursiveType)}:`,e.isMutuallyRecursive&&(P+=ee.groupNumber>-1?ee.groupNumber:"-",P+=":"),P+=" ",I+=`${P+e.rules[Y[u]].name}
614
+ `,J=!0,g=0,y=I.length,I+=P,d=0;d<e.ruleCount;d+=1)ee.refersTo[Y[d]]&&(J?(I+=X,J=!1,I+=e.ruleDeps[Y[d]].rule.name):I+=`, ${e.ruleDeps[Y[d]].rule.name}`,g+=1),I.length-y>R&&d!==E&&(I+=`
615
+ ${P}${X}`,y=I.length);if(e.udtCount)for(d=0;d<e.udtCount;d+=1)ee.refersToUdt[ie[d]]&&(J?(I+=X,J=!1,I+=e.udts[ie[d]].name):I+=`, ${e.udts[ie[d]].name}`,g+=1),I.length-y>R&&d!==O&&(I+=`
616
+ ${P}${X}`,y=I.length);for(g===0&&(I+=`=> <none>
617
617
  `),J===!1&&(I+=`
618
- `),J=!0,g=0,y=I.length,I+=N,d=0;d<e.ruleCount;d+=1)ee.referencedBy[Y[d]]&&(J?(I+=L,J=!1,I+=e.ruleDeps[Y[d]].rule.name):I+=`, ${e.ruleDeps[Y[d]].rule.name}`,g+=1),I.length-y>R&&d!==E&&(I+=`
619
- ${N}${X}`,y=I.length);g===0&&(I+=`<= <none>
618
+ `),J=!0,g=0,y=I.length,I+=P,d=0;d<e.ruleCount;d+=1)ee.referencedBy[Y[d]]&&(J?(I+=B,J=!1,I+=e.ruleDeps[Y[d]].rule.name):I+=`, ${e.ruleDeps[Y[d]].rule.name}`,g+=1),I.length-y>R&&d!==E&&(I+=`
619
+ ${P}${X}`,y=I.length);g===0&&(I+=`<= <none>
620
620
  `),J===!1&&(I+=`
621
621
  `),I+=`
622
622
  `}return I},"show");return{ruleDependencies:n,showRuleDependencies:o((f="index")=>{let u=`RULE DEPENDENCIES(index:type:[group number:])
@@ -625,15 +625,15 @@ ${N}${X}`,y=I.length);g===0&&(I+=`<= <none>
625
625
  `,e.dependenciesComplete&&(f.charCodeAt(0)===97?(u+=`alphabetical by rule name
626
626
  `,u+=i(97)):f.charCodeAt(0)===116?(u+=`ordered by rule type
627
627
  `,u+=i(116)):(u+=`ordered by rule index
628
- `,u+=i(null))),u},"showRuleDependencies")}})()});var H5=Re((MW,q5)=>{q5.exports=o(function(){let e=Wi(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=U5(),{ruleDependencies:s,showRuleDependencies:f}=$5();class u{constructor(y,E){this.rules=y,this.udts=E,this.ruleCount=y.length,this.udtCount=E.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 O=0;O<this.ruleCount;O+=1)this.attrs.push(this.attrGen(this.rules[O])),this.attrsWorking.push(this.attrGen(this.rules[O])),this.ruleDeps.push(this.rdGen(y[O],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(y){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:y}}attrInit(y){y.left=!1,y.nested=!1,y.right=!1,y.empty=!1,y.finite=!1,y.cyclic=!1,y.leaf=!1,y.isOpen=!1,y.isComplete=!1}attrCopy(y,E){y.left=E.left,y.nested=E.nested,y.right=E.right,y.empty=E.empty,y.finite=E.finite,y.cyclic=E.cyclic,y.leaf=E.leaf,y.isOpen=E.isOpen,y.isComplete=E.isComplete,y.rule=E.rule}rdGen(y,E,O){return{rule:y,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(E),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(E)}}typeToString(y){switch(y){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(y){let E=[];if(y>0)for(let O=0;O<y;O+=1)E.push(!1);return E}falsifyArray(y){for(let E=0;E<y.length;E+=1)y[E]=!1}indexArray(y){let E=[];if(y>0)for(let O=0;O<y;O+=1)E.push(O);return E}compRulesAlpha(y,E){return this.rules[y].lower<this.rules[E].lower?-1:this.rules[y].lower>this.rules[E].lower?1:0}compUdtsAlpha(y,E){return this.udts[y].lower<this.udts[E].lower?-1:this.udts[y].lower>this.udts[E].lower?1:0}compRulesType(y,E){return this.ruleDeps[y].recursiveType<this.ruleDeps[E].recursiveType?-1:this.ruleDeps[y].recursiveType>this.ruleDeps[E].recursiveType?1:0}compRulesGroup(y,E){if(this.ruleDeps[y].recursiveType===e.ATTR_MR&&this.ruleDeps[E].recursiveType===e.ATTR_MR){if(this.ruleDeps[y].groupNumber<this.ruleDeps[E].groupNumber)return-1;if(this.ruleDeps[y].groupNumber>this.ruleDeps[E].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(y=[],E=[],O=[],R=[]){let I=new u(y,E);return s(I),t(I),I.attrsErrorCount&&R.push({line:0,char:0,msg:`${I.attrsErrorCount} attribute errors`}),I.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:f}},"exportAttributes")()});var K5=Re((TW,z5)=>{z5.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],f="index"){let u="showRules",d=[],g=[],y=[],E=[],O=i,R=s,I=i.length,N=s.length,X="RULE/UDT NAMES",L;function J(Y,ie){return O[Y].lower<O[ie].lower?-1:O[Y].lower>O[ie].lower?1:0}o(J,"compRulesAlpha");function ee(Y,ie){return R[Y].lower<R[ie].lower?-1:R[Y].lower>R[ie].lower?1:0}if(o(ee,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${u}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${u}: udts arg must be array`);for(L=0;L<I;L+=1)y.push(L);if(d=y.slice(0),d.sort(J),N){for(L=0;L<N;L+=1)E.push(L);g=E.slice(0),g.sort(ee)}if(f.charCodeAt(0)===97){for(X+=` - alphabetical by rule/UDT name
629
- `,L=0;L<I;L+=1)X+=`${L}: ${d[L]}: ${O[d[L]].name}
630
- `;if(N)for(L=0;L<N;L+=1)X+=`${L}: ${g[L]}: ${R[g[L]].name}
628
+ `,u+=i(null))),u},"showRuleDependencies")}})()});var H5=Re((MW,q5)=>{q5.exports=o(function(){let e=Wi(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=U5(),{ruleDependencies:s,showRuleDependencies:f}=$5();class u{constructor(y,E){this.rules=y,this.udts=E,this.ruleCount=y.length,this.udtCount=E.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 O=0;O<this.ruleCount;O+=1)this.attrs.push(this.attrGen(this.rules[O])),this.attrsWorking.push(this.attrGen(this.rules[O])),this.ruleDeps.push(this.rdGen(y[O],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(y){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:y}}attrInit(y){y.left=!1,y.nested=!1,y.right=!1,y.empty=!1,y.finite=!1,y.cyclic=!1,y.leaf=!1,y.isOpen=!1,y.isComplete=!1}attrCopy(y,E){y.left=E.left,y.nested=E.nested,y.right=E.right,y.empty=E.empty,y.finite=E.finite,y.cyclic=E.cyclic,y.leaf=E.leaf,y.isOpen=E.isOpen,y.isComplete=E.isComplete,y.rule=E.rule}rdGen(y,E,O){return{rule:y,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(E),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(E)}}typeToString(y){switch(y){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(y){let E=[];if(y>0)for(let O=0;O<y;O+=1)E.push(!1);return E}falsifyArray(y){for(let E=0;E<y.length;E+=1)y[E]=!1}indexArray(y){let E=[];if(y>0)for(let O=0;O<y;O+=1)E.push(O);return E}compRulesAlpha(y,E){return this.rules[y].lower<this.rules[E].lower?-1:this.rules[y].lower>this.rules[E].lower?1:0}compUdtsAlpha(y,E){return this.udts[y].lower<this.udts[E].lower?-1:this.udts[y].lower>this.udts[E].lower?1:0}compRulesType(y,E){return this.ruleDeps[y].recursiveType<this.ruleDeps[E].recursiveType?-1:this.ruleDeps[y].recursiveType>this.ruleDeps[E].recursiveType?1:0}compRulesGroup(y,E){if(this.ruleDeps[y].recursiveType===e.ATTR_MR&&this.ruleDeps[E].recursiveType===e.ATTR_MR){if(this.ruleDeps[y].groupNumber<this.ruleDeps[E].groupNumber)return-1;if(this.ruleDeps[y].groupNumber>this.ruleDeps[E].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(y=[],E=[],O=[],R=[]){let I=new u(y,E);return s(I),t(I),I.attrsErrorCount&&R.push({line:0,char:0,msg:`${I.attrsErrorCount} attribute errors`}),I.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:f}},"exportAttributes")()});var K5=Re((TW,z5)=>{z5.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],f="index"){let u="showRules",d=[],g=[],y=[],E=[],O=i,R=s,I=i.length,P=s.length,X="RULE/UDT NAMES",B;function J(Y,ie){return O[Y].lower<O[ie].lower?-1:O[Y].lower>O[ie].lower?1:0}o(J,"compRulesAlpha");function ee(Y,ie){return R[Y].lower<R[ie].lower?-1:R[Y].lower>R[ie].lower?1:0}if(o(ee,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${u}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${u}: udts arg must be array`);for(B=0;B<I;B+=1)y.push(B);if(d=y.slice(0),d.sort(J),P){for(B=0;B<P;B+=1)E.push(B);g=E.slice(0),g.sort(ee)}if(f.charCodeAt(0)===97){for(X+=` - alphabetical by rule/UDT name
629
+ `,B=0;B<I;B+=1)X+=`${B}: ${d[B]}: ${O[d[B]].name}
630
+ `;if(P)for(B=0;B<P;B+=1)X+=`${B}: ${g[B]}: ${R[g[B]].name}
631
631
  `}else{for(X+=` - ordered by rule/UDT index
632
- `,L=0;L<I;L+=1)X+=`${L}: ${O[L].name}
633
- `;if(N)for(L=0;L<N;L+=1)X+=`${L}: ${R[L].name}
634
- `}return X},"showRules")},"exfn")()});var G5=Re((CW,j5)=>{j5.exports=o(function(e){let{Buffer:t}=Kd(),n="api.js: ",i=this,s=tf(),f=Ib(),u=C5(),d=new(L5()),{attributes:g,showAttributes:y,showAttributeErrors:E,showRuleDependencies:O}=H5(),R=K5(),I=o(function(h,x,b){let S=`<span class="${s.style.CLASS_CTRLCHAR}">`,A="</span>",v=`<span class="${s.style.CLASS_NOMATCH}">`,T="</span>",P,w="",k=!0;for(;k&&!(!Array.isArray(h)||h.length===0);){if(typeof x!="number")throw new Error("abnfToHtml: beg must be type number");if(x>=h.length)break;typeof b!="number"||x+b>=h.length?P=h.length:P=x+b;let fe=0;for(let D=x;D<P;D+=1){let Q=h[D];if(Q>=32&&Q<=126)switch(fe===1?(w+=A,fe=0):fe===2&&(w+=T,fe=0),Q){case 32:w+="&nbsp;";break;case 60:w+="&lt;";break;case 62:w+="&gt;";break;case 38:w+="&amp;";break;case 34:w+="&quot;";break;case 39:w+="&#039;";break;case 92:w+="&#092;";break;default:w+=String.fromCharCode(Q);break}else Q===9||Q===10||Q===13?(fe===0?(w+=S,fe=1):fe===2&&(w+=T+S,fe=1),Q===9&&(w+="TAB"),Q===10&&(w+="LF"),Q===13&&(w+="CR")):(fe===0?(w+=v,fe=2):fe===1&&(w+=A+v,fe=2),w+=`\\x${s.utils.charToHex(Q)}`)}fe===2&&(w+=T),fe===1&&(w+=A);break}return w},"abnfToHtml"),N=o(function(h,x,b){let l="";for(let m=x;m<x+b;m+=1){let _=h[m];if(_>=32&&_<=126)l+=String.fromCharCode(_);else switch(_){case 9:l+="\\t";break;case 10:l+="\\n";break;case 13:l+="\\r";break;default:l+="\\unknown";break}}return l},"abnfToAscii"),X=o(function(h){let x="Annotated Input Grammar";return h.forEach(b=>{x+=`
635
- `,x+=`line no: ${b.lineNo}`,x+=` : char index: ${b.beginChar}`,x+=` : length: ${b.length}`,x+=` : abnf: ${N(i.chars,b.beginChar,b.length)}`}),x+=`
636
- `,x},"linesToAscii"),L=o(function(h){let x="";return x+=`<table class="${s.style.CLASS_GRAMMAR}">
632
+ `,B=0;B<I;B+=1)X+=`${B}: ${O[B].name}
633
+ `;if(P)for(B=0;B<P;B+=1)X+=`${B}: ${R[B].name}
634
+ `}return X},"showRules")},"exfn")()});var G5=Re((CW,j5)=>{j5.exports=o(function(e){let{Buffer:t}=Kd(),n="api.js: ",i=this,s=tf(),f=Ib(),u=C5(),d=new(L5()),{attributes:g,showAttributes:y,showAttributeErrors:E,showRuleDependencies:O}=H5(),R=K5(),I=o(function(h,x,b){let S=`<span class="${s.style.CLASS_CTRLCHAR}">`,A="</span>",v=`<span class="${s.style.CLASS_NOMATCH}">`,T="</span>",L,w="",k=!0;for(;k&&!(!Array.isArray(h)||h.length===0);){if(typeof x!="number")throw new Error("abnfToHtml: beg must be type number");if(x>=h.length)break;typeof b!="number"||x+b>=h.length?L=h.length:L=x+b;let fe=0;for(let D=x;D<L;D+=1){let Q=h[D];if(Q>=32&&Q<=126)switch(fe===1?(w+=A,fe=0):fe===2&&(w+=T,fe=0),Q){case 32:w+="&nbsp;";break;case 60:w+="&lt;";break;case 62:w+="&gt;";break;case 38:w+="&amp;";break;case 34:w+="&quot;";break;case 39:w+="&#039;";break;case 92:w+="&#092;";break;default:w+=String.fromCharCode(Q);break}else Q===9||Q===10||Q===13?(fe===0?(w+=S,fe=1):fe===2&&(w+=T+S,fe=1),Q===9&&(w+="TAB"),Q===10&&(w+="LF"),Q===13&&(w+="CR")):(fe===0?(w+=v,fe=2):fe===1&&(w+=A+v,fe=2),w+=`\\x${s.utils.charToHex(Q)}`)}fe===2&&(w+=T),fe===1&&(w+=A);break}return w},"abnfToHtml"),P=o(function(h,x,b){let l="";for(let m=x;m<x+b;m+=1){let _=h[m];if(_>=32&&_<=126)l+=String.fromCharCode(_);else switch(_){case 9:l+="\\t";break;case 10:l+="\\n";break;case 13:l+="\\r";break;default:l+="\\unknown";break}}return l},"abnfToAscii"),X=o(function(h){let x="Annotated Input Grammar";return h.forEach(b=>{x+=`
635
+ `,x+=`line no: ${b.lineNo}`,x+=` : char index: ${b.beginChar}`,x+=` : length: ${b.length}`,x+=` : abnf: ${P(i.chars,b.beginChar,b.length)}`}),x+=`
636
+ `,x},"linesToAscii"),B=o(function(h){let x="";return x+=`<table class="${s.style.CLASS_GRAMMAR}">
637
637
  `,x+=`<caption>Annotated Input Grammar</caption>
638
638
  `,x+="<tr>",x+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",x+=`</tr>
639
639
  `,h.forEach(l=>{x+="<tr>",x+=`<td>${l.lineNo}`,x+=`</td><td>${l.beginChar}`,x+=`</td><td>${l.length}`,x+=`</td><td>${I(i.chars,l.beginChar,l.length)}`,x+="</td>",x+=`</tr>
@@ -641,18 +641,18 @@ ${N}${X}`,y=I.length);g===0&&(I+=`<= <none>
641
641
  `,x},"linesToHtml"),J=o(function(h,x,b,l){let[m]=s,_="",S=`<span class="${m.CLASS_NOMATCH}">&raquo;</span>`;return _+=`<p><table class="${m.CLASS_GRAMMAR}">
642
642
  `,l&&typeof l=="string"&&(_+=`<caption>${l}</caption>
643
643
  `),_+=`<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>
644
- `,h.forEach(A=>{let v,T,P,w,k,fe="",D="";x.length===0?(k=S,T=0):(v=x[A.line],P=v.beginChar,A.char>P&&(fe=I(b,P,A.char-P)),P=A.char,w=v.beginChar+v.length,P<w&&(D=I(b,P,w-P)),k=fe+S+D,T=A.char-v.beginChar,_+="<tr>",_+=`<td>${A.line}</td><td>${v.beginChar}</td><td>${T}</td><td>${k}</td>`,_+=`</tr>
644
+ `,h.forEach(A=>{let v,T,L,w,k,fe="",D="";x.length===0?(k=S,T=0):(v=x[A.line],L=v.beginChar,A.char>L&&(fe=I(b,L,A.char-L)),L=A.char,w=v.beginChar+v.length,L<w&&(D=I(b,L,w-L)),k=fe+S+D,T=A.char-v.beginChar,_+="<tr>",_+=`<td>${A.line}</td><td>${v.beginChar}</td><td>${T}</td><td>${k}</td>`,_+=`</tr>
645
645
  `,_+="<tr>",_+=`<td colspan="3"></td><td>&uarr;:&nbsp;${s.utils.stringToAsciiHtml(A.msg)}</td>`,_+=`</tr>
646
646
  `)}),_+=`</table></p>
647
- `,_},"errorsToHtml"),ee=o(function(h,x,b){let l,m,_,S;return l="",h.forEach(A=>{m=x[A.line],l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${A.char-m.beginChar}: `,_=m.beginChar,S=A.char-m.beginChar,l+=N(b,_,S),l+=" >> ",_=A.char,S=m.beginChar+m.length-A.char,l+=N(b,_,S),l+=`
647
+ `,_},"errorsToHtml"),ee=o(function(h,x,b){let l,m,_,S;return l="",h.forEach(A=>{m=x[A.line],l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${A.char-m.beginChar}: `,_=m.beginChar,S=A.char-m.beginChar,l+=P(b,_,S),l+=" >> ",_=A.char,S=m.beginChar+m.length-A.char,l+=P(b,_,S),l+=`
648
648
  `,l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${A.char-m.beginChar}: `,l+="error: ",l+=A.msg,l+=`
649
- `}),l},"errorsToAscii"),Y=!1,ie=!1,G=!1,$=!1,K=0,he;if(this.errors=[],t.isBuffer(e))this.chars=f.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=f.decode("STRING",e);else throw new Error(`${n}input source is not a string, byte Buffer or character array`);this.sabnf=f.encode("STRING",this.chars),this.scan=o(function(h,x){this.lines=u(this.chars,this.errors,h,x),Y=!0},"scan"),this.parse=o(function(h,x,b){if(!Y)throw new Error(`${n}grammar not scanned`);d.syntax(this.chars,this.lines,this.errors,h,x,b),ie=!0},"parse"),this.translate=o(function(){if(!ie)throw new Error(`${n}grammar not scanned and parsed`);let h=d.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=h.rules,this.udts=h.udts,he=h.lineMap,G=!0)},"translate"),this.attributes=o(function(){if(!G)throw new Error(`${n}grammar not scanned, parsed and translated`);return K=g(this.rules,this.udts,he,this.errors),$=!0,K},"attrs"),this.generate=o(function(h){if(this.lines=u(this.chars,this.errors,h),this.errors.length||(d.syntax(this.chars,this.lines,this.errors,h),this.errors.length))return;let x=d.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=x.rules,this.udts=x.udts,he=x.lineMap,K=g(this.rules,this.udts,he,this.errors),$=!0)},"generate"),this.displayRules=o(function(h="index"){if(!G)throw new Error(`${n}grammar not scanned, parsed and translated`);return R(this.rules,this.udts,h)},"displayRules"),this.displayRuleDependencies=o(function(h="index"){if(!$)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return O(h)},"displayRuleDependencies"),this.displayAttributes=o(function(h="index"){if(!$)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return K&&E(h),y(h)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!$)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return E()},"displayAttributeErrors"),this.toSource=o(function(h=void 0){if(!$)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(K)throw new Error(`${n}can't generate parser source - attributes have ${K} errors`);return d.generateSource(this.chars,this.lines,this.rules,this.udts,h)},"toSource"),this.toObject=o(function(){if(!$)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(K)throw new Error(`${n}can't generate parser source - attributes have ${K} errors`);return d.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return ee(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(h){return J(this.errors,this.lines,this.chars,h)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return X(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return L(this.lines)},"linesToHtmlFunc")},"api")});var jb=Re((f8,Kb)=>{(function(r,e){"use strict";function t(b,l){if(!b)throw new Error(l||"Assertion failed")}o(t,"assert");function n(b,l){b.super_=l;var m=o(function(){},"TempCtor");m.prototype=l.prototype,b.prototype=new m,b.prototype.constructor=b}o(n,"inherits");function i(b,l,m){if(i.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((l==="le"||l==="be")&&(m=l,l=10),this._init(b||0,l||10,m||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=i1().Buffer}catch{}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,m){return l.cmp(m)>0?l:m},"max"),i.min=o(function(l,m){return l.cmp(m)<0?l:m},"min"),i.prototype._init=o(function(l,m,_){if(typeof l=="number")return this._initNumber(l,m,_);if(typeof l=="object")return this._initArray(l,m,_);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),l=l.toString().replace(/\s+/g,"");var S=0;l[0]==="-"&&(S++,this.negative=1),S<l.length&&(m===16?this._parseHex(l,S,_):(this._parseBase(l,m,S),_==="le"&&this._initArray(this.toArray(),m,_)))},"init"),i.prototype._initNumber=o(function(l,m,_){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),_==="le"&&this._initArray(this.toArray(),m,_)},"_initNumber"),i.prototype._initArray=o(function(l,m,_){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 S=0;S<this.length;S++)this.words[S]=0;var A,v,T=0;if(_==="be")for(S=l.length-1,A=0;S>=0;S-=3)v=l[S]|l[S-1]<<8|l[S-2]<<16,this.words[A]|=v<<T&67108863,this.words[A+1]=v>>>26-T&67108863,T+=24,T>=26&&(T-=26,A++);else if(_==="le")for(S=0,A=0;S<l.length;S+=3)v=l[S]|l[S+1]<<8|l[S+2]<<16,this.words[A]|=v<<T&67108863,this.words[A+1]=v>>>26-T&67108863,T+=24,T>=26&&(T-=26,A++);return this._strip()},"_initArray");function f(b,l){var m=b.charCodeAt(l);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;t(!1,"Invalid character in "+b)}o(f,"parseHex4Bits");function u(b,l,m){var _=f(b,m);return m-1>=l&&(_|=f(b,m-1)<<4),_}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,m,_){this.length=Math.ceil((l.length-m)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var A=0,v=0,T;if(_==="be")for(S=l.length-1;S>=m;S-=2)T=u(l,m,S)<<A,this.words[v]|=T&67108863,A>=18?(A-=18,v+=1,this.words[v]|=T>>>26):A+=8;else{var P=l.length-m;for(S=P%2===0?m+1:m;S<l.length;S+=2)T=u(l,m,S)<<A,this.words[v]|=T&67108863,A>=18?(A-=18,v+=1,this.words[v]|=T>>>26):A+=8}this._strip()},"_parseHex");function d(b,l,m,_){for(var S=0,A=0,v=Math.min(b.length,m),T=l;T<v;T++){var P=b.charCodeAt(T)-48;S*=_,P>=49?A=P-49+10:P>=17?A=P-17+10:A=P,t(P>=0&&A<_,"Invalid character"),S+=A}return S}o(d,"parseBase"),i.prototype._parseBase=o(function(l,m,_){this.words=[0],this.length=1;for(var S=0,A=1;A<=67108863;A*=m)S++;S--,A=A/m|0;for(var v=l.length-_,T=v%S,P=Math.min(v,v-T)+_,w=0,k=_;k<P;k+=S)w=d(l,k,k+S,m),this.imuln(A),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(T!==0){var fe=1;for(w=d(l,k,l.length,m),k=0;k<T;k++)fe*=m;this.imuln(fe),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this._strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var m=0;m<this.length;m++)l.words[m]=this.words[m];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy");function g(b,l){b.words=l.words,b.length=l.length,b.negative=l.negative,b.red=l.red}if(o(g,"move"),i.prototype._move=o(function(l){g(l,this)},"_move"),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"),typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=y}catch{i.prototype.inspect=y}else i.prototype.inspect=y;function y(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(y,"inspect");var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[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,m){l=l||10,m=m|0||1;var _;if(l===16||l==="hex"){_="";for(var S=0,A=0,v=0;v<this.length;v++){var T=this.words[v],P=((T<<S|A)&16777215).toString(16);A=T>>>24-S&16777215,S+=2,S>=26&&(S-=26,v--),A!==0||v!==this.length-1?_=E[6-P.length]+P+_:_=P+_}for(A!==0&&(_=A.toString(16)+_);_.length%m!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(l===(l|0)&&l>=2&&l<=36){var w=O[l],k=R[l];_="";var fe=this.clone();for(fe.negative=0;!fe.isZero();){var D=fe.modrn(k).toString(l);fe=fe.idivn(k),fe.isZero()?_=D+_:_=E[w-D.length]+D+_}for(this.isZero()&&(_="0"+_);_.length%m!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}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,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(l,m){return this.toArrayLike(s,l,m)},"toBuffer")),i.prototype.toArray=o(function(l,m){return this.toArrayLike(Array,l,m)},"toArray");var I=o(function(l,m){return l.allocUnsafe?l.allocUnsafe(m):new l(m)},"allocate");i.prototype.toArrayLike=o(function(l,m,_){this._strip();var S=this.byteLength(),A=_||Math.max(1,S);t(S<=A,"byte array longer than desired length"),t(A>0,"Requested array length <= 0");var v=I(l,A),T=m==="le"?"LE":"BE";return this["_toArrayLike"+T](v,S),v},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,m){for(var _=0,S=0,A=0,v=0;A<this.length;A++){var T=this.words[A]<<v|S;l[_++]=T&255,_<l.length&&(l[_++]=T>>8&255),_<l.length&&(l[_++]=T>>16&255),v===6?(_<l.length&&(l[_++]=T>>24&255),S=0,v=0):(S=T>>>24,v+=2)}if(_<l.length)for(l[_++]=S;_<l.length;)l[_++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,m){for(var _=l.length-1,S=0,A=0,v=0;A<this.length;A++){var T=this.words[A]<<v|S;l[_--]=T&255,_>=0&&(l[_--]=T>>8&255),_>=0&&(l[_--]=T>>16&255),v===6?(_>=0&&(l[_--]=T>>24&255),S=0,v=0):(S=T>>>24,v+=2)}if(_>=0)for(l[_--]=S;_>=0;)l[_--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var m=l,_=0;return m>=4096&&(_+=13,m>>>=13),m>=64&&(_+=7,m>>>=7),m>=8&&(_+=4,m>>>=4),m>=2&&(_+=2,m>>>=2),_+m},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var m=l,_=0;return(m&8191)===0&&(_+=13,m>>>=13),(m&127)===0&&(_+=7,m>>>=7),(m&15)===0&&(_+=4,m>>>=4),(m&3)===0&&(_+=2,m>>>=2),(m&1)===0&&_++,_},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],m=this._countBits(l);return(this.length-1)*26+m},"bitLength");function N(b){for(var l=new Array(b.bitLength()),m=0;m<l.length;m++){var _=m/26|0,S=m%26;l[m]=b.words[_]>>>S&1}return l}o(N,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,m=0;m<this.length;m++){var _=this._zeroBits(this.words[m]);if(l+=_,_!==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 m=0;m<l.length;m++)this.words[m]=this.words[m]|l.words[m];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 m;this.length>l.length?m=l:m=this;for(var _=0;_<m.length;_++)this.words[_]=this.words[_]&l.words[_];return this.length=m.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 m,_;this.length>l.length?(m=this,_=l):(m=l,_=this);for(var S=0;S<_.length;S++)this.words[S]=m.words[S]^_.words[S];if(this!==m)for(;S<m.length;S++)this.words[S]=m.words[S];return this.length=m.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 m=Math.ceil(l/26)|0,_=l%26;this._expand(m),_>0&&m--;for(var S=0;S<m;S++)this.words[S]=~this.words[S]&67108863;return _>0&&(this.words[S]=~this.words[S]&67108863>>26-_),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,m){t(typeof l=="number"&&l>=0);var _=l/26|0,S=l%26;return this._expand(_+1),m?this.words[_]=this.words[_]|1<<S:this.words[_]=this.words[_]&~(1<<S),this._strip()},"setn"),i.prototype.iadd=o(function(l){var m;if(this.negative!==0&&l.negative===0)return this.negative=0,m=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,m=this.isub(l),l.negative=1,m._normSign();var _,S;this.length>l.length?(_=this,S=l):(_=l,S=this);for(var A=0,v=0;v<S.length;v++)m=(_.words[v]|0)+(S.words[v]|0)+A,this.words[v]=m&67108863,A=m>>>26;for(;A!==0&&v<_.length;v++)m=(_.words[v]|0)+A,this.words[v]=m&67108863,A=m>>>26;if(this.length=_.length,A!==0)this.words[this.length]=A,this.length++;else if(_!==this)for(;v<_.length;v++)this.words[v]=_.words[v];return this},"iadd"),i.prototype.add=o(function(l){var m;return l.negative!==0&&this.negative===0?(l.negative=0,m=this.sub(l),l.negative^=1,m):l.negative===0&&this.negative!==0?(this.negative=0,m=l.sub(this),this.negative=1,m):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 m=this.iadd(l);return l.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var _=this.cmp(l);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,A;_>0?(S=this,A=l):(S=l,A=this);for(var v=0,T=0;T<A.length;T++)m=(S.words[T]|0)-(A.words[T]|0)+v,v=m>>26,this.words[T]=m&67108863;for(;v!==0&&T<S.length;T++)m=(S.words[T]|0)+v,v=m>>26,this.words[T]=m&67108863;if(v===0&&T<S.length&&S!==this)for(;T<S.length;T++)this.words[T]=S.words[T];return this.length=Math.max(this.length,T),S!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function X(b,l,m){m.negative=l.negative^b.negative;var _=b.length+l.length|0;m.length=_,_=_-1|0;var S=b.words[0]|0,A=l.words[0]|0,v=S*A,T=v&67108863,P=v/67108864|0;m.words[0]=T;for(var w=1;w<_;w++){for(var k=P>>>26,fe=P&67108863,D=Math.min(w,l.length-1),Q=Math.max(0,w-b.length+1);Q<=D;Q++){var se=w-Q|0;S=b.words[se]|0,A=l.words[Q]|0,v=S*A+fe,k+=v/67108864|0,fe=v&67108863}m.words[w]=fe|0,P=k|0}return P!==0?m.words[w]=P|0:m.length--,m._strip()}o(X,"smallMulTo");var L=o(function(l,m,_){var S=l.words,A=m.words,v=_.words,T=0,P,w,k,fe=S[0]|0,D=fe&8191,Q=fe>>>13,se=S[1]|0,H=se&8191,z=se>>>13,V=S[2]|0,te=V&8191,ae=V>>>13,Ae=S[3]|0,ge=Ae&8191,ne=Ae>>>13,Me=S[4]|0,ue=Me&8191,ve=Me>>>13,W=S[5]|0,pe=W&8191,ke=W>>>13,ze=S[6]|0,Ne=ze&8191,We=ze>>>13,br=S[7]|0,le=br&8191,oe=br>>>13,F=S[8]|0,Z=F&8191,me=F>>>13,ye=S[9]|0,we=ye&8191,Ie=ye>>>13,Dt=A[0]|0,Fe=Dt&8191,Oe=Dt>>>13,Lt=A[1]|0,Ge=Lt&8191,Ye=Lt>>>13,Dn=A[2]|0,it=Dn&8191,ot=Dn>>>13,ei=A[3]|0,st=ei&8191,tt=ei>>>13,ti=A[4]|0,at=ti&8191,ft=ti>>>13,hn=A[5]|0,ct=hn&8191,Ze=hn>>>13,ri=A[6]|0,ut=ri&8191,lt=ri>>>13,ni=A[7]|0,ht=ni&8191,dt=ni>>>13,ii=A[8]|0,pt=ii&8191,rt=ii>>>13,Rn=A[9]|0,qt=Rn&8191,Ht=Rn>>>13;_.negative=l.negative^m.negative,_.length=19,P=Math.imul(D,Fe),w=Math.imul(D,Oe),w=w+Math.imul(Q,Fe)|0,k=Math.imul(Q,Oe);var dn=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,P=Math.imul(H,Fe),w=Math.imul(H,Oe),w=w+Math.imul(z,Fe)|0,k=Math.imul(z,Oe),P=P+Math.imul(D,Ge)|0,w=w+Math.imul(D,Ye)|0,w=w+Math.imul(Q,Ge)|0,k=k+Math.imul(Q,Ye)|0;var pn=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(pn>>>26)|0,pn&=67108863,P=Math.imul(te,Fe),w=Math.imul(te,Oe),w=w+Math.imul(ae,Fe)|0,k=Math.imul(ae,Oe),P=P+Math.imul(H,Ge)|0,w=w+Math.imul(H,Ye)|0,w=w+Math.imul(z,Ge)|0,k=k+Math.imul(z,Ye)|0,P=P+Math.imul(D,it)|0,w=w+Math.imul(D,ot)|0,w=w+Math.imul(Q,it)|0,k=k+Math.imul(Q,ot)|0;var mn=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(mn>>>26)|0,mn&=67108863,P=Math.imul(ge,Fe),w=Math.imul(ge,Oe),w=w+Math.imul(ne,Fe)|0,k=Math.imul(ne,Oe),P=P+Math.imul(te,Ge)|0,w=w+Math.imul(te,Ye)|0,w=w+Math.imul(ae,Ge)|0,k=k+Math.imul(ae,Ye)|0,P=P+Math.imul(H,it)|0,w=w+Math.imul(H,ot)|0,w=w+Math.imul(z,it)|0,k=k+Math.imul(z,ot)|0,P=P+Math.imul(D,st)|0,w=w+Math.imul(D,tt)|0,w=w+Math.imul(Q,st)|0,k=k+Math.imul(Q,tt)|0;var Ur=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,P=Math.imul(ue,Fe),w=Math.imul(ue,Oe),w=w+Math.imul(ve,Fe)|0,k=Math.imul(ve,Oe),P=P+Math.imul(ge,Ge)|0,w=w+Math.imul(ge,Ye)|0,w=w+Math.imul(ne,Ge)|0,k=k+Math.imul(ne,Ye)|0,P=P+Math.imul(te,it)|0,w=w+Math.imul(te,ot)|0,w=w+Math.imul(ae,it)|0,k=k+Math.imul(ae,ot)|0,P=P+Math.imul(H,st)|0,w=w+Math.imul(H,tt)|0,w=w+Math.imul(z,st)|0,k=k+Math.imul(z,tt)|0,P=P+Math.imul(D,at)|0,w=w+Math.imul(D,ft)|0,w=w+Math.imul(Q,at)|0,k=k+Math.imul(Q,ft)|0;var bn=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(bn>>>26)|0,bn&=67108863,P=Math.imul(pe,Fe),w=Math.imul(pe,Oe),w=w+Math.imul(ke,Fe)|0,k=Math.imul(ke,Oe),P=P+Math.imul(ue,Ge)|0,w=w+Math.imul(ue,Ye)|0,w=w+Math.imul(ve,Ge)|0,k=k+Math.imul(ve,Ye)|0,P=P+Math.imul(ge,it)|0,w=w+Math.imul(ge,ot)|0,w=w+Math.imul(ne,it)|0,k=k+Math.imul(ne,ot)|0,P=P+Math.imul(te,st)|0,w=w+Math.imul(te,tt)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,tt)|0,P=P+Math.imul(H,at)|0,w=w+Math.imul(H,ft)|0,w=w+Math.imul(z,at)|0,k=k+Math.imul(z,ft)|0,P=P+Math.imul(D,ct)|0,w=w+Math.imul(D,Ze)|0,w=w+Math.imul(Q,ct)|0,k=k+Math.imul(Q,Ze)|0;var oi=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(oi>>>26)|0,oi&=67108863,P=Math.imul(Ne,Fe),w=Math.imul(Ne,Oe),w=w+Math.imul(We,Fe)|0,k=Math.imul(We,Oe),P=P+Math.imul(pe,Ge)|0,w=w+Math.imul(pe,Ye)|0,w=w+Math.imul(ke,Ge)|0,k=k+Math.imul(ke,Ye)|0,P=P+Math.imul(ue,it)|0,w=w+Math.imul(ue,ot)|0,w=w+Math.imul(ve,it)|0,k=k+Math.imul(ve,ot)|0,P=P+Math.imul(ge,st)|0,w=w+Math.imul(ge,tt)|0,w=w+Math.imul(ne,st)|0,k=k+Math.imul(ne,tt)|0,P=P+Math.imul(te,at)|0,w=w+Math.imul(te,ft)|0,w=w+Math.imul(ae,at)|0,k=k+Math.imul(ae,ft)|0,P=P+Math.imul(H,ct)|0,w=w+Math.imul(H,Ze)|0,w=w+Math.imul(z,ct)|0,k=k+Math.imul(z,Ze)|0,P=P+Math.imul(D,ut)|0,w=w+Math.imul(D,lt)|0,w=w+Math.imul(Q,ut)|0,k=k+Math.imul(Q,lt)|0;var Ro=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,P=Math.imul(le,Fe),w=Math.imul(le,Oe),w=w+Math.imul(oe,Fe)|0,k=Math.imul(oe,Oe),P=P+Math.imul(Ne,Ge)|0,w=w+Math.imul(Ne,Ye)|0,w=w+Math.imul(We,Ge)|0,k=k+Math.imul(We,Ye)|0,P=P+Math.imul(pe,it)|0,w=w+Math.imul(pe,ot)|0,w=w+Math.imul(ke,it)|0,k=k+Math.imul(ke,ot)|0,P=P+Math.imul(ue,st)|0,w=w+Math.imul(ue,tt)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,tt)|0,P=P+Math.imul(ge,at)|0,w=w+Math.imul(ge,ft)|0,w=w+Math.imul(ne,at)|0,k=k+Math.imul(ne,ft)|0,P=P+Math.imul(te,ct)|0,w=w+Math.imul(te,Ze)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,Ze)|0,P=P+Math.imul(H,ut)|0,w=w+Math.imul(H,lt)|0,w=w+Math.imul(z,ut)|0,k=k+Math.imul(z,lt)|0,P=P+Math.imul(D,ht)|0,w=w+Math.imul(D,dt)|0,w=w+Math.imul(Q,ht)|0,k=k+Math.imul(Q,dt)|0;var Oo=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,P=Math.imul(Z,Fe),w=Math.imul(Z,Oe),w=w+Math.imul(me,Fe)|0,k=Math.imul(me,Oe),P=P+Math.imul(le,Ge)|0,w=w+Math.imul(le,Ye)|0,w=w+Math.imul(oe,Ge)|0,k=k+Math.imul(oe,Ye)|0,P=P+Math.imul(Ne,it)|0,w=w+Math.imul(Ne,ot)|0,w=w+Math.imul(We,it)|0,k=k+Math.imul(We,ot)|0,P=P+Math.imul(pe,st)|0,w=w+Math.imul(pe,tt)|0,w=w+Math.imul(ke,st)|0,k=k+Math.imul(ke,tt)|0,P=P+Math.imul(ue,at)|0,w=w+Math.imul(ue,ft)|0,w=w+Math.imul(ve,at)|0,k=k+Math.imul(ve,ft)|0,P=P+Math.imul(ge,ct)|0,w=w+Math.imul(ge,Ze)|0,w=w+Math.imul(ne,ct)|0,k=k+Math.imul(ne,Ze)|0,P=P+Math.imul(te,ut)|0,w=w+Math.imul(te,lt)|0,w=w+Math.imul(ae,ut)|0,k=k+Math.imul(ae,lt)|0,P=P+Math.imul(H,ht)|0,w=w+Math.imul(H,dt)|0,w=w+Math.imul(z,ht)|0,k=k+Math.imul(z,dt)|0,P=P+Math.imul(D,pt)|0,w=w+Math.imul(D,rt)|0,w=w+Math.imul(Q,pt)|0,k=k+Math.imul(Q,rt)|0;var No=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(No>>>26)|0,No&=67108863,P=Math.imul(we,Fe),w=Math.imul(we,Oe),w=w+Math.imul(Ie,Fe)|0,k=Math.imul(Ie,Oe),P=P+Math.imul(Z,Ge)|0,w=w+Math.imul(Z,Ye)|0,w=w+Math.imul(me,Ge)|0,k=k+Math.imul(me,Ye)|0,P=P+Math.imul(le,it)|0,w=w+Math.imul(le,ot)|0,w=w+Math.imul(oe,it)|0,k=k+Math.imul(oe,ot)|0,P=P+Math.imul(Ne,st)|0,w=w+Math.imul(Ne,tt)|0,w=w+Math.imul(We,st)|0,k=k+Math.imul(We,tt)|0,P=P+Math.imul(pe,at)|0,w=w+Math.imul(pe,ft)|0,w=w+Math.imul(ke,at)|0,k=k+Math.imul(ke,ft)|0,P=P+Math.imul(ue,ct)|0,w=w+Math.imul(ue,Ze)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,Ze)|0,P=P+Math.imul(ge,ut)|0,w=w+Math.imul(ge,lt)|0,w=w+Math.imul(ne,ut)|0,k=k+Math.imul(ne,lt)|0,P=P+Math.imul(te,ht)|0,w=w+Math.imul(te,dt)|0,w=w+Math.imul(ae,ht)|0,k=k+Math.imul(ae,dt)|0,P=P+Math.imul(H,pt)|0,w=w+Math.imul(H,rt)|0,w=w+Math.imul(z,pt)|0,k=k+Math.imul(z,rt)|0,P=P+Math.imul(D,qt)|0,w=w+Math.imul(D,Ht)|0,w=w+Math.imul(Q,qt)|0,k=k+Math.imul(Q,Ht)|0;var ro=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(ro>>>26)|0,ro&=67108863,P=Math.imul(we,Ge),w=Math.imul(we,Ye),w=w+Math.imul(Ie,Ge)|0,k=Math.imul(Ie,Ye),P=P+Math.imul(Z,it)|0,w=w+Math.imul(Z,ot)|0,w=w+Math.imul(me,it)|0,k=k+Math.imul(me,ot)|0,P=P+Math.imul(le,st)|0,w=w+Math.imul(le,tt)|0,w=w+Math.imul(oe,st)|0,k=k+Math.imul(oe,tt)|0,P=P+Math.imul(Ne,at)|0,w=w+Math.imul(Ne,ft)|0,w=w+Math.imul(We,at)|0,k=k+Math.imul(We,ft)|0,P=P+Math.imul(pe,ct)|0,w=w+Math.imul(pe,Ze)|0,w=w+Math.imul(ke,ct)|0,k=k+Math.imul(ke,Ze)|0,P=P+Math.imul(ue,ut)|0,w=w+Math.imul(ue,lt)|0,w=w+Math.imul(ve,ut)|0,k=k+Math.imul(ve,lt)|0,P=P+Math.imul(ge,ht)|0,w=w+Math.imul(ge,dt)|0,w=w+Math.imul(ne,ht)|0,k=k+Math.imul(ne,dt)|0,P=P+Math.imul(te,pt)|0,w=w+Math.imul(te,rt)|0,w=w+Math.imul(ae,pt)|0,k=k+Math.imul(ae,rt)|0,P=P+Math.imul(H,qt)|0,w=w+Math.imul(H,Ht)|0,w=w+Math.imul(z,qt)|0,k=k+Math.imul(z,Ht)|0;var no=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(no>>>26)|0,no&=67108863,P=Math.imul(we,it),w=Math.imul(we,ot),w=w+Math.imul(Ie,it)|0,k=Math.imul(Ie,ot),P=P+Math.imul(Z,st)|0,w=w+Math.imul(Z,tt)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,tt)|0,P=P+Math.imul(le,at)|0,w=w+Math.imul(le,ft)|0,w=w+Math.imul(oe,at)|0,k=k+Math.imul(oe,ft)|0,P=P+Math.imul(Ne,ct)|0,w=w+Math.imul(Ne,Ze)|0,w=w+Math.imul(We,ct)|0,k=k+Math.imul(We,Ze)|0,P=P+Math.imul(pe,ut)|0,w=w+Math.imul(pe,lt)|0,w=w+Math.imul(ke,ut)|0,k=k+Math.imul(ke,lt)|0,P=P+Math.imul(ue,ht)|0,w=w+Math.imul(ue,dt)|0,w=w+Math.imul(ve,ht)|0,k=k+Math.imul(ve,dt)|0,P=P+Math.imul(ge,pt)|0,w=w+Math.imul(ge,rt)|0,w=w+Math.imul(ne,pt)|0,k=k+Math.imul(ne,rt)|0,P=P+Math.imul(te,qt)|0,w=w+Math.imul(te,Ht)|0,w=w+Math.imul(ae,qt)|0,k=k+Math.imul(ae,Ht)|0;var io=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(io>>>26)|0,io&=67108863,P=Math.imul(we,st),w=Math.imul(we,tt),w=w+Math.imul(Ie,st)|0,k=Math.imul(Ie,tt),P=P+Math.imul(Z,at)|0,w=w+Math.imul(Z,ft)|0,w=w+Math.imul(me,at)|0,k=k+Math.imul(me,ft)|0,P=P+Math.imul(le,ct)|0,w=w+Math.imul(le,Ze)|0,w=w+Math.imul(oe,ct)|0,k=k+Math.imul(oe,Ze)|0,P=P+Math.imul(Ne,ut)|0,w=w+Math.imul(Ne,lt)|0,w=w+Math.imul(We,ut)|0,k=k+Math.imul(We,lt)|0,P=P+Math.imul(pe,ht)|0,w=w+Math.imul(pe,dt)|0,w=w+Math.imul(ke,ht)|0,k=k+Math.imul(ke,dt)|0,P=P+Math.imul(ue,pt)|0,w=w+Math.imul(ue,rt)|0,w=w+Math.imul(ve,pt)|0,k=k+Math.imul(ve,rt)|0,P=P+Math.imul(ge,qt)|0,w=w+Math.imul(ge,Ht)|0,w=w+Math.imul(ne,qt)|0,k=k+Math.imul(ne,Ht)|0;var Po=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Po>>>26)|0,Po&=67108863,P=Math.imul(we,at),w=Math.imul(we,ft),w=w+Math.imul(Ie,at)|0,k=Math.imul(Ie,ft),P=P+Math.imul(Z,ct)|0,w=w+Math.imul(Z,Ze)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,Ze)|0,P=P+Math.imul(le,ut)|0,w=w+Math.imul(le,lt)|0,w=w+Math.imul(oe,ut)|0,k=k+Math.imul(oe,lt)|0,P=P+Math.imul(Ne,ht)|0,w=w+Math.imul(Ne,dt)|0,w=w+Math.imul(We,ht)|0,k=k+Math.imul(We,dt)|0,P=P+Math.imul(pe,pt)|0,w=w+Math.imul(pe,rt)|0,w=w+Math.imul(ke,pt)|0,k=k+Math.imul(ke,rt)|0,P=P+Math.imul(ue,qt)|0,w=w+Math.imul(ue,Ht)|0,w=w+Math.imul(ve,qt)|0,k=k+Math.imul(ve,Ht)|0;var Lo=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,P=Math.imul(we,ct),w=Math.imul(we,Ze),w=w+Math.imul(Ie,ct)|0,k=Math.imul(Ie,Ze),P=P+Math.imul(Z,ut)|0,w=w+Math.imul(Z,lt)|0,w=w+Math.imul(me,ut)|0,k=k+Math.imul(me,lt)|0,P=P+Math.imul(le,ht)|0,w=w+Math.imul(le,dt)|0,w=w+Math.imul(oe,ht)|0,k=k+Math.imul(oe,dt)|0,P=P+Math.imul(Ne,pt)|0,w=w+Math.imul(Ne,rt)|0,w=w+Math.imul(We,pt)|0,k=k+Math.imul(We,rt)|0,P=P+Math.imul(pe,qt)|0,w=w+Math.imul(pe,Ht)|0,w=w+Math.imul(ke,qt)|0,k=k+Math.imul(ke,Ht)|0;var Bo=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,P=Math.imul(we,ut),w=Math.imul(we,lt),w=w+Math.imul(Ie,ut)|0,k=Math.imul(Ie,lt),P=P+Math.imul(Z,ht)|0,w=w+Math.imul(Z,dt)|0,w=w+Math.imul(me,ht)|0,k=k+Math.imul(me,dt)|0,P=P+Math.imul(le,pt)|0,w=w+Math.imul(le,rt)|0,w=w+Math.imul(oe,pt)|0,k=k+Math.imul(oe,rt)|0,P=P+Math.imul(Ne,qt)|0,w=w+Math.imul(Ne,Ht)|0,w=w+Math.imul(We,qt)|0,k=k+Math.imul(We,Ht)|0;var Uo=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,P=Math.imul(we,ht),w=Math.imul(we,dt),w=w+Math.imul(Ie,ht)|0,k=Math.imul(Ie,dt),P=P+Math.imul(Z,pt)|0,w=w+Math.imul(Z,rt)|0,w=w+Math.imul(me,pt)|0,k=k+Math.imul(me,rt)|0,P=P+Math.imul(le,qt)|0,w=w+Math.imul(le,Ht)|0,w=w+Math.imul(oe,qt)|0,k=k+Math.imul(oe,Ht)|0;var Cf=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Cf>>>26)|0,Cf&=67108863,P=Math.imul(we,pt),w=Math.imul(we,rt),w=w+Math.imul(Ie,pt)|0,k=Math.imul(Ie,rt),P=P+Math.imul(Z,qt)|0,w=w+Math.imul(Z,Ht)|0,w=w+Math.imul(me,qt)|0,k=k+Math.imul(me,Ht)|0;var kf=(T+P|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(kf>>>26)|0,kf&=67108863,P=Math.imul(we,qt),w=Math.imul(we,Ht),w=w+Math.imul(Ie,qt)|0,k=Math.imul(Ie,Ht);var If=(T+P|0)+((w&8191)<<13)|0;return T=(k+(w>>>13)|0)+(If>>>26)|0,If&=67108863,v[0]=dn,v[1]=pn,v[2]=mn,v[3]=Ur,v[4]=bn,v[5]=oi,v[6]=Ro,v[7]=Oo,v[8]=No,v[9]=ro,v[10]=no,v[11]=io,v[12]=Po,v[13]=Lo,v[14]=Bo,v[15]=Uo,v[16]=Cf,v[17]=kf,v[18]=If,T!==0&&(v[19]=T,_.length++),_},"comb10MulTo");Math.imul||(L=X);function J(b,l,m){m.negative=l.negative^b.negative,m.length=b.length+l.length;for(var _=0,S=0,A=0;A<m.length-1;A++){var v=S;S=0;for(var T=_&67108863,P=Math.min(A,l.length-1),w=Math.max(0,A-b.length+1);w<=P;w++){var k=A-w,fe=b.words[k]|0,D=l.words[w]|0,Q=fe*D,se=Q&67108863;v=v+(Q/67108864|0)|0,se=se+T|0,T=se&67108863,v=v+(se>>>26)|0,S+=v>>>26,v&=67108863}m.words[A]=T,_=v,v=S}return _!==0?m.words[A]=_:m.length--,m._strip()}o(J,"bigMulTo");function ee(b,l,m){return J(b,l,m)}o(ee,"jumboMulTo"),i.prototype.mulTo=o(function(l,m){var _,S=this.length+l.length;return this.length===10&&l.length===10?_=L(this,l,m):S<63?_=X(this,l,m):S<1024?_=J(this,l,m):_=ee(this,l,m),_},"mulTo");function Y(b,l){this.x=b,this.y=l}o(Y,"FFTM"),Y.prototype.makeRBT=o(function(l){for(var m=new Array(l),_=i.prototype._countBits(l)-1,S=0;S<l;S++)m[S]=this.revBin(S,_,l);return m},"makeRBT"),Y.prototype.revBin=o(function(l,m,_){if(l===0||l===_-1)return l;for(var S=0,A=0;A<m;A++)S|=(l&1)<<m-A-1,l>>=1;return S},"revBin"),Y.prototype.permute=o(function(l,m,_,S,A,v){for(var T=0;T<v;T++)S[T]=m[l[T]],A[T]=_[l[T]]},"permute"),Y.prototype.transform=o(function(l,m,_,S,A,v){this.permute(v,l,m,_,S,A);for(var T=1;T<A;T<<=1)for(var P=T<<1,w=Math.cos(2*Math.PI/P),k=Math.sin(2*Math.PI/P),fe=0;fe<A;fe+=P)for(var D=w,Q=k,se=0;se<T;se++){var H=_[fe+se],z=S[fe+se],V=_[fe+se+T],te=S[fe+se+T],ae=D*V-Q*te;te=D*te+Q*V,V=ae,_[fe+se]=H+V,S[fe+se]=z+te,_[fe+se+T]=H-V,S[fe+se+T]=z-te,se!==P&&(ae=w*D-k*Q,Q=w*Q+k*D,D=ae)}},"transform"),Y.prototype.guessLen13b=o(function(l,m){var _=Math.max(m,l)|1,S=_&1,A=0;for(_=_/2|0;_;_=_>>>1)A++;return 1<<A+1+S},"guessLen13b"),Y.prototype.conjugate=o(function(l,m,_){if(!(_<=1))for(var S=0;S<_/2;S++){var A=l[S];l[S]=l[_-S-1],l[_-S-1]=A,A=m[S],m[S]=-m[_-S-1],m[_-S-1]=-A}},"conjugate"),Y.prototype.normalize13b=o(function(l,m){for(var _=0,S=0;S<m/2;S++){var A=Math.round(l[2*S+1]/m)*8192+Math.round(l[2*S]/m)+_;l[S]=A&67108863,A<67108864?_=0:_=A/67108864|0}return l},"normalize13b"),Y.prototype.convert13b=o(function(l,m,_,S){for(var A=0,v=0;v<m;v++)A=A+(l[v]|0),_[2*v]=A&8191,A=A>>>13,_[2*v+1]=A&8191,A=A>>>13;for(v=2*m;v<S;++v)_[v]=0;t(A===0),t((A&-8192)===0)},"convert13b"),Y.prototype.stub=o(function(l){for(var m=new Array(l),_=0;_<l;_++)m[_]=0;return m},"stub"),Y.prototype.mulp=o(function(l,m,_){var S=2*this.guessLen13b(l.length,m.length),A=this.makeRBT(S),v=this.stub(S),T=new Array(S),P=new Array(S),w=new Array(S),k=new Array(S),fe=new Array(S),D=new Array(S),Q=_.words;Q.length=S,this.convert13b(l.words,l.length,T,S),this.convert13b(m.words,m.length,k,S),this.transform(T,v,P,w,S,A),this.transform(k,v,fe,D,S,A);for(var se=0;se<S;se++){var H=P[se]*fe[se]-w[se]*D[se];w[se]=P[se]*D[se]+w[se]*fe[se],P[se]=H}return this.conjugate(P,w,S),this.transform(P,w,Q,v,S,A),this.conjugate(Q,v,S),this.normalize13b(Q,S),_.negative=l.negative^m.negative,_.length=l.length+m.length,_._strip()},"mulp"),i.prototype.mul=o(function(l){var m=new i(null);return m.words=new Array(this.length+l.length),this.mulTo(l,m)},"mul"),i.prototype.mulf=o(function(l){var m=new i(null);return m.words=new Array(this.length+l.length),ee(this,l,m)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var m=l<0;m&&(l=-l),t(typeof l=="number"),t(l<67108864);for(var _=0,S=0;S<this.length;S++){var A=(this.words[S]|0)*l,v=(A&67108863)+(_&67108863);_>>=26,_+=A/67108864|0,_+=v>>>26,this.words[S]=v&67108863}return _!==0&&(this.words[S]=_,this.length++),m?this.ineg():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 m=N(l);if(m.length===0)return new i(1);for(var _=this,S=0;S<m.length&&m[S]===0;S++,_=_.sqr());if(++S<m.length)for(var A=_.sqr();S<m.length;S++,A=A.sqr())m[S]!==0&&(_=_.mul(A));return _},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26,S=67108863>>>26-m<<26-m,A;if(m!==0){var v=0;for(A=0;A<this.length;A++){var T=this.words[A]&S,P=(this.words[A]|0)-T<<m;this.words[A]=P|v,v=T>>>26-m}v&&(this.words[A]=v,this.length++)}if(_!==0){for(A=this.length-1;A>=0;A--)this.words[A+_]=this.words[A];for(A=0;A<_;A++)this.words[A]=0;this.length+=_}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,m,_){t(typeof l=="number"&&l>=0);var S;m?S=(m-m%26)/26:S=0;var A=l%26,v=Math.min((l-A)/26,this.length),T=67108863^67108863>>>A<<A,P=_;if(S-=v,S=Math.max(0,S),P){for(var w=0;w<v;w++)P.words[w]=this.words[w];P.length=v}if(v!==0)if(this.length>v)for(this.length-=v,w=0;w<this.length;w++)this.words[w]=this.words[w+v];else this.words[0]=0,this.length=1;var k=0;for(w=this.length-1;w>=0&&(k!==0||w>=S);w--){var fe=this.words[w]|0;this.words[w]=k<<26-A|fe>>>A,k=fe&T}return P&&k!==0&&(P.words[P.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(l,m,_){return t(this.negative===0),this.iushrn(l,m,_)},"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 m=l%26,_=(l-m)/26,S=1<<m;if(this.length<=_)return!1;var A=this.words[_];return!!(A&S)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(m!==0&&_++,this.length=Math.min(_,this.length),m!==0){var S=67108863^67108863>>>m<<m;this.words[this.length-1]&=S}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 m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+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 m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+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,m,_){var S=l.length+_,A;this._expand(S);var v,T=0;for(A=0;A<l.length;A++){v=(this.words[A+_]|0)+T;var P=(l.words[A]|0)*m;v-=P&67108863,T=(v>>26)-(P/67108864|0),this.words[A+_]=v&67108863}for(;A<this.length-_;A++)v=(this.words[A+_]|0)+T,T=v>>26,this.words[A+_]=v&67108863;if(T===0)return this._strip();for(t(T===-1),T=0,A=0;A<this.length;A++)v=-(this.words[A]|0)+T,T=v>>26,this.words[A]=v&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,m){var _=this.length-l.length,S=this.clone(),A=l,v=A.words[A.length-1]|0,T=this._countBits(v);_=26-T,_!==0&&(A=A.ushln(_),S.iushln(_),v=A.words[A.length-1]|0);var P=S.length-A.length,w;if(m!=="mod"){w=new i(null),w.length=P+1,w.words=new Array(w.length);for(var k=0;k<w.length;k++)w.words[k]=0}var fe=S.clone()._ishlnsubmul(A,1,P);fe.negative===0&&(S=fe,w&&(w.words[P]=1));for(var D=P-1;D>=0;D--){var Q=(S.words[A.length+D]|0)*67108864+(S.words[A.length+D-1]|0);for(Q=Math.min(Q/v|0,67108863),S._ishlnsubmul(A,Q,D);S.negative!==0;)Q--,S.negative=0,S._ishlnsubmul(A,1,D),S.isZero()||(S.negative^=1);w&&(w.words[D]=Q)}return w&&w._strip(),S._strip(),m!=="div"&&_!==0&&S.iushrn(_),{div:w||null,mod:S}},"_wordDiv"),i.prototype.divmod=o(function(l,m,_){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var S,A,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,m),m!=="mod"&&(S=v.div.neg()),m!=="div"&&(A=v.mod.neg(),_&&A.negative!==0&&A.iadd(l)),{div:S,mod:A}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),m),m!=="mod"&&(S=v.div.neg()),{div:S,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),m),m!=="div"&&(A=v.mod.neg(),_&&A.negative!==0&&A.isub(l)),{div:v.div,mod:A}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?m==="div"?{div:this.divn(l.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,m)},"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 m=this.divmod(l);if(m.mod.isZero())return m.div;var _=m.div.negative!==0?m.mod.isub(l):m.mod,S=l.ushrn(1),A=l.andln(1),v=_.cmp(S);return v<0||A===1&&v===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var m=l<0;m&&(l=-l),t(l<=67108863);for(var _=(1<<26)%l,S=0,A=this.length-1;A>=0;A--)S=(_*S+(this.words[A]|0))%l;return m?-S:S},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var m=l<0;m&&(l=-l),t(l<=67108863);for(var _=0,S=this.length-1;S>=0;S--){var A=(this.words[S]|0)+_*67108864;this.words[S]=A/l|0,_=A%l}return this._strip(),m?this.ineg():this},"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 m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var S=new i(1),A=new i(0),v=new i(0),T=new i(1),P=0;m.isEven()&&_.isEven();)m.iushrn(1),_.iushrn(1),++P;for(var w=_.clone(),k=m.clone();!m.isZero();){for(var fe=0,D=1;(m.words[0]&D)===0&&fe<26;++fe,D<<=1);if(fe>0)for(m.iushrn(fe);fe-- >0;)(S.isOdd()||A.isOdd())&&(S.iadd(w),A.isub(k)),S.iushrn(1),A.iushrn(1);for(var Q=0,se=1;(_.words[0]&se)===0&&Q<26;++Q,se<<=1);if(Q>0)for(_.iushrn(Q);Q-- >0;)(v.isOdd()||T.isOdd())&&(v.iadd(w),T.isub(k)),v.iushrn(1),T.iushrn(1);m.cmp(_)>=0?(m.isub(_),S.isub(v),A.isub(T)):(_.isub(m),v.isub(S),T.isub(A))}return{a:v,b:T,gcd:_.iushln(P)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var S=new i(1),A=new i(0),v=_.clone();m.cmpn(1)>0&&_.cmpn(1)>0;){for(var T=0,P=1;(m.words[0]&P)===0&&T<26;++T,P<<=1);if(T>0)for(m.iushrn(T);T-- >0;)S.isOdd()&&S.iadd(v),S.iushrn(1);for(var w=0,k=1;(_.words[0]&k)===0&&w<26;++w,k<<=1);if(w>0)for(_.iushrn(w);w-- >0;)A.isOdd()&&A.iadd(v),A.iushrn(1);m.cmp(_)>=0?(m.isub(_),S.isub(A)):(_.isub(m),A.isub(S))}var fe;return m.cmpn(1)===0?fe=S:fe=A,fe.cmpn(0)<0&&fe.iadd(l),fe},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var m=this.clone(),_=l.clone();m.negative=0,_.negative=0;for(var S=0;m.isEven()&&_.isEven();S++)m.iushrn(1),_.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;_.isEven();)_.iushrn(1);var A=m.cmp(_);if(A<0){var v=m;m=_,_=v}else if(A===0||_.cmpn(1)===0)break;m.isub(_)}while(!0);return _.iushln(S)},"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 m=l%26,_=(l-m)/26,S=1<<m;if(this.length<=_)return this._expand(_+1),this.words[_]|=S,this;for(var A=S,v=_;A!==0&&v<this.length;v++){var T=this.words[v]|0;T+=A,A=T>>>26,T&=67108863,this.words[v]=T}return A!==0&&(this.words[v]=A,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 m=l<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var _;if(this.length>1)_=1;else{m&&(l=-l),t(l<=67108863,"Number is too big");var S=this.words[0]|0;_=S===l?0:S<l?-1:1}return this.negative!==0?-_|0:_},"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 m=this.ucmp(l);return this.negative!==0?-m|0:m},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var m=0,_=this.length-1;_>=0;_--){var S=this.words[_]|0,A=l.words[_]|0;if(S!==A){S<A?m=-1:S>A&&(m=1);break}}return m},"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 h(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 ie={k256:null,p224:null,p192:null,p25519:null};function G(b,l){this.name=b,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(G,"MPrime"),G.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),G.prototype.ireduce=o(function(l){var m=l,_;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),_=m.bitLength();while(_>this.n);var S=_<this.n?-1:m.ucmp(this.p);return S===0?(m.words[0]=0,m.length=1):S>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),G.prototype.split=o(function(l,m){l.iushrn(this.n,0,m)},"split"),G.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function $(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o($,"K256"),n($,G),$.prototype.split=o(function(l,m){for(var _=4194303,S=Math.min(l.length,9),A=0;A<S;A++)m.words[A]=l.words[A];if(m.length=S,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(m.words[m.length++]=v&_,A=10;A<l.length;A++){var T=l.words[A]|0;l.words[A-10]=(T&_)<<4|v>>>22,v=T}v>>>=22,l.words[A-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},"split"),$.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var m=0,_=0;_<l.length;_++){var S=l.words[_]|0;m+=S*977,l.words[_]=m&67108863,m=S*64+(m/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function K(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(K,"P224"),n(K,G);function he(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(he,"P192"),n(he,G);function C(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(C,"P25519"),n(C,G),C.prototype.imulK=o(function(l){for(var m=0,_=0;_<l.length;_++){var S=(l.words[_]|0)*19+m,A=S&67108863;S>>>=26,l.words[_]=A,m=S}return m!==0&&(l.words[l.length++]=m),l},"imulK"),i._prime=o(function(l){if(ie[l])return ie[l];var m;if(l==="k256")m=new $;else if(l==="p224")m=new K;else if(l==="p192")m=new he;else if(l==="p25519")m=new C;else throw new Error("Unknown prime "+l);return ie[l]=m,m},"prime");function h(b){if(typeof b=="string"){var l=i._prime(b);this.m=l.p,this.prime=l}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,m){t((l.negative|m.negative)===0,"red works only with positives"),t(l.red&&l.red===m.red,"red works only with red numbers")},"_verify2"),h.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(g(l,l.umod(this.m)._forceRed(this)),l)},"imod"),h.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),h.prototype.add=o(function(l,m){this._verify2(l,m);var _=l.add(m);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},"add"),h.prototype.iadd=o(function(l,m){this._verify2(l,m);var _=l.iadd(m);return _.cmp(this.m)>=0&&_.isub(this.m),_},"iadd"),h.prototype.sub=o(function(l,m){this._verify2(l,m);var _=l.sub(m);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},"sub"),h.prototype.isub=o(function(l,m){this._verify2(l,m);var _=l.isub(m);return _.cmpn(0)<0&&_.iadd(this.m),_},"isub"),h.prototype.shl=o(function(l,m){return this._verify1(l),this.imod(l.ushln(m))},"shl"),h.prototype.imul=o(function(l,m){return this._verify2(l,m),this.imod(l.imul(m))},"imul"),h.prototype.mul=o(function(l,m){return this._verify2(l,m),this.imod(l.mul(m))},"mul"),h.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),h.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),h.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var _=this.m.add(new i(1)).iushrn(2);return this.pow(l,_)}for(var S=this.m.subn(1),A=0;!S.isZero()&&S.andln(1)===0;)A++,S.iushrn(1);t(!S.isZero());var v=new i(1).toRed(this),T=v.redNeg(),P=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,P).cmp(T)!==0;)w.redIAdd(T);for(var k=this.pow(w,S),fe=this.pow(l,S.addn(1).iushrn(1)),D=this.pow(l,S),Q=A;D.cmp(v)!==0;){for(var se=D,H=0;se.cmp(v)!==0;H++)se=se.redSqr();t(H<Q);var z=this.pow(k,new i(1).iushln(Q-H-1));fe=fe.redMul(z),k=z.redSqr(),D=D.redMul(k),Q=H}return fe},"sqrt"),h.prototype.invm=o(function(l){var m=l._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},"invm"),h.prototype.pow=o(function(l,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return l.clone();var _=4,S=new Array(1<<_);S[0]=new i(1).toRed(this),S[1]=l;for(var A=2;A<S.length;A++)S[A]=this.mul(S[A-1],l);var v=S[0],T=0,P=0,w=m.bitLength()%26;for(w===0&&(w=26),A=m.length-1;A>=0;A--){for(var k=m.words[A],fe=w-1;fe>=0;fe--){var D=k>>fe&1;if(v!==S[0]&&(v=this.sqr(v)),D===0&&T===0){P=0;continue}T<<=1,T|=D,P++,!(P!==_&&(A!==0||fe!==0))&&(v=this.mul(v,S[T]),P=0,T=0)}w=26}return v},"pow"),h.prototype.convertTo=o(function(l){var m=l.umod(this.m);return m===l?m.clone():m},"convertTo"),h.prototype.convertFrom=o(function(l){var m=l.clone();return m.red=null,m},"convertFrom"),i.mont=o(function(l){return new x(l)},"mont");function x(b){h.call(this,b),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(x,"Mont"),n(x,h),x.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),x.prototype.convertFrom=o(function(l){var m=this.imod(l.mul(this.rinv));return m.red=null,m},"convertFrom"),x.prototype.imul=o(function(l,m){if(l.isZero()||m.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(m),S=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=_.isub(S).iushrn(this.shift),v=A;return A.cmp(this.m)>=0?v=A.isub(this.m):A.cmpn(0)<0&&(v=A.iadd(this.m)),v._forceRed(this)},"imul"),x.prototype.mul=o(function(l,m){if(l.isZero()||m.isZero())return new i(0)._forceRed(this);var _=l.mul(m),S=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=_.isub(S).iushrn(this.shift),v=A;return A.cmp(this.m)>=0?v=A.isub(this.m):A.cmpn(0)<0&&(v=A.iadd(this.m)),v._forceRed(this)},"mul"),x.prototype.invm=o(function(l){var m=this.imod(l._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm")})(typeof Kb>"u"||Kb,f8)});var V8=Re((EY,G8)=>{G8.exports=og;var j8=128,cU=127,uU=~cU,lU=Math.pow(2,31);function og(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw og.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=lU;)e[t++]=r&255|j8,r/=128;for(;r&uU;)e[t++]=r&255|j8,r>>>=7;return e[t]=r|0,og.bytes=t-n+1,e}o(og,"encode")});var Y8=Re((AY,J8)=>{J8.exports=sg;var hU=128,W8=127;function sg(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u||i>49)throw sg.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&W8)<<i:(f&W8)*Math.pow(2,i),i+=7}while(f>=hU);return sg.bytes=s-n,t}o(sg,"read")});var Z8=Re((SY,X8)=>{var dU=Math.pow(2,7),pU=Math.pow(2,14),mU=Math.pow(2,21),bU=Math.pow(2,28),gU=Math.pow(2,35),vU=Math.pow(2,42),yU=Math.pow(2,49),xU=Math.pow(2,56),wU=Math.pow(2,63);X8.exports=function(r){return r<dU?1:r<pU?2:r<mU?3:r<bU?4:r<gU?5:r<vU?6:r<yU?7:r<xU?8:r<wU?9:10}});var ll=Re((MY,Q8)=>{Q8.exports={encode:V8(),decode:Y8(),encodingLength:Z8()}});var u_=Re((DY,c_)=>{"use strict";c_.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(f){return function(u,d){var g={key:u,value:f[u]},y={key:d,value:f[d]};return s(g,y)}}}(e.cmp),i=[];return o(function s(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var u,d;if(Array.isArray(f)){for(d="[",u=0;u<f.length;u++)u&&(d+=","),d+=s(f[u])||"null";return d+"]"}if(f===null)return"null";if(i.indexOf(f)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=i.push(f)-1,y=Object.keys(f).sort(n&&n(f));for(d="",u=0;u<y.length;u++){var E=y[u],O=s(f[E]);!O||(d&&(d+=","),d+=JSON.stringify(E)+":"+O)}return i.splice(g,1),"{"+d+"}"}},"stringify")(r)}});var Uc=Re((bl,Nc)=>{var nF=200,C_="__lodash_hash_undefined__",k_=9007199254740991,Cg="[object Arguments]",iF="[object Array]",I_="[object Boolean]",D_="[object Date]",oF="[object Error]",kg="[object Function]",R_="[object GeneratorFunction]",w0="[object Map]",O_="[object Number]",Ig="[object Object]",g_="[object Promise]",N_="[object RegExp]",_0="[object Set]",P_="[object String]",L_="[object Symbol]",_g="[object WeakMap]",B_="[object ArrayBuffer]",E0="[object DataView]",U_="[object Float32Array]",F_="[object Float64Array]",$_="[object Int8Array]",q_="[object Int16Array]",H_="[object Int32Array]",z_="[object Uint8Array]",K_="[object Uint8ClampedArray]",j_="[object Uint16Array]",G_="[object Uint32Array]",sF=/[\\^$.*+?()[\]{}|]/g,aF=/\w*$/,fF=/^\[object .+?Constructor\]$/,cF=/^(?:0|[1-9]\d*)$/,or={};or[Cg]=or[iF]=or[B_]=or[E0]=or[I_]=or[D_]=or[U_]=or[F_]=or[$_]=or[q_]=or[H_]=or[w0]=or[O_]=or[Ig]=or[N_]=or[_0]=or[P_]=or[L_]=or[z_]=or[K_]=or[j_]=or[G_]=!0;or[oF]=or[kg]=or[_g]=!1;var uF=typeof global=="object"&&global&&global.Object===Object&&global,lF=typeof self=="object"&&self&&self.Object===Object&&self,us=uF||lF||Function("return this")(),V_=typeof bl=="object"&&bl&&!bl.nodeType&&bl,v_=V_&&typeof Nc=="object"&&Nc&&!Nc.nodeType&&Nc,hF=v_&&v_.exports===V_;function dF(r,e){return r.set(e[0],e[1]),r}o(dF,"addMapEntry");function pF(r,e){return r.add(e),r}o(pF,"addSetEntry");function mF(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(mF,"arrayEach");function bF(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(bF,"arrayPush");function W_(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(W_,"arrayReduce");function gF(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(gF,"baseTimes");function vF(r,e){return r?.[e]}o(vF,"getValue");function J_(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}o(J_,"isHostObject");function y_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(y_,"mapToArray");function Dg(r,e){return function(t){return r(e(t))}}o(Dg,"overArg");function x_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(x_,"setToArray");var yF=Array.prototype,xF=Function.prototype,A0=Object.prototype,wg=us["__core-js_shared__"],w_=function(){var r=/[^.]+$/.exec(wg&&wg.keys&&wg.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Y_=xF.toString,ia=A0.hasOwnProperty,S0=A0.toString,wF=RegExp("^"+Y_.call(ia).replace(sF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),__=hF?us.Buffer:void 0,E_=us.Symbol,A_=us.Uint8Array,_F=Dg(Object.getPrototypeOf,Object),EF=Object.create,AF=A0.propertyIsEnumerable,SF=yF.splice,S_=Object.getOwnPropertySymbols,MF=__?__.isBuffer:void 0,TF=Dg(Object.keys,Object),Eg=Bc(us,"DataView"),gl=Bc(us,"Map"),Ag=Bc(us,"Promise"),Sg=Bc(us,"Set"),Mg=Bc(us,"WeakMap"),vl=Bc(Object,"create"),CF=cf(Eg),kF=cf(gl),IF=cf(Ag),DF=cf(Sg),RF=cf(Mg),M_=E_?E_.prototype:void 0,T_=M_?M_.valueOf:void 0;function ff(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(ff,"Hash");function OF(){this.__data__=vl?vl(null):{}}o(OF,"hashClear");function NF(r){return this.has(r)&&delete this.__data__[r]}o(NF,"hashDelete");function PF(r){var e=this.__data__;if(vl){var t=e[r];return t===C_?void 0:t}return ia.call(e,r)?e[r]:void 0}o(PF,"hashGet");function LF(r){var e=this.__data__;return vl?e[r]!==void 0:ia.call(e,r)}o(LF,"hashHas");function BF(r,e){var t=this.__data__;return t[r]=vl&&e===void 0?C_:e,this}o(BF,"hashSet");ff.prototype.clear=OF;ff.prototype.delete=NF;ff.prototype.get=PF;ff.prototype.has=LF;ff.prototype.set=BF;function ls(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(ls,"ListCache");function UF(){this.__data__=[]}o(UF,"listCacheClear");function FF(r){var e=this.__data__,t=M0(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():SF.call(e,t,1),!0}o(FF,"listCacheDelete");function $F(r){var e=this.__data__,t=M0(e,r);return t<0?void 0:e[t][1]}o($F,"listCacheGet");function qF(r){return M0(this.__data__,r)>-1}o(qF,"listCacheHas");function HF(r,e){var t=this.__data__,n=M0(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(HF,"listCacheSet");ls.prototype.clear=UF;ls.prototype.delete=FF;ls.prototype.get=$F;ls.prototype.has=qF;ls.prototype.set=HF;function Pc(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(Pc,"MapCache");function zF(){this.__data__={hash:new ff,map:new(gl||ls),string:new ff}}o(zF,"mapCacheClear");function KF(r){return T0(this,r).delete(r)}o(KF,"mapCacheDelete");function jF(r){return T0(this,r).get(r)}o(jF,"mapCacheGet");function GF(r){return T0(this,r).has(r)}o(GF,"mapCacheHas");function VF(r,e){return T0(this,r).set(r,e),this}o(VF,"mapCacheSet");Pc.prototype.clear=zF;Pc.prototype.delete=KF;Pc.prototype.get=jF;Pc.prototype.has=GF;Pc.prototype.set=VF;function Lc(r){this.__data__=new ls(r)}o(Lc,"Stack");function WF(){this.__data__=new ls}o(WF,"stackClear");function JF(r){return this.__data__.delete(r)}o(JF,"stackDelete");function YF(r){return this.__data__.get(r)}o(YF,"stackGet");function XF(r){return this.__data__.has(r)}o(XF,"stackHas");function ZF(r,e){var t=this.__data__;if(t instanceof ls){var n=t.__data__;if(!gl||n.length<nF-1)return n.push([r,e]),this;t=this.__data__=new Pc(n)}return t.set(r,e),this}o(ZF,"stackSet");Lc.prototype.clear=WF;Lc.prototype.delete=JF;Lc.prototype.get=YF;Lc.prototype.has=XF;Lc.prototype.set=ZF;function QF(r,e){var t=Og(r)||E$(r)?gF(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||ia.call(r,s))&&!(i&&(s=="length"||y$(s,n)))&&t.push(s);return t}o(QF,"arrayLikeKeys");function X_(r,e,t){var n=r[e];(!(ia.call(r,e)&&tE(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(X_,"assignValue");function M0(r,e){for(var t=r.length;t--;)if(tE(r[t][0],e))return t;return-1}o(M0,"assocIndexOf");function e$(r,e){return r&&Z_(e,Ng(e),r)}o(e$,"baseAssign");function Tg(r,e,t,n,i,s,f){var u;if(n&&(u=s?n(r,i,s,f):n(r)),u!==void 0)return u;if(!C0(r))return r;var d=Og(r);if(d){if(u=b$(r),!e)return d$(r,u)}else{var g=af(r),y=g==kg||g==R_;if(S$(r))return s$(r,e);if(g==Ig||g==Cg||y&&!s){if(J_(r))return s?r:{};if(u=g$(y?{}:r),!e)return p$(r,e$(u,r))}else{if(!or[g])return s?r:{};u=v$(r,g,Tg,e)}}f||(f=new Lc);var E=f.get(r);if(E)return E;if(f.set(r,u),!d)var O=t?m$(r):Ng(r);return mF(O||r,function(R,I){O&&(I=R,R=r[I]),X_(u,I,Tg(R,e,t,n,I,r,f))}),u}o(Tg,"baseClone");function t$(r){return C0(r)?EF(r):{}}o(t$,"baseCreate");function r$(r,e,t){var n=e(r);return Og(r)?n:bF(n,t(r))}o(r$,"baseGetAllKeys");function n$(r){return S0.call(r)}o(n$,"baseGetTag");function i$(r){if(!C0(r)||w$(r))return!1;var e=nE(r)||J_(r)?wF:fF;return e.test(cf(r))}o(i$,"baseIsNative");function o$(r){if(!eE(r))return TF(r);var e=[];for(var t in Object(r))ia.call(r,t)&&t!="constructor"&&e.push(t);return e}o(o$,"baseKeys");function s$(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(s$,"cloneBuffer");function Rg(r){var e=new r.constructor(r.byteLength);return new A_(e).set(new A_(r)),e}o(Rg,"cloneArrayBuffer");function a$(r,e){var t=e?Rg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(a$,"cloneDataView");function f$(r,e,t){var n=e?t(y_(r),!0):y_(r);return W_(n,dF,new r.constructor)}o(f$,"cloneMap");function c$(r){var e=new r.constructor(r.source,aF.exec(r));return e.lastIndex=r.lastIndex,e}o(c$,"cloneRegExp");function u$(r,e,t){var n=e?t(x_(r),!0):x_(r);return W_(n,pF,new r.constructor)}o(u$,"cloneSet");function l$(r){return T_?Object(T_.call(r)):{}}o(l$,"cloneSymbol");function h$(r,e){var t=e?Rg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(h$,"cloneTypedArray");function d$(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(d$,"copyArray");function Z_(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var f=e[i],u=n?n(t[f],r[f],f,t,r):void 0;X_(t,f,u===void 0?r[f]:u)}return t}o(Z_,"copyObject");function p$(r,e){return Z_(r,Q_(r),e)}o(p$,"copySymbols");function m$(r){return r$(r,Ng,Q_)}o(m$,"getAllKeys");function T0(r,e){var t=r.__data__;return x$(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(T0,"getMapData");function Bc(r,e){var t=vF(r,e);return i$(t)?t:void 0}o(Bc,"getNative");var Q_=S_?Dg(S_,Object):C$,af=n$;(Eg&&af(new Eg(new ArrayBuffer(1)))!=E0||gl&&af(new gl)!=w0||Ag&&af(Ag.resolve())!=g_||Sg&&af(new Sg)!=_0||Mg&&af(new Mg)!=_g)&&(af=o(function(r){var e=S0.call(r),t=e==Ig?r.constructor:void 0,n=t?cf(t):void 0;if(n)switch(n){case CF:return E0;case kF:return w0;case IF:return g_;case DF:return _0;case RF:return _g}return e},"getTag"));function b$(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&ia.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(b$,"initCloneArray");function g$(r){return typeof r.constructor=="function"&&!eE(r)?t$(_F(r)):{}}o(g$,"initCloneObject");function v$(r,e,t,n){var i=r.constructor;switch(e){case B_:return Rg(r);case I_:case D_:return new i(+r);case E0:return a$(r,n);case U_:case F_:case $_:case q_:case H_:case z_:case K_:case j_:case G_:return h$(r,n);case w0:return f$(r,n,t);case O_:case P_:return new i(r);case N_:return c$(r);case _0:return u$(r,n,t);case L_:return l$(r)}}o(v$,"initCloneByTag");function y$(r,e){return e=e??k_,!!e&&(typeof r=="number"||cF.test(r))&&r>-1&&r%1==0&&r<e}o(y$,"isIndex");function x$(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(x$,"isKeyable");function w$(r){return!!w_&&w_ in r}o(w$,"isMasked");function eE(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||A0;return r===t}o(eE,"isPrototype");function cf(r){if(r!=null){try{return Y_.call(r)}catch{}try{return r+""}catch{}}return""}o(cf,"toSource");function _$(r){return Tg(r,!0,!0)}o(_$,"cloneDeep");function tE(r,e){return r===e||r!==r&&e!==e}o(tE,"eq");function E$(r){return A$(r)&&ia.call(r,"callee")&&(!AF.call(r,"callee")||S0.call(r)==Cg)}o(E$,"isArguments");var Og=Array.isArray;function rE(r){return r!=null&&M$(r.length)&&!nE(r)}o(rE,"isArrayLike");function A$(r){return T$(r)&&rE(r)}o(A$,"isArrayLikeObject");var S$=MF||k$;function nE(r){var e=C0(r)?S0.call(r):"";return e==kg||e==R_}o(nE,"isFunction");function M$(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=k_}o(M$,"isLength");function C0(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(C0,"isObject");function T$(r){return!!r&&typeof r=="object"}o(T$,"isObjectLike");function Ng(r){return rE(r)?QF(r):o$(r)}o(Ng,"keys");function C$(){return[]}o(C$,"stubArray");function k$(){return!1}o(k$,"stubFalse");Nc.exports=_$});var ZE=Re((ms,XE)=>{var YE=typeof self<"u"?self:ms,ep=function(){function r(){this.fetch=!1,this.DOMException=YE.DOMException}return o(r,"F"),r.prototype=YE,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{return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function i(C){return C&&DataView.prototype.isPrototypeOf(C)}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]"],f=ArrayBuffer.isView||function(C){return C&&s.indexOf(Object.prototype.toString.call(C))>-1};function u(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}o(u,"normalizeName");function d(C){return typeof C!="string"&&(C=String(C)),C}o(d,"normalizeValue");function g(C){var h={next:function(){var x=C.shift();return{done:x===void 0,value:x}}};return n.iterable&&(h[Symbol.iterator]=function(){return h}),h}o(g,"iteratorFor");function y(C){this.map={},C instanceof y?C.forEach(function(h,x){this.append(x,h)},this):Array.isArray(C)?C.forEach(function(h){this.append(h[0],h[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(h){this.append(h,C[h])},this)}o(y,"Headers"),y.prototype.append=function(C,h){C=u(C),h=d(h);var x=this.map[C];this.map[C]=x?x+", "+h:h},y.prototype.delete=function(C){delete this.map[u(C)]},y.prototype.get=function(C){return C=u(C),this.has(C)?this.map[C]:null},y.prototype.has=function(C){return this.map.hasOwnProperty(u(C))},y.prototype.set=function(C,h){this.map[u(C)]=d(h)},y.prototype.forEach=function(C,h){for(var x in this.map)this.map.hasOwnProperty(x)&&C.call(h,this.map[x],x,this)},y.prototype.keys=function(){var C=[];return this.forEach(function(h,x){C.push(x)}),g(C)},y.prototype.values=function(){var C=[];return this.forEach(function(h){C.push(h)}),g(C)},y.prototype.entries=function(){var C=[];return this.forEach(function(h,x){C.push([x,h])}),g(C)},n.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function E(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}o(E,"consumed");function O(C){return new Promise(function(h,x){C.onload=function(){h(C.result)},C.onerror=function(){x(C.error)}})}o(O,"fileReaderReady");function R(C){var h=new FileReader,x=O(h);return h.readAsArrayBuffer(C),x}o(R,"readBlobAsArrayBuffer");function I(C){var h=new FileReader,x=O(h);return h.readAsText(C),x}o(I,"readBlobAsText");function N(C){for(var h=new Uint8Array(C),x=new Array(h.length),b=0;b<h.length;b++)x[b]=String.fromCharCode(h[b]);return x.join("")}o(N,"readArrayBufferAsText");function X(C){if(C.slice)return C.slice(0);var h=new Uint8Array(C.byteLength);return h.set(new Uint8Array(C)),h.buffer}o(X,"bufferClone");function L(){return this.bodyUsed=!1,this._initBody=function(C){this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:n.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:n.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():n.arrayBuffer&&n.blob&&i(C)?(this._bodyArrayBuffer=X(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||f(C))?this._bodyArrayBuffer=X(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="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(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var C=E(this);if(C)return C;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?E(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(R)}),this.text=function(){var C=E(this);if(C)return C;if(this._bodyBlob)return I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(N(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(ie)}),this.json=function(){return this.text().then(JSON.parse)},this}o(L,"Body");var J=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ee(C){var h=C.toUpperCase();return J.indexOf(h)>-1?h:C}o(ee,"normalizeMethod");function Y(C,h){h=h||{};var x=h.body;if(C instanceof Y){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,h.headers||(this.headers=new y(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!x&&C._bodyInit!=null&&(x=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new y(h.headers)),this.method=ee(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}o(Y,"Request"),Y.prototype.clone=function(){return new Y(this,{body:this._bodyInit})};function ie(C){var h=new FormData;return C.trim().split("&").forEach(function(x){if(x){var b=x.split("="),l=b.shift().replace(/\+/g," "),m=b.join("=").replace(/\+/g," ");h.append(decodeURIComponent(l),decodeURIComponent(m))}}),h}o(ie,"decode");function G(C){var h=new y,x=C.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(b){var l=b.split(":"),m=l.shift().trim();if(m){var _=l.join(":").trim();h.append(m,_)}}),h}o(G,"parseHeaders"),L.call(Y.prototype);function $(C,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new y(h.headers),this.url=h.url||"",this._initBody(C)}o($,"Response"),L.call($.prototype),$.prototype.clone=function(){return new $(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},$.error=function(){var C=new $(null,{status:0,statusText:""});return C.type="error",C};var K=[301,302,303,307,308];$.redirect=function(C,h){if(K.indexOf(h)===-1)throw new RangeError("Invalid status code");return new $(null,{status:h,headers:{location:C}})},t.DOMException=r.DOMException;try{new t.DOMException}catch{t.DOMException=function(h,x){this.message=h,this.name=x;var b=Error(h);this.stack=b.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function he(C,h){return new Promise(function(x,b){var l=new Y(C,h);if(l.signal&&l.signal.aborted)return b(new t.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function _(){m.abort()}o(_,"abortXhr"),m.onload=function(){var S={status:m.status,statusText:m.statusText,headers:G(m.getAllResponseHeaders()||"")};S.url="responseURL"in m?m.responseURL:S.headers.get("X-Request-URL");var A="response"in m?m.response:m.responseText;x(new $(A,S))},m.onerror=function(){b(new TypeError("Network request failed"))},m.ontimeout=function(){b(new TypeError("Network request failed"))},m.onabort=function(){b(new t.DOMException("Aborted","AbortError"))},m.open(l.method,l.url,!0),l.credentials==="include"?m.withCredentials=!0:l.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&n.blob&&(m.responseType="blob"),l.headers.forEach(function(S,A){m.setRequestHeader(A,S)}),l.signal&&(l.signal.addEventListener("abort",_),m.onreadystatechange=function(){m.readyState===4&&l.signal.removeEventListener("abort",_)}),m.send(typeof l._bodyInit>"u"?null:l._bodyInit)})}return o(he,"fetch"),he.polyfill=!0,r.fetch||(r.fetch=he,r.Headers=y,r.Request=Y,r.Response=$),t.Headers=y,t.Request=Y,t.Response=$,t.fetch=he,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(ep);ep.fetch.ponyfill=!0;delete ep.fetch.polyfill;var Yc=ep;ms=Yc.fetch;ms.default=Yc.fetch;ms.fetch=Yc.fetch;ms.Headers=Yc.Headers;ms.Request=Yc.Request;ms.Response=Yc.Response;XE.exports=ms});var c9=Re((pre,f9)=>{"use strict";var pq=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=vq(n),this._batchScheduleFn=yq(n),this._cacheKeyFn=xq(n),this._cacheMap=wq(n),this._batch=null,this.name=_q(n)}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=bq(this),s=this._cacheMap,f=this._cacheKeyFn(n);if(s){var u=s.get(f);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(y){d.push(function(){y(u)})})}}i.keys.push(n);var g=new Promise(function(y,E){i.callbacks.push({resolve:y,reject:E})});return s&&s.set(f,g),g},"load"),e.loadMany=o(function(n){if(!a9(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(f){return f}));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 f=this._cacheKeyFn(n);if(s.get(f)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),s.set(f,u)}}return this},"prime"),r}(),mq=typeof process=="object"&&typeof process.nextTick=="function"?function(r){a2||(a2=Promise.resolve()),a2.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},a2;function bq(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize)return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){gq(r,t)}),t}o(bq,"getCurrentBatch");function gq(r,e){if(e.hasDispatched=!0,e.keys.length===0){c2(e);return}var t;try{t=r._batchLoadFn(e.keys)}catch(n){return f2(r,e,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(n)+".")))}if(!t||typeof t.then!="function")return f2(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(!a9(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."+(`
649
+ `}),l},"errorsToAscii"),Y=!1,ie=!1,G=!1,$=!1,K=0,he;if(this.errors=[],t.isBuffer(e))this.chars=f.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=f.decode("STRING",e);else throw new Error(`${n}input source is not a string, byte Buffer or character array`);this.sabnf=f.encode("STRING",this.chars),this.scan=o(function(h,x){this.lines=u(this.chars,this.errors,h,x),Y=!0},"scan"),this.parse=o(function(h,x,b){if(!Y)throw new Error(`${n}grammar not scanned`);d.syntax(this.chars,this.lines,this.errors,h,x,b),ie=!0},"parse"),this.translate=o(function(){if(!ie)throw new Error(`${n}grammar not scanned and parsed`);let h=d.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=h.rules,this.udts=h.udts,he=h.lineMap,G=!0)},"translate"),this.attributes=o(function(){if(!G)throw new Error(`${n}grammar not scanned, parsed and translated`);return K=g(this.rules,this.udts,he,this.errors),$=!0,K},"attrs"),this.generate=o(function(h){if(this.lines=u(this.chars,this.errors,h),this.errors.length||(d.syntax(this.chars,this.lines,this.errors,h),this.errors.length))return;let x=d.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=x.rules,this.udts=x.udts,he=x.lineMap,K=g(this.rules,this.udts,he,this.errors),$=!0)},"generate"),this.displayRules=o(function(h="index"){if(!G)throw new Error(`${n}grammar not scanned, parsed and translated`);return R(this.rules,this.udts,h)},"displayRules"),this.displayRuleDependencies=o(function(h="index"){if(!$)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return O(h)},"displayRuleDependencies"),this.displayAttributes=o(function(h="index"){if(!$)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return K&&E(h),y(h)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!$)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return E()},"displayAttributeErrors"),this.toSource=o(function(h=void 0){if(!$)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(K)throw new Error(`${n}can't generate parser source - attributes have ${K} errors`);return d.generateSource(this.chars,this.lines,this.rules,this.udts,h)},"toSource"),this.toObject=o(function(){if(!$)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(K)throw new Error(`${n}can't generate parser source - attributes have ${K} errors`);return d.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return ee(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(h){return J(this.errors,this.lines,this.chars,h)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return X(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return B(this.lines)},"linesToHtmlFunc")},"api")});var jb=Re((f8,Kb)=>{(function(r,e){"use strict";function t(b,l){if(!b)throw new Error(l||"Assertion failed")}o(t,"assert");function n(b,l){b.super_=l;var m=o(function(){},"TempCtor");m.prototype=l.prototype,b.prototype=new m,b.prototype.constructor=b}o(n,"inherits");function i(b,l,m){if(i.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((l==="le"||l==="be")&&(m=l,l=10),this._init(b||0,l||10,m||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=i1().Buffer}catch{}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,m){return l.cmp(m)>0?l:m},"max"),i.min=o(function(l,m){return l.cmp(m)<0?l:m},"min"),i.prototype._init=o(function(l,m,_){if(typeof l=="number")return this._initNumber(l,m,_);if(typeof l=="object")return this._initArray(l,m,_);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),l=l.toString().replace(/\s+/g,"");var S=0;l[0]==="-"&&(S++,this.negative=1),S<l.length&&(m===16?this._parseHex(l,S,_):(this._parseBase(l,m,S),_==="le"&&this._initArray(this.toArray(),m,_)))},"init"),i.prototype._initNumber=o(function(l,m,_){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),_==="le"&&this._initArray(this.toArray(),m,_)},"_initNumber"),i.prototype._initArray=o(function(l,m,_){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 S=0;S<this.length;S++)this.words[S]=0;var A,v,T=0;if(_==="be")for(S=l.length-1,A=0;S>=0;S-=3)v=l[S]|l[S-1]<<8|l[S-2]<<16,this.words[A]|=v<<T&67108863,this.words[A+1]=v>>>26-T&67108863,T+=24,T>=26&&(T-=26,A++);else if(_==="le")for(S=0,A=0;S<l.length;S+=3)v=l[S]|l[S+1]<<8|l[S+2]<<16,this.words[A]|=v<<T&67108863,this.words[A+1]=v>>>26-T&67108863,T+=24,T>=26&&(T-=26,A++);return this._strip()},"_initArray");function f(b,l){var m=b.charCodeAt(l);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;t(!1,"Invalid character in "+b)}o(f,"parseHex4Bits");function u(b,l,m){var _=f(b,m);return m-1>=l&&(_|=f(b,m-1)<<4),_}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,m,_){this.length=Math.ceil((l.length-m)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var A=0,v=0,T;if(_==="be")for(S=l.length-1;S>=m;S-=2)T=u(l,m,S)<<A,this.words[v]|=T&67108863,A>=18?(A-=18,v+=1,this.words[v]|=T>>>26):A+=8;else{var L=l.length-m;for(S=L%2===0?m+1:m;S<l.length;S+=2)T=u(l,m,S)<<A,this.words[v]|=T&67108863,A>=18?(A-=18,v+=1,this.words[v]|=T>>>26):A+=8}this._strip()},"_parseHex");function d(b,l,m,_){for(var S=0,A=0,v=Math.min(b.length,m),T=l;T<v;T++){var L=b.charCodeAt(T)-48;S*=_,L>=49?A=L-49+10:L>=17?A=L-17+10:A=L,t(L>=0&&A<_,"Invalid character"),S+=A}return S}o(d,"parseBase"),i.prototype._parseBase=o(function(l,m,_){this.words=[0],this.length=1;for(var S=0,A=1;A<=67108863;A*=m)S++;S--,A=A/m|0;for(var v=l.length-_,T=v%S,L=Math.min(v,v-T)+_,w=0,k=_;k<L;k+=S)w=d(l,k,k+S,m),this.imuln(A),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(T!==0){var fe=1;for(w=d(l,k,l.length,m),k=0;k<T;k++)fe*=m;this.imuln(fe),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this._strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var m=0;m<this.length;m++)l.words[m]=this.words[m];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy");function g(b,l){b.words=l.words,b.length=l.length,b.negative=l.negative,b.red=l.red}if(o(g,"move"),i.prototype._move=o(function(l){g(l,this)},"_move"),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"),typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=y}catch{i.prototype.inspect=y}else i.prototype.inspect=y;function y(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(y,"inspect");var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[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,m){l=l||10,m=m|0||1;var _;if(l===16||l==="hex"){_="";for(var S=0,A=0,v=0;v<this.length;v++){var T=this.words[v],L=((T<<S|A)&16777215).toString(16);A=T>>>24-S&16777215,S+=2,S>=26&&(S-=26,v--),A!==0||v!==this.length-1?_=E[6-L.length]+L+_:_=L+_}for(A!==0&&(_=A.toString(16)+_);_.length%m!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(l===(l|0)&&l>=2&&l<=36){var w=O[l],k=R[l];_="";var fe=this.clone();for(fe.negative=0;!fe.isZero();){var D=fe.modrn(k).toString(l);fe=fe.idivn(k),fe.isZero()?_=D+_:_=E[w-D.length]+D+_}for(this.isZero()&&(_="0"+_);_.length%m!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}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,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(l,m){return this.toArrayLike(s,l,m)},"toBuffer")),i.prototype.toArray=o(function(l,m){return this.toArrayLike(Array,l,m)},"toArray");var I=o(function(l,m){return l.allocUnsafe?l.allocUnsafe(m):new l(m)},"allocate");i.prototype.toArrayLike=o(function(l,m,_){this._strip();var S=this.byteLength(),A=_||Math.max(1,S);t(S<=A,"byte array longer than desired length"),t(A>0,"Requested array length <= 0");var v=I(l,A),T=m==="le"?"LE":"BE";return this["_toArrayLike"+T](v,S),v},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,m){for(var _=0,S=0,A=0,v=0;A<this.length;A++){var T=this.words[A]<<v|S;l[_++]=T&255,_<l.length&&(l[_++]=T>>8&255),_<l.length&&(l[_++]=T>>16&255),v===6?(_<l.length&&(l[_++]=T>>24&255),S=0,v=0):(S=T>>>24,v+=2)}if(_<l.length)for(l[_++]=S;_<l.length;)l[_++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,m){for(var _=l.length-1,S=0,A=0,v=0;A<this.length;A++){var T=this.words[A]<<v|S;l[_--]=T&255,_>=0&&(l[_--]=T>>8&255),_>=0&&(l[_--]=T>>16&255),v===6?(_>=0&&(l[_--]=T>>24&255),S=0,v=0):(S=T>>>24,v+=2)}if(_>=0)for(l[_--]=S;_>=0;)l[_--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var m=l,_=0;return m>=4096&&(_+=13,m>>>=13),m>=64&&(_+=7,m>>>=7),m>=8&&(_+=4,m>>>=4),m>=2&&(_+=2,m>>>=2),_+m},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var m=l,_=0;return(m&8191)===0&&(_+=13,m>>>=13),(m&127)===0&&(_+=7,m>>>=7),(m&15)===0&&(_+=4,m>>>=4),(m&3)===0&&(_+=2,m>>>=2),(m&1)===0&&_++,_},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],m=this._countBits(l);return(this.length-1)*26+m},"bitLength");function P(b){for(var l=new Array(b.bitLength()),m=0;m<l.length;m++){var _=m/26|0,S=m%26;l[m]=b.words[_]>>>S&1}return l}o(P,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,m=0;m<this.length;m++){var _=this._zeroBits(this.words[m]);if(l+=_,_!==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 m=0;m<l.length;m++)this.words[m]=this.words[m]|l.words[m];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 m;this.length>l.length?m=l:m=this;for(var _=0;_<m.length;_++)this.words[_]=this.words[_]&l.words[_];return this.length=m.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 m,_;this.length>l.length?(m=this,_=l):(m=l,_=this);for(var S=0;S<_.length;S++)this.words[S]=m.words[S]^_.words[S];if(this!==m)for(;S<m.length;S++)this.words[S]=m.words[S];return this.length=m.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 m=Math.ceil(l/26)|0,_=l%26;this._expand(m),_>0&&m--;for(var S=0;S<m;S++)this.words[S]=~this.words[S]&67108863;return _>0&&(this.words[S]=~this.words[S]&67108863>>26-_),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,m){t(typeof l=="number"&&l>=0);var _=l/26|0,S=l%26;return this._expand(_+1),m?this.words[_]=this.words[_]|1<<S:this.words[_]=this.words[_]&~(1<<S),this._strip()},"setn"),i.prototype.iadd=o(function(l){var m;if(this.negative!==0&&l.negative===0)return this.negative=0,m=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,m=this.isub(l),l.negative=1,m._normSign();var _,S;this.length>l.length?(_=this,S=l):(_=l,S=this);for(var A=0,v=0;v<S.length;v++)m=(_.words[v]|0)+(S.words[v]|0)+A,this.words[v]=m&67108863,A=m>>>26;for(;A!==0&&v<_.length;v++)m=(_.words[v]|0)+A,this.words[v]=m&67108863,A=m>>>26;if(this.length=_.length,A!==0)this.words[this.length]=A,this.length++;else if(_!==this)for(;v<_.length;v++)this.words[v]=_.words[v];return this},"iadd"),i.prototype.add=o(function(l){var m;return l.negative!==0&&this.negative===0?(l.negative=0,m=this.sub(l),l.negative^=1,m):l.negative===0&&this.negative!==0?(this.negative=0,m=l.sub(this),this.negative=1,m):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 m=this.iadd(l);return l.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var _=this.cmp(l);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,A;_>0?(S=this,A=l):(S=l,A=this);for(var v=0,T=0;T<A.length;T++)m=(S.words[T]|0)-(A.words[T]|0)+v,v=m>>26,this.words[T]=m&67108863;for(;v!==0&&T<S.length;T++)m=(S.words[T]|0)+v,v=m>>26,this.words[T]=m&67108863;if(v===0&&T<S.length&&S!==this)for(;T<S.length;T++)this.words[T]=S.words[T];return this.length=Math.max(this.length,T),S!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function X(b,l,m){m.negative=l.negative^b.negative;var _=b.length+l.length|0;m.length=_,_=_-1|0;var S=b.words[0]|0,A=l.words[0]|0,v=S*A,T=v&67108863,L=v/67108864|0;m.words[0]=T;for(var w=1;w<_;w++){for(var k=L>>>26,fe=L&67108863,D=Math.min(w,l.length-1),Q=Math.max(0,w-b.length+1);Q<=D;Q++){var se=w-Q|0;S=b.words[se]|0,A=l.words[Q]|0,v=S*A+fe,k+=v/67108864|0,fe=v&67108863}m.words[w]=fe|0,L=k|0}return L!==0?m.words[w]=L|0:m.length--,m._strip()}o(X,"smallMulTo");var B=o(function(l,m,_){var S=l.words,A=m.words,v=_.words,T=0,L,w,k,fe=S[0]|0,D=fe&8191,Q=fe>>>13,se=S[1]|0,H=se&8191,z=se>>>13,V=S[2]|0,te=V&8191,ae=V>>>13,Ae=S[3]|0,ge=Ae&8191,ne=Ae>>>13,Me=S[4]|0,ue=Me&8191,ve=Me>>>13,W=S[5]|0,pe=W&8191,ke=W>>>13,ze=S[6]|0,Ne=ze&8191,We=ze>>>13,br=S[7]|0,le=br&8191,oe=br>>>13,F=S[8]|0,Z=F&8191,me=F>>>13,ye=S[9]|0,we=ye&8191,Ie=ye>>>13,Dt=A[0]|0,Fe=Dt&8191,Oe=Dt>>>13,Lt=A[1]|0,Ge=Lt&8191,Ye=Lt>>>13,Dn=A[2]|0,it=Dn&8191,ot=Dn>>>13,ei=A[3]|0,st=ei&8191,tt=ei>>>13,ti=A[4]|0,at=ti&8191,ft=ti>>>13,hn=A[5]|0,ct=hn&8191,Ze=hn>>>13,ri=A[6]|0,ut=ri&8191,lt=ri>>>13,ni=A[7]|0,ht=ni&8191,dt=ni>>>13,ii=A[8]|0,pt=ii&8191,rt=ii>>>13,Rn=A[9]|0,qt=Rn&8191,Ht=Rn>>>13;_.negative=l.negative^m.negative,_.length=19,L=Math.imul(D,Fe),w=Math.imul(D,Oe),w=w+Math.imul(Q,Fe)|0,k=Math.imul(Q,Oe);var dn=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,L=Math.imul(H,Fe),w=Math.imul(H,Oe),w=w+Math.imul(z,Fe)|0,k=Math.imul(z,Oe),L=L+Math.imul(D,Ge)|0,w=w+Math.imul(D,Ye)|0,w=w+Math.imul(Q,Ge)|0,k=k+Math.imul(Q,Ye)|0;var pn=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(pn>>>26)|0,pn&=67108863,L=Math.imul(te,Fe),w=Math.imul(te,Oe),w=w+Math.imul(ae,Fe)|0,k=Math.imul(ae,Oe),L=L+Math.imul(H,Ge)|0,w=w+Math.imul(H,Ye)|0,w=w+Math.imul(z,Ge)|0,k=k+Math.imul(z,Ye)|0,L=L+Math.imul(D,it)|0,w=w+Math.imul(D,ot)|0,w=w+Math.imul(Q,it)|0,k=k+Math.imul(Q,ot)|0;var mn=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(mn>>>26)|0,mn&=67108863,L=Math.imul(ge,Fe),w=Math.imul(ge,Oe),w=w+Math.imul(ne,Fe)|0,k=Math.imul(ne,Oe),L=L+Math.imul(te,Ge)|0,w=w+Math.imul(te,Ye)|0,w=w+Math.imul(ae,Ge)|0,k=k+Math.imul(ae,Ye)|0,L=L+Math.imul(H,it)|0,w=w+Math.imul(H,ot)|0,w=w+Math.imul(z,it)|0,k=k+Math.imul(z,ot)|0,L=L+Math.imul(D,st)|0,w=w+Math.imul(D,tt)|0,w=w+Math.imul(Q,st)|0,k=k+Math.imul(Q,tt)|0;var Ur=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,L=Math.imul(ue,Fe),w=Math.imul(ue,Oe),w=w+Math.imul(ve,Fe)|0,k=Math.imul(ve,Oe),L=L+Math.imul(ge,Ge)|0,w=w+Math.imul(ge,Ye)|0,w=w+Math.imul(ne,Ge)|0,k=k+Math.imul(ne,Ye)|0,L=L+Math.imul(te,it)|0,w=w+Math.imul(te,ot)|0,w=w+Math.imul(ae,it)|0,k=k+Math.imul(ae,ot)|0,L=L+Math.imul(H,st)|0,w=w+Math.imul(H,tt)|0,w=w+Math.imul(z,st)|0,k=k+Math.imul(z,tt)|0,L=L+Math.imul(D,at)|0,w=w+Math.imul(D,ft)|0,w=w+Math.imul(Q,at)|0,k=k+Math.imul(Q,ft)|0;var bn=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(bn>>>26)|0,bn&=67108863,L=Math.imul(pe,Fe),w=Math.imul(pe,Oe),w=w+Math.imul(ke,Fe)|0,k=Math.imul(ke,Oe),L=L+Math.imul(ue,Ge)|0,w=w+Math.imul(ue,Ye)|0,w=w+Math.imul(ve,Ge)|0,k=k+Math.imul(ve,Ye)|0,L=L+Math.imul(ge,it)|0,w=w+Math.imul(ge,ot)|0,w=w+Math.imul(ne,it)|0,k=k+Math.imul(ne,ot)|0,L=L+Math.imul(te,st)|0,w=w+Math.imul(te,tt)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,tt)|0,L=L+Math.imul(H,at)|0,w=w+Math.imul(H,ft)|0,w=w+Math.imul(z,at)|0,k=k+Math.imul(z,ft)|0,L=L+Math.imul(D,ct)|0,w=w+Math.imul(D,Ze)|0,w=w+Math.imul(Q,ct)|0,k=k+Math.imul(Q,Ze)|0;var oi=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(oi>>>26)|0,oi&=67108863,L=Math.imul(Ne,Fe),w=Math.imul(Ne,Oe),w=w+Math.imul(We,Fe)|0,k=Math.imul(We,Oe),L=L+Math.imul(pe,Ge)|0,w=w+Math.imul(pe,Ye)|0,w=w+Math.imul(ke,Ge)|0,k=k+Math.imul(ke,Ye)|0,L=L+Math.imul(ue,it)|0,w=w+Math.imul(ue,ot)|0,w=w+Math.imul(ve,it)|0,k=k+Math.imul(ve,ot)|0,L=L+Math.imul(ge,st)|0,w=w+Math.imul(ge,tt)|0,w=w+Math.imul(ne,st)|0,k=k+Math.imul(ne,tt)|0,L=L+Math.imul(te,at)|0,w=w+Math.imul(te,ft)|0,w=w+Math.imul(ae,at)|0,k=k+Math.imul(ae,ft)|0,L=L+Math.imul(H,ct)|0,w=w+Math.imul(H,Ze)|0,w=w+Math.imul(z,ct)|0,k=k+Math.imul(z,Ze)|0,L=L+Math.imul(D,ut)|0,w=w+Math.imul(D,lt)|0,w=w+Math.imul(Q,ut)|0,k=k+Math.imul(Q,lt)|0;var Ro=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,L=Math.imul(le,Fe),w=Math.imul(le,Oe),w=w+Math.imul(oe,Fe)|0,k=Math.imul(oe,Oe),L=L+Math.imul(Ne,Ge)|0,w=w+Math.imul(Ne,Ye)|0,w=w+Math.imul(We,Ge)|0,k=k+Math.imul(We,Ye)|0,L=L+Math.imul(pe,it)|0,w=w+Math.imul(pe,ot)|0,w=w+Math.imul(ke,it)|0,k=k+Math.imul(ke,ot)|0,L=L+Math.imul(ue,st)|0,w=w+Math.imul(ue,tt)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,tt)|0,L=L+Math.imul(ge,at)|0,w=w+Math.imul(ge,ft)|0,w=w+Math.imul(ne,at)|0,k=k+Math.imul(ne,ft)|0,L=L+Math.imul(te,ct)|0,w=w+Math.imul(te,Ze)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,Ze)|0,L=L+Math.imul(H,ut)|0,w=w+Math.imul(H,lt)|0,w=w+Math.imul(z,ut)|0,k=k+Math.imul(z,lt)|0,L=L+Math.imul(D,ht)|0,w=w+Math.imul(D,dt)|0,w=w+Math.imul(Q,ht)|0,k=k+Math.imul(Q,dt)|0;var Oo=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,L=Math.imul(Z,Fe),w=Math.imul(Z,Oe),w=w+Math.imul(me,Fe)|0,k=Math.imul(me,Oe),L=L+Math.imul(le,Ge)|0,w=w+Math.imul(le,Ye)|0,w=w+Math.imul(oe,Ge)|0,k=k+Math.imul(oe,Ye)|0,L=L+Math.imul(Ne,it)|0,w=w+Math.imul(Ne,ot)|0,w=w+Math.imul(We,it)|0,k=k+Math.imul(We,ot)|0,L=L+Math.imul(pe,st)|0,w=w+Math.imul(pe,tt)|0,w=w+Math.imul(ke,st)|0,k=k+Math.imul(ke,tt)|0,L=L+Math.imul(ue,at)|0,w=w+Math.imul(ue,ft)|0,w=w+Math.imul(ve,at)|0,k=k+Math.imul(ve,ft)|0,L=L+Math.imul(ge,ct)|0,w=w+Math.imul(ge,Ze)|0,w=w+Math.imul(ne,ct)|0,k=k+Math.imul(ne,Ze)|0,L=L+Math.imul(te,ut)|0,w=w+Math.imul(te,lt)|0,w=w+Math.imul(ae,ut)|0,k=k+Math.imul(ae,lt)|0,L=L+Math.imul(H,ht)|0,w=w+Math.imul(H,dt)|0,w=w+Math.imul(z,ht)|0,k=k+Math.imul(z,dt)|0,L=L+Math.imul(D,pt)|0,w=w+Math.imul(D,rt)|0,w=w+Math.imul(Q,pt)|0,k=k+Math.imul(Q,rt)|0;var No=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(No>>>26)|0,No&=67108863,L=Math.imul(we,Fe),w=Math.imul(we,Oe),w=w+Math.imul(Ie,Fe)|0,k=Math.imul(Ie,Oe),L=L+Math.imul(Z,Ge)|0,w=w+Math.imul(Z,Ye)|0,w=w+Math.imul(me,Ge)|0,k=k+Math.imul(me,Ye)|0,L=L+Math.imul(le,it)|0,w=w+Math.imul(le,ot)|0,w=w+Math.imul(oe,it)|0,k=k+Math.imul(oe,ot)|0,L=L+Math.imul(Ne,st)|0,w=w+Math.imul(Ne,tt)|0,w=w+Math.imul(We,st)|0,k=k+Math.imul(We,tt)|0,L=L+Math.imul(pe,at)|0,w=w+Math.imul(pe,ft)|0,w=w+Math.imul(ke,at)|0,k=k+Math.imul(ke,ft)|0,L=L+Math.imul(ue,ct)|0,w=w+Math.imul(ue,Ze)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,Ze)|0,L=L+Math.imul(ge,ut)|0,w=w+Math.imul(ge,lt)|0,w=w+Math.imul(ne,ut)|0,k=k+Math.imul(ne,lt)|0,L=L+Math.imul(te,ht)|0,w=w+Math.imul(te,dt)|0,w=w+Math.imul(ae,ht)|0,k=k+Math.imul(ae,dt)|0,L=L+Math.imul(H,pt)|0,w=w+Math.imul(H,rt)|0,w=w+Math.imul(z,pt)|0,k=k+Math.imul(z,rt)|0,L=L+Math.imul(D,qt)|0,w=w+Math.imul(D,Ht)|0,w=w+Math.imul(Q,qt)|0,k=k+Math.imul(Q,Ht)|0;var ro=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(ro>>>26)|0,ro&=67108863,L=Math.imul(we,Ge),w=Math.imul(we,Ye),w=w+Math.imul(Ie,Ge)|0,k=Math.imul(Ie,Ye),L=L+Math.imul(Z,it)|0,w=w+Math.imul(Z,ot)|0,w=w+Math.imul(me,it)|0,k=k+Math.imul(me,ot)|0,L=L+Math.imul(le,st)|0,w=w+Math.imul(le,tt)|0,w=w+Math.imul(oe,st)|0,k=k+Math.imul(oe,tt)|0,L=L+Math.imul(Ne,at)|0,w=w+Math.imul(Ne,ft)|0,w=w+Math.imul(We,at)|0,k=k+Math.imul(We,ft)|0,L=L+Math.imul(pe,ct)|0,w=w+Math.imul(pe,Ze)|0,w=w+Math.imul(ke,ct)|0,k=k+Math.imul(ke,Ze)|0,L=L+Math.imul(ue,ut)|0,w=w+Math.imul(ue,lt)|0,w=w+Math.imul(ve,ut)|0,k=k+Math.imul(ve,lt)|0,L=L+Math.imul(ge,ht)|0,w=w+Math.imul(ge,dt)|0,w=w+Math.imul(ne,ht)|0,k=k+Math.imul(ne,dt)|0,L=L+Math.imul(te,pt)|0,w=w+Math.imul(te,rt)|0,w=w+Math.imul(ae,pt)|0,k=k+Math.imul(ae,rt)|0,L=L+Math.imul(H,qt)|0,w=w+Math.imul(H,Ht)|0,w=w+Math.imul(z,qt)|0,k=k+Math.imul(z,Ht)|0;var no=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(no>>>26)|0,no&=67108863,L=Math.imul(we,it),w=Math.imul(we,ot),w=w+Math.imul(Ie,it)|0,k=Math.imul(Ie,ot),L=L+Math.imul(Z,st)|0,w=w+Math.imul(Z,tt)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,tt)|0,L=L+Math.imul(le,at)|0,w=w+Math.imul(le,ft)|0,w=w+Math.imul(oe,at)|0,k=k+Math.imul(oe,ft)|0,L=L+Math.imul(Ne,ct)|0,w=w+Math.imul(Ne,Ze)|0,w=w+Math.imul(We,ct)|0,k=k+Math.imul(We,Ze)|0,L=L+Math.imul(pe,ut)|0,w=w+Math.imul(pe,lt)|0,w=w+Math.imul(ke,ut)|0,k=k+Math.imul(ke,lt)|0,L=L+Math.imul(ue,ht)|0,w=w+Math.imul(ue,dt)|0,w=w+Math.imul(ve,ht)|0,k=k+Math.imul(ve,dt)|0,L=L+Math.imul(ge,pt)|0,w=w+Math.imul(ge,rt)|0,w=w+Math.imul(ne,pt)|0,k=k+Math.imul(ne,rt)|0,L=L+Math.imul(te,qt)|0,w=w+Math.imul(te,Ht)|0,w=w+Math.imul(ae,qt)|0,k=k+Math.imul(ae,Ht)|0;var io=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(io>>>26)|0,io&=67108863,L=Math.imul(we,st),w=Math.imul(we,tt),w=w+Math.imul(Ie,st)|0,k=Math.imul(Ie,tt),L=L+Math.imul(Z,at)|0,w=w+Math.imul(Z,ft)|0,w=w+Math.imul(me,at)|0,k=k+Math.imul(me,ft)|0,L=L+Math.imul(le,ct)|0,w=w+Math.imul(le,Ze)|0,w=w+Math.imul(oe,ct)|0,k=k+Math.imul(oe,Ze)|0,L=L+Math.imul(Ne,ut)|0,w=w+Math.imul(Ne,lt)|0,w=w+Math.imul(We,ut)|0,k=k+Math.imul(We,lt)|0,L=L+Math.imul(pe,ht)|0,w=w+Math.imul(pe,dt)|0,w=w+Math.imul(ke,ht)|0,k=k+Math.imul(ke,dt)|0,L=L+Math.imul(ue,pt)|0,w=w+Math.imul(ue,rt)|0,w=w+Math.imul(ve,pt)|0,k=k+Math.imul(ve,rt)|0,L=L+Math.imul(ge,qt)|0,w=w+Math.imul(ge,Ht)|0,w=w+Math.imul(ne,qt)|0,k=k+Math.imul(ne,Ht)|0;var Po=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Po>>>26)|0,Po&=67108863,L=Math.imul(we,at),w=Math.imul(we,ft),w=w+Math.imul(Ie,at)|0,k=Math.imul(Ie,ft),L=L+Math.imul(Z,ct)|0,w=w+Math.imul(Z,Ze)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,Ze)|0,L=L+Math.imul(le,ut)|0,w=w+Math.imul(le,lt)|0,w=w+Math.imul(oe,ut)|0,k=k+Math.imul(oe,lt)|0,L=L+Math.imul(Ne,ht)|0,w=w+Math.imul(Ne,dt)|0,w=w+Math.imul(We,ht)|0,k=k+Math.imul(We,dt)|0,L=L+Math.imul(pe,pt)|0,w=w+Math.imul(pe,rt)|0,w=w+Math.imul(ke,pt)|0,k=k+Math.imul(ke,rt)|0,L=L+Math.imul(ue,qt)|0,w=w+Math.imul(ue,Ht)|0,w=w+Math.imul(ve,qt)|0,k=k+Math.imul(ve,Ht)|0;var Lo=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,L=Math.imul(we,ct),w=Math.imul(we,Ze),w=w+Math.imul(Ie,ct)|0,k=Math.imul(Ie,Ze),L=L+Math.imul(Z,ut)|0,w=w+Math.imul(Z,lt)|0,w=w+Math.imul(me,ut)|0,k=k+Math.imul(me,lt)|0,L=L+Math.imul(le,ht)|0,w=w+Math.imul(le,dt)|0,w=w+Math.imul(oe,ht)|0,k=k+Math.imul(oe,dt)|0,L=L+Math.imul(Ne,pt)|0,w=w+Math.imul(Ne,rt)|0,w=w+Math.imul(We,pt)|0,k=k+Math.imul(We,rt)|0,L=L+Math.imul(pe,qt)|0,w=w+Math.imul(pe,Ht)|0,w=w+Math.imul(ke,qt)|0,k=k+Math.imul(ke,Ht)|0;var Bo=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,L=Math.imul(we,ut),w=Math.imul(we,lt),w=w+Math.imul(Ie,ut)|0,k=Math.imul(Ie,lt),L=L+Math.imul(Z,ht)|0,w=w+Math.imul(Z,dt)|0,w=w+Math.imul(me,ht)|0,k=k+Math.imul(me,dt)|0,L=L+Math.imul(le,pt)|0,w=w+Math.imul(le,rt)|0,w=w+Math.imul(oe,pt)|0,k=k+Math.imul(oe,rt)|0,L=L+Math.imul(Ne,qt)|0,w=w+Math.imul(Ne,Ht)|0,w=w+Math.imul(We,qt)|0,k=k+Math.imul(We,Ht)|0;var Uo=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,L=Math.imul(we,ht),w=Math.imul(we,dt),w=w+Math.imul(Ie,ht)|0,k=Math.imul(Ie,dt),L=L+Math.imul(Z,pt)|0,w=w+Math.imul(Z,rt)|0,w=w+Math.imul(me,pt)|0,k=k+Math.imul(me,rt)|0,L=L+Math.imul(le,qt)|0,w=w+Math.imul(le,Ht)|0,w=w+Math.imul(oe,qt)|0,k=k+Math.imul(oe,Ht)|0;var Cf=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(Cf>>>26)|0,Cf&=67108863,L=Math.imul(we,pt),w=Math.imul(we,rt),w=w+Math.imul(Ie,pt)|0,k=Math.imul(Ie,rt),L=L+Math.imul(Z,qt)|0,w=w+Math.imul(Z,Ht)|0,w=w+Math.imul(me,qt)|0,k=k+Math.imul(me,Ht)|0;var kf=(T+L|0)+((w&8191)<<13)|0;T=(k+(w>>>13)|0)+(kf>>>26)|0,kf&=67108863,L=Math.imul(we,qt),w=Math.imul(we,Ht),w=w+Math.imul(Ie,qt)|0,k=Math.imul(Ie,Ht);var If=(T+L|0)+((w&8191)<<13)|0;return T=(k+(w>>>13)|0)+(If>>>26)|0,If&=67108863,v[0]=dn,v[1]=pn,v[2]=mn,v[3]=Ur,v[4]=bn,v[5]=oi,v[6]=Ro,v[7]=Oo,v[8]=No,v[9]=ro,v[10]=no,v[11]=io,v[12]=Po,v[13]=Lo,v[14]=Bo,v[15]=Uo,v[16]=Cf,v[17]=kf,v[18]=If,T!==0&&(v[19]=T,_.length++),_},"comb10MulTo");Math.imul||(B=X);function J(b,l,m){m.negative=l.negative^b.negative,m.length=b.length+l.length;for(var _=0,S=0,A=0;A<m.length-1;A++){var v=S;S=0;for(var T=_&67108863,L=Math.min(A,l.length-1),w=Math.max(0,A-b.length+1);w<=L;w++){var k=A-w,fe=b.words[k]|0,D=l.words[w]|0,Q=fe*D,se=Q&67108863;v=v+(Q/67108864|0)|0,se=se+T|0,T=se&67108863,v=v+(se>>>26)|0,S+=v>>>26,v&=67108863}m.words[A]=T,_=v,v=S}return _!==0?m.words[A]=_:m.length--,m._strip()}o(J,"bigMulTo");function ee(b,l,m){return J(b,l,m)}o(ee,"jumboMulTo"),i.prototype.mulTo=o(function(l,m){var _,S=this.length+l.length;return this.length===10&&l.length===10?_=B(this,l,m):S<63?_=X(this,l,m):S<1024?_=J(this,l,m):_=ee(this,l,m),_},"mulTo");function Y(b,l){this.x=b,this.y=l}o(Y,"FFTM"),Y.prototype.makeRBT=o(function(l){for(var m=new Array(l),_=i.prototype._countBits(l)-1,S=0;S<l;S++)m[S]=this.revBin(S,_,l);return m},"makeRBT"),Y.prototype.revBin=o(function(l,m,_){if(l===0||l===_-1)return l;for(var S=0,A=0;A<m;A++)S|=(l&1)<<m-A-1,l>>=1;return S},"revBin"),Y.prototype.permute=o(function(l,m,_,S,A,v){for(var T=0;T<v;T++)S[T]=m[l[T]],A[T]=_[l[T]]},"permute"),Y.prototype.transform=o(function(l,m,_,S,A,v){this.permute(v,l,m,_,S,A);for(var T=1;T<A;T<<=1)for(var L=T<<1,w=Math.cos(2*Math.PI/L),k=Math.sin(2*Math.PI/L),fe=0;fe<A;fe+=L)for(var D=w,Q=k,se=0;se<T;se++){var H=_[fe+se],z=S[fe+se],V=_[fe+se+T],te=S[fe+se+T],ae=D*V-Q*te;te=D*te+Q*V,V=ae,_[fe+se]=H+V,S[fe+se]=z+te,_[fe+se+T]=H-V,S[fe+se+T]=z-te,se!==L&&(ae=w*D-k*Q,Q=w*Q+k*D,D=ae)}},"transform"),Y.prototype.guessLen13b=o(function(l,m){var _=Math.max(m,l)|1,S=_&1,A=0;for(_=_/2|0;_;_=_>>>1)A++;return 1<<A+1+S},"guessLen13b"),Y.prototype.conjugate=o(function(l,m,_){if(!(_<=1))for(var S=0;S<_/2;S++){var A=l[S];l[S]=l[_-S-1],l[_-S-1]=A,A=m[S],m[S]=-m[_-S-1],m[_-S-1]=-A}},"conjugate"),Y.prototype.normalize13b=o(function(l,m){for(var _=0,S=0;S<m/2;S++){var A=Math.round(l[2*S+1]/m)*8192+Math.round(l[2*S]/m)+_;l[S]=A&67108863,A<67108864?_=0:_=A/67108864|0}return l},"normalize13b"),Y.prototype.convert13b=o(function(l,m,_,S){for(var A=0,v=0;v<m;v++)A=A+(l[v]|0),_[2*v]=A&8191,A=A>>>13,_[2*v+1]=A&8191,A=A>>>13;for(v=2*m;v<S;++v)_[v]=0;t(A===0),t((A&-8192)===0)},"convert13b"),Y.prototype.stub=o(function(l){for(var m=new Array(l),_=0;_<l;_++)m[_]=0;return m},"stub"),Y.prototype.mulp=o(function(l,m,_){var S=2*this.guessLen13b(l.length,m.length),A=this.makeRBT(S),v=this.stub(S),T=new Array(S),L=new Array(S),w=new Array(S),k=new Array(S),fe=new Array(S),D=new Array(S),Q=_.words;Q.length=S,this.convert13b(l.words,l.length,T,S),this.convert13b(m.words,m.length,k,S),this.transform(T,v,L,w,S,A),this.transform(k,v,fe,D,S,A);for(var se=0;se<S;se++){var H=L[se]*fe[se]-w[se]*D[se];w[se]=L[se]*D[se]+w[se]*fe[se],L[se]=H}return this.conjugate(L,w,S),this.transform(L,w,Q,v,S,A),this.conjugate(Q,v,S),this.normalize13b(Q,S),_.negative=l.negative^m.negative,_.length=l.length+m.length,_._strip()},"mulp"),i.prototype.mul=o(function(l){var m=new i(null);return m.words=new Array(this.length+l.length),this.mulTo(l,m)},"mul"),i.prototype.mulf=o(function(l){var m=new i(null);return m.words=new Array(this.length+l.length),ee(this,l,m)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var m=l<0;m&&(l=-l),t(typeof l=="number"),t(l<67108864);for(var _=0,S=0;S<this.length;S++){var A=(this.words[S]|0)*l,v=(A&67108863)+(_&67108863);_>>=26,_+=A/67108864|0,_+=v>>>26,this.words[S]=v&67108863}return _!==0&&(this.words[S]=_,this.length++),m?this.ineg():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 m=P(l);if(m.length===0)return new i(1);for(var _=this,S=0;S<m.length&&m[S]===0;S++,_=_.sqr());if(++S<m.length)for(var A=_.sqr();S<m.length;S++,A=A.sqr())m[S]!==0&&(_=_.mul(A));return _},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26,S=67108863>>>26-m<<26-m,A;if(m!==0){var v=0;for(A=0;A<this.length;A++){var T=this.words[A]&S,L=(this.words[A]|0)-T<<m;this.words[A]=L|v,v=T>>>26-m}v&&(this.words[A]=v,this.length++)}if(_!==0){for(A=this.length-1;A>=0;A--)this.words[A+_]=this.words[A];for(A=0;A<_;A++)this.words[A]=0;this.length+=_}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,m,_){t(typeof l=="number"&&l>=0);var S;m?S=(m-m%26)/26:S=0;var A=l%26,v=Math.min((l-A)/26,this.length),T=67108863^67108863>>>A<<A,L=_;if(S-=v,S=Math.max(0,S),L){for(var w=0;w<v;w++)L.words[w]=this.words[w];L.length=v}if(v!==0)if(this.length>v)for(this.length-=v,w=0;w<this.length;w++)this.words[w]=this.words[w+v];else this.words[0]=0,this.length=1;var k=0;for(w=this.length-1;w>=0&&(k!==0||w>=S);w--){var fe=this.words[w]|0;this.words[w]=k<<26-A|fe>>>A,k=fe&T}return L&&k!==0&&(L.words[L.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(l,m,_){return t(this.negative===0),this.iushrn(l,m,_)},"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 m=l%26,_=(l-m)/26,S=1<<m;if(this.length<=_)return!1;var A=this.words[_];return!!(A&S)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(m!==0&&_++,this.length=Math.min(_,this.length),m!==0){var S=67108863^67108863>>>m<<m;this.words[this.length-1]&=S}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 m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+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 m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+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,m,_){var S=l.length+_,A;this._expand(S);var v,T=0;for(A=0;A<l.length;A++){v=(this.words[A+_]|0)+T;var L=(l.words[A]|0)*m;v-=L&67108863,T=(v>>26)-(L/67108864|0),this.words[A+_]=v&67108863}for(;A<this.length-_;A++)v=(this.words[A+_]|0)+T,T=v>>26,this.words[A+_]=v&67108863;if(T===0)return this._strip();for(t(T===-1),T=0,A=0;A<this.length;A++)v=-(this.words[A]|0)+T,T=v>>26,this.words[A]=v&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,m){var _=this.length-l.length,S=this.clone(),A=l,v=A.words[A.length-1]|0,T=this._countBits(v);_=26-T,_!==0&&(A=A.ushln(_),S.iushln(_),v=A.words[A.length-1]|0);var L=S.length-A.length,w;if(m!=="mod"){w=new i(null),w.length=L+1,w.words=new Array(w.length);for(var k=0;k<w.length;k++)w.words[k]=0}var fe=S.clone()._ishlnsubmul(A,1,L);fe.negative===0&&(S=fe,w&&(w.words[L]=1));for(var D=L-1;D>=0;D--){var Q=(S.words[A.length+D]|0)*67108864+(S.words[A.length+D-1]|0);for(Q=Math.min(Q/v|0,67108863),S._ishlnsubmul(A,Q,D);S.negative!==0;)Q--,S.negative=0,S._ishlnsubmul(A,1,D),S.isZero()||(S.negative^=1);w&&(w.words[D]=Q)}return w&&w._strip(),S._strip(),m!=="div"&&_!==0&&S.iushrn(_),{div:w||null,mod:S}},"_wordDiv"),i.prototype.divmod=o(function(l,m,_){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var S,A,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,m),m!=="mod"&&(S=v.div.neg()),m!=="div"&&(A=v.mod.neg(),_&&A.negative!==0&&A.iadd(l)),{div:S,mod:A}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),m),m!=="mod"&&(S=v.div.neg()),{div:S,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),m),m!=="div"&&(A=v.mod.neg(),_&&A.negative!==0&&A.isub(l)),{div:v.div,mod:A}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?m==="div"?{div:this.divn(l.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,m)},"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 m=this.divmod(l);if(m.mod.isZero())return m.div;var _=m.div.negative!==0?m.mod.isub(l):m.mod,S=l.ushrn(1),A=l.andln(1),v=_.cmp(S);return v<0||A===1&&v===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var m=l<0;m&&(l=-l),t(l<=67108863);for(var _=(1<<26)%l,S=0,A=this.length-1;A>=0;A--)S=(_*S+(this.words[A]|0))%l;return m?-S:S},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var m=l<0;m&&(l=-l),t(l<=67108863);for(var _=0,S=this.length-1;S>=0;S--){var A=(this.words[S]|0)+_*67108864;this.words[S]=A/l|0,_=A%l}return this._strip(),m?this.ineg():this},"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 m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var S=new i(1),A=new i(0),v=new i(0),T=new i(1),L=0;m.isEven()&&_.isEven();)m.iushrn(1),_.iushrn(1),++L;for(var w=_.clone(),k=m.clone();!m.isZero();){for(var fe=0,D=1;(m.words[0]&D)===0&&fe<26;++fe,D<<=1);if(fe>0)for(m.iushrn(fe);fe-- >0;)(S.isOdd()||A.isOdd())&&(S.iadd(w),A.isub(k)),S.iushrn(1),A.iushrn(1);for(var Q=0,se=1;(_.words[0]&se)===0&&Q<26;++Q,se<<=1);if(Q>0)for(_.iushrn(Q);Q-- >0;)(v.isOdd()||T.isOdd())&&(v.iadd(w),T.isub(k)),v.iushrn(1),T.iushrn(1);m.cmp(_)>=0?(m.isub(_),S.isub(v),A.isub(T)):(_.isub(m),v.isub(S),T.isub(A))}return{a:v,b:T,gcd:_.iushln(L)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var S=new i(1),A=new i(0),v=_.clone();m.cmpn(1)>0&&_.cmpn(1)>0;){for(var T=0,L=1;(m.words[0]&L)===0&&T<26;++T,L<<=1);if(T>0)for(m.iushrn(T);T-- >0;)S.isOdd()&&S.iadd(v),S.iushrn(1);for(var w=0,k=1;(_.words[0]&k)===0&&w<26;++w,k<<=1);if(w>0)for(_.iushrn(w);w-- >0;)A.isOdd()&&A.iadd(v),A.iushrn(1);m.cmp(_)>=0?(m.isub(_),S.isub(A)):(_.isub(m),A.isub(S))}var fe;return m.cmpn(1)===0?fe=S:fe=A,fe.cmpn(0)<0&&fe.iadd(l),fe},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var m=this.clone(),_=l.clone();m.negative=0,_.negative=0;for(var S=0;m.isEven()&&_.isEven();S++)m.iushrn(1),_.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;_.isEven();)_.iushrn(1);var A=m.cmp(_);if(A<0){var v=m;m=_,_=v}else if(A===0||_.cmpn(1)===0)break;m.isub(_)}while(!0);return _.iushln(S)},"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 m=l%26,_=(l-m)/26,S=1<<m;if(this.length<=_)return this._expand(_+1),this.words[_]|=S,this;for(var A=S,v=_;A!==0&&v<this.length;v++){var T=this.words[v]|0;T+=A,A=T>>>26,T&=67108863,this.words[v]=T}return A!==0&&(this.words[v]=A,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 m=l<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var _;if(this.length>1)_=1;else{m&&(l=-l),t(l<=67108863,"Number is too big");var S=this.words[0]|0;_=S===l?0:S<l?-1:1}return this.negative!==0?-_|0:_},"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 m=this.ucmp(l);return this.negative!==0?-m|0:m},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var m=0,_=this.length-1;_>=0;_--){var S=this.words[_]|0,A=l.words[_]|0;if(S!==A){S<A?m=-1:S>A&&(m=1);break}}return m},"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 h(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 ie={k256:null,p224:null,p192:null,p25519:null};function G(b,l){this.name=b,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(G,"MPrime"),G.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),G.prototype.ireduce=o(function(l){var m=l,_;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),_=m.bitLength();while(_>this.n);var S=_<this.n?-1:m.ucmp(this.p);return S===0?(m.words[0]=0,m.length=1):S>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),G.prototype.split=o(function(l,m){l.iushrn(this.n,0,m)},"split"),G.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function $(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o($,"K256"),n($,G),$.prototype.split=o(function(l,m){for(var _=4194303,S=Math.min(l.length,9),A=0;A<S;A++)m.words[A]=l.words[A];if(m.length=S,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(m.words[m.length++]=v&_,A=10;A<l.length;A++){var T=l.words[A]|0;l.words[A-10]=(T&_)<<4|v>>>22,v=T}v>>>=22,l.words[A-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},"split"),$.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var m=0,_=0;_<l.length;_++){var S=l.words[_]|0;m+=S*977,l.words[_]=m&67108863,m=S*64+(m/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function K(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(K,"P224"),n(K,G);function he(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(he,"P192"),n(he,G);function C(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(C,"P25519"),n(C,G),C.prototype.imulK=o(function(l){for(var m=0,_=0;_<l.length;_++){var S=(l.words[_]|0)*19+m,A=S&67108863;S>>>=26,l.words[_]=A,m=S}return m!==0&&(l.words[l.length++]=m),l},"imulK"),i._prime=o(function(l){if(ie[l])return ie[l];var m;if(l==="k256")m=new $;else if(l==="p224")m=new K;else if(l==="p192")m=new he;else if(l==="p25519")m=new C;else throw new Error("Unknown prime "+l);return ie[l]=m,m},"prime");function h(b){if(typeof b=="string"){var l=i._prime(b);this.m=l.p,this.prime=l}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,m){t((l.negative|m.negative)===0,"red works only with positives"),t(l.red&&l.red===m.red,"red works only with red numbers")},"_verify2"),h.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(g(l,l.umod(this.m)._forceRed(this)),l)},"imod"),h.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),h.prototype.add=o(function(l,m){this._verify2(l,m);var _=l.add(m);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},"add"),h.prototype.iadd=o(function(l,m){this._verify2(l,m);var _=l.iadd(m);return _.cmp(this.m)>=0&&_.isub(this.m),_},"iadd"),h.prototype.sub=o(function(l,m){this._verify2(l,m);var _=l.sub(m);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},"sub"),h.prototype.isub=o(function(l,m){this._verify2(l,m);var _=l.isub(m);return _.cmpn(0)<0&&_.iadd(this.m),_},"isub"),h.prototype.shl=o(function(l,m){return this._verify1(l),this.imod(l.ushln(m))},"shl"),h.prototype.imul=o(function(l,m){return this._verify2(l,m),this.imod(l.imul(m))},"imul"),h.prototype.mul=o(function(l,m){return this._verify2(l,m),this.imod(l.mul(m))},"mul"),h.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),h.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),h.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var _=this.m.add(new i(1)).iushrn(2);return this.pow(l,_)}for(var S=this.m.subn(1),A=0;!S.isZero()&&S.andln(1)===0;)A++,S.iushrn(1);t(!S.isZero());var v=new i(1).toRed(this),T=v.redNeg(),L=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,L).cmp(T)!==0;)w.redIAdd(T);for(var k=this.pow(w,S),fe=this.pow(l,S.addn(1).iushrn(1)),D=this.pow(l,S),Q=A;D.cmp(v)!==0;){for(var se=D,H=0;se.cmp(v)!==0;H++)se=se.redSqr();t(H<Q);var z=this.pow(k,new i(1).iushln(Q-H-1));fe=fe.redMul(z),k=z.redSqr(),D=D.redMul(k),Q=H}return fe},"sqrt"),h.prototype.invm=o(function(l){var m=l._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},"invm"),h.prototype.pow=o(function(l,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return l.clone();var _=4,S=new Array(1<<_);S[0]=new i(1).toRed(this),S[1]=l;for(var A=2;A<S.length;A++)S[A]=this.mul(S[A-1],l);var v=S[0],T=0,L=0,w=m.bitLength()%26;for(w===0&&(w=26),A=m.length-1;A>=0;A--){for(var k=m.words[A],fe=w-1;fe>=0;fe--){var D=k>>fe&1;if(v!==S[0]&&(v=this.sqr(v)),D===0&&T===0){L=0;continue}T<<=1,T|=D,L++,!(L!==_&&(A!==0||fe!==0))&&(v=this.mul(v,S[T]),L=0,T=0)}w=26}return v},"pow"),h.prototype.convertTo=o(function(l){var m=l.umod(this.m);return m===l?m.clone():m},"convertTo"),h.prototype.convertFrom=o(function(l){var m=l.clone();return m.red=null,m},"convertFrom"),i.mont=o(function(l){return new x(l)},"mont");function x(b){h.call(this,b),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(x,"Mont"),n(x,h),x.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),x.prototype.convertFrom=o(function(l){var m=this.imod(l.mul(this.rinv));return m.red=null,m},"convertFrom"),x.prototype.imul=o(function(l,m){if(l.isZero()||m.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(m),S=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=_.isub(S).iushrn(this.shift),v=A;return A.cmp(this.m)>=0?v=A.isub(this.m):A.cmpn(0)<0&&(v=A.iadd(this.m)),v._forceRed(this)},"imul"),x.prototype.mul=o(function(l,m){if(l.isZero()||m.isZero())return new i(0)._forceRed(this);var _=l.mul(m),S=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=_.isub(S).iushrn(this.shift),v=A;return A.cmp(this.m)>=0?v=A.isub(this.m):A.cmpn(0)<0&&(v=A.iadd(this.m)),v._forceRed(this)},"mul"),x.prototype.invm=o(function(l){var m=this.imod(l._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm")})(typeof Kb>"u"||Kb,f8)});var V8=Re((EY,G8)=>{G8.exports=og;var j8=128,cU=127,uU=~cU,lU=Math.pow(2,31);function og(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw og.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=lU;)e[t++]=r&255|j8,r/=128;for(;r&uU;)e[t++]=r&255|j8,r>>>=7;return e[t]=r|0,og.bytes=t-n+1,e}o(og,"encode")});var Y8=Re((AY,J8)=>{J8.exports=sg;var hU=128,W8=127;function sg(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u||i>49)throw sg.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&W8)<<i:(f&W8)*Math.pow(2,i),i+=7}while(f>=hU);return sg.bytes=s-n,t}o(sg,"read")});var Z8=Re((SY,X8)=>{var dU=Math.pow(2,7),pU=Math.pow(2,14),mU=Math.pow(2,21),bU=Math.pow(2,28),gU=Math.pow(2,35),vU=Math.pow(2,42),yU=Math.pow(2,49),xU=Math.pow(2,56),wU=Math.pow(2,63);X8.exports=function(r){return r<dU?1:r<pU?2:r<mU?3:r<bU?4:r<gU?5:r<vU?6:r<yU?7:r<xU?8:r<wU?9:10}});var ll=Re((MY,Q8)=>{Q8.exports={encode:V8(),decode:Y8(),encodingLength:Z8()}});var u_=Re((DY,c_)=>{"use strict";c_.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(f){return function(u,d){var g={key:u,value:f[u]},y={key:d,value:f[d]};return s(g,y)}}}(e.cmp),i=[];return o(function s(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var u,d;if(Array.isArray(f)){for(d="[",u=0;u<f.length;u++)u&&(d+=","),d+=s(f[u])||"null";return d+"]"}if(f===null)return"null";if(i.indexOf(f)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=i.push(f)-1,y=Object.keys(f).sort(n&&n(f));for(d="",u=0;u<y.length;u++){var E=y[u],O=s(f[E]);!O||(d&&(d+=","),d+=JSON.stringify(E)+":"+O)}return i.splice(g,1),"{"+d+"}"}},"stringify")(r)}});var Uc=Re((bl,Nc)=>{var nF=200,C_="__lodash_hash_undefined__",k_=9007199254740991,Cg="[object Arguments]",iF="[object Array]",I_="[object Boolean]",D_="[object Date]",oF="[object Error]",kg="[object Function]",R_="[object GeneratorFunction]",w0="[object Map]",O_="[object Number]",Ig="[object Object]",g_="[object Promise]",N_="[object RegExp]",_0="[object Set]",P_="[object String]",L_="[object Symbol]",_g="[object WeakMap]",B_="[object ArrayBuffer]",E0="[object DataView]",U_="[object Float32Array]",F_="[object Float64Array]",$_="[object Int8Array]",q_="[object Int16Array]",H_="[object Int32Array]",z_="[object Uint8Array]",K_="[object Uint8ClampedArray]",j_="[object Uint16Array]",G_="[object Uint32Array]",sF=/[\\^$.*+?()[\]{}|]/g,aF=/\w*$/,fF=/^\[object .+?Constructor\]$/,cF=/^(?:0|[1-9]\d*)$/,or={};or[Cg]=or[iF]=or[B_]=or[E0]=or[I_]=or[D_]=or[U_]=or[F_]=or[$_]=or[q_]=or[H_]=or[w0]=or[O_]=or[Ig]=or[N_]=or[_0]=or[P_]=or[L_]=or[z_]=or[K_]=or[j_]=or[G_]=!0;or[oF]=or[kg]=or[_g]=!1;var uF=typeof global=="object"&&global&&global.Object===Object&&global,lF=typeof self=="object"&&self&&self.Object===Object&&self,us=uF||lF||Function("return this")(),V_=typeof bl=="object"&&bl&&!bl.nodeType&&bl,v_=V_&&typeof Nc=="object"&&Nc&&!Nc.nodeType&&Nc,hF=v_&&v_.exports===V_;function dF(r,e){return r.set(e[0],e[1]),r}o(dF,"addMapEntry");function pF(r,e){return r.add(e),r}o(pF,"addSetEntry");function mF(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(mF,"arrayEach");function bF(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(bF,"arrayPush");function W_(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(W_,"arrayReduce");function gF(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(gF,"baseTimes");function vF(r,e){return r?.[e]}o(vF,"getValue");function J_(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}o(J_,"isHostObject");function y_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(y_,"mapToArray");function Dg(r,e){return function(t){return r(e(t))}}o(Dg,"overArg");function x_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(x_,"setToArray");var yF=Array.prototype,xF=Function.prototype,A0=Object.prototype,wg=us["__core-js_shared__"],w_=function(){var r=/[^.]+$/.exec(wg&&wg.keys&&wg.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Y_=xF.toString,ia=A0.hasOwnProperty,S0=A0.toString,wF=RegExp("^"+Y_.call(ia).replace(sF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),__=hF?us.Buffer:void 0,E_=us.Symbol,A_=us.Uint8Array,_F=Dg(Object.getPrototypeOf,Object),EF=Object.create,AF=A0.propertyIsEnumerable,SF=yF.splice,S_=Object.getOwnPropertySymbols,MF=__?__.isBuffer:void 0,TF=Dg(Object.keys,Object),Eg=Bc(us,"DataView"),gl=Bc(us,"Map"),Ag=Bc(us,"Promise"),Sg=Bc(us,"Set"),Mg=Bc(us,"WeakMap"),vl=Bc(Object,"create"),CF=cf(Eg),kF=cf(gl),IF=cf(Ag),DF=cf(Sg),RF=cf(Mg),M_=E_?E_.prototype:void 0,T_=M_?M_.valueOf:void 0;function ff(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(ff,"Hash");function OF(){this.__data__=vl?vl(null):{}}o(OF,"hashClear");function NF(r){return this.has(r)&&delete this.__data__[r]}o(NF,"hashDelete");function PF(r){var e=this.__data__;if(vl){var t=e[r];return t===C_?void 0:t}return ia.call(e,r)?e[r]:void 0}o(PF,"hashGet");function LF(r){var e=this.__data__;return vl?e[r]!==void 0:ia.call(e,r)}o(LF,"hashHas");function BF(r,e){var t=this.__data__;return t[r]=vl&&e===void 0?C_:e,this}o(BF,"hashSet");ff.prototype.clear=OF;ff.prototype.delete=NF;ff.prototype.get=PF;ff.prototype.has=LF;ff.prototype.set=BF;function ls(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(ls,"ListCache");function UF(){this.__data__=[]}o(UF,"listCacheClear");function FF(r){var e=this.__data__,t=M0(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():SF.call(e,t,1),!0}o(FF,"listCacheDelete");function $F(r){var e=this.__data__,t=M0(e,r);return t<0?void 0:e[t][1]}o($F,"listCacheGet");function qF(r){return M0(this.__data__,r)>-1}o(qF,"listCacheHas");function HF(r,e){var t=this.__data__,n=M0(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(HF,"listCacheSet");ls.prototype.clear=UF;ls.prototype.delete=FF;ls.prototype.get=$F;ls.prototype.has=qF;ls.prototype.set=HF;function Pc(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(Pc,"MapCache");function zF(){this.__data__={hash:new ff,map:new(gl||ls),string:new ff}}o(zF,"mapCacheClear");function KF(r){return T0(this,r).delete(r)}o(KF,"mapCacheDelete");function jF(r){return T0(this,r).get(r)}o(jF,"mapCacheGet");function GF(r){return T0(this,r).has(r)}o(GF,"mapCacheHas");function VF(r,e){return T0(this,r).set(r,e),this}o(VF,"mapCacheSet");Pc.prototype.clear=zF;Pc.prototype.delete=KF;Pc.prototype.get=jF;Pc.prototype.has=GF;Pc.prototype.set=VF;function Lc(r){this.__data__=new ls(r)}o(Lc,"Stack");function WF(){this.__data__=new ls}o(WF,"stackClear");function JF(r){return this.__data__.delete(r)}o(JF,"stackDelete");function YF(r){return this.__data__.get(r)}o(YF,"stackGet");function XF(r){return this.__data__.has(r)}o(XF,"stackHas");function ZF(r,e){var t=this.__data__;if(t instanceof ls){var n=t.__data__;if(!gl||n.length<nF-1)return n.push([r,e]),this;t=this.__data__=new Pc(n)}return t.set(r,e),this}o(ZF,"stackSet");Lc.prototype.clear=WF;Lc.prototype.delete=JF;Lc.prototype.get=YF;Lc.prototype.has=XF;Lc.prototype.set=ZF;function QF(r,e){var t=Og(r)||E$(r)?gF(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||ia.call(r,s))&&!(i&&(s=="length"||y$(s,n)))&&t.push(s);return t}o(QF,"arrayLikeKeys");function X_(r,e,t){var n=r[e];(!(ia.call(r,e)&&tE(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(X_,"assignValue");function M0(r,e){for(var t=r.length;t--;)if(tE(r[t][0],e))return t;return-1}o(M0,"assocIndexOf");function e$(r,e){return r&&Z_(e,Ng(e),r)}o(e$,"baseAssign");function Tg(r,e,t,n,i,s,f){var u;if(n&&(u=s?n(r,i,s,f):n(r)),u!==void 0)return u;if(!C0(r))return r;var d=Og(r);if(d){if(u=b$(r),!e)return d$(r,u)}else{var g=af(r),y=g==kg||g==R_;if(S$(r))return s$(r,e);if(g==Ig||g==Cg||y&&!s){if(J_(r))return s?r:{};if(u=g$(y?{}:r),!e)return p$(r,e$(u,r))}else{if(!or[g])return s?r:{};u=v$(r,g,Tg,e)}}f||(f=new Lc);var E=f.get(r);if(E)return E;if(f.set(r,u),!d)var O=t?m$(r):Ng(r);return mF(O||r,function(R,I){O&&(I=R,R=r[I]),X_(u,I,Tg(R,e,t,n,I,r,f))}),u}o(Tg,"baseClone");function t$(r){return C0(r)?EF(r):{}}o(t$,"baseCreate");function r$(r,e,t){var n=e(r);return Og(r)?n:bF(n,t(r))}o(r$,"baseGetAllKeys");function n$(r){return S0.call(r)}o(n$,"baseGetTag");function i$(r){if(!C0(r)||w$(r))return!1;var e=nE(r)||J_(r)?wF:fF;return e.test(cf(r))}o(i$,"baseIsNative");function o$(r){if(!eE(r))return TF(r);var e=[];for(var t in Object(r))ia.call(r,t)&&t!="constructor"&&e.push(t);return e}o(o$,"baseKeys");function s$(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(s$,"cloneBuffer");function Rg(r){var e=new r.constructor(r.byteLength);return new A_(e).set(new A_(r)),e}o(Rg,"cloneArrayBuffer");function a$(r,e){var t=e?Rg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(a$,"cloneDataView");function f$(r,e,t){var n=e?t(y_(r),!0):y_(r);return W_(n,dF,new r.constructor)}o(f$,"cloneMap");function c$(r){var e=new r.constructor(r.source,aF.exec(r));return e.lastIndex=r.lastIndex,e}o(c$,"cloneRegExp");function u$(r,e,t){var n=e?t(x_(r),!0):x_(r);return W_(n,pF,new r.constructor)}o(u$,"cloneSet");function l$(r){return T_?Object(T_.call(r)):{}}o(l$,"cloneSymbol");function h$(r,e){var t=e?Rg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(h$,"cloneTypedArray");function d$(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(d$,"copyArray");function Z_(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var f=e[i],u=n?n(t[f],r[f],f,t,r):void 0;X_(t,f,u===void 0?r[f]:u)}return t}o(Z_,"copyObject");function p$(r,e){return Z_(r,Q_(r),e)}o(p$,"copySymbols");function m$(r){return r$(r,Ng,Q_)}o(m$,"getAllKeys");function T0(r,e){var t=r.__data__;return x$(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(T0,"getMapData");function Bc(r,e){var t=vF(r,e);return i$(t)?t:void 0}o(Bc,"getNative");var Q_=S_?Dg(S_,Object):C$,af=n$;(Eg&&af(new Eg(new ArrayBuffer(1)))!=E0||gl&&af(new gl)!=w0||Ag&&af(Ag.resolve())!=g_||Sg&&af(new Sg)!=_0||Mg&&af(new Mg)!=_g)&&(af=o(function(r){var e=S0.call(r),t=e==Ig?r.constructor:void 0,n=t?cf(t):void 0;if(n)switch(n){case CF:return E0;case kF:return w0;case IF:return g_;case DF:return _0;case RF:return _g}return e},"getTag"));function b$(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&ia.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(b$,"initCloneArray");function g$(r){return typeof r.constructor=="function"&&!eE(r)?t$(_F(r)):{}}o(g$,"initCloneObject");function v$(r,e,t,n){var i=r.constructor;switch(e){case B_:return Rg(r);case I_:case D_:return new i(+r);case E0:return a$(r,n);case U_:case F_:case $_:case q_:case H_:case z_:case K_:case j_:case G_:return h$(r,n);case w0:return f$(r,n,t);case O_:case P_:return new i(r);case N_:return c$(r);case _0:return u$(r,n,t);case L_:return l$(r)}}o(v$,"initCloneByTag");function y$(r,e){return e=e??k_,!!e&&(typeof r=="number"||cF.test(r))&&r>-1&&r%1==0&&r<e}o(y$,"isIndex");function x$(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(x$,"isKeyable");function w$(r){return!!w_&&w_ in r}o(w$,"isMasked");function eE(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||A0;return r===t}o(eE,"isPrototype");function cf(r){if(r!=null){try{return Y_.call(r)}catch{}try{return r+""}catch{}}return""}o(cf,"toSource");function _$(r){return Tg(r,!0,!0)}o(_$,"cloneDeep");function tE(r,e){return r===e||r!==r&&e!==e}o(tE,"eq");function E$(r){return A$(r)&&ia.call(r,"callee")&&(!AF.call(r,"callee")||S0.call(r)==Cg)}o(E$,"isArguments");var Og=Array.isArray;function rE(r){return r!=null&&M$(r.length)&&!nE(r)}o(rE,"isArrayLike");function A$(r){return T$(r)&&rE(r)}o(A$,"isArrayLikeObject");var S$=MF||k$;function nE(r){var e=C0(r)?S0.call(r):"";return e==kg||e==R_}o(nE,"isFunction");function M$(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=k_}o(M$,"isLength");function C0(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(C0,"isObject");function T$(r){return!!r&&typeof r=="object"}o(T$,"isObjectLike");function Ng(r){return rE(r)?QF(r):o$(r)}o(Ng,"keys");function C$(){return[]}o(C$,"stubArray");function k$(){return!1}o(k$,"stubFalse");Nc.exports=_$});var ZE=Re((ms,XE)=>{var YE=typeof self<"u"?self:ms,ep=function(){function r(){this.fetch=!1,this.DOMException=YE.DOMException}return o(r,"F"),r.prototype=YE,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{return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function i(C){return C&&DataView.prototype.isPrototypeOf(C)}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]"],f=ArrayBuffer.isView||function(C){return C&&s.indexOf(Object.prototype.toString.call(C))>-1};function u(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}o(u,"normalizeName");function d(C){return typeof C!="string"&&(C=String(C)),C}o(d,"normalizeValue");function g(C){var h={next:function(){var x=C.shift();return{done:x===void 0,value:x}}};return n.iterable&&(h[Symbol.iterator]=function(){return h}),h}o(g,"iteratorFor");function y(C){this.map={},C instanceof y?C.forEach(function(h,x){this.append(x,h)},this):Array.isArray(C)?C.forEach(function(h){this.append(h[0],h[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(h){this.append(h,C[h])},this)}o(y,"Headers"),y.prototype.append=function(C,h){C=u(C),h=d(h);var x=this.map[C];this.map[C]=x?x+", "+h:h},y.prototype.delete=function(C){delete this.map[u(C)]},y.prototype.get=function(C){return C=u(C),this.has(C)?this.map[C]:null},y.prototype.has=function(C){return this.map.hasOwnProperty(u(C))},y.prototype.set=function(C,h){this.map[u(C)]=d(h)},y.prototype.forEach=function(C,h){for(var x in this.map)this.map.hasOwnProperty(x)&&C.call(h,this.map[x],x,this)},y.prototype.keys=function(){var C=[];return this.forEach(function(h,x){C.push(x)}),g(C)},y.prototype.values=function(){var C=[];return this.forEach(function(h){C.push(h)}),g(C)},y.prototype.entries=function(){var C=[];return this.forEach(function(h,x){C.push([x,h])}),g(C)},n.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function E(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}o(E,"consumed");function O(C){return new Promise(function(h,x){C.onload=function(){h(C.result)},C.onerror=function(){x(C.error)}})}o(O,"fileReaderReady");function R(C){var h=new FileReader,x=O(h);return h.readAsArrayBuffer(C),x}o(R,"readBlobAsArrayBuffer");function I(C){var h=new FileReader,x=O(h);return h.readAsText(C),x}o(I,"readBlobAsText");function P(C){for(var h=new Uint8Array(C),x=new Array(h.length),b=0;b<h.length;b++)x[b]=String.fromCharCode(h[b]);return x.join("")}o(P,"readArrayBufferAsText");function X(C){if(C.slice)return C.slice(0);var h=new Uint8Array(C.byteLength);return h.set(new Uint8Array(C)),h.buffer}o(X,"bufferClone");function B(){return this.bodyUsed=!1,this._initBody=function(C){this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:n.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:n.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():n.arrayBuffer&&n.blob&&i(C)?(this._bodyArrayBuffer=X(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||f(C))?this._bodyArrayBuffer=X(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="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(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var C=E(this);if(C)return C;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?E(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(R)}),this.text=function(){var C=E(this);if(C)return C;if(this._bodyBlob)return I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(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(ie)}),this.json=function(){return this.text().then(JSON.parse)},this}o(B,"Body");var J=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ee(C){var h=C.toUpperCase();return J.indexOf(h)>-1?h:C}o(ee,"normalizeMethod");function Y(C,h){h=h||{};var x=h.body;if(C instanceof Y){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,h.headers||(this.headers=new y(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!x&&C._bodyInit!=null&&(x=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new y(h.headers)),this.method=ee(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}o(Y,"Request"),Y.prototype.clone=function(){return new Y(this,{body:this._bodyInit})};function ie(C){var h=new FormData;return C.trim().split("&").forEach(function(x){if(x){var b=x.split("="),l=b.shift().replace(/\+/g," "),m=b.join("=").replace(/\+/g," ");h.append(decodeURIComponent(l),decodeURIComponent(m))}}),h}o(ie,"decode");function G(C){var h=new y,x=C.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(b){var l=b.split(":"),m=l.shift().trim();if(m){var _=l.join(":").trim();h.append(m,_)}}),h}o(G,"parseHeaders"),B.call(Y.prototype);function $(C,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new y(h.headers),this.url=h.url||"",this._initBody(C)}o($,"Response"),B.call($.prototype),$.prototype.clone=function(){return new $(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},$.error=function(){var C=new $(null,{status:0,statusText:""});return C.type="error",C};var K=[301,302,303,307,308];$.redirect=function(C,h){if(K.indexOf(h)===-1)throw new RangeError("Invalid status code");return new $(null,{status:h,headers:{location:C}})},t.DOMException=r.DOMException;try{new t.DOMException}catch{t.DOMException=function(h,x){this.message=h,this.name=x;var b=Error(h);this.stack=b.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function he(C,h){return new Promise(function(x,b){var l=new Y(C,h);if(l.signal&&l.signal.aborted)return b(new t.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function _(){m.abort()}o(_,"abortXhr"),m.onload=function(){var S={status:m.status,statusText:m.statusText,headers:G(m.getAllResponseHeaders()||"")};S.url="responseURL"in m?m.responseURL:S.headers.get("X-Request-URL");var A="response"in m?m.response:m.responseText;x(new $(A,S))},m.onerror=function(){b(new TypeError("Network request failed"))},m.ontimeout=function(){b(new TypeError("Network request failed"))},m.onabort=function(){b(new t.DOMException("Aborted","AbortError"))},m.open(l.method,l.url,!0),l.credentials==="include"?m.withCredentials=!0:l.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&n.blob&&(m.responseType="blob"),l.headers.forEach(function(S,A){m.setRequestHeader(A,S)}),l.signal&&(l.signal.addEventListener("abort",_),m.onreadystatechange=function(){m.readyState===4&&l.signal.removeEventListener("abort",_)}),m.send(typeof l._bodyInit>"u"?null:l._bodyInit)})}return o(he,"fetch"),he.polyfill=!0,r.fetch||(r.fetch=he,r.Headers=y,r.Request=Y,r.Response=$),t.Headers=y,t.Request=Y,t.Response=$,t.fetch=he,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(ep);ep.fetch.ponyfill=!0;delete ep.fetch.polyfill;var Yc=ep;ms=Yc.fetch;ms.default=Yc.fetch;ms.fetch=Yc.fetch;ms.Headers=Yc.Headers;ms.Request=Yc.Request;ms.Response=Yc.Response;XE.exports=ms});var c9=Re((pre,f9)=>{"use strict";var pq=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=vq(n),this._batchScheduleFn=yq(n),this._cacheKeyFn=xq(n),this._cacheMap=wq(n),this._batch=null,this.name=_q(n)}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=bq(this),s=this._cacheMap,f=this._cacheKeyFn(n);if(s){var u=s.get(f);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(y){d.push(function(){y(u)})})}}i.keys.push(n);var g=new Promise(function(y,E){i.callbacks.push({resolve:y,reject:E})});return s&&s.set(f,g),g},"load"),e.loadMany=o(function(n){if(!a9(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(f){return f}));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 f=this._cacheKeyFn(n);if(s.get(f)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),s.set(f,u)}}return this},"prime"),r}(),mq=typeof process=="object"&&typeof process.nextTick=="function"?function(r){a2||(a2=Promise.resolve()),a2.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},a2;function bq(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize)return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){gq(r,t)}),t}o(bq,"getCurrentBatch");function gq(r,e){if(e.hasDispatched=!0,e.keys.length===0){c2(e);return}var t;try{t=r._batchLoadFn(e.keys)}catch(n){return f2(r,e,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(n)+".")))}if(!t||typeof t.then!="function")return f2(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(!a9(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."+(`
650
650
 
651
651
  Keys:
652
652
  `+String(e.keys))+(`
653
653
 
654
654
  Values:
655
- `+String(n)));c2(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){f2(r,e,n)})}o(gq,"dispatchBatch");function f2(r,e,t){c2(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(f2,"failedDispatch");function c2(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(c2,"resolveCacheHits");function vq(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(vq,"getValidMaxBatchSize");function yq(r){var e=r&&r.batchScheduleFn;if(e===void 0)return mq;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(yq,"getValidBatchScheduleFn");function xq(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(xq,"getValidCacheKeyFn");function wq(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(wq,"getValidCacheMap");function _q(r){return r&&r.name?r.name:null}o(_q,"getValidName");function a9(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(a9,"isArrayLike");f9.exports=pq});var A9=Re((qre,E9)=>{"use strict";function $q(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 f=r.length,u=r.charAt(0),d=Math.log(f)/Math.log(256),g=Math.log(256)/Math.log(f);function y(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var I=0,N=0,X=0,L=R.length;X!==L&&R[X]===0;)X++,I++;for(var J=(L-X)*g+1>>>0,ee=new Uint8Array(J);X!==L;){for(var Y=R[X],ie=0,G=J-1;(Y!==0||ie<N)&&G!==-1;G--,ie++)Y+=256*ee[G]>>>0,ee[G]=Y%f>>>0,Y=Y/f>>>0;if(Y!==0)throw new Error("Non-zero carry");N=ie,X++}for(var $=J-N;$!==J&&ee[$]===0;)$++;for(var K=u.repeat(I);$<J;++$)K+=r.charAt(ee[$]);return K}o(y,"encode");function E(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var I=0;if(R[I]!==" "){for(var N=0,X=0;R[I]===u;)N++,I++;for(var L=(R.length-I)*d+1>>>0,J=new Uint8Array(L);R[I];){var ee=e[R.charCodeAt(I)];if(ee===255)return;for(var Y=0,ie=L-1;(ee!==0||Y<X)&&ie!==-1;ie--,Y++)ee+=f*J[ie]>>>0,J[ie]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");X=Y,I++}if(R[I]!==" "){for(var G=L-X;G!==L&&J[G]===0;)G++;for(var $=new Uint8Array(N+(L-G)),K=N;G!==L;)$[K++]=J[G++];return $}}}o(E,"decodeUnsafe");function O(R){var I=E(R);if(I)return I;throw new Error("Non-base"+f+" character")}return o(O,"decode"),{encode:y,decodeUnsafe:E,decode:O}}o($q,"base");E9.exports=$q});var rp=Re((Hre,S9)=>{"use strict";var qq=new TextDecoder,Hq=o(r=>qq.decode(r),"decodeText"),zq=new TextEncoder,Kq=o(r=>zq.encode(r),"encodeText");function jq(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(jq,"concat");S9.exports={decodeText:Hq,encodeText:Kq,concat:jq}});var T9=Re((zre,M9)=>{"use strict";var{encodeText:Gq}=rp(),np=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=Gq(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(np,"Base");M9.exports=np});var k9=Re((Kre,C9)=>{"use strict";var Vq=o((r,e,t)=>{let n={};for(let g=0;g<e.length;++g)n[e[g]]=g;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),f=0,u=0,d=0;for(let g=0;g<i;++g){let y=n[r[g]];if(y===void 0)throw new SyntaxError("Invalid character "+r[g]);u=u<<t|y,f+=t,f>=8&&(f-=8,s[d++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return s},"decode"),Wq=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Jq=o(r=>e=>({encode(t){return Wq(t,e,r)},decode(t){return Vq(t,e,r)}}),"rfc4648");C9.exports={rfc4648:Jq}});var O9=Re((jre,R9)=>{"use strict";var Rl=A9(),Yq=T9(),{rfc4648:Gr}=k9(),{decodeText:Xq,encodeText:Zq}=rp(),Qq=o(()=>({encode:Xq,decode:Zq}),"identity"),I9=[["identity","\0",Qq,""],["base2","0",Gr(1),"01"],["base8","7",Gr(3),"01234567"],["base10","9",Rl,"0123456789"],["base16","f",Gr(4),"0123456789abcdef"],["base16upper","F",Gr(4),"0123456789ABCDEF"],["base32hex","v",Gr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",Gr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",Gr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",Gr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",Gr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Rl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Rl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Rl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Rl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],D9=I9.reduce((r,e)=>(r[e[0]]=new Yq(e[0],e[1],e[2],e[3]),r),{}),eH=I9.reduce((r,e)=>(r[e[1]]=D9[e[0]],r),{});R9.exports={names:D9,codes:eH}});var L9=Re((gs,P9)=>{"use strict";var Xc=O9(),{encodeText:tH,decodeText:ip,concat:N9}=rp();function rH(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=yf(r);return sH(t,e),N9([n,e],n.length+e.length)}o(rH,"multibase");function nH(r,e){let t=yf(r),n=tH(t.encode(e));return N9([t.codeBuf,n],t.codeBuf.length+n.length)}o(nH,"encode");function iH(r){r instanceof Uint8Array&&(r=ip(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),yf(r[0]).decode(r.substring(1))}o(iH,"decode");function oH(r){if(r instanceof Uint8Array&&(r=ip(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return yf(r[0]).name}catch{return!1}}o(oH,"isEncoded");function sH(r,e){yf(r).decode(ip(e))}o(sH,"validEncode");function yf(r){if(Object.prototype.hasOwnProperty.call(Xc.names,r))return Xc.names[r];if(Object.prototype.hasOwnProperty.call(Xc.codes,r))return Xc.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(yf,"encoding");function aH(r){return r instanceof Uint8Array&&(r=ip(r)),yf(r[0])}o(aH,"encodingFromData");gs=P9.exports=rH;gs.encode=nH;gs.decode=iH;gs.isEncoded=oH;gs.encoding=yf;gs.encodingFromData=aH;var fH=Object.freeze(Xc.names),cH=Object.freeze(Xc.codes);gs.names=fH;gs.codes=cH});var $9=Re((Gre,F9)=>{F9.exports=U9;var B9=128,uH=127,lH=~uH,hH=Math.pow(2,31);function U9(r,e,t){e=e||[],t=t||0;for(var n=t;r>=hH;)e[t++]=r&255|B9,r/=128;for(;r&lH;)e[t++]=r&255|B9,r>>>=7;return e[t]=r|0,U9.bytes=t-n+1,e}o(U9,"encode")});var z9=Re((Vre,H9)=>{H9.exports=y2;var dH=128,q9=127;function y2(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw y2.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&q9)<<i:(f&q9)*Math.pow(2,i),i+=7}while(f>=dH);return y2.bytes=s-n,t}o(y2,"read")});var j9=Re((Wre,K9)=>{var pH=Math.pow(2,7),mH=Math.pow(2,14),bH=Math.pow(2,21),gH=Math.pow(2,28),vH=Math.pow(2,35),yH=Math.pow(2,42),xH=Math.pow(2,49),wH=Math.pow(2,56),_H=Math.pow(2,63);K9.exports=function(r){return r<pH?1:r<mH?2:r<bH?3:r<gH?4:r<vH?5:r<yH?6:r<xH?7:r<wH?8:r<_H?9:10}});var V9=Re((Jre,G9)=>{G9.exports={encode:$9(),decode:z9(),encodingLength:j9()}});var J9=Re((Yre,W9)=>{"use strict";var EH=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});W9.exports={names:EH}});var r7=Re((Xre,t7)=>{"use strict";var Y9=L9(),Zc=V9(),{names:Ol}=J9(),{toString:op}=(Yf(),Ch(C3)),{fromString:AH}=(jh(),Ch(T3)),{concat:SH}=(Cm(),Ch(Zy)),Qc={};for(let r in Ol){let e=r;Qc[Ol[e]]=e}Object.freeze(Qc);function MH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return op(r,"base16")}o(MH,"toHexString");function TH(r){return AH(r,"base16")}o(TH,"fromHexString");function CH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return op(Y9.encode("base58btc",r)).slice(1)}o(CH,"toB58String");function kH(r){let e=r instanceof Uint8Array?op(r):r;return Y9.decode("z"+e)}o(kH,"fromB58String");function X9(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=Zc.decode(r);if(!Q9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Zc.decode.bytes);let t=Zc.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Zc.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${op(r,"base16")}`);return{code:e,name:Qc[e],length:t,digest:r}}o(X9,"decode");function IH(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=Z9(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=Zc.encode(n),s=Zc.encode(t);return SH([i,s,r],i.length+s.length+r.length)}o(IH,"encode");function Z9(r){let e=r;if(typeof r=="string"){if(Ol[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=Ol[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Qc[e]===void 0&&!x2(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(Z9,"coerceCode");function x2(r){return r>0&&r<16}o(x2,"isAppCode");function Q9(r){return!!(x2(r)||Qc[r])}o(Q9,"isValidCode");function e7(r){X9(r)}o(e7,"validate");function DH(r){return e7(r),r.subarray(0,2)}o(DH,"prefix");t7.exports={names:Ol,codes:Qc,toHexString:MH,fromHexString:TH,toB58String:CH,fromB58String:kH,decode:X9,encode:IH,coerceCode:Z9,isAppCode:x2,validate:e7,prefix:DH,isValidCode:Q9}});var _K={};Yt(_K,{CeramicURIValidator:()=>C2,default:()=>wK,getCeramicPlugin:()=>gp,streamIdToCeramicURI:()=>bp});module.exports=Ch(_K);var C7=Bt(Jy());function NI(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(NI,"_catch");function PI(){let r=new Map;return function(e,t){try{let i=function(f){if(n)return f;let u=r.get(e.didUrl);return u!==void 0?u:Promise.resolve(t()).then(function(d){var g;return((g=d.didResolutionMetadata)==null?void 0:g.error)!=="notFound"&&r.set(e.didUrl,d),d})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(f){return n=1,f})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(PI,"inMemoryCache");function LI(r,e){return e()}o(LI,"noCache");var BI="(?:%[0-9a-fA-F]{2})",Yy=`(?:[a-zA-Z0-9._-]|${BI})`,UI="([a-z0-9]+)",FI=`((?:${Yy}*:)*(${Yy}+))`,Xy="[a-zA-Z0-9_.:%-]",$I=`;${Xy}+=${Xy}*`,qI=`((${$I})*)`,HI="(/[^#?]*)?",zI="([?][^#]*)?",KI="(#.*)?",jI=new RegExp(`^did:${UI}:${FI}${qI}${HI}${zI}${KI}$`);function GI(r){if(r===""||!r)return null;let e=r.match(jI);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(GI,"parse");var kh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function VI(r){return function(e,t,n){try{return Promise.resolve(NI(function(){return Promise.resolve(r(e,t,n)).then(function(i){return{...kh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...kh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(VI,"wrapLegacyResolver");var yu=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?PI():t.cache||LI,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=VI(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=GI(e);if(i===null)return Promise.resolve({...kh,didResolutionMetadata:{error:"invalidDid"}});let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve({...kh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(yu,"Resolver");Cm();jh();Yf();Ih();xu();Wm();var J1=Bt(L3()),aw=Bt(n1()),Y1=Bt(u6()),Sd=Bt(vd()),fw=Bt(P6()),Hu=Bt(F6()),X1=Bt(Q6()),Z1=Bt(qa());function xi(r){return It(r,"base64url")}o(xi,"bytesToBase64url");function En(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Ut(e,"base64url")}o(En,"base64ToBytes");function Q1(r){return Ut(r,"base58btc")}o(Q1,"base58ToBytes");function G1(r){let e=r.startsWith("0x")?r.substring(2):r;return Ut(e.toLowerCase(),"base16")}o(G1,"hexToBytes");function V1(r){return xi(Ut(r))}o(V1,"encodeBase64url");function cw(r){return It(En(r))}o(cw,"decodeBase64url");function ja(r){return It(r,"base16")}o(ja,"bytesToHex");function uw(r){return Ut(r)}o(uw,"stringToBytes");function gP({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Ut(r,"base16"),0),i.set(Ut(e,"base16"),32),n){if(typeof t>"u")throw new Error("Signer did not return a recoveryParam");i[64]=t}return xi(i)}o(gP,"toJose");function vP(r){let e=En(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=ja(e.slice(0,32)),n=ja(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(vP,"fromJose");function lw(r,e){return Bi([En(r),En(e)])}o(lw,"toSealed");var yP=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,xP=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,wP=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function _P(r){if(typeof r=="string"){if(yP.test(r))return G1(r);if(xP.test(r))return Q1(r);if(wP.test(r))return En(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(_P,"parseKey");function hw(r){let e=typeof r=="string"?Ut(r):r;return(0,J1.hash)(e)}o(hw,"sha256");function EP(r){return new Uint8Array(aw.keccak_256.arrayBuffer(r))}o(EP,"keccak");function AP(r){let e=Ut(r.slice(2),"base16");return`0x${It(EP(e).slice(-20),"base16")}`}o(AP,"toEthereumAddress");function W1(r,e=new Uint8Array(4)){let t=Ut(r.toString(),"base10");return e.set(t,4-t.length),e}o(W1,"writeUint32BE");var j1=o(r=>Bi([W1(r.length),r]),"lengthAndInput");function dw(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=Bi([j1(Ut(t)),j1(typeof n>"u"?new Uint8Array(0):n),j1(typeof i>"u"?new Uint8Array(0):i),W1(e)]);return(0,J1.hash)(Bi([W1(1),r,s]))}o(dw,"concatKDF");var IG=new Y1.ec("secp256k1");function pw(r){let e=_P(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"?uw(t):t,i=(0,Sd.sign)(e,n);return Promise.resolve(xi(i))}catch(n){return Promise.reject(n)}}}o(pw,"EdDSASigner");function mw(r){return typeof r=="object"&&"r"in r&&"s"in r}o(mw,"instanceOfEcdsaSignature");function ew(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(mw(i))return gP(i,r);if(r&&typeof vP(i).recoveryParam>"u")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(ew,"ES256KSignerAlg");function tw(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(mw(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(tw,"Ed25519SignerAlg");var SP={ES256K:ew(),"ES256K-R":ew(!0),Ed25519:tw(),EdDSA:tw()};function MP(r){let e=SP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(MP,"SignerAlg");var eb=new Y1.ec("secp256k1");function Ad(r,e=!1){let t=En(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=ja(t.slice(0,32)),i=ja(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(Ad,"toSignatureObject");function tb(r){if(r.publicKeyBase58)return Q1(r.publicKeyBase58);if(r.publicKeyBase64)return En(r.publicKeyBase64);if(r.publicKeyHex)return G1(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return G1(eb.keyFromPublic({x:ja(En(r.publicKeyJwk.x)),y:ja(En(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Tu;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(tb,"extractPublicKeyBytes");function TP(r,e,t){let n=hw(r),i=Ad(e),s=t.filter(({ethereumAddress:d,blockchainAccountId:g})=>typeof d>"u"&&typeof g>"u"),f=t.filter(({ethereumAddress:d,blockchainAccountId:g})=>typeof d<"u"||typeof g!==void 0),u=s.find(d=>{try{let g=tb(d);return eb.keyFromPublic(g).verify(n,i)}catch{return!1}});if(!u&&f.length>0&&(u=bw(r,e,f)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(TP,"verifyES256K");function bw(r,e,t){let n;if(e.length>86)n=[Ad(e,!0)];else{let f=Ad(e,!1);n=[{...f,recoveryParam:0},{...f,recoveryParam:1}]}let i=o(f=>{let u=hw(r),d=eb.recoverPubKey(u,f,f.recoveryParam),g=d.encode("hex"),y=d.encode("hex",!0),E=AP(g);return t.find(R=>{var I,N,X;let L=ja(tb(R));return L===g||L===y||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===E||((N=R.blockchainAccountId)==null||(X=N.split("@eip155"))==null?void 0:X[0].toLowerCase())===E})},"checkSignatureAgainstSigner"),s=n.map(i).filter(f=>typeof f<"u");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(bw,"verifyRecoverableES256K");function rw(r,e,t){let n=uw(r),i=En(e),s=t.find(f=>(0,Sd.verify)(tb(f),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(rw,"verifyEd25519");var CP={ES256K:TP,"ES256K-R":bw,Ed25519:rw,EdDSA:rw};function gw(r){let e=CP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(gw,"VerifierAlgorithm");gw.toSignatureObject=Ad;var vw=o(function(r,e,t={},n={}){try{t.alg||(t.alg=kP);let i=typeof r=="string"?r:nw(r,n.canonicalize),s=[nw(t,n.canonicalize),i].join("."),f=MP(t.alg);return Promise.resolve(f(s,e)).then(function(u){return[s,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var kP="ES256K";function nw(r,e=!1){return V1(e?(0,fw.default)(r):JSON.stringify(r))}o(nw,"encodeSection");function IP(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(cw(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(IP,"decodeJWS");function DP({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),gw(r.alg)(e,t,n)}o(DP,"verifyJWSDecoded");function yw(r,e){let t=IP(r);return DP(t,e)}o(yw,"verifyJWS");function RP(r,e,t){for(var n;;){var i=r();if(js(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(js(s))s=s.s;else{n=1;break}if(e){var f=e();if(f&&f.then&&!js(f)){n=2;break}}}var u=new Ga,d=Ar.bind(null,u,2);return(n===0?i.then(y):n===1?s.then(g):f.then(E)).then(void 0,d),u;function g(O){s=O;do{if(e&&(f=e(),f&&f.then&&!js(f))){f.then(E).then(void 0,d);return}if(i=r(),!i||js(i)&&!i.v){Ar(u,1,s);return}if(i.then){i.then(y).then(void 0,d);return}s=t(),js(s)&&(s=s.v)}while(!s||!s.then);s.then(g).then(void 0,d)}o(g,"_resumeAfterBody");function y(O){O?(s=t(),s&&s.then?s.then(g).then(void 0,d):g(s)):Ar(u,1,s)}o(y,"_resumeAfterTest");function E(){(i=r())?i.then?i.then(y).then(void 0,d):y(i):Ar(u,1,s)}o(E,"_resumeAfterUpdate")}o(RP,"_for");var xw=o(function(r,e){try{let n=function(g){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let t;PP(r);let i=JSON.parse(cw(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=lw(r.ciphertext,r.tag),f=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),u=null,d=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,En(r.iv),f)).then(function(g){u=g}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let g=0;return RP(function(){return!u&&g<r.recipients.length},function(){return g++},function(){let y=r.recipients[g];Object.assign(y.header,i);let E=function(){if(y.header.alg===e.alg)return Promise.resolve(e.decrypt(s,En(r.iv),f,y)).then(function(O){u=O})}();if(E&&E.then)return E.then(function(){})})}}()}();return Promise.resolve(d&&d.then?d.then(n):n(d))}catch(t){return Promise.reject(t)}},"decryptJWE"),iw=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Ar(r,e,t){if(!r.s){if(t instanceof Ga)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=Ar.bind(null,r,e);return}if(t&&t.then){t.then(Ar.bind(null,r,e),Ar.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(Ar,"_settle");var Ga=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{Ar(n,1,s(this.v))}catch(f){Ar(n,2,f)}return n}else return this}return this.o=function(s){try{let f=s.v;s.s&1?Ar(n,1,e?e(f):f):t?Ar(n,1,t(f)):Ar(n,2,f)}catch(f){Ar(n,2,f)}},n},r}();function js(r){return r instanceof Ga&&r.s&1}o(js,"_isSettledPact");function OP(r,e,t){var n=-1,i,s;function f(u){try{for(;++n<r.length&&(!t||!t());)if(u=e(n),u&&u.then)if(js(u))u=u.v;else{u.then(f,s||(s=Ar.bind(null,i=new Ga,2)));return}i?Ar(i,1,u):i=u}catch(d){Ar(i||(i=new Ga),2,d)}}return o(f,"_cycle"),f(),i}o(OP,"_forTo");function NP(r,e,t){if(typeof r[iw]=="function"){let y=function(E){try{for(;!(i=n.next()).done&&(!t||!t());)if(E=e(i.value),E&&E.then)if(js(E))E=E.v;else{E.then(y,f||(f=Ar.bind(null,s=new Ga,2)));return}s?Ar(s,1,E):s=E}catch(O){Ar(s||(s=new Ga),2,O)}};o(y,"_cycle");var n=r[iw](),i,s,f;if(y(),n.return){var u=o(function(E){try{i.done||n.return()}catch{}return E},"_fixup");if(s&&s.then)return s.then(u,function(E){throw u(E)});u()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var d=[],g=0;g<r.length;g++)d.push(r[g]);return OP(d,function(y){return e(d[y])},t)}o(NP,"_forOf");function PP(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(PP,"validateJWE");function ow({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let f={protected:n,iv:xi(t),ciphertext:xi(r),tag:xi(e)};return s&&(f.aad=xi(s)),i&&(f.recipients=[i]),f}o(ow,"encodeJWE");var ww=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 ow(i,n)})}else{let i=e[0].enc;if(!e.reduce((d,g)=>d&&g.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,f,u=NP(e,function(d){let g=function(){return s?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(s)).then(function(y){if(y){var E,O;(E=f)==null||(O=E.recipients)==null||O.push(y)}}):Promise.resolve(d.encrypt(r,t,n)).then(function(y){s=y.cek,f=ow(y,n)})}();if(g&&g.then)return g.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return f}):f)}}catch(i){return Promise.reject(i)}},"createJWE");var _w=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:f}){var u;if(s!=null&&s.error||f==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!f.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let g=((u=f.keyAgreement)==null?void 0:u.map(y=>typeof y=="string"?[...f.publicKey||[],...f.verificationMethod||[]].find(E=>E.id===y):y).filter(y=>typeof y<"u")).filter(y=>y.type==="X25519KeyAgreementKey2019"&&Boolean(y.publicKeyBase58));if(!g.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return g.map(y=>BP(Q1(y.publicKeyBase58),y.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 Ew(r){let e=new X1.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Z1.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(Ew,"xc20pEncrypter");function LP(r){let e=o(function(s,f={},u){try{let d=V1(JSON.stringify(Object.assign({alg:i},f,{enc:n}))),g=new Uint8Array(Buffer.from(u?`${d}.${xi(u)}`:d));return Promise.resolve({...t(s,g),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),t=Ew(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(LP,"xc20pDirEncrypter");function sw(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(f){return Promise.reject(f)}},"decrypt"),t=new X1.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(sw,"xc20pDirDecrypter");function BP(r,e){let t=o(function(u,d={},g){try{Object.assign(d,{alg:void 0});let y=(0,Z1.randomBytes)(32);return Promise.resolve(LP(y).encrypt(u,d,g)).then(function(E){return Promise.resolve(n(y)).then(function(O){return{...E,recipient:O,cek:y}})})}catch(y){return Promise.reject(y)}},"encrypt"),n=o(function(u){try{let d=(0,Hu.generateKeyPair)(),g=(0,Hu.sharedKey)(d.secretKey,r),y=dw(g,s,i),E=Ew(y)(u),O={encrypted_key:xi(E.ciphertext),header:{alg:i,iv:xi(E.iv),tag:xi(E.tag),epk:{kty:"OKP",crv:f,x:xi(d.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(d){return Promise.reject(d)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,f="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(BP,"x25519Encrypter");function UP(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(UP,"validateHeader");function Aw(r){let e=o(function(s,f,u,d){try{let E=function(){let N=dw(R,n,t),X=lw(d.encrypted_key,d.header.tag);return Promise.resolve(sw(N).decrypt(X,En(d.header.iv))).then(function(L){return L===null?null:sw(L).decrypt(s,f,u)})};o(E,"_temp4");var g,y;if(UP((g=d)==null?void 0:g.header),d=d,((y=d.header.epk)==null?void 0:y.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=En(d.header.epk.x),R,I=function(){if(r instanceof Uint8Array)R=(0,Hu.sharedKey)(r,O);else return Promise.resolve(r(O)).then(function(N){R=N})}();return Promise.resolve(I&&I.then?I.then(E):E(I))}catch(E){return Promise.reject(E)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(Aw,"x25519Decrypter");Vm();var Md=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),rb=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,f]of n.entries()){let u=[...i,s],d=Je.asCID(f);d?yield[u.join("/"),d]:typeof f=="object"&&(yield*rb(f,u))}else{let s=Je.asCID(n);s?yield[i.join("/"),s]:yield*rb(n,i)}}},"links"),nb=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"&&!Je.asCID(n))if(Array.isArray(n))for(let[s,f]of n.entries()){let u=[...i,s];yield u.join("/"),typeof f=="object"&&!Je.asCID(f)&&(yield*nb(f,u))}else yield*nb(n,i)}},"tree"),FP=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(f=>`[${JSON.stringify(f)}]`).join("")}`);let s=Je.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),zu=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:Md(),bytes:Md(),value:Md(),asBlock:Md()})}links(){return rb(this.value,[])}tree(){return nb(this.value,[])}get(e="/"){return FP(this.value,e.split("/").filter(Boolean))}};o(zu,"Block");var Va=o(async({value:r,codec:e,hasher:t})=>{if(typeof r>"u")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.encode(r),i=await t.digest(n),s=Je.create(1,e.code,i);return new zu({value:r,bytes:n,cid:s})},"encode"),Sw=o(async({bytes:r,codec:e,hasher:t})=>{if(!r)throw new Error('Missing required argument "bytes"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.decode(r),i=await t.digest(r),s=Je.create(1,e.code,i);return new zu({value:n,bytes:r,cid:s})},"decode");$i();Su();Gm();Lh();var Vi={};Yt(Vi,{code:()=>vc,decode:()=>pb,encode:()=>Ya,name:()=>wL});var $P=["string","number","bigint","symbol"],qP=["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 Mw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if($P.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(HP(r))return"Buffer";let t=zP(r);return t||"Object"}o(Mw,"is");function HP(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(HP,"isBuffer");function zP(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(qP.includes(e))return e}o(zP,"getObjectType");var _e=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(_e,"Type");_e.uint=new _e(0,"uint",!0);_e.negint=new _e(1,"negint",!0);_e.bytes=new _e(2,"bytes",!0);_e.string=new _e(3,"string",!0);_e.array=new _e(4,"array",!1);_e.map=new _e(5,"map",!1);_e.tag=new _e(6,"tag",!1);_e.float=new _e(7,"float",!0);_e.false=new _e(7,"false",!0);_e.true=new _e(7,"true",!0);_e.null=new _e(7,"null",!0);_e.undefined=new _e(7,"undefined",!0);_e.break=new _e(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 hc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",KP=new TextDecoder,jP=new TextEncoder;function Td(r){return hc&&globalThis.Buffer.isBuffer(r)}o(Td,"isBuffer");function ob(r){return r instanceof Uint8Array?Td(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(ob,"asU8A");var Iw=hc?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):Cw(r,e,t):(r,e,t)=>t-e>64?KP.decode(r.subarray(e,t)):Cw(r,e,t),Dw=hc?r=>r.length>64?globalThis.Buffer.from(r):Tw(r):r=>r.length>64?jP.encode(r):Tw(r),vo=o(r=>Uint8Array.from(r),"fromArray"),dc=hc?(r,e,t)=>Td(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Rw=hc?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),ob(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},Ow=hc?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Nw(r,e){if(Td(r)&&Td(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(Nw,"compare");function Tw(r,e=1/0){let t,n=r.length,i=null,s=[];for(let f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(Tw,"utf8ToBytes");function Cw(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,f=i>239?4:i>223?3:i>191?2:1;if(e+f<=t){let u,d,g,y;switch(f){case 1:i<128&&(s=i);break;case 2:u=r[e+1],(u&192)===128&&(y=(i&31)<<6|u&63,y>127&&(s=y));break;case 3:u=r[e+1],d=r[e+2],(u&192)===128&&(d&192)===128&&(y=(i&15)<<12|(u&63)<<6|d&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:u=r[e+1],d=r[e+2],g=r[e+3],(u&192)===128&&(d&192)===128&&(g&192)===128&&(y=(i&15)<<18|(u&63)<<12|(d&63)<<6|g&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=f}return GP(n)}o(Cw,"utf8Slice");var kw=4096;function GP(r){let e=r.length;if(e<=kw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=kw));return t}o(GP,"decodeCodePointsArray");var VP=256,pc=class{constructor(e=VP){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=Ow(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=dc(n,0,this.cursor)}else t=Rw(this.chunks,this.cursor);return e&&this.reset(),t}};o(pc,"Bl");var bt="CBOR decode error:",sb="CBOR encode error:",Ku=[];Ku[23]=1;Ku[24]=2;Ku[25]=3;Ku[26]=5;Ku[27]=9;function os(r,e,t){if(r.length-e<t)throw new Error(`${bt} not enough data for type`)}o(os,"assertEnoughData");var Dr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function qn(r,e,t){os(r,e,1);let n=r[e];if(t.strict===!0&&n<Dr[0])throw new Error(`${bt} integer encoded in more bytes than necessary (strict decode)`);return n}o(qn,"readUint8");function Hn(r,e,t){os(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Dr[1])throw new Error(`${bt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Hn,"readUint16");function zn(r,e,t){os(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Dr[2])throw new Error(`${bt} integer encoded in more bytes than necessary (strict decode)`);return n}o(zn,"readUint32");function Kn(r,e,t){os(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<Dr[3])throw new Error(`${bt} 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(`${bt} integers outside of the safe integer range are not supported`)}o(Kn,"readUint64");function Pw(r,e,t,n){return new $e(_e.uint,qn(r,e+1,n),2)}o(Pw,"decodeUint8");function Lw(r,e,t,n){return new $e(_e.uint,Hn(r,e+1,n),3)}o(Lw,"decodeUint16");function Bw(r,e,t,n){return new $e(_e.uint,zn(r,e+1,n),5)}o(Bw,"decodeUint32");function Uw(r,e,t,n){return new $e(_e.uint,Kn(r,e+1,n),9)}o(Uw,"decodeUint64");function wi(r,e){return Hr(r,0,e.value)}o(wi,"encodeUint");function Hr(r,e,t){if(t<Dr[0]){let n=Number(t);r.push([e|n])}else if(t<Dr[1]){let n=Number(t);r.push([e|24,n])}else if(t<Dr[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Dr[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<Dr[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),f=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]=f&255,f=f>>8,i[3]=f&255,f=f>>8,i[2]=f&255,f=f>>8,i[1]=f&255,r.push(i)}else throw new Error(`${bt} encountered BigInt larger than allowable range`)}}o(Hr,"encodeUintValue");wi.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");Hr.encodedSize=o(function(e){return e<Dr[0]?1:e<Dr[1]?2:e<Dr[2]?3:e<Dr[3]?5:9},"encodedSize");wi.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function Fw(r,e,t,n){return new $e(_e.negint,-1-qn(r,e+1,n),2)}o(Fw,"decodeNegint8");function $w(r,e,t,n){return new $e(_e.negint,-1-Hn(r,e+1,n),3)}o($w,"decodeNegint16");function qw(r,e,t,n){return new $e(_e.negint,-1-zn(r,e+1,n),5)}o(qw,"decodeNegint32");var ab=BigInt(-1),Hw=BigInt(1);function zw(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new $e(_e.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${bt} integers outside of the safe integer range are not supported`);return new $e(_e.negint,ab-BigInt(i),9)}o(zw,"decodeNegint64");function Cd(r,e){let t=e.value,n=typeof t=="bigint"?t*ab-Hw:t*-1-1;Hr(r,e.type.majorEncoded,n)}o(Cd,"encodeNegint");Cd.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*ab-Hw:t*-1-1;return n<Dr[0]?1:n<Dr[1]?2:n<Dr[2]?3:n<Dr[3]?5:9},"encodedSize");Cd.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function ju(r,e,t,n){os(r,e,t+n);let i=dc(r,e+t,e+t+n);return new $e(_e.bytes,i,t+n)}o(ju,"toToken");function Kw(r,e,t,n){return ju(r,e,1,t)}o(Kw,"decodeBytesCompact");function jw(r,e,t,n){return ju(r,e,2,qn(r,e+1,n))}o(jw,"decodeBytes8");function Gw(r,e,t,n){return ju(r,e,3,Hn(r,e+1,n))}o(Gw,"decodeBytes16");function Vw(r,e,t,n){return ju(r,e,5,zn(r,e+1,n))}o(Vw,"decodeBytes32");function Ww(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer bytes lengths not supported`);return ju(r,e,9,i)}o(Ww,"decodeBytes64");function kd(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===_e.string?Dw(r.value):r.value),r.encodedBytes}o(kd,"tokenBytes");function mc(r,e){let t=kd(e);Hr(r,e.type.majorEncoded,t.length),r.push(t)}o(mc,"encodeBytes");mc.encodedSize=o(function(e){let t=kd(e);return Hr.encodedSize(t.length)+t.length},"encodedSize");mc.compareTokens=o(function(e,t){return JP(kd(e),kd(t))},"compareTokens");function JP(r,e){return r.length<e.length?-1:r.length>e.length?1:Nw(r,e)}o(JP,"compareBytes");function Gu(r,e,t,n,i){let s=t+n;os(r,e,s);let f=new $e(_e.string,Iw(r,e+t,e+s),s);return i.retainStringBytes===!0&&(f.byteValue=dc(r,e+t,e+s)),f}o(Gu,"toToken");function Jw(r,e,t,n){return Gu(r,e,1,t,n)}o(Jw,"decodeStringCompact");function Yw(r,e,t,n){return Gu(r,e,2,qn(r,e+1,n),n)}o(Yw,"decodeString8");function Xw(r,e,t,n){return Gu(r,e,3,Hn(r,e+1,n),n)}o(Xw,"decodeString16");function Zw(r,e,t,n){return Gu(r,e,5,zn(r,e+1,n),n)}o(Zw,"decodeString32");function Qw(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer string lengths not supported`);return Gu(r,e,9,i,n)}o(Qw,"decodeString64");var e4=mc;function bc(r,e,t,n){return new $e(_e.array,n,t)}o(bc,"toToken");function t4(r,e,t,n){return bc(r,e,1,t)}o(t4,"decodeArrayCompact");function r4(r,e,t,n){return bc(r,e,2,qn(r,e+1,n))}o(r4,"decodeArray8");function n4(r,e,t,n){return bc(r,e,3,Hn(r,e+1,n))}o(n4,"decodeArray16");function i4(r,e,t,n){return bc(r,e,5,zn(r,e+1,n))}o(i4,"decodeArray32");function o4(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer array lengths not supported`);return bc(r,e,9,i)}o(o4,"decodeArray64");function s4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${bt} indefinite length items not allowed`);return bc(r,e,1,1/0)}o(s4,"decodeArrayIndefinite");function Id(r,e){Hr(r,_e.array.majorEncoded,e.value)}o(Id,"encodeArray");Id.compareTokens=wi.compareTokens;Id.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function gc(r,e,t,n){return new $e(_e.map,n,t)}o(gc,"toToken");function a4(r,e,t,n){return gc(r,e,1,t)}o(a4,"decodeMapCompact");function f4(r,e,t,n){return gc(r,e,2,qn(r,e+1,n))}o(f4,"decodeMap8");function c4(r,e,t,n){return gc(r,e,3,Hn(r,e+1,n))}o(c4,"decodeMap16");function u4(r,e,t,n){return gc(r,e,5,zn(r,e+1,n))}o(u4,"decodeMap32");function l4(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer map lengths not supported`);return gc(r,e,9,i)}o(l4,"decodeMap64");function h4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${bt} indefinite length items not allowed`);return gc(r,e,1,1/0)}o(h4,"decodeMapIndefinite");function Dd(r,e){Hr(r,_e.map.majorEncoded,e.value)}o(Dd,"encodeMap");Dd.compareTokens=wi.compareTokens;Dd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function d4(r,e,t,n){return new $e(_e.tag,t,1)}o(d4,"decodeTagCompact");function p4(r,e,t,n){return new $e(_e.tag,qn(r,e+1,n),2)}o(p4,"decodeTag8");function m4(r,e,t,n){return new $e(_e.tag,Hn(r,e+1,n),3)}o(m4,"decodeTag16");function b4(r,e,t,n){return new $e(_e.tag,zn(r,e+1,n),5)}o(b4,"decodeTag32");function g4(r,e,t,n){return new $e(_e.tag,Kn(r,e+1,n),9)}o(g4,"decodeTag64");function Rd(r,e){Hr(r,_e.tag.majorEncoded,e.value)}o(Rd,"encodeTag");Rd.compareTokens=wi.compareTokens;Rd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");var tL=20,rL=21,nL=22,iL=23;function v4(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${bt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new $e(_e.null,null,1):new $e(_e.undefined,void 0,1)}o(v4,"decodeUndefined");function y4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${bt} indefinite length items not allowed`);return new $e(_e.break,void 0,1)}o(y4,"decodeBreak");function fb(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${bt} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${bt} Infinity values are not supported`)}return new $e(_e.float,r,e)}o(fb,"createToken");function x4(r,e,t,n){return fb(cb(r,e+1),3,n)}o(x4,"decodeFloat16");function w4(r,e,t,n){return fb(ub(r,e+1),5,n)}o(w4,"decodeFloat32");function _4(r,e,t,n){return fb(M4(r,e+1),9,n)}o(_4,"decodeFloat64");function Od(r,e,t){let n=e.value;if(n===!1)r.push([_e.float.majorEncoded|tL]);else if(n===!0)r.push([_e.float.majorEncoded|rL]);else if(n===null)r.push([_e.float.majorEncoded|nL]);else if(n===void 0)r.push([_e.float.majorEncoded|iL]);else{let i,s=!1;(!t||t.float64!==!0)&&(A4(n),i=cb(ji,1),n===i||Number.isNaN(n)?(ji[0]=249,r.push(ji.slice(0,3)),s=!0):(S4(n),i=ub(ji,1),n===i&&(ji[0]=250,r.push(ji.slice(0,5)),s=!0))),s||(oL(n),i=M4(ji,1),ji[0]=251,r.push(ji.slice(0,9)))}}o(Od,"encodeFloat");Od.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){A4(n);let i=cb(ji,1);if(n===i||Number.isNaN(n))return 3;if(S4(n),i=ub(ji,1),n===i)return 5}return 9},"encodedSize");var E4=new ArrayBuffer(9),_i=new DataView(E4,1),ji=new Uint8Array(E4,0);function A4(r){if(r===1/0)_i.setUint16(0,31744,!1);else if(r===-1/0)_i.setUint16(0,64512,!1);else if(Number.isNaN(r))_i.setUint16(0,32256,!1);else{_i.setFloat32(0,r);let e=_i.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)_i.setUint16(0,31744,!1);else if(t===0)_i.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?_i.setUint16(0,0):i<-14?_i.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):_i.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(A4,"encodeFloat16");function cb(r,e){if(r.length-e<2)throw new Error(`${bt} 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*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(cb,"readFloat16");function S4(r){_i.setFloat32(0,r,!1)}o(S4,"encodeFloat32");function ub(r,e){if(r.length-e<4)throw new Error(`${bt} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(ub,"readFloat32");function oL(r){_i.setFloat64(0,r,!1)}o(oL,"encodeFloat64");function M4(r,e){if(r.length-e<8)throw new Error(`${bt} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(M4,"readFloat64");Od.compareTokens=wi.compareTokens;function $t(r,e,t){throw new Error(`${bt} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o($t,"invalidMinor");function Nd(r){return()=>{throw new Error(`${bt} ${r}`)}}o(Nd,"errorer");var Le=[];for(let r=0;r<=23;r++)Le[r]=$t;Le[24]=Pw;Le[25]=Lw;Le[26]=Bw;Le[27]=Uw;Le[28]=$t;Le[29]=$t;Le[30]=$t;Le[31]=$t;for(let r=32;r<=55;r++)Le[r]=$t;Le[56]=Fw;Le[57]=$w;Le[58]=qw;Le[59]=zw;Le[60]=$t;Le[61]=$t;Le[62]=$t;Le[63]=$t;for(let r=64;r<=87;r++)Le[r]=Kw;Le[88]=jw;Le[89]=Gw;Le[90]=Vw;Le[91]=Ww;Le[92]=$t;Le[93]=$t;Le[94]=$t;Le[95]=Nd("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)Le[r]=Jw;Le[120]=Yw;Le[121]=Xw;Le[122]=Zw;Le[123]=Qw;Le[124]=$t;Le[125]=$t;Le[126]=$t;Le[127]=Nd("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)Le[r]=t4;Le[152]=r4;Le[153]=n4;Le[154]=i4;Le[155]=o4;Le[156]=$t;Le[157]=$t;Le[158]=$t;Le[159]=s4;for(let r=160;r<=183;r++)Le[r]=a4;Le[184]=f4;Le[185]=c4;Le[186]=u4;Le[187]=l4;Le[188]=$t;Le[189]=$t;Le[190]=$t;Le[191]=h4;for(let r=192;r<=215;r++)Le[r]=d4;Le[216]=p4;Le[217]=m4;Le[218]=b4;Le[219]=g4;Le[220]=$t;Le[221]=$t;Le[222]=$t;Le[223]=$t;for(let r=224;r<=243;r++)Le[r]=Nd("simple values are not supported");Le[244]=$t;Le[245]=$t;Le[246]=$t;Le[247]=v4;Le[248]=Nd("simple values are not supported");Le[249]=x4;Le[250]=w4;Le[251]=_4;Le[252]=$t;Le[253]=$t;Le[254]=$t;Le[255]=y4;var Gi=[];for(let r=0;r<24;r++)Gi[r]=new $e(_e.uint,r,1);for(let r=-1;r>=-24;r--)Gi[31-r]=new $e(_e.negint,r,1);Gi[64]=new $e(_e.bytes,new Uint8Array(0),1);Gi[96]=new $e(_e.string,"",1);Gi[128]=new $e(_e.array,0,1);Gi[160]=new $e(_e.map,0,1);Gi[244]=new $e(_e.false,!1,1);Gi[245]=new $e(_e.true,!0,1);Gi[246]=new $e(_e.null,null,1);function T4(r){switch(r.type){case _e.false:return vo([244]);case _e.true:return vo([245]);case _e.null:return vo([246]);case _e.bytes:return r.value.length?void 0:vo([64]);case _e.string:return r.value===""?vo([96]):void 0;case _e.array:return r.value===0?vo([128]):void 0;case _e.map:return r.value===0?vo([160]):void 0;case _e.uint:return r.value<24?vo([Number(r.value)]):void 0;case _e.negint:if(r.value>=-24)return vo([31-Number(r.value)])}}o(T4,"quickEncodeToken");var aL={float64:!1,mapSorter:uL,quickEncodeToken:T4};function fL(){let r=[];return r[_e.uint.major]=wi,r[_e.negint.major]=Cd,r[_e.bytes.major]=mc,r[_e.string.major]=e4,r[_e.array.major]=Id,r[_e.map.major]=Dd,r[_e.tag.major]=Rd,r[_e.float.major]=Od,r}o(fL,"makeCborEncoders");var C4=fL(),lb=new pc,Ja=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(`${sb} object contains circular references`);return new Ja(t,e)}};o(Ja,"Ref");var Gs={null:new $e(_e.null,null),undefined:new $e(_e.undefined,void 0),true:new $e(_e.true,!0),false:new $e(_e.false,!1),emptyArray:new $e(_e.array,0),emptyMap:new $e(_e.map,0)},Vs={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new $e(_e.float,r):r>=0?new $e(_e.uint,r):new $e(_e.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new $e(_e.uint,r):new $e(_e.negint,r)},Uint8Array(r,e,t,n){return new $e(_e.bytes,r)},string(r,e,t,n){return new $e(_e.string,r)},boolean(r,e,t,n){return r?Gs.true:Gs.false},null(r,e,t,n){return Gs.null},undefined(r,e,t,n){return Gs.undefined},ArrayBuffer(r,e,t,n){return new $e(_e.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new $e(_e.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[Gs.emptyArray,new $e(_e.break)]:Gs.emptyArray;n=Ja.createCheck(n,r);let i=[],s=0;for(let f of r)i[s++]=Pd(f,t,n);return t.addBreakTokens?[new $e(_e.array,r.length),i,new $e(_e.break)]:[new $e(_e.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),f=i?r.size:s.length;if(!f)return t.addBreakTokens===!0?[Gs.emptyMap,new $e(_e.break)]:Gs.emptyMap;n=Ja.createCheck(n,r);let u=[],d=0;for(let g of s)u[d++]=[Pd(g,t,n),Pd(i?r.get(g):r[g],t,n)];return cL(u,t),t.addBreakTokens?[new $e(_e.map,f),u,new $e(_e.break)]:[new $e(_e.map,f),u]}};Vs.Map=Vs.Object;Vs.Buffer=Vs.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Vs[`${r}Array`]=Vs.DataView;function Pd(r,e={},t){let n=Mw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||Vs[n];if(typeof i=="function"){let f=i(r,n,e,t);if(f!=null)return f}let s=Vs[n];if(!s)throw new Error(`${sb} unsupported type: ${n}`);return s(r,n,e,t)}o(Pd,"objectToTokens");function cL(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(cL,"sortMapEntries");function uL(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=C4[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(uL,"mapSorter");function k4(r,e,t,n){if(Array.isArray(e))for(let i of e)k4(r,i,t,n);else t[e.type.major](r,e,n)}o(k4,"tokensToEncoded");function lL(r,e,t){let n=Pd(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 f=s.encodedSize(n,t),u=new pc(f);if(s(u,n,t),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return ob(u.chunks[0])}}return lb.reset(),k4(lb,n,e,t),lb.toBytes(!0)}o(lL,"encodeCustom");function hb(r,e){return e=Object.assign({},aL,e),lL(r,C4,e)}o(hb,"encode");var hL={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ld=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=Gi[e];if(t===void 0){let n=Le[e];if(!n)throw new Error(`${bt} 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(Ld,"Tokeniser");var Vu=Symbol.for("DONE"),Bd=Symbol.for("BREAK");function dL(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=Wu(e,t);if(s===Bd){if(r.value===1/0)break;throw new Error(`${bt} got unexpected break to lengthed array`)}if(s===Vu)throw new Error(`${bt} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(dL,"tokenToArray");function pL(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let f=0;f<r.value;f++){let u=Wu(e,t);if(u===Bd){if(r.value===1/0)break;throw new Error(`${bt} got unexpected break to lengthed map`)}if(u===Vu)throw new Error(`${bt} found map but not enough entries (got ${f} [no key], expected ${r.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${bt} non-string keys not supported (got ${typeof u})`);if(t.rejectDuplicateMapKeys===!0&&(n&&s.has(u)||!n&&u in i))throw new Error(`${bt} found repeat map key "${u}"`);let d=Wu(e,t);if(d===Vu)throw new Error(`${bt} found map but not enough entries (got ${f} [no value], expected ${r.value})`);n?s.set(u,d):i[u]=d}return n?s:i}o(pL,"tokenToMap");function Wu(r,e){if(r.done())return Vu;let t=r.next();if(t.type===_e.break)return Bd;if(t.type.terminal)return t.value;if(t.type===_e.array)return dL(t,r,e);if(t.type===_e.map)return pL(t,r,e);if(t.type===_e.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=Wu(r,e);return e.tags[t.value](n)}throw new Error(`${bt} tag not supported (${t.value})`)}throw new Error("unsupported")}o(Wu,"tokensToObject");function db(r,e){if(!(r instanceof Uint8Array))throw new Error(`${bt} data to decode must be a Uint8Array`);e=Object.assign({},hL,e);let t=e.tokenizer||new Ld(r,e),n=Wu(t,e);if(n===Vu)throw new Error(`${bt} did not find any content to decode`);if(n===Bd)throw new Error(`${bt} got unexpected break`);if(!t.done())throw new Error(`${bt} too many terminals, data makes no sense`);return n}o(db,"decode");$i();var I4=42;function bL(r){if(r.asCID!==r)return null;let e=Je.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new $e(_e.tag,I4),new $e(_e.bytes,t)]}o(bL,"cidEncoder");function gL(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(gL,"undefinedEncoder");function vL(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(vL,"numberEncoder");var yL={float64:!0,typeEncoders:{Object:bL,undefined:gL,number:vL}};function xL(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Je.decode(r.subarray(1))}o(xL,"cidDecoder");var D4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};D4.tags[I4]=xL;var wL="dag-cbor",vc=113,Ya=o(r=>hb(r,yL),"encode"),pb=o(r=>db(r,D4),"decode");var _L=24;async function R4(r){let e=await Va({value:r,codec:Vi,hasher:Ns});return{cid:e.cid,linkedBlock:e.bytes}}o(R4,"encodePayload");function EL(r,e=_L){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(EL,"pad");async function AL(r){return(await Va({value:r,codec:Vi,hasher:qh})).cid}o(AL,"encodeIdentityCID");function SL(r){if(r=Je.asCID(r),r.code!==vc)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==qh.code)throw new Error("CID must use identity multihash");return pb(r.multihash.digest)}o(SL,"decodeIdentityCID");async function O4(r,e){return EL((await AL(r)).bytes,e)}o(O4,"prepareCleartext");function N4(r){return SL(Je.decodeFirst(r)[0])}o(N4,"decodeCleartext");var P4=Symbol("abortable"),Ud=Symbol("aborted");function L4(r,e){if(e.aborted)return Promise.reject(Ud);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Ud)}),Promise.race([r,n])}o(L4,"abortable");var B4=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 Fd="utils_abort_request";var un;(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"})(un||(un={}));var U4={[un.PARSE_ERROR]:"Parse error",[un.INVALID_REQUEST]:"Invalid request",[un.METHOD_NOT_FOUND]:"Method not found",[un.INVALID_PARAMS]:"Invalid params",[un.INTERNAL_ERROR]:"Internal error"};function ML(r){return-32e3>=r&&r>=-32099}o(ML,"isServerError");function $d(r){return U4[r.toString()]??(ML(r)?"Server error":"Application error")}o($d,"getErrorMessage");var An=class extends Error{static fromObject(e){return new An(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,An.prototype),this.code=e,this.data=n,this.message=t??$d(e)}};o(An,"RPCError");function Ju(r){let e=U4[r];return o(function(n){return new An(r,e,n)},"createError")}o(Ju,"createErrorFactory");var TL=Ju(un.PARSE_ERROR),HV=Ju(un.INVALID_REQUEST),zV=Ju(un.METHOD_NOT_FOUND),KV=Ju(un.INVALID_PARAMS),jV=Ju(un.INTERNAL_ERROR);function CL(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(CL,"_checkPrivateRedeclaration");function kL(r,e){return e.get?e.get.call(r):e.value}o(kL,"_classApplyDescriptorGet");function IL(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(IL,"_classApplyDescriptorSet");function F4(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(F4,"_classExtractFieldDescriptor");function mb(r,e){var t=F4(r,e,"get");return kL(r,t)}o(mb,"_classPrivateFieldGet");function DL(r,e,t){CL(r,e),e.set(r,t)}o(DL,"_classPrivateFieldInit");function RL(r,e,t){var n=F4(r,e,"set");return IL(r,n,t),t}o(RL,"_classPrivateFieldSet");var Yu=new WeakMap,yc=class{get connection(){return mb(this,Yu)}createID(){return B4()}request(e,t=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Ud);let s=this.createID(),f=mb(this,Yu).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw An.fromObject(u.error);return u.result});return i==null?f:(i.addEventListener("abort",()=>{this.notify(Fd,{id:s})}),L4(f,i))}async notify(e,t=void 0){await mb(this,Yu).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){DL(this,Yu,{writable:!0,value:void 0}),RL(this,Yu,e)}};o(yc,"RPCClient");function $4(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:$d(e)}}}o($4,"createErrorResponse");function OL(r,e,t){console.warn("Unhandled handler error",e,t)}o(OL,"fallbackOnHandlerError");function NL(r,e){console.warn("Unhandled invalid message",e)}o(NL,"fallbackOnInvalidMessage");function PL(r,e){console.warn("Unhandled notification",e)}o(PL,"fallbackOnNotification");function q4(r,e={}){let t=e.onHandlerError??OL,n=e.onInvalidMessage??NL,i=e.onNotification??PL,s={};function f(u,d){if(d.method===Fd){let g=d.params?.id;g!=null&&s[g]?.abort()}else i(u,d)}return o(f,"handleNotification"),o(async function(d,g){let y=g.id;if(g.jsonrpc!=="2.0"||g.method==null)return y==null?(n(d,g),null):$4(y,un.INVALID_REQUEST);let E=r[g.method];if(E==null)return y==null?(f(d,g),null):$4(y,un.METHOD_NOT_FOUND);try{let O;if(y!=null&&E[P4]){let I=new AbortController;s[y]=I,O=E(d,g.params,{signal:I.signal})}else O=E(d,g.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return y==null||s[y]?.signal.aborted?null:{jsonrpc:"2.0",id:y,result:R}}catch(O){if(y==null||s[y]?.signal.aborted)return t(d,g,O),null;let R;if(O instanceof An)R=O.toObject();else{t(d,g,O);let I=O.code??-32e3;R={code:I,message:O.message||$d(I)}}return{jsonrpc:"2.0",id:y,error:R}}finally{y!=null&&delete s[y]}},"handleRequest")}o(q4,"createHandler");$i();var V5=Bt(G5(),1),Qr=Bt(tf(),1);var DB=`
655
+ `+String(n)));c2(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){f2(r,e,n)})}o(gq,"dispatchBatch");function f2(r,e,t){c2(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(f2,"failedDispatch");function c2(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(c2,"resolveCacheHits");function vq(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(vq,"getValidMaxBatchSize");function yq(r){var e=r&&r.batchScheduleFn;if(e===void 0)return mq;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(yq,"getValidBatchScheduleFn");function xq(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(xq,"getValidCacheKeyFn");function wq(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(wq,"getValidCacheMap");function _q(r){return r&&r.name?r.name:null}o(_q,"getValidName");function a9(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(a9,"isArrayLike");f9.exports=pq});var A9=Re((qre,E9)=>{"use strict";function $q(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 f=r.length,u=r.charAt(0),d=Math.log(f)/Math.log(256),g=Math.log(256)/Math.log(f);function y(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var I=0,P=0,X=0,B=R.length;X!==B&&R[X]===0;)X++,I++;for(var J=(B-X)*g+1>>>0,ee=new Uint8Array(J);X!==B;){for(var Y=R[X],ie=0,G=J-1;(Y!==0||ie<P)&&G!==-1;G--,ie++)Y+=256*ee[G]>>>0,ee[G]=Y%f>>>0,Y=Y/f>>>0;if(Y!==0)throw new Error("Non-zero carry");P=ie,X++}for(var $=J-P;$!==J&&ee[$]===0;)$++;for(var K=u.repeat(I);$<J;++$)K+=r.charAt(ee[$]);return K}o(y,"encode");function E(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var I=0;if(R[I]!==" "){for(var P=0,X=0;R[I]===u;)P++,I++;for(var B=(R.length-I)*d+1>>>0,J=new Uint8Array(B);R[I];){var ee=e[R.charCodeAt(I)];if(ee===255)return;for(var Y=0,ie=B-1;(ee!==0||Y<X)&&ie!==-1;ie--,Y++)ee+=f*J[ie]>>>0,J[ie]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");X=Y,I++}if(R[I]!==" "){for(var G=B-X;G!==B&&J[G]===0;)G++;for(var $=new Uint8Array(P+(B-G)),K=P;G!==B;)$[K++]=J[G++];return $}}}o(E,"decodeUnsafe");function O(R){var I=E(R);if(I)return I;throw new Error("Non-base"+f+" character")}return o(O,"decode"),{encode:y,decodeUnsafe:E,decode:O}}o($q,"base");E9.exports=$q});var rp=Re((Hre,S9)=>{"use strict";var qq=new TextDecoder,Hq=o(r=>qq.decode(r),"decodeText"),zq=new TextEncoder,Kq=o(r=>zq.encode(r),"encodeText");function jq(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(jq,"concat");S9.exports={decodeText:Hq,encodeText:Kq,concat:jq}});var T9=Re((zre,M9)=>{"use strict";var{encodeText:Gq}=rp(),np=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=Gq(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(np,"Base");M9.exports=np});var k9=Re((Kre,C9)=>{"use strict";var Vq=o((r,e,t)=>{let n={};for(let g=0;g<e.length;++g)n[e[g]]=g;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),f=0,u=0,d=0;for(let g=0;g<i;++g){let y=n[r[g]];if(y===void 0)throw new SyntaxError("Invalid character "+r[g]);u=u<<t|y,f+=t,f>=8&&(f-=8,s[d++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return s},"decode"),Wq=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Jq=o(r=>e=>({encode(t){return Wq(t,e,r)},decode(t){return Vq(t,e,r)}}),"rfc4648");C9.exports={rfc4648:Jq}});var O9=Re((jre,R9)=>{"use strict";var Rl=A9(),Yq=T9(),{rfc4648:Gr}=k9(),{decodeText:Xq,encodeText:Zq}=rp(),Qq=o(()=>({encode:Xq,decode:Zq}),"identity"),I9=[["identity","\0",Qq,""],["base2","0",Gr(1),"01"],["base8","7",Gr(3),"01234567"],["base10","9",Rl,"0123456789"],["base16","f",Gr(4),"0123456789abcdef"],["base16upper","F",Gr(4),"0123456789ABCDEF"],["base32hex","v",Gr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",Gr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",Gr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",Gr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",Gr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Rl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Rl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Rl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Rl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],D9=I9.reduce((r,e)=>(r[e[0]]=new Yq(e[0],e[1],e[2],e[3]),r),{}),eH=I9.reduce((r,e)=>(r[e[1]]=D9[e[0]],r),{});R9.exports={names:D9,codes:eH}});var L9=Re((gs,P9)=>{"use strict";var Xc=O9(),{encodeText:tH,decodeText:ip,concat:N9}=rp();function rH(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=yf(r);return sH(t,e),N9([n,e],n.length+e.length)}o(rH,"multibase");function nH(r,e){let t=yf(r),n=tH(t.encode(e));return N9([t.codeBuf,n],t.codeBuf.length+n.length)}o(nH,"encode");function iH(r){r instanceof Uint8Array&&(r=ip(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),yf(r[0]).decode(r.substring(1))}o(iH,"decode");function oH(r){if(r instanceof Uint8Array&&(r=ip(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return yf(r[0]).name}catch{return!1}}o(oH,"isEncoded");function sH(r,e){yf(r).decode(ip(e))}o(sH,"validEncode");function yf(r){if(Object.prototype.hasOwnProperty.call(Xc.names,r))return Xc.names[r];if(Object.prototype.hasOwnProperty.call(Xc.codes,r))return Xc.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(yf,"encoding");function aH(r){return r instanceof Uint8Array&&(r=ip(r)),yf(r[0])}o(aH,"encodingFromData");gs=P9.exports=rH;gs.encode=nH;gs.decode=iH;gs.isEncoded=oH;gs.encoding=yf;gs.encodingFromData=aH;var fH=Object.freeze(Xc.names),cH=Object.freeze(Xc.codes);gs.names=fH;gs.codes=cH});var $9=Re((Gre,F9)=>{F9.exports=U9;var B9=128,uH=127,lH=~uH,hH=Math.pow(2,31);function U9(r,e,t){e=e||[],t=t||0;for(var n=t;r>=hH;)e[t++]=r&255|B9,r/=128;for(;r&lH;)e[t++]=r&255|B9,r>>>=7;return e[t]=r|0,U9.bytes=t-n+1,e}o(U9,"encode")});var z9=Re((Vre,H9)=>{H9.exports=y2;var dH=128,q9=127;function y2(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw y2.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&q9)<<i:(f&q9)*Math.pow(2,i),i+=7}while(f>=dH);return y2.bytes=s-n,t}o(y2,"read")});var j9=Re((Wre,K9)=>{var pH=Math.pow(2,7),mH=Math.pow(2,14),bH=Math.pow(2,21),gH=Math.pow(2,28),vH=Math.pow(2,35),yH=Math.pow(2,42),xH=Math.pow(2,49),wH=Math.pow(2,56),_H=Math.pow(2,63);K9.exports=function(r){return r<pH?1:r<mH?2:r<bH?3:r<gH?4:r<vH?5:r<yH?6:r<xH?7:r<wH?8:r<_H?9:10}});var V9=Re((Jre,G9)=>{G9.exports={encode:$9(),decode:z9(),encodingLength:j9()}});var J9=Re((Yre,W9)=>{"use strict";var EH=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});W9.exports={names:EH}});var r7=Re((Xre,t7)=>{"use strict";var Y9=L9(),Zc=V9(),{names:Ol}=J9(),{toString:op}=(Yf(),Ch(C3)),{fromString:AH}=(jh(),Ch(T3)),{concat:SH}=(Cm(),Ch(Zy)),Qc={};for(let r in Ol){let e=r;Qc[Ol[e]]=e}Object.freeze(Qc);function MH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return op(r,"base16")}o(MH,"toHexString");function TH(r){return AH(r,"base16")}o(TH,"fromHexString");function CH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return op(Y9.encode("base58btc",r)).slice(1)}o(CH,"toB58String");function kH(r){let e=r instanceof Uint8Array?op(r):r;return Y9.decode("z"+e)}o(kH,"fromB58String");function X9(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=Zc.decode(r);if(!Q9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Zc.decode.bytes);let t=Zc.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Zc.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${op(r,"base16")}`);return{code:e,name:Qc[e],length:t,digest:r}}o(X9,"decode");function IH(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=Z9(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=Zc.encode(n),s=Zc.encode(t);return SH([i,s,r],i.length+s.length+r.length)}o(IH,"encode");function Z9(r){let e=r;if(typeof r=="string"){if(Ol[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=Ol[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Qc[e]===void 0&&!x2(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(Z9,"coerceCode");function x2(r){return r>0&&r<16}o(x2,"isAppCode");function Q9(r){return!!(x2(r)||Qc[r])}o(Q9,"isValidCode");function e7(r){X9(r)}o(e7,"validate");function DH(r){return e7(r),r.subarray(0,2)}o(DH,"prefix");t7.exports={names:Ol,codes:Qc,toHexString:MH,fromHexString:TH,toB58String:CH,fromB58String:kH,decode:X9,encode:IH,coerceCode:Z9,isAppCode:x2,validate:e7,prefix:DH,isValidCode:Q9}});var _K={};Yt(_K,{CeramicURIValidator:()=>C2,default:()=>wK,getCeramicPlugin:()=>gp,streamIdToCeramicURI:()=>bp});module.exports=Ch(_K);var C7=Bt(Jy());function NI(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(NI,"_catch");function PI(){let r=new Map;return function(e,t){try{let i=function(f){if(n)return f;let u=r.get(e.didUrl);return u!==void 0?u:Promise.resolve(t()).then(function(d){var g;return((g=d.didResolutionMetadata)==null?void 0:g.error)!=="notFound"&&r.set(e.didUrl,d),d})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(f){return n=1,f})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(PI,"inMemoryCache");function LI(r,e){return e()}o(LI,"noCache");var BI="(?:%[0-9a-fA-F]{2})",Yy=`(?:[a-zA-Z0-9._-]|${BI})`,UI="([a-z0-9]+)",FI=`((?:${Yy}*:)*(${Yy}+))`,Xy="[a-zA-Z0-9_.:%-]",$I=`;${Xy}+=${Xy}*`,qI=`((${$I})*)`,HI="(/[^#?]*)?",zI="([?][^#]*)?",KI="(#.*)?",jI=new RegExp(`^did:${UI}:${FI}${qI}${HI}${zI}${KI}$`);function GI(r){if(r===""||!r)return null;let e=r.match(jI);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(GI,"parse");var kh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function VI(r){return function(e,t,n){try{return Promise.resolve(NI(function(){return Promise.resolve(r(e,t,n)).then(function(i){return{...kh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...kh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(VI,"wrapLegacyResolver");var yu=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?PI():t.cache||LI,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=VI(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=GI(e);if(i===null)return Promise.resolve({...kh,didResolutionMetadata:{error:"invalidDid"}});let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve({...kh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(yu,"Resolver");Cm();jh();Yf();Ih();xu();Wm();var J1=Bt(L3()),aw=Bt(n1()),Y1=Bt(u6()),Sd=Bt(vd()),fw=Bt(P6()),Hu=Bt(F6()),X1=Bt(Q6()),Z1=Bt(qa());function xi(r){return It(r,"base64url")}o(xi,"bytesToBase64url");function En(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Ut(e,"base64url")}o(En,"base64ToBytes");function Q1(r){return Ut(r,"base58btc")}o(Q1,"base58ToBytes");function G1(r){let e=r.startsWith("0x")?r.substring(2):r;return Ut(e.toLowerCase(),"base16")}o(G1,"hexToBytes");function V1(r){return xi(Ut(r))}o(V1,"encodeBase64url");function cw(r){return It(En(r))}o(cw,"decodeBase64url");function ja(r){return It(r,"base16")}o(ja,"bytesToHex");function uw(r){return Ut(r)}o(uw,"stringToBytes");function gP({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Ut(r,"base16"),0),i.set(Ut(e,"base16"),32),n){if(typeof t>"u")throw new Error("Signer did not return a recoveryParam");i[64]=t}return xi(i)}o(gP,"toJose");function vP(r){let e=En(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=ja(e.slice(0,32)),n=ja(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(vP,"fromJose");function lw(r,e){return Bi([En(r),En(e)])}o(lw,"toSealed");var yP=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,xP=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,wP=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function _P(r){if(typeof r=="string"){if(yP.test(r))return G1(r);if(xP.test(r))return Q1(r);if(wP.test(r))return En(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(_P,"parseKey");function hw(r){let e=typeof r=="string"?Ut(r):r;return(0,J1.hash)(e)}o(hw,"sha256");function EP(r){return new Uint8Array(aw.keccak_256.arrayBuffer(r))}o(EP,"keccak");function AP(r){let e=Ut(r.slice(2),"base16");return`0x${It(EP(e).slice(-20),"base16")}`}o(AP,"toEthereumAddress");function W1(r,e=new Uint8Array(4)){let t=Ut(r.toString(),"base10");return e.set(t,4-t.length),e}o(W1,"writeUint32BE");var j1=o(r=>Bi([W1(r.length),r]),"lengthAndInput");function dw(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=Bi([j1(Ut(t)),j1(typeof n>"u"?new Uint8Array(0):n),j1(typeof i>"u"?new Uint8Array(0):i),W1(e)]);return(0,J1.hash)(Bi([W1(1),r,s]))}o(dw,"concatKDF");var IG=new Y1.ec("secp256k1");function pw(r){let e=_P(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"?uw(t):t,i=(0,Sd.sign)(e,n);return Promise.resolve(xi(i))}catch(n){return Promise.reject(n)}}}o(pw,"EdDSASigner");function mw(r){return typeof r=="object"&&"r"in r&&"s"in r}o(mw,"instanceOfEcdsaSignature");function ew(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(mw(i))return gP(i,r);if(r&&typeof vP(i).recoveryParam>"u")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(ew,"ES256KSignerAlg");function tw(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(mw(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(tw,"Ed25519SignerAlg");var SP={ES256K:ew(),"ES256K-R":ew(!0),Ed25519:tw(),EdDSA:tw()};function MP(r){let e=SP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(MP,"SignerAlg");var eb=new Y1.ec("secp256k1");function Ad(r,e=!1){let t=En(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=ja(t.slice(0,32)),i=ja(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(Ad,"toSignatureObject");function tb(r){if(r.publicKeyBase58)return Q1(r.publicKeyBase58);if(r.publicKeyBase64)return En(r.publicKeyBase64);if(r.publicKeyHex)return G1(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return G1(eb.keyFromPublic({x:ja(En(r.publicKeyJwk.x)),y:ja(En(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Tu;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(tb,"extractPublicKeyBytes");function TP(r,e,t){let n=hw(r),i=Ad(e),s=t.filter(({ethereumAddress:d,blockchainAccountId:g})=>typeof d>"u"&&typeof g>"u"),f=t.filter(({ethereumAddress:d,blockchainAccountId:g})=>typeof d<"u"||typeof g!==void 0),u=s.find(d=>{try{let g=tb(d);return eb.keyFromPublic(g).verify(n,i)}catch{return!1}});if(!u&&f.length>0&&(u=bw(r,e,f)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(TP,"verifyES256K");function bw(r,e,t){let n;if(e.length>86)n=[Ad(e,!0)];else{let f=Ad(e,!1);n=[{...f,recoveryParam:0},{...f,recoveryParam:1}]}let i=o(f=>{let u=hw(r),d=eb.recoverPubKey(u,f,f.recoveryParam),g=d.encode("hex"),y=d.encode("hex",!0),E=AP(g);return t.find(R=>{var I,P,X;let B=ja(tb(R));return B===g||B===y||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===E||((P=R.blockchainAccountId)==null||(X=P.split("@eip155"))==null?void 0:X[0].toLowerCase())===E})},"checkSignatureAgainstSigner"),s=n.map(i).filter(f=>typeof f<"u");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(bw,"verifyRecoverableES256K");function rw(r,e,t){let n=uw(r),i=En(e),s=t.find(f=>(0,Sd.verify)(tb(f),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(rw,"verifyEd25519");var CP={ES256K:TP,"ES256K-R":bw,Ed25519:rw,EdDSA:rw};function gw(r){let e=CP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(gw,"VerifierAlgorithm");gw.toSignatureObject=Ad;var vw=o(function(r,e,t={},n={}){try{t.alg||(t.alg=kP);let i=typeof r=="string"?r:nw(r,n.canonicalize),s=[nw(t,n.canonicalize),i].join("."),f=MP(t.alg);return Promise.resolve(f(s,e)).then(function(u){return[s,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var kP="ES256K";function nw(r,e=!1){return V1(e?(0,fw.default)(r):JSON.stringify(r))}o(nw,"encodeSection");function IP(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(cw(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(IP,"decodeJWS");function DP({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),gw(r.alg)(e,t,n)}o(DP,"verifyJWSDecoded");function yw(r,e){let t=IP(r);return DP(t,e)}o(yw,"verifyJWS");function RP(r,e,t){for(var n;;){var i=r();if(js(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(js(s))s=s.s;else{n=1;break}if(e){var f=e();if(f&&f.then&&!js(f)){n=2;break}}}var u=new Ga,d=Ar.bind(null,u,2);return(n===0?i.then(y):n===1?s.then(g):f.then(E)).then(void 0,d),u;function g(O){s=O;do{if(e&&(f=e(),f&&f.then&&!js(f))){f.then(E).then(void 0,d);return}if(i=r(),!i||js(i)&&!i.v){Ar(u,1,s);return}if(i.then){i.then(y).then(void 0,d);return}s=t(),js(s)&&(s=s.v)}while(!s||!s.then);s.then(g).then(void 0,d)}o(g,"_resumeAfterBody");function y(O){O?(s=t(),s&&s.then?s.then(g).then(void 0,d):g(s)):Ar(u,1,s)}o(y,"_resumeAfterTest");function E(){(i=r())?i.then?i.then(y).then(void 0,d):y(i):Ar(u,1,s)}o(E,"_resumeAfterUpdate")}o(RP,"_for");var xw=o(function(r,e){try{let n=function(g){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let t;PP(r);let i=JSON.parse(cw(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=lw(r.ciphertext,r.tag),f=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),u=null,d=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,En(r.iv),f)).then(function(g){u=g}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let g=0;return RP(function(){return!u&&g<r.recipients.length},function(){return g++},function(){let y=r.recipients[g];Object.assign(y.header,i);let E=function(){if(y.header.alg===e.alg)return Promise.resolve(e.decrypt(s,En(r.iv),f,y)).then(function(O){u=O})}();if(E&&E.then)return E.then(function(){})})}}()}();return Promise.resolve(d&&d.then?d.then(n):n(d))}catch(t){return Promise.reject(t)}},"decryptJWE"),iw=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Ar(r,e,t){if(!r.s){if(t instanceof Ga)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=Ar.bind(null,r,e);return}if(t&&t.then){t.then(Ar.bind(null,r,e),Ar.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(Ar,"_settle");var Ga=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{Ar(n,1,s(this.v))}catch(f){Ar(n,2,f)}return n}else return this}return this.o=function(s){try{let f=s.v;s.s&1?Ar(n,1,e?e(f):f):t?Ar(n,1,t(f)):Ar(n,2,f)}catch(f){Ar(n,2,f)}},n},r}();function js(r){return r instanceof Ga&&r.s&1}o(js,"_isSettledPact");function OP(r,e,t){var n=-1,i,s;function f(u){try{for(;++n<r.length&&(!t||!t());)if(u=e(n),u&&u.then)if(js(u))u=u.v;else{u.then(f,s||(s=Ar.bind(null,i=new Ga,2)));return}i?Ar(i,1,u):i=u}catch(d){Ar(i||(i=new Ga),2,d)}}return o(f,"_cycle"),f(),i}o(OP,"_forTo");function NP(r,e,t){if(typeof r[iw]=="function"){let y=function(E){try{for(;!(i=n.next()).done&&(!t||!t());)if(E=e(i.value),E&&E.then)if(js(E))E=E.v;else{E.then(y,f||(f=Ar.bind(null,s=new Ga,2)));return}s?Ar(s,1,E):s=E}catch(O){Ar(s||(s=new Ga),2,O)}};o(y,"_cycle");var n=r[iw](),i,s,f;if(y(),n.return){var u=o(function(E){try{i.done||n.return()}catch{}return E},"_fixup");if(s&&s.then)return s.then(u,function(E){throw u(E)});u()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var d=[],g=0;g<r.length;g++)d.push(r[g]);return OP(d,function(y){return e(d[y])},t)}o(NP,"_forOf");function PP(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(PP,"validateJWE");function ow({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let f={protected:n,iv:xi(t),ciphertext:xi(r),tag:xi(e)};return s&&(f.aad=xi(s)),i&&(f.recipients=[i]),f}o(ow,"encodeJWE");var ww=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 ow(i,n)})}else{let i=e[0].enc;if(!e.reduce((d,g)=>d&&g.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,f,u=NP(e,function(d){let g=function(){return s?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(s)).then(function(y){if(y){var E,O;(E=f)==null||(O=E.recipients)==null||O.push(y)}}):Promise.resolve(d.encrypt(r,t,n)).then(function(y){s=y.cek,f=ow(y,n)})}();if(g&&g.then)return g.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return f}):f)}}catch(i){return Promise.reject(i)}},"createJWE");var _w=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:f}){var u;if(s!=null&&s.error||f==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!f.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let g=((u=f.keyAgreement)==null?void 0:u.map(y=>typeof y=="string"?[...f.publicKey||[],...f.verificationMethod||[]].find(E=>E.id===y):y).filter(y=>typeof y<"u")).filter(y=>y.type==="X25519KeyAgreementKey2019"&&Boolean(y.publicKeyBase58));if(!g.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return g.map(y=>BP(Q1(y.publicKeyBase58),y.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 Ew(r){let e=new X1.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Z1.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(Ew,"xc20pEncrypter");function LP(r){let e=o(function(s,f={},u){try{let d=V1(JSON.stringify(Object.assign({alg:i},f,{enc:n}))),g=new Uint8Array(Buffer.from(u?`${d}.${xi(u)}`:d));return Promise.resolve({...t(s,g),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),t=Ew(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(LP,"xc20pDirEncrypter");function sw(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(f){return Promise.reject(f)}},"decrypt"),t=new X1.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(sw,"xc20pDirDecrypter");function BP(r,e){let t=o(function(u,d={},g){try{Object.assign(d,{alg:void 0});let y=(0,Z1.randomBytes)(32);return Promise.resolve(LP(y).encrypt(u,d,g)).then(function(E){return Promise.resolve(n(y)).then(function(O){return{...E,recipient:O,cek:y}})})}catch(y){return Promise.reject(y)}},"encrypt"),n=o(function(u){try{let d=(0,Hu.generateKeyPair)(),g=(0,Hu.sharedKey)(d.secretKey,r),y=dw(g,s,i),E=Ew(y)(u),O={encrypted_key:xi(E.ciphertext),header:{alg:i,iv:xi(E.iv),tag:xi(E.tag),epk:{kty:"OKP",crv:f,x:xi(d.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(d){return Promise.reject(d)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,f="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(BP,"x25519Encrypter");function UP(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(UP,"validateHeader");function Aw(r){let e=o(function(s,f,u,d){try{let E=function(){let P=dw(R,n,t),X=lw(d.encrypted_key,d.header.tag);return Promise.resolve(sw(P).decrypt(X,En(d.header.iv))).then(function(B){return B===null?null:sw(B).decrypt(s,f,u)})};o(E,"_temp4");var g,y;if(UP((g=d)==null?void 0:g.header),d=d,((y=d.header.epk)==null?void 0:y.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=En(d.header.epk.x),R,I=function(){if(r instanceof Uint8Array)R=(0,Hu.sharedKey)(r,O);else return Promise.resolve(r(O)).then(function(P){R=P})}();return Promise.resolve(I&&I.then?I.then(E):E(I))}catch(E){return Promise.reject(E)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(Aw,"x25519Decrypter");Vm();var Md=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),rb=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,f]of n.entries()){let u=[...i,s],d=Je.asCID(f);d?yield[u.join("/"),d]:typeof f=="object"&&(yield*rb(f,u))}else{let s=Je.asCID(n);s?yield[i.join("/"),s]:yield*rb(n,i)}}},"links"),nb=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"&&!Je.asCID(n))if(Array.isArray(n))for(let[s,f]of n.entries()){let u=[...i,s];yield u.join("/"),typeof f=="object"&&!Je.asCID(f)&&(yield*nb(f,u))}else yield*nb(n,i)}},"tree"),FP=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(f=>`[${JSON.stringify(f)}]`).join("")}`);let s=Je.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),zu=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:Md(),bytes:Md(),value:Md(),asBlock:Md()})}links(){return rb(this.value,[])}tree(){return nb(this.value,[])}get(e="/"){return FP(this.value,e.split("/").filter(Boolean))}};o(zu,"Block");var Va=o(async({value:r,codec:e,hasher:t})=>{if(typeof r>"u")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.encode(r),i=await t.digest(n),s=Je.create(1,e.code,i);return new zu({value:r,bytes:n,cid:s})},"encode"),Sw=o(async({bytes:r,codec:e,hasher:t})=>{if(!r)throw new Error('Missing required argument "bytes"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.decode(r),i=await t.digest(r),s=Je.create(1,e.code,i);return new zu({value:n,bytes:r,cid:s})},"decode");$i();Su();Gm();Lh();var Vi={};Yt(Vi,{code:()=>vc,decode:()=>pb,encode:()=>Ya,name:()=>wL});var $P=["string","number","bigint","symbol"],qP=["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 Mw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if($P.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(HP(r))return"Buffer";let t=zP(r);return t||"Object"}o(Mw,"is");function HP(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(HP,"isBuffer");function zP(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(qP.includes(e))return e}o(zP,"getObjectType");var _e=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(_e,"Type");_e.uint=new _e(0,"uint",!0);_e.negint=new _e(1,"negint",!0);_e.bytes=new _e(2,"bytes",!0);_e.string=new _e(3,"string",!0);_e.array=new _e(4,"array",!1);_e.map=new _e(5,"map",!1);_e.tag=new _e(6,"tag",!1);_e.float=new _e(7,"float",!0);_e.false=new _e(7,"false",!0);_e.true=new _e(7,"true",!0);_e.null=new _e(7,"null",!0);_e.undefined=new _e(7,"undefined",!0);_e.break=new _e(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 hc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",KP=new TextDecoder,jP=new TextEncoder;function Td(r){return hc&&globalThis.Buffer.isBuffer(r)}o(Td,"isBuffer");function ob(r){return r instanceof Uint8Array?Td(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(ob,"asU8A");var Iw=hc?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):Cw(r,e,t):(r,e,t)=>t-e>64?KP.decode(r.subarray(e,t)):Cw(r,e,t),Dw=hc?r=>r.length>64?globalThis.Buffer.from(r):Tw(r):r=>r.length>64?jP.encode(r):Tw(r),vo=o(r=>Uint8Array.from(r),"fromArray"),dc=hc?(r,e,t)=>Td(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Rw=hc?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),ob(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},Ow=hc?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Nw(r,e){if(Td(r)&&Td(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(Nw,"compare");function Tw(r,e=1/0){let t,n=r.length,i=null,s=[];for(let f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(Tw,"utf8ToBytes");function Cw(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,f=i>239?4:i>223?3:i>191?2:1;if(e+f<=t){let u,d,g,y;switch(f){case 1:i<128&&(s=i);break;case 2:u=r[e+1],(u&192)===128&&(y=(i&31)<<6|u&63,y>127&&(s=y));break;case 3:u=r[e+1],d=r[e+2],(u&192)===128&&(d&192)===128&&(y=(i&15)<<12|(u&63)<<6|d&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:u=r[e+1],d=r[e+2],g=r[e+3],(u&192)===128&&(d&192)===128&&(g&192)===128&&(y=(i&15)<<18|(u&63)<<12|(d&63)<<6|g&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=f}return GP(n)}o(Cw,"utf8Slice");var kw=4096;function GP(r){let e=r.length;if(e<=kw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=kw));return t}o(GP,"decodeCodePointsArray");var VP=256,pc=class{constructor(e=VP){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=Ow(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=dc(n,0,this.cursor)}else t=Rw(this.chunks,this.cursor);return e&&this.reset(),t}};o(pc,"Bl");var bt="CBOR decode error:",sb="CBOR encode error:",Ku=[];Ku[23]=1;Ku[24]=2;Ku[25]=3;Ku[26]=5;Ku[27]=9;function os(r,e,t){if(r.length-e<t)throw new Error(`${bt} not enough data for type`)}o(os,"assertEnoughData");var Dr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function qn(r,e,t){os(r,e,1);let n=r[e];if(t.strict===!0&&n<Dr[0])throw new Error(`${bt} integer encoded in more bytes than necessary (strict decode)`);return n}o(qn,"readUint8");function Hn(r,e,t){os(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Dr[1])throw new Error(`${bt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Hn,"readUint16");function zn(r,e,t){os(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Dr[2])throw new Error(`${bt} integer encoded in more bytes than necessary (strict decode)`);return n}o(zn,"readUint32");function Kn(r,e,t){os(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<Dr[3])throw new Error(`${bt} 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(`${bt} integers outside of the safe integer range are not supported`)}o(Kn,"readUint64");function Pw(r,e,t,n){return new $e(_e.uint,qn(r,e+1,n),2)}o(Pw,"decodeUint8");function Lw(r,e,t,n){return new $e(_e.uint,Hn(r,e+1,n),3)}o(Lw,"decodeUint16");function Bw(r,e,t,n){return new $e(_e.uint,zn(r,e+1,n),5)}o(Bw,"decodeUint32");function Uw(r,e,t,n){return new $e(_e.uint,Kn(r,e+1,n),9)}o(Uw,"decodeUint64");function wi(r,e){return Hr(r,0,e.value)}o(wi,"encodeUint");function Hr(r,e,t){if(t<Dr[0]){let n=Number(t);r.push([e|n])}else if(t<Dr[1]){let n=Number(t);r.push([e|24,n])}else if(t<Dr[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Dr[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<Dr[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),f=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]=f&255,f=f>>8,i[3]=f&255,f=f>>8,i[2]=f&255,f=f>>8,i[1]=f&255,r.push(i)}else throw new Error(`${bt} encountered BigInt larger than allowable range`)}}o(Hr,"encodeUintValue");wi.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");Hr.encodedSize=o(function(e){return e<Dr[0]?1:e<Dr[1]?2:e<Dr[2]?3:e<Dr[3]?5:9},"encodedSize");wi.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function Fw(r,e,t,n){return new $e(_e.negint,-1-qn(r,e+1,n),2)}o(Fw,"decodeNegint8");function $w(r,e,t,n){return new $e(_e.negint,-1-Hn(r,e+1,n),3)}o($w,"decodeNegint16");function qw(r,e,t,n){return new $e(_e.negint,-1-zn(r,e+1,n),5)}o(qw,"decodeNegint32");var ab=BigInt(-1),Hw=BigInt(1);function zw(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new $e(_e.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${bt} integers outside of the safe integer range are not supported`);return new $e(_e.negint,ab-BigInt(i),9)}o(zw,"decodeNegint64");function Cd(r,e){let t=e.value,n=typeof t=="bigint"?t*ab-Hw:t*-1-1;Hr(r,e.type.majorEncoded,n)}o(Cd,"encodeNegint");Cd.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*ab-Hw:t*-1-1;return n<Dr[0]?1:n<Dr[1]?2:n<Dr[2]?3:n<Dr[3]?5:9},"encodedSize");Cd.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function ju(r,e,t,n){os(r,e,t+n);let i=dc(r,e+t,e+t+n);return new $e(_e.bytes,i,t+n)}o(ju,"toToken");function Kw(r,e,t,n){return ju(r,e,1,t)}o(Kw,"decodeBytesCompact");function jw(r,e,t,n){return ju(r,e,2,qn(r,e+1,n))}o(jw,"decodeBytes8");function Gw(r,e,t,n){return ju(r,e,3,Hn(r,e+1,n))}o(Gw,"decodeBytes16");function Vw(r,e,t,n){return ju(r,e,5,zn(r,e+1,n))}o(Vw,"decodeBytes32");function Ww(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer bytes lengths not supported`);return ju(r,e,9,i)}o(Ww,"decodeBytes64");function kd(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===_e.string?Dw(r.value):r.value),r.encodedBytes}o(kd,"tokenBytes");function mc(r,e){let t=kd(e);Hr(r,e.type.majorEncoded,t.length),r.push(t)}o(mc,"encodeBytes");mc.encodedSize=o(function(e){let t=kd(e);return Hr.encodedSize(t.length)+t.length},"encodedSize");mc.compareTokens=o(function(e,t){return JP(kd(e),kd(t))},"compareTokens");function JP(r,e){return r.length<e.length?-1:r.length>e.length?1:Nw(r,e)}o(JP,"compareBytes");function Gu(r,e,t,n,i){let s=t+n;os(r,e,s);let f=new $e(_e.string,Iw(r,e+t,e+s),s);return i.retainStringBytes===!0&&(f.byteValue=dc(r,e+t,e+s)),f}o(Gu,"toToken");function Jw(r,e,t,n){return Gu(r,e,1,t,n)}o(Jw,"decodeStringCompact");function Yw(r,e,t,n){return Gu(r,e,2,qn(r,e+1,n),n)}o(Yw,"decodeString8");function Xw(r,e,t,n){return Gu(r,e,3,Hn(r,e+1,n),n)}o(Xw,"decodeString16");function Zw(r,e,t,n){return Gu(r,e,5,zn(r,e+1,n),n)}o(Zw,"decodeString32");function Qw(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer string lengths not supported`);return Gu(r,e,9,i,n)}o(Qw,"decodeString64");var e4=mc;function bc(r,e,t,n){return new $e(_e.array,n,t)}o(bc,"toToken");function t4(r,e,t,n){return bc(r,e,1,t)}o(t4,"decodeArrayCompact");function r4(r,e,t,n){return bc(r,e,2,qn(r,e+1,n))}o(r4,"decodeArray8");function n4(r,e,t,n){return bc(r,e,3,Hn(r,e+1,n))}o(n4,"decodeArray16");function i4(r,e,t,n){return bc(r,e,5,zn(r,e+1,n))}o(i4,"decodeArray32");function o4(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer array lengths not supported`);return bc(r,e,9,i)}o(o4,"decodeArray64");function s4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${bt} indefinite length items not allowed`);return bc(r,e,1,1/0)}o(s4,"decodeArrayIndefinite");function Id(r,e){Hr(r,_e.array.majorEncoded,e.value)}o(Id,"encodeArray");Id.compareTokens=wi.compareTokens;Id.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function gc(r,e,t,n){return new $e(_e.map,n,t)}o(gc,"toToken");function a4(r,e,t,n){return gc(r,e,1,t)}o(a4,"decodeMapCompact");function f4(r,e,t,n){return gc(r,e,2,qn(r,e+1,n))}o(f4,"decodeMap8");function c4(r,e,t,n){return gc(r,e,3,Hn(r,e+1,n))}o(c4,"decodeMap16");function u4(r,e,t,n){return gc(r,e,5,zn(r,e+1,n))}o(u4,"decodeMap32");function l4(r,e,t,n){let i=Kn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${bt} 64-bit integer map lengths not supported`);return gc(r,e,9,i)}o(l4,"decodeMap64");function h4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${bt} indefinite length items not allowed`);return gc(r,e,1,1/0)}o(h4,"decodeMapIndefinite");function Dd(r,e){Hr(r,_e.map.majorEncoded,e.value)}o(Dd,"encodeMap");Dd.compareTokens=wi.compareTokens;Dd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function d4(r,e,t,n){return new $e(_e.tag,t,1)}o(d4,"decodeTagCompact");function p4(r,e,t,n){return new $e(_e.tag,qn(r,e+1,n),2)}o(p4,"decodeTag8");function m4(r,e,t,n){return new $e(_e.tag,Hn(r,e+1,n),3)}o(m4,"decodeTag16");function b4(r,e,t,n){return new $e(_e.tag,zn(r,e+1,n),5)}o(b4,"decodeTag32");function g4(r,e,t,n){return new $e(_e.tag,Kn(r,e+1,n),9)}o(g4,"decodeTag64");function Rd(r,e){Hr(r,_e.tag.majorEncoded,e.value)}o(Rd,"encodeTag");Rd.compareTokens=wi.compareTokens;Rd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");var tL=20,rL=21,nL=22,iL=23;function v4(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${bt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new $e(_e.null,null,1):new $e(_e.undefined,void 0,1)}o(v4,"decodeUndefined");function y4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${bt} indefinite length items not allowed`);return new $e(_e.break,void 0,1)}o(y4,"decodeBreak");function fb(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${bt} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${bt} Infinity values are not supported`)}return new $e(_e.float,r,e)}o(fb,"createToken");function x4(r,e,t,n){return fb(cb(r,e+1),3,n)}o(x4,"decodeFloat16");function w4(r,e,t,n){return fb(ub(r,e+1),5,n)}o(w4,"decodeFloat32");function _4(r,e,t,n){return fb(M4(r,e+1),9,n)}o(_4,"decodeFloat64");function Od(r,e,t){let n=e.value;if(n===!1)r.push([_e.float.majorEncoded|tL]);else if(n===!0)r.push([_e.float.majorEncoded|rL]);else if(n===null)r.push([_e.float.majorEncoded|nL]);else if(n===void 0)r.push([_e.float.majorEncoded|iL]);else{let i,s=!1;(!t||t.float64!==!0)&&(A4(n),i=cb(ji,1),n===i||Number.isNaN(n)?(ji[0]=249,r.push(ji.slice(0,3)),s=!0):(S4(n),i=ub(ji,1),n===i&&(ji[0]=250,r.push(ji.slice(0,5)),s=!0))),s||(oL(n),i=M4(ji,1),ji[0]=251,r.push(ji.slice(0,9)))}}o(Od,"encodeFloat");Od.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){A4(n);let i=cb(ji,1);if(n===i||Number.isNaN(n))return 3;if(S4(n),i=ub(ji,1),n===i)return 5}return 9},"encodedSize");var E4=new ArrayBuffer(9),_i=new DataView(E4,1),ji=new Uint8Array(E4,0);function A4(r){if(r===1/0)_i.setUint16(0,31744,!1);else if(r===-1/0)_i.setUint16(0,64512,!1);else if(Number.isNaN(r))_i.setUint16(0,32256,!1);else{_i.setFloat32(0,r);let e=_i.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)_i.setUint16(0,31744,!1);else if(t===0)_i.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?_i.setUint16(0,0):i<-14?_i.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):_i.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(A4,"encodeFloat16");function cb(r,e){if(r.length-e<2)throw new Error(`${bt} 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*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(cb,"readFloat16");function S4(r){_i.setFloat32(0,r,!1)}o(S4,"encodeFloat32");function ub(r,e){if(r.length-e<4)throw new Error(`${bt} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(ub,"readFloat32");function oL(r){_i.setFloat64(0,r,!1)}o(oL,"encodeFloat64");function M4(r,e){if(r.length-e<8)throw new Error(`${bt} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(M4,"readFloat64");Od.compareTokens=wi.compareTokens;function $t(r,e,t){throw new Error(`${bt} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o($t,"invalidMinor");function Nd(r){return()=>{throw new Error(`${bt} ${r}`)}}o(Nd,"errorer");var Le=[];for(let r=0;r<=23;r++)Le[r]=$t;Le[24]=Pw;Le[25]=Lw;Le[26]=Bw;Le[27]=Uw;Le[28]=$t;Le[29]=$t;Le[30]=$t;Le[31]=$t;for(let r=32;r<=55;r++)Le[r]=$t;Le[56]=Fw;Le[57]=$w;Le[58]=qw;Le[59]=zw;Le[60]=$t;Le[61]=$t;Le[62]=$t;Le[63]=$t;for(let r=64;r<=87;r++)Le[r]=Kw;Le[88]=jw;Le[89]=Gw;Le[90]=Vw;Le[91]=Ww;Le[92]=$t;Le[93]=$t;Le[94]=$t;Le[95]=Nd("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)Le[r]=Jw;Le[120]=Yw;Le[121]=Xw;Le[122]=Zw;Le[123]=Qw;Le[124]=$t;Le[125]=$t;Le[126]=$t;Le[127]=Nd("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)Le[r]=t4;Le[152]=r4;Le[153]=n4;Le[154]=i4;Le[155]=o4;Le[156]=$t;Le[157]=$t;Le[158]=$t;Le[159]=s4;for(let r=160;r<=183;r++)Le[r]=a4;Le[184]=f4;Le[185]=c4;Le[186]=u4;Le[187]=l4;Le[188]=$t;Le[189]=$t;Le[190]=$t;Le[191]=h4;for(let r=192;r<=215;r++)Le[r]=d4;Le[216]=p4;Le[217]=m4;Le[218]=b4;Le[219]=g4;Le[220]=$t;Le[221]=$t;Le[222]=$t;Le[223]=$t;for(let r=224;r<=243;r++)Le[r]=Nd("simple values are not supported");Le[244]=$t;Le[245]=$t;Le[246]=$t;Le[247]=v4;Le[248]=Nd("simple values are not supported");Le[249]=x4;Le[250]=w4;Le[251]=_4;Le[252]=$t;Le[253]=$t;Le[254]=$t;Le[255]=y4;var Gi=[];for(let r=0;r<24;r++)Gi[r]=new $e(_e.uint,r,1);for(let r=-1;r>=-24;r--)Gi[31-r]=new $e(_e.negint,r,1);Gi[64]=new $e(_e.bytes,new Uint8Array(0),1);Gi[96]=new $e(_e.string,"",1);Gi[128]=new $e(_e.array,0,1);Gi[160]=new $e(_e.map,0,1);Gi[244]=new $e(_e.false,!1,1);Gi[245]=new $e(_e.true,!0,1);Gi[246]=new $e(_e.null,null,1);function T4(r){switch(r.type){case _e.false:return vo([244]);case _e.true:return vo([245]);case _e.null:return vo([246]);case _e.bytes:return r.value.length?void 0:vo([64]);case _e.string:return r.value===""?vo([96]):void 0;case _e.array:return r.value===0?vo([128]):void 0;case _e.map:return r.value===0?vo([160]):void 0;case _e.uint:return r.value<24?vo([Number(r.value)]):void 0;case _e.negint:if(r.value>=-24)return vo([31-Number(r.value)])}}o(T4,"quickEncodeToken");var aL={float64:!1,mapSorter:uL,quickEncodeToken:T4};function fL(){let r=[];return r[_e.uint.major]=wi,r[_e.negint.major]=Cd,r[_e.bytes.major]=mc,r[_e.string.major]=e4,r[_e.array.major]=Id,r[_e.map.major]=Dd,r[_e.tag.major]=Rd,r[_e.float.major]=Od,r}o(fL,"makeCborEncoders");var C4=fL(),lb=new pc,Ja=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(`${sb} object contains circular references`);return new Ja(t,e)}};o(Ja,"Ref");var Gs={null:new $e(_e.null,null),undefined:new $e(_e.undefined,void 0),true:new $e(_e.true,!0),false:new $e(_e.false,!1),emptyArray:new $e(_e.array,0),emptyMap:new $e(_e.map,0)},Vs={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new $e(_e.float,r):r>=0?new $e(_e.uint,r):new $e(_e.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new $e(_e.uint,r):new $e(_e.negint,r)},Uint8Array(r,e,t,n){return new $e(_e.bytes,r)},string(r,e,t,n){return new $e(_e.string,r)},boolean(r,e,t,n){return r?Gs.true:Gs.false},null(r,e,t,n){return Gs.null},undefined(r,e,t,n){return Gs.undefined},ArrayBuffer(r,e,t,n){return new $e(_e.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new $e(_e.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[Gs.emptyArray,new $e(_e.break)]:Gs.emptyArray;n=Ja.createCheck(n,r);let i=[],s=0;for(let f of r)i[s++]=Pd(f,t,n);return t.addBreakTokens?[new $e(_e.array,r.length),i,new $e(_e.break)]:[new $e(_e.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),f=i?r.size:s.length;if(!f)return t.addBreakTokens===!0?[Gs.emptyMap,new $e(_e.break)]:Gs.emptyMap;n=Ja.createCheck(n,r);let u=[],d=0;for(let g of s)u[d++]=[Pd(g,t,n),Pd(i?r.get(g):r[g],t,n)];return cL(u,t),t.addBreakTokens?[new $e(_e.map,f),u,new $e(_e.break)]:[new $e(_e.map,f),u]}};Vs.Map=Vs.Object;Vs.Buffer=Vs.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Vs[`${r}Array`]=Vs.DataView;function Pd(r,e={},t){let n=Mw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||Vs[n];if(typeof i=="function"){let f=i(r,n,e,t);if(f!=null)return f}let s=Vs[n];if(!s)throw new Error(`${sb} unsupported type: ${n}`);return s(r,n,e,t)}o(Pd,"objectToTokens");function cL(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(cL,"sortMapEntries");function uL(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=C4[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(uL,"mapSorter");function k4(r,e,t,n){if(Array.isArray(e))for(let i of e)k4(r,i,t,n);else t[e.type.major](r,e,n)}o(k4,"tokensToEncoded");function lL(r,e,t){let n=Pd(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 f=s.encodedSize(n,t),u=new pc(f);if(s(u,n,t),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return ob(u.chunks[0])}}return lb.reset(),k4(lb,n,e,t),lb.toBytes(!0)}o(lL,"encodeCustom");function hb(r,e){return e=Object.assign({},aL,e),lL(r,C4,e)}o(hb,"encode");var hL={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ld=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=Gi[e];if(t===void 0){let n=Le[e];if(!n)throw new Error(`${bt} 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(Ld,"Tokeniser");var Vu=Symbol.for("DONE"),Bd=Symbol.for("BREAK");function dL(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=Wu(e,t);if(s===Bd){if(r.value===1/0)break;throw new Error(`${bt} got unexpected break to lengthed array`)}if(s===Vu)throw new Error(`${bt} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(dL,"tokenToArray");function pL(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let f=0;f<r.value;f++){let u=Wu(e,t);if(u===Bd){if(r.value===1/0)break;throw new Error(`${bt} got unexpected break to lengthed map`)}if(u===Vu)throw new Error(`${bt} found map but not enough entries (got ${f} [no key], expected ${r.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${bt} non-string keys not supported (got ${typeof u})`);if(t.rejectDuplicateMapKeys===!0&&(n&&s.has(u)||!n&&u in i))throw new Error(`${bt} found repeat map key "${u}"`);let d=Wu(e,t);if(d===Vu)throw new Error(`${bt} found map but not enough entries (got ${f} [no value], expected ${r.value})`);n?s.set(u,d):i[u]=d}return n?s:i}o(pL,"tokenToMap");function Wu(r,e){if(r.done())return Vu;let t=r.next();if(t.type===_e.break)return Bd;if(t.type.terminal)return t.value;if(t.type===_e.array)return dL(t,r,e);if(t.type===_e.map)return pL(t,r,e);if(t.type===_e.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=Wu(r,e);return e.tags[t.value](n)}throw new Error(`${bt} tag not supported (${t.value})`)}throw new Error("unsupported")}o(Wu,"tokensToObject");function db(r,e){if(!(r instanceof Uint8Array))throw new Error(`${bt} data to decode must be a Uint8Array`);e=Object.assign({},hL,e);let t=e.tokenizer||new Ld(r,e),n=Wu(t,e);if(n===Vu)throw new Error(`${bt} did not find any content to decode`);if(n===Bd)throw new Error(`${bt} got unexpected break`);if(!t.done())throw new Error(`${bt} too many terminals, data makes no sense`);return n}o(db,"decode");$i();var I4=42;function bL(r){if(r.asCID!==r)return null;let e=Je.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new $e(_e.tag,I4),new $e(_e.bytes,t)]}o(bL,"cidEncoder");function gL(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(gL,"undefinedEncoder");function vL(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(vL,"numberEncoder");var yL={float64:!0,typeEncoders:{Object:bL,undefined:gL,number:vL}};function xL(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Je.decode(r.subarray(1))}o(xL,"cidDecoder");var D4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};D4.tags[I4]=xL;var wL="dag-cbor",vc=113,Ya=o(r=>hb(r,yL),"encode"),pb=o(r=>db(r,D4),"decode");var _L=24;async function R4(r){let e=await Va({value:r,codec:Vi,hasher:Ns});return{cid:e.cid,linkedBlock:e.bytes}}o(R4,"encodePayload");function EL(r,e=_L){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(EL,"pad");async function AL(r){return(await Va({value:r,codec:Vi,hasher:qh})).cid}o(AL,"encodeIdentityCID");function SL(r){if(r=Je.asCID(r),r.code!==vc)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==qh.code)throw new Error("CID must use identity multihash");return pb(r.multihash.digest)}o(SL,"decodeIdentityCID");async function O4(r,e){return EL((await AL(r)).bytes,e)}o(O4,"prepareCleartext");function N4(r){return SL(Je.decodeFirst(r)[0])}o(N4,"decodeCleartext");var P4=Symbol("abortable"),Ud=Symbol("aborted");function L4(r,e){if(e.aborted)return Promise.reject(Ud);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Ud)}),Promise.race([r,n])}o(L4,"abortable");var B4=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 Fd="utils_abort_request";var un;(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"})(un||(un={}));var U4={[un.PARSE_ERROR]:"Parse error",[un.INVALID_REQUEST]:"Invalid request",[un.METHOD_NOT_FOUND]:"Method not found",[un.INVALID_PARAMS]:"Invalid params",[un.INTERNAL_ERROR]:"Internal error"};function ML(r){return-32e3>=r&&r>=-32099}o(ML,"isServerError");function $d(r){return U4[r.toString()]??(ML(r)?"Server error":"Application error")}o($d,"getErrorMessage");var An=class extends Error{static fromObject(e){return new An(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,An.prototype),this.code=e,this.data=n,this.message=t??$d(e)}};o(An,"RPCError");function Ju(r){let e=U4[r];return o(function(n){return new An(r,e,n)},"createError")}o(Ju,"createErrorFactory");var TL=Ju(un.PARSE_ERROR),HV=Ju(un.INVALID_REQUEST),zV=Ju(un.METHOD_NOT_FOUND),KV=Ju(un.INVALID_PARAMS),jV=Ju(un.INTERNAL_ERROR);function CL(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(CL,"_checkPrivateRedeclaration");function kL(r,e){return e.get?e.get.call(r):e.value}o(kL,"_classApplyDescriptorGet");function IL(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(IL,"_classApplyDescriptorSet");function F4(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(F4,"_classExtractFieldDescriptor");function mb(r,e){var t=F4(r,e,"get");return kL(r,t)}o(mb,"_classPrivateFieldGet");function DL(r,e,t){CL(r,e),e.set(r,t)}o(DL,"_classPrivateFieldInit");function RL(r,e,t){var n=F4(r,e,"set");return IL(r,n,t),t}o(RL,"_classPrivateFieldSet");var Yu=new WeakMap,yc=class{get connection(){return mb(this,Yu)}createID(){return B4()}request(e,t=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Ud);let s=this.createID(),f=mb(this,Yu).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw An.fromObject(u.error);return u.result});return i==null?f:(i.addEventListener("abort",()=>{this.notify(Fd,{id:s})}),L4(f,i))}async notify(e,t=void 0){await mb(this,Yu).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){DL(this,Yu,{writable:!0,value:void 0}),RL(this,Yu,e)}};o(yc,"RPCClient");function $4(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:$d(e)}}}o($4,"createErrorResponse");function OL(r,e,t){console.warn("Unhandled handler error",e,t)}o(OL,"fallbackOnHandlerError");function NL(r,e){console.warn("Unhandled invalid message",e)}o(NL,"fallbackOnInvalidMessage");function PL(r,e){console.warn("Unhandled notification",e)}o(PL,"fallbackOnNotification");function q4(r,e={}){let t=e.onHandlerError??OL,n=e.onInvalidMessage??NL,i=e.onNotification??PL,s={};function f(u,d){if(d.method===Fd){let g=d.params?.id;g!=null&&s[g]?.abort()}else i(u,d)}return o(f,"handleNotification"),o(async function(d,g){let y=g.id;if(g.jsonrpc!=="2.0"||g.method==null)return y==null?(n(d,g),null):$4(y,un.INVALID_REQUEST);let E=r[g.method];if(E==null)return y==null?(f(d,g),null):$4(y,un.METHOD_NOT_FOUND);try{let O;if(y!=null&&E[P4]){let I=new AbortController;s[y]=I,O=E(d,g.params,{signal:I.signal})}else O=E(d,g.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return y==null||s[y]?.signal.aborted?null:{jsonrpc:"2.0",id:y,result:R}}catch(O){if(y==null||s[y]?.signal.aborted)return t(d,g,O),null;let R;if(O instanceof An)R=O.toObject();else{t(d,g,O);let I=O.code??-32e3;R={code:I,message:O.message||$d(I)}}return{jsonrpc:"2.0",id:y,error:R}}finally{y!=null&&delete s[y]}},"handleRequest")}o(q4,"createHandler");$i();var V5=Bt(G5(),1),Qr=Bt(tf(),1);var DB=`
656
656
  sign-in-with-ethereum =
657
657
  domain %s" wants you to sign in with your Ethereum account:" LF
658
658
  address LF
@@ -799,8 +799,8 @@ LF = %x0A
799
799
  DIGIT = %x30-39
800
800
  ; 0-9
801
801
  HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
802
- `,el=class{constructor(e){let t=new V5.default(DB);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 Qr.default.parser;i.ast=new Qr.default.ast;let s=Qr.default.ids,f=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.domain=Qr.default.utils.charsToString(ie,G,$)),he},"domain");i.ast.callbacks.domain=f;let u=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.address=Qr.default.utils.charsToString(ie,G,$)),he},"address");i.ast.callbacks.address=u;let d=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.statement=Qr.default.utils.charsToString(ie,G,$)),he},"statement");i.ast.callbacks.statement=d;let g=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.uri||(K.uri=Qr.default.utils.charsToString(ie,G,$))),he},"uri");i.ast.callbacks.uri=g;let y=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.version=Qr.default.utils.charsToString(ie,G,$)),he},"version");i.ast.callbacks.version=y;let E=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.chainId=Qr.default.utils.charsToString(ie,G,$)),he},"chainId");i.ast.callbacks["chain-id"]=E;let O=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.nonce=Qr.default.utils.charsToString(ie,G,$)),he},"nonce");i.ast.callbacks.nonce=O;let R=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.issuedAt=Qr.default.utils.charsToString(ie,G,$)),he},"issuedAt");i.ast.callbacks["issued-at"]=R;let I=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.expirationTime=Qr.default.utils.charsToString(ie,G,$)),he},"expirationTime");i.ast.callbacks["expiration-time"]=I;let N=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.notBefore=Qr.default.utils.charsToString(ie,G,$)),he},"notBefore");i.ast.callbacks["not-before"]=N;let X=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.requestId=Qr.default.utils.charsToString(ie,G,$)),he},"requestId");i.ast.callbacks["request-id"]=X;let L=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.resources=Qr.default.utils.charsToString(ie,G,$).slice(3).split(`
803
- - `)),he},"resources");i.ast.callbacks.resources=L;let J=i.parse(n,"sign-in-with-ethereum",e);if(!J.success)throw new Error(`Invalid message: ${JSON.stringify(J)}`);let ee={};i.ast.translate(ee);for(let[Y,ie]of Object.entries(ee))this[Y]=ie}};o(el,"ParsedMessage");function Nb(){return Nb=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},Nb.apply(this,arguments)}o(Nb,"_extends");var Pb={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}"}}}},RB={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}"}}}},Lb={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}"}}}},OB={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:Pb,1:Lb}}},NB={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:Pb,1:Lb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},tl={2:Pb,10:RB,19:{assetName:Lb,assetType:OB,assetId:NB}};function W5(r,e){return r.split(e.parameters.delimiter)}o(W5,"splitParams");function rl(r,e){var t=W5(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(rl,"getParams");function Tc(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Tc(n,t)}).join(e.parameters.delimiter)}o(Tc,"joinParams");function nl(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=W5(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(nl,"isValidId");var Xs=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(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();Xs.spec=tl[2];var Zs=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new Xs(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=rl(n,this.spec),s=i.namespace,f=i.reference,u=i.address,d=new Xs({namespace:s,reference:f});return new r({chainId:d,address:u}).toJSON()},"parse"),r.format=o(function(n){var i=new Xs(n.chainId),s=Nb({},i.toJSON(),{address:n.address});return Tc(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}();Zs.spec=tl[10];var Bb=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(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();Bb.spec=tl[19].assetName;var PB=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new Xs(t.chainId),this.assetName=new Bb(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();PB.spec=tl[19].assetType;var LB=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new Xs(t.chainId),this.assetName=new Bb(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();LB.spec=tl[19].assetId;var J5;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(J5||(J5={}));var ol;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(ol||(ol={}));var il=class{static fromCacao(e){let t=Zs.parse(e.p.iss.replace("did:pkh:","")),n=new this({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new Xs(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=ol.PERSONAL_SIGNATURE)),n}toMessage(e){return BB(this,e)}constructor(e){if(this.statement=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.resources=void 0,this.signature=void 0,typeof e=="string"){let t=new el(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)}};o(il,"SiwxMessage");function Y5(r,e){let t=`${r.domain} wants you to sign in with your ${e} account:`,n=`URI: ${r.uri}`,i=[t,r.address].join(`
802
+ `,el=class{constructor(e){let t=new V5.default(DB);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 Qr.default.parser;i.ast=new Qr.default.ast;let s=Qr.default.ids,f=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.domain=Qr.default.utils.charsToString(ie,G,$)),he},"domain");i.ast.callbacks.domain=f;let u=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.address=Qr.default.utils.charsToString(ie,G,$)),he},"address");i.ast.callbacks.address=u;let d=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.statement=Qr.default.utils.charsToString(ie,G,$)),he},"statement");i.ast.callbacks.statement=d;let g=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.uri||(K.uri=Qr.default.utils.charsToString(ie,G,$))),he},"uri");i.ast.callbacks.uri=g;let y=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.version=Qr.default.utils.charsToString(ie,G,$)),he},"version");i.ast.callbacks.version=y;let E=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.chainId=Qr.default.utils.charsToString(ie,G,$)),he},"chainId");i.ast.callbacks["chain-id"]=E;let O=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.nonce=Qr.default.utils.charsToString(ie,G,$)),he},"nonce");i.ast.callbacks.nonce=O;let R=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.issuedAt=Qr.default.utils.charsToString(ie,G,$)),he},"issuedAt");i.ast.callbacks["issued-at"]=R;let I=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.expirationTime=Qr.default.utils.charsToString(ie,G,$)),he},"expirationTime");i.ast.callbacks["expiration-time"]=I;let P=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.notBefore=Qr.default.utils.charsToString(ie,G,$)),he},"notBefore");i.ast.callbacks["not-before"]=P;let X=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.requestId=Qr.default.utils.charsToString(ie,G,$)),he},"requestId");i.ast.callbacks["request-id"]=X;let B=o(function(Y,ie,G,$,K){let he=s.SEM_OK;return Y===s.SEM_PRE&&(K.resources=Qr.default.utils.charsToString(ie,G,$).slice(3).split(`
803
+ - `)),he},"resources");i.ast.callbacks.resources=B;let J=i.parse(n,"sign-in-with-ethereum",e);if(!J.success)throw new Error(`Invalid message: ${JSON.stringify(J)}`);let ee={};i.ast.translate(ee);for(let[Y,ie]of Object.entries(ee))this[Y]=ie}};o(el,"ParsedMessage");function Nb(){return Nb=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},Nb.apply(this,arguments)}o(Nb,"_extends");var Pb={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}"}}}},RB={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}"}}}},Lb={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}"}}}},OB={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:Pb,1:Lb}}},NB={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:Pb,1:Lb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},tl={2:Pb,10:RB,19:{assetName:Lb,assetType:OB,assetId:NB}};function W5(r,e){return r.split(e.parameters.delimiter)}o(W5,"splitParams");function rl(r,e){var t=W5(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(rl,"getParams");function Tc(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Tc(n,t)}).join(e.parameters.delimiter)}o(Tc,"joinParams");function nl(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=W5(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(nl,"isValidId");var Xs=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(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();Xs.spec=tl[2];var Zs=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new Xs(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=rl(n,this.spec),s=i.namespace,f=i.reference,u=i.address,d=new Xs({namespace:s,reference:f});return new r({chainId:d,address:u}).toJSON()},"parse"),r.format=o(function(n){var i=new Xs(n.chainId),s=Nb({},i.toJSON(),{address:n.address});return Tc(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}();Zs.spec=tl[10];var Bb=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(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();Bb.spec=tl[19].assetName;var PB=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new Xs(t.chainId),this.assetName=new Bb(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();PB.spec=tl[19].assetType;var LB=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new Xs(t.chainId),this.assetName=new Bb(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!nl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(rl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Tc(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}();LB.spec=tl[19].assetId;var J5;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(J5||(J5={}));var ol;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(ol||(ol={}));var il=class{static fromCacao(e){let t=Zs.parse(e.p.iss.replace("did:pkh:","")),n=new this({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new Xs(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=ol.PERSONAL_SIGNATURE)),n}toMessage(e){return BB(this,e)}constructor(e){if(this.statement=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.resources=void 0,this.signature=void 0,typeof e=="string"){let t=new el(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)}};o(il,"SiwxMessage");function Y5(r,e){let t=`${r.domain} wants you to sign in with your ${e} account:`,n=`URI: ${r.uri}`,i=[t,r.address].join(`
804
804
  `),s=`Version: ${r.version}`;r.nonce||(r.nonce=(Math.random()+1).toString(36).substring(4));let f=`Nonce: ${r.nonce}`,u=[n,s,f];if(r.issuedAt&&Date.parse(r.issuedAt),r.issuedAt=r.issuedAt?r.issuedAt:new Date().toISOString(),u.push(`Issued At: ${r.issuedAt}`),r.expirationTime){let g=`Expiration Time: ${r.expirationTime}`;u.push(g)}r.notBefore&&u.push(`Not Before: ${r.notBefore}`),r.requestId&&u.push(`Request ID: ${r.requestId}`),r.chainId&&u.push(`Chain ID: ${r.chainId}`),r.resources&&u.push(["Resources:",...r.resources.map(g=>`- ${g}`)].join(`
805
805
  `));let d=u.join(`
806
806
  `);return r.statement&&(i=[i,r.statement].join(`
@@ -815,10 +815,10 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
815
815
  `)),[i,g].join(`
816
816
 
817
817
  `)}o(BB,"asString");var Cc=class extends il{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case ol.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Cc,"SiweMessage");Su();var UB=5*60,BW=new Date("2022-09-20").valueOf(),sl;(function(r){function e(u){let d={h:{t:"eip4361"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:eip155:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"eip191",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:solana:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"solana:ed25519",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(t,"fromSiwsMessage"),r.fromSiwsMessage=t;function n(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:tezos:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"tezos:ed25519",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(n,"fromSiwTezosMessage"),r.fromSiwTezosMessage=n;function i(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:stacks:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"stacks:secp256k1",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(i,"fromSiwStacksMessage"),r.fromSiwStacksMessage=i;async function s(u){return(await Sw({bytes:u,codec:Vi,hasher:Ns})).value}o(s,"fromBlockBytes"),r.fromBlockBytes=s;async function f(u,d={}){Ub(u);let g=d.verifiers[u.s.t];if(!g)throw new Error("Unsupported CACAO signature type, register the needed verifier");return g(u,d)}o(f,"verify"),r.verify=f})(sl||(sl={}));var al;(function(r){function e(t){return Va({value:t,codec:Vi,hasher:Ns})}o(e,"fromCacao"),r.fromCacao=e})(al||(al={}));function Ub(r){if(r.s===null||r.s===void 0)throw new Error("CACAO does not have a signature")}o(Ub,"assertSigned");function X5(r,e){let t=e.atTime?e.atTime.getTime():Date.now(),n=(e.clockSkewSecs??UB)*1e3;if(Date.parse(r.p.iat)>t+n||Date.parse(r.p.nbf)>t+n)throw new Error("CACAO is not valid yet");let i=e.revocationPhaseOutSecs?e.revocationPhaseOutSecs*1e3:0;if(!e.disableExpirationCheck&&Date.parse(r.p.exp)+i+n<t)throw new Error("CACAO has expired")}o(X5,"verifyTimeChecks");var Z5="logger/5.7.0";var Q5=!1,e8=!1,Yd={debug:1,default:2,info:2,warning:3,error:4,off:5},t8=Yd.default,Fb=null;function FB(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}o(FB,"_checkNormalize");var r8=FB(),$b;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})($b||($b={}));var Ji;(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",r.ACTION_REJECTED="ACTION_REJECTED"})(Ji||(Ji={}));var n8="0123456789abcdef",At=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();Yd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(t8>Yd[n])&&console.log.apply(console,t)}debug(...e){this._log(At.levels.DEBUG,e)}info(...e){this._log(At.levels.INFO,e)}warn(...e){this._log(At.levels.WARNING,e)}makeError(e,t,n){if(e8)return this.makeError("censored error",t,{});t||(t=At.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(d=>{let g=n[d];try{if(g instanceof Uint8Array){let y="";for(let E=0;E<g.length;E++)y+=n8[g[E]>>4],y+=n8[g[E]&15];i.push(d+"=Uint8Array(0x"+y+")")}else i.push(d+"="+JSON.stringify(g))}catch{i.push(d+"="+JSON.stringify(n[d].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,f="";switch(t){case Ji.NUMERIC_FAULT:{f="NUMERIC_FAULT";let d=e;switch(d){case"overflow":case"underflow":case"division-by-zero":f+="-"+d;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result";break}break}case Ji.CALL_EXCEPTION:case Ji.INSUFFICIENT_FUNDS:case Ji.MISSING_NEW:case Ji.NONCE_EXPIRED:case Ji.REPLACEMENT_UNDERPRICED:case Ji.TRANSACTION_REPLACED:case Ji.UNPREDICTABLE_GAS_LIMIT:f=t;break}f&&(e+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let u=new Error(e);return u.reason=s,u.code=t,Object.keys(n).forEach(function(d){u[d]=n[d]}),u}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,At.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"),r8&&this.throwError("platform missing String.prototype.normalize",At.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:r8})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,At.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,At.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,At.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,At.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",At.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",At.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",At.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Fb||(Fb=new At(Z5)),Fb}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",At.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Q5){if(!e)return;this.globalLogger().throwError("error censorship permanent",At.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}e8=!!e,Q5=!!t}static setLogLevel(e){let t=Yd[e.toLowerCase()];if(t==null){At.globalLogger().warn("invalid log level - "+e);return}t8=t}static from(e){return new At(e)}};o(At,"Logger");At.errors=Ji;At.levels=$b;var i8="bytes/5.7.0";var yr=new At(i8);function s8(r){return!!r.toHexString}o(s8,"isHexable");function kc(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return kc(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(kc,"addSlice");function a8(r){return Yi(r)&&!(r.length%2)||Hb(r)}o(a8,"isBytesLike");function o8(r){return typeof r=="number"&&r==r&&r%1===0}o(o8,"isInteger");function Hb(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!o8(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!o8(t)||t<0||t>=256)return!1}return!0}o(Hb,"isBytes");function ar(r,e){if(e||(e={}),typeof r=="number"){yr.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),kc(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),s8(r)&&(r=r.toHexString()),Yi(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":yr.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 kc(new Uint8Array(n))}return Hb(r)?kc(new Uint8Array(r)):yr.throwArgumentError("invalid arrayify value","value",r)}o(ar,"arrayify");function zb(r){let e=r.map(i=>ar(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),kc(n)}o(zb,"concat");function $B(r,e){r=ar(r),r.length>e&&yr.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),kc(t)}o($B,"zeroPad");function Yi(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Yi,"isHexString");var qb="0123456789abcdef";function en(r,e){if(e||(e={}),typeof r=="number"){yr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=qb[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),s8(r))return r.toHexString();if(Yi(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":yr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Hb(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=qb[(i&240)>>4]+qb[i&15]}return t}return yr.throwArgumentError("invalid hexlify value","value",r)}o(en,"hexlify");function Xd(r){if(typeof r!="string")r=en(r);else if(!Yi(r)||r.length%2)return null;return(r.length-2)/2}o(Xd,"hexDataLength");function Zd(r,e,t){return typeof r!="string"?r=en(r):(!Yi(r)||r.length%2)&&yr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(Zd,"hexDataSlice");function Qs(r,e){for(typeof r!="string"?r=en(r):Yi(r)||yr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&yr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(Qs,"hexZeroPad");function Qd(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a8(r)){let t=ar(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=en(t.slice(0,32)),e.s=en(t.slice(32,64))):t.length===65?(e.r=en(t.slice(0,32)),e.s=en(t.slice(32,64)),e.v=t[64]):yr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:yr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=en(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=$B(ar(e._vs),32);e._vs=en(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&yr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let f=en(i);e.s==null?e.s=f:e.s!==f&&yr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?yr.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&&yr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Yi(e.r)?yr.throwArgumentError("signature missing or invalid r","signature",r):e.r=Qs(e.r,32),e.s==null||!Yi(e.s)?yr.throwArgumentError("signature missing or invalid s","signature",r):e.s=Qs(e.s,32);let t=ar(e.s);t[0]>=128&&yr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=en(t);e._vs&&(Yi(e._vs)||yr.throwArgumentError("signature invalid _vs","signature",r),e._vs=Qs(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&yr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(Qd,"splitSignature");var u8=Bt(jb());var c8="bignumber/5.7.0";var qB=u8.default.BN,JW=new At(c8);function Gb(r){return new qB(r,36).toString(16)}o(Gb,"_base36To16");var l8=Bt(n1());function Ic(r){return"0x"+l8.default.keccak_256(ar(r))}o(Ic,"keccak256");var h8="address/5.7.0";var fl=new At(h8);function d8(r){Yi(r,20)||fl.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=ar(Ic(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(d8,"getChecksumAddress");var KB=9007199254740991;function jB(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(jB,"log10");var Vb={};for(let r=0;r<10;r++)Vb[String(r)]=String(r);for(let r=0;r<26;r++)Vb[String.fromCharCode(65+r)]=String(10+r);var p8=Math.floor(jB(KB));function GB(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>Vb[n]).join("");for(;e.length>=p8;){let n=e.substring(0,p8);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(GB,"ibanChecksum");function m8(r){let e=null;if(typeof r!="string"&&fl.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=d8(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&fl.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)!==GB(r)&&fl.throwArgumentError("bad icap checksum","address",r),e=Gb(r.substring(4));e.length<40;)e="0"+e;e=d8("0x"+e)}else fl.throwArgumentError("invalid address","address",r);return e}o(m8,"getAddress");var b8="properties/5.7.0";var hJ=new At(b8);function Dc(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Dc,"defineReadOnly");var g8="strings/5.7.0";var v8=new At(g8),cl;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(cl||(cl={}));var rf;(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"})(rf||(rf={}));function VB(r,e,t,n,i){return v8.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(VB,"errorFunc");function y8(r,e,t,n,i){if(r===rf.BAD_PREFIX||r===rf.UNEXPECTED_CONTINUE){let s=0;for(let f=e+1;f<t.length&&t[f]>>6===2;f++)s++;return s}return r===rf.OVERRUN?t.length-e-1:0}o(y8,"ignoreFunc");function WB(r,e,t,n,i){return r===rf.OVERLONG?(n.push(i),0):(n.push(65533),y8(r,e,t,n,i))}o(WB,"replaceFunc");var JB=Object.freeze({error:VB,ignore:y8,replace:WB});function ul(r,e=cl.current){e!=cl.current&&(v8.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 f=65536+((i&1023)<<10)+(s&1023);t.push(f>>18|240),t.push(f>>12&63|128),t.push(f>>6&63|128),t.push(f&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return ar(t)}o(ul,"toUtf8Bytes");var x8=`Ethereum Signed Message:
818
- `;function Wb(r){return typeof r=="string"&&(r=ul(r)),Ic(zb([ul(x8),ul(String(r.length)),r]))}o(Wb,"hashMessage");var xt=Bt(jb()),Eo=Bt(Ou());function Rc(r,e,t){return t={path:e,exports:{},require:function(n,i){return YB(n,i??t.path)}},r(t,t.exports),t.exports}o(Rc,"createCommonjsModule");function YB(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(YB,"commonjsRequire");var Zb=_8;function _8(r,e){if(!r)throw new Error(e||"Assertion failed")}o(_8,"assert");_8.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Xi=Rc(function(r,e){"use strict";var t=e;function n(f,u){if(Array.isArray(f))return f.slice();if(!f)return[];var d=[];if(typeof f!="string"){for(var g=0;g<f.length;g++)d[g]=f[g]|0;return d}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var g=0;g<f.length;g+=2)d.push(parseInt(f[g]+f[g+1],16))}else for(var g=0;g<f.length;g++){var y=f.charCodeAt(g),E=y>>8,O=y&255;E?d.push(E,O):d.push(O)}return d}o(n,"toArray"),t.toArray=n;function i(f){return f.length===1?"0"+f:f}o(i,"zero2"),t.zero2=i;function s(f){for(var u="",d=0;d<f.length;d++)u+=i(f[d].toString(16));return u}o(s,"toHex"),t.toHex=s,t.encode=o(function(u,d){return d==="hex"?s(u):u},"encode")}),Gn=Rc(function(r,e){"use strict";var t=e;t.assert=Zb,t.toArray=Xi.toArray,t.zero2=Xi.zero2,t.toHex=Xi.toHex,t.encode=Xi.encode;function n(d,g,y){var E=new Array(Math.max(d.bitLength(),y)+1);E.fill(0);for(var O=1<<g+1,R=d.clone(),I=0;I<E.length;I++){var N,X=R.andln(O-1);R.isOdd()?(X>(O>>1)-1?N=(O>>1)-X:N=X,R.isubn(N)):N=0,E[I]=N,R.iushrn(1)}return E}o(n,"getNAF"),t.getNAF=n;function i(d,g){var y=[[],[]];d=d.clone(),g=g.clone();for(var E=0,O=0,R;d.cmpn(-E)>0||g.cmpn(-O)>0;){var I=d.andln(3)+E&3,N=g.andln(3)+O&3;I===3&&(I=-1),N===3&&(N=-1);var X;(I&1)===0?X=0:(R=d.andln(7)+E&7,(R===3||R===5)&&N===2?X=-I:X=I),y[0].push(X);var L;(N&1)===0?L=0:(R=g.andln(7)+O&7,(R===3||R===5)&&I===2?L=-N:L=N),y[1].push(L),2*E===X+1&&(E=1-E),2*O===L+1&&(O=1-O),d.iushrn(1),g.iushrn(1)}return y}o(i,"getJSF"),t.getJSF=i;function s(d,g,y){var E="_"+g;d.prototype[g]=o(function(){return this[E]!==void 0?this[E]:this[E]=y.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function f(d){return typeof d=="string"?t.toArray(d,"hex"):d}o(f,"parseBytes"),t.parseBytes=f;function u(d){return new xt.default(d,"hex","le")}o(u,"intFromLE"),t.intFromLE=u}),r0=Gn.getNAF,XB=Gn.getJSF,n0=Gn.assert;function ta(r,e){this.type=r,this.p=new xt.default(e.p,16),this.red=e.prime?xt.default.red(e.prime):xt.default.mont(this.p),this.zero=new xt.default(0).toRed(this.red),this.one=new xt.default(1).toRed(this.red),this.two=new xt.default(2).toRed(this.red),this.n=e.n&&new xt.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(ta,"BaseCurve");var nf=ta;ta.prototype.point=o(function(){throw new Error("Not implemented")},"point");ta.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");ta.prototype._fixedNafMul=o(function(e,t){n0(e.precomputed);var n=e._getDoubles(),i=r0(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var g=u+n.step-1;g>=u;g--)d=(d<<1)+i[g];f.push(d)}for(var y=this.jpoint(null,null,null),E=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?E=E.mixedAdd(n.points[u]):d===-O&&(E=E.mixedAdd(n.points[u].neg()));y=y.add(E)}return y.toP()},"_fixedNafMul");ta.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=r0(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var g=0;d>=0&&f[d]===0;d--)g++;if(d>=0&&g++,u=u.dblp(g),d<0)break;var y=f[d];n0(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(s[y-1>>1]):u=u.mixedAdd(s[-y-1>>1].neg()):y>0?u=u.add(s[y-1>>1]):u=u.add(s[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");ta.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,g=0,y,E,O;for(y=0;y<i;y++){O=t[y];var R=O._getNAFPoints(e);f[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,N=y;if(f[I]!==1||f[N]!==1){d[I]=r0(n[I],f[I],this._bitLength),d[N]=r0(n[N],f[N],this._bitLength),g=Math.max(d[I].length,g),g=Math.max(d[N].length,g);continue}var X=[t[I],null,null,t[N]];t[I].y.cmp(t[N].y)===0?(X[1]=t[I].add(t[N]),X[2]=t[I].toJ().mixedAdd(t[N].neg())):t[I].y.cmp(t[N].y.redNeg())===0?(X[1]=t[I].toJ().mixedAdd(t[N]),X[2]=t[I].add(t[N].neg())):(X[1]=t[I].toJ().mixedAdd(t[N]),X[2]=t[I].toJ().mixedAdd(t[N].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],J=XB(n[I],n[N]);for(g=Math.max(J[0].length,g),d[I]=new Array(g),d[N]=new Array(g),E=0;E<g;E++){var ee=J[0][E]|0,Y=J[1][E]|0;d[I][E]=L[(ee+1)*3+(Y+1)],d[N][E]=0,u[I]=X}}var ie=this.jpoint(null,null,null),G=this._wnafT4;for(y=g;y>=0;y--){for(var $=0;y>=0;){var K=!0;for(E=0;E<i;E++)G[E]=d[E][y]|0,G[E]!==0&&(K=!1);if(!K)break;$++,y--}if(y>=0&&$++,ie=ie.dblp($),y<0)break;for(E=0;E<i;E++){var he=G[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ie=ie.mixedAdd(O):ie=ie.add(O))}}for(y=0;y<i;y++)u[y]=null;return s?ie:ie.toP()},"_wnafMulAdd");function Mi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(Mi,"BasePoint");ta.BasePoint=Mi;Mi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");Mi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");ta.prototype.decodePoint=o(function(e,t){e=Gn.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?n0(e[e.length-1]%2===0):e[0]===7&&n0(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");Mi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");Mi.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");Mi.prototype.encode=o(function(e,t){return Gn.encode(this._encode(t),e)},"encode");Mi.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");Mi.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");Mi.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");Mi.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");Mi.prototype._getBeta=o(function(){return null},"_getBeta");Mi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var Qb=Rc(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")}),ZB=Gn.assert;function Ti(r){nf.call(this,"short",r),this.a=new xt.default(r.a,16).toRed(this.red),this.b=new xt.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(Ti,"ShortCurve");Qb(Ti,nf);var QB=Ti;Ti.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 xt.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 xt.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],ZB(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new xt.default(u.a,16),b:new xt.default(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");Ti.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:xt.default.mont(e),n=new xt.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new xt.default(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");Ti.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 xt.default(1),f=new xt.default(0),u=new xt.default(0),d=new xt.default(1),g,y,E,O,R,I,N,X=0,L,J;n.cmpn(0)!==0;){var ee=i.div(n);L=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Y=d.sub(ee.mul(f));if(!E&&L.cmp(t)<0)g=N.neg(),y=s,E=L.neg(),O=J;else if(E&&++X===2)break;N=L,i=n,n=L,u=s,s=J,d=f,f=Y}R=L.neg(),I=J;var ie=E.sqr().add(O.sqr()),G=R.sqr().add(I.sqr());return G.cmp(ie)>=0&&(R=g,I=y),E.negative&&(E=E.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:E,b:O},{a:R,b:I}]},"_getEndoBasis");Ti.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),g=s.mul(n.b),y=f.mul(i.b),E=e.sub(u).sub(d),O=g.add(y).neg();return{k1:E,k2:O}},"_endoSplit");Ti.prototype.pointFromX=o(function(e,t){e=new xt.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");Ti.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");Ti.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],g=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),g=g.neg(!0)),i[f*2]=d,i[f*2+1]=g,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return y},"_endoWnafMulAdd");function Nr(r,e,t,n){nf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new xt.default(e,16),this.y=new xt.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(Nr,"Point");Qb(Nr,nf.BasePoint);Ti.prototype.point=o(function(e,t,n){return new Nr(this,e,t,n)},"point");Ti.prototype.pointFromJSON=o(function(e,t){return Nr.fromJSON(this,e,t)},"pointFromJSON");Nr.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");Nr.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");Nr.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Nr.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");Nr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Nr.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");Nr.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Nr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Nr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Nr.prototype.mul=o(function(e){return e=new xt.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");Nr.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");Nr.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");Nr.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");Nr.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");Nr.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 zr(r,e,t,n){nf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new xt.default(0)):(this.x=new xt.default(e,16),this.y=new xt.default(t,16),this.z=new xt.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(zr,"JPoint");Qb(zr,nf.BasePoint);Ti.prototype.jpoint=o(function(e,t,n){return new zr(this,e,t,n)},"jpoint");zr.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");zr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");zr.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),g=f.redSub(u);if(d.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),E=y.redMul(d),O=i.redMul(y),R=g.redSqr().redIAdd(E).redISub(O).redISub(O),I=g.redMul(O.redISub(R)).redISub(f.redMul(E)),N=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,N)},"add");zr.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=u.redSqr(),y=g.redMul(u),E=n.redMul(g),O=d.redSqr().redIAdd(y).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");zr.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,f=this.x,u=this.y,d=this.z,g=d.redSqr().redSqr(),y=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=y.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(g)),N=f.redMul(O),X=I.redSqr().redISub(N.redAdd(N)),L=N.redISub(X),J=I.redMul(L);J=J.redIAdd(J).redISub(R);var ee=y.redMul(d);t+1<e&&(g=g.redMul(R)),f=X,d=ee,y=J}return this.curve.jpoint(f,y.redMul(s),d)},"dblp");zr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");zr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),g=d.redSqr().redISub(u).redISub(u),y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),e=g,t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(E).redISub(R);I=I.redIAdd(I);var N=E.redAdd(E).redIAdd(E),X=N.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=X.redISub(I).redISub(I),t=N.redMul(I.redISub(e)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");zr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=d.redSqr().redISub(u).redISub(u);e=g;var y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(E).redMul(this.x.redAdd(E));I=I.redAdd(I).redIAdd(I);var N=R.redIAdd(R);N=N.redIAdd(N);var X=N.redAdd(N);e=I.redSqr().redISub(X),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var L=O.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),t=I.redMul(N.redISub(e)).redISub(L)}return this.curve.jpoint(e,t,n)},"_threeDbl");zr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),g=t.redAdd(t);g=g.redIAdd(g);var y=g.redMul(u),E=d.redSqr().redISub(y.redAdd(y)),O=y.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),N=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,N)},"_dbl");zr.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(g),E=t.redMul(y);E=E.redIAdd(E),E=E.redIAdd(E);var O=this.x.redMul(d).redISub(E);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(g.redISub(y)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");zr.prototype.mul=o(function(e,t){return e=new xt.default(e,t),this.curve._wnafMul(this,e)},"mul");zr.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");zr.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");zr.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");zr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var e0=Rc(function(r,e){"use strict";var t=e;t.base=nf,t.short=QB,t.mont=null,t.edwards=null}),t0=Rc(function(r,e){"use strict";var t=e,n=Gn.assert;function i(u){u.type==="short"?this.curve=new e0.short(u):u.type==="edwards"?this.curve=new e0.edwards(u):this.curve=new e0.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.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(u,d){Object.defineProperty(t,u,{configurable:!0,enumerable:!0,get:function(){var g=new i(d);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:g}),g}})}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:Eo.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:Eo.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:Eo.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:Eo.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:Eo.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:Eo.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:Eo.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=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:Eo.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function ea(r){if(!(this instanceof ea))return new ea(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=Xi.toArray(r.entropy,r.entropyEnc||"hex"),t=Xi.toArray(r.nonce,r.nonceEnc||"hex"),n=Xi.toArray(r.pers,r.persEnc||"hex");Zb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ea,"HmacDRBG");var E8=ea;ea.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");ea.prototype._hmac=o(function(){return new Eo.default.hmac(this.hash,this.K)},"hmac");ea.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");ea.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Xi.toArray(e,t),n=Xi.toArray(n,i),Zb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");ea.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=Xi.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 f=s.slice(0,e);return this._update(n),this._reseed++,Xi.encode(f,t)},"generate");var Xb=Gn.assert;function tn(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(tn,"KeyPair");var eg=tn;tn.fromPublic=o(function(e,t,n){return t instanceof tn?t:new tn(e,{pub:t,pubEnc:n})},"fromPublic");tn.fromPrivate=o(function(e,t,n){return t instanceof tn?t:new tn(e,{priv:t,privEnc:n})},"fromPrivate");tn.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");tn.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");tn.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");tn.prototype._importPrivate=o(function(e,t){this.priv=new xt.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");tn.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?Xb(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Xb(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");tn.prototype.derive=o(function(e){return e.validate()||Xb(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");tn.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");tn.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");tn.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var eU=Gn.assert;function i0(r,e){if(r instanceof i0)return r;this._importDER(r,e)||(eU(r.r&&r.s,"Signature without r or s"),this.r=new xt.default(r.r,16),this.s=new xt.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(i0,"Signature");var o0=i0;function tU(){this.place=0}o(tU,"Position");function Jb(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,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(Jb,"getLength");function w8(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(w8,"rmPadding");i0.prototype._importDER=o(function(e,t){e=Gn.toArray(e,t);var n=new tU;if(e[n.place++]!==48)return!1;var i=Jb(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Jb(e,n);if(s===!1)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=Jb(e,n);if(u===!1||e.length!==u+n.place)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new xt.default(f),this.s=new xt.default(d),this.recoveryParam=null,!0},"_importDER");function Yb(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(Yb,"constructLength");i0.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=w8(t),n=w8(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Yb(i,t.length),i=i.concat(t),i.push(2),Yb(i,n.length);var s=i.concat(n),f=[48];return Yb(f,s.length),f=f.concat(s),Gn.encode(f,e)},"toDER");var rU=o(function(){throw new Error("unsupported")},"rand"),A8=Gn.assert;function Si(r){if(!(this instanceof Si))return new Si(r);typeof r=="string"&&(A8(Object.prototype.hasOwnProperty.call(t0,r),"Unknown curve "+r),r=t0[r]),r instanceof t0.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(Si,"EC");var nU=Si;Si.prototype.keyPair=o(function(e){return new eg(this,e)},"keyPair");Si.prototype.keyFromPrivate=o(function(e,t){return eg.fromPrivate(this,e,t)},"keyFromPrivate");Si.prototype.keyFromPublic=o(function(e,t){return eg.fromPublic(this,e,t)},"keyFromPublic");Si.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new E8({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||rU(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new xt.default(2));;){var s=new xt.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");Si.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");Si.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 xt.default(e,16));for(var s=this.n.byteLength(),f=t.getPrivate().toArray("be",s),u=e.toArray("be",s),d=new E8({hash:this.hash,entropy:f,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new xt.default(1)),y=0;;y++){var E=i.k?i.k(y):new xt.default(d.generate(this.n.byteLength()));if(E=this._truncateToN(E,!0),!(E.cmpn(1)<=0||E.cmp(g)>=0)){var O=this.g.mul(E);if(!O.isInfinity()){var R=O.getX(),I=R.umod(this.n);if(I.cmpn(0)!==0){var N=E.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(N=N.umod(this.n),N.cmpn(0)!==0){var X=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),X^=1),new o0({r:I,s:N,recoveryParam:X})}}}}}},"sign");Si.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new xt.default(e,16)),n=this.keyFromPublic(n,i),t=new o0(t,"hex");var s=t.r,f=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var u=f.invm(this.n),d=u.mul(e).umod(this.n),g=u.mul(s).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.eqXToP(s)):(y=this.g.mulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(s)===0)},"verify");Si.prototype.recoverPubKey=function(r,e,t,n){A8((3&t)===t,"The recovery param is more than two bits"),e=new o0(e,n);var i=this.n,s=new xt.default(r),f=e.r,u=e.s,d=t&1,g=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var y=e.r.invm(i),E=i.sub(s).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(E,f,O)};Si.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new o0(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var iU=Rc(function(r,e){"use strict";var t=e;t.version="6.5.4",t.utils=Gn,t.rand=function(){throw new Error("unsupported")},t.curve=e0,t.curves=t0,t.ec=nU,t.eddsa=null}),S8=iU.ec;var M8="signing-key/5.7.0";var rg=new At(M8),tg=null;function Ao(){return tg||(tg=new S8("secp256k1")),tg}o(Ao,"getCurve");var s0=class{constructor(e){Dc(this,"curve","secp256k1"),Dc(this,"privateKey",en(e)),Xd(this.privateKey)!==32&&rg.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Ao().keyFromPrivate(ar(this.privateKey));Dc(this,"publicKey","0x"+t.getPublic(!1,"hex")),Dc(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Dc(this,"_isSigningKey",!0)}_addPoint(e){let t=Ao().keyFromPublic(ar(this.publicKey)),n=Ao().keyFromPublic(ar(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=Ao().keyFromPrivate(ar(this.privateKey)),n=ar(e);n.length!==32&&rg.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return Qd({recoveryParam:i.recoveryParam,r:Qs("0x"+i.r.toString(16),32),s:Qs("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=Ao().keyFromPrivate(ar(this.privateKey)),n=Ao().keyFromPublic(ar(ng(e)));return Qs("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(s0,"SigningKey");function T8(r,e){let t=Qd(e),n={r:ar(t.r),s:ar(t.s)};return"0x"+Ao().recoverPubKey(ar(r),n,t.recoveryParam).encode("hex",!1)}o(T8,"recoverPublicKey");function ng(r,e){let t=ar(r);if(t.length===32){let n=new s0(t);return e?"0x"+Ao().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?en(t):"0x"+Ao().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+Ao().keyFromPublic(t).getPublic(!0,"hex"):en(t)}return rg.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(ng,"computePublicKey");var C8="transactions/5.7.0";var GJ=new At(C8),k8;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(k8||(k8={}));function I8(r){let e=ng(r);return m8(Zd(Ic(Zd(e,1)),12))}o(I8,"computeAddress");function D8(r,e){return I8(T8(ar(r),e))}o(D8,"recoverAddress");var R8="wallet/5.7.0";var tY=new At(R8);function ig(r,e){return D8(Wb(r),e)}o(ig,"verifyMessage");function O8(){return{eip191:async(r,e)=>{sU(r,e)}}}o(O8,"getEIP191Verifier");var oU=new Date("2022-09-20").valueOf();function sU(r,e){Ub(r),X5(r,e);let n=[ig(Cc.fromCacao(r).toMessage(),r.s.s).toLowerCase()];if(Date.parse(r.p.iat)<=oU){let s=ig(Y5(Cc.fromCacao(r),"Ethereum"),r.s.s).toLowerCase();n.push(s)}let i=Zs.parse(r.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(sU,"verifyEIP191Signature");Yf();jh();var N8=Bt(qa(),1);Yf();function P8(){return It((0,N8.randomBytes)(16),"base64")}o(P8,"randomString");var L8="base64pad",B8="base64url";function U8(r){return It(r,L8)}o(U8,"encodeBase64");function F8(r){return It(r,B8)}o(F8,"encodeBase64Url");function $8(r){return Ut(r,L8)}o($8,"decodeBase64");function a0(r){return JSON.parse(It(Ut(r,B8)))}o(a0,"base64urlToJSON");function q8(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(q8,"fromDagJWS");function H8(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(H8,"didWithTime");function z8(r){return r?Array.isArray(r)?r:[r]:[]}o(z8,"extractControllers");var aU={...O8()};function fU(r){return"registry"in r&&"cache"in r}o(fU,"isResolver");var of=class{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){return new of({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new yc(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=fU(e)?e:new yu(e,t)}async authenticate({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=P8(),s=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:f}=await this.verifyJWS(s),u=a0(s.payload);if(!f.includes(u.did))throw new Error("Invalid authencation response, kid mismatch");if(u.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(u.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(u.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=u.did,this._id}async createJWS(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 i=this._capability.p.exp;if(i&&Date.parse(i)<Date.now())throw new Error("Capability is expired, cannot create a valid signature");let s=await al.fromCacao(this._capability),f=Je.asCID(s.cid);if(!f)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://${f?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...t,payload:e});return n}async createDagJWS(e,t={}){let{cid:n,linkedBlock:i}=await R4(e),s=F8(n.bytes);Object.assign(t,{linkedBlock:U8(i)});let f=await this.createJWS(s,t),u=Je.asCID(n);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 d=await al.fromCacao(this._capability);return{jws:f,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:f,linkedBlock:i}}async verifyJWS(e,t={}){t=Object.assign({verifiers:aU},t),typeof e!="string"&&(e=q8(e));let n=a0(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!t.disableTimecheck){let g=i.didDocumentMetadata?.nextUpdate;if(g){let E=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,O=new Date(g).valueOf()+E;if(!(t.atTime&&t.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let y=i.didDocumentMetadata?.updated;if(y&&t.atTime&&t.atTime.getTime()<new Date(y).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let f=i.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&f===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await sl.verify(t.capability,{disableExpirationCheck:t.disableTimecheck,atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}})}else if(t.issuer&&t.issuer!==f){let g=H8(t.issuer,t.atTime),E=(await this.resolve(g)).didDocument?.controller,O=z8(E);if(t.capability?.s&&t.capability.p.aud===f&&O.includes(t.capability.p.iss))await sl.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(f?O.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];yw(e,u);let d;try{d=a0(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,t,n={}){let i=await _w(t,this._resolver);return ww(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,t,n={}){let i=await O4(e);return this.createJWE(i,t,n)}async decryptJWE(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:n}=await this._client.request("did_decryptJWE",{did:this._id,...t,jwe:e});return $8(n)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return N4(t)}async resolve(e){let t=await 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}constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new yc(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)}};o(of,"DID");function K8(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(K8,"toUint8Array");var mg=Bt(ll(),1);Ph();var ag={};Yt(ag,{keyToDidDoc:()=>_U});function _U(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:It(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(_U,"keyToDidDoc");var fg={};Yt(fg,{keyToDidDoc:()=>AU});Yf();var e_=Bt(vd(),1);function EU(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${It(e,"base58btc")}`}o(EU,"encodeKey");function AU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=(0,e_.convertPublicKeyToX25519)(r),s=`${t}#${EU(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:It(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:It(i,"base58btc")}]}}o(AU,"keyToDidDoc");var hg={};Yt(hg,{keyToDidDoc:()=>PU,pubKeyBytesToXY:()=>i_});var c0={};Yt(c0,{ECPointDecompress:()=>RU});function SU(r){return r>=0?r:-r}o(SU,"n");function MU(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),r<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let t=0n,n=1n,i=1n,s=0n;for(;r!==0n;){let f=e/r,u=e%r,d=t-i*f,g=n-s*f;e=r,r=u,t=i,n=s,i=d,s=g}return{g:e,x:t,y:n}}o(MU,"r");function f0(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let t=r%e;return t<0n?t+e:t}o(f0,"e");function t_(r,e){let t=MU(f0(r,e),e);if(t.g!==1n)throw new RangeError(`${r.toString()} does not have inverse modulo ${e.toString()}`);return f0(t.x,e)}o(t_,"o");function TU(r,e,t){if(r.length!==e.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=t??e.reduce((i,s)=>i*s,1n);return e.reduce((i,s,f)=>{let u=n/s;return f0(i+u*t_(u,s)%n*r[f]%n,n)},0n)}o(TU,"i");function CU(r){return r.map(e=>e[0]**(e[1]-1n)*(e[0]-1n)).reduce((e,t)=>t*e,1n)}o(CU,"a");function ra(r,e,t,n){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");if(t===1n)return 0n;if(r=f0(r,t),e<0n)return t_(ra(r,SU(e),t,n),t);if(n!==void 0)return function(s,f,u,d){let g=d.map(O=>O[0]**O[1]),y=d.map(O=>CU([O])),E=y.map((O,R)=>ra(s,f%O,g[R]));return TU(E,g,u)}(r,e,t,function(s){let f={};return s.forEach(u=>{if(typeof u=="bigint"||typeof u=="number"){let d=String(u);f[d]===void 0?f[d]={p:BigInt(u),k:1n}:f[d].k+=1n}else{let d=String(u[0]);f[d]===void 0?f[d]={p:BigInt(u[0]),k:BigInt(u[1])}:f[d].k+=BigInt(u[1])}}),Object.values(f).map(u=>[u.p,u.k])}(n));let i=1n;for(;e>0;)e%2n===1n&&(i=i*r%t),e/=2n,r=r**2n%t;return i}o(ra,"s");var xr={};Yt(xr,{pubKeyBytesToHex:()=>kU,publicKeyHexToUint8ArrayPointPair:()=>r_,publicKeyIntToUint8ArrayPointPair:()=>n_,publicKeyIntToXY:()=>DU,publicKeyToXY:()=>IU,testHexString:()=>ug,testUint8Array:()=>na});Lh();function kU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");return It(r,"base16")}o(kU,"pubKeyBytesToHex");function IU(r){if(!ug(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=r_(r),t=Da.encode(e.xOctet).slice(1),n=Da.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(IU,"publicKeyToXY");function r_(r){if(!ug(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=r.slice(0,r.length/2),t=r.slice(r.length/2,r.length),n=Ut(e,"base16"),i=Ut(t,"base16");return{xOctet:n,yOctet:i}}o(r_,"publicKeyHexToUint8ArrayPointPair");function ug(r){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(r)!==null&&e.test(r)&&typeof r=="string")}o(ug,"testHexString");function na(r){return r==null?!1:r.constructor===Uint8Array}o(na,"testUint8Array");function DU(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=n_(r),t=Da.encode(e.xOctet).slice(1),n=Da.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(DU,"publicKeyIntToXY");function n_(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=r.x.toString(),t=r.y.toString(),n=Ut(e,"base10"),i=Ut(t,"base10");return{xOctet:n,yOctet:i}}o(n_,"publicKeyIntToUint8ArrayPointPair");function RU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(It(f,"base10")),d=u**3n-u*3n+n,g=ra(d,i,t);return g%2n!==s&&(g=t-g),{x:u,y:g}}o(RU,"ECPointDecompress");var u0={};Yt(u0,{ECPointDecompress:()=>OU});function OU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(It(f,"base10")),d=u**3n-u*3n+n,g=ra(d,i,t);return g%2n!==s&&(g=t-g),{x:u,y:g}}o(OU,"ECPointDecompress");var l0={};Yt(l0,{ECPointDecompress:()=>NU});function NU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");let t=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(It(f,"base10")),d=u**3n-u*3n+n,g=ra(d,i,t);return g%2n!==s&&(g=t-g),{x:u,y:g}}o(NU,"ECPointDecompress");function PU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=i_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(PU,"keyToDidDoc");function i_(r){if(!xr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=xr.pubKeyBytesToHex(r),t=e.length/2;if(t==64)return xr.publicKeyToXY(e);if(t==65&&e.slice(0,2)=="04"){let n=e.slice(2);return xr.publicKeyToXY(n)}if(t==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ut(e,"base16"),i=c0.ECPointDecompress(n);return xr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(i_,"pubKeyBytesToXY");var dg={};Yt(dg,{keyToDidDoc:()=>LU,pubKeyBytesToXY:()=>o_});function LU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=o_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(LU,"keyToDidDoc");function o_(r){if(!xr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=xr.pubKeyBytesToHex(r),t=e.length/2;if(t==96)return xr.publicKeyToXY(e);if(t==97&&e.slice(0,2)=="04"){let n=e.slice(2);return xr.publicKeyToXY(n)}if(t==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ut(e,"base16"),i=u0.ECPointDecompress(n);return xr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(o_,"pubKeyBytesToXY");var pg={};Yt(pg,{keyToDidDoc:()=>BU,pubKeyBytesToXY:()=>s_});function BU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=s_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(BU,"keyToDidDoc");function s_(r){if(!xr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=xr.pubKeyBytesToHex(r);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let t=Ut(e,"base16"),n=l0.ECPointDecompress(t);return xr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(s_,"pubKeyBytesToXY");var UU="application/did+ld+json",a_="application/did+json",FU={231:ag,237:fg,4608:hg,4609:dg,4610:pg};function $U(){return{key:async(r,e,t,n)=>{let i=n.accept||a_,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let f=pi.decode(e.id),u=mg.default.decode(f),d=f.slice(mg.default.decode.bytes),g=await FU[u].keyToDidDoc(d,e.id);i===UU?(g["@context"]="https://w3id.org/did/v1",s.didDocument=g):i===a_?s.didDocument=g:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(f){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=f.toString()}return s}}}o($U,"getResolver");var f_={getResolver:$U};var h0=Bt(vd(),1);var p_=Bt(u_(),1);var qU="base64pad";function l_(r){return JSON.parse((0,p_.default)(r))}o(l_,"toStableObject");function HU(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(HU,"encodeDID");function h_(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(h_,"toGeneralJWS");var d_=o(async(r,e,t,n={})=>{let i=`${e}#${e.split(":")[2]}`,s=pw(t),f=l_(Object.assign(n,{kid:i,alg:"EdDSA"}));return vw(typeof r=="string"?r:l_(r),s,f)},"sign"),zU={did_authenticate:async({did:r,secretKey:e},t)=>{let n=await d_({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return h_(n)},did_createJWS:async({did:r,secretKey:e},t)=>{if(t.did.split("#")[0]!==r)throw new An(4100,`Unknown DID: ${r}`);let i=await d_(t.payload,r,e,t.protected);return{jws:h_(i)}},did_decryptJWE:async({secretKey:r},e)=>{let t=Aw((0,h0.convertSecretKeyToX25519)(r));try{let n=await xw(e.jwe,t);return{cleartext:It(n,qU)}}catch(n){throw new An(-32e3,n.message)}}},hl=class{constructor(e){let{secretKey:t,publicKey:n}=(0,h0.generateKeyPairFromSeed)(e),i=HU(n),s=q4(zU);this._handle=async f=>await s({did:i,secretKey:t},f)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(hl,"Ed25519Provider");var bg={};Yt(bg,{JsonPatchError:()=>mr,_areEquals:()=>ml,applyOperation:()=>sf,applyPatch:()=>y0,applyReducer:()=>WU,deepClone:()=>GU,getValueByPointer:()=>g0,validate:()=>b_,validator:()=>v0});var KU=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)}}(),jU=Object.prototype.hasOwnProperty;function p0(r,e){return jU.call(r,e)}o(p0,"hasOwnProperty");function m0(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)p0(r,i)&&n.push(i);return n}o(m0,"_objectKeys");function Kr(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(Kr,"_deepClone");function b0(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(b0,"isInteger");function So(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(So,"escapePathComponent");function dl(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(dl,"unescapePathComponent");function d0(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(d0(r[e]))return!0}else if(typeof r=="object"){for(var n=m0(r),i=n.length,s=0;s<i;s++)if(d0(r[n[s]]))return!0}}return!1}o(d0,"hasUndefined");function m_(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<"u"&&t.push(n+": "+i)}return t.join(`
819
- `)}o(m_,"patchErrorMessageFormatter");var pl=function(r){KU(e,r);function e(t,n,i,s,f){var u=this.constructor,d=r.call(this,m_(t,{name:n,index:i,operation:s,tree:f}))||this;return d.name=n,d.index=i,d.operation=s,d.tree=f,Object.setPrototypeOf(d,u.prototype),d.message=m_(t,{name:n,index:i,operation:s,tree:f}),d}return o(e,"PatchError"),e}(Error);var mr=pl,GU=Kr,Oc={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=g0(t,this.path);n&&(n=Kr(n));var i=sf(t,{op:"remove",path:this.from}).removed;return sf(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=g0(t,this.from);return sf(t,{op:"add",path:this.path,value:Kr(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:ml(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},VU={add:function(r,e,t){return b0(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:Oc.move,copy:Oc.copy,test:Oc.test,_get:Oc._get};function g0(r,e){if(e=="")return r;var t={op:"_get",path:e};return sf(r,t),t.value}o(g0,"getValueByPointer");function sf(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):v0(e,0)),e.path===""){var f={newDocument:r};if(e.op==="add")return f.newDocument=e.value,f;if(e.op==="replace")return f.newDocument=e.value,f.removed=r,f;if(e.op==="move"||e.op==="copy")return f.newDocument=g0(r,e.from),e.op==="move"&&(f.removed=r),f;if(e.op==="test"){if(f.test=ml(r,e.value),f.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f.newDocument=r,f}else{if(e.op==="remove")return f.removed=r,f.newDocument=null,f;if(e.op==="_get")return e.value=r,f;if(t)throw new mr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return f}}else{n||(r=Kr(r));var u=e.path||"",d=u.split("/"),g=r,y=1,E=d.length,O=void 0,R=void 0,I=void 0;for(typeof t=="function"?I=t:I=v0;;){if(R=d[y],R&&R.indexOf("~")!=-1&&(R=dl(R)),i&&(R=="__proto__"||R=="prototype"&&y>0&&d[y-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&&O===void 0&&(g[R]===void 0?O=d.slice(0,y).join("/"):y==E-1&&(O=e.path),O!==void 0&&I(e,0,r,O)),y++,Array.isArray(g)){if(R==="-")R=g.length;else{if(t&&!b0(R))throw new mr("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);b0(R)&&(R=~~R)}if(y>=E){if(t&&e.op==="add"&&R>g.length)throw new mr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var f=VU[e.op].call(e,g,R,r);if(f.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}}else if(y>=E){var f=Oc[e.op].call(e,g,R,r);if(f.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}if(g=g[R],t&&y<E&&(!g||typeof g!="object"))throw new mr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(sf,"applyOperation");function y0(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new mr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=Kr(r));for(var s=new Array(e.length),f=0,u=e.length;f<u;f++)s[f]=sf(r,e[f],t,!0,i,f),r=s[f].newDocument;return s.newDocument=r,s}o(y0,"applyPatch");function WU(r,e,t){var n=sf(r,e);if(n.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(WU,"applyReducer");function v0(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new mr("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(Oc[r.op]){if(typeof r.path!="string")throw new mr("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new mr('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 mr("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 mr("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")&&d0(r.value))throw new mr("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 mr("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 mr("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 f={op:"_get",path:r.from,value:void 0},u=b_([f],t);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new mr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new mr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(v0,"validator");function b_(r,e,t){try{if(!Array.isArray(r))throw new mr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)y0(Kr(e),Kr(r),t||!0);else{t=t||v0;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof mr)return i;throw i}}o(b_,"validate");function ml(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,f;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!ml(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var u=Object.keys(r);if(s=u.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(u[i]))return!1;for(i=s;i--!==0;)if(f=u[i],!ml(r[f],e[f]))return!1;return!0}return r!==r&&e!==e}o(ml,"_areEquals");var xg={};Yt(xg,{compare:()=>rF,generate:()=>gg,observe:()=>tF,unobserve:()=>eF});var vg=new WeakMap,JU=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),YU=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function XU(r){return vg.get(r)}o(XU,"getMirror");function ZU(r,e){return r.observers.get(e)}o(ZU,"getObserverFromMirror");function QU(r,e){r.observers.delete(e.callback)}o(QU,"removeObserverFromMirror");function eF(r,e){e.unobserve()}o(eF,"unobserve");function tF(r,e){var t=[],n,i=XU(r);if(!i)i=new JU(r),vg.set(r,i);else{var s=ZU(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=Kr(r),e){n.callback=e,n.next=null;var f=o(function(){gg(n)},"dirtyCheck"),u=o(function(){clearTimeout(n.next),n.next=setTimeout(f)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",u),window.addEventListener("keyup",u),window.addEventListener("mousedown",u),window.addEventListener("keydown",u),window.addEventListener("change",u))}return n.patches=t,n.object=r,n.unobserve=function(){gg(n),clearTimeout(n.next),QU(i,n),typeof window<"u"&&(window.removeEventListener("mouseup",u),window.removeEventListener("keyup",u),window.removeEventListener("mousedown",u),window.removeEventListener("keydown",u),window.removeEventListener("change",u))},i.observers.set(e,new YU(e,n)),n}o(tF,"observe");function gg(r,e){e===void 0&&(e=!1);var t=vg.get(r.object);yg(t.value,r.object,r.patches,"",e),r.patches.length&&y0(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(gg,"generate");function yg(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=m0(e),f=m0(r),u=!1,d=!1,g=f.length-1;g>=0;g--){var y=f[g],E=r[y];if(p0(e,y)&&!(e[y]===void 0&&E!==void 0&&Array.isArray(e)===!1)){var O=e[y];typeof E=="object"&&E!=null&&typeof O=="object"&&O!=null&&Array.isArray(E)===Array.isArray(O)?yg(E,O,t,n+"/"+So(y),i):E!==O&&(u=!0,i&&t.push({op:"test",path:n+"/"+So(y),value:Kr(E)}),t.push({op:"replace",path:n+"/"+So(y),value:Kr(O)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+So(y),value:Kr(E)}),t.push({op:"remove",path:n+"/"+So(y)}),d=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),u=!0)}if(!(!d&&s.length==f.length))for(var g=0;g<s.length;g++){var y=s[g];!p0(r,y)&&e[y]!==void 0&&t.push({op:"add",path:n+"/"+So(y),value:Kr(e[y])})}}}o(yg,"_generate");function rF(r,e,t){t===void 0&&(t=!1);var n=[];return yg(r,e,n,"",t),n}o(rF,"compare");var x0=Object.assign({},bg,xg,{JsonPatchError:pl,deepClone:Kr,escapePathComponent:So,unescapePathComponent:dl});var o9=Bt(Uc(),1);var s9=Bt(qa(),1);var wr;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(wr||(wr={}));var r2=Bt(Uc(),1);$i();Vf();var iE={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function I$(r){let e=iE[r];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${r}`)}o(I$,"codeByName");function D$(r){let e=Object.entries(iE).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(D$,"nameByCode");var Tn=class{};o(Tn,"StreamType");Tn.nameByCode=D$;Tn.codeByName=I$;var Hg=Bt(ll(),1);function Vn(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,f)=>{if(f.value!=null)f.value=oE(f.value,e,t,n);else if(f.get!=null)f.get=oE(f.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(Vn,"Memoize");var Pg=new Map;function oE(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let f;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let u=this[i];if(Array.isArray(n))for(let d of n)Pg.has(d)?Pg.get(d).push(u):Pg.set(d,[u]);if(e||s.length>0||t>0){let d;e===!0?d=s.map(E=>E.toString()).join("!"):e?d=e.apply(this,s):d=s[0];let g=`${d}__timestamp`,y=!1;if(t>0)if(!u.has(g))y=!0;else{let E=u.get(g);y=Date.now()-E>t}u.has(d)&&!y?f=u.get(d):(f=r.apply(this,s),u.set(d,f),t>0&&u.set(g,Date.now()))}else{let d=this;u.has(d)?f=u.get(d):(f=r.apply(this,s),u.set(d,f))}return f}}o(oE,"getNewFunction");$i();Vf();Su();var $g=Bt(ll(),1);function Fc(r){try{return r()}catch(e){return e}}o(Fc,"tryCatch");$i();var Lg=Bt(ll(),1);Oa();function uf(r){let e=Lg.default.decode(r),t=Lg.default.decode.bytes,n=r.subarray(t);return[e,n,t]}o(uf,"readVarint");function R$(r){return r===0||r===1}o(R$,"isCidVersion");function Bg(r){let[e,t]=uf(r);if(!R$(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=uf(t),[,s,f]=uf(i),[u,,d]=uf(s),g=i.subarray(0,f+d+u),y=i.subarray(f+d+u);return[Je.create(e,n,Fh(g)),y]}o(Bg,"readCid");$i();Vf();function lf(r,e="StreamRef"){let[t,n]=uf(r);if(t!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,s]=uf(n),f=Bg(s),[u,d]=f;if(d.length===0)return{kind:"stream-id",type:i,genesis:u};if(d.length===1&&d[0]===0)return{kind:"commit-id",type:i,genesis:u,commit:null};{let[g]=Bg(d);return{kind:"commit-id",type:i,genesis:u,commit:g}}}o(lf,"fromBytes");var O$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function $c(r,e="StreamRef"){let t=O$.exec(r)||[],n=t[2];if(!n)throw new Error(`Malformed ${e} string: ${r}`);let i=Fi.decode(n),s=lf(i),f=t[4];return f?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Ug(s.genesis,f)}:s}o($c,"fromString");function N$(r){try{return typeof r=="string"?Je.parse(r):Je.asCID(r)}catch{return null}}o(N$,"parseCID");function Ug(r,e=null){if(!e||e==="0")return null;let t=N$(e);if(t)return r.equals(t)?null:t;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(Ug,"parseCommit");var yl=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ci=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},k0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Fi.encode(e)}: contains commit`)}};o(k0,"InvalidStreamIDBytesError");var I0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(I0,"InvalidStreamIDStringError");function fE(r){let e=lf(r,"StreamID");if(e.kind==="stream-id")return new nt(e.type,e.genesis);throw new k0(r)}o(fE,"fromBytes");function P$(r){return Fc(()=>fE(r))}o(P$,"fromBytesNoThrow");function cE(r){let e=$c(r,"StreamID");if(e.kind==="stream-id")return new nt(e.type,e.genesis);throw new I0(r)}o(cE,"fromString");function L$(r){return Fc(()=>cE(r))}o(L$,"fromStringNoThrow");var aE=Symbol.for("@ceramicnetwork/streamid/StreamID"),nt=class{constructor(e,t){if(this._tag=aE,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?Tn.codeByName(e):e,this._cid=typeof t=="string"?Je.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===aE}static async fromGenesis(e,t){let n=await Va({value:t,codec:Vi,hasher:Ns});return new nt(e,n.cid)}get type(){return this._type}get typeName(){return Tn.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=$g.default.encode(206),t=$g.default.encode(this.type);return Bi([e,t,this.cid.bytes])}get baseID(){return new nt(this._type,this._cid)}equals(e){return nt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Fi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(nt,"StreamID");nt.fromBytes=fE;nt.fromBytesNoThrow=P$;nt.fromString=cE;nt.fromStringNoThrow=L$;yl([Vn(),Ci("design:type",String),Ci("design:paramtypes",[])],nt.prototype,"typeName",null);yl([Vn(),Ci("design:type",Uint8Array),Ci("design:paramtypes",[])],nt.prototype,"bytes",null);yl([Vn(),Ci("design:type",nt),Ci("design:paramtypes",[])],nt.prototype,"baseID",null);yl([Vn(),Ci("design:type",Function),Ci("design:paramtypes",[]),Ci("design:returntype",String)],nt.prototype,"toString",null);yl([Vn(),Ci("design:type",Function),Ci("design:paramtypes",[]),Ci("design:returntype",String)],nt.prototype,"toUrl",null);var Hc=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Cn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},qg=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},hs=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)},qc,hf,xl,D0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Fi.encode(e)}: no commit information provided`)}};o(D0,"InvalidCommitIDBytesError");var R0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(R0,"InvalidCommitIDStringError");function lE(r){let e=lf(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new D0(r)}o(lE,"fromBytes");function B$(r){return Fc(()=>lE(r))}o(B$,"fromBytesNoThrow");function hE(r){let e=$c(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new R0(r)}o(hE,"fromString");function U$(r){return Fc(()=>hE(r))}o(U$,"fromStringNoThrow");var uE=Symbol.for("@ceramicnetwork/streamid/CommitID");function F$(r,e){return new Pt(r.type,r.cid,e)}o(F$,"make");var Pt=class{constructor(e,t,n=null){if(this._tag=uE,qc.set(this,void 0),hf.set(this,void 0),xl.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");qg(this,qc,typeof e=="string"?Tn.codeByName(e):e,"f"),qg(this,hf,typeof t=="string"?Je.parse(t):t,"f"),qg(this,xl,Ug(hs(this,hf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===uE}get baseID(){return new nt(hs(this,qc,"f"),hs(this,hf,"f"))}get type(){return hs(this,qc,"f")}get typeName(){return Tn.nameByCode(hs(this,qc,"f"))}get cid(){return hs(this,hf,"f")}get commit(){return hs(this,xl,"f")||hs(this,hf,"f")}get bytes(){let e=Hg.default.encode(206),t=Hg.default.encode(this.type),n=hs(this,xl,"f")?.bytes||new Uint8Array([0]);return Bi([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 Fi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(qc=new WeakMap,hf=new WeakMap,xl=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=lE;Pt.fromBytesNoThrow=B$;Pt.fromString=hE;Pt.fromStringNoThrow=U$;Pt.make=F$;Hc([Vn(),Cn("design:type",nt),Cn("design:paramtypes",[])],Pt.prototype,"baseID",null);Hc([Vn(),Cn("design:type",String),Cn("design:paramtypes",[])],Pt.prototype,"typeName",null);Hc([Vn(),Cn("design:type",Je),Cn("design:paramtypes",[])],Pt.prototype,"commit",null);Hc([Vn(),Cn("design:type",Uint8Array),Cn("design:paramtypes",[])],Pt.prototype,"bytes",null);Hc([Vn(),Cn("design:type",Function),Cn("design:paramtypes",[]),Cn("design:returntype",String)],Pt.prototype,"toString",null);Hc([Vn(),Cn("design:type",Function),Cn("design:paramtypes",[]),Cn("design:returntype",String)],Pt.prototype,"toUrl",null);Vf();var ln;(function(r){function e(i){let s=lf(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new nt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Fi.encode(i)}`)}}o(e,"fromBytes"),r.fromBytes=e;function t(i){let s=$c(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new nt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(t,"fromString"),r.fromString=t;function n(i){if(nt.isInstance(i)||Pt.isInstance(i))return i;if(i instanceof Uint8Array)return e(i);if(typeof i=="string")return t(i);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(i)}`)}o(n,"from"),r.from=n})(ln||(ln={}));var zg=o(function(r,e){return zg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},zg(r,e)},"extendStatics");function rn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zg(r,e);function t(){this.constructor=r}o(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}o(rn,"__extends");function dE(r,e,t,n){function i(s){return s instanceof t?s:new t(function(f){f(s)})}return o(i,"adopt"),new(t||(t=Promise))(function(s,f){function u(y){try{g(n.next(y))}catch(E){f(E)}}o(u,"fulfilled");function d(y){try{g(n.throw(y))}catch(E){f(E)}}o(d,"rejected");function g(y){y.done?s(y.value):i(y.value).then(u,d)}o(g,"step"),g((n=n.apply(r,e||[])).next())})}o(dE,"__awaiter");function O0(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=u(0),f.throw=u(1),f.return=u(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(g){return function(y){return d([g,y])}}function d(g){if(n)throw new TypeError("Generator is already executing.");for(;f&&(f=0,g[0]&&(t=0)),t;)try{if(n=1,i&&(s=g[0]&2?i.return:g[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,g[1])).done)return s;switch(i=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,i=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){t.label=g[1];break}if(g[0]===6&&t.label<s[1]){t.label=s[1],s=g;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(g);break}s[2]&&t.ops.pop(),t.trys.pop();continue}g=e.call(r,t)}catch(y){g=[6,y],i=0}finally{n=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}o(O0,"__generator");function ds(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(ds,"__values");function Wn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],f;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(u){f={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(f)throw f.error}}return s}o(Wn,"__read");function Zi(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}o(Zi,"__spreadArray");function df(r){return this instanceof df?(this.v=r,this):new df(r)}o(df,"__await");function pE(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",f),i[Symbol.asyncIterator]=function(){return this},i;function f(R){return function(I){return Promise.resolve(I).then(R,E)}}function u(R,I){n[R]&&(i[R]=function(N){return new Promise(function(X,L){s.push([R,N,X,L])>1||d(R,N)})},I&&(i[R]=I(i[R])))}function d(R,I){try{g(n[R](I))}catch(N){O(s[0][3],N)}}function g(R){R.value instanceof df?Promise.resolve(R.value.v).then(y,E):O(s[0][2],R)}function y(R){d("next",R)}function E(R){d("throw",R)}function O(R,I){R(I),s.shift(),s.length&&d(s[0][0],s[0][1])}}o(pE,"__asyncGenerator");function mE(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof ds=="function"?ds(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(f){return new Promise(function(u,d){f=r[s](f),i(u,d,f.done,f.value)})}}function i(s,f,u,d){Promise.resolve(d).then(function(g){s({value:g,done:u})},f)}}o(mE,"__asyncValues");function St(r){return typeof r=="function"}o(St,"isFunction");function zc(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(zc,"createErrorClass");var N0=zc(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
818
+ `;function Wb(r){return typeof r=="string"&&(r=ul(r)),Ic(zb([ul(x8),ul(String(r.length)),r]))}o(Wb,"hashMessage");var xt=Bt(jb()),Eo=Bt(Ou());function Rc(r,e,t){return t={path:e,exports:{},require:function(n,i){return YB(n,i??t.path)}},r(t,t.exports),t.exports}o(Rc,"createCommonjsModule");function YB(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(YB,"commonjsRequire");var Zb=_8;function _8(r,e){if(!r)throw new Error(e||"Assertion failed")}o(_8,"assert");_8.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Xi=Rc(function(r,e){"use strict";var t=e;function n(f,u){if(Array.isArray(f))return f.slice();if(!f)return[];var d=[];if(typeof f!="string"){for(var g=0;g<f.length;g++)d[g]=f[g]|0;return d}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var g=0;g<f.length;g+=2)d.push(parseInt(f[g]+f[g+1],16))}else for(var g=0;g<f.length;g++){var y=f.charCodeAt(g),E=y>>8,O=y&255;E?d.push(E,O):d.push(O)}return d}o(n,"toArray"),t.toArray=n;function i(f){return f.length===1?"0"+f:f}o(i,"zero2"),t.zero2=i;function s(f){for(var u="",d=0;d<f.length;d++)u+=i(f[d].toString(16));return u}o(s,"toHex"),t.toHex=s,t.encode=o(function(u,d){return d==="hex"?s(u):u},"encode")}),Gn=Rc(function(r,e){"use strict";var t=e;t.assert=Zb,t.toArray=Xi.toArray,t.zero2=Xi.zero2,t.toHex=Xi.toHex,t.encode=Xi.encode;function n(d,g,y){var E=new Array(Math.max(d.bitLength(),y)+1);E.fill(0);for(var O=1<<g+1,R=d.clone(),I=0;I<E.length;I++){var P,X=R.andln(O-1);R.isOdd()?(X>(O>>1)-1?P=(O>>1)-X:P=X,R.isubn(P)):P=0,E[I]=P,R.iushrn(1)}return E}o(n,"getNAF"),t.getNAF=n;function i(d,g){var y=[[],[]];d=d.clone(),g=g.clone();for(var E=0,O=0,R;d.cmpn(-E)>0||g.cmpn(-O)>0;){var I=d.andln(3)+E&3,P=g.andln(3)+O&3;I===3&&(I=-1),P===3&&(P=-1);var X;(I&1)===0?X=0:(R=d.andln(7)+E&7,(R===3||R===5)&&P===2?X=-I:X=I),y[0].push(X);var B;(P&1)===0?B=0:(R=g.andln(7)+O&7,(R===3||R===5)&&I===2?B=-P:B=P),y[1].push(B),2*E===X+1&&(E=1-E),2*O===B+1&&(O=1-O),d.iushrn(1),g.iushrn(1)}return y}o(i,"getJSF"),t.getJSF=i;function s(d,g,y){var E="_"+g;d.prototype[g]=o(function(){return this[E]!==void 0?this[E]:this[E]=y.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function f(d){return typeof d=="string"?t.toArray(d,"hex"):d}o(f,"parseBytes"),t.parseBytes=f;function u(d){return new xt.default(d,"hex","le")}o(u,"intFromLE"),t.intFromLE=u}),r0=Gn.getNAF,XB=Gn.getJSF,n0=Gn.assert;function ta(r,e){this.type=r,this.p=new xt.default(e.p,16),this.red=e.prime?xt.default.red(e.prime):xt.default.mont(this.p),this.zero=new xt.default(0).toRed(this.red),this.one=new xt.default(1).toRed(this.red),this.two=new xt.default(2).toRed(this.red),this.n=e.n&&new xt.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(ta,"BaseCurve");var nf=ta;ta.prototype.point=o(function(){throw new Error("Not implemented")},"point");ta.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");ta.prototype._fixedNafMul=o(function(e,t){n0(e.precomputed);var n=e._getDoubles(),i=r0(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var g=u+n.step-1;g>=u;g--)d=(d<<1)+i[g];f.push(d)}for(var y=this.jpoint(null,null,null),E=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?E=E.mixedAdd(n.points[u]):d===-O&&(E=E.mixedAdd(n.points[u].neg()));y=y.add(E)}return y.toP()},"_fixedNafMul");ta.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=r0(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var g=0;d>=0&&f[d]===0;d--)g++;if(d>=0&&g++,u=u.dblp(g),d<0)break;var y=f[d];n0(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(s[y-1>>1]):u=u.mixedAdd(s[-y-1>>1].neg()):y>0?u=u.add(s[y-1>>1]):u=u.add(s[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");ta.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,g=0,y,E,O;for(y=0;y<i;y++){O=t[y];var R=O._getNAFPoints(e);f[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,P=y;if(f[I]!==1||f[P]!==1){d[I]=r0(n[I],f[I],this._bitLength),d[P]=r0(n[P],f[P],this._bitLength),g=Math.max(d[I].length,g),g=Math.max(d[P].length,g);continue}var X=[t[I],null,null,t[P]];t[I].y.cmp(t[P].y)===0?(X[1]=t[I].add(t[P]),X[2]=t[I].toJ().mixedAdd(t[P].neg())):t[I].y.cmp(t[P].y.redNeg())===0?(X[1]=t[I].toJ().mixedAdd(t[P]),X[2]=t[I].add(t[P].neg())):(X[1]=t[I].toJ().mixedAdd(t[P]),X[2]=t[I].toJ().mixedAdd(t[P].neg()));var B=[-3,-1,-5,-7,0,7,5,1,3],J=XB(n[I],n[P]);for(g=Math.max(J[0].length,g),d[I]=new Array(g),d[P]=new Array(g),E=0;E<g;E++){var ee=J[0][E]|0,Y=J[1][E]|0;d[I][E]=B[(ee+1)*3+(Y+1)],d[P][E]=0,u[I]=X}}var ie=this.jpoint(null,null,null),G=this._wnafT4;for(y=g;y>=0;y--){for(var $=0;y>=0;){var K=!0;for(E=0;E<i;E++)G[E]=d[E][y]|0,G[E]!==0&&(K=!1);if(!K)break;$++,y--}if(y>=0&&$++,ie=ie.dblp($),y<0)break;for(E=0;E<i;E++){var he=G[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ie=ie.mixedAdd(O):ie=ie.add(O))}}for(y=0;y<i;y++)u[y]=null;return s?ie:ie.toP()},"_wnafMulAdd");function Mi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(Mi,"BasePoint");ta.BasePoint=Mi;Mi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");Mi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");ta.prototype.decodePoint=o(function(e,t){e=Gn.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?n0(e[e.length-1]%2===0):e[0]===7&&n0(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");Mi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");Mi.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");Mi.prototype.encode=o(function(e,t){return Gn.encode(this._encode(t),e)},"encode");Mi.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");Mi.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");Mi.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");Mi.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");Mi.prototype._getBeta=o(function(){return null},"_getBeta");Mi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var Qb=Rc(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")}),ZB=Gn.assert;function Ti(r){nf.call(this,"short",r),this.a=new xt.default(r.a,16).toRed(this.red),this.b=new xt.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(Ti,"ShortCurve");Qb(Ti,nf);var QB=Ti;Ti.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 xt.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 xt.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],ZB(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new xt.default(u.a,16),b:new xt.default(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");Ti.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:xt.default.mont(e),n=new xt.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new xt.default(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");Ti.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 xt.default(1),f=new xt.default(0),u=new xt.default(0),d=new xt.default(1),g,y,E,O,R,I,P,X=0,B,J;n.cmpn(0)!==0;){var ee=i.div(n);B=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Y=d.sub(ee.mul(f));if(!E&&B.cmp(t)<0)g=P.neg(),y=s,E=B.neg(),O=J;else if(E&&++X===2)break;P=B,i=n,n=B,u=s,s=J,d=f,f=Y}R=B.neg(),I=J;var ie=E.sqr().add(O.sqr()),G=R.sqr().add(I.sqr());return G.cmp(ie)>=0&&(R=g,I=y),E.negative&&(E=E.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:E,b:O},{a:R,b:I}]},"_getEndoBasis");Ti.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),g=s.mul(n.b),y=f.mul(i.b),E=e.sub(u).sub(d),O=g.add(y).neg();return{k1:E,k2:O}},"_endoSplit");Ti.prototype.pointFromX=o(function(e,t){e=new xt.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");Ti.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");Ti.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],g=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),g=g.neg(!0)),i[f*2]=d,i[f*2+1]=g,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return y},"_endoWnafMulAdd");function Nr(r,e,t,n){nf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new xt.default(e,16),this.y=new xt.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(Nr,"Point");Qb(Nr,nf.BasePoint);Ti.prototype.point=o(function(e,t,n){return new Nr(this,e,t,n)},"point");Ti.prototype.pointFromJSON=o(function(e,t){return Nr.fromJSON(this,e,t)},"pointFromJSON");Nr.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");Nr.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");Nr.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Nr.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");Nr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Nr.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");Nr.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Nr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Nr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Nr.prototype.mul=o(function(e){return e=new xt.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");Nr.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");Nr.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");Nr.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");Nr.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");Nr.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 zr(r,e,t,n){nf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new xt.default(0)):(this.x=new xt.default(e,16),this.y=new xt.default(t,16),this.z=new xt.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(zr,"JPoint");Qb(zr,nf.BasePoint);Ti.prototype.jpoint=o(function(e,t,n){return new zr(this,e,t,n)},"jpoint");zr.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");zr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");zr.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),g=f.redSub(u);if(d.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),E=y.redMul(d),O=i.redMul(y),R=g.redSqr().redIAdd(E).redISub(O).redISub(O),I=g.redMul(O.redISub(R)).redISub(f.redMul(E)),P=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,P)},"add");zr.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=u.redSqr(),y=g.redMul(u),E=n.redMul(g),O=d.redSqr().redIAdd(y).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");zr.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,f=this.x,u=this.y,d=this.z,g=d.redSqr().redSqr(),y=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=y.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(g)),P=f.redMul(O),X=I.redSqr().redISub(P.redAdd(P)),B=P.redISub(X),J=I.redMul(B);J=J.redIAdd(J).redISub(R);var ee=y.redMul(d);t+1<e&&(g=g.redMul(R)),f=X,d=ee,y=J}return this.curve.jpoint(f,y.redMul(s),d)},"dblp");zr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");zr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),g=d.redSqr().redISub(u).redISub(u),y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),e=g,t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(E).redISub(R);I=I.redIAdd(I);var P=E.redAdd(E).redIAdd(E),X=P.redSqr(),B=R.redIAdd(R);B=B.redIAdd(B),B=B.redIAdd(B),e=X.redISub(I).redISub(I),t=P.redMul(I.redISub(e)).redISub(B),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");zr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=d.redSqr().redISub(u).redISub(u);e=g;var y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),t=d.redMul(u.redISub(g)).redISub(y),n=this.y.redAdd(this.y)}else{var E=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(E).redMul(this.x.redAdd(E));I=I.redAdd(I).redIAdd(I);var P=R.redIAdd(R);P=P.redIAdd(P);var X=P.redAdd(P);e=I.redSqr().redISub(X),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var B=O.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B),t=I.redMul(P.redISub(e)).redISub(B)}return this.curve.jpoint(e,t,n)},"_threeDbl");zr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),g=t.redAdd(t);g=g.redIAdd(g);var y=g.redMul(u),E=d.redSqr().redISub(y.redAdd(y)),O=y.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),P=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,P)},"_dbl");zr.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(g),E=t.redMul(y);E=E.redIAdd(E),E=E.redIAdd(E);var O=this.x.redMul(d).redISub(E);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(g.redISub(y)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");zr.prototype.mul=o(function(e,t){return e=new xt.default(e,t),this.curve._wnafMul(this,e)},"mul");zr.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");zr.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");zr.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");zr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var e0=Rc(function(r,e){"use strict";var t=e;t.base=nf,t.short=QB,t.mont=null,t.edwards=null}),t0=Rc(function(r,e){"use strict";var t=e,n=Gn.assert;function i(u){u.type==="short"?this.curve=new e0.short(u):u.type==="edwards"?this.curve=new e0.edwards(u):this.curve=new e0.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.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(u,d){Object.defineProperty(t,u,{configurable:!0,enumerable:!0,get:function(){var g=new i(d);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:g}),g}})}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:Eo.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:Eo.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:Eo.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:Eo.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:Eo.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:Eo.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:Eo.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=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:Eo.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function ea(r){if(!(this instanceof ea))return new ea(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=Xi.toArray(r.entropy,r.entropyEnc||"hex"),t=Xi.toArray(r.nonce,r.nonceEnc||"hex"),n=Xi.toArray(r.pers,r.persEnc||"hex");Zb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ea,"HmacDRBG");var E8=ea;ea.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");ea.prototype._hmac=o(function(){return new Eo.default.hmac(this.hash,this.K)},"hmac");ea.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");ea.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Xi.toArray(e,t),n=Xi.toArray(n,i),Zb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");ea.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=Xi.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 f=s.slice(0,e);return this._update(n),this._reseed++,Xi.encode(f,t)},"generate");var Xb=Gn.assert;function tn(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(tn,"KeyPair");var eg=tn;tn.fromPublic=o(function(e,t,n){return t instanceof tn?t:new tn(e,{pub:t,pubEnc:n})},"fromPublic");tn.fromPrivate=o(function(e,t,n){return t instanceof tn?t:new tn(e,{priv:t,privEnc:n})},"fromPrivate");tn.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");tn.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");tn.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");tn.prototype._importPrivate=o(function(e,t){this.priv=new xt.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");tn.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?Xb(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Xb(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");tn.prototype.derive=o(function(e){return e.validate()||Xb(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");tn.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");tn.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");tn.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var eU=Gn.assert;function i0(r,e){if(r instanceof i0)return r;this._importDER(r,e)||(eU(r.r&&r.s,"Signature without r or s"),this.r=new xt.default(r.r,16),this.s=new xt.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(i0,"Signature");var o0=i0;function tU(){this.place=0}o(tU,"Position");function Jb(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,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(Jb,"getLength");function w8(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(w8,"rmPadding");i0.prototype._importDER=o(function(e,t){e=Gn.toArray(e,t);var n=new tU;if(e[n.place++]!==48)return!1;var i=Jb(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Jb(e,n);if(s===!1)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=Jb(e,n);if(u===!1||e.length!==u+n.place)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new xt.default(f),this.s=new xt.default(d),this.recoveryParam=null,!0},"_importDER");function Yb(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(Yb,"constructLength");i0.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=w8(t),n=w8(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Yb(i,t.length),i=i.concat(t),i.push(2),Yb(i,n.length);var s=i.concat(n),f=[48];return Yb(f,s.length),f=f.concat(s),Gn.encode(f,e)},"toDER");var rU=o(function(){throw new Error("unsupported")},"rand"),A8=Gn.assert;function Si(r){if(!(this instanceof Si))return new Si(r);typeof r=="string"&&(A8(Object.prototype.hasOwnProperty.call(t0,r),"Unknown curve "+r),r=t0[r]),r instanceof t0.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(Si,"EC");var nU=Si;Si.prototype.keyPair=o(function(e){return new eg(this,e)},"keyPair");Si.prototype.keyFromPrivate=o(function(e,t){return eg.fromPrivate(this,e,t)},"keyFromPrivate");Si.prototype.keyFromPublic=o(function(e,t){return eg.fromPublic(this,e,t)},"keyFromPublic");Si.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new E8({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||rU(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new xt.default(2));;){var s=new xt.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");Si.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");Si.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 xt.default(e,16));for(var s=this.n.byteLength(),f=t.getPrivate().toArray("be",s),u=e.toArray("be",s),d=new E8({hash:this.hash,entropy:f,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new xt.default(1)),y=0;;y++){var E=i.k?i.k(y):new xt.default(d.generate(this.n.byteLength()));if(E=this._truncateToN(E,!0),!(E.cmpn(1)<=0||E.cmp(g)>=0)){var O=this.g.mul(E);if(!O.isInfinity()){var R=O.getX(),I=R.umod(this.n);if(I.cmpn(0)!==0){var P=E.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var X=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),X^=1),new o0({r:I,s:P,recoveryParam:X})}}}}}},"sign");Si.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new xt.default(e,16)),n=this.keyFromPublic(n,i),t=new o0(t,"hex");var s=t.r,f=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var u=f.invm(this.n),d=u.mul(e).umod(this.n),g=u.mul(s).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.eqXToP(s)):(y=this.g.mulAdd(d,n.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(s)===0)},"verify");Si.prototype.recoverPubKey=function(r,e,t,n){A8((3&t)===t,"The recovery param is more than two bits"),e=new o0(e,n);var i=this.n,s=new xt.default(r),f=e.r,u=e.s,d=t&1,g=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var y=e.r.invm(i),E=i.sub(s).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(E,f,O)};Si.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new o0(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var iU=Rc(function(r,e){"use strict";var t=e;t.version="6.5.4",t.utils=Gn,t.rand=function(){throw new Error("unsupported")},t.curve=e0,t.curves=t0,t.ec=nU,t.eddsa=null}),S8=iU.ec;var M8="signing-key/5.7.0";var rg=new At(M8),tg=null;function Ao(){return tg||(tg=new S8("secp256k1")),tg}o(Ao,"getCurve");var s0=class{constructor(e){Dc(this,"curve","secp256k1"),Dc(this,"privateKey",en(e)),Xd(this.privateKey)!==32&&rg.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Ao().keyFromPrivate(ar(this.privateKey));Dc(this,"publicKey","0x"+t.getPublic(!1,"hex")),Dc(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Dc(this,"_isSigningKey",!0)}_addPoint(e){let t=Ao().keyFromPublic(ar(this.publicKey)),n=Ao().keyFromPublic(ar(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=Ao().keyFromPrivate(ar(this.privateKey)),n=ar(e);n.length!==32&&rg.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return Qd({recoveryParam:i.recoveryParam,r:Qs("0x"+i.r.toString(16),32),s:Qs("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=Ao().keyFromPrivate(ar(this.privateKey)),n=Ao().keyFromPublic(ar(ng(e)));return Qs("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(s0,"SigningKey");function T8(r,e){let t=Qd(e),n={r:ar(t.r),s:ar(t.s)};return"0x"+Ao().recoverPubKey(ar(r),n,t.recoveryParam).encode("hex",!1)}o(T8,"recoverPublicKey");function ng(r,e){let t=ar(r);if(t.length===32){let n=new s0(t);return e?"0x"+Ao().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?en(t):"0x"+Ao().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+Ao().keyFromPublic(t).getPublic(!0,"hex"):en(t)}return rg.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(ng,"computePublicKey");var C8="transactions/5.7.0";var GJ=new At(C8),k8;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(k8||(k8={}));function I8(r){let e=ng(r);return m8(Zd(Ic(Zd(e,1)),12))}o(I8,"computeAddress");function D8(r,e){return I8(T8(ar(r),e))}o(D8,"recoverAddress");var R8="wallet/5.7.0";var tY=new At(R8);function ig(r,e){return D8(Wb(r),e)}o(ig,"verifyMessage");function O8(){return{eip191:async(r,e)=>{sU(r,e)}}}o(O8,"getEIP191Verifier");var oU=new Date("2022-09-20").valueOf();function sU(r,e){Ub(r),X5(r,e);let n=[ig(Cc.fromCacao(r).toMessage(),r.s.s).toLowerCase()];if(Date.parse(r.p.iat)<=oU){let s=ig(Y5(Cc.fromCacao(r),"Ethereum"),r.s.s).toLowerCase();n.push(s)}let i=Zs.parse(r.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(sU,"verifyEIP191Signature");Yf();jh();var N8=Bt(qa(),1);Yf();function P8(){return It((0,N8.randomBytes)(16),"base64")}o(P8,"randomString");var L8="base64pad",B8="base64url";function U8(r){return It(r,L8)}o(U8,"encodeBase64");function F8(r){return It(r,B8)}o(F8,"encodeBase64Url");function $8(r){return Ut(r,L8)}o($8,"decodeBase64");function a0(r){return JSON.parse(It(Ut(r,B8)))}o(a0,"base64urlToJSON");function q8(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(q8,"fromDagJWS");function H8(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(H8,"didWithTime");function z8(r){return r?Array.isArray(r)?r:[r]:[]}o(z8,"extractControllers");var aU={...O8()};function fU(r){return"registry"in r&&"cache"in r}o(fU,"isResolver");var of=class{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){return new of({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new yc(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=fU(e)?e:new yu(e,t)}async authenticate({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=P8(),s=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:f}=await this.verifyJWS(s),u=a0(s.payload);if(!f.includes(u.did))throw new Error("Invalid authencation response, kid mismatch");if(u.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(u.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(u.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=u.did,this._id}async createJWS(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 i=this._capability.p.exp;if(i&&Date.parse(i)<Date.now())throw new Error("Capability is expired, cannot create a valid signature");let s=await al.fromCacao(this._capability),f=Je.asCID(s.cid);if(!f)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://${f?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...t,payload:e});return n}async createDagJWS(e,t={}){let{cid:n,linkedBlock:i}=await R4(e),s=F8(n.bytes);Object.assign(t,{linkedBlock:U8(i)});let f=await this.createJWS(s,t),u=Je.asCID(n);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 d=await al.fromCacao(this._capability);return{jws:f,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:f,linkedBlock:i}}async verifyJWS(e,t={}){t=Object.assign({verifiers:aU},t),typeof e!="string"&&(e=q8(e));let n=a0(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!t.disableTimecheck){let g=i.didDocumentMetadata?.nextUpdate;if(g){let E=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,O=new Date(g).valueOf()+E;if(!(t.atTime&&t.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let y=i.didDocumentMetadata?.updated;if(y&&t.atTime&&t.atTime.getTime()<new Date(y).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let f=i.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&f===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await sl.verify(t.capability,{disableExpirationCheck:t.disableTimecheck,atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}})}else if(t.issuer&&t.issuer!==f){let g=H8(t.issuer,t.atTime),E=(await this.resolve(g)).didDocument?.controller,O=z8(E);if(t.capability?.s&&t.capability.p.aud===f&&O.includes(t.capability.p.iss))await sl.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(f?O.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];yw(e,u);let d;try{d=a0(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,t,n={}){let i=await _w(t,this._resolver);return ww(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,t,n={}){let i=await O4(e);return this.createJWE(i,t,n)}async decryptJWE(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:n}=await this._client.request("did_decryptJWE",{did:this._id,...t,jwe:e});return $8(n)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return N4(t)}async resolve(e){let t=await 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}constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new yc(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)}};o(of,"DID");function K8(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(K8,"toUint8Array");var mg=Bt(ll(),1);Ph();var ag={};Yt(ag,{keyToDidDoc:()=>_U});function _U(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:It(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(_U,"keyToDidDoc");var fg={};Yt(fg,{keyToDidDoc:()=>AU});Yf();var e_=Bt(vd(),1);function EU(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${It(e,"base58btc")}`}o(EU,"encodeKey");function AU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=(0,e_.convertPublicKeyToX25519)(r),s=`${t}#${EU(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:It(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:It(i,"base58btc")}]}}o(AU,"keyToDidDoc");var hg={};Yt(hg,{keyToDidDoc:()=>PU,pubKeyBytesToXY:()=>i_});var c0={};Yt(c0,{ECPointDecompress:()=>RU});function SU(r){return r>=0?r:-r}o(SU,"n");function MU(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),r<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let t=0n,n=1n,i=1n,s=0n;for(;r!==0n;){let f=e/r,u=e%r,d=t-i*f,g=n-s*f;e=r,r=u,t=i,n=s,i=d,s=g}return{g:e,x:t,y:n}}o(MU,"r");function f0(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let t=r%e;return t<0n?t+e:t}o(f0,"e");function t_(r,e){let t=MU(f0(r,e),e);if(t.g!==1n)throw new RangeError(`${r.toString()} does not have inverse modulo ${e.toString()}`);return f0(t.x,e)}o(t_,"o");function TU(r,e,t){if(r.length!==e.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=t??e.reduce((i,s)=>i*s,1n);return e.reduce((i,s,f)=>{let u=n/s;return f0(i+u*t_(u,s)%n*r[f]%n,n)},0n)}o(TU,"i");function CU(r){return r.map(e=>e[0]**(e[1]-1n)*(e[0]-1n)).reduce((e,t)=>t*e,1n)}o(CU,"a");function ra(r,e,t,n){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");if(t===1n)return 0n;if(r=f0(r,t),e<0n)return t_(ra(r,SU(e),t,n),t);if(n!==void 0)return function(s,f,u,d){let g=d.map(O=>O[0]**O[1]),y=d.map(O=>CU([O])),E=y.map((O,R)=>ra(s,f%O,g[R]));return TU(E,g,u)}(r,e,t,function(s){let f={};return s.forEach(u=>{if(typeof u=="bigint"||typeof u=="number"){let d=String(u);f[d]===void 0?f[d]={p:BigInt(u),k:1n}:f[d].k+=1n}else{let d=String(u[0]);f[d]===void 0?f[d]={p:BigInt(u[0]),k:BigInt(u[1])}:f[d].k+=BigInt(u[1])}}),Object.values(f).map(u=>[u.p,u.k])}(n));let i=1n;for(;e>0;)e%2n===1n&&(i=i*r%t),e/=2n,r=r**2n%t;return i}o(ra,"s");var xr={};Yt(xr,{pubKeyBytesToHex:()=>kU,publicKeyHexToUint8ArrayPointPair:()=>r_,publicKeyIntToUint8ArrayPointPair:()=>n_,publicKeyIntToXY:()=>DU,publicKeyToXY:()=>IU,testHexString:()=>ug,testUint8Array:()=>na});Lh();function kU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");return It(r,"base16")}o(kU,"pubKeyBytesToHex");function IU(r){if(!ug(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=r_(r),t=Da.encode(e.xOctet).slice(1),n=Da.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(IU,"publicKeyToXY");function r_(r){if(!ug(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=r.slice(0,r.length/2),t=r.slice(r.length/2,r.length),n=Ut(e,"base16"),i=Ut(t,"base16");return{xOctet:n,yOctet:i}}o(r_,"publicKeyHexToUint8ArrayPointPair");function ug(r){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(r)!==null&&e.test(r)&&typeof r=="string")}o(ug,"testHexString");function na(r){return r==null?!1:r.constructor===Uint8Array}o(na,"testUint8Array");function DU(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=n_(r),t=Da.encode(e.xOctet).slice(1),n=Da.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(DU,"publicKeyIntToXY");function n_(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=r.x.toString(),t=r.y.toString(),n=Ut(e,"base10"),i=Ut(t,"base10");return{xOctet:n,yOctet:i}}o(n_,"publicKeyIntToUint8ArrayPointPair");function RU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(It(f,"base10")),d=u**3n-u*3n+n,g=ra(d,i,t);return g%2n!==s&&(g=t-g),{x:u,y:g}}o(RU,"ECPointDecompress");var u0={};Yt(u0,{ECPointDecompress:()=>OU});function OU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(It(f,"base10")),d=u**3n-u*3n+n,g=ra(d,i,t);return g%2n!==s&&(g=t-g),{x:u,y:g}}o(OU,"ECPointDecompress");var l0={};Yt(l0,{ECPointDecompress:()=>NU});function NU(r){if(!na(r))throw new TypeError("input must be a Uint8Array");let t=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(It(f,"base10")),d=u**3n-u*3n+n,g=ra(d,i,t);return g%2n!==s&&(g=t-g),{x:u,y:g}}o(NU,"ECPointDecompress");function PU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=i_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(PU,"keyToDidDoc");function i_(r){if(!xr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=xr.pubKeyBytesToHex(r),t=e.length/2;if(t==64)return xr.publicKeyToXY(e);if(t==65&&e.slice(0,2)=="04"){let n=e.slice(2);return xr.publicKeyToXY(n)}if(t==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ut(e,"base16"),i=c0.ECPointDecompress(n);return xr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(i_,"pubKeyBytesToXY");var dg={};Yt(dg,{keyToDidDoc:()=>LU,pubKeyBytesToXY:()=>o_});function LU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=o_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(LU,"keyToDidDoc");function o_(r){if(!xr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=xr.pubKeyBytesToHex(r),t=e.length/2;if(t==96)return xr.publicKeyToXY(e);if(t==97&&e.slice(0,2)=="04"){let n=e.slice(2);return xr.publicKeyToXY(n)}if(t==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ut(e,"base16"),i=u0.ECPointDecompress(n);return xr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(o_,"pubKeyBytesToXY");var pg={};Yt(pg,{keyToDidDoc:()=>BU,pubKeyBytesToXY:()=>s_});function BU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=s_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(BU,"keyToDidDoc");function s_(r){if(!xr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=xr.pubKeyBytesToHex(r);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let t=Ut(e,"base16"),n=l0.ECPointDecompress(t);return xr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(s_,"pubKeyBytesToXY");var UU="application/did+ld+json",a_="application/did+json",FU={231:ag,237:fg,4608:hg,4609:dg,4610:pg};function $U(){return{key:async(r,e,t,n)=>{let i=n.accept||a_,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let f=pi.decode(e.id),u=mg.default.decode(f),d=f.slice(mg.default.decode.bytes),g=await FU[u].keyToDidDoc(d,e.id);i===UU?(g["@context"]="https://w3id.org/did/v1",s.didDocument=g):i===a_?s.didDocument=g:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(f){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=f.toString()}return s}}}o($U,"getResolver");var f_={getResolver:$U};var h0=Bt(vd(),1);var p_=Bt(u_(),1);var qU="base64pad";function l_(r){return JSON.parse((0,p_.default)(r))}o(l_,"toStableObject");function HU(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(HU,"encodeDID");function h_(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(h_,"toGeneralJWS");var d_=o(async(r,e,t,n={})=>{let i=`${e}#${e.split(":")[2]}`,s=pw(t),f=l_(Object.assign(n,{kid:i,alg:"EdDSA"}));return vw(typeof r=="string"?r:l_(r),s,f)},"sign"),zU={did_authenticate:async({did:r,secretKey:e},t)=>{let n=await d_({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return h_(n)},did_createJWS:async({did:r,secretKey:e},t)=>{if(t.did.split("#")[0]!==r)throw new An(4100,`Unknown DID: ${r}`);let i=await d_(t.payload,r,e,t.protected);return{jws:h_(i)}},did_decryptJWE:async({secretKey:r},e)=>{let t=Aw((0,h0.convertSecretKeyToX25519)(r));try{let n=await xw(e.jwe,t);return{cleartext:It(n,qU)}}catch(n){throw new An(-32e3,n.message)}}},hl=class{constructor(e){let{secretKey:t,publicKey:n}=(0,h0.generateKeyPairFromSeed)(e),i=HU(n),s=q4(zU);this._handle=async f=>await s({did:i,secretKey:t},f)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(hl,"Ed25519Provider");var bg={};Yt(bg,{JsonPatchError:()=>mr,_areEquals:()=>ml,applyOperation:()=>sf,applyPatch:()=>y0,applyReducer:()=>WU,deepClone:()=>GU,getValueByPointer:()=>g0,validate:()=>b_,validator:()=>v0});var KU=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)}}(),jU=Object.prototype.hasOwnProperty;function p0(r,e){return jU.call(r,e)}o(p0,"hasOwnProperty");function m0(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)p0(r,i)&&n.push(i);return n}o(m0,"_objectKeys");function Kr(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(Kr,"_deepClone");function b0(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(b0,"isInteger");function So(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(So,"escapePathComponent");function dl(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(dl,"unescapePathComponent");function d0(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(d0(r[e]))return!0}else if(typeof r=="object"){for(var n=m0(r),i=n.length,s=0;s<i;s++)if(d0(r[n[s]]))return!0}}return!1}o(d0,"hasUndefined");function m_(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<"u"&&t.push(n+": "+i)}return t.join(`
819
+ `)}o(m_,"patchErrorMessageFormatter");var pl=function(r){KU(e,r);function e(t,n,i,s,f){var u=this.constructor,d=r.call(this,m_(t,{name:n,index:i,operation:s,tree:f}))||this;return d.name=n,d.index=i,d.operation=s,d.tree=f,Object.setPrototypeOf(d,u.prototype),d.message=m_(t,{name:n,index:i,operation:s,tree:f}),d}return o(e,"PatchError"),e}(Error);var mr=pl,GU=Kr,Oc={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=g0(t,this.path);n&&(n=Kr(n));var i=sf(t,{op:"remove",path:this.from}).removed;return sf(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=g0(t,this.from);return sf(t,{op:"add",path:this.path,value:Kr(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:ml(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},VU={add:function(r,e,t){return b0(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:Oc.move,copy:Oc.copy,test:Oc.test,_get:Oc._get};function g0(r,e){if(e=="")return r;var t={op:"_get",path:e};return sf(r,t),t.value}o(g0,"getValueByPointer");function sf(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):v0(e,0)),e.path===""){var f={newDocument:r};if(e.op==="add")return f.newDocument=e.value,f;if(e.op==="replace")return f.newDocument=e.value,f.removed=r,f;if(e.op==="move"||e.op==="copy")return f.newDocument=g0(r,e.from),e.op==="move"&&(f.removed=r),f;if(e.op==="test"){if(f.test=ml(r,e.value),f.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f.newDocument=r,f}else{if(e.op==="remove")return f.removed=r,f.newDocument=null,f;if(e.op==="_get")return e.value=r,f;if(t)throw new mr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return f}}else{n||(r=Kr(r));var u=e.path||"",d=u.split("/"),g=r,y=1,E=d.length,O=void 0,R=void 0,I=void 0;for(typeof t=="function"?I=t:I=v0;;){if(R=d[y],R&&R.indexOf("~")!=-1&&(R=dl(R)),i&&(R=="__proto__"||R=="prototype"&&y>0&&d[y-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&&O===void 0&&(g[R]===void 0?O=d.slice(0,y).join("/"):y==E-1&&(O=e.path),O!==void 0&&I(e,0,r,O)),y++,Array.isArray(g)){if(R==="-")R=g.length;else{if(t&&!b0(R))throw new mr("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);b0(R)&&(R=~~R)}if(y>=E){if(t&&e.op==="add"&&R>g.length)throw new mr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var f=VU[e.op].call(e,g,R,r);if(f.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}}else if(y>=E){var f=Oc[e.op].call(e,g,R,r);if(f.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}if(g=g[R],t&&y<E&&(!g||typeof g!="object"))throw new mr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(sf,"applyOperation");function y0(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new mr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=Kr(r));for(var s=new Array(e.length),f=0,u=e.length;f<u;f++)s[f]=sf(r,e[f],t,!0,i,f),r=s[f].newDocument;return s.newDocument=r,s}o(y0,"applyPatch");function WU(r,e,t){var n=sf(r,e);if(n.test===!1)throw new mr("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(WU,"applyReducer");function v0(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new mr("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(Oc[r.op]){if(typeof r.path!="string")throw new mr("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new mr('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 mr("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 mr("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")&&d0(r.value))throw new mr("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 mr("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 mr("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 f={op:"_get",path:r.from,value:void 0},u=b_([f],t);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new mr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new mr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(v0,"validator");function b_(r,e,t){try{if(!Array.isArray(r))throw new mr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)y0(Kr(e),Kr(r),t||!0);else{t=t||v0;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof mr)return i;throw i}}o(b_,"validate");function ml(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,f;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!ml(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var u=Object.keys(r);if(s=u.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(u[i]))return!1;for(i=s;i--!==0;)if(f=u[i],!ml(r[f],e[f]))return!1;return!0}return r!==r&&e!==e}o(ml,"_areEquals");var xg={};Yt(xg,{compare:()=>rF,generate:()=>gg,observe:()=>tF,unobserve:()=>eF});var vg=new WeakMap,JU=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),YU=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function XU(r){return vg.get(r)}o(XU,"getMirror");function ZU(r,e){return r.observers.get(e)}o(ZU,"getObserverFromMirror");function QU(r,e){r.observers.delete(e.callback)}o(QU,"removeObserverFromMirror");function eF(r,e){e.unobserve()}o(eF,"unobserve");function tF(r,e){var t=[],n,i=XU(r);if(!i)i=new JU(r),vg.set(r,i);else{var s=ZU(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=Kr(r),e){n.callback=e,n.next=null;var f=o(function(){gg(n)},"dirtyCheck"),u=o(function(){clearTimeout(n.next),n.next=setTimeout(f)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",u),window.addEventListener("keyup",u),window.addEventListener("mousedown",u),window.addEventListener("keydown",u),window.addEventListener("change",u))}return n.patches=t,n.object=r,n.unobserve=function(){gg(n),clearTimeout(n.next),QU(i,n),typeof window<"u"&&(window.removeEventListener("mouseup",u),window.removeEventListener("keyup",u),window.removeEventListener("mousedown",u),window.removeEventListener("keydown",u),window.removeEventListener("change",u))},i.observers.set(e,new YU(e,n)),n}o(tF,"observe");function gg(r,e){e===void 0&&(e=!1);var t=vg.get(r.object);yg(t.value,r.object,r.patches,"",e),r.patches.length&&y0(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(gg,"generate");function yg(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=m0(e),f=m0(r),u=!1,d=!1,g=f.length-1;g>=0;g--){var y=f[g],E=r[y];if(p0(e,y)&&!(e[y]===void 0&&E!==void 0&&Array.isArray(e)===!1)){var O=e[y];typeof E=="object"&&E!=null&&typeof O=="object"&&O!=null&&Array.isArray(E)===Array.isArray(O)?yg(E,O,t,n+"/"+So(y),i):E!==O&&(u=!0,i&&t.push({op:"test",path:n+"/"+So(y),value:Kr(E)}),t.push({op:"replace",path:n+"/"+So(y),value:Kr(O)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+So(y),value:Kr(E)}),t.push({op:"remove",path:n+"/"+So(y)}),d=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),u=!0)}if(!(!d&&s.length==f.length))for(var g=0;g<s.length;g++){var y=s[g];!p0(r,y)&&e[y]!==void 0&&t.push({op:"add",path:n+"/"+So(y),value:Kr(e[y])})}}}o(yg,"_generate");function rF(r,e,t){t===void 0&&(t=!1);var n=[];return yg(r,e,n,"",t),n}o(rF,"compare");var x0=Object.assign({},bg,xg,{JsonPatchError:pl,deepClone:Kr,escapePathComponent:So,unescapePathComponent:dl});var o9=Bt(Uc(),1);var s9=Bt(qa(),1);var wr;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(wr||(wr={}));var r2=Bt(Uc(),1);$i();Vf();var iE={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function I$(r){let e=iE[r];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${r}`)}o(I$,"codeByName");function D$(r){let e=Object.entries(iE).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(D$,"nameByCode");var Tn=class{};o(Tn,"StreamType");Tn.nameByCode=D$;Tn.codeByName=I$;var Hg=Bt(ll(),1);function Vn(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,f)=>{if(f.value!=null)f.value=oE(f.value,e,t,n);else if(f.get!=null)f.get=oE(f.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(Vn,"Memoize");var Pg=new Map;function oE(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let f;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let u=this[i];if(Array.isArray(n))for(let d of n)Pg.has(d)?Pg.get(d).push(u):Pg.set(d,[u]);if(e||s.length>0||t>0){let d;e===!0?d=s.map(E=>E.toString()).join("!"):e?d=e.apply(this,s):d=s[0];let g=`${d}__timestamp`,y=!1;if(t>0)if(!u.has(g))y=!0;else{let E=u.get(g);y=Date.now()-E>t}u.has(d)&&!y?f=u.get(d):(f=r.apply(this,s),u.set(d,f),t>0&&u.set(g,Date.now()))}else{let d=this;u.has(d)?f=u.get(d):(f=r.apply(this,s),u.set(d,f))}return f}}o(oE,"getNewFunction");$i();Vf();Su();var $g=Bt(ll(),1);function Fc(r){try{return r()}catch(e){return e}}o(Fc,"tryCatch");$i();var Lg=Bt(ll(),1);Oa();function uf(r){let e=Lg.default.decode(r),t=Lg.default.decode.bytes,n=r.subarray(t);return[e,n,t]}o(uf,"readVarint");function R$(r){return r===0||r===1}o(R$,"isCidVersion");function Bg(r){let[e,t]=uf(r);if(!R$(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=uf(t),[,s,f]=uf(i),[u,,d]=uf(s),g=i.subarray(0,f+d+u),y=i.subarray(f+d+u);return[Je.create(e,n,Fh(g)),y]}o(Bg,"readCid");$i();Vf();function lf(r,e="StreamRef"){let[t,n]=uf(r);if(t!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,s]=uf(n),f=Bg(s),[u,d]=f;if(d.length===0)return{kind:"stream-id",type:i,genesis:u};if(d.length===1&&d[0]===0)return{kind:"commit-id",type:i,genesis:u,commit:null};{let[g]=Bg(d);return{kind:"commit-id",type:i,genesis:u,commit:g}}}o(lf,"fromBytes");var O$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function $c(r,e="StreamRef"){let t=O$.exec(r)||[],n=t[2];if(!n)throw new Error(`Malformed ${e} string: ${r}`);let i=Fi.decode(n),s=lf(i),f=t[4];return f?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Ug(s.genesis,f)}:s}o($c,"fromString");function N$(r){try{return typeof r=="string"?Je.parse(r):Je.asCID(r)}catch{return null}}o(N$,"parseCID");function Ug(r,e=null){if(!e||e==="0")return null;let t=N$(e);if(t)return r.equals(t)?null:t;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(Ug,"parseCommit");var yl=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ci=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},k0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Fi.encode(e)}: contains commit`)}};o(k0,"InvalidStreamIDBytesError");var I0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(I0,"InvalidStreamIDStringError");function fE(r){let e=lf(r,"StreamID");if(e.kind==="stream-id")return new nt(e.type,e.genesis);throw new k0(r)}o(fE,"fromBytes");function P$(r){return Fc(()=>fE(r))}o(P$,"fromBytesNoThrow");function cE(r){let e=$c(r,"StreamID");if(e.kind==="stream-id")return new nt(e.type,e.genesis);throw new I0(r)}o(cE,"fromString");function L$(r){return Fc(()=>cE(r))}o(L$,"fromStringNoThrow");var aE=Symbol.for("@ceramicnetwork/streamid/StreamID"),nt=class{constructor(e,t){if(this._tag=aE,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?Tn.codeByName(e):e,this._cid=typeof t=="string"?Je.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===aE}static async fromGenesis(e,t){let n=await Va({value:t,codec:Vi,hasher:Ns});return new nt(e,n.cid)}get type(){return this._type}get typeName(){return Tn.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=$g.default.encode(206),t=$g.default.encode(this.type);return Bi([e,t,this.cid.bytes])}get baseID(){return new nt(this._type,this._cid)}equals(e){return nt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Fi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(nt,"StreamID");nt.fromBytes=fE;nt.fromBytesNoThrow=P$;nt.fromString=cE;nt.fromStringNoThrow=L$;yl([Vn(),Ci("design:type",String),Ci("design:paramtypes",[])],nt.prototype,"typeName",null);yl([Vn(),Ci("design:type",Uint8Array),Ci("design:paramtypes",[])],nt.prototype,"bytes",null);yl([Vn(),Ci("design:type",nt),Ci("design:paramtypes",[])],nt.prototype,"baseID",null);yl([Vn(),Ci("design:type",Function),Ci("design:paramtypes",[]),Ci("design:returntype",String)],nt.prototype,"toString",null);yl([Vn(),Ci("design:type",Function),Ci("design:paramtypes",[]),Ci("design:returntype",String)],nt.prototype,"toUrl",null);var Hc=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Cn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},qg=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},hs=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)},qc,hf,xl,D0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Fi.encode(e)}: no commit information provided`)}};o(D0,"InvalidCommitIDBytesError");var R0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(R0,"InvalidCommitIDStringError");function lE(r){let e=lf(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new D0(r)}o(lE,"fromBytes");function B$(r){return Fc(()=>lE(r))}o(B$,"fromBytesNoThrow");function hE(r){let e=$c(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new R0(r)}o(hE,"fromString");function U$(r){return Fc(()=>hE(r))}o(U$,"fromStringNoThrow");var uE=Symbol.for("@ceramicnetwork/streamid/CommitID");function F$(r,e){return new Pt(r.type,r.cid,e)}o(F$,"make");var Pt=class{constructor(e,t,n=null){if(this._tag=uE,qc.set(this,void 0),hf.set(this,void 0),xl.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");qg(this,qc,typeof e=="string"?Tn.codeByName(e):e,"f"),qg(this,hf,typeof t=="string"?Je.parse(t):t,"f"),qg(this,xl,Ug(hs(this,hf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===uE}get baseID(){return new nt(hs(this,qc,"f"),hs(this,hf,"f"))}get type(){return hs(this,qc,"f")}get typeName(){return Tn.nameByCode(hs(this,qc,"f"))}get cid(){return hs(this,hf,"f")}get commit(){return hs(this,xl,"f")||hs(this,hf,"f")}get bytes(){let e=Hg.default.encode(206),t=Hg.default.encode(this.type),n=hs(this,xl,"f")?.bytes||new Uint8Array([0]);return Bi([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 Fi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(qc=new WeakMap,hf=new WeakMap,xl=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=lE;Pt.fromBytesNoThrow=B$;Pt.fromString=hE;Pt.fromStringNoThrow=U$;Pt.make=F$;Hc([Vn(),Cn("design:type",nt),Cn("design:paramtypes",[])],Pt.prototype,"baseID",null);Hc([Vn(),Cn("design:type",String),Cn("design:paramtypes",[])],Pt.prototype,"typeName",null);Hc([Vn(),Cn("design:type",Je),Cn("design:paramtypes",[])],Pt.prototype,"commit",null);Hc([Vn(),Cn("design:type",Uint8Array),Cn("design:paramtypes",[])],Pt.prototype,"bytes",null);Hc([Vn(),Cn("design:type",Function),Cn("design:paramtypes",[]),Cn("design:returntype",String)],Pt.prototype,"toString",null);Hc([Vn(),Cn("design:type",Function),Cn("design:paramtypes",[]),Cn("design:returntype",String)],Pt.prototype,"toUrl",null);Vf();var ln;(function(r){function e(i){let s=lf(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new nt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Fi.encode(i)}`)}}o(e,"fromBytes"),r.fromBytes=e;function t(i){let s=$c(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new nt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(t,"fromString"),r.fromString=t;function n(i){if(nt.isInstance(i)||Pt.isInstance(i))return i;if(i instanceof Uint8Array)return e(i);if(typeof i=="string")return t(i);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(i)}`)}o(n,"from"),r.from=n})(ln||(ln={}));var zg=o(function(r,e){return zg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},zg(r,e)},"extendStatics");function rn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zg(r,e);function t(){this.constructor=r}o(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}o(rn,"__extends");function dE(r,e,t,n){function i(s){return s instanceof t?s:new t(function(f){f(s)})}return o(i,"adopt"),new(t||(t=Promise))(function(s,f){function u(y){try{g(n.next(y))}catch(E){f(E)}}o(u,"fulfilled");function d(y){try{g(n.throw(y))}catch(E){f(E)}}o(d,"rejected");function g(y){y.done?s(y.value):i(y.value).then(u,d)}o(g,"step"),g((n=n.apply(r,e||[])).next())})}o(dE,"__awaiter");function O0(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=u(0),f.throw=u(1),f.return=u(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(g){return function(y){return d([g,y])}}function d(g){if(n)throw new TypeError("Generator is already executing.");for(;f&&(f=0,g[0]&&(t=0)),t;)try{if(n=1,i&&(s=g[0]&2?i.return:g[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,g[1])).done)return s;switch(i=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,i=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){t.label=g[1];break}if(g[0]===6&&t.label<s[1]){t.label=s[1],s=g;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(g);break}s[2]&&t.ops.pop(),t.trys.pop();continue}g=e.call(r,t)}catch(y){g=[6,y],i=0}finally{n=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}o(O0,"__generator");function ds(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(ds,"__values");function Wn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],f;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(u){f={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(f)throw f.error}}return s}o(Wn,"__read");function Zi(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}o(Zi,"__spreadArray");function df(r){return this instanceof df?(this.v=r,this):new df(r)}o(df,"__await");function pE(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",f),i[Symbol.asyncIterator]=function(){return this},i;function f(R){return function(I){return Promise.resolve(I).then(R,E)}}function u(R,I){n[R]&&(i[R]=function(P){return new Promise(function(X,B){s.push([R,P,X,B])>1||d(R,P)})},I&&(i[R]=I(i[R])))}function d(R,I){try{g(n[R](I))}catch(P){O(s[0][3],P)}}function g(R){R.value instanceof df?Promise.resolve(R.value.v).then(y,E):O(s[0][2],R)}function y(R){d("next",R)}function E(R){d("throw",R)}function O(R,I){R(I),s.shift(),s.length&&d(s[0][0],s[0][1])}}o(pE,"__asyncGenerator");function mE(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof ds=="function"?ds(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(f){return new Promise(function(u,d){f=r[s](f),i(u,d,f.done,f.value)})}}function i(s,f,u,d){Promise.resolve(d).then(function(g){s({value:g,done:u})},f)}}o(mE,"__asyncValues");function St(r){return typeof r=="function"}o(St,"isFunction");function zc(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(zc,"createErrorClass");var N0=zc(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
820
820
  `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
821
- `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function pf(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(pf,"arrRemove");var oa=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 f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var u=ds(f),d=u.next();!d.done;d=u.next()){var g=d.value;g.remove(this)}}catch(N){e={error:N}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else f.remove(this);var y=this.initialTeardown;if(St(y))try{y()}catch(N){s=N instanceof N0?N.errors:[N]}var E=this._finalizers;if(E){this._finalizers=null;try{for(var O=ds(E),R=O.next();!R.done;R=O.next()){var I=R.value;try{bE(I)}catch(N){s=s??[],N instanceof N0?s=Zi(Zi([],Wn(s)),Wn(N.errors)):s.push(N)}}}catch(N){n={error:N}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(s)throw new N0(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)bE(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)&&pf(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&pf(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var Kg=oa.EMPTY;function P0(r){return r instanceof oa||r&&"closed"in r&&St(r.remove)&&St(r.add)&&St(r.unsubscribe)}o(P0,"isSubscription");function bE(r){St(r)?r():r.unsubscribe()}o(bE,"execFinalizer");var Qi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Kc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Kc.delegate;return i?.setTimeout?i.setTimeout.apply(i,Zi([r,e],Wn(t))):setTimeout.apply(void 0,Zi([r,e],Wn(t)))},clearTimeout:function(r){var e=Kc.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function L0(r){Kc.setTimeout(function(){var e=Qi.onUnhandledError;if(e)e(r);else throw r})}o(L0,"reportUnhandledError");function jg(){}o(jg,"noop");var gE=function(){return Gg("C",void 0,void 0)}();function vE(r){return Gg("E",void 0,r)}o(vE,"errorNotification");function yE(r){return Gg("N",r,void 0)}o(yE,"nextNotification");function Gg(r,e,t){return{kind:r,value:e,error:t}}o(Gg,"createNotification");var mf=null;function jc(r){if(Qi.useDeprecatedSynchronousErrorHandling){var e=!mf;if(e&&(mf={errorThrown:!1,error:null}),r(),e){var t=mf,n=t.errorThrown,i=t.error;if(mf=null,n)throw i}}else r()}o(jc,"errorContext");function xE(r){Qi.useDeprecatedSynchronousErrorHandling&&mf&&(mf.errorThrown=!0,mf.error=r)}o(xE,"captureError");var wl=function(r){rn(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,P0(t)&&t.add(n)):n.destination=z$,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new U0(t,n,i)},e.prototype.next=function(t){this.isStopped?Wg(yE(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Wg(vE(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Wg(gE,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}(oa);var $$=Function.prototype.bind;function Vg(r,e){return $$.call(r,e)}o(Vg,"bind");var q$=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){B0(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){B0(n)}else B0(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){B0(t)}},r}(),U0=function(r){rn(e,r);function e(t,n,i){var s=r.call(this)||this,f;if(St(t)||!t)f={next:t??void 0,error:n??void 0,complete:i??void 0};else{var u;s&&Qi.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()},f={next:t.next&&Vg(t.next,u),error:t.error&&Vg(t.error,u),complete:t.complete&&Vg(t.complete,u)}):f=t}return s.destination=new q$(f),s}return o(e,"SafeSubscriber"),e}(wl);function B0(r){Qi.useDeprecatedSynchronousErrorHandling?xE(r):L0(r)}o(B0,"handleUnhandledError");function H$(r){throw r}o(H$,"defaultErrorHandler");function Wg(r,e){var t=Qi.onStoppedNotification;t&&Kc.setTimeout(function(){return t(r,e)})}o(Wg,"handleStoppedNotification");var z$={closed:!0,next:jg,error:H$,complete:jg};var Gc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Vc(r){return r}o(Vc,"identity");function wE(r){return r.length===0?Vc:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(wE,"pipeFromArray");var Jt=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=j$(e)?e:new U0(e,t,n);return jc(function(){var f=i,u=f.operator,d=f.source;s.add(u?u.call(s,d):d?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=_E(t),new t(function(i,s){var f=new U0({next:function(u){try{e(u)}catch(d){s(d),f.unsubscribe()}},error:s,complete:i});n.subscribe(f)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Gc]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wE(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=_E(e),new e(function(n,i){var s;t.subscribe(function(f){return s=f},function(f){return i(f)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function _E(r){var e;return(e=r??Qi.Promise)!==null&&e!==void 0?e:Promise}o(_E,"getPromiseCtor");function K$(r){return r&&St(r.next)&&St(r.error)&&St(r.complete)}o(K$,"isObserver");function j$(r){return r&&r instanceof wl||K$(r)&&P0(r)}o(j$,"isSubscriber");function G$(r){return St(r?.lift)}o(G$,"hasLift");function Pr(r){return function(e){if(G$(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(Pr,"operate");function Lr(r,e,t,n,i){return new V$(r,e,t,n,i)}o(Lr,"createOperatorSubscriber");var V$=function(r){rn(e,r);function e(t,n,i,s,f,u){var d=r.call(this,t)||this;return d.onFinalize=f,d.shouldUnsubscribe=u,d._next=n?function(g){try{n(g)}catch(y){t.error(y)}}:r.prototype._next,d._error=s?function(g){try{s(g)}catch(y){t.error(y)}finally{this.unsubscribe()}}:r.prototype._error,d._complete=i?function(){try{i()}catch(g){t.error(g)}finally{this.unsubscribe()}}:r.prototype._complete,d}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}(wl);var EE=zc(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Jg=function(r){rn(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 AE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new EE},e.prototype.next=function(t){var n=this;jc(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var f=ds(n.currentObservers),u=f.next();!u.done;u=f.next()){var d=u.value;d.next(t)}}catch(g){i={error:g}}finally{try{u&&!u.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;jc(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;jc(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,f=i.isStopped,u=i.observers;return s||f?Kg:(this.currentObservers=null,u.push(t),new oa(function(){n.currentObservers=null,pf(u,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,f=n.isStopped;i?t.error(s):f&&t.complete()},e.prototype.asObservable=function(){var t=new Jt;return t.source=this,t},e.create=function(t,n){return new AE(t,n)},e}(Jt);var AE=function(r){rn(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:Kg},e}(Jg);var Yg=function(r){rn(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}(Jg);var Xg={now:function(){return(Xg.delegate||Date).now()},delegate:void 0};var SE=function(r){rn(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}(oa);var _l={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=_l.delegate;return i?.setInterval?i.setInterval.apply(i,Zi([r,e],Wn(t))):setInterval.apply(void 0,Zi([r,e],Wn(t)))},clearInterval:function(r){var e=_l.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var ME=function(r){rn(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){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var s=this.id,f=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(f,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(f,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),_l.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;n!=null&&_l.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(f){i=!0,s=f||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,pf(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(SE);var Zg=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=Xg.now,r}();var TE=function(r){rn(e,r);function e(t,n){n===void 0&&(n=Zg.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,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}(Zg);var W$=new TE(ME),CE=W$;var F0=new Jt(function(r){return r.complete()});function $0(r){return r&&St(r.schedule)}o($0,"isScheduler");function kE(r){return r[r.length-1]}o(kE,"last");function IE(r){return $0(kE(r))?r.pop():void 0}o(IE,"popScheduler");function DE(r,e){return typeof kE(r)=="number"?r.pop():e}o(DE,"popNumber");var Wc=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function q0(r){return St(r?.then)}o(q0,"isPromise");function H0(r){return St(r[Gc])}o(H0,"isInteropObservable");function z0(r){return Symbol.asyncIterator&&St(r?.[Symbol.asyncIterator])}o(z0,"isAsyncIterable");function K0(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(K0,"createInvalidObservableTypeError");function J$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(J$,"getSymbolIterator");var j0=J$();function G0(r){return St(r?.[j0])}o(G0,"isIterable");function V0(r){return pE(this,arguments,o(function(){var t,n,i,s;return O0(this,function(f){switch(f.label){case 0:t=r.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,df(t.read())];case 3:return n=f.sent(),i=n.value,s=n.done,s?[4,df(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,df(i)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(V0,"readableStreamLikeToAsyncGenerator");function W0(r){return St(r?.getReader)}o(W0,"isReadableStreamLike");function nn(r){if(r instanceof Jt)return r;if(r!=null){if(H0(r))return Y$(r);if(Wc(r))return X$(r);if(q0(r))return Z$(r);if(z0(r))return RE(r);if(G0(r))return Q$(r);if(W0(r))return eq(r)}throw K0(r)}o(nn,"innerFrom");function Y$(r){return new Jt(function(e){var t=r[Gc]();if(St(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Y$,"fromInteropObservable");function X$(r){return new Jt(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(X$,"fromArrayLike");function Z$(r){return new Jt(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,L0)})}o(Z$,"fromPromise");function Q$(r){return new Jt(function(e){var t,n;try{for(var i=ds(r),s=i.next();!s.done;s=i.next()){var f=s.value;if(e.next(f),e.closed)return}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(Q$,"fromIterable");function RE(r){return new Jt(function(e){tq(r,e).catch(function(t){return e.error(t)})})}o(RE,"fromAsyncIterable");function eq(r){return RE(V0(r))}o(eq,"fromReadableStreamLike");function tq(r,e){var t,n,i,s;return dE(this,void 0,void 0,function(){var f,u;return O0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),t=mE(r),d.label=1;case 1:return[4,t.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(f=n.value,e.next(f),e.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),i={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:d.sent(),d.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(tq,"process");function ki(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(ki,"executeSchedule");function J0(r,e){return e===void 0&&(e=0),Pr(function(t,n){t.subscribe(Lr(n,function(i){return ki(n,r,function(){return n.next(i)},e)},function(){return ki(n,r,function(){return n.complete()},e)},function(i){return ki(n,r,function(){return n.error(i)},e)}))})}o(J0,"observeOn");function Y0(r,e){return e===void 0&&(e=0),Pr(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(Y0,"subscribeOn");function OE(r,e){return nn(r).pipe(Y0(e),J0(e))}o(OE,"scheduleObservable");function NE(r,e){return nn(r).pipe(Y0(e),J0(e))}o(NE,"schedulePromise");function PE(r,e){return new Jt(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(PE,"scheduleArray");function LE(r,e){return new Jt(function(t){var n;return ki(t,e,function(){n=r[j0](),ki(t,e,function(){var i,s,f;try{i=n.next(),s=i.value,f=i.done}catch(u){t.error(u);return}f?t.complete():t.next(s)},0,!0)}),function(){return St(n?.return)&&n.return()}})}o(LE,"scheduleIterable");function X0(r,e){if(!r)throw new Error("Iterable cannot be null");return new Jt(function(t){ki(t,e,function(){var n=r[Symbol.asyncIterator]();ki(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(X0,"scheduleAsyncIterable");function BE(r,e){return X0(V0(r),e)}o(BE,"scheduleReadableStreamLike");function UE(r,e){if(r!=null){if(H0(r))return OE(r,e);if(Wc(r))return PE(r,e);if(q0(r))return NE(r,e);if(z0(r))return X0(r,e);if(G0(r))return LE(r,e);if(W0(r))return BE(r,e)}throw K0(r)}o(UE,"scheduled");function FE(r,e){return e?UE(r,e):nn(r)}o(FE,"from");var Z0=zc(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function $E(r){return r instanceof Date&&!isNaN(r)}o($E,"isValidDate");function Q0(r,e){return Pr(function(t,n){var i=0;t.subscribe(Lr(n,function(s){n.next(r.call(e,s,i++))}))})}o(Q0,"map");var rq=Array.isArray;function nq(r,e){return rq(e)?r.apply(void 0,Zi([],Wn(e))):r(e)}o(nq,"callOrApply");function qE(r){return Q0(function(e){return nq(r,e)})}o(qE,"mapOneOrManyArgs");function HE(r,e,t,n,i,s,f,u){var d=[],g=0,y=0,E=!1,O=o(function(){E&&!d.length&&!g&&e.complete()},"checkComplete"),R=o(function(N){return g<n?I(N):d.push(N)},"outerNext"),I=o(function(N){s&&e.next(N),g++;var X=!1;nn(t(N,y++)).subscribe(Lr(e,function(L){i?.(L),s?R(L):e.next(L)},function(){X=!0},void 0,function(){if(X)try{g--;for(var L=o(function(){var J=d.shift();f?ki(e,f,function(){return I(J)}):I(J)},"_loop_1");d.length&&g<n;)L();O()}catch(J){e.error(J)}}))},"doInnerSub");return r.subscribe(Lr(e,R,function(){E=!0,O()})),function(){u?.()}}o(HE,"mergeInternals");function El(r,e,t){return t===void 0&&(t=1/0),St(e)?El(function(n,i){return Q0(function(s,f){return e(n,s,i,f)})(nn(r(n,i)))},t):(typeof e=="number"&&(t=e),Pr(function(n,i){return HE(n,i,r,t)}))}o(El,"mergeMap");function zE(r){return r===void 0&&(r=1/0),El(Vc,r)}o(zE,"mergeAll");var iq=["addListener","removeListener"],oq=["addEventListener","removeEventListener"],sq=["on","off"];function Al(r,e,t,n){if(St(t)&&(n=t,t=void 0),n)return Al(r,e,t).pipe(qE(n));var i=Wn(cq(r)?oq.map(function(u){return function(d){return r[u](e,d,t)}}):aq(r)?iq.map(KE(r,e)):fq(r)?sq.map(KE(r,e)):[],2),s=i[0],f=i[1];if(!s&&Wc(r))return El(function(u){return Al(u,e,t)})(nn(r));if(!s)throw new TypeError("Invalid event target");return new Jt(function(u){var d=o(function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return u.next(1<g.length?g:g[0])},"handler");return s(d),function(){return f(d)}})}o(Al,"fromEvent");function KE(r,e){return function(t){return function(n){return r[t](e,n)}}}o(KE,"toCommonHandlerRegistry");function aq(r){return St(r.addListener)&&St(r.removeListener)}o(aq,"isNodeStyleEventEmitter");function fq(r){return St(r.on)&&St(r.off)}o(fq,"isJQueryStyleEventEmitter");function cq(r){return St(r.addEventListener)&&St(r.removeEventListener)}o(cq,"isEventTarget");function Sl(r,e,t){r===void 0&&(r=0),t===void 0&&(t=CE);var n=-1;return e!=null&&($0(e)?t=e:n=e),new Jt(function(i){var s=$E(r)?+r-t.now():r;s<0&&(s=0);var f=0;return t.schedule(function(){i.closed||(i.next(f++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(Sl,"timer");function Qg(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=IE(r),n=DE(r,1/0),i=r;return i.length?i.length===1?nn(i[0]):zE(n)(FE(i,t)):F0}o(Qg,"merge");function jE(r,e){return Pr(function(t,n){var i=0;t.subscribe(Lr(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(jE,"filter");function GE(r){return Pr(function(e,t){var n=!1;e.subscribe(Lr(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(GE,"defaultIfEmpty");function VE(r){return r<=0?function(){return F0}:Pr(function(e,t){var n=0;e.subscribe(Lr(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(VE,"take");function WE(r){return r===void 0&&(r=uq),Pr(function(e,t){var n=!1;e.subscribe(Lr(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(WE,"throwIfEmpty");function uq(){return new Z0}o(uq,"defaultErrorFactory");function e2(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?jE(function(i,s){return r(i,s,n)}):Vc,VE(1),t?GE(e):WE(function(){return new Z0}))}}o(e2,"first");function t2(r,e){return Pr(function(t,n){var i=e??{},s=i.leading,f=s===void 0?!0:s,u=i.trailing,d=u===void 0?!1:u,g=!1,y=null,E=null,O=!1,R=o(function(){E?.unsubscribe(),E=null,d&&(X(),O&&n.complete())},"endThrottling"),I=o(function(){E=null,O&&n.complete()},"cleanupThrottling"),N=o(function(L){return E=nn(r(L)).subscribe(Lr(n,R,I))},"startThrottle"),X=o(function(){if(g){g=!1;var L=y;y=null,n.next(L),!O&&N(L)}},"send");t.subscribe(Lr(n,function(L){g=!0,y=L,!(E&&!E.closed)&&(f?X():N(L))},function(){O=!0,!(d&&g&&E&&!E.closed)&&n.complete()}))})}o(t2,"throttle");var JE;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(JE||(JE={}));var Ml;(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"})(Ml||(Ml={}));var n2;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(n2||(n2={}));var ps=class extends Jt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new nt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,r2.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===n2.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,r2.default)(this.state$.value)}async sync(e={}){e={sync:wr.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(ps,"Stream");function Jc(){return r=>{}}o(Jc,"StreamStatic");var t9=Bt(ZE(),1);function QE(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):(Qg(...r.map(t=>Al(t,"abort"))).pipe(e2()).subscribe(()=>{e.abort()}),e.signal)}o(QE,"mergeAbortSignals");var Tl=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=Sl(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}};o(Tl,"TimedAbortSignal");async function e9(r,e){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(e9,"abortable");var lq=60*1e3*3;async function jr(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let t=e.timeout||lq,n=new Tl(t),i=e.signal?QE([e.signal,n.signal]):n.signal,s=await e9(i,f=>(0,t9.default)(String(r),{...e,signal:f})).finally(()=>n.clear());if(!s.ok){let f=await s.text();throw new Error(`HTTP request to '${r}' failed with status '${s.statusText}': ${f}`)}return s.json()}o(jr,"fetchJson");var Cl=Bt(Uc(),1);$i();function bs(r){let e=Je.asCID(r);if(e)return e;if(typeof r=="string")return Je.parse(r);if(r instanceof Uint8Array)return Je.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(bs,"toCID");var r9=0,Zt=class{static streamIdFromState(e){return new nt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,Cl.default)(e);return Zt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=It(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=It(t.cacaoBlock,"base64")),t):(Zt.isSignedCommit(e)&&(t.link=t.link.toString()),Zt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=It(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,Cl.default)(e);return Zt.isSignedCommitContainer(t)?(t.jws.link=bs(t.jws.link),t.linkedBlock=Ut(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ut(t.cacaoBlock,"base64")),t):(Zt.isSignedCommit(t)&&(t.link=bs(t.link)),Zt.isAnchorCommit(t)&&(t.proof=bs(t.proof)),t.id&&(t.id=bs(t.id)),t.prev&&(t.prev=bs(t.prev)),t.header?.model&&(t.header.model=Ut(t.header.model,"base64")),t)}static serializeState(e){let t=(0,Cl.default)(e);return t.log=t.log.map(n=>({...n,cid:n.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Ml[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=r9&&(t.metadata.unique=It(t.metadata.unique,"base64")),t.doctype=Tn.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,Cl.default)(e);return t.doctype&&(t.type=Tn.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(n=>({...n,cid:bs(n.cid)})),t.anchorProof&&(t.anchorProof.txHash=bs(t.anchorProof.txHash),t.anchorProof.root=bs(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Ml[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=nt.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=nt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=r9&&(t.metadata.unique=Ut(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Zt.serializeState(e))===JSON.stringify(Zt.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.log.length===t.log.length&&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 async convertCommitToSignedCommitContainer(e,t){if(Zt.isSignedCommit(e)){let n=await 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(Zt,"StreamUtils");var kl=class extends Yg{next(e){let t=this.value;Zt.statesEqual(t,e)||super.next(e)}};o(kl,"StreamStateSubject");var hq=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Jn,i2={anchor:!0,publish:!0,pin:!0,sync:wr.PREFER_CACHE},dq={sync:wr.PREFER_CACHE},n9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function o2(r,e){if(typeof r?.schema=="string")try{Pt.fromString(r.schema)}catch{throw new Error("Schema must be a CommitID")}let t={controllers:r?.controllers,family:r?.family,schema:r?.schema?.toString(),tags:r?.tags};if(e)r?.deterministic||(t.unique=It((0,s9.randomBytes)(12),"base64")),r?.forbidControllerChange&&(t.forbidControllerChange=!0);else{if(r?.deterministic!==void 0||r?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(r?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(n=>t[n]===void 0&&delete t[n]),t}o(o2,"headerFromMetadata");async function i9(r){if(!r.did)throw new Error("No DID provided");return r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`)),r.did}o(i9,"getAuthenticatedDID");async function s2(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(s2,"throwReadOnlyError");var Yn=Jn=o(class extends ps{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,o9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async create(e,t,n,i={}){i={...i2,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let s=i.asDID?{did:i.asDID}:e,f=await Jn.makeGenesis(s,t,n);return e.createStreamFromGenesis(Jn.STREAM_TYPE_ID,f,i)}static async createFromGenesis(e,t,n={}){n={...i2,...n},t.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=t.data?await Jn._signDagJWS(e,t):t;return e.createStreamFromGenesis(Jn.STREAM_TYPE_ID,i,n)}static async deterministic(e,t,n={}){if(n={...i2,...n},t={...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 i=await Jn.makeGenesis(e,null,t);return e.createStreamFromGenesis(Jn.STREAM_TYPE_ID,i,n)}static async load(e,t,n={}){n={...dq,...n};let i=ln.from(t);if(i.type!=Jn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Jn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,t,n={}){n={...n9,...n};let i=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(i,e,t),f=await this.api.applyCommit(this.id,s,n);this.state$.next(f.state)}async patch(e,t={}){t={...n9,...t};let i={header:o2(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},s=await Jn._signDagJWS(this.api,i),f=await this.api.applyCommit(this.id,s,t);this.state$.next(f.state)}makeReadOnly(){this.update=s2,this.patch=s2,this.sync=s2,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,t,n){let i=await this._makeRawCommit(t,n);return Jn._signDagJWS(e,i)}async _makeRawCommit(e,t){t||(t={});let n=o2(t,!1);if(e==null&&(e=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let i=x0.compare(this.content,e),s=this.state.log[0];return{header:n,data:i,prev:this.tip,id:s.cid}}static async makeGenesis(e,t,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let f=await i9(e);n.controllers=[f.hasParent?f.parent:f.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=o2(n,!0);if(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 Ya(f),f}let s={data:t,header:i};return Jn._signDagJWS(e,s)}static async _signDagJWS(e,t){return(await i9(e)).createDagJWS(t)}},"TileDocument");Yn.STREAM_TYPE_NAME="tile";Yn.STREAM_TYPE_ID=0;Yn=Jn=hq([Jc()],Yn);var d9=Bt(c9(),1);function Eq(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(Eq,"_checkPrivateRedeclaration");function Aq(r,e){return e.get?e.get.call(r):e.value}o(Aq,"_classApplyDescriptorGet");function Sq(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(Sq,"_classApplyDescriptorSet");function h9(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(h9,"_classExtractFieldDescriptor");function u2(r,e){var t=h9(r,e,"get");return Aq(r,t)}o(u2,"_classPrivateFieldGet");function u9(r,e,t){Eq(r,e),e.set(r,t)}o(u9,"_classPrivateFieldInit");function l9(r,e,t){var n=h9(r,e,"set");return Sq(r,n,t),t}o(l9,"_classPrivateFieldSet");function Mq(r){return typeof r=="string"||Pt.isInstance(r)||nt.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(Mq,"keyToQuery");function l2(r){return typeof r=="string"?ln.from(r).toString():Pt.isInstance(r)||nt.isInstance(r)?r.toString():r.streamId.toString()}o(l2,"keyToString");async function Tq(r){let e=await Yn.makeGenesis({},null,{...r,deterministic:!0}),t=await nt.fromGenesis("tile",e);return{genesis:e,streamId:t}}o(Tq,"getDeterministicQuery");var Cq=o(()=>Promise.resolve([]),"tempBatchLoadFn"),tp=new WeakMap,h2=new WeakMap,Il=class extends d9.default{cache(e){if(!u2(this,h2))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,n){let i=await Yn.create(u2(this,tp),e,t,n);return this.cache(i),i}async deterministic(e,t){let n=await Tq(e);try{return await super.load(n)}catch{let s=await Yn.createFromGenesis(u2(this,tp),n.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,n,i){let s=l2(e);this.clear(s);let f=await this.load({streamId:s});return await f.update(t,n,i),f}constructor(e){super(Cq,{cache:!0,cacheKeyFn:l2,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),u9(this,tp,{writable:!0,value:void 0}),u9(this,h2,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(t.map(Mq),e.multiqueryTimeout);return t.map(i=>{let s=l2(i),f=n[s];return f||new Error(`Failed to load stream: ${s}`)})},l9(this,tp,e.ceramic),l9(this,h2,!!e.cache)}};o(Il,"TileLoader");function d2(r){return typeof r=="string"?nt.fromString(r):r}o(d2,"typeStreamID");function p9(r,e){let t=new URL(r);for(let[n,i]of Object.entries(e))nt.isInstance(i)?t.searchParams.set(n,i.toString()):typeof i=="object"?t.searchParams.set(n,JSON.stringify(i)):t.searchParams.set(n,i);return t}o(p9,"serializeObjectToSearchParams");function p2(r){let e={};for(let[t,n]of Object.entries(r))nt.isInstance(n)?e[t]=n.toString():e[t]=n;return e}o(p2,"serializeObjectForHttpPost");var on=class extends Jt{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=Sl(0,n).pipe(t2(()=>this._syncState(this.id,{sync:wr.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new kl(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let n=await on._load(e,this._apiUrl,t);this.state$.next(Zt.deserializeState(n))}get id(){return new nt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,n,i,s){let f=new URL("./streams",e),{state:u}=await jr(f,{method:"post",body:{type:t,genesis:Zt.serializeCommit(n),opts:i}});return new on(Zt.deserializeState(u),e,s)}static async applyCommit(e,t,n,i,s){let f=new URL("./commits",e),{state:u}=await jr(f,{method:"post",body:{streamId:t.toString(),commit:Zt.serializeCommit(n),opts:i}});return new on(Zt.deserializeState(u),e,s)}static async _load(e,t,n){let i=p9(new URL(`./streams/${e}`,t),n),{state:s}=await jr(i);return s}static async load(e,t,n,i){let s=await on._load(e,t,i);return new on(Zt.deserializeState(s),t,n)}static async loadStreamCommits(e,t){let n=new URL(`./commits/${e}`,t),{commits:i}=await jr(n);return i.map(s=>({cid:s.cid,value:Zt.deserializeCommit(s.value)}))}complete(){this.state$.complete()}};o(on,"Document");var bf;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC",r[r.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(bf||(bf={}));var m2=Bt(Uc(),1);var m9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(m9||(m9={}));var b2;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(b2||(b2={}));var Dl=class extends Jt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new nt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,m2.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===b2.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,m2.default)(this.state$.value)}async sync(e={}){e={sync:bf.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(Dl,"Stream");function b9(){return r=>{}}o(b9,"StreamStatic");function g9(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new Zs({address:e,chainId:t})}return new Zs(r)}o(g9,"normalizeAccountId");var kq="(?:%[0-9a-fA-F]{2})",v9=`(?:[a-zA-Z0-9._-]|${kq})`,Iq="([a-z0-9]+)",Dq=`((?:${v9}*:)*(${v9}+))`,y9="[a-zA-Z0-9_.:%-]",Rq=`;${y9}+=${y9}*`,Oq=`((${Rq})*)`,Nq="(/[^#?]*)?",Pq="([?][^#]*)?",Lq="(#.*)?",Bq=new RegExp(`^did:${Iq}:${Dq}${Oq}${Nq}${Pq}${Lq}$`);function x9(r){if(r===""||!r)return null;let e=r.match(Bq);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(x9,"parse");var _9=Bt(Uc(),1);var Uq=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},gf,g2=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),w9={anchor:!1,publish:!0,sync:bf.PREFER_CACHE},v2={anchor:!0,publish:!0},Fq={sync:bf.PREFER_CACHE},vf=gf=o(class extends Dl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,_9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async fromAccount(e,t,n={}){n={...w9,...n};let i=g9(t),s=gf.makeGenesis(i);return gf.fromGenesis(e,s,n)}static async fromGenesis(e,t,n={}){return n={...w9,...n},e.createStreamFromGenesis(gf.STREAM_TYPE_ID,t,n)}async setDid(e,t,n={}){n={...v2,...n};let i=typeof e=="string"?e.trim():e.id;if(x9(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let f=await t.createLink(i);return this.setDidProof(f,n)}async setDidProof(e,t={}){t={...v2,...t};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,t);this.state$.next(i.state)}async clearDid(e,t={}){t={...v2,...t};let n=await e.createLink("");return this.setDidProof(n,t)}static async load(e,t,n={}){n={...Fq,...n};let i=ln.from(t);if(i.type!=gf.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${gf.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,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=g2,this.setDid=g2,this.sync=g2,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");vf.STREAM_TYPE_NAME="caip10-link";vf.STREAM_TYPE_ID=1;vf=gf=Uq([b9()],vf);$i();Oa();var i7=Bt(r7(),1);var RH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Mo,OH={sync:wr.PREFER_CACHE};async function n7(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(n7,"_ensureAuthenticated");async function NH(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(NH,"throwReadOnlyError");var sa=Mo=o(class extends ps{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Mo.MODEL}}static async create(e,t,n){Mo.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:wr.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Mo._makeGenesis(e,t,n);return await e.createStreamFromGenesis(Mo.STREAM_TYPE_ID,s,i)}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 async load(e,t,n={}){n={...OH,...n};let i=ln.from(t);if(i.type!=Mo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Mo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return Mo._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await n7(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],model:Mo.MODEL.bytes};return{data:t,header:i}}makeReadOnly(){this.sync=NH,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,t){return await n7(e),e.did.createDagJWS(t)}},"Model");sa.STREAM_TYPE_NAME="model";sa.STREAM_TYPE_ID=2;sa.MODEL=function(){let r=Ya("model-v1"),e=i7.default.encode(r,"identity"),t=Jo(vc,e),n=Je.createV1(vc,t);return new nt("UNLOADABLE",n)}();sa=Mo=RH([Jc()],sa);var a7=Bt(qa(),1);var PH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},eo,LH={anchor:!0,publish:!0,pin:!0,sync:wr.NEVER_SYNC,syncTimeoutSeconds:0},BH={anchor:!1,publish:!1,pin:!0,sync:wr.PREFER_CACHE},UH={sync:wr.PREFER_CACHE},o7={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function s7(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(s7,"_ensureAuthenticated");async function w2(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(w2,"throwReadOnlyError");var xf=eo=o(class extends ps{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 async create(e,t,n,i={}){i={...LH,...i};let s=i.asDID?{did:i.asDID}:e,f=await eo._makeGenesis(s,t,n);return e.createStreamFromGenesis(eo.STREAM_TYPE_ID,f,i)}static async single(e,t,n={}){n={...BH,...n};let i=n.asDID?{did:n.asDID}:e;t={...t,deterministic:!0};let s=await eo._makeGenesis(i,null,t);return e.createStreamFromGenesis(eo.STREAM_TYPE_ID,s,n)}static async load(e,t,n={}){n={...UH,...n};let i=ln.from(t);if(i.type!=eo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${eo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,t={}){t={...o7,...t};let n=t.asDID?{did:t.asDID}:this.api,i=await this._makeCommit(n,e),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}async patch(e,t={}){t={...o7,...t};let n={data:e,prev:this.tip,id:this.id.cid},i=await eo._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}makeReadOnly(){this.replace=w2,this.patch=w2,this.sync=w2,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return eo._signDagJWS(e,n)}_makeRawCommit(e){return{data:x0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return n.deterministic?(Ya(i),i):eo._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let i=n.controller;if(!i)if(e.did)await s7(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let s={controllers:[i],model:n.model.bytes};return n.deterministic||(s.unique=(0,a7.randomBytes)(12)),{data:t,header:s}}static async _signDagJWS(e,t){return await s7(e),e.did.createDagJWS(t)}},"ModelInstanceDocument");xf.STREAM_TYPE_NAME="MID";xf.STREAM_TYPE_ID=3;xf=eo=PH([Jc()],xf);var Nl=class{constructor(e){this._apiUrl=e}async add(e,t){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await jr(i,{method:"post",body:n})}async rm(e,t){let n=new URL(`./pins/${e}`,this._apiUrl);await jr(n,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await jr(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(Nl,"RemotePinApi");var Pl=class{constructor(e){this._fetchJson=jr,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:p2(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:p2(e)});return{edges:t.edges.map(i=>({cursor:i.cursor,node:Zt.deserializeState(i.node)})),pageInfo:t.pageInfo}}};o(Pl,"RemoteIndexApi");var Ll=class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=jr,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,n){let i=n?{models:n.map(f=>f.toString())}:void 0,s=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${s.signatures[0].protected}.${s.payload}.${s.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(n=>nt.fromString(n))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}};o(Ll,"RemoteAdminApi");var FH="/api/v0/",$H="http://localhost:7007",qH={syncInterval:5e3},HH={anchor:!0,publish:!0,sync:wr.PREFER_CACHE},zH={anchor:!0,publish:!0,sync:wr.PREFER_CACHE},f7={sync:wr.PREFER_CACHE},Bl=class{constructor(e=$H,t={}){this._config={...qH,...t},this._apiUrl=new URL(FH,e),this._streamCache=new Map,this.context={api:this},this.pin=new Nl(this._apiUrl),this.index=new Pl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Ll(this._apiUrl,n),this._streamConstructors={[vf.STREAM_TYPE_ID]:vf,[sa.STREAM_TYPE_ID]:sa,[xf.STREAM_TYPE_ID]:xf,[Yn.STREAM_TYPE_ID]:Yn}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,n={}){n={...zH,...n};let i=await on.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),s=this._streamCache.get(i.id.toString());return s?(Zt.statesEqual(i.state,s.state)||s.next(i.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,t={}){t={...f7,...t};let n=ln.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,t):(i=await on.load(n,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,t){let n=e.map(f=>({...f,streamId:typeof f.streamId=="string"?f.streamId:f.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=await jr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((f,u)=>{let[d,g]=u,y=Zt.deserializeState(g),E=new on(y,this._apiUrl,this._config.syncInterval);return f[d]=this.buildStreamFromDocument(E),f},{})}loadStreamCommits(e){let t=d2(e);return on.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,n={}){n={...HH,...n};let i=d2(e),s=await on.applyCommit(this._apiUrl,i,t,n,this._config.syncInterval),f=this._streamCache.get(i.toString());return f?(f.next(s.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.toString(),s),this.buildStreamFromDocument(s))}async requestAnchor(e,t={}){t={...f7,...t};let{anchorStatus:n}=await jr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new on(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)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await jr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Bl,"CeramicClient");var Ft;(function(r){r.assertEqual=i=>i;function e(i){}o(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}o(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let s={};for(let f of i)s[f]=f;return s},r.getValidEnumValues=i=>{let s=r.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),f={};for(let u of s)f[u]=i[u];return r.objectValues(f)},r.objectValues=i=>r.objectKeys(i).map(function(s){return i[s]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let f in i)Object.prototype.hasOwnProperty.call(i,f)&&s.push(f);return s},r.find=(i,s)=>{for(let f of i)if(s(f))return f},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(f=>typeof f=="string"?`'${f}'`:f).join(s)}o(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ft||(Ft={}));var qe=Ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),aa=o(r=>{switch(typeof r){case"undefined":return qe.undefined;case"string":return qe.string;case"number":return isNaN(r)?qe.nan:qe.number;case"boolean":return qe.boolean;case"function":return qe.function;case"bigint":return qe.bigint;case"symbol":return qe.symbol;case"object":return Array.isArray(r)?qe.array:r===null?qe.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?qe.promise:typeof Map<"u"&&r instanceof Map?qe.map:typeof Set<"u"&&r instanceof Set?qe.set:typeof Date<"u"&&r instanceof Date?qe.date:qe.object;default:return qe.unknown}},"getParsedType"),Pe=Ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),KH=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ii=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 f of s.issues)if(f.code==="invalid_union")f.unionErrors.map(i);else if(f.code==="invalid_return_type")i(f.returnTypeError);else if(f.code==="invalid_arguments")i(f.argumentsError);else if(f.path.length===0)n._errors.push(t(f));else{let u=n,d=0;for(;d<f.path.length;){let g=f.path[d];d===f.path.length-1?(u[g]=u[g]||{_errors:[]},u[g]._errors.push(t(f))):u[g]=u[g]||{_errors:[]},u=u[g],d++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ft.jsonStringifyReplacer,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(Ii,"ZodError");Ii.create=r=>new Ii(r);var Fl=o((r,e)=>{let t;switch(r.code){case Pe.invalid_type:r.received===qe.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Pe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Ft.jsonStringifyReplacer)}`;break;case Pe.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ft.joinValues(r.keys,", ")}`;break;case Pe.invalid_union:t="Invalid input";break;case Pe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ft.joinValues(r.options)}`;break;case Pe.invalid_enum_value:t=`Invalid enum value. Expected ${Ft.joinValues(r.options)}, received '${r.received}'`;break;case Pe.invalid_arguments:t="Invalid function arguments";break;case Pe.invalid_return_type:t="Invalid function return type";break;case Pe.invalid_date:t="Invalid date";break;case Pe.invalid_string:typeof r.validation=="object"?"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:Ft.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Pe.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(r.minimum)}`:t="Invalid input";break;case Pe.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(r.maximum)}`:t="Invalid input";break;case Pe.custom:t="Invalid input";break;case Pe.invalid_intersection_types:t="Intersection results could not be merged";break;case Pe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Pe.not_finite:t="Number must be finite";break;default:t=e.defaultError,Ft.assertNever(r)}return{message:t}},"errorMap"),h7=Fl;function jH(r){h7=r}o(jH,"setErrorMap");function ap(){return h7}o(ap,"getErrorMap");var fp=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],f={...i,path:s},u="",d=n.filter(g=>!!g).slice().reverse();for(let g of d)u=g(f,{data:e,defaultError:u}).message;return{...i,path:s,message:i.message||u}},"makeIssue"),GH=[];function je(r,e){let t=fp({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ap(),Fl].filter(n=>!!n)});r.common.issues.push(t)}o(je,"addIssueToContext");var Br=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 vt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t)n.push({key:await i.key,value:await i.value});return Br.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:f}=i;if(s.status==="aborted"||f.status==="aborted")return vt;s.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),(typeof f.value<"u"||i.alwaysSet)&&(n[s.value]=f.value)}return{status:e.value,value:n}}};o(Br,"ParseStatus");var vt=Object.freeze({status:"aborted"}),d7=o(r=>({status:"dirty",value:r}),"DIRTY"),sn=o(r=>({status:"valid",value:r}),"OK"),_2=o(r=>r.status==="aborted","isAborted"),E2=o(r=>r.status==="dirty","isDirty"),cp=o(r=>r.status==="valid","isValid"),up=o(r=>typeof Promise!==void 0&&r instanceof Promise,"isAsync"),Ot;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(Ot||(Ot={}));var Xn=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(Xn,"ParseInputLazyPath");var c7=o((r,e)=>{if(cp(e))return{success:!0,data:e.value};{if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new Ii(r.common.issues);return{success:!1,error:t}}},"handleResult");function Ct(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_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((f,u)=>f.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:n??u.defaultError}:{message:t??u.defaultError},"customMap"),description:i}}o(Ct,"processCreateParams");var wt=class{constructor(e){this.spa=this.safeParseAsync,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.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return aa(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:aa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Br,ctx:{common:e.parent.common,data:e.data,parsedType:aa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(up(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?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aa(e)},s=this._parseSync({data:e,path:i.path,parent:i});return c7(i,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aa(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(up(i)?i:Promise.resolve(i));return c7(n,s)}refine(e,t){let n=o(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let f=e(i),u=o(()=>s.addIssue({code:Pe.custom,...n(i)}),"setError");return typeof Promise<"u"&&f instanceof Promise?f.then(d=>d?!0:(u(),!1)):f?!0:(u(),!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 In({schema:this,typeName:mt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Qn.create(this)}nullable(){return Io.create(this)}nullish(){return this.optional().nullable()}array(){return kn.create(this)}promise(){return xs.create(this)}or(e){return ha.create([this,e])}and(e){return da.create(this,e)}transform(e){return new In({schema:this,typeName:mt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ya({innerType:this,defaultValue:t,typeName:mt.ZodDefault})}brand(){return new Ul({typeName:mt.ZodBranded,type:this,...Ct(void 0)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Sf({innerType:this,defaultValue:t,typeName:mt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xa.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(wt,"ZodType");var VH=/^c[^\s-]{8,}$/i,WH=/^([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,JH=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,YH=o(r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}:\\d{2})|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Di=class extends wt{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(i=>e.test(i),{validation:t,code:Pe.invalid_string,...Ot.errToObj(n)}),this.nonempty=e=>this.min(1,Ot.errToObj(e)),this.trim=()=>new Di({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==qe.string){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_type,expected:qe.string,received:s.parsedType}),vt}let n=new Br,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let f=e.data.length>s.value,u=e.data.length<s.value;(f||u)&&(i=this._getOrReturnCtx(e,i),f?je(i,{code:Pe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&je(i,{code:Pe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")JH.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"email",code:Pe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")WH.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"uuid",code:Pe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")VH.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cuid",code:Pe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),je(i,{validation:"url",code:Pe.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),je(i,{validation:"regex",code:Pe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?YH(s).test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):Ft.assertNever(s);return{status:n.value,value:e.data}}_addCheck(e){return new Di({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ot.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ot.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ot.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ot.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,...Ot.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ot.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ot.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ot.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ot.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ot.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ot.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};o(Di,"ZodString");Di.create=r=>{var e;return new Di({checks:[],typeName:mt.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Ct(r)})};function XH(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(".","")),f=parseInt(e.toFixed(i).replace(".",""));return s%f/Math.pow(10,i)}o(XH,"floatSafeRemainder");var to=class extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==qe.number){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_type,expected:qe.number,received:s.parsedType}),vt}let n,i=new Br;for(let s of this._def.checks)s.kind==="int"?Ft.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.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),je(n,{code:Pe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?XH(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.not_finite,message:s.message}),i.dirty()):Ft.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ot.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ot.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ot.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ot.toString(t))}setLimit(e,t,n,i){return new to({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ot.toString(i)}]})}_addCheck(e){return new to({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ot.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ot.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ot.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ot.toString(e)})}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(to,"ZodNumber");to.create=r=>new to({checks:[],typeName:mt.ZodNumber,coerce:r?.coerce||!1,...Ct(r)});var fa=class extends wt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==qe.bigint){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.bigint,received:n.parsedType}),vt}return sn(e.data)}};o(fa,"ZodBigInt");fa.create=r=>{var e;return new fa({typeName:mt.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Ct(r)})};var ca=class extends wt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==qe.boolean){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.boolean,received:n.parsedType}),vt}return sn(e.data)}};o(ca,"ZodBoolean");ca.create=r=>new ca({typeName:mt.ZodBoolean,coerce:r?.coerce||!1,...Ct(r)});var To=class extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==qe.date){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_type,expected:qe.date,received:s.parsedType}),vt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_date}),vt}let n=new Br,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ft.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new To({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ot.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ot.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};o(To,"ZodDate");To.create=r=>new To({checks:[],coerce:r?.coerce||!1,typeName:mt.ZodDate,...Ct(r)});var wf=class extends wt{_parse(e){if(this._getType(e)!==qe.symbol){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.symbol,received:n.parsedType}),vt}return sn(e.data)}};o(wf,"ZodSymbol");wf.create=r=>new wf({typeName:mt.ZodSymbol,...Ct(r)});var ua=class extends wt{_parse(e){if(this._getType(e)!==qe.undefined){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.undefined,received:n.parsedType}),vt}return sn(e.data)}};o(ua,"ZodUndefined");ua.create=r=>new ua({typeName:mt.ZodUndefined,...Ct(r)});var la=class extends wt{_parse(e){if(this._getType(e)!==qe.null){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.null,received:n.parsedType}),vt}return sn(e.data)}};o(la,"ZodNull");la.create=r=>new la({typeName:mt.ZodNull,...Ct(r)});var vs=class extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return sn(e.data)}};o(vs,"ZodAny");vs.create=r=>new vs({typeName:mt.ZodAny,...Ct(r)});var Co=class extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return sn(e.data)}};o(Co,"ZodUnknown");Co.create=r=>new Co({typeName:mt.ZodUnknown,...Ct(r)});var Ri=class extends wt{_parse(e){let t=this._getOrReturnCtx(e);return je(t,{code:Pe.invalid_type,expected:qe.never,received:t.parsedType}),vt}};o(Ri,"ZodNever");Ri.create=r=>new Ri({typeName:mt.ZodNever,...Ct(r)});var _f=class extends wt{_parse(e){if(this._getType(e)!==qe.undefined){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.void,received:n.parsedType}),vt}return sn(e.data)}};o(_f,"ZodVoid");_f.create=r=>new _f({typeName:mt.ZodVoid,...Ct(r)});var kn=class extends wt{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==qe.array)return je(t,{code:Pe.invalid_type,expected:qe.array,received:t.parsedType}),vt;if(i.exactLength!==null){let f=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(f||u)&&(je(t,{code:f?Pe.too_big:Pe.too_small,minimum:u?i.exactLength.value:void 0,maximum:f?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(je(t,{code:Pe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(je(t,{code:Pe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all(t.data.map((f,u)=>i.type._parseAsync(new Xn(t,f,t.path,u)))).then(f=>Br.mergeArray(n,f));let s=t.data.map((f,u)=>i.type._parseSync(new Xn(t,f,t.path,u)));return Br.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new kn({...this._def,minLength:{value:e,message:Ot.toString(t)}})}max(e,t){return new kn({...this._def,maxLength:{value:e,message:Ot.toString(t)}})}length(e,t){return new kn({...this._def,exactLength:{value:e,message:Ot.toString(t)}})}nonempty(e){return this.min(1,e)}};o(kn,"ZodArray");kn.create=(r,e)=>new kn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:mt.ZodArray,...Ct(e)});var lp;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(lp||(lp={}));var u7=o(r=>e=>new tr({...r,shape:()=>({...r.shape(),...e})}),"AugmentFactory");function eu(r){if(r instanceof tr){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Qn.create(eu(n))}return new tr({...r._def,shape:()=>e})}else return r instanceof kn?kn.create(eu(r.element)):r instanceof Qn?Qn.create(eu(r.unwrap())):r instanceof Io?Io.create(eu(r.unwrap())):r instanceof Zn?Zn.create(r.items.map(e=>eu(e))):r}o(eu,"deepPartialify");var tr=class extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=u7(this._def),this.extend=u7(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Ft.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==qe.object){let g=this._getOrReturnCtx(e);return je(g,{code:Pe.invalid_type,expected:qe.object,received:g.parsedType}),vt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:f}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ri&&this._def.unknownKeys==="strip"))for(let g in i.data)f.includes(g)||u.push(g);let d=[];for(let g of f){let y=s[g],E=i.data[g];d.push({key:{status:"valid",value:g},value:y._parse(new Xn(i,E,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Ri){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of u)d.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")u.length>0&&(je(i,{code:Pe.unrecognized_keys,keys:u}),n.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of u){let E=i.data[y];d.push({key:{status:"valid",value:y},value:g._parse(new Xn(i,E,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of d){let E=await y.key;g.push({key:E,value:await y.value,alwaysSet:y.alwaysSet})}return g}).then(g=>Br.mergeObjectSync(n,g)):Br.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Ot.errToObj,new tr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,s,f,u;let d=(f=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&f!==void 0?f:n.defaultError;return t.code==="unrecognized_keys"?{message:(u=Ot.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new tr({...this._def,unknownKeys:"strip"})}passthrough(){return new tr({...this._def,unknownKeys:"passthrough"})}setKey(e,t){return this.augment({[e]:t})}merge(e){return new tr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>lp.mergeShapes(this._def.shape(),e._def.shape()),typeName:mt.ZodObject})}catchall(e){return new tr({...this._def,catchall:e})}pick(e){let t={};return Ft.objectKeys(e).map(n=>{this.shape[n]&&(t[n]=this.shape[n])}),new tr({...this._def,shape:()=>t})}omit(e){let t={};return Ft.objectKeys(this.shape).map(n=>{Ft.objectKeys(e).indexOf(n)===-1&&(t[n]=this.shape[n])}),new tr({...this._def,shape:()=>t})}deepPartial(){return eu(this)}partial(e){let t={};if(e)return Ft.objectKeys(this.shape).map(n=>{Ft.objectKeys(e).indexOf(n)===-1?t[n]=this.shape[n]:t[n]=this.shape[n].optional()}),new tr({...this._def,shape:()=>t});for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new tr({...this._def,shape:()=>t})}required(e){let t={};if(e)Ft.objectKeys(this.shape).map(n=>{if(Ft.objectKeys(e).indexOf(n)===-1)t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Qn;)s=s._def.innerType;t[n]=s}});else for(let n in this.shape){let s=this.shape[n];for(;s instanceof Qn;)s=s._def.innerType;t[n]=s}return new tr({...this._def,shape:()=>t})}keyof(){return p7(Ft.objectKeys(this.shape))}};o(tr,"ZodObject");tr.create=(r,e)=>new tr({shape:()=>r,unknownKeys:"strip",catchall:Ri.create(),typeName:mt.ZodObject,...Ct(e)});tr.strictCreate=(r,e)=>new tr({shape:()=>r,unknownKeys:"strict",catchall:Ri.create(),typeName:mt.ZodObject,...Ct(e)});tr.lazycreate=(r,e)=>new tr({shape:r,unknownKeys:"strip",catchall:Ri.create(),typeName:mt.ZodObject,...Ct(e)});var ha=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let u of s)if(u.result.status==="valid")return u.result;for(let u of s)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;let f=s.map(u=>new Ii(u.ctx.common.issues));return je(t,{code:Pe.invalid_union,unionErrors:f}),vt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(async s=>{let f={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:f}),ctx:f}})).then(i);{let s,f=[];for(let d of n){let g={...t,common:{...t.common,issues:[]},parent:null},y=d._parseSync({data:t.data,path:t.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:g}),g.common.issues.length&&f.push(g.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let u=f.map(d=>new Ii(d));return je(t,{code:Pe.invalid_union,unionErrors:u}),vt}}get options(){return this._def.options}};o(ha,"ZodUnion");ha.create=(r,e)=>new ha({options:r,typeName:mt.ZodUnion,...Ct(e)});var sp=o(r=>r instanceof ma?sp(r.schema):r instanceof In?sp(r.innerType()):r instanceof ba?[r.value]:r instanceof ga?r.options:r instanceof va?Object.keys(r.enum):r instanceof ya?sp(r._def.innerType):r instanceof ua?[void 0]:r instanceof la?[null]:null,"getDiscriminator"),Ef=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==qe.object)return je(t,{code:Pe.invalid_type,expected:qe.object,received:t.parsedType}),vt;let n=this.discriminator,i=t.data[n],s=this.optionsMap.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}):(je(t,{code:Pe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),vt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let s of t){let f=sp(s.shape[e]);if(!f)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of f){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,s)}}return new Ef({typeName:mt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...Ct(n)})}};o(Ef,"ZodDiscriminatedUnion");function A2(r,e){let t=aa(r),n=aa(e);if(r===e)return{valid:!0,data:r};if(t===qe.object&&n===qe.object){let i=Ft.objectKeys(e),s=Ft.objectKeys(r).filter(u=>i.indexOf(u)!==-1),f={...r,...e};for(let u of s){let d=A2(r[u],e[u]);if(!d.valid)return{valid:!1};f[u]=d.data}return{valid:!0,data:f}}else if(t===qe.array&&n===qe.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let f=r[s],u=e[s],d=A2(f,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===qe.date&&n===qe.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(A2,"mergeValues");var da=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,f)=>{if(_2(s)||_2(f))return vt;let u=A2(s.value,f.value);return u.valid?((E2(s)||E2(f))&&t.dirty(),{status:t.value,value:u.data}):(je(n,{code:Pe.invalid_intersection_types}),vt)},"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,f])=>i(s,f)):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(da,"ZodIntersection");da.create=(r,e,t)=>new da({left:r,right:e,typeName:mt.ZodIntersection,...Ct(t)});var Zn=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.array)return je(n,{code:Pe.invalid_type,expected:qe.array,received:n.parsedType}),vt;if(n.data.length<this._def.items.length)return je(n,{code:Pe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&n.data.length>this._def.items.length&&(je(n,{code:Pe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=n.data.map((f,u)=>{let d=this._def.items[u]||this._def.rest;return d?d._parse(new Xn(n,f,n.path,u)):null}).filter(f=>!!f);return n.common.async?Promise.all(s).then(f=>Br.mergeArray(t,f)):Br.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Zn({...this._def,rest:e})}};o(Zn,"ZodTuple");Zn.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zn({items:r,typeName:mt.ZodTuple,rest:null,...Ct(e)})};var pa=class extends wt{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!==qe.object)return je(n,{code:Pe.invalid_type,expected:qe.object,received:n.parsedType}),vt;let i=[],s=this._def.keyType,f=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new Xn(n,u,n.path,u)),value:f._parse(new Xn(n,n.data[u],n.path,u))});return n.common.async?Br.mergeObjectAsync(t,i):Br.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof wt?new pa({keyType:e,valueType:t,typeName:mt.ZodRecord,...Ct(n)}):new pa({keyType:Di.create(),valueType:e,typeName:mt.ZodRecord,...Ct(t)})}};o(pa,"ZodRecord");var Af=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.map)return je(n,{code:Pe.invalid_type,expected:qe.map,received:n.parsedType}),vt;let i=this._def.keyType,s=this._def.valueType,f=[...n.data.entries()].map(([u,d],g)=>({key:i._parse(new Xn(n,u,n.path,[g,"key"])),value:s._parse(new Xn(n,d,n.path,[g,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of f){let g=await d.key,y=await d.value;if(g.status==="aborted"||y.status==="aborted")return vt;(g.status==="dirty"||y.status==="dirty")&&t.dirty(),u.set(g.value,y.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let d of f){let g=d.key,y=d.value;if(g.status==="aborted"||y.status==="aborted")return vt;(g.status==="dirty"||y.status==="dirty")&&t.dirty(),u.set(g.value,y.value)}return{status:t.value,value:u}}}};o(Af,"ZodMap");Af.create=(r,e,t)=>new Af({valueType:e,keyType:r,typeName:mt.ZodMap,...Ct(t)});var ko=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.set)return je(n,{code:Pe.invalid_type,expected:qe.set,received:n.parsedType}),vt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(je(n,{code:Pe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(je(n,{code:Pe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function f(d){let g=new Set;for(let y of d){if(y.status==="aborted")return vt;y.status==="dirty"&&t.dirty(),g.add(y.value)}return{status:t.value,value:g}}o(f,"finalizeSet");let u=[...n.data.values()].map((d,g)=>s._parse(new Xn(n,d,n.path,g)));return n.common.async?Promise.all(u).then(d=>f(d)):f(u)}min(e,t){return new ko({...this._def,minSize:{value:e,message:Ot.toString(t)}})}max(e,t){return new ko({...this._def,maxSize:{value:e,message:Ot.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(ko,"ZodSet");ko.create=(r,e)=>new ko({valueType:r,minSize:null,maxSize:null,typeName:mt.ZodSet,...Ct(e)});var ys=class extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==qe.function)return je(t,{code:Pe.invalid_type,expected:qe.function,received:t.parsedType}),vt;function n(u,d){return fp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ap(),Fl].filter(g=>!!g),issueData:{code:Pe.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return fp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ap(),Fl].filter(g=>!!g),issueData:{code:Pe.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},f=t.data;return this._def.returns instanceof xs?sn(async(...u)=>{let d=new Ii([]),g=await this._def.args.parseAsync(u,s).catch(O=>{throw d.addIssue(n(u,O)),d}),y=await f(...g);return await this._def.returns._def.type.parseAsync(y,s).catch(O=>{throw d.addIssue(i(y,O)),d})}):sn((...u)=>{let d=this._def.args.safeParse(u,s);if(!d.success)throw new Ii([n(u,d.error)]);let g=f(...d.data),y=this._def.returns.safeParse(g,s);if(!y.success)throw new Ii([i(g,y.error)]);return y.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ys({...this._def,args:Zn.create(e).rest(Co.create())})}returns(e){return new ys({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ys({args:e||Zn.create([]).rest(Co.create()),returns:t||Co.create(),typeName:mt.ZodFunction,...Ct(n)})}};o(ys,"ZodFunction");var ma=class extends wt{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(ma,"ZodLazy");ma.create=(r,e)=>new ma({getter:r,typeName:mt.ZodLazy,...Ct(e)});var ba=class extends wt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return je(t,{code:Pe.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(ba,"ZodLiteral");ba.create=(r,e)=>new ba({value:r,typeName:mt.ZodLiteral,...Ct(e)});function p7(r,e){return new ga({values:r,typeName:mt.ZodEnum,...Ct(e)})}o(p7,"createZodEnum");var ga=class extends wt{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return je(t,{expected:Ft.joinValues(n),received:t.parsedType,code:Pe.invalid_type}),vt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),n=this._def.values;return je(t,{received:t.data,code:Pe.invalid_enum_value,options:n}),vt}return sn(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(ga,"ZodEnum");ga.create=p7;var va=class extends wt{_parse(e){let t=Ft.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==qe.string&&n.parsedType!==qe.number){let i=Ft.objectValues(t);return je(n,{expected:Ft.joinValues(i),received:n.parsedType,code:Pe.invalid_type}),vt}if(t.indexOf(e.data)===-1){let i=Ft.objectValues(t);return je(n,{received:n.data,code:Pe.invalid_enum_value,options:i}),vt}return sn(e.data)}get enum(){return this._def.values}};o(va,"ZodNativeEnum");va.create=(r,e)=>new va({values:r,typeName:mt.ZodNativeEnum,...Ct(e)});var xs=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==qe.promise&&t.common.async===!1)return je(t,{code:Pe.invalid_type,expected:qe.promise,received:t.parsedType}),vt;let n=t.parsedType===qe.promise?t.data:Promise.resolve(t.data);return sn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(xs,"ZodPromise");xs.create=(r,e)=>new xs({type:r,typeName:mt.ZodPromise,...Ct(e)});var In=class extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let f=i.transform(n.data);return n.common.async?Promise.resolve(f).then(u=>this._def.schema._parseAsync({data:u,path:n.path,parent:n})):this._def.schema._parseSync({data:f,path:n.path,parent:n})}let s={addIssue:f=>{je(n,f),f.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="refinement"){let f=o(u=>{let d=i.refinement(u,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?vt:(u.status==="dirty"&&t.dirty(),f(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?vt:(u.status==="dirty"&&t.dirty(),f(u.value).then(()=>({status:t.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!cp(f))return f;let u=i.transform(f.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>cp(f)?Promise.resolve(i.transform(f.value,s)).then(u=>({status:t.value,value:u})):f);Ft.assertNever(i)}};o(In,"ZodEffects");In.create=(r,e,t)=>new In({schema:r,typeName:mt.ZodEffects,effect:e,...Ct(t)});In.createWithPreprocess=(r,e,t)=>new In({schema:e,effect:{type:"preprocess",transform:r},typeName:mt.ZodEffects,...Ct(t)});var Qn=class extends wt{_parse(e){return this._getType(e)===qe.undefined?sn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Qn,"ZodOptional");Qn.create=(r,e)=>new Qn({innerType:r,typeName:mt.ZodOptional,...Ct(e)});var Io=class extends wt{_parse(e){return this._getType(e)===qe.null?sn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Io,"ZodNullable");Io.create=(r,e)=>new Io({innerType:r,typeName:mt.ZodNullable,...Ct(e)});var ya=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===qe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(ya,"ZodDefault");ya.create=(r,e)=>new ya({innerType:r,typeName:mt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ct(e)});var Sf=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:t});return up(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.defaultValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};o(Sf,"ZodCatch");Sf.create=(r,e)=>new Sf({innerType:r,typeName:mt.ZodCatch,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ct(e)});var Mf=class extends wt{_parse(e){if(this._getType(e)!==qe.nan){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.nan,received:n.parsedType}),vt}return{status:"valid",value:e.data}}};o(Mf,"ZodNaN");Mf.create=r=>new Mf({typeName:mt.ZodNaN,...Ct(r)});var ZH=Symbol("zod_brand"),Ul=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};o(Ul,"ZodBranded");var xa=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?vt:s.status==="dirty"?(t.dirty(),d7(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?vt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new xa({in:e,out:t,typeName:mt.ZodPipeline})}};o(xa,"ZodPipeline");var m7=o((r,e={},t)=>r?vs.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,f=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...f,fatal:t})}}):vs.create(),"custom"),QH={object:tr.lazycreate},mt;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",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.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline"})(mt||(mt={}));var ez=o((r,e={message:`Input not instance of ${r.name}`})=>m7(t=>t instanceof r,e,!0),"instanceOfType"),b7=Di.create,g7=to.create,tz=Mf.create,rz=fa.create,v7=ca.create,nz=To.create,iz=wf.create,oz=ua.create,sz=la.create,az=vs.create,fz=Co.create,cz=Ri.create,uz=_f.create,lz=kn.create,hz=tr.create,dz=tr.strictCreate,pz=ha.create,mz=Ef.create,bz=da.create,gz=Zn.create,vz=pa.create,yz=Af.create,xz=ko.create,wz=ys.create,_z=ma.create,Ez=ba.create,Az=ga.create,Sz=va.create,Mz=xs.create,l7=In.create,Tz=Qn.create,Cz=Io.create,kz=In.createWithPreprocess,Iz=xa.create,Dz=o(()=>b7().optional(),"ostring"),Rz=o(()=>g7().optional(),"onumber"),Oz=o(()=>v7().optional(),"oboolean"),Nz={string:r=>Di.create({...r,coerce:!0}),number:r=>to.create({...r,coerce:!0}),boolean:r=>ca.create({...r,coerce:!0}),bigint:r=>fa.create({...r,coerce:!0}),date:r=>To.create({...r,coerce:!0})},Pz=vt,B=Object.freeze({__proto__:null,defaultErrorMap:Fl,setErrorMap:jH,getErrorMap:ap,makeIssue:fp,EMPTY_PATH:GH,addIssueToContext:je,ParseStatus:Br,INVALID:vt,DIRTY:d7,OK:sn,isAborted:_2,isDirty:E2,isValid:cp,isAsync:up,get util(){return Ft},ZodParsedType:qe,getParsedType:aa,ZodType:wt,ZodString:Di,ZodNumber:to,ZodBigInt:fa,ZodBoolean:ca,ZodDate:To,ZodSymbol:wf,ZodUndefined:ua,ZodNull:la,ZodAny:vs,ZodUnknown:Co,ZodNever:Ri,ZodVoid:_f,ZodArray:kn,get objectUtil(){return lp},ZodObject:tr,ZodUnion:ha,ZodDiscriminatedUnion:Ef,ZodIntersection:da,ZodTuple:Zn,ZodRecord:pa,ZodMap:Af,ZodSet:ko,ZodFunction:ys,ZodLazy:ma,ZodLiteral:ba,ZodEnum:ga,ZodNativeEnum:va,ZodPromise:xs,ZodEffects:In,ZodTransformer:In,ZodOptional:Qn,ZodNullable:Io,ZodDefault:ya,ZodCatch:Sf,ZodNaN:Mf,BRAND:ZH,ZodBranded:Ul,ZodPipeline:xa,custom:m7,Schema:wt,ZodSchema:wt,late:QH,get ZodFirstPartyTypeKind(){return mt},coerce:Nz,any:az,array:lz,bigint:rz,boolean:v7,date:nz,discriminatedUnion:mz,effect:l7,enum:Az,function:wz,instanceof:ez,intersection:bz,lazy:_z,literal:Ez,map:yz,nan:tz,nativeEnum:Sz,never:cz,null:sz,nullable:Cz,number:g7,object:hz,oboolean:Oz,onumber:Rz,optional:Tz,ostring:Dz,pipeline:Iz,preprocess:kz,promise:Mz,record:vz,set:xz,strictObject:dz,string:b7,symbol:iz,transformer:l7,tuple:gz,undefined:oz,union:pz,unknown:fz,void:uz,NEVER:Pz,ZodIssueCode:Pe,quotelessJson:KH,ZodError:Ii});var dp=B.array(B.string().or(B.record(B.any()))),Rne=B.object({type:B.string().optional(),narrative:B.string().optional()}),pp=B.string().or(B.object({id:B.string(),type:B.string(),caption:B.string().optional()})),Lz=B.object({type:B.string().min(1).or(B.string().array().nonempty()),latitude:B.number(),longitude:B.number()}),Bz=B.object({type:B.string().min(1).or(B.string().array().nonempty()),addressCountry:B.string().optional(),addressCountryCode:B.string().optional(),addressRegion:B.string().optional(),addressLocality:B.string().optional(),streetAddress:B.string().optional(),postOfficeBoxNumber:B.string().optional(),postalCode:B.string().optional(),geo:Lz.optional()}),Uz=B.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(B.string()),x7=B.object({type:B.string().min(1).or(B.string().array().nonempty()),identifier:B.string(),identifierType:Uz}),$l=B.string().or(B.object({id:B.string().optional(),type:B.string().or(B.string().array().nonempty().optional()),name:B.string().optional(),url:B.string().optional(),phone:B.string().optional(),description:B.string().optional(),endorsement:B.any().array().optional(),image:pp.optional(),email:B.string().email().optional(),address:Bz.optional(),otherIdentifier:x7.array().optional(),official:B.string().optional(),parentOrg:B.any().optional(),familyName:B.string().optional(),givenName:B.string().optional(),additionalName:B.string().optional(),patronymicName:B.string().optional(),honorificPrefix:B.string().optional(),honorificSuffix:B.string().optional(),familyNamePrefix:B.string().optional(),dateOfBirth:B.string().optional()}).catchall(B.any())),S2=B.object({id:B.string().optional()}).catchall(B.any()),Fz=B.object({type:B.string(),id:B.string()}).catchall(B.any()),$z=B.object({id:B.string(),type:B.string()}).catchall(B.any()),qz=B.object({id:B.string(),type:B.string()}).catchall(B.any()),hp=B.object({"@context":dp,id:B.string().optional(),type:B.string().array().nonempty(),issuer:$l,issuanceDate:B.string(),expirationDate:B.string().optional(),credentialSubject:S2.or(S2.array()),credentialStatus:Fz.optional(),credentialSchema:$z.array().optional(),refreshService:qz.optional()}).catchall(B.any()),Do=B.object({type:B.string(),created:B.string(),challenge:B.string().optional(),domain:B.string().optional(),nonce:B.string().optional(),proofPurpose:B.string(),verificationMethod:B.string(),jws:B.string().optional()}).catchall(B.any()),ql=hp.extend({proof:Do.or(Do.array())}),Hz=B.object({"@context":dp,id:B.string().optional(),type:B.string().or(B.string().array().nonempty()),verifiableCredential:ql.or(ql.array()).optional(),holder:B.string().optional()}).catchall(B.any()),T2=Hz.extend({proof:Do.or(Do.array())}),w7=B.object({kty:B.string(),crv:B.string(),x:B.string(),y:B.string().optional(),n:B.string().optional(),d:B.string()}),zz=B.object({alg:B.string(),iv:B.string(),tag:B.string(),epk:w7.partial().optional(),kid:B.string().optional(),apv:B.string().optional(),apu:B.string().optional()}),Kz=B.object({header:zz,encrypted_key:B.string()}),jz=B.object({protected:B.string(),iv:B.string(),ciphertext:B.string(),tag:B.string(),aad:B.string().optional(),recipients:Kz.array().optional()}),Tf=B.string().or(B.object({"@context":dp.optional(),id:B.string(),type:B.string(),controller:B.string(),publicKeyJwk:w7.optional(),publicKeyBase58:B.string().optional(),blockChainAccountId:B.string().optional()}).catchall(B.any())),Gz=B.object({id:B.string(),type:B.string().or(B.string().array().nonempty()),serviceEndpoint:B.any().or(B.any().array().nonempty())}).catchall(B.any()),Pne=B.object({"@context":dp,id:B.string(),alsoKnownAs:B.string().optional(),controller:B.string().or(B.string().array().nonempty()).optional(),verificationMethod:Tf.array().optional(),authentication:Tf.array().optional(),assertionMethod:Tf.array().optional(),keyAgreement:Tf.array().optional(),capabilityInvocation:Tf.array().optional(),capabilityDelegation:Tf.array().optional(),publicKey:Tf.array().optional(),service:Gz.array().optional(),proof:Do.or(Do.array()).optional()}).catchall(B.any()),Vz=B.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(B.string()),mp=B.object({type:B.string().array().nonempty(),targetCode:B.string().optional(),targetDescription:B.string().optional(),targetName:B.string(),targetFramework:B.string().optional(),targetType:Vz.optional(),targetUrl:B.string()}),Wz=B.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"]),Jz=Wz.or(B.string()),Yz=B.object({id:B.string().optional(),narrative:B.string().optional()}).catchall(B.any()),Xz=B.object({id:B.string(),type:B.string().array().nonempty(),endorsementComment:B.string().optional()}),Zz=hp.extend({credentialSubject:Xz,proof:Do.or(Do.array()).optional()}),Qz=B.object({id:B.string(),"@language":B.string().optional(),version:B.string().optional()}),eK=B.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(B.string()),tK=B.object({id:B.string(),type:B.string().array().nonempty(),alignment:mp.array().optional(),description:B.string().optional(),level:B.string().optional(),name:B.string(),points:B.string().optional()}).catchall(B.any()),rK=B.object({id:B.string(),type:B.string().array().nonempty(),alignment:mp.array().optional(),allowedValue:B.string().array().optional(),name:B.string(),requiredLevel:B.string().optional(),requiredValue:B.string().optional(),resultType:eK,rubricCriterionLevel:tK.array().optional(),valueMax:B.string().optional(),valueMin:B.string().optional()}).catchall(B.any()),nK=B.object({id:B.string().optional(),type:B.string().array().nonempty(),alignment:mp.array().optional(),achievementType:Jz.optional(),creator:$l.optional(),creditsAvailable:B.number().optional(),criteria:Yz,description:B.string(),endorsement:Zz.array().optional(),fieldOfStudy:B.string().optional(),humanCode:B.string().optional(),image:pp.optional(),"@language":B.string().optional(),name:B.string(),otherIdentifier:x7.array().optional(),related:Qz.array().optional(),resultDescription:rK.array().optional(),specialization:B.string().optional(),tag:B.string().array().optional(),version:B.string().optional()}).catchall(B.any()),iK=B.object({type:B.string(),hashed:B.boolean(),identityHash:B.string(),identityType:B.string(),salt:B.string().optional()}),oK=B.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),sK=B.object({type:B.string().array().nonempty(),achievedLevel:B.string().optional(),alignment:mp.array().optional(),resultDescription:B.string().optional(),status:oK.optional(),value:B.string().optional()}).catchall(B.any()),y7=B.object({id:B.string().optional(),type:B.string().array().nonempty(),activityEndDate:B.string().optional(),activityStartDate:B.string().optional(),creditsEarned:B.number().optional(),achievement:nK.optional(),identifier:iK.array().optional(),image:pp.optional(),licenseNumber:B.string().optional(),narrative:B.string().optional(),result:sK.array().optional(),role:B.string().optional(),source:$l.optional(),term:B.string().optional()}).catchall(B.any()),aK=B.object({id:B.string().optional(),type:B.string().array().nonempty(),narrative:B.string().optional(),name:B.string().optional(),description:B.string().optional(),genre:B.string().optional(),audience:B.string().optional()}).catchall(B.any()),fK=hp.extend({name:B.string().optional(),description:B.string().optional(),image:pp.optional(),credentialSubject:y7.or(y7.array()),endorsement:hp.array().optional(),evidence:aK.array().optional()}),Bne=fK.extend({proof:Do.or(Do.array())}),Fne=B.object({checks:B.string().array(),warnings:B.string().array(),errors:B.string().array()}),_7=B.enum(["Success","Failed","Error"]),$ne=_7.enum,qne=B.object({check:B.string(),status:_7,message:B.string().optional(),details:B.string().optional()}),Hne=B.object({title:B.string().optional(),createdAt:B.string().optional(),issuer:$l.optional(),issuee:$l.optional(),credentialSubject:S2.optional()}),zne=B.object({id:B.string(),uri:B.string()}).catchall(B.any()),Gne=B.object({limit:B.number(),cursor:B.string().optional(),sort:B.string().optional()}),ws=B.object({cursor:B.string().optional(),hasMore:B.boolean()}),E7=B.object({encryptedRecord:jz,fields:B.string().array()}).catchall(B.any()),Vne=ws.extend({records:E7.array()}),cK=E7.extend({id:B.string()}),Wne=ws.extend({records:cK.array()}),tu=B.object({profileId:B.string().min(3).max(40),displayName:B.string().default(""),shortBio:B.string().default(""),bio:B.string().default(""),did:B.string(),email:B.string().optional(),image:B.string().optional(),heroImage:B.string().optional(),websiteLink:B.string().optional(),isServiceProfile:B.boolean().default(!1).optional(),type:B.string().optional(),notificationsWebhook:B.string().url().startsWith("http").optional()}),Yne=ws.extend({records:tu.array()}),Xne=B.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Zne=B.object({uri:B.string(),to:B.string(),from:B.string(),sent:B.string().datetime(),received:B.string().datetime().optional()}),uK=B.enum(["DRAFT","LIVE"]),lK=B.object({uri:B.string(),name:B.string().optional(),type:B.string().optional(),category:B.string().optional(),status:uK.optional(),autoConnectRecipients:B.boolean().optional()}),Qne=ws.extend({records:lK.array()}),hK=B.object({to:tu,from:B.string(),received:B.string().optional()}),eie=ws.extend({records:hK.array()}),tie=B.object({endpoint:B.string(),name:B.string(),did:B.string().optional()}),rie=B.object({ttlSeconds:B.number().optional(),totalUses:B.number().optional()}),dK=B.object({endpoint:B.string()}),nie=B.object({signingAuthority:dK,relationship:B.object({name:B.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:B.string()})}),pK=B.enum(["live","stale","withdrawn"]),mK=B.object({read:B.object({anonymize:B.boolean().optional(),credentials:B.object({categories:B.record(B.object({required:B.boolean()})).default({})}).default({}),personal:B.record(B.object({required:B.boolean()})).default({})}).default({}),write:B.object({credentials:B.object({categories:B.record(B.object({required:B.boolean()})).default({})}).default({}),personal:B.record(B.object({required:B.boolean()})).default({})}).default({})}),A7=B.object({contract:mK,owner:tu,name:B.string(),subtitle:B.string().optional(),description:B.string().optional(),reasonForAccessing:B.string().optional(),image:B.string().optional(),uri:B.string(),createdAt:B.string(),updatedAt:B.string(),expiresAt:B.string().optional()}),iie=ws.extend({records:A7.omit({owner:!0}).array()}),bK=B.object({credentials:B.object({categories:B.record(B.string().array()).default({})}),personal:B.record(B.string()).default({}),date:B.string()}),oie=ws.extend({records:bK.array()}),S7=B.object({sharing:B.boolean().optional(),shared:B.string().array().optional(),shareAll:B.boolean().optional(),shareUntil:B.string().optional()}),M7=B.object({read:B.object({anonymize:B.boolean().optional(),credentials:B.object({shareAll:B.boolean().optional(),sharing:B.boolean().optional(),categories:B.record(S7).default({})}).default({}),personal:B.record(B.string()).default({})}).default({}),write:B.object({credentials:B.object({categories:B.record(B.boolean()).default({})}).default({}),personal:B.record(B.boolean()).default({})}).default({})}),sie=ws.extend({records:B.object({expiresAt:B.string().optional(),oneTime:B.boolean().optional(),terms:M7,contract:A7,uri:B.string(),consenter:tu,status:pK}).array()}),aie=B.object({read:B.object({anonymize:B.boolean().optional(),credentials:B.object({categories:B.record(B.object({required:B.boolean().optional()})).optional()}).optional(),personal:B.record(B.object({required:B.boolean().optional()})).optional()}).optional(),write:B.object({credentials:B.object({categories:B.record(B.object({required:B.boolean().optional()})).optional()}).optional(),personal:B.record(B.object({required:B.boolean().optional()})).optional()}).optional()}),fie=B.object({anonymize:B.boolean().optional(),credentials:B.object({categories:B.record(B.boolean()).optional()}).optional(),personal:B.record(B.boolean()).optional()}),gK=B.object({read:B.object({anonymize:B.boolean().optional(),credentials:B.object({shareAll:B.boolean().optional(),sharing:B.boolean().optional(),categories:B.record(S7.optional()).optional()}).optional(),personal:B.record(B.string()).optional()}).optional(),write:B.object({credentials:B.object({categories:B.record(B.boolean()).optional()}).optional(),personal:B.record(B.boolean()).optional()}).optional()}),M2=B.enum(["consent","update","sync","withdraw"]),cie=B.object({terms:gK.optional(),action:M2.or(M2.array()).optional(),date:B.object({$gt:B.string()}).or(B.object({$lt:B.string()})).or(B.object({$eq:B.string()})).optional(),expiresAt:B.object({$gt:B.string()}).or(B.object({$lt:B.string()})).or(B.object({$eq:B.string()})).optional(),oneTime:B.boolean().optional()}),T7=B.object({expiresAt:B.string().optional(),oneTime:B.boolean().optional(),terms:M7.optional(),id:B.string(),action:M2,date:B.string()}),uie=ws.extend({records:T7.array()}),vK=B.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),yK=B.object({title:B.string().optional(),body:B.string().optional()}),xK=B.object({vcUris:B.array(B.string()).optional(),vpUris:B.array(B.string()).optional(),transaction:T7.optional()}),lie=B.object({type:vK,to:tu.partial().and(B.object({did:B.string()})),from:tu.partial().and(B.object({did:B.string()})),message:yK.optional(),data:xK.optional(),sent:B.string().datetime().optional()});var bp=o(r=>`lc:ceramic:${r}`,"streamIdToCeramicURI");var C2=B.string().refine(r=>r.split(":").length===3&&r.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(r=>r.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var gp=o(async(r,{ceramicEndpoint:e,defaultContentFamily:t})=>{let n=new Bl(e),i=o(async(R,I,N,X)=>r.invoke.didResolver(R,X),"learnCardResolver"),s={...f_.getResolver(),web:i},f=new of({resolver:s});n.did=f;let u=r.invoke.getKey(),d=new hl(K8(u));n.did.setProvider(d),await n.did.authenticate();let g=new Il({ceramic:n}),y=o(async(R,I={},N={},X)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=t),"pin"in N||(N.pin=!0),X?.encrypt){r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",X);let J=X?.recipients||[];X?.controllersCanDecrypt&&(J=[...J,...I.controllers]),R=await n?.did?.createDagJWE(R,C7.default.uniq(J))}return r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,N),(await Yn.create(n,R,I,N)).id.toString()},"publishContentToCeramic"),E=o(async R=>{let I=(await g.load(R))?.content;if(r.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await f.decryptDagJWE(I)}catch(N){throw r.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",N),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await ql.or(T2).parseAsync(R),bp(await y(R,{},{},I))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,I)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(I)),uploadEncrypted:async(R,I,N)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...N?{recipients:N.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let N=await C2.spa(I);if(!N.success)return;let X=N.data.split(":")[2];try{return await ql.or(T2).parseAsync(await E(X))}catch(L){R.debug?.(L);return}}},methods:{publishContentToCeramic:async(R,I,N)=>bp(await y(I,{},{},N)),readContentFromCeramic:async(R,I)=>E(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var wK=gp;
821
+ `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function pf(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(pf,"arrRemove");var oa=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 f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var u=ds(f),d=u.next();!d.done;d=u.next()){var g=d.value;g.remove(this)}}catch(P){e={error:P}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else f.remove(this);var y=this.initialTeardown;if(St(y))try{y()}catch(P){s=P instanceof N0?P.errors:[P]}var E=this._finalizers;if(E){this._finalizers=null;try{for(var O=ds(E),R=O.next();!R.done;R=O.next()){var I=R.value;try{bE(I)}catch(P){s=s??[],P instanceof N0?s=Zi(Zi([],Wn(s)),Wn(P.errors)):s.push(P)}}}catch(P){n={error:P}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(s)throw new N0(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)bE(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)&&pf(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&pf(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var Kg=oa.EMPTY;function P0(r){return r instanceof oa||r&&"closed"in r&&St(r.remove)&&St(r.add)&&St(r.unsubscribe)}o(P0,"isSubscription");function bE(r){St(r)?r():r.unsubscribe()}o(bE,"execFinalizer");var Qi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Kc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Kc.delegate;return i?.setTimeout?i.setTimeout.apply(i,Zi([r,e],Wn(t))):setTimeout.apply(void 0,Zi([r,e],Wn(t)))},clearTimeout:function(r){var e=Kc.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function L0(r){Kc.setTimeout(function(){var e=Qi.onUnhandledError;if(e)e(r);else throw r})}o(L0,"reportUnhandledError");function jg(){}o(jg,"noop");var gE=function(){return Gg("C",void 0,void 0)}();function vE(r){return Gg("E",void 0,r)}o(vE,"errorNotification");function yE(r){return Gg("N",r,void 0)}o(yE,"nextNotification");function Gg(r,e,t){return{kind:r,value:e,error:t}}o(Gg,"createNotification");var mf=null;function jc(r){if(Qi.useDeprecatedSynchronousErrorHandling){var e=!mf;if(e&&(mf={errorThrown:!1,error:null}),r(),e){var t=mf,n=t.errorThrown,i=t.error;if(mf=null,n)throw i}}else r()}o(jc,"errorContext");function xE(r){Qi.useDeprecatedSynchronousErrorHandling&&mf&&(mf.errorThrown=!0,mf.error=r)}o(xE,"captureError");var wl=function(r){rn(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,P0(t)&&t.add(n)):n.destination=z$,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new U0(t,n,i)},e.prototype.next=function(t){this.isStopped?Wg(yE(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Wg(vE(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Wg(gE,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}(oa);var $$=Function.prototype.bind;function Vg(r,e){return $$.call(r,e)}o(Vg,"bind");var q$=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){B0(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){B0(n)}else B0(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){B0(t)}},r}(),U0=function(r){rn(e,r);function e(t,n,i){var s=r.call(this)||this,f;if(St(t)||!t)f={next:t??void 0,error:n??void 0,complete:i??void 0};else{var u;s&&Qi.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()},f={next:t.next&&Vg(t.next,u),error:t.error&&Vg(t.error,u),complete:t.complete&&Vg(t.complete,u)}):f=t}return s.destination=new q$(f),s}return o(e,"SafeSubscriber"),e}(wl);function B0(r){Qi.useDeprecatedSynchronousErrorHandling?xE(r):L0(r)}o(B0,"handleUnhandledError");function H$(r){throw r}o(H$,"defaultErrorHandler");function Wg(r,e){var t=Qi.onStoppedNotification;t&&Kc.setTimeout(function(){return t(r,e)})}o(Wg,"handleStoppedNotification");var z$={closed:!0,next:jg,error:H$,complete:jg};var Gc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Vc(r){return r}o(Vc,"identity");function wE(r){return r.length===0?Vc:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(wE,"pipeFromArray");var Jt=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=j$(e)?e:new U0(e,t,n);return jc(function(){var f=i,u=f.operator,d=f.source;s.add(u?u.call(s,d):d?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=_E(t),new t(function(i,s){var f=new U0({next:function(u){try{e(u)}catch(d){s(d),f.unsubscribe()}},error:s,complete:i});n.subscribe(f)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Gc]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wE(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=_E(e),new e(function(n,i){var s;t.subscribe(function(f){return s=f},function(f){return i(f)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function _E(r){var e;return(e=r??Qi.Promise)!==null&&e!==void 0?e:Promise}o(_E,"getPromiseCtor");function K$(r){return r&&St(r.next)&&St(r.error)&&St(r.complete)}o(K$,"isObserver");function j$(r){return r&&r instanceof wl||K$(r)&&P0(r)}o(j$,"isSubscriber");function G$(r){return St(r?.lift)}o(G$,"hasLift");function Pr(r){return function(e){if(G$(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(Pr,"operate");function Lr(r,e,t,n,i){return new V$(r,e,t,n,i)}o(Lr,"createOperatorSubscriber");var V$=function(r){rn(e,r);function e(t,n,i,s,f,u){var d=r.call(this,t)||this;return d.onFinalize=f,d.shouldUnsubscribe=u,d._next=n?function(g){try{n(g)}catch(y){t.error(y)}}:r.prototype._next,d._error=s?function(g){try{s(g)}catch(y){t.error(y)}finally{this.unsubscribe()}}:r.prototype._error,d._complete=i?function(){try{i()}catch(g){t.error(g)}finally{this.unsubscribe()}}:r.prototype._complete,d}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}(wl);var EE=zc(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Jg=function(r){rn(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 AE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new EE},e.prototype.next=function(t){var n=this;jc(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var f=ds(n.currentObservers),u=f.next();!u.done;u=f.next()){var d=u.value;d.next(t)}}catch(g){i={error:g}}finally{try{u&&!u.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;jc(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;jc(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,f=i.isStopped,u=i.observers;return s||f?Kg:(this.currentObservers=null,u.push(t),new oa(function(){n.currentObservers=null,pf(u,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,f=n.isStopped;i?t.error(s):f&&t.complete()},e.prototype.asObservable=function(){var t=new Jt;return t.source=this,t},e.create=function(t,n){return new AE(t,n)},e}(Jt);var AE=function(r){rn(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:Kg},e}(Jg);var Yg=function(r){rn(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}(Jg);var Xg={now:function(){return(Xg.delegate||Date).now()},delegate:void 0};var SE=function(r){rn(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}(oa);var _l={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=_l.delegate;return i?.setInterval?i.setInterval.apply(i,Zi([r,e],Wn(t))):setInterval.apply(void 0,Zi([r,e],Wn(t)))},clearInterval:function(r){var e=_l.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var ME=function(r){rn(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){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var s=this.id,f=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(f,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(f,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),_l.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;n!=null&&_l.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(f){i=!0,s=f||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,pf(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(SE);var Zg=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=Xg.now,r}();var TE=function(r){rn(e,r);function e(t,n){n===void 0&&(n=Zg.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,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}(Zg);var W$=new TE(ME),CE=W$;var F0=new Jt(function(r){return r.complete()});function $0(r){return r&&St(r.schedule)}o($0,"isScheduler");function kE(r){return r[r.length-1]}o(kE,"last");function IE(r){return $0(kE(r))?r.pop():void 0}o(IE,"popScheduler");function DE(r,e){return typeof kE(r)=="number"?r.pop():e}o(DE,"popNumber");var Wc=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function q0(r){return St(r?.then)}o(q0,"isPromise");function H0(r){return St(r[Gc])}o(H0,"isInteropObservable");function z0(r){return Symbol.asyncIterator&&St(r?.[Symbol.asyncIterator])}o(z0,"isAsyncIterable");function K0(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(K0,"createInvalidObservableTypeError");function J$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(J$,"getSymbolIterator");var j0=J$();function G0(r){return St(r?.[j0])}o(G0,"isIterable");function V0(r){return pE(this,arguments,o(function(){var t,n,i,s;return O0(this,function(f){switch(f.label){case 0:t=r.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,df(t.read())];case 3:return n=f.sent(),i=n.value,s=n.done,s?[4,df(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,df(i)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(V0,"readableStreamLikeToAsyncGenerator");function W0(r){return St(r?.getReader)}o(W0,"isReadableStreamLike");function nn(r){if(r instanceof Jt)return r;if(r!=null){if(H0(r))return Y$(r);if(Wc(r))return X$(r);if(q0(r))return Z$(r);if(z0(r))return RE(r);if(G0(r))return Q$(r);if(W0(r))return eq(r)}throw K0(r)}o(nn,"innerFrom");function Y$(r){return new Jt(function(e){var t=r[Gc]();if(St(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Y$,"fromInteropObservable");function X$(r){return new Jt(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(X$,"fromArrayLike");function Z$(r){return new Jt(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,L0)})}o(Z$,"fromPromise");function Q$(r){return new Jt(function(e){var t,n;try{for(var i=ds(r),s=i.next();!s.done;s=i.next()){var f=s.value;if(e.next(f),e.closed)return}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(Q$,"fromIterable");function RE(r){return new Jt(function(e){tq(r,e).catch(function(t){return e.error(t)})})}o(RE,"fromAsyncIterable");function eq(r){return RE(V0(r))}o(eq,"fromReadableStreamLike");function tq(r,e){var t,n,i,s;return dE(this,void 0,void 0,function(){var f,u;return O0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),t=mE(r),d.label=1;case 1:return[4,t.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(f=n.value,e.next(f),e.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),i={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:d.sent(),d.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(tq,"process");function ki(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(ki,"executeSchedule");function J0(r,e){return e===void 0&&(e=0),Pr(function(t,n){t.subscribe(Lr(n,function(i){return ki(n,r,function(){return n.next(i)},e)},function(){return ki(n,r,function(){return n.complete()},e)},function(i){return ki(n,r,function(){return n.error(i)},e)}))})}o(J0,"observeOn");function Y0(r,e){return e===void 0&&(e=0),Pr(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(Y0,"subscribeOn");function OE(r,e){return nn(r).pipe(Y0(e),J0(e))}o(OE,"scheduleObservable");function NE(r,e){return nn(r).pipe(Y0(e),J0(e))}o(NE,"schedulePromise");function PE(r,e){return new Jt(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(PE,"scheduleArray");function LE(r,e){return new Jt(function(t){var n;return ki(t,e,function(){n=r[j0](),ki(t,e,function(){var i,s,f;try{i=n.next(),s=i.value,f=i.done}catch(u){t.error(u);return}f?t.complete():t.next(s)},0,!0)}),function(){return St(n?.return)&&n.return()}})}o(LE,"scheduleIterable");function X0(r,e){if(!r)throw new Error("Iterable cannot be null");return new Jt(function(t){ki(t,e,function(){var n=r[Symbol.asyncIterator]();ki(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(X0,"scheduleAsyncIterable");function BE(r,e){return X0(V0(r),e)}o(BE,"scheduleReadableStreamLike");function UE(r,e){if(r!=null){if(H0(r))return OE(r,e);if(Wc(r))return PE(r,e);if(q0(r))return NE(r,e);if(z0(r))return X0(r,e);if(G0(r))return LE(r,e);if(W0(r))return BE(r,e)}throw K0(r)}o(UE,"scheduled");function FE(r,e){return e?UE(r,e):nn(r)}o(FE,"from");var Z0=zc(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function $E(r){return r instanceof Date&&!isNaN(r)}o($E,"isValidDate");function Q0(r,e){return Pr(function(t,n){var i=0;t.subscribe(Lr(n,function(s){n.next(r.call(e,s,i++))}))})}o(Q0,"map");var rq=Array.isArray;function nq(r,e){return rq(e)?r.apply(void 0,Zi([],Wn(e))):r(e)}o(nq,"callOrApply");function qE(r){return Q0(function(e){return nq(r,e)})}o(qE,"mapOneOrManyArgs");function HE(r,e,t,n,i,s,f,u){var d=[],g=0,y=0,E=!1,O=o(function(){E&&!d.length&&!g&&e.complete()},"checkComplete"),R=o(function(P){return g<n?I(P):d.push(P)},"outerNext"),I=o(function(P){s&&e.next(P),g++;var X=!1;nn(t(P,y++)).subscribe(Lr(e,function(B){i?.(B),s?R(B):e.next(B)},function(){X=!0},void 0,function(){if(X)try{g--;for(var B=o(function(){var J=d.shift();f?ki(e,f,function(){return I(J)}):I(J)},"_loop_1");d.length&&g<n;)B();O()}catch(J){e.error(J)}}))},"doInnerSub");return r.subscribe(Lr(e,R,function(){E=!0,O()})),function(){u?.()}}o(HE,"mergeInternals");function El(r,e,t){return t===void 0&&(t=1/0),St(e)?El(function(n,i){return Q0(function(s,f){return e(n,s,i,f)})(nn(r(n,i)))},t):(typeof e=="number"&&(t=e),Pr(function(n,i){return HE(n,i,r,t)}))}o(El,"mergeMap");function zE(r){return r===void 0&&(r=1/0),El(Vc,r)}o(zE,"mergeAll");var iq=["addListener","removeListener"],oq=["addEventListener","removeEventListener"],sq=["on","off"];function Al(r,e,t,n){if(St(t)&&(n=t,t=void 0),n)return Al(r,e,t).pipe(qE(n));var i=Wn(cq(r)?oq.map(function(u){return function(d){return r[u](e,d,t)}}):aq(r)?iq.map(KE(r,e)):fq(r)?sq.map(KE(r,e)):[],2),s=i[0],f=i[1];if(!s&&Wc(r))return El(function(u){return Al(u,e,t)})(nn(r));if(!s)throw new TypeError("Invalid event target");return new Jt(function(u){var d=o(function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return u.next(1<g.length?g:g[0])},"handler");return s(d),function(){return f(d)}})}o(Al,"fromEvent");function KE(r,e){return function(t){return function(n){return r[t](e,n)}}}o(KE,"toCommonHandlerRegistry");function aq(r){return St(r.addListener)&&St(r.removeListener)}o(aq,"isNodeStyleEventEmitter");function fq(r){return St(r.on)&&St(r.off)}o(fq,"isJQueryStyleEventEmitter");function cq(r){return St(r.addEventListener)&&St(r.removeEventListener)}o(cq,"isEventTarget");function Sl(r,e,t){r===void 0&&(r=0),t===void 0&&(t=CE);var n=-1;return e!=null&&($0(e)?t=e:n=e),new Jt(function(i){var s=$E(r)?+r-t.now():r;s<0&&(s=0);var f=0;return t.schedule(function(){i.closed||(i.next(f++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(Sl,"timer");function Qg(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=IE(r),n=DE(r,1/0),i=r;return i.length?i.length===1?nn(i[0]):zE(n)(FE(i,t)):F0}o(Qg,"merge");function jE(r,e){return Pr(function(t,n){var i=0;t.subscribe(Lr(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(jE,"filter");function GE(r){return Pr(function(e,t){var n=!1;e.subscribe(Lr(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(GE,"defaultIfEmpty");function VE(r){return r<=0?function(){return F0}:Pr(function(e,t){var n=0;e.subscribe(Lr(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(VE,"take");function WE(r){return r===void 0&&(r=uq),Pr(function(e,t){var n=!1;e.subscribe(Lr(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(WE,"throwIfEmpty");function uq(){return new Z0}o(uq,"defaultErrorFactory");function e2(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?jE(function(i,s){return r(i,s,n)}):Vc,VE(1),t?GE(e):WE(function(){return new Z0}))}}o(e2,"first");function t2(r,e){return Pr(function(t,n){var i=e??{},s=i.leading,f=s===void 0?!0:s,u=i.trailing,d=u===void 0?!1:u,g=!1,y=null,E=null,O=!1,R=o(function(){E?.unsubscribe(),E=null,d&&(X(),O&&n.complete())},"endThrottling"),I=o(function(){E=null,O&&n.complete()},"cleanupThrottling"),P=o(function(B){return E=nn(r(B)).subscribe(Lr(n,R,I))},"startThrottle"),X=o(function(){if(g){g=!1;var B=y;y=null,n.next(B),!O&&P(B)}},"send");t.subscribe(Lr(n,function(B){g=!0,y=B,!(E&&!E.closed)&&(f?X():P(B))},function(){O=!0,!(d&&g&&E&&!E.closed)&&n.complete()}))})}o(t2,"throttle");var JE;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(JE||(JE={}));var Ml;(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"})(Ml||(Ml={}));var n2;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(n2||(n2={}));var ps=class extends Jt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new nt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,r2.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===n2.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,r2.default)(this.state$.value)}async sync(e={}){e={sync:wr.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(ps,"Stream");function Jc(){return r=>{}}o(Jc,"StreamStatic");var t9=Bt(ZE(),1);function QE(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):(Qg(...r.map(t=>Al(t,"abort"))).pipe(e2()).subscribe(()=>{e.abort()}),e.signal)}o(QE,"mergeAbortSignals");var Tl=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=Sl(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}};o(Tl,"TimedAbortSignal");async function e9(r,e){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(e9,"abortable");var lq=60*1e3*3;async function jr(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let t=e.timeout||lq,n=new Tl(t),i=e.signal?QE([e.signal,n.signal]):n.signal,s=await e9(i,f=>(0,t9.default)(String(r),{...e,signal:f})).finally(()=>n.clear());if(!s.ok){let f=await s.text();throw new Error(`HTTP request to '${r}' failed with status '${s.statusText}': ${f}`)}return s.json()}o(jr,"fetchJson");var Cl=Bt(Uc(),1);$i();function bs(r){let e=Je.asCID(r);if(e)return e;if(typeof r=="string")return Je.parse(r);if(r instanceof Uint8Array)return Je.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(bs,"toCID");var r9=0,Zt=class{static streamIdFromState(e){return new nt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,Cl.default)(e);return Zt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=It(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=It(t.cacaoBlock,"base64")),t):(Zt.isSignedCommit(e)&&(t.link=t.link.toString()),Zt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=It(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,Cl.default)(e);return Zt.isSignedCommitContainer(t)?(t.jws.link=bs(t.jws.link),t.linkedBlock=Ut(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ut(t.cacaoBlock,"base64")),t):(Zt.isSignedCommit(t)&&(t.link=bs(t.link)),Zt.isAnchorCommit(t)&&(t.proof=bs(t.proof)),t.id&&(t.id=bs(t.id)),t.prev&&(t.prev=bs(t.prev)),t.header?.model&&(t.header.model=Ut(t.header.model,"base64")),t)}static serializeState(e){let t=(0,Cl.default)(e);return t.log=t.log.map(n=>({...n,cid:n.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Ml[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=r9&&(t.metadata.unique=It(t.metadata.unique,"base64")),t.doctype=Tn.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,Cl.default)(e);return t.doctype&&(t.type=Tn.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(n=>({...n,cid:bs(n.cid)})),t.anchorProof&&(t.anchorProof.txHash=bs(t.anchorProof.txHash),t.anchorProof.root=bs(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Ml[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=nt.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=nt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=r9&&(t.metadata.unique=Ut(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Zt.serializeState(e))===JSON.stringify(Zt.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.log.length===t.log.length&&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 async convertCommitToSignedCommitContainer(e,t){if(Zt.isSignedCommit(e)){let n=await 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(Zt,"StreamUtils");var kl=class extends Yg{next(e){let t=this.value;Zt.statesEqual(t,e)||super.next(e)}};o(kl,"StreamStateSubject");var hq=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Jn,i2={anchor:!0,publish:!0,pin:!0,sync:wr.PREFER_CACHE},dq={sync:wr.PREFER_CACHE},n9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function o2(r,e){if(typeof r?.schema=="string")try{Pt.fromString(r.schema)}catch{throw new Error("Schema must be a CommitID")}let t={controllers:r?.controllers,family:r?.family,schema:r?.schema?.toString(),tags:r?.tags};if(e)r?.deterministic||(t.unique=It((0,s9.randomBytes)(12),"base64")),r?.forbidControllerChange&&(t.forbidControllerChange=!0);else{if(r?.deterministic!==void 0||r?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(r?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(n=>t[n]===void 0&&delete t[n]),t}o(o2,"headerFromMetadata");async function i9(r){if(!r.did)throw new Error("No DID provided");return r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`)),r.did}o(i9,"getAuthenticatedDID");async function s2(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(s2,"throwReadOnlyError");var Yn=Jn=o(class extends ps{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,o9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async create(e,t,n,i={}){i={...i2,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let s=i.asDID?{did:i.asDID}:e,f=await Jn.makeGenesis(s,t,n);return e.createStreamFromGenesis(Jn.STREAM_TYPE_ID,f,i)}static async createFromGenesis(e,t,n={}){n={...i2,...n},t.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=t.data?await Jn._signDagJWS(e,t):t;return e.createStreamFromGenesis(Jn.STREAM_TYPE_ID,i,n)}static async deterministic(e,t,n={}){if(n={...i2,...n},t={...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 i=await Jn.makeGenesis(e,null,t);return e.createStreamFromGenesis(Jn.STREAM_TYPE_ID,i,n)}static async load(e,t,n={}){n={...dq,...n};let i=ln.from(t);if(i.type!=Jn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Jn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,t,n={}){n={...n9,...n};let i=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(i,e,t),f=await this.api.applyCommit(this.id,s,n);this.state$.next(f.state)}async patch(e,t={}){t={...n9,...t};let i={header:o2(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},s=await Jn._signDagJWS(this.api,i),f=await this.api.applyCommit(this.id,s,t);this.state$.next(f.state)}makeReadOnly(){this.update=s2,this.patch=s2,this.sync=s2,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,t,n){let i=await this._makeRawCommit(t,n);return Jn._signDagJWS(e,i)}async _makeRawCommit(e,t){t||(t={});let n=o2(t,!1);if(e==null&&(e=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let i=x0.compare(this.content,e),s=this.state.log[0];return{header:n,data:i,prev:this.tip,id:s.cid}}static async makeGenesis(e,t,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let f=await i9(e);n.controllers=[f.hasParent?f.parent:f.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=o2(n,!0);if(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 Ya(f),f}let s={data:t,header:i};return Jn._signDagJWS(e,s)}static async _signDagJWS(e,t){return(await i9(e)).createDagJWS(t)}},"TileDocument");Yn.STREAM_TYPE_NAME="tile";Yn.STREAM_TYPE_ID=0;Yn=Jn=hq([Jc()],Yn);var d9=Bt(c9(),1);function Eq(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(Eq,"_checkPrivateRedeclaration");function Aq(r,e){return e.get?e.get.call(r):e.value}o(Aq,"_classApplyDescriptorGet");function Sq(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(Sq,"_classApplyDescriptorSet");function h9(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(h9,"_classExtractFieldDescriptor");function u2(r,e){var t=h9(r,e,"get");return Aq(r,t)}o(u2,"_classPrivateFieldGet");function u9(r,e,t){Eq(r,e),e.set(r,t)}o(u9,"_classPrivateFieldInit");function l9(r,e,t){var n=h9(r,e,"set");return Sq(r,n,t),t}o(l9,"_classPrivateFieldSet");function Mq(r){return typeof r=="string"||Pt.isInstance(r)||nt.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(Mq,"keyToQuery");function l2(r){return typeof r=="string"?ln.from(r).toString():Pt.isInstance(r)||nt.isInstance(r)?r.toString():r.streamId.toString()}o(l2,"keyToString");async function Tq(r){let e=await Yn.makeGenesis({},null,{...r,deterministic:!0}),t=await nt.fromGenesis("tile",e);return{genesis:e,streamId:t}}o(Tq,"getDeterministicQuery");var Cq=o(()=>Promise.resolve([]),"tempBatchLoadFn"),tp=new WeakMap,h2=new WeakMap,Il=class extends d9.default{cache(e){if(!u2(this,h2))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,n){let i=await Yn.create(u2(this,tp),e,t,n);return this.cache(i),i}async deterministic(e,t){let n=await Tq(e);try{return await super.load(n)}catch{let s=await Yn.createFromGenesis(u2(this,tp),n.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,n,i){let s=l2(e);this.clear(s);let f=await this.load({streamId:s});return await f.update(t,n,i),f}constructor(e){super(Cq,{cache:!0,cacheKeyFn:l2,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),u9(this,tp,{writable:!0,value:void 0}),u9(this,h2,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(t.map(Mq),e.multiqueryTimeout);return t.map(i=>{let s=l2(i),f=n[s];return f||new Error(`Failed to load stream: ${s}`)})},l9(this,tp,e.ceramic),l9(this,h2,!!e.cache)}};o(Il,"TileLoader");function d2(r){return typeof r=="string"?nt.fromString(r):r}o(d2,"typeStreamID");function p9(r,e){let t=new URL(r);for(let[n,i]of Object.entries(e))nt.isInstance(i)?t.searchParams.set(n,i.toString()):typeof i=="object"?t.searchParams.set(n,JSON.stringify(i)):t.searchParams.set(n,i);return t}o(p9,"serializeObjectToSearchParams");function p2(r){let e={};for(let[t,n]of Object.entries(r))nt.isInstance(n)?e[t]=n.toString():e[t]=n;return e}o(p2,"serializeObjectForHttpPost");var on=class extends Jt{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=Sl(0,n).pipe(t2(()=>this._syncState(this.id,{sync:wr.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new kl(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let n=await on._load(e,this._apiUrl,t);this.state$.next(Zt.deserializeState(n))}get id(){return new nt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,n,i,s){let f=new URL("./streams",e),{state:u}=await jr(f,{method:"post",body:{type:t,genesis:Zt.serializeCommit(n),opts:i}});return new on(Zt.deserializeState(u),e,s)}static async applyCommit(e,t,n,i,s){let f=new URL("./commits",e),{state:u}=await jr(f,{method:"post",body:{streamId:t.toString(),commit:Zt.serializeCommit(n),opts:i}});return new on(Zt.deserializeState(u),e,s)}static async _load(e,t,n){let i=p9(new URL(`./streams/${e}`,t),n),{state:s}=await jr(i);return s}static async load(e,t,n,i){let s=await on._load(e,t,i);return new on(Zt.deserializeState(s),t,n)}static async loadStreamCommits(e,t){let n=new URL(`./commits/${e}`,t),{commits:i}=await jr(n);return i.map(s=>({cid:s.cid,value:Zt.deserializeCommit(s.value)}))}complete(){this.state$.complete()}};o(on,"Document");var bf;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC",r[r.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(bf||(bf={}));var m2=Bt(Uc(),1);var m9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(m9||(m9={}));var b2;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(b2||(b2={}));var Dl=class extends Jt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new nt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,m2.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===b2.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,m2.default)(this.state$.value)}async sync(e={}){e={sync:bf.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(Dl,"Stream");function b9(){return r=>{}}o(b9,"StreamStatic");function g9(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new Zs({address:e,chainId:t})}return new Zs(r)}o(g9,"normalizeAccountId");var kq="(?:%[0-9a-fA-F]{2})",v9=`(?:[a-zA-Z0-9._-]|${kq})`,Iq="([a-z0-9]+)",Dq=`((?:${v9}*:)*(${v9}+))`,y9="[a-zA-Z0-9_.:%-]",Rq=`;${y9}+=${y9}*`,Oq=`((${Rq})*)`,Nq="(/[^#?]*)?",Pq="([?][^#]*)?",Lq="(#.*)?",Bq=new RegExp(`^did:${Iq}:${Dq}${Oq}${Nq}${Pq}${Lq}$`);function x9(r){if(r===""||!r)return null;let e=r.match(Bq);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(x9,"parse");var _9=Bt(Uc(),1);var Uq=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},gf,g2=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),w9={anchor:!1,publish:!0,sync:bf.PREFER_CACHE},v2={anchor:!0,publish:!0},Fq={sync:bf.PREFER_CACHE},vf=gf=o(class extends Dl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,_9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async fromAccount(e,t,n={}){n={...w9,...n};let i=g9(t),s=gf.makeGenesis(i);return gf.fromGenesis(e,s,n)}static async fromGenesis(e,t,n={}){return n={...w9,...n},e.createStreamFromGenesis(gf.STREAM_TYPE_ID,t,n)}async setDid(e,t,n={}){n={...v2,...n};let i=typeof e=="string"?e.trim():e.id;if(x9(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let f=await t.createLink(i);return this.setDidProof(f,n)}async setDidProof(e,t={}){t={...v2,...t};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,t);this.state$.next(i.state)}async clearDid(e,t={}){t={...v2,...t};let n=await e.createLink("");return this.setDidProof(n,t)}static async load(e,t,n={}){n={...Fq,...n};let i=ln.from(t);if(i.type!=gf.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${gf.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,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=g2,this.setDid=g2,this.sync=g2,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");vf.STREAM_TYPE_NAME="caip10-link";vf.STREAM_TYPE_ID=1;vf=gf=Uq([b9()],vf);$i();Oa();var i7=Bt(r7(),1);var RH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Mo,OH={sync:wr.PREFER_CACHE};async function n7(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(n7,"_ensureAuthenticated");async function NH(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(NH,"throwReadOnlyError");var sa=Mo=o(class extends ps{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Mo.MODEL}}static async create(e,t,n){Mo.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:wr.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Mo._makeGenesis(e,t,n);return await e.createStreamFromGenesis(Mo.STREAM_TYPE_ID,s,i)}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 async load(e,t,n={}){n={...OH,...n};let i=ln.from(t);if(i.type!=Mo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Mo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return Mo._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await n7(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],model:Mo.MODEL.bytes};return{data:t,header:i}}makeReadOnly(){this.sync=NH,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,t){return await n7(e),e.did.createDagJWS(t)}},"Model");sa.STREAM_TYPE_NAME="model";sa.STREAM_TYPE_ID=2;sa.MODEL=function(){let r=Ya("model-v1"),e=i7.default.encode(r,"identity"),t=Jo(vc,e),n=Je.createV1(vc,t);return new nt("UNLOADABLE",n)}();sa=Mo=RH([Jc()],sa);var a7=Bt(qa(),1);var PH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},eo,LH={anchor:!0,publish:!0,pin:!0,sync:wr.NEVER_SYNC,syncTimeoutSeconds:0},BH={anchor:!1,publish:!1,pin:!0,sync:wr.PREFER_CACHE},UH={sync:wr.PREFER_CACHE},o7={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function s7(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(s7,"_ensureAuthenticated");async function w2(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(w2,"throwReadOnlyError");var xf=eo=o(class extends ps{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 async create(e,t,n,i={}){i={...LH,...i};let s=i.asDID?{did:i.asDID}:e,f=await eo._makeGenesis(s,t,n);return e.createStreamFromGenesis(eo.STREAM_TYPE_ID,f,i)}static async single(e,t,n={}){n={...BH,...n};let i=n.asDID?{did:n.asDID}:e;t={...t,deterministic:!0};let s=await eo._makeGenesis(i,null,t);return e.createStreamFromGenesis(eo.STREAM_TYPE_ID,s,n)}static async load(e,t,n={}){n={...UH,...n};let i=ln.from(t);if(i.type!=eo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${eo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,t={}){t={...o7,...t};let n=t.asDID?{did:t.asDID}:this.api,i=await this._makeCommit(n,e),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}async patch(e,t={}){t={...o7,...t};let n={data:e,prev:this.tip,id:this.id.cid},i=await eo._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}makeReadOnly(){this.replace=w2,this.patch=w2,this.sync=w2,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return eo._signDagJWS(e,n)}_makeRawCommit(e){return{data:x0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return n.deterministic?(Ya(i),i):eo._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let i=n.controller;if(!i)if(e.did)await s7(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let s={controllers:[i],model:n.model.bytes};return n.deterministic||(s.unique=(0,a7.randomBytes)(12)),{data:t,header:s}}static async _signDagJWS(e,t){return await s7(e),e.did.createDagJWS(t)}},"ModelInstanceDocument");xf.STREAM_TYPE_NAME="MID";xf.STREAM_TYPE_ID=3;xf=eo=PH([Jc()],xf);var Nl=class{constructor(e){this._apiUrl=e}async add(e,t){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await jr(i,{method:"post",body:n})}async rm(e,t){let n=new URL(`./pins/${e}`,this._apiUrl);await jr(n,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await jr(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(Nl,"RemotePinApi");var Pl=class{constructor(e){this._fetchJson=jr,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:p2(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:p2(e)});return{edges:t.edges.map(i=>({cursor:i.cursor,node:Zt.deserializeState(i.node)})),pageInfo:t.pageInfo}}};o(Pl,"RemoteIndexApi");var Ll=class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=jr,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,n){let i=n?{models:n.map(f=>f.toString())}:void 0,s=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${s.signatures[0].protected}.${s.payload}.${s.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(n=>nt.fromString(n))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}};o(Ll,"RemoteAdminApi");var FH="/api/v0/",$H="http://localhost:7007",qH={syncInterval:5e3},HH={anchor:!0,publish:!0,sync:wr.PREFER_CACHE},zH={anchor:!0,publish:!0,sync:wr.PREFER_CACHE},f7={sync:wr.PREFER_CACHE},Bl=class{constructor(e=$H,t={}){this._config={...qH,...t},this._apiUrl=new URL(FH,e),this._streamCache=new Map,this.context={api:this},this.pin=new Nl(this._apiUrl),this.index=new Pl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Ll(this._apiUrl,n),this._streamConstructors={[vf.STREAM_TYPE_ID]:vf,[sa.STREAM_TYPE_ID]:sa,[xf.STREAM_TYPE_ID]:xf,[Yn.STREAM_TYPE_ID]:Yn}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,n={}){n={...zH,...n};let i=await on.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),s=this._streamCache.get(i.id.toString());return s?(Zt.statesEqual(i.state,s.state)||s.next(i.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,t={}){t={...f7,...t};let n=ln.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,t):(i=await on.load(n,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,t){let n=e.map(f=>({...f,streamId:typeof f.streamId=="string"?f.streamId:f.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=await jr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((f,u)=>{let[d,g]=u,y=Zt.deserializeState(g),E=new on(y,this._apiUrl,this._config.syncInterval);return f[d]=this.buildStreamFromDocument(E),f},{})}loadStreamCommits(e){let t=d2(e);return on.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,n={}){n={...HH,...n};let i=d2(e),s=await on.applyCommit(this._apiUrl,i,t,n,this._config.syncInterval),f=this._streamCache.get(i.toString());return f?(f.next(s.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.toString(),s),this.buildStreamFromDocument(s))}async requestAnchor(e,t={}){t={...f7,...t};let{anchorStatus:n}=await jr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new on(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)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await jr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Bl,"CeramicClient");var Ft;(function(r){r.assertEqual=i=>i;function e(i){}o(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}o(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let s={};for(let f of i)s[f]=f;return s},r.getValidEnumValues=i=>{let s=r.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),f={};for(let u of s)f[u]=i[u];return r.objectValues(f)},r.objectValues=i=>r.objectKeys(i).map(function(s){return i[s]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let f in i)Object.prototype.hasOwnProperty.call(i,f)&&s.push(f);return s},r.find=(i,s)=>{for(let f of i)if(s(f))return f},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(f=>typeof f=="string"?`'${f}'`:f).join(s)}o(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ft||(Ft={}));var qe=Ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),aa=o(r=>{switch(typeof r){case"undefined":return qe.undefined;case"string":return qe.string;case"number":return isNaN(r)?qe.nan:qe.number;case"boolean":return qe.boolean;case"function":return qe.function;case"bigint":return qe.bigint;case"symbol":return qe.symbol;case"object":return Array.isArray(r)?qe.array:r===null?qe.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?qe.promise:typeof Map<"u"&&r instanceof Map?qe.map:typeof Set<"u"&&r instanceof Set?qe.set:typeof Date<"u"&&r instanceof Date?qe.date:qe.object;default:return qe.unknown}},"getParsedType"),Pe=Ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),KH=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ii=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 f of s.issues)if(f.code==="invalid_union")f.unionErrors.map(i);else if(f.code==="invalid_return_type")i(f.returnTypeError);else if(f.code==="invalid_arguments")i(f.argumentsError);else if(f.path.length===0)n._errors.push(t(f));else{let u=n,d=0;for(;d<f.path.length;){let g=f.path[d];d===f.path.length-1?(u[g]=u[g]||{_errors:[]},u[g]._errors.push(t(f))):u[g]=u[g]||{_errors:[]},u=u[g],d++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ft.jsonStringifyReplacer,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(Ii,"ZodError");Ii.create=r=>new Ii(r);var Fl=o((r,e)=>{let t;switch(r.code){case Pe.invalid_type:r.received===qe.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Pe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Ft.jsonStringifyReplacer)}`;break;case Pe.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ft.joinValues(r.keys,", ")}`;break;case Pe.invalid_union:t="Invalid input";break;case Pe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ft.joinValues(r.options)}`;break;case Pe.invalid_enum_value:t=`Invalid enum value. Expected ${Ft.joinValues(r.options)}, received '${r.received}'`;break;case Pe.invalid_arguments:t="Invalid function arguments";break;case Pe.invalid_return_type:t="Invalid function return type";break;case Pe.invalid_date:t="Invalid date";break;case Pe.invalid_string:typeof r.validation=="object"?"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:Ft.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Pe.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(r.minimum)}`:t="Invalid input";break;case Pe.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(r.maximum)}`:t="Invalid input";break;case Pe.custom:t="Invalid input";break;case Pe.invalid_intersection_types:t="Intersection results could not be merged";break;case Pe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Pe.not_finite:t="Number must be finite";break;default:t=e.defaultError,Ft.assertNever(r)}return{message:t}},"errorMap"),h7=Fl;function jH(r){h7=r}o(jH,"setErrorMap");function ap(){return h7}o(ap,"getErrorMap");var fp=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],f={...i,path:s},u="",d=n.filter(g=>!!g).slice().reverse();for(let g of d)u=g(f,{data:e,defaultError:u}).message;return{...i,path:s,message:i.message||u}},"makeIssue"),GH=[];function je(r,e){let t=fp({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ap(),Fl].filter(n=>!!n)});r.common.issues.push(t)}o(je,"addIssueToContext");var Br=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 vt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t)n.push({key:await i.key,value:await i.value});return Br.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:f}=i;if(s.status==="aborted"||f.status==="aborted")return vt;s.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),(typeof f.value<"u"||i.alwaysSet)&&(n[s.value]=f.value)}return{status:e.value,value:n}}};o(Br,"ParseStatus");var vt=Object.freeze({status:"aborted"}),d7=o(r=>({status:"dirty",value:r}),"DIRTY"),sn=o(r=>({status:"valid",value:r}),"OK"),_2=o(r=>r.status==="aborted","isAborted"),E2=o(r=>r.status==="dirty","isDirty"),cp=o(r=>r.status==="valid","isValid"),up=o(r=>typeof Promise!==void 0&&r instanceof Promise,"isAsync"),Ot;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(Ot||(Ot={}));var Xn=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(Xn,"ParseInputLazyPath");var c7=o((r,e)=>{if(cp(e))return{success:!0,data:e.value};{if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new Ii(r.common.issues);return{success:!1,error:t}}},"handleResult");function Ct(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_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((f,u)=>f.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:n??u.defaultError}:{message:t??u.defaultError},"customMap"),description:i}}o(Ct,"processCreateParams");var wt=class{constructor(e){this.spa=this.safeParseAsync,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.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return aa(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:aa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Br,ctx:{common:e.parent.common,data:e.data,parsedType:aa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(up(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?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aa(e)},s=this._parseSync({data:e,path:i.path,parent:i});return c7(i,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aa(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(up(i)?i:Promise.resolve(i));return c7(n,s)}refine(e,t){let n=o(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let f=e(i),u=o(()=>s.addIssue({code:Pe.custom,...n(i)}),"setError");return typeof Promise<"u"&&f instanceof Promise?f.then(d=>d?!0:(u(),!1)):f?!0:(u(),!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 In({schema:this,typeName:mt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Qn.create(this)}nullable(){return Io.create(this)}nullish(){return this.optional().nullable()}array(){return kn.create(this)}promise(){return xs.create(this)}or(e){return ha.create([this,e])}and(e){return da.create(this,e)}transform(e){return new In({schema:this,typeName:mt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ya({innerType:this,defaultValue:t,typeName:mt.ZodDefault})}brand(){return new Ul({typeName:mt.ZodBranded,type:this,...Ct(void 0)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Sf({innerType:this,defaultValue:t,typeName:mt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xa.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(wt,"ZodType");var VH=/^c[^\s-]{8,}$/i,WH=/^([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,JH=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,YH=o(r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}:\\d{2})|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Di=class extends wt{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(i=>e.test(i),{validation:t,code:Pe.invalid_string,...Ot.errToObj(n)}),this.nonempty=e=>this.min(1,Ot.errToObj(e)),this.trim=()=>new Di({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==qe.string){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_type,expected:qe.string,received:s.parsedType}),vt}let n=new Br,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let f=e.data.length>s.value,u=e.data.length<s.value;(f||u)&&(i=this._getOrReturnCtx(e,i),f?je(i,{code:Pe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&je(i,{code:Pe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")JH.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"email",code:Pe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")WH.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"uuid",code:Pe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")VH.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cuid",code:Pe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),je(i,{validation:"url",code:Pe.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),je(i,{validation:"regex",code:Pe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?YH(s).test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):Ft.assertNever(s);return{status:n.value,value:e.data}}_addCheck(e){return new Di({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ot.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ot.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ot.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ot.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,...Ot.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ot.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ot.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ot.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ot.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ot.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ot.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};o(Di,"ZodString");Di.create=r=>{var e;return new Di({checks:[],typeName:mt.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Ct(r)})};function XH(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(".","")),f=parseInt(e.toFixed(i).replace(".",""));return s%f/Math.pow(10,i)}o(XH,"floatSafeRemainder");var to=class extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==qe.number){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_type,expected:qe.number,received:s.parsedType}),vt}let n,i=new Br;for(let s of this._def.checks)s.kind==="int"?Ft.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.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),je(n,{code:Pe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?XH(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:Pe.not_finite,message:s.message}),i.dirty()):Ft.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ot.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ot.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ot.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ot.toString(t))}setLimit(e,t,n,i){return new to({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ot.toString(i)}]})}_addCheck(e){return new to({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ot.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ot.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ot.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ot.toString(e)})}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(to,"ZodNumber");to.create=r=>new to({checks:[],typeName:mt.ZodNumber,coerce:r?.coerce||!1,...Ct(r)});var fa=class extends wt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==qe.bigint){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.bigint,received:n.parsedType}),vt}return sn(e.data)}};o(fa,"ZodBigInt");fa.create=r=>{var e;return new fa({typeName:mt.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Ct(r)})};var ca=class extends wt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==qe.boolean){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.boolean,received:n.parsedType}),vt}return sn(e.data)}};o(ca,"ZodBoolean");ca.create=r=>new ca({typeName:mt.ZodBoolean,coerce:r?.coerce||!1,...Ct(r)});var To=class extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==qe.date){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_type,expected:qe.date,received:s.parsedType}),vt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return je(s,{code:Pe.invalid_date}),vt}let n=new Br,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:Pe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ft.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new To({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ot.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ot.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};o(To,"ZodDate");To.create=r=>new To({checks:[],coerce:r?.coerce||!1,typeName:mt.ZodDate,...Ct(r)});var wf=class extends wt{_parse(e){if(this._getType(e)!==qe.symbol){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.symbol,received:n.parsedType}),vt}return sn(e.data)}};o(wf,"ZodSymbol");wf.create=r=>new wf({typeName:mt.ZodSymbol,...Ct(r)});var ua=class extends wt{_parse(e){if(this._getType(e)!==qe.undefined){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.undefined,received:n.parsedType}),vt}return sn(e.data)}};o(ua,"ZodUndefined");ua.create=r=>new ua({typeName:mt.ZodUndefined,...Ct(r)});var la=class extends wt{_parse(e){if(this._getType(e)!==qe.null){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.null,received:n.parsedType}),vt}return sn(e.data)}};o(la,"ZodNull");la.create=r=>new la({typeName:mt.ZodNull,...Ct(r)});var vs=class extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return sn(e.data)}};o(vs,"ZodAny");vs.create=r=>new vs({typeName:mt.ZodAny,...Ct(r)});var Co=class extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return sn(e.data)}};o(Co,"ZodUnknown");Co.create=r=>new Co({typeName:mt.ZodUnknown,...Ct(r)});var Ri=class extends wt{_parse(e){let t=this._getOrReturnCtx(e);return je(t,{code:Pe.invalid_type,expected:qe.never,received:t.parsedType}),vt}};o(Ri,"ZodNever");Ri.create=r=>new Ri({typeName:mt.ZodNever,...Ct(r)});var _f=class extends wt{_parse(e){if(this._getType(e)!==qe.undefined){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.void,received:n.parsedType}),vt}return sn(e.data)}};o(_f,"ZodVoid");_f.create=r=>new _f({typeName:mt.ZodVoid,...Ct(r)});var kn=class extends wt{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==qe.array)return je(t,{code:Pe.invalid_type,expected:qe.array,received:t.parsedType}),vt;if(i.exactLength!==null){let f=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(f||u)&&(je(t,{code:f?Pe.too_big:Pe.too_small,minimum:u?i.exactLength.value:void 0,maximum:f?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(je(t,{code:Pe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(je(t,{code:Pe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all(t.data.map((f,u)=>i.type._parseAsync(new Xn(t,f,t.path,u)))).then(f=>Br.mergeArray(n,f));let s=t.data.map((f,u)=>i.type._parseSync(new Xn(t,f,t.path,u)));return Br.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new kn({...this._def,minLength:{value:e,message:Ot.toString(t)}})}max(e,t){return new kn({...this._def,maxLength:{value:e,message:Ot.toString(t)}})}length(e,t){return new kn({...this._def,exactLength:{value:e,message:Ot.toString(t)}})}nonempty(e){return this.min(1,e)}};o(kn,"ZodArray");kn.create=(r,e)=>new kn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:mt.ZodArray,...Ct(e)});var lp;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(lp||(lp={}));var u7=o(r=>e=>new tr({...r,shape:()=>({...r.shape(),...e})}),"AugmentFactory");function eu(r){if(r instanceof tr){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Qn.create(eu(n))}return new tr({...r._def,shape:()=>e})}else return r instanceof kn?kn.create(eu(r.element)):r instanceof Qn?Qn.create(eu(r.unwrap())):r instanceof Io?Io.create(eu(r.unwrap())):r instanceof Zn?Zn.create(r.items.map(e=>eu(e))):r}o(eu,"deepPartialify");var tr=class extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=u7(this._def),this.extend=u7(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Ft.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==qe.object){let g=this._getOrReturnCtx(e);return je(g,{code:Pe.invalid_type,expected:qe.object,received:g.parsedType}),vt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:f}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ri&&this._def.unknownKeys==="strip"))for(let g in i.data)f.includes(g)||u.push(g);let d=[];for(let g of f){let y=s[g],E=i.data[g];d.push({key:{status:"valid",value:g},value:y._parse(new Xn(i,E,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Ri){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of u)d.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")u.length>0&&(je(i,{code:Pe.unrecognized_keys,keys:u}),n.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of u){let E=i.data[y];d.push({key:{status:"valid",value:y},value:g._parse(new Xn(i,E,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of d){let E=await y.key;g.push({key:E,value:await y.value,alwaysSet:y.alwaysSet})}return g}).then(g=>Br.mergeObjectSync(n,g)):Br.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Ot.errToObj,new tr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,s,f,u;let d=(f=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&f!==void 0?f:n.defaultError;return t.code==="unrecognized_keys"?{message:(u=Ot.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new tr({...this._def,unknownKeys:"strip"})}passthrough(){return new tr({...this._def,unknownKeys:"passthrough"})}setKey(e,t){return this.augment({[e]:t})}merge(e){return new tr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>lp.mergeShapes(this._def.shape(),e._def.shape()),typeName:mt.ZodObject})}catchall(e){return new tr({...this._def,catchall:e})}pick(e){let t={};return Ft.objectKeys(e).map(n=>{this.shape[n]&&(t[n]=this.shape[n])}),new tr({...this._def,shape:()=>t})}omit(e){let t={};return Ft.objectKeys(this.shape).map(n=>{Ft.objectKeys(e).indexOf(n)===-1&&(t[n]=this.shape[n])}),new tr({...this._def,shape:()=>t})}deepPartial(){return eu(this)}partial(e){let t={};if(e)return Ft.objectKeys(this.shape).map(n=>{Ft.objectKeys(e).indexOf(n)===-1?t[n]=this.shape[n]:t[n]=this.shape[n].optional()}),new tr({...this._def,shape:()=>t});for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new tr({...this._def,shape:()=>t})}required(e){let t={};if(e)Ft.objectKeys(this.shape).map(n=>{if(Ft.objectKeys(e).indexOf(n)===-1)t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Qn;)s=s._def.innerType;t[n]=s}});else for(let n in this.shape){let s=this.shape[n];for(;s instanceof Qn;)s=s._def.innerType;t[n]=s}return new tr({...this._def,shape:()=>t})}keyof(){return p7(Ft.objectKeys(this.shape))}};o(tr,"ZodObject");tr.create=(r,e)=>new tr({shape:()=>r,unknownKeys:"strip",catchall:Ri.create(),typeName:mt.ZodObject,...Ct(e)});tr.strictCreate=(r,e)=>new tr({shape:()=>r,unknownKeys:"strict",catchall:Ri.create(),typeName:mt.ZodObject,...Ct(e)});tr.lazycreate=(r,e)=>new tr({shape:r,unknownKeys:"strip",catchall:Ri.create(),typeName:mt.ZodObject,...Ct(e)});var ha=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let u of s)if(u.result.status==="valid")return u.result;for(let u of s)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;let f=s.map(u=>new Ii(u.ctx.common.issues));return je(t,{code:Pe.invalid_union,unionErrors:f}),vt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(async s=>{let f={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:f}),ctx:f}})).then(i);{let s,f=[];for(let d of n){let g={...t,common:{...t.common,issues:[]},parent:null},y=d._parseSync({data:t.data,path:t.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:g}),g.common.issues.length&&f.push(g.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let u=f.map(d=>new Ii(d));return je(t,{code:Pe.invalid_union,unionErrors:u}),vt}}get options(){return this._def.options}};o(ha,"ZodUnion");ha.create=(r,e)=>new ha({options:r,typeName:mt.ZodUnion,...Ct(e)});var sp=o(r=>r instanceof ma?sp(r.schema):r instanceof In?sp(r.innerType()):r instanceof ba?[r.value]:r instanceof ga?r.options:r instanceof va?Object.keys(r.enum):r instanceof ya?sp(r._def.innerType):r instanceof ua?[void 0]:r instanceof la?[null]:null,"getDiscriminator"),Ef=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==qe.object)return je(t,{code:Pe.invalid_type,expected:qe.object,received:t.parsedType}),vt;let n=this.discriminator,i=t.data[n],s=this.optionsMap.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}):(je(t,{code:Pe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),vt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let s of t){let f=sp(s.shape[e]);if(!f)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of f){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,s)}}return new Ef({typeName:mt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...Ct(n)})}};o(Ef,"ZodDiscriminatedUnion");function A2(r,e){let t=aa(r),n=aa(e);if(r===e)return{valid:!0,data:r};if(t===qe.object&&n===qe.object){let i=Ft.objectKeys(e),s=Ft.objectKeys(r).filter(u=>i.indexOf(u)!==-1),f={...r,...e};for(let u of s){let d=A2(r[u],e[u]);if(!d.valid)return{valid:!1};f[u]=d.data}return{valid:!0,data:f}}else if(t===qe.array&&n===qe.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let f=r[s],u=e[s],d=A2(f,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===qe.date&&n===qe.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(A2,"mergeValues");var da=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,f)=>{if(_2(s)||_2(f))return vt;let u=A2(s.value,f.value);return u.valid?((E2(s)||E2(f))&&t.dirty(),{status:t.value,value:u.data}):(je(n,{code:Pe.invalid_intersection_types}),vt)},"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,f])=>i(s,f)):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(da,"ZodIntersection");da.create=(r,e,t)=>new da({left:r,right:e,typeName:mt.ZodIntersection,...Ct(t)});var Zn=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.array)return je(n,{code:Pe.invalid_type,expected:qe.array,received:n.parsedType}),vt;if(n.data.length<this._def.items.length)return je(n,{code:Pe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&n.data.length>this._def.items.length&&(je(n,{code:Pe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=n.data.map((f,u)=>{let d=this._def.items[u]||this._def.rest;return d?d._parse(new Xn(n,f,n.path,u)):null}).filter(f=>!!f);return n.common.async?Promise.all(s).then(f=>Br.mergeArray(t,f)):Br.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Zn({...this._def,rest:e})}};o(Zn,"ZodTuple");Zn.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zn({items:r,typeName:mt.ZodTuple,rest:null,...Ct(e)})};var pa=class extends wt{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!==qe.object)return je(n,{code:Pe.invalid_type,expected:qe.object,received:n.parsedType}),vt;let i=[],s=this._def.keyType,f=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new Xn(n,u,n.path,u)),value:f._parse(new Xn(n,n.data[u],n.path,u))});return n.common.async?Br.mergeObjectAsync(t,i):Br.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof wt?new pa({keyType:e,valueType:t,typeName:mt.ZodRecord,...Ct(n)}):new pa({keyType:Di.create(),valueType:e,typeName:mt.ZodRecord,...Ct(t)})}};o(pa,"ZodRecord");var Af=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.map)return je(n,{code:Pe.invalid_type,expected:qe.map,received:n.parsedType}),vt;let i=this._def.keyType,s=this._def.valueType,f=[...n.data.entries()].map(([u,d],g)=>({key:i._parse(new Xn(n,u,n.path,[g,"key"])),value:s._parse(new Xn(n,d,n.path,[g,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of f){let g=await d.key,y=await d.value;if(g.status==="aborted"||y.status==="aborted")return vt;(g.status==="dirty"||y.status==="dirty")&&t.dirty(),u.set(g.value,y.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let d of f){let g=d.key,y=d.value;if(g.status==="aborted"||y.status==="aborted")return vt;(g.status==="dirty"||y.status==="dirty")&&t.dirty(),u.set(g.value,y.value)}return{status:t.value,value:u}}}};o(Af,"ZodMap");Af.create=(r,e,t)=>new Af({valueType:e,keyType:r,typeName:mt.ZodMap,...Ct(t)});var ko=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.set)return je(n,{code:Pe.invalid_type,expected:qe.set,received:n.parsedType}),vt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(je(n,{code:Pe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(je(n,{code:Pe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function f(d){let g=new Set;for(let y of d){if(y.status==="aborted")return vt;y.status==="dirty"&&t.dirty(),g.add(y.value)}return{status:t.value,value:g}}o(f,"finalizeSet");let u=[...n.data.values()].map((d,g)=>s._parse(new Xn(n,d,n.path,g)));return n.common.async?Promise.all(u).then(d=>f(d)):f(u)}min(e,t){return new ko({...this._def,minSize:{value:e,message:Ot.toString(t)}})}max(e,t){return new ko({...this._def,maxSize:{value:e,message:Ot.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(ko,"ZodSet");ko.create=(r,e)=>new ko({valueType:r,minSize:null,maxSize:null,typeName:mt.ZodSet,...Ct(e)});var ys=class extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==qe.function)return je(t,{code:Pe.invalid_type,expected:qe.function,received:t.parsedType}),vt;function n(u,d){return fp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ap(),Fl].filter(g=>!!g),issueData:{code:Pe.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return fp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ap(),Fl].filter(g=>!!g),issueData:{code:Pe.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},f=t.data;return this._def.returns instanceof xs?sn(async(...u)=>{let d=new Ii([]),g=await this._def.args.parseAsync(u,s).catch(O=>{throw d.addIssue(n(u,O)),d}),y=await f(...g);return await this._def.returns._def.type.parseAsync(y,s).catch(O=>{throw d.addIssue(i(y,O)),d})}):sn((...u)=>{let d=this._def.args.safeParse(u,s);if(!d.success)throw new Ii([n(u,d.error)]);let g=f(...d.data),y=this._def.returns.safeParse(g,s);if(!y.success)throw new Ii([i(g,y.error)]);return y.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ys({...this._def,args:Zn.create(e).rest(Co.create())})}returns(e){return new ys({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ys({args:e||Zn.create([]).rest(Co.create()),returns:t||Co.create(),typeName:mt.ZodFunction,...Ct(n)})}};o(ys,"ZodFunction");var ma=class extends wt{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(ma,"ZodLazy");ma.create=(r,e)=>new ma({getter:r,typeName:mt.ZodLazy,...Ct(e)});var ba=class extends wt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return je(t,{code:Pe.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(ba,"ZodLiteral");ba.create=(r,e)=>new ba({value:r,typeName:mt.ZodLiteral,...Ct(e)});function p7(r,e){return new ga({values:r,typeName:mt.ZodEnum,...Ct(e)})}o(p7,"createZodEnum");var ga=class extends wt{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return je(t,{expected:Ft.joinValues(n),received:t.parsedType,code:Pe.invalid_type}),vt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),n=this._def.values;return je(t,{received:t.data,code:Pe.invalid_enum_value,options:n}),vt}return sn(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(ga,"ZodEnum");ga.create=p7;var va=class extends wt{_parse(e){let t=Ft.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==qe.string&&n.parsedType!==qe.number){let i=Ft.objectValues(t);return je(n,{expected:Ft.joinValues(i),received:n.parsedType,code:Pe.invalid_type}),vt}if(t.indexOf(e.data)===-1){let i=Ft.objectValues(t);return je(n,{received:n.data,code:Pe.invalid_enum_value,options:i}),vt}return sn(e.data)}get enum(){return this._def.values}};o(va,"ZodNativeEnum");va.create=(r,e)=>new va({values:r,typeName:mt.ZodNativeEnum,...Ct(e)});var xs=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==qe.promise&&t.common.async===!1)return je(t,{code:Pe.invalid_type,expected:qe.promise,received:t.parsedType}),vt;let n=t.parsedType===qe.promise?t.data:Promise.resolve(t.data);return sn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(xs,"ZodPromise");xs.create=(r,e)=>new xs({type:r,typeName:mt.ZodPromise,...Ct(e)});var In=class extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let f=i.transform(n.data);return n.common.async?Promise.resolve(f).then(u=>this._def.schema._parseAsync({data:u,path:n.path,parent:n})):this._def.schema._parseSync({data:f,path:n.path,parent:n})}let s={addIssue:f=>{je(n,f),f.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="refinement"){let f=o(u=>{let d=i.refinement(u,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?vt:(u.status==="dirty"&&t.dirty(),f(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?vt:(u.status==="dirty"&&t.dirty(),f(u.value).then(()=>({status:t.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!cp(f))return f;let u=i.transform(f.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>cp(f)?Promise.resolve(i.transform(f.value,s)).then(u=>({status:t.value,value:u})):f);Ft.assertNever(i)}};o(In,"ZodEffects");In.create=(r,e,t)=>new In({schema:r,typeName:mt.ZodEffects,effect:e,...Ct(t)});In.createWithPreprocess=(r,e,t)=>new In({schema:e,effect:{type:"preprocess",transform:r},typeName:mt.ZodEffects,...Ct(t)});var Qn=class extends wt{_parse(e){return this._getType(e)===qe.undefined?sn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Qn,"ZodOptional");Qn.create=(r,e)=>new Qn({innerType:r,typeName:mt.ZodOptional,...Ct(e)});var Io=class extends wt{_parse(e){return this._getType(e)===qe.null?sn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Io,"ZodNullable");Io.create=(r,e)=>new Io({innerType:r,typeName:mt.ZodNullable,...Ct(e)});var ya=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===qe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(ya,"ZodDefault");ya.create=(r,e)=>new ya({innerType:r,typeName:mt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ct(e)});var Sf=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:t});return up(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.defaultValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};o(Sf,"ZodCatch");Sf.create=(r,e)=>new Sf({innerType:r,typeName:mt.ZodCatch,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ct(e)});var Mf=class extends wt{_parse(e){if(this._getType(e)!==qe.nan){let n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:qe.nan,received:n.parsedType}),vt}return{status:"valid",value:e.data}}};o(Mf,"ZodNaN");Mf.create=r=>new Mf({typeName:mt.ZodNaN,...Ct(r)});var ZH=Symbol("zod_brand"),Ul=class extends wt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};o(Ul,"ZodBranded");var xa=class extends wt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?vt:s.status==="dirty"?(t.dirty(),d7(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?vt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new xa({in:e,out:t,typeName:mt.ZodPipeline})}};o(xa,"ZodPipeline");var m7=o((r,e={},t)=>r?vs.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,f=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...f,fatal:t})}}):vs.create(),"custom"),QH={object:tr.lazycreate},mt;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",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.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline"})(mt||(mt={}));var ez=o((r,e={message:`Input not instance of ${r.name}`})=>m7(t=>t instanceof r,e,!0),"instanceOfType"),b7=Di.create,g7=to.create,tz=Mf.create,rz=fa.create,v7=ca.create,nz=To.create,iz=wf.create,oz=ua.create,sz=la.create,az=vs.create,fz=Co.create,cz=Ri.create,uz=_f.create,lz=kn.create,hz=tr.create,dz=tr.strictCreate,pz=ha.create,mz=Ef.create,bz=da.create,gz=Zn.create,vz=pa.create,yz=Af.create,xz=ko.create,wz=ys.create,_z=ma.create,Ez=ba.create,Az=ga.create,Sz=va.create,Mz=xs.create,l7=In.create,Tz=Qn.create,Cz=Io.create,kz=In.createWithPreprocess,Iz=xa.create,Dz=o(()=>b7().optional(),"ostring"),Rz=o(()=>g7().optional(),"onumber"),Oz=o(()=>v7().optional(),"oboolean"),Nz={string:r=>Di.create({...r,coerce:!0}),number:r=>to.create({...r,coerce:!0}),boolean:r=>ca.create({...r,coerce:!0}),bigint:r=>fa.create({...r,coerce:!0}),date:r=>To.create({...r,coerce:!0})},Pz=vt,N=Object.freeze({__proto__:null,defaultErrorMap:Fl,setErrorMap:jH,getErrorMap:ap,makeIssue:fp,EMPTY_PATH:GH,addIssueToContext:je,ParseStatus:Br,INVALID:vt,DIRTY:d7,OK:sn,isAborted:_2,isDirty:E2,isValid:cp,isAsync:up,get util(){return Ft},ZodParsedType:qe,getParsedType:aa,ZodType:wt,ZodString:Di,ZodNumber:to,ZodBigInt:fa,ZodBoolean:ca,ZodDate:To,ZodSymbol:wf,ZodUndefined:ua,ZodNull:la,ZodAny:vs,ZodUnknown:Co,ZodNever:Ri,ZodVoid:_f,ZodArray:kn,get objectUtil(){return lp},ZodObject:tr,ZodUnion:ha,ZodDiscriminatedUnion:Ef,ZodIntersection:da,ZodTuple:Zn,ZodRecord:pa,ZodMap:Af,ZodSet:ko,ZodFunction:ys,ZodLazy:ma,ZodLiteral:ba,ZodEnum:ga,ZodNativeEnum:va,ZodPromise:xs,ZodEffects:In,ZodTransformer:In,ZodOptional:Qn,ZodNullable:Io,ZodDefault:ya,ZodCatch:Sf,ZodNaN:Mf,BRAND:ZH,ZodBranded:Ul,ZodPipeline:xa,custom:m7,Schema:wt,ZodSchema:wt,late:QH,get ZodFirstPartyTypeKind(){return mt},coerce:Nz,any:az,array:lz,bigint:rz,boolean:v7,date:nz,discriminatedUnion:mz,effect:l7,enum:Az,function:wz,instanceof:ez,intersection:bz,lazy:_z,literal:Ez,map:yz,nan:tz,nativeEnum:Sz,never:cz,null:sz,nullable:Cz,number:g7,object:hz,oboolean:Oz,onumber:Rz,optional:Tz,ostring:Dz,pipeline:Iz,preprocess:kz,promise:Mz,record:vz,set:xz,strictObject:dz,string:b7,symbol:iz,transformer:l7,tuple:gz,undefined:oz,union:pz,unknown:fz,void:uz,NEVER:Pz,ZodIssueCode:Pe,quotelessJson:KH,ZodError:Ii});var dp=N.array(N.string().or(N.record(N.any()))),Rne=N.object({type:N.string().optional(),narrative:N.string().optional()}),pp=N.string().or(N.object({id:N.string(),type:N.string(),caption:N.string().optional()})),Lz=N.object({type:N.string().min(1).or(N.string().array().nonempty()),latitude:N.number(),longitude:N.number()}),Bz=N.object({type:N.string().min(1).or(N.string().array().nonempty()),addressCountry:N.string().optional(),addressCountryCode:N.string().optional(),addressRegion:N.string().optional(),addressLocality:N.string().optional(),streetAddress:N.string().optional(),postOfficeBoxNumber:N.string().optional(),postalCode:N.string().optional(),geo:Lz.optional()}),Uz=N.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(N.string()),x7=N.object({type:N.string().min(1).or(N.string().array().nonempty()),identifier:N.string(),identifierType:Uz}),$l=N.string().or(N.object({id:N.string().optional(),type:N.string().or(N.string().array().nonempty().optional()),name:N.string().optional(),url:N.string().optional(),phone:N.string().optional(),description:N.string().optional(),endorsement:N.any().array().optional(),image:pp.optional(),email:N.string().email().optional(),address:Bz.optional(),otherIdentifier:x7.array().optional(),official:N.string().optional(),parentOrg:N.any().optional(),familyName:N.string().optional(),givenName:N.string().optional(),additionalName:N.string().optional(),patronymicName:N.string().optional(),honorificPrefix:N.string().optional(),honorificSuffix:N.string().optional(),familyNamePrefix:N.string().optional(),dateOfBirth:N.string().optional()}).catchall(N.any())),S2=N.object({id:N.string().optional()}).catchall(N.any()),Fz=N.object({type:N.string(),id:N.string()}).catchall(N.any()),$z=N.object({id:N.string(),type:N.string()}).catchall(N.any()),qz=N.object({id:N.string(),type:N.string()}).catchall(N.any()),hp=N.object({"@context":dp,id:N.string().optional(),type:N.string().array().nonempty(),issuer:$l,issuanceDate:N.string(),expirationDate:N.string().optional(),credentialSubject:S2.or(S2.array()),credentialStatus:Fz.optional(),credentialSchema:$z.array().optional(),refreshService:qz.optional()}).catchall(N.any()),Do=N.object({type:N.string(),created:N.string(),challenge:N.string().optional(),domain:N.string().optional(),nonce:N.string().optional(),proofPurpose:N.string(),verificationMethod:N.string(),jws:N.string().optional()}).catchall(N.any()),ql=hp.extend({proof:Do.or(Do.array())}),Hz=N.object({"@context":dp,id:N.string().optional(),type:N.string().or(N.string().array().nonempty()),verifiableCredential:ql.or(ql.array()).optional(),holder:N.string().optional()}).catchall(N.any()),T2=Hz.extend({proof:Do.or(Do.array())}),w7=N.object({kty:N.string(),crv:N.string(),x:N.string(),y:N.string().optional(),n:N.string().optional(),d:N.string()}),zz=N.object({alg:N.string(),iv:N.string(),tag:N.string(),epk:w7.partial().optional(),kid:N.string().optional(),apv:N.string().optional(),apu:N.string().optional()}),Kz=N.object({header:zz,encrypted_key:N.string()}),jz=N.object({protected:N.string(),iv:N.string(),ciphertext:N.string(),tag:N.string(),aad:N.string().optional(),recipients:Kz.array().optional()}),Tf=N.string().or(N.object({"@context":dp.optional(),id:N.string(),type:N.string(),controller:N.string(),publicKeyJwk:w7.optional(),publicKeyBase58:N.string().optional(),blockChainAccountId:N.string().optional()}).catchall(N.any())),Gz=N.object({id:N.string(),type:N.string().or(N.string().array().nonempty()),serviceEndpoint:N.any().or(N.any().array().nonempty())}).catchall(N.any()),Pne=N.object({"@context":dp,id:N.string(),alsoKnownAs:N.string().optional(),controller:N.string().or(N.string().array().nonempty()).optional(),verificationMethod:Tf.array().optional(),authentication:Tf.array().optional(),assertionMethod:Tf.array().optional(),keyAgreement:Tf.array().optional(),capabilityInvocation:Tf.array().optional(),capabilityDelegation:Tf.array().optional(),publicKey:Tf.array().optional(),service:Gz.array().optional(),proof:Do.or(Do.array()).optional()}).catchall(N.any()),Vz=N.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(N.string()),mp=N.object({type:N.string().array().nonempty(),targetCode:N.string().optional(),targetDescription:N.string().optional(),targetName:N.string(),targetFramework:N.string().optional(),targetType:Vz.optional(),targetUrl:N.string()}),Wz=N.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"]),Jz=Wz.or(N.string()),Yz=N.object({id:N.string().optional(),narrative:N.string().optional()}).catchall(N.any()),Xz=N.object({id:N.string(),type:N.string().array().nonempty(),endorsementComment:N.string().optional()}),Zz=hp.extend({credentialSubject:Xz,proof:Do.or(Do.array()).optional()}),Qz=N.object({id:N.string(),"@language":N.string().optional(),version:N.string().optional()}),eK=N.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(N.string()),tK=N.object({id:N.string(),type:N.string().array().nonempty(),alignment:mp.array().optional(),description:N.string().optional(),level:N.string().optional(),name:N.string(),points:N.string().optional()}).catchall(N.any()),rK=N.object({id:N.string(),type:N.string().array().nonempty(),alignment:mp.array().optional(),allowedValue:N.string().array().optional(),name:N.string(),requiredLevel:N.string().optional(),requiredValue:N.string().optional(),resultType:eK,rubricCriterionLevel:tK.array().optional(),valueMax:N.string().optional(),valueMin:N.string().optional()}).catchall(N.any()),nK=N.object({id:N.string().optional(),type:N.string().array().nonempty(),alignment:mp.array().optional(),achievementType:Jz.optional(),creator:$l.optional(),creditsAvailable:N.number().optional(),criteria:Yz,description:N.string(),endorsement:Zz.array().optional(),fieldOfStudy:N.string().optional(),humanCode:N.string().optional(),image:pp.optional(),"@language":N.string().optional(),name:N.string(),otherIdentifier:x7.array().optional(),related:Qz.array().optional(),resultDescription:rK.array().optional(),specialization:N.string().optional(),tag:N.string().array().optional(),version:N.string().optional()}).catchall(N.any()),iK=N.object({type:N.string(),hashed:N.boolean(),identityHash:N.string(),identityType:N.string(),salt:N.string().optional()}),oK=N.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),sK=N.object({type:N.string().array().nonempty(),achievedLevel:N.string().optional(),alignment:mp.array().optional(),resultDescription:N.string().optional(),status:oK.optional(),value:N.string().optional()}).catchall(N.any()),y7=N.object({id:N.string().optional(),type:N.string().array().nonempty(),activityEndDate:N.string().optional(),activityStartDate:N.string().optional(),creditsEarned:N.number().optional(),achievement:nK.optional(),identifier:iK.array().optional(),image:pp.optional(),licenseNumber:N.string().optional(),narrative:N.string().optional(),result:sK.array().optional(),role:N.string().optional(),source:$l.optional(),term:N.string().optional()}).catchall(N.any()),aK=N.object({id:N.string().optional(),type:N.string().array().nonempty(),narrative:N.string().optional(),name:N.string().optional(),description:N.string().optional(),genre:N.string().optional(),audience:N.string().optional()}).catchall(N.any()),fK=hp.extend({name:N.string().optional(),description:N.string().optional(),image:pp.optional(),credentialSubject:y7.or(y7.array()),endorsement:hp.array().optional(),evidence:aK.array().optional()}),Bne=fK.extend({proof:Do.or(Do.array())}),Fne=N.object({checks:N.string().array(),warnings:N.string().array(),errors:N.string().array()}),_7=N.enum(["Success","Failed","Error"]),$ne=_7.enum,qne=N.object({check:N.string(),status:_7,message:N.string().optional(),details:N.string().optional()}),Hne=N.object({title:N.string().optional(),createdAt:N.string().optional(),issuer:$l.optional(),issuee:$l.optional(),credentialSubject:S2.optional()}),zne=N.object({id:N.string(),uri:N.string()}).catchall(N.any()),Gne=N.object({limit:N.number(),cursor:N.string().optional(),sort:N.string().optional()}),ws=N.object({cursor:N.string().optional(),hasMore:N.boolean()}),E7=N.object({encryptedRecord:jz,fields:N.string().array()}).catchall(N.any()),Vne=ws.extend({records:E7.array()}),cK=E7.extend({id:N.string()}),Wne=ws.extend({records:cK.array()}),tu=N.object({profileId:N.string().min(3).max(40),displayName:N.string().default(""),shortBio:N.string().default(""),bio:N.string().default(""),did:N.string(),email:N.string().optional(),image:N.string().optional(),heroImage:N.string().optional(),websiteLink:N.string().optional(),isServiceProfile:N.boolean().default(!1).optional(),type:N.string().optional(),notificationsWebhook:N.string().url().startsWith("http").optional()}),Yne=ws.extend({records:tu.array()}),Xne=N.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Zne=N.object({uri:N.string(),to:N.string(),from:N.string(),sent:N.string().datetime(),received:N.string().datetime().optional()}),uK=N.enum(["DRAFT","LIVE"]),lK=N.object({uri:N.string(),name:N.string().optional(),type:N.string().optional(),category:N.string().optional(),status:uK.optional(),autoConnectRecipients:N.boolean().optional()}),Qne=ws.extend({records:lK.array()}),hK=N.object({to:tu,from:N.string(),received:N.string().optional()}),eie=ws.extend({records:hK.array()}),tie=N.object({endpoint:N.string(),name:N.string(),did:N.string().optional()}),rie=N.object({ttlSeconds:N.number().optional(),totalUses:N.number().optional()}),nie=N.object({role:N.string(),canEdit:N.boolean(),canIssue:N.boolean(),canRevoke:N.boolean(),canManagePermissions:N.boolean(),canIssueChildren:N.string(),canCreateChildren:N.string(),canEditChildren:N.string(),canRevokeChildren:N.string(),canManageChildrenPermissions:N.string(),canViewAnalytics:N.boolean()}),dK=N.object({endpoint:N.string()}),iie=N.object({signingAuthority:dK,relationship:N.object({name:N.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:N.string()})}),pK=N.enum(["live","stale","withdrawn"]),mK=N.object({read:N.object({anonymize:N.boolean().optional(),credentials:N.object({categories:N.record(N.object({required:N.boolean()})).default({})}).default({}),personal:N.record(N.object({required:N.boolean()})).default({})}).default({}),write:N.object({credentials:N.object({categories:N.record(N.object({required:N.boolean()})).default({})}).default({}),personal:N.record(N.object({required:N.boolean()})).default({})}).default({})}),A7=N.object({contract:mK,owner:tu,name:N.string(),subtitle:N.string().optional(),description:N.string().optional(),reasonForAccessing:N.string().optional(),image:N.string().optional(),uri:N.string(),createdAt:N.string(),updatedAt:N.string(),expiresAt:N.string().optional()}),oie=ws.extend({records:A7.omit({owner:!0}).array()}),bK=N.object({credentials:N.object({categories:N.record(N.string().array()).default({})}),personal:N.record(N.string()).default({}),date:N.string()}),sie=ws.extend({records:bK.array()}),S7=N.object({sharing:N.boolean().optional(),shared:N.string().array().optional(),shareAll:N.boolean().optional(),shareUntil:N.string().optional()}),M7=N.object({read:N.object({anonymize:N.boolean().optional(),credentials:N.object({shareAll:N.boolean().optional(),sharing:N.boolean().optional(),categories:N.record(S7).default({})}).default({}),personal:N.record(N.string()).default({})}).default({}),write:N.object({credentials:N.object({categories:N.record(N.boolean()).default({})}).default({}),personal:N.record(N.boolean()).default({})}).default({})}),aie=ws.extend({records:N.object({expiresAt:N.string().optional(),oneTime:N.boolean().optional(),terms:M7,contract:A7,uri:N.string(),consenter:tu,status:pK}).array()}),fie=N.object({read:N.object({anonymize:N.boolean().optional(),credentials:N.object({categories:N.record(N.object({required:N.boolean().optional()})).optional()}).optional(),personal:N.record(N.object({required:N.boolean().optional()})).optional()}).optional(),write:N.object({credentials:N.object({categories:N.record(N.object({required:N.boolean().optional()})).optional()}).optional(),personal:N.record(N.object({required:N.boolean().optional()})).optional()}).optional()}),cie=N.object({anonymize:N.boolean().optional(),credentials:N.object({categories:N.record(N.boolean()).optional()}).optional(),personal:N.record(N.boolean()).optional()}),gK=N.object({read:N.object({anonymize:N.boolean().optional(),credentials:N.object({shareAll:N.boolean().optional(),sharing:N.boolean().optional(),categories:N.record(S7.optional()).optional()}).optional(),personal:N.record(N.string()).optional()}).optional(),write:N.object({credentials:N.object({categories:N.record(N.boolean()).optional()}).optional(),personal:N.record(N.boolean()).optional()}).optional()}),M2=N.enum(["consent","update","sync","withdraw"]),uie=N.object({terms:gK.optional(),action:M2.or(M2.array()).optional(),date:N.object({$gt:N.string()}).or(N.object({$lt:N.string()})).or(N.object({$eq:N.string()})).optional(),expiresAt:N.object({$gt:N.string()}).or(N.object({$lt:N.string()})).or(N.object({$eq:N.string()})).optional(),oneTime:N.boolean().optional()}),T7=N.object({expiresAt:N.string().optional(),oneTime:N.boolean().optional(),terms:M7.optional(),id:N.string(),action:M2,date:N.string()}),lie=ws.extend({records:T7.array()}),vK=N.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),yK=N.object({title:N.string().optional(),body:N.string().optional()}),xK=N.object({vcUris:N.array(N.string()).optional(),vpUris:N.array(N.string()).optional(),transaction:T7.optional()}),hie=N.object({type:vK,to:tu.partial().and(N.object({did:N.string()})),from:tu.partial().and(N.object({did:N.string()})),message:yK.optional(),data:xK.optional(),sent:N.string().datetime().optional()});var bp=o(r=>`lc:ceramic:${r}`,"streamIdToCeramicURI");var C2=N.string().refine(r=>r.split(":").length===3&&r.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(r=>r.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var gp=o(async(r,{ceramicEndpoint:e,defaultContentFamily:t})=>{let n=new Bl(e),i=o(async(R,I,P,X)=>r.invoke.didResolver(R,X),"learnCardResolver"),s={...f_.getResolver(),web:i},f=new of({resolver:s});n.did=f;let u=r.invoke.getKey(),d=new hl(K8(u));n.did.setProvider(d),await n.did.authenticate();let g=new Il({ceramic:n}),y=o(async(R,I={},P={},X)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=t),"pin"in P||(P.pin=!0),X?.encrypt){r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",X);let J=X?.recipients||[];X?.controllersCanDecrypt&&(J=[...J,...I.controllers]),R=await n?.did?.createDagJWE(R,C7.default.uniq(J))}return r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,P),(await Yn.create(n,R,I,P)).id.toString()},"publishContentToCeramic"),E=o(async R=>{let I=(await g.load(R))?.content;if(r.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await f.decryptDagJWE(I)}catch(P){throw r.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",P),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await ql.or(T2).parseAsync(R),bp(await y(R,{},{},I))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,I)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(I)),uploadEncrypted:async(R,I,P)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...P?{recipients:P.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let P=await C2.spa(I);if(!P.success)return;let X=P.data.split(":")[2];try{return await ql.or(T2).parseAsync(await E(X))}catch(B){R.debug?.(B);return}}},methods:{publishContentToCeramic:async(R,I,P)=>bp(await y(I,{},{},P)),readContentFromCeramic:async(R,I)=>E(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var wK=gp;
822
822
  /*!
823
823
  * The buffer module from node.js, for the browser.
824
824
  *