@learncard/ceramic-plugin 1.0.40 → 1.0.42

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,7 +1,7 @@
1
- "use strict";var QI=Object.create;var Tu=Object.defineProperty;var eD=Object.getOwnPropertyDescriptor;var tD=Object.getOwnPropertyNames;var rD=Object.getPrototypeOf,nD=Object.prototype.hasOwnProperty;var o=(r,e)=>Tu(r,"name",{value:e,configurable:!0});var Vt=(r,e)=>()=>(r&&(e=r(r=0)),e);var Re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Xt=(r,e)=>{for(var t in e)Tu(r,t,{get:e[t],enumerable:!0})},u3=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tD(e))!nD.call(r,i)&&i!==t&&Tu(r,i,{get:()=>e[i],enumerable:!(n=eD(e,i))||n.enumerable});return r};var Ut=(r,e,t)=>(t=r!=null?QI(rD(r)):{},u3(e||!r||!r.__esModule?Tu(t,"default",{value:r,enumerable:!0}):t,r)),qh=r=>u3(Tu({},"__esModule",{value:!0}),r);var l3=Re((Xf,Cu)=>{(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__",v=1,x=2,E=4,O=1,R=2,I=1,B=2,Y=4,P=8,J=16,ee=32,X=64,ne=128,V=256,H=512,z=30,he="...",L=800,h=16,g=1,b=2,l=3,m=1/0,_=9007199254740991,S=17976931348623157e292,A=0/0,y=4294967295,C=y-1,N=y>>>1,w=[["ary",ne],["bind",I],["bindKey",B],["curry",P],["curryRight",J],["flip",H],["partial",ee],["partialRight",X],["rearg",V]],k="[object Arguments]",fe="[object Array]",D="[object AsyncFunction]",Q="[object Boolean]",se="[object Date]",q="[object DOMException]",j="[object Error]",G="[object Function]",te="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",ie="[object Object]",Me="[object Promise]",ue="[object Proxy]",ve="[object RegExp]",W="[object Set]",pe="[object String]",ke="[object Symbol]",je="[object Undefined]",Pe="[object WeakMap]",Je="[object WeakSet]",gr="[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]",Rt="[object Uint16Array]",Fe="[object Uint32Array]",Ne=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xe=/&(?:amp|lt|gt|quot|#39);/g,Pn=/[&<>"']/g,st=RegExp(Xe.source),at=RegExp(Pn.source),ii=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,oi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/,ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pn=/[\\^$.*+?()[\]{}|]/g,lt=RegExp(pn.source),Qe=/^\s+/,si=/\s/,ht=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dt=/\{\n\/\* \[wrapped with (.+)\] \*/,ai=/,? & /,pt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,mt=/[()=,{}\[\]\/\s]/,fi=/\\(\\)?/g,bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,Bn=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Ht=/^\[object .+?Constructor\]$/,mn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,gn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fr=/($^)/,vn=/['\n\r\u2028\u2029\\]/g,ci="\\ud800-\\udfff",Lo="\\u0300-\\u036f",Uo="\\ufe20-\\ufe2f",Fo="\\u20d0-\\u20ff",fo=Lo+Uo+Fo,co="\\u2700-\\u27bf",uo="a-z\\xdf-\\xf6\\xf8-\\xff",$o="\\xac\\xb1\\xd7\\xf7",qo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ho="\\u2000-\\u206f",zo=" \\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",Pf="A-Z\\xc0-\\xd6\\xd8-\\xde",Bf="\\ufe0e\\ufe0f",Lf=$o+qo+Ho+zo,Ip="['\u2019]",QA="["+ci+"]",Kv="["+Lf+"]",th="["+fo+"]",Vv="\\d+",e7="["+co+"]",Gv="["+uo+"]",Wv="[^"+ci+Lf+Vv+co+uo+Pf+"]",Dp="\\ud83c[\\udffb-\\udfff]",t7="(?:"+th+"|"+Dp+")",Jv="[^"+ci+"]",Rp="(?:\\ud83c[\\udde6-\\uddff]){2}",Op="[\\ud800-\\udbff][\\udc00-\\udfff]",Uf="["+Pf+"]",Yv="\\u200d",Xv="(?:"+Gv+"|"+Wv+")",r7="(?:"+Uf+"|"+Wv+")",Zv="(?:"+Ip+"(?:d|ll|m|re|s|t|ve))?",Qv="(?:"+Ip+"(?:D|LL|M|RE|S|T|VE))?",e2=t7+"?",t2="["+Bf+"]?",n7="(?:"+Yv+"(?:"+[Jv,Rp,Op].join("|")+")"+t2+e2+")*",i7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",r2=t2+e2+n7,s7="(?:"+[e7,Rp,Op].join("|")+")"+r2,a7="(?:"+[Jv+th+"?",th,Rp,Op,QA].join("|")+")",f7=RegExp(Ip,"g"),c7=RegExp(th,"g"),Np=RegExp(Dp+"(?="+Dp+")|"+a7+r2,"g"),u7=RegExp([Uf+"?"+Gv+"+"+Zv+"(?="+[Kv,Uf,"$"].join("|")+")",r7+"+"+Qv+"(?="+[Kv,Uf+Xv,"$"].join("|")+")",Uf+"?"+Xv+"+"+Zv,Uf+"+"+Qv,o7,i7,Vv,s7].join("|"),"g"),l7=RegExp("["+Yv+ci+fo+Bf+"]"),h7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,d7=["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"],p7=-1,ar={};ar[oe]=ar[F]=ar[Z]=ar[me]=ar[ye]=ar[we]=ar[Ie]=ar[Rt]=ar[Fe]=!0,ar[k]=ar[fe]=ar[gr]=ar[Q]=ar[le]=ar[se]=ar[j]=ar[G]=ar[ae]=ar[Ae]=ar[ie]=ar[ve]=ar[W]=ar[pe]=ar[Pe]=!1;var rr={};rr[k]=rr[fe]=rr[gr]=rr[le]=rr[Q]=rr[se]=rr[oe]=rr[F]=rr[Z]=rr[me]=rr[ye]=rr[ae]=rr[Ae]=rr[ie]=rr[ve]=rr[W]=rr[pe]=rr[ke]=rr[we]=rr[Ie]=rr[Rt]=rr[Fe]=!0,rr[j]=rr[G]=rr[Pe]=!1;var m7={\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"},b7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},v7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},y7=parseFloat,x7=parseInt,n2=typeof global=="object"&&global&&global.Object===Object&&global,w7=typeof self=="object"&&self&&self.Object===Object&&self,Cr=n2||w7||Function("return this")(),Pp=typeof Xf=="object"&&Xf&&!Xf.nodeType&&Xf,Ta=Pp&&typeof Cu=="object"&&Cu&&!Cu.nodeType&&Cu,i2=Ta&&Ta.exports===Pp,Bp=i2&&n2.process,ui=function(){try{var de=Ta&&Ta.require&&Ta.require("util").types;return de||Bp&&Bp.binding&&Bp.binding("util")}catch{}}(),o2=ui&&ui.isArrayBuffer,s2=ui&&ui.isDate,a2=ui&&ui.isMap,f2=ui&&ui.isRegExp,c2=ui&&ui.isSet,u2=ui&&ui.isTypedArray;function Ln(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(Ln,"apply");function _7(de,Ee,xe,ze){for(var xt=-1,zt=de==null?0:de.length;++xt<zt;){var Er=de[xt];Ee(ze,Er,xe(Er),de)}return ze}o(_7,"arrayAggregator");function li(de,Ee){for(var xe=-1,ze=de==null?0:de.length;++xe<ze&&Ee(de[xe],xe,de)!==!1;);return de}o(li,"arrayEach");function E7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(E7,"arrayEachRight");function l2(de,Ee){for(var xe=-1,ze=de==null?0:de.length;++xe<ze;)if(!Ee(de[xe],xe,de))return!1;return!0}o(l2,"arrayEvery");function Ms(de,Ee){for(var xe=-1,ze=de==null?0:de.length,xt=0,zt=[];++xe<ze;){var Er=de[xe];Ee(Er,xe,de)&&(zt[xt++]=Er)}return zt}o(Ms,"arrayFilter");function rh(de,Ee){var xe=de==null?0:de.length;return!!xe&&Ff(de,Ee,0)>-1}o(rh,"arrayIncludes");function Lp(de,Ee,xe){for(var ze=-1,xt=de==null?0:de.length;++ze<xt;)if(xe(Ee,de[ze]))return!0;return!1}o(Lp,"arrayIncludesWith");function cr(de,Ee){for(var xe=-1,ze=de==null?0:de.length,xt=Array(ze);++xe<ze;)xt[xe]=Ee(de[xe],xe,de);return xt}o(cr,"arrayMap");function Ts(de,Ee){for(var xe=-1,ze=Ee.length,xt=de.length;++xe<ze;)de[xt+xe]=Ee[xe];return de}o(Ts,"arrayPush");function Up(de,Ee,xe,ze){var xt=-1,zt=de==null?0:de.length;for(ze&&zt&&(xe=de[++xt]);++xt<zt;)xe=Ee(xe,de[xt],xt,de);return xe}o(Up,"arrayReduce");function A7(de,Ee,xe,ze){var xt=de==null?0:de.length;for(ze&&xt&&(xe=de[--xt]);xt--;)xe=Ee(xe,de[xt],xt,de);return xe}o(A7,"arrayReduceRight");function Fp(de,Ee){for(var xe=-1,ze=de==null?0:de.length;++xe<ze;)if(Ee(de[xe],xe,de))return!0;return!1}o(Fp,"arraySome");var S7=$p("length");function M7(de){return de.split("")}o(M7,"asciiToArray");function T7(de){return de.match(pt)||[]}o(T7,"asciiWords");function h2(de,Ee,xe){var ze;return xe(de,function(xt,zt,Er){if(Ee(xt,zt,Er))return ze=zt,!1}),ze}o(h2,"baseFindKey");function nh(de,Ee,xe,ze){for(var xt=de.length,zt=xe+(ze?1:-1);ze?zt--:++zt<xt;)if(Ee(de[zt],zt,de))return zt;return-1}o(nh,"baseFindIndex");function Ff(de,Ee,xe){return Ee===Ee?F7(de,Ee,xe):nh(de,d2,xe)}o(Ff,"baseIndexOf");function C7(de,Ee,xe,ze){for(var xt=xe-1,zt=de.length;++xt<zt;)if(ze(de[xt],Ee))return xt;return-1}o(C7,"baseIndexOfWith");function d2(de){return de!==de}o(d2,"baseIsNaN");function p2(de,Ee){var xe=de==null?0:de.length;return xe?Hp(de,Ee)/xe:A}o(p2,"baseMean");function $p(de){return function(Ee){return Ee==null?r:Ee[de]}}o($p,"baseProperty");function qp(de){return function(Ee){return de==null?r:de[Ee]}}o(qp,"basePropertyOf");function m2(de,Ee,xe,ze,xt){return xt(de,function(zt,Er,er){xe=ze?(ze=!1,zt):Ee(xe,zt,Er,er)}),xe}o(m2,"baseReduce");function k7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(k7,"baseSortBy");function Hp(de,Ee){for(var xe,ze=-1,xt=de.length;++ze<xt;){var zt=Ee(de[ze]);zt!==r&&(xe=xe===r?zt:xe+zt)}return xe}o(Hp,"baseSum");function zp(de,Ee){for(var xe=-1,ze=Array(de);++xe<de;)ze[xe]=Ee(xe);return ze}o(zp,"baseTimes");function I7(de,Ee){return cr(Ee,function(xe){return[xe,de[xe]]})}o(I7,"baseToPairs");function b2(de){return de&&de.slice(0,x2(de)+1).replace(Qe,"")}o(b2,"baseTrim");function Un(de){return function(Ee){return de(Ee)}}o(Un,"baseUnary");function jp(de,Ee){return cr(Ee,function(xe){return de[xe]})}o(jp,"baseValues");function hu(de,Ee){return de.has(Ee)}o(hu,"cacheHas");function g2(de,Ee){for(var xe=-1,ze=de.length;++xe<ze&&Ff(Ee,de[xe],0)>-1;);return xe}o(g2,"charsStartIndex");function v2(de,Ee){for(var xe=de.length;xe--&&Ff(Ee,de[xe],0)>-1;);return xe}o(v2,"charsEndIndex");function D7(de,Ee){for(var xe=de.length,ze=0;xe--;)de[xe]===Ee&&++ze;return ze}o(D7,"countHolders");var R7=qp(m7),O7=qp(b7);function N7(de){return"\\"+v7[de]}o(N7,"escapeStringChar");function P7(de,Ee){return de==null?r:de[Ee]}o(P7,"getValue");function $f(de){return l7.test(de)}o($f,"hasUnicode");function B7(de){return h7.test(de)}o(B7,"hasUnicodeWord");function L7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(L7,"iteratorToArray");function Kp(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(ze,xt){xe[++Ee]=[xt,ze]}),xe}o(Kp,"mapToArray");function y2(de,Ee){return function(xe){return de(Ee(xe))}}o(y2,"overArg");function Cs(de,Ee){for(var xe=-1,ze=de.length,xt=0,zt=[];++xe<ze;){var Er=de[xe];(Er===Ee||Er===d)&&(de[xe]=d,zt[xt++]=xe)}return zt}o(Cs,"replaceHolders");function ih(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(ze){xe[++Ee]=ze}),xe}o(ih,"setToArray");function U7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(ze){xe[++Ee]=[ze,ze]}),xe}o(U7,"setToPairs");function F7(de,Ee,xe){for(var ze=xe-1,xt=de.length;++ze<xt;)if(de[ze]===Ee)return ze;return-1}o(F7,"strictIndexOf");function $7(de,Ee,xe){for(var ze=xe+1;ze--;)if(de[ze]===Ee)return ze;return ze}o($7,"strictLastIndexOf");function qf(de){return $f(de)?H7(de):S7(de)}o(qf,"stringSize");function Pi(de){return $f(de)?z7(de):M7(de)}o(Pi,"stringToArray");function x2(de){for(var Ee=de.length;Ee--&&si.test(de.charAt(Ee)););return Ee}o(x2,"trimmedEndIndex");var q7=qp(g7);function H7(de){for(var Ee=Np.lastIndex=0;Np.test(de);)++Ee;return Ee}o(H7,"unicodeSize");function z7(de){return de.match(Np)||[]}o(z7,"unicodeToArray");function j7(de){return de.match(u7)||[]}o(j7,"unicodeWords");var K7=o(function de(Ee){Ee=Ee==null?Cr:ks.defaults(Cr.Object(),Ee,ks.pick(Cr,d7));var xe=Ee.Array,ze=Ee.Date,xt=Ee.Error,zt=Ee.Function,Er=Ee.Math,er=Ee.Object,Vp=Ee.RegExp,V7=Ee.String,hi=Ee.TypeError,oh=xe.prototype,G7=zt.prototype,Hf=er.prototype,sh=Ee["__core-js_shared__"],ah=G7.toString,Jt=Hf.hasOwnProperty,W7=0,w2=function(){var a=/[^.]+$/.exec(sh&&sh.keys&&sh.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),fh=Hf.toString,J7=ah.call(er),Y7=Cr._,X7=Vp("^"+ah.call(Jt).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ch=i2?Ee.Buffer:r,Is=Ee.Symbol,uh=Ee.Uint8Array,_2=ch?ch.allocUnsafe:r,lh=y2(er.getPrototypeOf,er),E2=er.create,A2=Hf.propertyIsEnumerable,hh=oh.splice,S2=Is?Is.isConcatSpreadable:r,du=Is?Is.iterator:r,Ca=Is?Is.toStringTag:r,dh=function(){try{var a=Oa(er,"defineProperty");return a({},"",{}),a}catch{}}(),Z7=Ee.clearTimeout!==Cr.clearTimeout&&Ee.clearTimeout,Q7=ze&&ze.now!==Cr.Date.now&&ze.now,eS=Ee.setTimeout!==Cr.setTimeout&&Ee.setTimeout,ph=Er.ceil,mh=Er.floor,Gp=er.getOwnPropertySymbols,tS=ch?ch.isBuffer:r,M2=Ee.isFinite,rS=oh.join,nS=y2(er.keys,er),Ar=Er.max,Wr=Er.min,iS=ze.now,oS=Ee.parseInt,T2=Er.random,sS=oh.reverse,Wp=Oa(Ee,"DataView"),pu=Oa(Ee,"Map"),Jp=Oa(Ee,"Promise"),zf=Oa(Ee,"Set"),mu=Oa(Ee,"WeakMap"),bu=Oa(er,"create"),bh=mu&&new mu,jf={},aS=Na(Wp),fS=Na(pu),cS=Na(Jp),uS=Na(zf),lS=Na(mu),gh=Is?Is.prototype:r,gu=gh?gh.valueOf:r,C2=gh?gh.toString:r;function $(a){if(lr(a)&&!wt(a)&&!(a instanceof Ot)){if(a instanceof di)return a;if(Jt.call(a,"__wrapped__"))return ky(a)}return new di(a)}o($,"lodash");var Kf=function(){function a(){}return o(a,"object"),function(c){if(!ur(c))return{};if(E2)return E2(c);a.prototype=c;var p=new a;return a.prototype=r,p}}();function vh(){}o(vh,"baseLodash");function di(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}o(di,"LodashWrapper"),$.templateSettings={escape:ii,evaluate:ft,interpolate:rt,variable:"",imports:{_:$}},$.prototype=vh.prototype,$.prototype.constructor=$,di.prototype=Kf(vh.prototype),di.prototype.constructor=di;function Ot(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}o(Ot,"LazyWrapper");function hS(){var a=new Ot(this.__wrapped__);return a.__actions__=yn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=yn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=yn(this.__views__),a}o(hS,"lazyClone");function dS(){if(this.__filtered__){var a=new Ot(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}o(dS,"lazyReverse");function pS(){var a=this.__wrapped__.value(),c=this.__dir__,p=wt(a),M=c<0,U=p?a.length:0,K=MM(0,U,this.__views__),re=K.start,ce=K.end,be=ce-re,Te=M?ce:re-1,Ce=this.__iteratees__,De=Ce.length,Le=0,Ke=Wr(be,this.__takeCount__);if(!p||!M&&U==be&&Ke==be)return Z2(a,this.__actions__);var et=[];e:for(;be--&&Le<Ke;){Te+=c;for(var St=-1,tt=a[Te];++St<De;){var It=Ce[St],Nt=It.iteratee,qn=It.type,un=Nt(tt);if(qn==b)tt=un;else if(!un){if(qn==g)continue e;break e}}et[Le++]=tt}return et}o(pS,"lazyValue"),Ot.prototype=Kf(vh.prototype),Ot.prototype.constructor=Ot;function ka(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(ka,"Hash");function mS(){this.__data__=bu?bu(null):{},this.size=0}o(mS,"hashClear");function bS(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}o(bS,"hashDelete");function gS(a){var c=this.__data__;if(bu){var p=c[a];return p===f?r:p}return Jt.call(c,a)?c[a]:r}o(gS,"hashGet");function vS(a){var c=this.__data__;return bu?c[a]!==r:Jt.call(c,a)}o(vS,"hashHas");function yS(a,c){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=bu&&c===r?f:c,this}o(yS,"hashSet"),ka.prototype.clear=mS,ka.prototype.delete=bS,ka.prototype.get=gS,ka.prototype.has=vS,ka.prototype.set=yS;function jo(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(jo,"ListCache");function xS(){this.__data__=[],this.size=0}o(xS,"listCacheClear");function wS(a){var c=this.__data__,p=yh(c,a);if(p<0)return!1;var M=c.length-1;return p==M?c.pop():hh.call(c,p,1),--this.size,!0}o(wS,"listCacheDelete");function _S(a){var c=this.__data__,p=yh(c,a);return p<0?r:c[p][1]}o(_S,"listCacheGet");function ES(a){return yh(this.__data__,a)>-1}o(ES,"listCacheHas");function AS(a,c){var p=this.__data__,M=yh(p,a);return M<0?(++this.size,p.push([a,c])):p[M][1]=c,this}o(AS,"listCacheSet"),jo.prototype.clear=xS,jo.prototype.delete=wS,jo.prototype.get=_S,jo.prototype.has=ES,jo.prototype.set=AS;function Ko(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(Ko,"MapCache");function SS(){this.size=0,this.__data__={hash:new ka,map:new(pu||jo),string:new ka}}o(SS,"mapCacheClear");function MS(a){var c=Dh(this,a).delete(a);return this.size-=c?1:0,c}o(MS,"mapCacheDelete");function TS(a){return Dh(this,a).get(a)}o(TS,"mapCacheGet");function CS(a){return Dh(this,a).has(a)}o(CS,"mapCacheHas");function kS(a,c){var p=Dh(this,a),M=p.size;return p.set(a,c),this.size+=p.size==M?0:1,this}o(kS,"mapCacheSet"),Ko.prototype.clear=SS,Ko.prototype.delete=MS,Ko.prototype.get=TS,Ko.prototype.has=CS,Ko.prototype.set=kS;function Ia(a){var c=-1,p=a==null?0:a.length;for(this.__data__=new Ko;++c<p;)this.add(a[c])}o(Ia,"SetCache");function IS(a){return this.__data__.set(a,f),this}o(IS,"setCacheAdd");function DS(a){return this.__data__.has(a)}o(DS,"setCacheHas"),Ia.prototype.add=Ia.prototype.push=IS,Ia.prototype.has=DS;function Bi(a){var c=this.__data__=new jo(a);this.size=c.size}o(Bi,"Stack");function RS(){this.__data__=new jo,this.size=0}o(RS,"stackClear");function OS(a){var c=this.__data__,p=c.delete(a);return this.size=c.size,p}o(OS,"stackDelete");function NS(a){return this.__data__.get(a)}o(NS,"stackGet");function PS(a){return this.__data__.has(a)}o(PS,"stackHas");function BS(a,c){var p=this.__data__;if(p instanceof jo){var M=p.__data__;if(!pu||M.length<t-1)return M.push([a,c]),this.size=++p.size,this;p=this.__data__=new Ko(M)}return p.set(a,c),this.size=p.size,this}o(BS,"stackSet"),Bi.prototype.clear=RS,Bi.prototype.delete=OS,Bi.prototype.get=NS,Bi.prototype.has=PS,Bi.prototype.set=BS;function k2(a,c){var p=wt(a),M=!p&&Pa(a),U=!p&&!M&&Ps(a),K=!p&&!M&&!U&&Jf(a),re=p||M||U||K,ce=re?zp(a.length,V7):[],be=ce.length;for(var Te in a)(c||Jt.call(a,Te))&&!(re&&(Te=="length"||U&&(Te=="offset"||Te=="parent")||K&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Jo(Te,be)))&&ce.push(Te);return ce}o(k2,"arrayLikeKeys");function I2(a){var c=a.length;return c?a[sm(0,c-1)]:r}o(I2,"arraySample");function LS(a,c){return Rh(yn(a),Da(c,0,a.length))}o(LS,"arraySampleSize");function US(a){return Rh(yn(a))}o(US,"arrayShuffle");function Yp(a,c,p){(p!==r&&!Li(a[c],p)||p===r&&!(c in a))&&Vo(a,c,p)}o(Yp,"assignMergeValue");function vu(a,c,p){var M=a[c];(!(Jt.call(a,c)&&Li(M,p))||p===r&&!(c in a))&&Vo(a,c,p)}o(vu,"assignValue");function yh(a,c){for(var p=a.length;p--;)if(Li(a[p][0],c))return p;return-1}o(yh,"assocIndexOf");function FS(a,c,p,M){return Ds(a,function(U,K,re){c(M,U,p(U),re)}),M}o(FS,"baseAggregator");function D2(a,c){return a&&ho(c,kr(c),a)}o(D2,"baseAssign");function $S(a,c){return a&&ho(c,wn(c),a)}o($S,"baseAssignIn");function Vo(a,c,p){c=="__proto__"&&dh?dh(a,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[c]=p}o(Vo,"baseAssignValue");function Xp(a,c){for(var p=-1,M=c.length,U=xe(M),K=a==null;++p<M;)U[p]=K?r:Dm(a,c[p]);return U}o(Xp,"baseAt");function Da(a,c,p){return a===a&&(p!==r&&(a=a<=p?a:p),c!==r&&(a=a>=c?a:c)),a}o(Da,"baseClamp");function pi(a,c,p,M,U,K){var re,ce=c&v,be=c&x,Te=c&E;if(p&&(re=U?p(a,M,U,K):p(a)),re!==r)return re;if(!ur(a))return a;var Ce=wt(a);if(Ce){if(re=CM(a),!ce)return yn(a,re)}else{var De=Jr(a),Le=De==G||De==te;if(Ps(a))return ty(a,ce);if(De==ie||De==k||Le&&!U){if(re=be||Le?{}:xy(a),!ce)return be?gM(a,$S(re,a)):bM(a,D2(re,a))}else{if(!rr[De])return U?a:{};re=kM(a,De,ce)}}K||(K=new Bi);var Ke=K.get(a);if(Ke)return Ke;K.set(a,re),Jy(a)?a.forEach(function(tt){re.add(pi(tt,c,p,tt,a,K))}):Gy(a)&&a.forEach(function(tt,It){re.set(It,pi(tt,c,p,It,a,K))});var et=Te?be?gm:bm:be?wn:kr,St=Ce?r:et(a);return li(St||a,function(tt,It){St&&(It=tt,tt=a[It]),vu(re,It,pi(tt,c,p,It,a,K))}),re}o(pi,"baseClone");function qS(a){var c=kr(a);return function(p){return R2(p,a,c)}}o(qS,"baseConforms");function R2(a,c,p){var M=p.length;if(a==null)return!M;for(a=er(a);M--;){var U=p[M],K=c[U],re=a[U];if(re===r&&!(U in a)||!K(re))return!1}return!0}o(R2,"baseConformsTo");function O2(a,c,p){if(typeof a!="function")throw new hi(i);return Su(function(){a.apply(r,p)},c)}o(O2,"baseDelay");function yu(a,c,p,M){var U=-1,K=rh,re=!0,ce=a.length,be=[],Te=c.length;if(!ce)return be;p&&(c=cr(c,Un(p))),M?(K=Lp,re=!1):c.length>=t&&(K=hu,re=!1,c=new Ia(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 Le=Te;Le--;)if(c[Le]===De)continue e;be.push(Ce)}else K(c,De,M)||be.push(Ce)}return be}o(yu,"baseDifference");var Ds=sy(lo),N2=sy(Qp,!0);function HS(a,c){var p=!0;return Ds(a,function(M,U,K){return p=!!c(M,U,K),p}),p}o(HS,"baseEvery");function xh(a,c,p){for(var M=-1,U=a.length;++M<U;){var K=a[M],re=c(K);if(re!=null&&(ce===r?re===re&&!$n(re):p(re,ce)))var ce=re,be=K}return be}o(xh,"baseExtremum");function zS(a,c,p,M){var U=a.length;for(p=At(p),p<0&&(p=-p>U?0:U+p),M=M===r||M>U?U:At(M),M<0&&(M+=U),M=p>M?0:Xy(M);p<M;)a[p++]=c;return a}o(zS,"baseFill");function P2(a,c){var p=[];return Ds(a,function(M,U,K){c(M,U,K)&&p.push(M)}),p}o(P2,"baseFilter");function $r(a,c,p,M,U){var K=-1,re=a.length;for(p||(p=DM),U||(U=[]);++K<re;){var ce=a[K];c>0&&p(ce)?c>1?$r(ce,c-1,p,M,U):Ts(U,ce):M||(U[U.length]=ce)}return U}o($r,"baseFlatten");var Zp=ay(),B2=ay(!0);function lo(a,c){return a&&Zp(a,c,kr)}o(lo,"baseForOwn");function Qp(a,c){return a&&B2(a,c,kr)}o(Qp,"baseForOwnRight");function wh(a,c){return Ms(c,function(p){return Yo(a[p])})}o(wh,"baseFunctions");function Ra(a,c){c=Os(c,a);for(var p=0,M=c.length;a!=null&&p<M;)a=a[po(c[p++])];return p&&p==M?a:r}o(Ra,"baseGet");function L2(a,c,p){var M=c(a);return wt(a)?M:Ts(M,p(a))}o(L2,"baseGetAllKeys");function fn(a){return a==null?a===r?je:ge:Ca&&Ca in er(a)?SM(a):UM(a)}o(fn,"baseGetTag");function em(a,c){return a>c}o(em,"baseGt");function jS(a,c){return a!=null&&Jt.call(a,c)}o(jS,"baseHas");function KS(a,c){return a!=null&&c in er(a)}o(KS,"baseHasIn");function VS(a,c,p){return a>=Wr(c,p)&&a<Ar(c,p)}o(VS,"baseInRange");function tm(a,c,p){for(var M=p?Lp:rh,U=a[0].length,K=a.length,re=K,ce=xe(K),be=1/0,Te=[];re--;){var Ce=a[re];re&&c&&(Ce=cr(Ce,Un(c))),be=Wr(Ce.length,be),ce[re]=!p&&(c||U>=120&&Ce.length>=120)?new Ia(re&&Ce):r}Ce=a[0];var De=-1,Le=ce[0];e:for(;++De<U&&Te.length<be;){var Ke=Ce[De],et=c?c(Ke):Ke;if(Ke=p||Ke!==0?Ke:0,!(Le?hu(Le,et):M(Te,et,p))){for(re=K;--re;){var St=ce[re];if(!(St?hu(St,et):M(a[re],et,p)))continue e}Le&&Le.push(et),Te.push(Ke)}}return Te}o(tm,"baseIntersection");function GS(a,c,p,M){return lo(a,function(U,K,re){c(M,p(U),K,re)}),M}o(GS,"baseInverter");function xu(a,c,p){c=Os(c,a),a=Ay(a,c);var M=a==null?a:a[po(bi(c))];return M==null?r:Ln(M,a,p)}o(xu,"baseInvoke");function U2(a){return lr(a)&&fn(a)==k}o(U2,"baseIsArguments");function WS(a){return lr(a)&&fn(a)==gr}o(WS,"baseIsArrayBuffer");function JS(a){return lr(a)&&fn(a)==se}o(JS,"baseIsDate");function wu(a,c,p,M,U){return a===c?!0:a==null||c==null||!lr(a)&&!lr(c)?a!==a&&c!==c:YS(a,c,p,M,wu,U)}o(wu,"baseIsEqual");function YS(a,c,p,M,U,K){var re=wt(a),ce=wt(c),be=re?fe:Jr(a),Te=ce?fe:Jr(c);be=be==k?ie:be,Te=Te==k?ie:Te;var Ce=be==ie,De=Te==ie,Le=be==Te;if(Le&&Ps(a)){if(!Ps(c))return!1;re=!0,Ce=!1}if(Le&&!Ce)return K||(K=new Bi),re||Jf(a)?gy(a,c,p,M,U,K):EM(a,c,be,p,M,U,K);if(!(p&O)){var Ke=Ce&&Jt.call(a,"__wrapped__"),et=De&&Jt.call(c,"__wrapped__");if(Ke||et){var St=Ke?a.value():a,tt=et?c.value():c;return K||(K=new Bi),U(St,tt,p,M,K)}}return Le?(K||(K=new Bi),AM(a,c,p,M,U,K)):!1}o(YS,"baseIsEqualDeep");function XS(a){return lr(a)&&Jr(a)==ae}o(XS,"baseIsMap");function rm(a,c,p,M){var U=p.length,K=U,re=!M;if(a==null)return!K;for(a=er(a);U--;){var ce=p[U];if(re&&ce[2]?ce[1]!==a[ce[0]]:!(ce[0]in a))return!1}for(;++U<K;){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 Bi;if(M)var Le=M(Te,Ce,be,a,c,De);if(!(Le===r?wu(Ce,Te,O|R,M,De):Le))return!1}}return!0}o(rm,"baseIsMatch");function F2(a){if(!ur(a)||OM(a))return!1;var c=Yo(a)?X7:Ht;return c.test(Na(a))}o(F2,"baseIsNative");function ZS(a){return lr(a)&&fn(a)==ve}o(ZS,"baseIsRegExp");function QS(a){return lr(a)&&Jr(a)==W}o(QS,"baseIsSet");function eM(a){return lr(a)&&Uh(a.length)&&!!ar[fn(a)]}o(eM,"baseIsTypedArray");function $2(a){return typeof a=="function"?a:a==null?_n:typeof a=="object"?wt(a)?z2(a[0],a[1]):H2(a):f3(a)}o($2,"baseIteratee");function nm(a){if(!Au(a))return nS(a);var c=[];for(var p in er(a))Jt.call(a,p)&&p!="constructor"&&c.push(p);return c}o(nm,"baseKeys");function tM(a){if(!ur(a))return LM(a);var c=Au(a),p=[];for(var M in a)M=="constructor"&&(c||!Jt.call(a,M))||p.push(M);return p}o(tM,"baseKeysIn");function im(a,c){return a<c}o(im,"baseLt");function q2(a,c){var p=-1,M=xn(a)?xe(a.length):[];return Ds(a,function(U,K,re){M[++p]=c(U,K,re)}),M}o(q2,"baseMap");function H2(a){var c=ym(a);return c.length==1&&c[0][2]?_y(c[0][0],c[0][1]):function(p){return p===a||rm(p,a,c)}}o(H2,"baseMatches");function z2(a,c){return wm(a)&&wy(c)?_y(po(a),c):function(p){var M=Dm(p,a);return M===r&&M===c?Rm(p,a):wu(c,M,O|R)}}o(z2,"baseMatchesProperty");function _h(a,c,p,M,U){a!==c&&Zp(c,function(K,re){if(U||(U=new Bi),ur(K))rM(a,c,re,p,_h,M,U);else{var ce=M?M(Em(a,re),K,re+"",a,c,U):r;ce===r&&(ce=K),Yp(a,re,ce)}},wn)}o(_h,"baseMerge");function rM(a,c,p,M,U,K,re){var ce=Em(a,p),be=Em(c,p),Te=re.get(be);if(Te){Yp(a,p,Te);return}var Ce=K?K(ce,be,p+"",a,c,re):r,De=Ce===r;if(De){var Le=wt(be),Ke=!Le&&Ps(be),et=!Le&&!Ke&&Jf(be);Ce=be,Le||Ke||et?wt(ce)?Ce=ce:vr(ce)?Ce=yn(ce):Ke?(De=!1,Ce=ty(be,!0)):et?(De=!1,Ce=ry(be,!0)):Ce=[]:Mu(be)||Pa(be)?(Ce=ce,Pa(ce)?Ce=Zy(ce):(!ur(ce)||Yo(ce))&&(Ce=xy(be))):De=!1}De&&(re.set(be,Ce),U(Ce,be,M,K,re),re.delete(be)),Yp(a,p,Ce)}o(rM,"baseMergeDeep");function j2(a,c){var p=a.length;if(!!p)return c+=c<0?p:0,Jo(c,p)?a[c]:r}o(j2,"baseNth");function K2(a,c,p){c.length?c=cr(c,function(K){return wt(K)?function(re){return Ra(re,K.length===1?K[0]:K)}:K}):c=[_n];var M=-1;c=cr(c,Un(Ze()));var U=q2(a,function(K,re,ce){var be=cr(c,function(Te){return Te(K)});return{criteria:be,index:++M,value:K}});return k7(U,function(K,re){return mM(K,re,p)})}o(K2,"baseOrderBy");function nM(a,c){return V2(a,c,function(p,M){return Rm(a,M)})}o(nM,"basePick");function V2(a,c,p){for(var M=-1,U=c.length,K={};++M<U;){var re=c[M],ce=Ra(a,re);p(ce,re)&&_u(K,Os(re,a),ce)}return K}o(V2,"basePickBy");function iM(a){return function(c){return Ra(c,a)}}o(iM,"basePropertyDeep");function om(a,c,p,M){var U=M?C7:Ff,K=-1,re=c.length,ce=a;for(a===c&&(c=yn(c)),p&&(ce=cr(a,Un(p)));++K<re;)for(var be=0,Te=c[K],Ce=p?p(Te):Te;(be=U(ce,Ce,be,M))>-1;)ce!==a&&hh.call(ce,be,1),hh.call(a,be,1);return a}o(om,"basePullAll");function G2(a,c){for(var p=a?c.length:0,M=p-1;p--;){var U=c[p];if(p==M||U!==K){var K=U;Jo(U)?hh.call(a,U,1):cm(a,U)}}return a}o(G2,"basePullAt");function sm(a,c){return a+mh(T2()*(c-a+1))}o(sm,"baseRandom");function oM(a,c,p,M){for(var U=-1,K=Ar(ph((c-a)/(p||1)),0),re=xe(K);K--;)re[M?K:++U]=a,a+=p;return re}o(oM,"baseRange");function am(a,c){var p="";if(!a||c<1||c>_)return p;do c%2&&(p+=a),c=mh(c/2),c&&(a+=a);while(c);return p}o(am,"baseRepeat");function Ct(a,c){return Am(Ey(a,c,_n),a+"")}o(Ct,"baseRest");function sM(a){return I2(Yf(a))}o(sM,"baseSample");function aM(a,c){var p=Yf(a);return Rh(p,Da(c,0,p.length))}o(aM,"baseSampleSize");function _u(a,c,p,M){if(!ur(a))return a;c=Os(c,a);for(var U=-1,K=c.length,re=K-1,ce=a;ce!=null&&++U<K;){var be=po(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=ur(Ce)?Ce:Jo(c[U+1])?[]:{})}vu(ce,be,Te),ce=ce[be]}return a}o(_u,"baseSet");var W2=bh?function(a,c){return bh.set(a,c),a}:_n,fM=dh?function(a,c){return dh(a,"toString",{configurable:!0,enumerable:!1,value:Nm(c),writable:!0})}:_n;function cM(a){return Rh(Yf(a))}o(cM,"baseShuffle");function mi(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 K=xe(U);++M<U;)K[M]=a[M+c];return K}o(mi,"baseSlice");function uM(a,c){var p;return Ds(a,function(M,U,K){return p=c(M,U,K),!p}),!!p}o(uM,"baseSome");function Eh(a,c,p){var M=0,U=a==null?M:a.length;if(typeof c=="number"&&c===c&&U<=N){for(;M<U;){var K=M+U>>>1,re=a[K];re!==null&&!$n(re)&&(p?re<=c:re<c)?M=K+1:U=K}return U}return fm(a,c,_n,p)}o(Eh,"baseSortedIndex");function fm(a,c,p,M){var U=0,K=a==null?0:a.length;if(K===0)return 0;c=p(c);for(var re=c!==c,ce=c===null,be=$n(c),Te=c===r;U<K;){var Ce=mh((U+K)/2),De=p(a[Ce]),Le=De!==r,Ke=De===null,et=De===De,St=$n(De);if(re)var tt=M||et;else Te?tt=et&&(M||Le):ce?tt=et&&Le&&(M||!Ke):be?tt=et&&Le&&!Ke&&(M||!St):Ke||St?tt=!1:tt=M?De<=c:De<c;tt?U=Ce+1:K=Ce}return Wr(K,C)}o(fm,"baseSortedIndexBy");function J2(a,c){for(var p=-1,M=a.length,U=0,K=[];++p<M;){var re=a[p],ce=c?c(re):re;if(!p||!Li(ce,be)){var be=ce;K[U++]=re===0?0:re}}return K}o(J2,"baseSortedUniq");function Y2(a){return typeof a=="number"?a:$n(a)?A:+a}o(Y2,"baseToNumber");function Fn(a){if(typeof a=="string")return a;if(wt(a))return cr(a,Fn)+"";if($n(a))return C2?C2.call(a):"";var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(Fn,"baseToString");function Rs(a,c,p){var M=-1,U=rh,K=a.length,re=!0,ce=[],be=ce;if(p)re=!1,U=Lp;else if(K>=t){var Te=c?null:wM(a);if(Te)return ih(Te);re=!1,U=hu,be=new Ia}else be=c?[]:ce;e:for(;++M<K;){var Ce=a[M],De=c?c(Ce):Ce;if(Ce=p||Ce!==0?Ce:0,re&&De===De){for(var Le=be.length;Le--;)if(be[Le]===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(Rs,"baseUniq");function cm(a,c){return c=Os(c,a),a=Ay(a,c),a==null||delete a[po(bi(c))]}o(cm,"baseUnset");function X2(a,c,p,M){return _u(a,c,p(Ra(a,c)),M)}o(X2,"baseUpdate");function Ah(a,c,p,M){for(var U=a.length,K=M?U:-1;(M?K--:++K<U)&&c(a[K],K,a););return p?mi(a,M?0:K,M?K+1:U):mi(a,M?K+1:0,M?U:K)}o(Ah,"baseWhile");function Z2(a,c){var p=a;return p instanceof Ot&&(p=p.value()),Up(c,function(M,U){return U.func.apply(U.thisArg,Ts([M],U.args))},p)}o(Z2,"baseWrapperValue");function um(a,c,p){var M=a.length;if(M<2)return M?Rs(a[0]):[];for(var U=-1,K=xe(M);++U<M;)for(var re=a[U],ce=-1;++ce<M;)ce!=U&&(K[U]=yu(K[U]||re,a[ce],c,p));return Rs($r(K,1),c,p)}o(um,"baseXor");function Q2(a,c,p){for(var M=-1,U=a.length,K=c.length,re={};++M<U;){var ce=M<K?c[M]:r;p(re,a[M],ce)}return re}o(Q2,"baseZipObject");function lm(a){return vr(a)?a:[]}o(lm,"castArrayLikeObject");function hm(a){return typeof a=="function"?a:_n}o(hm,"castFunction");function Os(a,c){return wt(a)?a:wm(a,c)?[a]:Cy(Kt(a))}o(Os,"castPath");var lM=Ct;function Ns(a,c,p){var M=a.length;return p=p===r?M:p,!c&&p>=M?a:mi(a,c,p)}o(Ns,"castSlice");var ey=Z7||function(a){return Cr.clearTimeout(a)};function ty(a,c){if(c)return a.slice();var p=a.length,M=_2?_2(p):new a.constructor(p);return a.copy(M),M}o(ty,"cloneBuffer");function dm(a){var c=new a.constructor(a.byteLength);return new uh(c).set(new uh(a)),c}o(dm,"cloneArrayBuffer");function hM(a,c){var p=c?dm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}o(hM,"cloneDataView");function dM(a){var c=new a.constructor(a.source,nt.exec(a));return c.lastIndex=a.lastIndex,c}o(dM,"cloneRegExp");function pM(a){return gu?er(gu.call(a)):{}}o(pM,"cloneSymbol");function ry(a,c){var p=c?dm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}o(ry,"cloneTypedArray");function ny(a,c){if(a!==c){var p=a!==r,M=a===null,U=a===a,K=$n(a),re=c!==r,ce=c===null,be=c===c,Te=$n(c);if(!ce&&!Te&&!K&&a>c||K&&re&&be&&!ce&&!Te||M&&re&&be||!p&&be||!U)return 1;if(!M&&!K&&!Te&&a<c||Te&&p&&U&&!M&&!K||ce&&p&&U||!re&&U||!be)return-1}return 0}o(ny,"compareAscending");function mM(a,c,p){for(var M=-1,U=a.criteria,K=c.criteria,re=U.length,ce=p.length;++M<re;){var be=ny(U[M],K[M]);if(be){if(M>=ce)return be;var Te=p[M];return be*(Te=="desc"?-1:1)}}return a.index-c.index}o(mM,"compareMultiple");function iy(a,c,p,M){for(var U=-1,K=a.length,re=p.length,ce=-1,be=c.length,Te=Ar(K-re,0),Ce=xe(be+Te),De=!M;++ce<be;)Ce[ce]=c[ce];for(;++U<re;)(De||U<K)&&(Ce[p[U]]=a[U]);for(;Te--;)Ce[ce++]=a[U++];return Ce}o(iy,"composeArgs");function oy(a,c,p,M){for(var U=-1,K=a.length,re=-1,ce=p.length,be=-1,Te=c.length,Ce=Ar(K-ce,0),De=xe(Ce+Te),Le=!M;++U<Ce;)De[U]=a[U];for(var Ke=U;++be<Te;)De[Ke+be]=c[be];for(;++re<ce;)(Le||U<K)&&(De[Ke+p[re]]=a[U++]);return De}o(oy,"composeArgsRight");function yn(a,c){var p=-1,M=a.length;for(c||(c=xe(M));++p<M;)c[p]=a[p];return c}o(yn,"copyArray");function ho(a,c,p,M){var U=!p;p||(p={});for(var K=-1,re=c.length;++K<re;){var ce=c[K],be=M?M(p[ce],a[ce],ce,p,a):r;be===r&&(be=a[ce]),U?Vo(p,ce,be):vu(p,ce,be)}return p}o(ho,"copyObject");function bM(a,c){return ho(a,xm(a),c)}o(bM,"copySymbols");function gM(a,c){return ho(a,vy(a),c)}o(gM,"copySymbolsIn");function Sh(a,c){return function(p,M){var U=wt(p)?_7:FS,K=c?c():{};return U(p,a,Ze(M,2),K)}}o(Sh,"createAggregator");function Vf(a){return Ct(function(c,p){var M=-1,U=p.length,K=U>1?p[U-1]:r,re=U>2?p[2]:r;for(K=a.length>3&&typeof K=="function"?(U--,K):r,re&&cn(p[0],p[1],re)&&(K=U<3?r:K,U=1),c=er(c);++M<U;){var ce=p[M];ce&&a(c,ce,M,K)}return c})}o(Vf,"createAssigner");function sy(a,c){return function(p,M){if(p==null)return p;if(!xn(p))return a(p,M);for(var U=p.length,K=c?U:-1,re=er(p);(c?K--:++K<U)&&M(re[K],K,re)!==!1;);return p}}o(sy,"createBaseEach");function ay(a){return function(c,p,M){for(var U=-1,K=er(c),re=M(c),ce=re.length;ce--;){var be=re[a?ce:++U];if(p(K[be],be,K)===!1)break}return c}}o(ay,"createBaseFor");function vM(a,c,p){var M=c&I,U=Eu(a);function K(){var re=this&&this!==Cr&&this instanceof K?U:a;return re.apply(M?p:this,arguments)}return o(K,"wrapper"),K}o(vM,"createBind");function fy(a){return function(c){c=Kt(c);var p=$f(c)?Pi(c):r,M=p?p[0]:c.charAt(0),U=p?Ns(p,1).join(""):c.slice(1);return M[a]()+U}}o(fy,"createCaseFirst");function Gf(a){return function(c){return Up(s3(o3(c).replace(f7,"")),a,"")}}o(Gf,"createCompounder");function Eu(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=Kf(a.prototype),M=a.apply(p,c);return ur(M)?M:p}}o(Eu,"createCtor");function yM(a,c,p){var M=Eu(a);function U(){for(var K=arguments.length,re=xe(K),ce=K,be=Wf(U);ce--;)re[ce]=arguments[ce];var Te=K<3&&re[0]!==be&&re[K-1]!==be?[]:Cs(re,be);if(K-=Te.length,K<p)return dy(a,c,Mh,U.placeholder,r,re,Te,r,r,p-K);var Ce=this&&this!==Cr&&this instanceof U?M:a;return Ln(Ce,this,re)}return o(U,"wrapper"),U}o(yM,"createCurry");function cy(a){return function(c,p,M){var U=er(c);if(!xn(c)){var K=Ze(p,3);c=kr(c),p=o(function(ce){return K(U[ce],ce,U)},"predicate")}var re=a(c,p,M);return re>-1?U[K?c[re]:re]:r}}o(cy,"createFind");function uy(a){return Wo(function(c){var p=c.length,M=p,U=di.prototype.thru;for(a&&c.reverse();M--;){var K=c[M];if(typeof K!="function")throw new hi(i);if(U&&!re&&Ih(K)=="wrapper")var re=new di([],!0)}for(M=re?M:p;++M<p;){K=c[M];var ce=Ih(K),be=ce=="wrapper"?vm(K):r;be&&_m(be[0])&&be[1]==(ne|P|ee|V)&&!be[4].length&&be[9]==1?re=re[Ih(be[0])].apply(re,be[3]):re=K.length==1&&_m(K)?re[ce]():re.thru(K)}return function(){var Te=arguments,Ce=Te[0];if(re&&Te.length==1&&wt(Ce))return re.plant(Ce).value();for(var De=0,Le=p?c[De].apply(this,Te):Ce;++De<p;)Le=c[De].call(this,Le);return Le}})}o(uy,"createFlow");function Mh(a,c,p,M,U,K,re,ce,be,Te){var Ce=c&ne,De=c&I,Le=c&B,Ke=c&(P|J),et=c&H,St=Le?r:Eu(a);function tt(){for(var It=arguments.length,Nt=xe(It),qn=It;qn--;)Nt[qn]=arguments[qn];if(Ke)var un=Wf(tt),Hn=D7(Nt,un);if(M&&(Nt=iy(Nt,M,U,Ke)),K&&(Nt=oy(Nt,K,re,Ke)),It-=Hn,Ke&&It<Te){var yr=Cs(Nt,un);return dy(a,c,Mh,tt.placeholder,p,Nt,yr,ce,be,Te-It)}var Ui=De?p:this,Zo=Le?Ui[a]:a;return It=Nt.length,ce?Nt=FM(Nt,ce):et&&It>1&&Nt.reverse(),Ce&&be<It&&(Nt.length=be),this&&this!==Cr&&this instanceof tt&&(Zo=St||Eu(Zo)),Zo.apply(Ui,Nt)}return o(tt,"wrapper"),tt}o(Mh,"createHybrid");function ly(a,c){return function(p,M){return GS(p,a,c(M),{})}}o(ly,"createInverter");function Th(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=Fn(p),M=Fn(M)):(p=Y2(p),M=Y2(M)),U=a(p,M)}return U}}o(Th,"createMathOperation");function pm(a){return Wo(function(c){return c=cr(c,Un(Ze())),Ct(function(p){var M=this;return a(c,function(U){return Ln(U,M,p)})})})}o(pm,"createOver");function Ch(a,c){c=c===r?" ":Fn(c);var p=c.length;if(p<2)return p?am(c,a):c;var M=am(c,ph(a/qf(c)));return $f(c)?Ns(Pi(M),0,a).join(""):M.slice(0,a)}o(Ch,"createPadding");function xM(a,c,p,M){var U=c&I,K=Eu(a);function re(){for(var ce=-1,be=arguments.length,Te=-1,Ce=M.length,De=xe(Ce+be),Le=this&&this!==Cr&&this instanceof re?K:a;++Te<Ce;)De[Te]=M[Te];for(;be--;)De[Te++]=arguments[++ce];return Ln(Le,U?p:this,De)}return o(re,"wrapper"),re}o(xM,"createPartial");function hy(a){return function(c,p,M){return M&&typeof M!="number"&&cn(c,p,M)&&(p=M=r),c=Xo(c),p===r?(p=c,c=0):p=Xo(p),M=M===r?c<p?1:-1:Xo(M),oM(c,p,M,a)}}o(hy,"createRange");function kh(a){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=gi(c),p=gi(p)),a(c,p)}}o(kh,"createRelationalOperation");function dy(a,c,p,M,U,K,re,ce,be,Te){var Ce=c&P,De=Ce?re:r,Le=Ce?r:re,Ke=Ce?K:r,et=Ce?r:K;c|=Ce?ee:X,c&=~(Ce?X:ee),c&Y||(c&=~(I|B));var St=[a,c,U,Ke,De,et,Le,ce,be,Te],tt=p.apply(r,St);return _m(a)&&Sy(tt,St),tt.placeholder=M,My(tt,a,c)}o(dy,"createRecurry");function mm(a){var c=Er[a];return function(p,M){if(p=gi(p),M=M==null?0:Wr(At(M),292),M&&M2(p)){var U=(Kt(p)+"e").split("e"),K=c(U[0]+"e"+(+U[1]+M));return U=(Kt(K)+"e").split("e"),+(U[0]+"e"+(+U[1]-M))}return c(p)}}o(mm,"createRound");var wM=zf&&1/ih(new zf([,-0]))[1]==m?function(a){return new zf(a)}:Lm;function py(a){return function(c){var p=Jr(c);return p==ae?Kp(c):p==W?U7(c):I7(c,a(c))}}o(py,"createToPairs");function Go(a,c,p,M,U,K,re,ce){var be=c&B;if(!be&&typeof a!="function")throw new hi(i);var Te=M?M.length:0;if(Te||(c&=~(ee|X),M=U=r),re=re===r?re:Ar(At(re),0),ce=ce===r?ce:At(ce),Te-=U?U.length:0,c&X){var Ce=M,De=U;M=U=r}var Le=be?r:vm(a),Ke=[a,c,p,M,U,Ce,De,K,re,ce];if(Le&&BM(Ke,Le),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:Ar(Ke[9]-Te,0),!ce&&c&(P|J)&&(c&=~(P|J)),!c||c==I)var et=vM(a,c,p);else c==P||c==J?et=yM(a,c,ce):(c==ee||c==(I|ee))&&!U.length?et=xM(a,c,p,M):et=Mh.apply(r,Ke);var St=Le?W2:Sy;return My(St(et,Ke),a,c)}o(Go,"createWrap");function my(a,c,p,M){return a===r||Li(a,Hf[p])&&!Jt.call(M,p)?c:a}o(my,"customDefaultsAssignIn");function by(a,c,p,M,U,K){return ur(a)&&ur(c)&&(K.set(c,a),_h(a,c,r,by,K),K.delete(c)),a}o(by,"customDefaultsMerge");function _M(a){return Mu(a)?r:a}o(_M,"customOmitClone");function gy(a,c,p,M,U,K){var re=p&O,ce=a.length,be=c.length;if(ce!=be&&!(re&&be>ce))return!1;var Te=K.get(a),Ce=K.get(c);if(Te&&Ce)return Te==c&&Ce==a;var De=-1,Le=!0,Ke=p&R?new Ia:r;for(K.set(a,c),K.set(c,a);++De<ce;){var et=a[De],St=c[De];if(M)var tt=re?M(St,et,De,c,a,K):M(et,St,De,a,c,K);if(tt!==r){if(tt)continue;Le=!1;break}if(Ke){if(!Fp(c,function(It,Nt){if(!hu(Ke,Nt)&&(et===It||U(et,It,p,M,K)))return Ke.push(Nt)})){Le=!1;break}}else if(!(et===St||U(et,St,p,M,K))){Le=!1;break}}return K.delete(a),K.delete(c),Le}o(gy,"equalArrays");function EM(a,c,p,M,U,K,re){switch(p){case le:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case gr:return!(a.byteLength!=c.byteLength||!K(new uh(a),new uh(c)));case Q:case se:case Ae:return Li(+a,+c);case j:return a.name==c.name&&a.message==c.message;case ve:case pe:return a==c+"";case ae:var ce=Kp;case W:var be=M&O;if(ce||(ce=ih),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=gy(ce(a),ce(c),M,U,K,re);return re.delete(a),Ce;case ke:if(gu)return gu.call(a)==gu.call(c)}return!1}o(EM,"equalByTag");function AM(a,c,p,M,U,K){var re=p&O,ce=bm(a),be=ce.length,Te=bm(c),Ce=Te.length;if(be!=Ce&&!re)return!1;for(var De=be;De--;){var Le=ce[De];if(!(re?Le in c:Jt.call(c,Le)))return!1}var Ke=K.get(a),et=K.get(c);if(Ke&&et)return Ke==c&&et==a;var St=!0;K.set(a,c),K.set(c,a);for(var tt=re;++De<be;){Le=ce[De];var It=a[Le],Nt=c[Le];if(M)var qn=re?M(Nt,It,Le,c,a,K):M(It,Nt,Le,a,c,K);if(!(qn===r?It===Nt||U(It,Nt,p,M,K):qn)){St=!1;break}tt||(tt=Le=="constructor")}if(St&&!tt){var un=a.constructor,Hn=c.constructor;un!=Hn&&"constructor"in a&&"constructor"in c&&!(typeof un=="function"&&un instanceof un&&typeof Hn=="function"&&Hn instanceof Hn)&&(St=!1)}return K.delete(a),K.delete(c),St}o(AM,"equalObjects");function Wo(a){return Am(Ey(a,r,Ry),a+"")}o(Wo,"flatRest");function bm(a){return L2(a,kr,xm)}o(bm,"getAllKeys");function gm(a){return L2(a,wn,vy)}o(gm,"getAllKeysIn");var vm=bh?function(a){return bh.get(a)}:Lm;function Ih(a){for(var c=a.name+"",p=jf[c],M=Jt.call(jf,c)?p.length:0;M--;){var U=p[M],K=U.func;if(K==null||K==a)return U.name}return c}o(Ih,"getFuncName");function Wf(a){var c=Jt.call($,"placeholder")?$:a;return c.placeholder}o(Wf,"getHolder");function Ze(){var a=$.iteratee||Pm;return a=a===Pm?$2:a,arguments.length?a(arguments[0],arguments[1]):a}o(Ze,"getIteratee");function Dh(a,c){var p=a.__data__;return RM(c)?p[typeof c=="string"?"string":"hash"]:p.map}o(Dh,"getMapData");function ym(a){for(var c=kr(a),p=c.length;p--;){var M=c[p],U=a[M];c[p]=[M,U,wy(U)]}return c}o(ym,"getMatchData");function Oa(a,c){var p=P7(a,c);return F2(p)?p:r}o(Oa,"getNative");function SM(a){var c=Jt.call(a,Ca),p=a[Ca];try{a[Ca]=r;var M=!0}catch{}var U=fh.call(a);return M&&(c?a[Ca]=p:delete a[Ca]),U}o(SM,"getRawTag");var xm=Gp?function(a){return a==null?[]:(a=er(a),Ms(Gp(a),function(c){return A2.call(a,c)}))}:Um,vy=Gp?function(a){for(var c=[];a;)Ts(c,xm(a)),a=lh(a);return c}:Um,Jr=fn;(Wp&&Jr(new Wp(new ArrayBuffer(1)))!=le||pu&&Jr(new pu)!=ae||Jp&&Jr(Jp.resolve())!=Me||zf&&Jr(new zf)!=W||mu&&Jr(new mu)!=Pe)&&(Jr=o(function(a){var c=fn(a),p=c==ie?a.constructor:r,M=p?Na(p):"";if(M)switch(M){case aS:return le;case fS:return ae;case cS:return Me;case uS:return W;case lS:return Pe}return c},"getTag"));function MM(a,c,p){for(var M=-1,U=p.length;++M<U;){var K=p[M],re=K.size;switch(K.type){case"drop":a+=re;break;case"dropRight":c-=re;break;case"take":c=Wr(c,a+re);break;case"takeRight":a=Ar(a,c-re);break}}return{start:a,end:c}}o(MM,"getView");function TM(a){var c=a.match(dt);return c?c[1].split(ai):[]}o(TM,"getWrapDetails");function yy(a,c,p){c=Os(c,a);for(var M=-1,U=c.length,K=!1;++M<U;){var re=po(c[M]);if(!(K=a!=null&&p(a,re)))break;a=a[re]}return K||++M!=U?K:(U=a==null?0:a.length,!!U&&Uh(U)&&Jo(re,U)&&(wt(a)||Pa(a)))}o(yy,"hasPath");function CM(a){var c=a.length,p=new a.constructor(c);return c&&typeof a[0]=="string"&&Jt.call(a,"index")&&(p.index=a.index,p.input=a.input),p}o(CM,"initCloneArray");function xy(a){return typeof a.constructor=="function"&&!Au(a)?Kf(lh(a)):{}}o(xy,"initCloneObject");function kM(a,c,p){var M=a.constructor;switch(c){case gr:return dm(a);case Q:case se:return new M(+a);case le:return hM(a,p);case oe:case F:case Z:case me:case ye:case we:case Ie:case Rt:case Fe:return ry(a,p);case ae:return new M;case Ae:case pe:return new M(a);case ve:return dM(a);case W:return new M;case ke:return pM(a)}}o(kM,"initCloneByTag");function IM(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(ht,`{
1
+ "use strict";var nD=Object.create;var Cu=Object.defineProperty;var iD=Object.getOwnPropertyDescriptor;var oD=Object.getOwnPropertyNames;var sD=Object.getPrototypeOf,aD=Object.prototype.hasOwnProperty;var o=(r,e)=>Cu(r,"name",{value:e,configurable:!0});var Vt=(r,e)=>()=>(r&&(e=r(r=0)),e);var Re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Xt=(r,e)=>{for(var t in e)Cu(r,t,{get:e[t],enumerable:!0})},l3=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of oD(e))!aD.call(r,i)&&i!==t&&Cu(r,i,{get:()=>e[i],enumerable:!(n=iD(e,i))||n.enumerable});return r};var Ut=(r,e,t)=>(t=r!=null?nD(sD(r)):{},l3(e||!r||!r.__esModule?Cu(t,"default",{value:r,enumerable:!0}):t,r)),Hh=r=>l3(Cu({},"__esModule",{value:!0}),r);var h3=Re((Xf,ku)=>{(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__",v=1,x=2,E=4,O=1,R=2,I=1,B=2,Y=4,P=8,J=16,ee=32,X=64,ne=128,V=256,H=512,z=30,he="...",L=800,h=16,g=1,b=2,l=3,m=1/0,_=9007199254740991,M=17976931348623157e292,S=0/0,y=4294967295,C=y-1,N=y>>>1,w=[["ary",ne],["bind",I],["bindKey",B],["curry",P],["curryRight",J],["flip",H],["partial",ee],["partialRight",X],["rearg",V]],k="[object Arguments]",fe="[object Array]",D="[object AsyncFunction]",Q="[object Boolean]",se="[object Date]",q="[object DOMException]",j="[object Error]",G="[object Function]",te="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",ie="[object Object]",Me="[object Promise]",ue="[object Proxy]",ve="[object RegExp]",W="[object Set]",pe="[object String]",ke="[object Symbol]",je="[object Undefined]",Pe="[object WeakMap]",Je="[object WeakSet]",gr="[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]",Rt="[object Uint16Array]",Fe="[object Uint32Array]",Ne=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xe=/&(?:amp|lt|gt|quot|#39);/g,Pn=/[&<>"']/g,st=RegExp(Xe.source),at=RegExp(Pn.source),ii=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,oi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/,ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pn=/[\\^$.*+?()[\]{}|]/g,lt=RegExp(pn.source),Qe=/^\s+/,si=/\s/,ht=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dt=/\{\n\/\* \[wrapped with (.+)\] \*/,ai=/,? & /,pt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,mt=/[()=,{}\[\]\/\s]/,fi=/\\(\\)?/g,bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,Bn=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Ht=/^\[object .+?Constructor\]$/,mn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,gn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fr=/($^)/,vn=/['\n\r\u2028\u2029\\]/g,ci="\\ud800-\\udfff",Lo="\\u0300-\\u036f",Uo="\\ufe20-\\ufe2f",Fo="\\u20d0-\\u20ff",fo=Lo+Uo+Fo,co="\\u2700-\\u27bf",uo="a-z\\xdf-\\xf6\\xf8-\\xff",$o="\\xac\\xb1\\xd7\\xf7",qo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ho="\\u2000-\\u206f",zo=" \\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",Pf="A-Z\\xc0-\\xd6\\xd8-\\xde",Bf="\\ufe0e\\ufe0f",Lf=$o+qo+Ho+zo,Rp="['\u2019]",n7="["+ci+"]",Vv="["+Lf+"]",rh="["+fo+"]",Gv="\\d+",i7="["+co+"]",Wv="["+uo+"]",Jv="[^"+ci+Lf+Gv+co+uo+Pf+"]",Op="\\ud83c[\\udffb-\\udfff]",o7="(?:"+rh+"|"+Op+")",Yv="[^"+ci+"]",Np="(?:\\ud83c[\\udde6-\\uddff]){2}",Pp="[\\ud800-\\udbff][\\udc00-\\udfff]",Uf="["+Pf+"]",Xv="\\u200d",Zv="(?:"+Wv+"|"+Jv+")",s7="(?:"+Uf+"|"+Jv+")",Qv="(?:"+Rp+"(?:d|ll|m|re|s|t|ve))?",e2="(?:"+Rp+"(?:D|LL|M|RE|S|T|VE))?",t2=o7+"?",r2="["+Bf+"]?",a7="(?:"+Xv+"(?:"+[Yv,Np,Pp].join("|")+")"+r2+t2+")*",f7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",c7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",n2=r2+t2+a7,u7="(?:"+[i7,Np,Pp].join("|")+")"+n2,l7="(?:"+[Yv+rh+"?",rh,Np,Pp,n7].join("|")+")",h7=RegExp(Rp,"g"),d7=RegExp(rh,"g"),Bp=RegExp(Op+"(?="+Op+")|"+l7+n2,"g"),p7=RegExp([Uf+"?"+Wv+"+"+Qv+"(?="+[Vv,Uf,"$"].join("|")+")",s7+"+"+e2+"(?="+[Vv,Uf+Zv,"$"].join("|")+")",Uf+"?"+Zv+"+"+Qv,Uf+"+"+e2,c7,f7,Gv,u7].join("|"),"g"),m7=RegExp("["+Xv+ci+fo+Bf+"]"),b7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,g7=["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"],v7=-1,ar={};ar[oe]=ar[F]=ar[Z]=ar[me]=ar[ye]=ar[we]=ar[Ie]=ar[Rt]=ar[Fe]=!0,ar[k]=ar[fe]=ar[gr]=ar[Q]=ar[le]=ar[se]=ar[j]=ar[G]=ar[ae]=ar[Ae]=ar[ie]=ar[ve]=ar[W]=ar[pe]=ar[Pe]=!1;var rr={};rr[k]=rr[fe]=rr[gr]=rr[le]=rr[Q]=rr[se]=rr[oe]=rr[F]=rr[Z]=rr[me]=rr[ye]=rr[ae]=rr[Ae]=rr[ie]=rr[ve]=rr[W]=rr[pe]=rr[ke]=rr[we]=rr[Ie]=rr[Rt]=rr[Fe]=!0,rr[j]=rr[G]=rr[Pe]=!1;var y7={\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"},x7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},w7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},_7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},E7=parseFloat,A7=parseInt,i2=typeof global=="object"&&global&&global.Object===Object&&global,S7=typeof self=="object"&&self&&self.Object===Object&&self,Cr=i2||S7||Function("return this")(),Lp=typeof Xf=="object"&&Xf&&!Xf.nodeType&&Xf,Ta=Lp&&typeof ku=="object"&&ku&&!ku.nodeType&&ku,o2=Ta&&Ta.exports===Lp,Up=o2&&i2.process,ui=function(){try{var de=Ta&&Ta.require&&Ta.require("util").types;return de||Up&&Up.binding&&Up.binding("util")}catch{}}(),s2=ui&&ui.isArrayBuffer,a2=ui&&ui.isDate,f2=ui&&ui.isMap,c2=ui&&ui.isRegExp,u2=ui&&ui.isSet,l2=ui&&ui.isTypedArray;function Ln(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(Ln,"apply");function M7(de,Ee,xe,ze){for(var xt=-1,zt=de==null?0:de.length;++xt<zt;){var Er=de[xt];Ee(ze,Er,xe(Er),de)}return ze}o(M7,"arrayAggregator");function li(de,Ee){for(var xe=-1,ze=de==null?0:de.length;++xe<ze&&Ee(de[xe],xe,de)!==!1;);return de}o(li,"arrayEach");function T7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(T7,"arrayEachRight");function h2(de,Ee){for(var xe=-1,ze=de==null?0:de.length;++xe<ze;)if(!Ee(de[xe],xe,de))return!1;return!0}o(h2,"arrayEvery");function Ms(de,Ee){for(var xe=-1,ze=de==null?0:de.length,xt=0,zt=[];++xe<ze;){var Er=de[xe];Ee(Er,xe,de)&&(zt[xt++]=Er)}return zt}o(Ms,"arrayFilter");function nh(de,Ee){var xe=de==null?0:de.length;return!!xe&&Ff(de,Ee,0)>-1}o(nh,"arrayIncludes");function Fp(de,Ee,xe){for(var ze=-1,xt=de==null?0:de.length;++ze<xt;)if(xe(Ee,de[ze]))return!0;return!1}o(Fp,"arrayIncludesWith");function cr(de,Ee){for(var xe=-1,ze=de==null?0:de.length,xt=Array(ze);++xe<ze;)xt[xe]=Ee(de[xe],xe,de);return xt}o(cr,"arrayMap");function Ts(de,Ee){for(var xe=-1,ze=Ee.length,xt=de.length;++xe<ze;)de[xt+xe]=Ee[xe];return de}o(Ts,"arrayPush");function $p(de,Ee,xe,ze){var xt=-1,zt=de==null?0:de.length;for(ze&&zt&&(xe=de[++xt]);++xt<zt;)xe=Ee(xe,de[xt],xt,de);return xe}o($p,"arrayReduce");function C7(de,Ee,xe,ze){var xt=de==null?0:de.length;for(ze&&xt&&(xe=de[--xt]);xt--;)xe=Ee(xe,de[xt],xt,de);return xe}o(C7,"arrayReduceRight");function qp(de,Ee){for(var xe=-1,ze=de==null?0:de.length;++xe<ze;)if(Ee(de[xe],xe,de))return!0;return!1}o(qp,"arraySome");var k7=Hp("length");function I7(de){return de.split("")}o(I7,"asciiToArray");function D7(de){return de.match(pt)||[]}o(D7,"asciiWords");function d2(de,Ee,xe){var ze;return xe(de,function(xt,zt,Er){if(Ee(xt,zt,Er))return ze=zt,!1}),ze}o(d2,"baseFindKey");function ih(de,Ee,xe,ze){for(var xt=de.length,zt=xe+(ze?1:-1);ze?zt--:++zt<xt;)if(Ee(de[zt],zt,de))return zt;return-1}o(ih,"baseFindIndex");function Ff(de,Ee,xe){return Ee===Ee?z7(de,Ee,xe):ih(de,p2,xe)}o(Ff,"baseIndexOf");function R7(de,Ee,xe,ze){for(var xt=xe-1,zt=de.length;++xt<zt;)if(ze(de[xt],Ee))return xt;return-1}o(R7,"baseIndexOfWith");function p2(de){return de!==de}o(p2,"baseIsNaN");function m2(de,Ee){var xe=de==null?0:de.length;return xe?jp(de,Ee)/xe:S}o(m2,"baseMean");function Hp(de){return function(Ee){return Ee==null?r:Ee[de]}}o(Hp,"baseProperty");function zp(de){return function(Ee){return de==null?r:de[Ee]}}o(zp,"basePropertyOf");function b2(de,Ee,xe,ze,xt){return xt(de,function(zt,Er,er){xe=ze?(ze=!1,zt):Ee(xe,zt,Er,er)}),xe}o(b2,"baseReduce");function O7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(O7,"baseSortBy");function jp(de,Ee){for(var xe,ze=-1,xt=de.length;++ze<xt;){var zt=Ee(de[ze]);zt!==r&&(xe=xe===r?zt:xe+zt)}return xe}o(jp,"baseSum");function Kp(de,Ee){for(var xe=-1,ze=Array(de);++xe<de;)ze[xe]=Ee(xe);return ze}o(Kp,"baseTimes");function N7(de,Ee){return cr(Ee,function(xe){return[xe,de[xe]]})}o(N7,"baseToPairs");function g2(de){return de&&de.slice(0,w2(de)+1).replace(Qe,"")}o(g2,"baseTrim");function Un(de){return function(Ee){return de(Ee)}}o(Un,"baseUnary");function Vp(de,Ee){return cr(Ee,function(xe){return de[xe]})}o(Vp,"baseValues");function du(de,Ee){return de.has(Ee)}o(du,"cacheHas");function v2(de,Ee){for(var xe=-1,ze=de.length;++xe<ze&&Ff(Ee,de[xe],0)>-1;);return xe}o(v2,"charsStartIndex");function y2(de,Ee){for(var xe=de.length;xe--&&Ff(Ee,de[xe],0)>-1;);return xe}o(y2,"charsEndIndex");function P7(de,Ee){for(var xe=de.length,ze=0;xe--;)de[xe]===Ee&&++ze;return ze}o(P7,"countHolders");var B7=zp(y7),L7=zp(x7);function U7(de){return"\\"+_7[de]}o(U7,"escapeStringChar");function F7(de,Ee){return de==null?r:de[Ee]}o(F7,"getValue");function $f(de){return m7.test(de)}o($f,"hasUnicode");function $7(de){return b7.test(de)}o($7,"hasUnicodeWord");function q7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(q7,"iteratorToArray");function Gp(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(ze,xt){xe[++Ee]=[xt,ze]}),xe}o(Gp,"mapToArray");function x2(de,Ee){return function(xe){return de(Ee(xe))}}o(x2,"overArg");function Cs(de,Ee){for(var xe=-1,ze=de.length,xt=0,zt=[];++xe<ze;){var Er=de[xe];(Er===Ee||Er===d)&&(de[xe]=d,zt[xt++]=xe)}return zt}o(Cs,"replaceHolders");function oh(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(ze){xe[++Ee]=ze}),xe}o(oh,"setToArray");function H7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(ze){xe[++Ee]=[ze,ze]}),xe}o(H7,"setToPairs");function z7(de,Ee,xe){for(var ze=xe-1,xt=de.length;++ze<xt;)if(de[ze]===Ee)return ze;return-1}o(z7,"strictIndexOf");function j7(de,Ee,xe){for(var ze=xe+1;ze--;)if(de[ze]===Ee)return ze;return ze}o(j7,"strictLastIndexOf");function qf(de){return $f(de)?V7(de):k7(de)}o(qf,"stringSize");function Pi(de){return $f(de)?G7(de):I7(de)}o(Pi,"stringToArray");function w2(de){for(var Ee=de.length;Ee--&&si.test(de.charAt(Ee)););return Ee}o(w2,"trimmedEndIndex");var K7=zp(w7);function V7(de){for(var Ee=Bp.lastIndex=0;Bp.test(de);)++Ee;return Ee}o(V7,"unicodeSize");function G7(de){return de.match(Bp)||[]}o(G7,"unicodeToArray");function W7(de){return de.match(p7)||[]}o(W7,"unicodeWords");var J7=o(function de(Ee){Ee=Ee==null?Cr:ks.defaults(Cr.Object(),Ee,ks.pick(Cr,g7));var xe=Ee.Array,ze=Ee.Date,xt=Ee.Error,zt=Ee.Function,Er=Ee.Math,er=Ee.Object,Wp=Ee.RegExp,Y7=Ee.String,hi=Ee.TypeError,sh=xe.prototype,X7=zt.prototype,Hf=er.prototype,ah=Ee["__core-js_shared__"],fh=X7.toString,Jt=Hf.hasOwnProperty,Z7=0,_2=function(){var a=/[^.]+$/.exec(ah&&ah.keys&&ah.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),ch=Hf.toString,Q7=fh.call(er),eS=Cr._,tS=Wp("^"+fh.call(Jt).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uh=o2?Ee.Buffer:r,Is=Ee.Symbol,lh=Ee.Uint8Array,E2=uh?uh.allocUnsafe:r,hh=x2(er.getPrototypeOf,er),A2=er.create,S2=Hf.propertyIsEnumerable,dh=sh.splice,M2=Is?Is.isConcatSpreadable:r,pu=Is?Is.iterator:r,Ca=Is?Is.toStringTag:r,ph=function(){try{var a=Oa(er,"defineProperty");return a({},"",{}),a}catch{}}(),rS=Ee.clearTimeout!==Cr.clearTimeout&&Ee.clearTimeout,nS=ze&&ze.now!==Cr.Date.now&&ze.now,iS=Ee.setTimeout!==Cr.setTimeout&&Ee.setTimeout,mh=Er.ceil,bh=Er.floor,Jp=er.getOwnPropertySymbols,oS=uh?uh.isBuffer:r,T2=Ee.isFinite,sS=sh.join,aS=x2(er.keys,er),Ar=Er.max,Wr=Er.min,fS=ze.now,cS=Ee.parseInt,C2=Er.random,uS=sh.reverse,Yp=Oa(Ee,"DataView"),mu=Oa(Ee,"Map"),Xp=Oa(Ee,"Promise"),zf=Oa(Ee,"Set"),bu=Oa(Ee,"WeakMap"),gu=Oa(er,"create"),gh=bu&&new bu,jf={},lS=Na(Yp),hS=Na(mu),dS=Na(Xp),pS=Na(zf),mS=Na(bu),vh=Is?Is.prototype:r,vu=vh?vh.valueOf:r,k2=vh?vh.toString:r;function $(a){if(lr(a)&&!wt(a)&&!(a instanceof Ot)){if(a instanceof di)return a;if(Jt.call(a,"__wrapped__"))return Iy(a)}return new di(a)}o($,"lodash");var Kf=function(){function a(){}return o(a,"object"),function(c){if(!ur(c))return{};if(A2)return A2(c);a.prototype=c;var p=new a;return a.prototype=r,p}}();function yh(){}o(yh,"baseLodash");function di(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}o(di,"LodashWrapper"),$.templateSettings={escape:ii,evaluate:ft,interpolate:rt,variable:"",imports:{_:$}},$.prototype=yh.prototype,$.prototype.constructor=$,di.prototype=Kf(yh.prototype),di.prototype.constructor=di;function Ot(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}o(Ot,"LazyWrapper");function bS(){var a=new Ot(this.__wrapped__);return a.__actions__=yn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=yn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=yn(this.__views__),a}o(bS,"lazyClone");function gS(){if(this.__filtered__){var a=new Ot(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}o(gS,"lazyReverse");function vS(){var a=this.__wrapped__.value(),c=this.__dir__,p=wt(a),T=c<0,U=p?a.length:0,K=IM(0,U,this.__views__),re=K.start,ce=K.end,be=ce-re,Te=T?ce:re-1,Ce=this.__iteratees__,De=Ce.length,Le=0,Ke=Wr(be,this.__takeCount__);if(!p||!T&&U==be&&Ke==be)return Q2(a,this.__actions__);var et=[];e:for(;be--&&Le<Ke;){Te+=c;for(var St=-1,tt=a[Te];++St<De;){var It=Ce[St],Nt=It.iteratee,qn=It.type,un=Nt(tt);if(qn==b)tt=un;else if(!un){if(qn==g)continue e;break e}}et[Le++]=tt}return et}o(vS,"lazyValue"),Ot.prototype=Kf(yh.prototype),Ot.prototype.constructor=Ot;function ka(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var T=a[c];this.set(T[0],T[1])}}o(ka,"Hash");function yS(){this.__data__=gu?gu(null):{},this.size=0}o(yS,"hashClear");function xS(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}o(xS,"hashDelete");function wS(a){var c=this.__data__;if(gu){var p=c[a];return p===f?r:p}return Jt.call(c,a)?c[a]:r}o(wS,"hashGet");function _S(a){var c=this.__data__;return gu?c[a]!==r:Jt.call(c,a)}o(_S,"hashHas");function ES(a,c){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=gu&&c===r?f:c,this}o(ES,"hashSet"),ka.prototype.clear=yS,ka.prototype.delete=xS,ka.prototype.get=wS,ka.prototype.has=_S,ka.prototype.set=ES;function jo(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var T=a[c];this.set(T[0],T[1])}}o(jo,"ListCache");function AS(){this.__data__=[],this.size=0}o(AS,"listCacheClear");function SS(a){var c=this.__data__,p=xh(c,a);if(p<0)return!1;var T=c.length-1;return p==T?c.pop():dh.call(c,p,1),--this.size,!0}o(SS,"listCacheDelete");function MS(a){var c=this.__data__,p=xh(c,a);return p<0?r:c[p][1]}o(MS,"listCacheGet");function TS(a){return xh(this.__data__,a)>-1}o(TS,"listCacheHas");function CS(a,c){var p=this.__data__,T=xh(p,a);return T<0?(++this.size,p.push([a,c])):p[T][1]=c,this}o(CS,"listCacheSet"),jo.prototype.clear=AS,jo.prototype.delete=SS,jo.prototype.get=MS,jo.prototype.has=TS,jo.prototype.set=CS;function Ko(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var T=a[c];this.set(T[0],T[1])}}o(Ko,"MapCache");function kS(){this.size=0,this.__data__={hash:new ka,map:new(mu||jo),string:new ka}}o(kS,"mapCacheClear");function IS(a){var c=Rh(this,a).delete(a);return this.size-=c?1:0,c}o(IS,"mapCacheDelete");function DS(a){return Rh(this,a).get(a)}o(DS,"mapCacheGet");function RS(a){return Rh(this,a).has(a)}o(RS,"mapCacheHas");function OS(a,c){var p=Rh(this,a),T=p.size;return p.set(a,c),this.size+=p.size==T?0:1,this}o(OS,"mapCacheSet"),Ko.prototype.clear=kS,Ko.prototype.delete=IS,Ko.prototype.get=DS,Ko.prototype.has=RS,Ko.prototype.set=OS;function Ia(a){var c=-1,p=a==null?0:a.length;for(this.__data__=new Ko;++c<p;)this.add(a[c])}o(Ia,"SetCache");function NS(a){return this.__data__.set(a,f),this}o(NS,"setCacheAdd");function PS(a){return this.__data__.has(a)}o(PS,"setCacheHas"),Ia.prototype.add=Ia.prototype.push=NS,Ia.prototype.has=PS;function Bi(a){var c=this.__data__=new jo(a);this.size=c.size}o(Bi,"Stack");function BS(){this.__data__=new jo,this.size=0}o(BS,"stackClear");function LS(a){var c=this.__data__,p=c.delete(a);return this.size=c.size,p}o(LS,"stackDelete");function US(a){return this.__data__.get(a)}o(US,"stackGet");function FS(a){return this.__data__.has(a)}o(FS,"stackHas");function $S(a,c){var p=this.__data__;if(p instanceof jo){var T=p.__data__;if(!mu||T.length<t-1)return T.push([a,c]),this.size=++p.size,this;p=this.__data__=new Ko(T)}return p.set(a,c),this.size=p.size,this}o($S,"stackSet"),Bi.prototype.clear=BS,Bi.prototype.delete=LS,Bi.prototype.get=US,Bi.prototype.has=FS,Bi.prototype.set=$S;function I2(a,c){var p=wt(a),T=!p&&Pa(a),U=!p&&!T&&Ps(a),K=!p&&!T&&!U&&Jf(a),re=p||T||U||K,ce=re?Kp(a.length,Y7):[],be=ce.length;for(var Te in a)(c||Jt.call(a,Te))&&!(re&&(Te=="length"||U&&(Te=="offset"||Te=="parent")||K&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Jo(Te,be)))&&ce.push(Te);return ce}o(I2,"arrayLikeKeys");function D2(a){var c=a.length;return c?a[fm(0,c-1)]:r}o(D2,"arraySample");function qS(a,c){return Oh(yn(a),Da(c,0,a.length))}o(qS,"arraySampleSize");function HS(a){return Oh(yn(a))}o(HS,"arrayShuffle");function Zp(a,c,p){(p!==r&&!Li(a[c],p)||p===r&&!(c in a))&&Vo(a,c,p)}o(Zp,"assignMergeValue");function yu(a,c,p){var T=a[c];(!(Jt.call(a,c)&&Li(T,p))||p===r&&!(c in a))&&Vo(a,c,p)}o(yu,"assignValue");function xh(a,c){for(var p=a.length;p--;)if(Li(a[p][0],c))return p;return-1}o(xh,"assocIndexOf");function zS(a,c,p,T){return Ds(a,function(U,K,re){c(T,U,p(U),re)}),T}o(zS,"baseAggregator");function R2(a,c){return a&&ho(c,kr(c),a)}o(R2,"baseAssign");function jS(a,c){return a&&ho(c,wn(c),a)}o(jS,"baseAssignIn");function Vo(a,c,p){c=="__proto__"&&ph?ph(a,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[c]=p}o(Vo,"baseAssignValue");function Qp(a,c){for(var p=-1,T=c.length,U=xe(T),K=a==null;++p<T;)U[p]=K?r:Om(a,c[p]);return U}o(Qp,"baseAt");function Da(a,c,p){return a===a&&(p!==r&&(a=a<=p?a:p),c!==r&&(a=a>=c?a:c)),a}o(Da,"baseClamp");function pi(a,c,p,T,U,K){var re,ce=c&v,be=c&x,Te=c&E;if(p&&(re=U?p(a,T,U,K):p(a)),re!==r)return re;if(!ur(a))return a;var Ce=wt(a);if(Ce){if(re=RM(a),!ce)return yn(a,re)}else{var De=Jr(a),Le=De==G||De==te;if(Ps(a))return ry(a,ce);if(De==ie||De==k||Le&&!U){if(re=be||Le?{}:wy(a),!ce)return be?wM(a,jS(re,a)):xM(a,R2(re,a))}else{if(!rr[De])return U?a:{};re=OM(a,De,ce)}}K||(K=new Bi);var Ke=K.get(a);if(Ke)return Ke;K.set(a,re),Yy(a)?a.forEach(function(tt){re.add(pi(tt,c,p,tt,a,K))}):Wy(a)&&a.forEach(function(tt,It){re.set(It,pi(tt,c,p,It,a,K))});var et=Te?be?ym:vm:be?wn:kr,St=Ce?r:et(a);return li(St||a,function(tt,It){St&&(It=tt,tt=a[It]),yu(re,It,pi(tt,c,p,It,a,K))}),re}o(pi,"baseClone");function KS(a){var c=kr(a);return function(p){return O2(p,a,c)}}o(KS,"baseConforms");function O2(a,c,p){var T=p.length;if(a==null)return!T;for(a=er(a);T--;){var U=p[T],K=c[U],re=a[U];if(re===r&&!(U in a)||!K(re))return!1}return!0}o(O2,"baseConformsTo");function N2(a,c,p){if(typeof a!="function")throw new hi(i);return Mu(function(){a.apply(r,p)},c)}o(N2,"baseDelay");function xu(a,c,p,T){var U=-1,K=nh,re=!0,ce=a.length,be=[],Te=c.length;if(!ce)return be;p&&(c=cr(c,Un(p))),T?(K=Fp,re=!1):c.length>=t&&(K=du,re=!1,c=new Ia(c));e:for(;++U<ce;){var Ce=a[U],De=p==null?Ce:p(Ce);if(Ce=T||Ce!==0?Ce:0,re&&De===De){for(var Le=Te;Le--;)if(c[Le]===De)continue e;be.push(Ce)}else K(c,De,T)||be.push(Ce)}return be}o(xu,"baseDifference");var Ds=ay(lo),P2=ay(tm,!0);function VS(a,c){var p=!0;return Ds(a,function(T,U,K){return p=!!c(T,U,K),p}),p}o(VS,"baseEvery");function wh(a,c,p){for(var T=-1,U=a.length;++T<U;){var K=a[T],re=c(K);if(re!=null&&(ce===r?re===re&&!$n(re):p(re,ce)))var ce=re,be=K}return be}o(wh,"baseExtremum");function GS(a,c,p,T){var U=a.length;for(p=At(p),p<0&&(p=-p>U?0:U+p),T=T===r||T>U?U:At(T),T<0&&(T+=U),T=p>T?0:Zy(T);p<T;)a[p++]=c;return a}o(GS,"baseFill");function B2(a,c){var p=[];return Ds(a,function(T,U,K){c(T,U,K)&&p.push(T)}),p}o(B2,"baseFilter");function $r(a,c,p,T,U){var K=-1,re=a.length;for(p||(p=PM),U||(U=[]);++K<re;){var ce=a[K];c>0&&p(ce)?c>1?$r(ce,c-1,p,T,U):Ts(U,ce):T||(U[U.length]=ce)}return U}o($r,"baseFlatten");var em=fy(),L2=fy(!0);function lo(a,c){return a&&em(a,c,kr)}o(lo,"baseForOwn");function tm(a,c){return a&&L2(a,c,kr)}o(tm,"baseForOwnRight");function _h(a,c){return Ms(c,function(p){return Yo(a[p])})}o(_h,"baseFunctions");function Ra(a,c){c=Os(c,a);for(var p=0,T=c.length;a!=null&&p<T;)a=a[po(c[p++])];return p&&p==T?a:r}o(Ra,"baseGet");function U2(a,c,p){var T=c(a);return wt(a)?T:Ts(T,p(a))}o(U2,"baseGetAllKeys");function fn(a){return a==null?a===r?je:ge:Ca&&Ca in er(a)?kM(a):HM(a)}o(fn,"baseGetTag");function rm(a,c){return a>c}o(rm,"baseGt");function WS(a,c){return a!=null&&Jt.call(a,c)}o(WS,"baseHas");function JS(a,c){return a!=null&&c in er(a)}o(JS,"baseHasIn");function YS(a,c,p){return a>=Wr(c,p)&&a<Ar(c,p)}o(YS,"baseInRange");function nm(a,c,p){for(var T=p?Fp:nh,U=a[0].length,K=a.length,re=K,ce=xe(K),be=1/0,Te=[];re--;){var Ce=a[re];re&&c&&(Ce=cr(Ce,Un(c))),be=Wr(Ce.length,be),ce[re]=!p&&(c||U>=120&&Ce.length>=120)?new Ia(re&&Ce):r}Ce=a[0];var De=-1,Le=ce[0];e:for(;++De<U&&Te.length<be;){var Ke=Ce[De],et=c?c(Ke):Ke;if(Ke=p||Ke!==0?Ke:0,!(Le?du(Le,et):T(Te,et,p))){for(re=K;--re;){var St=ce[re];if(!(St?du(St,et):T(a[re],et,p)))continue e}Le&&Le.push(et),Te.push(Ke)}}return Te}o(nm,"baseIntersection");function XS(a,c,p,T){return lo(a,function(U,K,re){c(T,p(U),K,re)}),T}o(XS,"baseInverter");function wu(a,c,p){c=Os(c,a),a=Sy(a,c);var T=a==null?a:a[po(bi(c))];return T==null?r:Ln(T,a,p)}o(wu,"baseInvoke");function F2(a){return lr(a)&&fn(a)==k}o(F2,"baseIsArguments");function ZS(a){return lr(a)&&fn(a)==gr}o(ZS,"baseIsArrayBuffer");function QS(a){return lr(a)&&fn(a)==se}o(QS,"baseIsDate");function _u(a,c,p,T,U){return a===c?!0:a==null||c==null||!lr(a)&&!lr(c)?a!==a&&c!==c:eM(a,c,p,T,_u,U)}o(_u,"baseIsEqual");function eM(a,c,p,T,U,K){var re=wt(a),ce=wt(c),be=re?fe:Jr(a),Te=ce?fe:Jr(c);be=be==k?ie:be,Te=Te==k?ie:Te;var Ce=be==ie,De=Te==ie,Le=be==Te;if(Le&&Ps(a)){if(!Ps(c))return!1;re=!0,Ce=!1}if(Le&&!Ce)return K||(K=new Bi),re||Jf(a)?vy(a,c,p,T,U,K):TM(a,c,be,p,T,U,K);if(!(p&O)){var Ke=Ce&&Jt.call(a,"__wrapped__"),et=De&&Jt.call(c,"__wrapped__");if(Ke||et){var St=Ke?a.value():a,tt=et?c.value():c;return K||(K=new Bi),U(St,tt,p,T,K)}}return Le?(K||(K=new Bi),CM(a,c,p,T,U,K)):!1}o(eM,"baseIsEqualDeep");function tM(a){return lr(a)&&Jr(a)==ae}o(tM,"baseIsMap");function im(a,c,p,T){var U=p.length,K=U,re=!T;if(a==null)return!K;for(a=er(a);U--;){var ce=p[U];if(re&&ce[2]?ce[1]!==a[ce[0]]:!(ce[0]in a))return!1}for(;++U<K;){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 Bi;if(T)var Le=T(Te,Ce,be,a,c,De);if(!(Le===r?_u(Ce,Te,O|R,T,De):Le))return!1}}return!0}o(im,"baseIsMatch");function $2(a){if(!ur(a)||LM(a))return!1;var c=Yo(a)?tS:Ht;return c.test(Na(a))}o($2,"baseIsNative");function rM(a){return lr(a)&&fn(a)==ve}o(rM,"baseIsRegExp");function nM(a){return lr(a)&&Jr(a)==W}o(nM,"baseIsSet");function iM(a){return lr(a)&&Fh(a.length)&&!!ar[fn(a)]}o(iM,"baseIsTypedArray");function q2(a){return typeof a=="function"?a:a==null?_n:typeof a=="object"?wt(a)?j2(a[0],a[1]):z2(a):c3(a)}o(q2,"baseIteratee");function om(a){if(!Su(a))return aS(a);var c=[];for(var p in er(a))Jt.call(a,p)&&p!="constructor"&&c.push(p);return c}o(om,"baseKeys");function oM(a){if(!ur(a))return qM(a);var c=Su(a),p=[];for(var T in a)T=="constructor"&&(c||!Jt.call(a,T))||p.push(T);return p}o(oM,"baseKeysIn");function sm(a,c){return a<c}o(sm,"baseLt");function H2(a,c){var p=-1,T=xn(a)?xe(a.length):[];return Ds(a,function(U,K,re){T[++p]=c(U,K,re)}),T}o(H2,"baseMap");function z2(a){var c=wm(a);return c.length==1&&c[0][2]?Ey(c[0][0],c[0][1]):function(p){return p===a||im(p,a,c)}}o(z2,"baseMatches");function j2(a,c){return Em(a)&&_y(c)?Ey(po(a),c):function(p){var T=Om(p,a);return T===r&&T===c?Nm(p,a):_u(c,T,O|R)}}o(j2,"baseMatchesProperty");function Eh(a,c,p,T,U){a!==c&&em(c,function(K,re){if(U||(U=new Bi),ur(K))sM(a,c,re,p,Eh,T,U);else{var ce=T?T(Sm(a,re),K,re+"",a,c,U):r;ce===r&&(ce=K),Zp(a,re,ce)}},wn)}o(Eh,"baseMerge");function sM(a,c,p,T,U,K,re){var ce=Sm(a,p),be=Sm(c,p),Te=re.get(be);if(Te){Zp(a,p,Te);return}var Ce=K?K(ce,be,p+"",a,c,re):r,De=Ce===r;if(De){var Le=wt(be),Ke=!Le&&Ps(be),et=!Le&&!Ke&&Jf(be);Ce=be,Le||Ke||et?wt(ce)?Ce=ce:vr(ce)?Ce=yn(ce):Ke?(De=!1,Ce=ry(be,!0)):et?(De=!1,Ce=ny(be,!0)):Ce=[]:Tu(be)||Pa(be)?(Ce=ce,Pa(ce)?Ce=Qy(ce):(!ur(ce)||Yo(ce))&&(Ce=wy(be))):De=!1}De&&(re.set(be,Ce),U(Ce,be,T,K,re),re.delete(be)),Zp(a,p,Ce)}o(sM,"baseMergeDeep");function K2(a,c){var p=a.length;if(!!p)return c+=c<0?p:0,Jo(c,p)?a[c]:r}o(K2,"baseNth");function V2(a,c,p){c.length?c=cr(c,function(K){return wt(K)?function(re){return Ra(re,K.length===1?K[0]:K)}:K}):c=[_n];var T=-1;c=cr(c,Un(Ze()));var U=H2(a,function(K,re,ce){var be=cr(c,function(Te){return Te(K)});return{criteria:be,index:++T,value:K}});return O7(U,function(K,re){return yM(K,re,p)})}o(V2,"baseOrderBy");function aM(a,c){return G2(a,c,function(p,T){return Nm(a,T)})}o(aM,"basePick");function G2(a,c,p){for(var T=-1,U=c.length,K={};++T<U;){var re=c[T],ce=Ra(a,re);p(ce,re)&&Eu(K,Os(re,a),ce)}return K}o(G2,"basePickBy");function fM(a){return function(c){return Ra(c,a)}}o(fM,"basePropertyDeep");function am(a,c,p,T){var U=T?R7:Ff,K=-1,re=c.length,ce=a;for(a===c&&(c=yn(c)),p&&(ce=cr(a,Un(p)));++K<re;)for(var be=0,Te=c[K],Ce=p?p(Te):Te;(be=U(ce,Ce,be,T))>-1;)ce!==a&&dh.call(ce,be,1),dh.call(a,be,1);return a}o(am,"basePullAll");function W2(a,c){for(var p=a?c.length:0,T=p-1;p--;){var U=c[p];if(p==T||U!==K){var K=U;Jo(U)?dh.call(a,U,1):lm(a,U)}}return a}o(W2,"basePullAt");function fm(a,c){return a+bh(C2()*(c-a+1))}o(fm,"baseRandom");function cM(a,c,p,T){for(var U=-1,K=Ar(mh((c-a)/(p||1)),0),re=xe(K);K--;)re[T?K:++U]=a,a+=p;return re}o(cM,"baseRange");function cm(a,c){var p="";if(!a||c<1||c>_)return p;do c%2&&(p+=a),c=bh(c/2),c&&(a+=a);while(c);return p}o(cm,"baseRepeat");function Ct(a,c){return Mm(Ay(a,c,_n),a+"")}o(Ct,"baseRest");function uM(a){return D2(Yf(a))}o(uM,"baseSample");function lM(a,c){var p=Yf(a);return Oh(p,Da(c,0,p.length))}o(lM,"baseSampleSize");function Eu(a,c,p,T){if(!ur(a))return a;c=Os(c,a);for(var U=-1,K=c.length,re=K-1,ce=a;ce!=null&&++U<K;){var be=po(c[U]),Te=p;if(be==="__proto__"||be==="constructor"||be==="prototype")return a;if(U!=re){var Ce=ce[be];Te=T?T(Ce,be,ce):r,Te===r&&(Te=ur(Ce)?Ce:Jo(c[U+1])?[]:{})}yu(ce,be,Te),ce=ce[be]}return a}o(Eu,"baseSet");var J2=gh?function(a,c){return gh.set(a,c),a}:_n,hM=ph?function(a,c){return ph(a,"toString",{configurable:!0,enumerable:!1,value:Bm(c),writable:!0})}:_n;function dM(a){return Oh(Yf(a))}o(dM,"baseShuffle");function mi(a,c,p){var T=-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 K=xe(U);++T<U;)K[T]=a[T+c];return K}o(mi,"baseSlice");function pM(a,c){var p;return Ds(a,function(T,U,K){return p=c(T,U,K),!p}),!!p}o(pM,"baseSome");function Ah(a,c,p){var T=0,U=a==null?T:a.length;if(typeof c=="number"&&c===c&&U<=N){for(;T<U;){var K=T+U>>>1,re=a[K];re!==null&&!$n(re)&&(p?re<=c:re<c)?T=K+1:U=K}return U}return um(a,c,_n,p)}o(Ah,"baseSortedIndex");function um(a,c,p,T){var U=0,K=a==null?0:a.length;if(K===0)return 0;c=p(c);for(var re=c!==c,ce=c===null,be=$n(c),Te=c===r;U<K;){var Ce=bh((U+K)/2),De=p(a[Ce]),Le=De!==r,Ke=De===null,et=De===De,St=$n(De);if(re)var tt=T||et;else Te?tt=et&&(T||Le):ce?tt=et&&Le&&(T||!Ke):be?tt=et&&Le&&!Ke&&(T||!St):Ke||St?tt=!1:tt=T?De<=c:De<c;tt?U=Ce+1:K=Ce}return Wr(K,C)}o(um,"baseSortedIndexBy");function Y2(a,c){for(var p=-1,T=a.length,U=0,K=[];++p<T;){var re=a[p],ce=c?c(re):re;if(!p||!Li(ce,be)){var be=ce;K[U++]=re===0?0:re}}return K}o(Y2,"baseSortedUniq");function X2(a){return typeof a=="number"?a:$n(a)?S:+a}o(X2,"baseToNumber");function Fn(a){if(typeof a=="string")return a;if(wt(a))return cr(a,Fn)+"";if($n(a))return k2?k2.call(a):"";var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(Fn,"baseToString");function Rs(a,c,p){var T=-1,U=nh,K=a.length,re=!0,ce=[],be=ce;if(p)re=!1,U=Fp;else if(K>=t){var Te=c?null:SM(a);if(Te)return oh(Te);re=!1,U=du,be=new Ia}else be=c?[]:ce;e:for(;++T<K;){var Ce=a[T],De=c?c(Ce):Ce;if(Ce=p||Ce!==0?Ce:0,re&&De===De){for(var Le=be.length;Le--;)if(be[Le]===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(Rs,"baseUniq");function lm(a,c){return c=Os(c,a),a=Sy(a,c),a==null||delete a[po(bi(c))]}o(lm,"baseUnset");function Z2(a,c,p,T){return Eu(a,c,p(Ra(a,c)),T)}o(Z2,"baseUpdate");function Sh(a,c,p,T){for(var U=a.length,K=T?U:-1;(T?K--:++K<U)&&c(a[K],K,a););return p?mi(a,T?0:K,T?K+1:U):mi(a,T?K+1:0,T?U:K)}o(Sh,"baseWhile");function Q2(a,c){var p=a;return p instanceof Ot&&(p=p.value()),$p(c,function(T,U){return U.func.apply(U.thisArg,Ts([T],U.args))},p)}o(Q2,"baseWrapperValue");function hm(a,c,p){var T=a.length;if(T<2)return T?Rs(a[0]):[];for(var U=-1,K=xe(T);++U<T;)for(var re=a[U],ce=-1;++ce<T;)ce!=U&&(K[U]=xu(K[U]||re,a[ce],c,p));return Rs($r(K,1),c,p)}o(hm,"baseXor");function ey(a,c,p){for(var T=-1,U=a.length,K=c.length,re={};++T<U;){var ce=T<K?c[T]:r;p(re,a[T],ce)}return re}o(ey,"baseZipObject");function dm(a){return vr(a)?a:[]}o(dm,"castArrayLikeObject");function pm(a){return typeof a=="function"?a:_n}o(pm,"castFunction");function Os(a,c){return wt(a)?a:Em(a,c)?[a]:ky(Kt(a))}o(Os,"castPath");var mM=Ct;function Ns(a,c,p){var T=a.length;return p=p===r?T:p,!c&&p>=T?a:mi(a,c,p)}o(Ns,"castSlice");var ty=rS||function(a){return Cr.clearTimeout(a)};function ry(a,c){if(c)return a.slice();var p=a.length,T=E2?E2(p):new a.constructor(p);return a.copy(T),T}o(ry,"cloneBuffer");function mm(a){var c=new a.constructor(a.byteLength);return new lh(c).set(new lh(a)),c}o(mm,"cloneArrayBuffer");function bM(a,c){var p=c?mm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}o(bM,"cloneDataView");function gM(a){var c=new a.constructor(a.source,nt.exec(a));return c.lastIndex=a.lastIndex,c}o(gM,"cloneRegExp");function vM(a){return vu?er(vu.call(a)):{}}o(vM,"cloneSymbol");function ny(a,c){var p=c?mm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}o(ny,"cloneTypedArray");function iy(a,c){if(a!==c){var p=a!==r,T=a===null,U=a===a,K=$n(a),re=c!==r,ce=c===null,be=c===c,Te=$n(c);if(!ce&&!Te&&!K&&a>c||K&&re&&be&&!ce&&!Te||T&&re&&be||!p&&be||!U)return 1;if(!T&&!K&&!Te&&a<c||Te&&p&&U&&!T&&!K||ce&&p&&U||!re&&U||!be)return-1}return 0}o(iy,"compareAscending");function yM(a,c,p){for(var T=-1,U=a.criteria,K=c.criteria,re=U.length,ce=p.length;++T<re;){var be=iy(U[T],K[T]);if(be){if(T>=ce)return be;var Te=p[T];return be*(Te=="desc"?-1:1)}}return a.index-c.index}o(yM,"compareMultiple");function oy(a,c,p,T){for(var U=-1,K=a.length,re=p.length,ce=-1,be=c.length,Te=Ar(K-re,0),Ce=xe(be+Te),De=!T;++ce<be;)Ce[ce]=c[ce];for(;++U<re;)(De||U<K)&&(Ce[p[U]]=a[U]);for(;Te--;)Ce[ce++]=a[U++];return Ce}o(oy,"composeArgs");function sy(a,c,p,T){for(var U=-1,K=a.length,re=-1,ce=p.length,be=-1,Te=c.length,Ce=Ar(K-ce,0),De=xe(Ce+Te),Le=!T;++U<Ce;)De[U]=a[U];for(var Ke=U;++be<Te;)De[Ke+be]=c[be];for(;++re<ce;)(Le||U<K)&&(De[Ke+p[re]]=a[U++]);return De}o(sy,"composeArgsRight");function yn(a,c){var p=-1,T=a.length;for(c||(c=xe(T));++p<T;)c[p]=a[p];return c}o(yn,"copyArray");function ho(a,c,p,T){var U=!p;p||(p={});for(var K=-1,re=c.length;++K<re;){var ce=c[K],be=T?T(p[ce],a[ce],ce,p,a):r;be===r&&(be=a[ce]),U?Vo(p,ce,be):yu(p,ce,be)}return p}o(ho,"copyObject");function xM(a,c){return ho(a,_m(a),c)}o(xM,"copySymbols");function wM(a,c){return ho(a,yy(a),c)}o(wM,"copySymbolsIn");function Mh(a,c){return function(p,T){var U=wt(p)?M7:zS,K=c?c():{};return U(p,a,Ze(T,2),K)}}o(Mh,"createAggregator");function Vf(a){return Ct(function(c,p){var T=-1,U=p.length,K=U>1?p[U-1]:r,re=U>2?p[2]:r;for(K=a.length>3&&typeof K=="function"?(U--,K):r,re&&cn(p[0],p[1],re)&&(K=U<3?r:K,U=1),c=er(c);++T<U;){var ce=p[T];ce&&a(c,ce,T,K)}return c})}o(Vf,"createAssigner");function ay(a,c){return function(p,T){if(p==null)return p;if(!xn(p))return a(p,T);for(var U=p.length,K=c?U:-1,re=er(p);(c?K--:++K<U)&&T(re[K],K,re)!==!1;);return p}}o(ay,"createBaseEach");function fy(a){return function(c,p,T){for(var U=-1,K=er(c),re=T(c),ce=re.length;ce--;){var be=re[a?ce:++U];if(p(K[be],be,K)===!1)break}return c}}o(fy,"createBaseFor");function _M(a,c,p){var T=c&I,U=Au(a);function K(){var re=this&&this!==Cr&&this instanceof K?U:a;return re.apply(T?p:this,arguments)}return o(K,"wrapper"),K}o(_M,"createBind");function cy(a){return function(c){c=Kt(c);var p=$f(c)?Pi(c):r,T=p?p[0]:c.charAt(0),U=p?Ns(p,1).join(""):c.slice(1);return T[a]()+U}}o(cy,"createCaseFirst");function Gf(a){return function(c){return $p(a3(s3(c).replace(h7,"")),a,"")}}o(Gf,"createCompounder");function Au(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=Kf(a.prototype),T=a.apply(p,c);return ur(T)?T:p}}o(Au,"createCtor");function EM(a,c,p){var T=Au(a);function U(){for(var K=arguments.length,re=xe(K),ce=K,be=Wf(U);ce--;)re[ce]=arguments[ce];var Te=K<3&&re[0]!==be&&re[K-1]!==be?[]:Cs(re,be);if(K-=Te.length,K<p)return py(a,c,Th,U.placeholder,r,re,Te,r,r,p-K);var Ce=this&&this!==Cr&&this instanceof U?T:a;return Ln(Ce,this,re)}return o(U,"wrapper"),U}o(EM,"createCurry");function uy(a){return function(c,p,T){var U=er(c);if(!xn(c)){var K=Ze(p,3);c=kr(c),p=o(function(ce){return K(U[ce],ce,U)},"predicate")}var re=a(c,p,T);return re>-1?U[K?c[re]:re]:r}}o(uy,"createFind");function ly(a){return Wo(function(c){var p=c.length,T=p,U=di.prototype.thru;for(a&&c.reverse();T--;){var K=c[T];if(typeof K!="function")throw new hi(i);if(U&&!re&&Dh(K)=="wrapper")var re=new di([],!0)}for(T=re?T:p;++T<p;){K=c[T];var ce=Dh(K),be=ce=="wrapper"?xm(K):r;be&&Am(be[0])&&be[1]==(ne|P|ee|V)&&!be[4].length&&be[9]==1?re=re[Dh(be[0])].apply(re,be[3]):re=K.length==1&&Am(K)?re[ce]():re.thru(K)}return function(){var Te=arguments,Ce=Te[0];if(re&&Te.length==1&&wt(Ce))return re.plant(Ce).value();for(var De=0,Le=p?c[De].apply(this,Te):Ce;++De<p;)Le=c[De].call(this,Le);return Le}})}o(ly,"createFlow");function Th(a,c,p,T,U,K,re,ce,be,Te){var Ce=c&ne,De=c&I,Le=c&B,Ke=c&(P|J),et=c&H,St=Le?r:Au(a);function tt(){for(var It=arguments.length,Nt=xe(It),qn=It;qn--;)Nt[qn]=arguments[qn];if(Ke)var un=Wf(tt),Hn=P7(Nt,un);if(T&&(Nt=oy(Nt,T,U,Ke)),K&&(Nt=sy(Nt,K,re,Ke)),It-=Hn,Ke&&It<Te){var yr=Cs(Nt,un);return py(a,c,Th,tt.placeholder,p,Nt,yr,ce,be,Te-It)}var Ui=De?p:this,Zo=Le?Ui[a]:a;return It=Nt.length,ce?Nt=zM(Nt,ce):et&&It>1&&Nt.reverse(),Ce&&be<It&&(Nt.length=be),this&&this!==Cr&&this instanceof tt&&(Zo=St||Au(Zo)),Zo.apply(Ui,Nt)}return o(tt,"wrapper"),tt}o(Th,"createHybrid");function hy(a,c){return function(p,T){return XS(p,a,c(T),{})}}o(hy,"createInverter");function Ch(a,c){return function(p,T){var U;if(p===r&&T===r)return c;if(p!==r&&(U=p),T!==r){if(U===r)return T;typeof p=="string"||typeof T=="string"?(p=Fn(p),T=Fn(T)):(p=X2(p),T=X2(T)),U=a(p,T)}return U}}o(Ch,"createMathOperation");function bm(a){return Wo(function(c){return c=cr(c,Un(Ze())),Ct(function(p){var T=this;return a(c,function(U){return Ln(U,T,p)})})})}o(bm,"createOver");function kh(a,c){c=c===r?" ":Fn(c);var p=c.length;if(p<2)return p?cm(c,a):c;var T=cm(c,mh(a/qf(c)));return $f(c)?Ns(Pi(T),0,a).join(""):T.slice(0,a)}o(kh,"createPadding");function AM(a,c,p,T){var U=c&I,K=Au(a);function re(){for(var ce=-1,be=arguments.length,Te=-1,Ce=T.length,De=xe(Ce+be),Le=this&&this!==Cr&&this instanceof re?K:a;++Te<Ce;)De[Te]=T[Te];for(;be--;)De[Te++]=arguments[++ce];return Ln(Le,U?p:this,De)}return o(re,"wrapper"),re}o(AM,"createPartial");function dy(a){return function(c,p,T){return T&&typeof T!="number"&&cn(c,p,T)&&(p=T=r),c=Xo(c),p===r?(p=c,c=0):p=Xo(p),T=T===r?c<p?1:-1:Xo(T),cM(c,p,T,a)}}o(dy,"createRange");function Ih(a){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=gi(c),p=gi(p)),a(c,p)}}o(Ih,"createRelationalOperation");function py(a,c,p,T,U,K,re,ce,be,Te){var Ce=c&P,De=Ce?re:r,Le=Ce?r:re,Ke=Ce?K:r,et=Ce?r:K;c|=Ce?ee:X,c&=~(Ce?X:ee),c&Y||(c&=~(I|B));var St=[a,c,U,Ke,De,et,Le,ce,be,Te],tt=p.apply(r,St);return Am(a)&&My(tt,St),tt.placeholder=T,Ty(tt,a,c)}o(py,"createRecurry");function gm(a){var c=Er[a];return function(p,T){if(p=gi(p),T=T==null?0:Wr(At(T),292),T&&T2(p)){var U=(Kt(p)+"e").split("e"),K=c(U[0]+"e"+(+U[1]+T));return U=(Kt(K)+"e").split("e"),+(U[0]+"e"+(+U[1]-T))}return c(p)}}o(gm,"createRound");var SM=zf&&1/oh(new zf([,-0]))[1]==m?function(a){return new zf(a)}:Fm;function my(a){return function(c){var p=Jr(c);return p==ae?Gp(c):p==W?H7(c):N7(c,a(c))}}o(my,"createToPairs");function Go(a,c,p,T,U,K,re,ce){var be=c&B;if(!be&&typeof a!="function")throw new hi(i);var Te=T?T.length:0;if(Te||(c&=~(ee|X),T=U=r),re=re===r?re:Ar(At(re),0),ce=ce===r?ce:At(ce),Te-=U?U.length:0,c&X){var Ce=T,De=U;T=U=r}var Le=be?r:xm(a),Ke=[a,c,p,T,U,Ce,De,K,re,ce];if(Le&&$M(Ke,Le),a=Ke[0],c=Ke[1],p=Ke[2],T=Ke[3],U=Ke[4],ce=Ke[9]=Ke[9]===r?be?0:a.length:Ar(Ke[9]-Te,0),!ce&&c&(P|J)&&(c&=~(P|J)),!c||c==I)var et=_M(a,c,p);else c==P||c==J?et=EM(a,c,ce):(c==ee||c==(I|ee))&&!U.length?et=AM(a,c,p,T):et=Th.apply(r,Ke);var St=Le?J2:My;return Ty(St(et,Ke),a,c)}o(Go,"createWrap");function by(a,c,p,T){return a===r||Li(a,Hf[p])&&!Jt.call(T,p)?c:a}o(by,"customDefaultsAssignIn");function gy(a,c,p,T,U,K){return ur(a)&&ur(c)&&(K.set(c,a),Eh(a,c,r,gy,K),K.delete(c)),a}o(gy,"customDefaultsMerge");function MM(a){return Tu(a)?r:a}o(MM,"customOmitClone");function vy(a,c,p,T,U,K){var re=p&O,ce=a.length,be=c.length;if(ce!=be&&!(re&&be>ce))return!1;var Te=K.get(a),Ce=K.get(c);if(Te&&Ce)return Te==c&&Ce==a;var De=-1,Le=!0,Ke=p&R?new Ia:r;for(K.set(a,c),K.set(c,a);++De<ce;){var et=a[De],St=c[De];if(T)var tt=re?T(St,et,De,c,a,K):T(et,St,De,a,c,K);if(tt!==r){if(tt)continue;Le=!1;break}if(Ke){if(!qp(c,function(It,Nt){if(!du(Ke,Nt)&&(et===It||U(et,It,p,T,K)))return Ke.push(Nt)})){Le=!1;break}}else if(!(et===St||U(et,St,p,T,K))){Le=!1;break}}return K.delete(a),K.delete(c),Le}o(vy,"equalArrays");function TM(a,c,p,T,U,K,re){switch(p){case le:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case gr:return!(a.byteLength!=c.byteLength||!K(new lh(a),new lh(c)));case Q:case se:case Ae:return Li(+a,+c);case j:return a.name==c.name&&a.message==c.message;case ve:case pe:return a==c+"";case ae:var ce=Gp;case W:var be=T&O;if(ce||(ce=oh),a.size!=c.size&&!be)return!1;var Te=re.get(a);if(Te)return Te==c;T|=R,re.set(a,c);var Ce=vy(ce(a),ce(c),T,U,K,re);return re.delete(a),Ce;case ke:if(vu)return vu.call(a)==vu.call(c)}return!1}o(TM,"equalByTag");function CM(a,c,p,T,U,K){var re=p&O,ce=vm(a),be=ce.length,Te=vm(c),Ce=Te.length;if(be!=Ce&&!re)return!1;for(var De=be;De--;){var Le=ce[De];if(!(re?Le in c:Jt.call(c,Le)))return!1}var Ke=K.get(a),et=K.get(c);if(Ke&&et)return Ke==c&&et==a;var St=!0;K.set(a,c),K.set(c,a);for(var tt=re;++De<be;){Le=ce[De];var It=a[Le],Nt=c[Le];if(T)var qn=re?T(Nt,It,Le,c,a,K):T(It,Nt,Le,a,c,K);if(!(qn===r?It===Nt||U(It,Nt,p,T,K):qn)){St=!1;break}tt||(tt=Le=="constructor")}if(St&&!tt){var un=a.constructor,Hn=c.constructor;un!=Hn&&"constructor"in a&&"constructor"in c&&!(typeof un=="function"&&un instanceof un&&typeof Hn=="function"&&Hn instanceof Hn)&&(St=!1)}return K.delete(a),K.delete(c),St}o(CM,"equalObjects");function Wo(a){return Mm(Ay(a,r,Oy),a+"")}o(Wo,"flatRest");function vm(a){return U2(a,kr,_m)}o(vm,"getAllKeys");function ym(a){return U2(a,wn,yy)}o(ym,"getAllKeysIn");var xm=gh?function(a){return gh.get(a)}:Fm;function Dh(a){for(var c=a.name+"",p=jf[c],T=Jt.call(jf,c)?p.length:0;T--;){var U=p[T],K=U.func;if(K==null||K==a)return U.name}return c}o(Dh,"getFuncName");function Wf(a){var c=Jt.call($,"placeholder")?$:a;return c.placeholder}o(Wf,"getHolder");function Ze(){var a=$.iteratee||Lm;return a=a===Lm?q2:a,arguments.length?a(arguments[0],arguments[1]):a}o(Ze,"getIteratee");function Rh(a,c){var p=a.__data__;return BM(c)?p[typeof c=="string"?"string":"hash"]:p.map}o(Rh,"getMapData");function wm(a){for(var c=kr(a),p=c.length;p--;){var T=c[p],U=a[T];c[p]=[T,U,_y(U)]}return c}o(wm,"getMatchData");function Oa(a,c){var p=F7(a,c);return $2(p)?p:r}o(Oa,"getNative");function kM(a){var c=Jt.call(a,Ca),p=a[Ca];try{a[Ca]=r;var T=!0}catch{}var U=ch.call(a);return T&&(c?a[Ca]=p:delete a[Ca]),U}o(kM,"getRawTag");var _m=Jp?function(a){return a==null?[]:(a=er(a),Ms(Jp(a),function(c){return S2.call(a,c)}))}:$m,yy=Jp?function(a){for(var c=[];a;)Ts(c,_m(a)),a=hh(a);return c}:$m,Jr=fn;(Yp&&Jr(new Yp(new ArrayBuffer(1)))!=le||mu&&Jr(new mu)!=ae||Xp&&Jr(Xp.resolve())!=Me||zf&&Jr(new zf)!=W||bu&&Jr(new bu)!=Pe)&&(Jr=o(function(a){var c=fn(a),p=c==ie?a.constructor:r,T=p?Na(p):"";if(T)switch(T){case lS:return le;case hS:return ae;case dS:return Me;case pS:return W;case mS:return Pe}return c},"getTag"));function IM(a,c,p){for(var T=-1,U=p.length;++T<U;){var K=p[T],re=K.size;switch(K.type){case"drop":a+=re;break;case"dropRight":c-=re;break;case"take":c=Wr(c,a+re);break;case"takeRight":a=Ar(a,c-re);break}}return{start:a,end:c}}o(IM,"getView");function DM(a){var c=a.match(dt);return c?c[1].split(ai):[]}o(DM,"getWrapDetails");function xy(a,c,p){c=Os(c,a);for(var T=-1,U=c.length,K=!1;++T<U;){var re=po(c[T]);if(!(K=a!=null&&p(a,re)))break;a=a[re]}return K||++T!=U?K:(U=a==null?0:a.length,!!U&&Fh(U)&&Jo(re,U)&&(wt(a)||Pa(a)))}o(xy,"hasPath");function RM(a){var c=a.length,p=new a.constructor(c);return c&&typeof a[0]=="string"&&Jt.call(a,"index")&&(p.index=a.index,p.input=a.input),p}o(RM,"initCloneArray");function wy(a){return typeof a.constructor=="function"&&!Su(a)?Kf(hh(a)):{}}o(wy,"initCloneObject");function OM(a,c,p){var T=a.constructor;switch(c){case gr:return mm(a);case Q:case se:return new T(+a);case le:return bM(a,p);case oe:case F:case Z:case me:case ye:case we:case Ie:case Rt:case Fe:return ny(a,p);case ae:return new T;case Ae:case pe:return new T(a);case ve:return gM(a);case W:return new T;case ke:return vM(a)}}o(OM,"initCloneByTag");function NM(a,c){var p=c.length;if(!p)return a;var T=p-1;return c[T]=(p>1?"& ":"")+c[T],c=c.join(p>2?", ":" "),a.replace(ht,`{
2
2
  /* [wrapped with `+c+`] */
3
- `)}o(IM,"insertWrapDetails");function DM(a){return wt(a)||Pa(a)||!!(S2&&a&&a[S2])}o(DM,"isFlattenable");function Jo(a,c){var p=typeof a;return c=c??_,!!c&&(p=="number"||p!="symbol"&&bn.test(a))&&a>-1&&a%1==0&&a<c}o(Jo,"isIndex");function cn(a,c,p){if(!ur(p))return!1;var M=typeof c;return(M=="number"?xn(p)&&Jo(c,p.length):M=="string"&&c in p)?Li(p[c],a):!1}o(cn,"isIterateeCall");function wm(a,c){if(wt(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||$n(a)?!0:ct.test(a)||!oi.test(a)||c!=null&&a in er(c)}o(wm,"isKey");function RM(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}o(RM,"isKeyable");function _m(a){var c=Ih(a),p=$[c];if(typeof p!="function"||!(c in Ot.prototype))return!1;if(a===p)return!0;var M=vm(p);return!!M&&a===M[0]}o(_m,"isLaziable");function OM(a){return!!w2&&w2 in a}o(OM,"isMasked");var NM=sh?Yo:Fm;function Au(a){var c=a&&a.constructor,p=typeof c=="function"&&c.prototype||Hf;return a===p}o(Au,"isPrototype");function wy(a){return a===a&&!ur(a)}o(wy,"isStrictComparable");function _y(a,c){return function(p){return p==null?!1:p[a]===c&&(c!==r||a in er(p))}}o(_y,"matchesStrictComparable");function PM(a){var c=Bh(a,function(M){return p.size===u&&p.clear(),M}),p=c.cache;return c}o(PM,"memoizeCapped");function BM(a,c){var p=a[1],M=c[1],U=p|M,K=U<(I|B|ne),re=M==ne&&p==P||M==ne&&p==V&&a[7].length<=c[8]||M==(ne|V)&&c[7].length<=c[8]&&p==P;if(!(K||re))return a;M&I&&(a[2]=c[2],U|=p&I?0:Y);var ce=c[3];if(ce){var be=a[3];a[3]=be?iy(be,ce,c[4]):ce,a[4]=be?Cs(a[3],d):c[4]}return ce=c[5],ce&&(be=a[5],a[5]=be?oy(be,ce,c[6]):ce,a[6]=be?Cs(a[5],d):c[6]),ce=c[7],ce&&(a[7]=ce),M&ne&&(a[8]=a[8]==null?c[8]:Wr(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=U,a}o(BM,"mergeData");function LM(a){var c=[];if(a!=null)for(var p in er(a))c.push(p);return c}o(LM,"nativeKeysIn");function UM(a){return fh.call(a)}o(UM,"objectToString");function Ey(a,c,p){return c=Ar(c===r?a.length-1:c,0),function(){for(var M=arguments,U=-1,K=Ar(M.length-c,0),re=xe(K);++U<K;)re[U]=M[c+U];U=-1;for(var ce=xe(c+1);++U<c;)ce[U]=M[U];return ce[c]=p(re),Ln(a,this,ce)}}o(Ey,"overRest");function Ay(a,c){return c.length<2?a:Ra(a,mi(c,0,-1))}o(Ay,"parent");function FM(a,c){for(var p=a.length,M=Wr(c.length,p),U=yn(a);M--;){var K=c[M];a[M]=Jo(K,p)?U[K]:r}return a}o(FM,"reorder");function Em(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}o(Em,"safeGet");var Sy=Ty(W2),Su=eS||function(a,c){return Cr.setTimeout(a,c)},Am=Ty(fM);function My(a,c,p){var M=c+"";return Am(a,IM(M,$M(TM(M),p)))}o(My,"setWrapToString");function Ty(a){var c=0,p=0;return function(){var M=iS(),U=h-(M-p);if(p=M,U>0){if(++c>=L)return arguments[0]}else c=0;return a.apply(r,arguments)}}o(Ty,"shortOut");function Rh(a,c){var p=-1,M=a.length,U=M-1;for(c=c===r?M:c;++p<c;){var K=sm(p,U),re=a[K];a[K]=a[p],a[p]=re}return a.length=c,a}o(Rh,"shuffleSelf");var Cy=PM(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(ut,function(p,M,U,K){c.push(U?K.replace(fi,"$1"):M||p)}),c});function po(a){if(typeof a=="string"||$n(a))return a;var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(po,"toKey");function Na(a){if(a!=null){try{return ah.call(a)}catch{}try{return a+""}catch{}}return""}o(Na,"toSource");function $M(a,c){return li(w,function(p){var M="_."+p[0];c&p[1]&&!rh(a,M)&&a.push(M)}),a.sort()}o($M,"updateWrapDetails");function ky(a){if(a instanceof Ot)return a.clone();var c=new di(a.__wrapped__,a.__chain__);return c.__actions__=yn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}o(ky,"wrapperClone");function qM(a,c,p){(p?cn(a,c,p):c===r)?c=1:c=Ar(At(c),0);var M=a==null?0:a.length;if(!M||c<1)return[];for(var U=0,K=0,re=xe(ph(M/c));U<M;)re[K++]=mi(a,U,U+=c);return re}o(qM,"chunk");function HM(a){for(var c=-1,p=a==null?0:a.length,M=0,U=[];++c<p;){var K=a[c];K&&(U[M++]=K)}return U}o(HM,"compact");function zM(){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 Ts(wt(p)?yn(p):[p],$r(c,1))}o(zM,"concat");var jM=Ct(function(a,c){return vr(a)?yu(a,$r(c,1,vr,!0)):[]}),KM=Ct(function(a,c){var p=bi(c);return vr(p)&&(p=r),vr(a)?yu(a,$r(c,1,vr,!0),Ze(p,2)):[]}),VM=Ct(function(a,c){var p=bi(c);return vr(p)&&(p=r),vr(a)?yu(a,$r(c,1,vr,!0),r,p):[]});function GM(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:At(c),mi(a,c<0?0:c,M)):[]}o(GM,"drop");function WM(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:At(c),c=M-c,mi(a,0,c<0?0:c)):[]}o(WM,"dropRight");function JM(a,c){return a&&a.length?Ah(a,Ze(c,3),!0,!0):[]}o(JM,"dropRightWhile");function YM(a,c){return a&&a.length?Ah(a,Ze(c,3),!0):[]}o(YM,"dropWhile");function XM(a,c,p,M){var U=a==null?0:a.length;return U?(p&&typeof p!="number"&&cn(a,c,p)&&(p=0,M=U),zS(a,c,p,M)):[]}o(XM,"fill");function Iy(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=p==null?0:At(p);return U<0&&(U=Ar(M+U,0)),nh(a,Ze(c,3),U)}o(Iy,"findIndex");function Dy(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=M-1;return p!==r&&(U=At(p),U=p<0?Ar(M+U,0):Wr(U,M-1)),nh(a,Ze(c,3),U,!0)}o(Dy,"findLastIndex");function Ry(a){var c=a==null?0:a.length;return c?$r(a,1):[]}o(Ry,"flatten");function ZM(a){var c=a==null?0:a.length;return c?$r(a,m):[]}o(ZM,"flattenDeep");function QM(a,c){var p=a==null?0:a.length;return p?(c=c===r?1:At(c),$r(a,c)):[]}o(QM,"flattenDepth");function eT(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(eT,"fromPairs");function Oy(a){return a&&a.length?a[0]:r}o(Oy,"head");function tT(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=p==null?0:At(p);return U<0&&(U=Ar(M+U,0)),Ff(a,c,U)}o(tT,"indexOf");function rT(a){var c=a==null?0:a.length;return c?mi(a,0,-1):[]}o(rT,"initial");var nT=Ct(function(a){var c=cr(a,lm);return c.length&&c[0]===a[0]?tm(c):[]}),iT=Ct(function(a){var c=bi(a),p=cr(a,lm);return c===bi(p)?c=r:p.pop(),p.length&&p[0]===a[0]?tm(p,Ze(c,2)):[]}),oT=Ct(function(a){var c=bi(a),p=cr(a,lm);return c=typeof c=="function"?c:r,c&&p.pop(),p.length&&p[0]===a[0]?tm(p,r,c):[]});function sT(a,c){return a==null?"":rS.call(a,c)}o(sT,"join");function bi(a){var c=a==null?0:a.length;return c?a[c-1]:r}o(bi,"last");function aT(a,c,p){var M=a==null?0:a.length;if(!M)return-1;var U=M;return p!==r&&(U=At(p),U=U<0?Ar(M+U,0):Wr(U,M-1)),c===c?$7(a,c,U):nh(a,d2,U,!0)}o(aT,"lastIndexOf");function fT(a,c){return a&&a.length?j2(a,At(c)):r}o(fT,"nth");var cT=Ct(Ny);function Ny(a,c){return a&&a.length&&c&&c.length?om(a,c):a}o(Ny,"pullAll");function uT(a,c,p){return a&&a.length&&c&&c.length?om(a,c,Ze(p,2)):a}o(uT,"pullAllBy");function lT(a,c,p){return a&&a.length&&c&&c.length?om(a,c,r,p):a}o(lT,"pullAllWith");var hT=Wo(function(a,c){var p=a==null?0:a.length,M=Xp(a,c);return G2(a,cr(c,function(U){return Jo(U,p)?+U:U}).sort(ny)),M});function dT(a,c){var p=[];if(!(a&&a.length))return p;var M=-1,U=[],K=a.length;for(c=Ze(c,3);++M<K;){var re=a[M];c(re,M,a)&&(p.push(re),U.push(M))}return G2(a,U),p}o(dT,"remove");function Sm(a){return a==null?a:sS.call(a)}o(Sm,"reverse");function pT(a,c,p){var M=a==null?0:a.length;return M?(p&&typeof p!="number"&&cn(a,c,p)?(c=0,p=M):(c=c==null?0:At(c),p=p===r?M:At(p)),mi(a,c,p)):[]}o(pT,"slice");function mT(a,c){return Eh(a,c)}o(mT,"sortedIndex");function bT(a,c,p){return fm(a,c,Ze(p,2))}o(bT,"sortedIndexBy");function gT(a,c){var p=a==null?0:a.length;if(p){var M=Eh(a,c);if(M<p&&Li(a[M],c))return M}return-1}o(gT,"sortedIndexOf");function vT(a,c){return Eh(a,c,!0)}o(vT,"sortedLastIndex");function yT(a,c,p){return fm(a,c,Ze(p,2),!0)}o(yT,"sortedLastIndexBy");function xT(a,c){var p=a==null?0:a.length;if(p){var M=Eh(a,c,!0)-1;if(Li(a[M],c))return M}return-1}o(xT,"sortedLastIndexOf");function wT(a){return a&&a.length?J2(a):[]}o(wT,"sortedUniq");function _T(a,c){return a&&a.length?J2(a,Ze(c,2)):[]}o(_T,"sortedUniqBy");function ET(a){var c=a==null?0:a.length;return c?mi(a,1,c):[]}o(ET,"tail");function AT(a,c,p){return a&&a.length?(c=p||c===r?1:At(c),mi(a,0,c<0?0:c)):[]}o(AT,"take");function ST(a,c,p){var M=a==null?0:a.length;return M?(c=p||c===r?1:At(c),c=M-c,mi(a,c<0?0:c,M)):[]}o(ST,"takeRight");function MT(a,c){return a&&a.length?Ah(a,Ze(c,3),!1,!0):[]}o(MT,"takeRightWhile");function TT(a,c){return a&&a.length?Ah(a,Ze(c,3)):[]}o(TT,"takeWhile");var CT=Ct(function(a){return Rs($r(a,1,vr,!0))}),kT=Ct(function(a){var c=bi(a);return vr(c)&&(c=r),Rs($r(a,1,vr,!0),Ze(c,2))}),IT=Ct(function(a){var c=bi(a);return c=typeof c=="function"?c:r,Rs($r(a,1,vr,!0),r,c)});function DT(a){return a&&a.length?Rs(a):[]}o(DT,"uniq");function RT(a,c){return a&&a.length?Rs(a,Ze(c,2)):[]}o(RT,"uniqBy");function OT(a,c){return c=typeof c=="function"?c:r,a&&a.length?Rs(a,r,c):[]}o(OT,"uniqWith");function Mm(a){if(!(a&&a.length))return[];var c=0;return a=Ms(a,function(p){if(vr(p))return c=Ar(p.length,c),!0}),zp(c,function(p){return cr(a,$p(p))})}o(Mm,"unzip");function Py(a,c){if(!(a&&a.length))return[];var p=Mm(a);return c==null?p:cr(p,function(M){return Ln(c,r,M)})}o(Py,"unzipWith");var NT=Ct(function(a,c){return vr(a)?yu(a,c):[]}),PT=Ct(function(a){return um(Ms(a,vr))}),BT=Ct(function(a){var c=bi(a);return vr(c)&&(c=r),um(Ms(a,vr),Ze(c,2))}),LT=Ct(function(a){var c=bi(a);return c=typeof c=="function"?c:r,um(Ms(a,vr),r,c)}),UT=Ct(Mm);function FT(a,c){return Q2(a||[],c||[],vu)}o(FT,"zipObject");function $T(a,c){return Q2(a||[],c||[],_u)}o($T,"zipObjectDeep");var qT=Ct(function(a){var c=a.length,p=c>1?a[c-1]:r;return p=typeof p=="function"?(a.pop(),p):r,Py(a,p)});function By(a){var c=$(a);return c.__chain__=!0,c}o(By,"chain");function HT(a,c){return c(a),a}o(HT,"tap");function Oh(a,c){return c(a)}o(Oh,"thru");var zT=Wo(function(a){var c=a.length,p=c?a[0]:0,M=this.__wrapped__,U=o(function(K){return Xp(K,a)},"interceptor");return c>1||this.__actions__.length||!(M instanceof Ot)||!Jo(p)?this.thru(U):(M=M.slice(p,+p+(c?1:0)),M.__actions__.push({func:Oh,args:[U],thisArg:r}),new di(M,this.__chain__).thru(function(K){return c&&!K.length&&K.push(r),K}))});function jT(){return By(this)}o(jT,"wrapperChain");function KT(){return new di(this.value(),this.__chain__)}o(KT,"wrapperCommit");function VT(){this.__values__===r&&(this.__values__=Yy(this.value()));var a=this.__index__>=this.__values__.length,c=a?r:this.__values__[this.__index__++];return{done:a,value:c}}o(VT,"wrapperNext");function GT(){return this}o(GT,"wrapperToIterator");function WT(a){for(var c,p=this;p instanceof vh;){var M=ky(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(WT,"wrapperPlant");function JT(){var a=this.__wrapped__;if(a instanceof Ot){var c=a;return this.__actions__.length&&(c=new Ot(this)),c=c.reverse(),c.__actions__.push({func:Oh,args:[Sm],thisArg:r}),new di(c,this.__chain__)}return this.thru(Sm)}o(JT,"wrapperReverse");function YT(){return Z2(this.__wrapped__,this.__actions__)}o(YT,"wrapperValue");var XT=Sh(function(a,c,p){Jt.call(a,p)?++a[p]:Vo(a,p,1)});function ZT(a,c,p){var M=wt(a)?l2:HS;return p&&cn(a,c,p)&&(c=r),M(a,Ze(c,3))}o(ZT,"every");function QT(a,c){var p=wt(a)?Ms:P2;return p(a,Ze(c,3))}o(QT,"filter");var eC=cy(Iy),tC=cy(Dy);function rC(a,c){return $r(Nh(a,c),1)}o(rC,"flatMap");function nC(a,c){return $r(Nh(a,c),m)}o(nC,"flatMapDeep");function iC(a,c,p){return p=p===r?1:At(p),$r(Nh(a,c),p)}o(iC,"flatMapDepth");function Ly(a,c){var p=wt(a)?li:Ds;return p(a,Ze(c,3))}o(Ly,"forEach");function Uy(a,c){var p=wt(a)?E7:N2;return p(a,Ze(c,3))}o(Uy,"forEachRight");var oC=Sh(function(a,c,p){Jt.call(a,p)?a[p].push(c):Vo(a,p,[c])});function sC(a,c,p,M){a=xn(a)?a:Yf(a),p=p&&!M?At(p):0;var U=a.length;return p<0&&(p=Ar(U+p,0)),Fh(a)?p<=U&&a.indexOf(c,p)>-1:!!U&&Ff(a,c,p)>-1}o(sC,"includes");var aC=Ct(function(a,c,p){var M=-1,U=typeof c=="function",K=xn(a)?xe(a.length):[];return Ds(a,function(re){K[++M]=U?Ln(c,re,p):xu(re,c,p)}),K}),fC=Sh(function(a,c,p){Vo(a,p,c)});function Nh(a,c){var p=wt(a)?cr:q2;return p(a,Ze(c,3))}o(Nh,"map");function cC(a,c,p,M){return a==null?[]:(wt(c)||(c=c==null?[]:[c]),p=M?r:p,wt(p)||(p=p==null?[]:[p]),K2(a,c,p))}o(cC,"orderBy");var uC=Sh(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function lC(a,c,p){var M=wt(a)?Up:m2,U=arguments.length<3;return M(a,Ze(c,4),p,U,Ds)}o(lC,"reduce");function hC(a,c,p){var M=wt(a)?A7:m2,U=arguments.length<3;return M(a,Ze(c,4),p,U,N2)}o(hC,"reduceRight");function dC(a,c){var p=wt(a)?Ms:P2;return p(a,Lh(Ze(c,3)))}o(dC,"reject");function pC(a){var c=wt(a)?I2:sM;return c(a)}o(pC,"sample");function mC(a,c,p){(p?cn(a,c,p):c===r)?c=1:c=At(c);var M=wt(a)?LS:aM;return M(a,c)}o(mC,"sampleSize");function bC(a){var c=wt(a)?US:cM;return c(a)}o(bC,"shuffle");function gC(a){if(a==null)return 0;if(xn(a))return Fh(a)?qf(a):a.length;var c=Jr(a);return c==ae||c==W?a.size:nm(a).length}o(gC,"size");function vC(a,c,p){var M=wt(a)?Fp:uM;return p&&cn(a,c,p)&&(c=r),M(a,Ze(c,3))}o(vC,"some");var yC=Ct(function(a,c){if(a==null)return[];var p=c.length;return p>1&&cn(a,c[0],c[1])?c=[]:p>2&&cn(c[0],c[1],c[2])&&(c=[c[0]]),K2(a,$r(c,1),[])}),Ph=Q7||function(){return Cr.Date.now()};function xC(a,c){if(typeof c!="function")throw new hi(i);return a=At(a),function(){if(--a<1)return c.apply(this,arguments)}}o(xC,"after");function Fy(a,c,p){return c=p?r:c,c=a&&c==null?a.length:c,Go(a,ne,r,r,r,r,c)}o(Fy,"ary");function $y(a,c){var p;if(typeof c!="function")throw new hi(i);return a=At(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=r),p}}o($y,"before");var Tm=Ct(function(a,c,p){var M=I;if(p.length){var U=Cs(p,Wf(Tm));M|=ee}return Go(a,M,c,p,U)}),qy=Ct(function(a,c,p){var M=I|B;if(p.length){var U=Cs(p,Wf(qy));M|=ee}return Go(c,M,a,p,U)});function Hy(a,c,p){c=p?r:c;var M=Go(a,P,r,r,r,r,r,c);return M.placeholder=Hy.placeholder,M}o(Hy,"curry");function zy(a,c,p){c=p?r:c;var M=Go(a,J,r,r,r,r,r,c);return M.placeholder=zy.placeholder,M}o(zy,"curryRight");function jy(a,c,p){var M,U,K,re,ce,be,Te=0,Ce=!1,De=!1,Le=!0;if(typeof a!="function")throw new hi(i);c=gi(c)||0,ur(p)&&(Ce=!!p.leading,De="maxWait"in p,K=De?Ar(gi(p.maxWait)||0,c):K,Le="trailing"in p?!!p.trailing:Le);function Ke(yr){var Ui=M,Zo=U;return M=U=r,Te=yr,re=a.apply(Zo,Ui),re}o(Ke,"invokeFunc");function et(yr){return Te=yr,ce=Su(It,c),Ce?Ke(yr):re}o(et,"leadingEdge");function St(yr){var Ui=yr-be,Zo=yr-Te,c3=c-Ui;return De?Wr(c3,K-Zo):c3}o(St,"remainingWait");function tt(yr){var Ui=yr-be,Zo=yr-Te;return be===r||Ui>=c||Ui<0||De&&Zo>=K}o(tt,"shouldInvoke");function It(){var yr=Ph();if(tt(yr))return Nt(yr);ce=Su(It,St(yr))}o(It,"timerExpired");function Nt(yr){return ce=r,Le&&M?Ke(yr):(M=U=r,re)}o(Nt,"trailingEdge");function qn(){ce!==r&&ey(ce),Te=0,M=be=U=ce=r}o(qn,"cancel");function un(){return ce===r?re:Nt(Ph())}o(un,"flush");function Hn(){var yr=Ph(),Ui=tt(yr);if(M=arguments,U=this,be=yr,Ui){if(ce===r)return et(be);if(De)return ey(ce),ce=Su(It,c),Ke(be)}return ce===r&&(ce=Su(It,c)),re}return o(Hn,"debounced"),Hn.cancel=qn,Hn.flush=un,Hn}o(jy,"debounce");var wC=Ct(function(a,c){return O2(a,1,c)}),_C=Ct(function(a,c,p){return O2(a,gi(c)||0,p)});function EC(a){return Go(a,H)}o(EC,"flip");function Bh(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new hi(i);var p=o(function(){var M=arguments,U=c?c.apply(this,M):M[0],K=p.cache;if(K.has(U))return K.get(U);var re=a.apply(this,M);return p.cache=K.set(U,re)||K,re},"memoized");return p.cache=new(Bh.Cache||Ko),p}o(Bh,"memoize"),Bh.Cache=Ko;function Lh(a){if(typeof a!="function")throw new hi(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(Lh,"negate");function AC(a){return $y(2,a)}o(AC,"once");var SC=lM(function(a,c){c=c.length==1&&wt(c[0])?cr(c[0],Un(Ze())):cr($r(c,1),Un(Ze()));var p=c.length;return Ct(function(M){for(var U=-1,K=Wr(M.length,p);++U<K;)M[U]=c[U].call(this,M[U]);return Ln(a,this,M)})}),Cm=Ct(function(a,c){var p=Cs(c,Wf(Cm));return Go(a,ee,r,c,p)}),Ky=Ct(function(a,c){var p=Cs(c,Wf(Ky));return Go(a,X,r,c,p)}),MC=Wo(function(a,c){return Go(a,V,r,r,r,c)});function TC(a,c){if(typeof a!="function")throw new hi(i);return c=c===r?c:At(c),Ct(a,c)}o(TC,"rest");function CC(a,c){if(typeof a!="function")throw new hi(i);return c=c==null?0:Ar(At(c),0),Ct(function(p){var M=p[c],U=Ns(p,0,c);return M&&Ts(U,M),Ln(a,this,U)})}o(CC,"spread");function kC(a,c,p){var M=!0,U=!0;if(typeof a!="function")throw new hi(i);return ur(p)&&(M="leading"in p?!!p.leading:M,U="trailing"in p?!!p.trailing:U),jy(a,c,{leading:M,maxWait:c,trailing:U})}o(kC,"throttle");function IC(a){return Fy(a,1)}o(IC,"unary");function DC(a,c){return Cm(hm(c),a)}o(DC,"wrap");function RC(){if(!arguments.length)return[];var a=arguments[0];return wt(a)?a:[a]}o(RC,"castArray");function OC(a){return pi(a,E)}o(OC,"clone");function NC(a,c){return c=typeof c=="function"?c:r,pi(a,E,c)}o(NC,"cloneWith");function PC(a){return pi(a,v|E)}o(PC,"cloneDeep");function BC(a,c){return c=typeof c=="function"?c:r,pi(a,v|E,c)}o(BC,"cloneDeepWith");function LC(a,c){return c==null||R2(a,c,kr(c))}o(LC,"conformsTo");function Li(a,c){return a===c||a!==a&&c!==c}o(Li,"eq");var UC=kh(em),FC=kh(function(a,c){return a>=c}),Pa=U2(function(){return arguments}())?U2:function(a){return lr(a)&&Jt.call(a,"callee")&&!A2.call(a,"callee")},wt=xe.isArray,$C=o2?Un(o2):WS;function xn(a){return a!=null&&Uh(a.length)&&!Yo(a)}o(xn,"isArrayLike");function vr(a){return lr(a)&&xn(a)}o(vr,"isArrayLikeObject");function qC(a){return a===!0||a===!1||lr(a)&&fn(a)==Q}o(qC,"isBoolean");var Ps=tS||Fm,HC=s2?Un(s2):JS;function zC(a){return lr(a)&&a.nodeType===1&&!Mu(a)}o(zC,"isElement");function jC(a){if(a==null)return!0;if(xn(a)&&(wt(a)||typeof a=="string"||typeof a.splice=="function"||Ps(a)||Jf(a)||Pa(a)))return!a.length;var c=Jr(a);if(c==ae||c==W)return!a.size;if(Au(a))return!nm(a).length;for(var p in a)if(Jt.call(a,p))return!1;return!0}o(jC,"isEmpty");function KC(a,c){return wu(a,c)}o(KC,"isEqual");function VC(a,c,p){p=typeof p=="function"?p:r;var M=p?p(a,c):r;return M===r?wu(a,c,r,p):!!M}o(VC,"isEqualWith");function km(a){if(!lr(a))return!1;var c=fn(a);return c==j||c==q||typeof a.message=="string"&&typeof a.name=="string"&&!Mu(a)}o(km,"isError");function GC(a){return typeof a=="number"&&M2(a)}o(GC,"isFinite");function Yo(a){if(!ur(a))return!1;var c=fn(a);return c==G||c==te||c==D||c==ue}o(Yo,"isFunction");function Vy(a){return typeof a=="number"&&a==At(a)}o(Vy,"isInteger");function Uh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=_}o(Uh,"isLength");function ur(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}o(ur,"isObject");function lr(a){return a!=null&&typeof a=="object"}o(lr,"isObjectLike");var Gy=a2?Un(a2):XS;function WC(a,c){return a===c||rm(a,c,ym(c))}o(WC,"isMatch");function JC(a,c,p){return p=typeof p=="function"?p:r,rm(a,c,ym(c),p)}o(JC,"isMatchWith");function YC(a){return Wy(a)&&a!=+a}o(YC,"isNaN");function XC(a){if(NM(a))throw new xt(n);return F2(a)}o(XC,"isNative");function ZC(a){return a===null}o(ZC,"isNull");function QC(a){return a==null}o(QC,"isNil");function Wy(a){return typeof a=="number"||lr(a)&&fn(a)==Ae}o(Wy,"isNumber");function Mu(a){if(!lr(a)||fn(a)!=ie)return!1;var c=lh(a);if(c===null)return!0;var p=Jt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&ah.call(p)==J7}o(Mu,"isPlainObject");var Im=f2?Un(f2):ZS;function ek(a){return Vy(a)&&a>=-_&&a<=_}o(ek,"isSafeInteger");var Jy=c2?Un(c2):QS;function Fh(a){return typeof a=="string"||!wt(a)&&lr(a)&&fn(a)==pe}o(Fh,"isString");function $n(a){return typeof a=="symbol"||lr(a)&&fn(a)==ke}o($n,"isSymbol");var Jf=u2?Un(u2):eM;function tk(a){return a===r}o(tk,"isUndefined");function rk(a){return lr(a)&&Jr(a)==Pe}o(rk,"isWeakMap");function nk(a){return lr(a)&&fn(a)==Je}o(nk,"isWeakSet");var ik=kh(im),ok=kh(function(a,c){return a<=c});function Yy(a){if(!a)return[];if(xn(a))return Fh(a)?Pi(a):yn(a);if(du&&a[du])return L7(a[du]());var c=Jr(a),p=c==ae?Kp:c==W?ih:Yf;return p(a)}o(Yy,"toArray");function Xo(a){if(!a)return a===0?a:0;if(a=gi(a),a===m||a===-m){var c=a<0?-1:1;return c*S}return a===a?a:0}o(Xo,"toFinite");function At(a){var c=Xo(a),p=c%1;return c===c?p?c-p:c:0}o(At,"toInteger");function Xy(a){return a?Da(At(a),0,y):0}o(Xy,"toLength");function gi(a){if(typeof a=="number")return a;if($n(a))return A;if(ur(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=ur(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=b2(a);var p=qt.test(a);return p||mn.test(a)?x7(a.slice(2),p?2:8):Bn.test(a)?A:+a}o(gi,"toNumber");function Zy(a){return ho(a,wn(a))}o(Zy,"toPlainObject");function sk(a){return a?Da(At(a),-_,_):a===0?a:0}o(sk,"toSafeInteger");function Kt(a){return a==null?"":Fn(a)}o(Kt,"toString");var ak=Vf(function(a,c){if(Au(c)||xn(c)){ho(c,kr(c),a);return}for(var p in c)Jt.call(c,p)&&vu(a,p,c[p])}),Qy=Vf(function(a,c){ho(c,wn(c),a)}),$h=Vf(function(a,c,p,M){ho(c,wn(c),a,M)}),fk=Vf(function(a,c,p,M){ho(c,kr(c),a,M)}),ck=Wo(Xp);function uk(a,c){var p=Kf(a);return c==null?p:D2(p,c)}o(uk,"create");var lk=Ct(function(a,c){a=er(a);var p=-1,M=c.length,U=M>2?c[2]:r;for(U&&cn(c[0],c[1],U)&&(M=1);++p<M;)for(var K=c[p],re=wn(K),ce=-1,be=re.length;++ce<be;){var Te=re[ce],Ce=a[Te];(Ce===r||Li(Ce,Hf[Te])&&!Jt.call(a,Te))&&(a[Te]=K[Te])}return a}),hk=Ct(function(a){return a.push(r,by),Ln(e3,r,a)});function dk(a,c){return h2(a,Ze(c,3),lo)}o(dk,"findKey");function pk(a,c){return h2(a,Ze(c,3),Qp)}o(pk,"findLastKey");function mk(a,c){return a==null?a:Zp(a,Ze(c,3),wn)}o(mk,"forIn");function bk(a,c){return a==null?a:B2(a,Ze(c,3),wn)}o(bk,"forInRight");function gk(a,c){return a&&lo(a,Ze(c,3))}o(gk,"forOwn");function vk(a,c){return a&&Qp(a,Ze(c,3))}o(vk,"forOwnRight");function yk(a){return a==null?[]:wh(a,kr(a))}o(yk,"functions");function xk(a){return a==null?[]:wh(a,wn(a))}o(xk,"functionsIn");function Dm(a,c,p){var M=a==null?r:Ra(a,c);return M===r?p:M}o(Dm,"get");function wk(a,c){return a!=null&&yy(a,c,jS)}o(wk,"has");function Rm(a,c){return a!=null&&yy(a,c,KS)}o(Rm,"hasIn");var _k=ly(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=fh.call(c)),a[c]=p},Nm(_n)),Ek=ly(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=fh.call(c)),Jt.call(a,c)?a[c].push(p):a[c]=[p]},Ze),Ak=Ct(xu);function kr(a){return xn(a)?k2(a):nm(a)}o(kr,"keys");function wn(a){return xn(a)?k2(a,!0):tM(a)}o(wn,"keysIn");function Sk(a,c){var p={};return c=Ze(c,3),lo(a,function(M,U,K){Vo(p,c(M,U,K),M)}),p}o(Sk,"mapKeys");function Mk(a,c){var p={};return c=Ze(c,3),lo(a,function(M,U,K){Vo(p,U,c(M,U,K))}),p}o(Mk,"mapValues");var Tk=Vf(function(a,c,p){_h(a,c,p)}),e3=Vf(function(a,c,p,M){_h(a,c,p,M)}),Ck=Wo(function(a,c){var p={};if(a==null)return p;var M=!1;c=cr(c,function(K){return K=Os(K,a),M||(M=K.length>1),K}),ho(a,gm(a),p),M&&(p=pi(p,v|x|E,_M));for(var U=c.length;U--;)cm(p,c[U]);return p});function kk(a,c){return t3(a,Lh(Ze(c)))}o(kk,"omitBy");var Ik=Wo(function(a,c){return a==null?{}:nM(a,c)});function t3(a,c){if(a==null)return{};var p=cr(gm(a),function(M){return[M]});return c=Ze(c),V2(a,p,function(M,U){return c(M,U[0])})}o(t3,"pickBy");function Dk(a,c,p){c=Os(c,a);var M=-1,U=c.length;for(U||(U=1,a=r);++M<U;){var K=a==null?r:a[po(c[M])];K===r&&(M=U,K=p),a=Yo(K)?K.call(a):K}return a}o(Dk,"result");function Rk(a,c,p){return a==null?a:_u(a,c,p)}o(Rk,"set");function Ok(a,c,p,M){return M=typeof M=="function"?M:r,a==null?a:_u(a,c,p,M)}o(Ok,"setWith");var r3=py(kr),n3=py(wn);function Nk(a,c,p){var M=wt(a),U=M||Ps(a)||Jf(a);if(c=Ze(c,4),p==null){var K=a&&a.constructor;U?p=M?new K:[]:ur(a)?p=Yo(K)?Kf(lh(a)):{}:p={}}return(U?li:lo)(a,function(re,ce,be){return c(p,re,ce,be)}),p}o(Nk,"transform");function Pk(a,c){return a==null?!0:cm(a,c)}o(Pk,"unset");function Bk(a,c,p){return a==null?a:X2(a,c,hm(p))}o(Bk,"update");function Lk(a,c,p,M){return M=typeof M=="function"?M:r,a==null?a:X2(a,c,hm(p),M)}o(Lk,"updateWith");function Yf(a){return a==null?[]:jp(a,kr(a))}o(Yf,"values");function Uk(a){return a==null?[]:jp(a,wn(a))}o(Uk,"valuesIn");function Fk(a,c,p){return p===r&&(p=c,c=r),p!==r&&(p=gi(p),p=p===p?p:0),c!==r&&(c=gi(c),c=c===c?c:0),Da(gi(a),c,p)}o(Fk,"clamp");function $k(a,c,p){return c=Xo(c),p===r?(p=c,c=0):p=Xo(p),a=gi(a),VS(a,c,p)}o($k,"inRange");function qk(a,c,p){if(p&&typeof p!="boolean"&&cn(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=Xo(a),c===r?(c=a,a=0):c=Xo(c)),a>c){var M=a;a=c,c=M}if(p||a%1||c%1){var U=T2();return Wr(a+U*(c-a+y7("1e-"+((U+"").length-1))),c)}return sm(a,c)}o(qk,"random");var Hk=Gf(function(a,c,p){return c=c.toLowerCase(),a+(p?i3(c):c)});function i3(a){return Om(Kt(a).toLowerCase())}o(i3,"capitalize");function o3(a){return a=Kt(a),a&&a.replace(gn,R7).replace(c7,"")}o(o3,"deburr");function zk(a,c,p){a=Kt(a),c=Fn(c);var M=a.length;p=p===r?M:Da(At(p),0,M);var U=p;return p-=c.length,p>=0&&a.slice(p,U)==c}o(zk,"endsWith");function jk(a){return a=Kt(a),a&&at.test(a)?a.replace(Pn,O7):a}o(jk,"escape");function Kk(a){return a=Kt(a),a&&lt.test(a)?a.replace(pn,"\\$&"):a}o(Kk,"escapeRegExp");var Vk=Gf(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),Gk=Gf(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),Wk=fy("toLowerCase");function Jk(a,c,p){a=Kt(a),c=At(c);var M=c?qf(a):0;if(!c||M>=c)return a;var U=(c-M)/2;return Ch(mh(U),p)+a+Ch(ph(U),p)}o(Jk,"pad");function Yk(a,c,p){a=Kt(a),c=At(c);var M=c?qf(a):0;return c&&M<c?a+Ch(c-M,p):a}o(Yk,"padEnd");function Xk(a,c,p){a=Kt(a),c=At(c);var M=c?qf(a):0;return c&&M<c?Ch(c-M,p)+a:a}o(Xk,"padStart");function Zk(a,c,p){return p||c==null?c=0:c&&(c=+c),oS(Kt(a).replace(Qe,""),c||0)}o(Zk,"parseInt");function Qk(a,c,p){return(p?cn(a,c,p):c===r)?c=1:c=At(c),am(Kt(a),c)}o(Qk,"repeat");function eI(){var a=arguments,c=Kt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}o(eI,"replace");var tI=Gf(function(a,c,p){return a+(p?"_":"")+c.toLowerCase()});function rI(a,c,p){return p&&typeof p!="number"&&cn(a,c,p)&&(c=p=r),p=p===r?y:p>>>0,p?(a=Kt(a),a&&(typeof c=="string"||c!=null&&!Im(c))&&(c=Fn(c),!c&&$f(a))?Ns(Pi(a),0,p):a.split(c,p)):[]}o(rI,"split");var nI=Gf(function(a,c,p){return a+(p?" ":"")+Om(c)});function iI(a,c,p){return a=Kt(a),p=p==null?0:Da(At(p),0,a.length),c=Fn(c),a.slice(p,p+c.length)==c}o(iI,"startsWith");function oI(a,c,p){var M=$.templateSettings;p&&cn(a,c,p)&&(c=r),a=Kt(a),c=$h({},c,M,my);var U=$h({},c.imports,M.imports,my),K=kr(U),re=jp(U,K),ce,be,Te=0,Ce=c.interpolate||Fr,De="__p += '",Le=Vp((c.escape||Fr).source+"|"+Ce.source+"|"+(Ce===rt?bt:Fr).source+"|"+(c.evaluate||Fr).source+"|$","g"),Ke="//# sourceURL="+(Jt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++p7+"]")+`
4
- `;a.replace(Le,function(tt,It,Nt,qn,un,Hn){return Nt||(Nt=qn),De+=a.slice(Te,Hn).replace(vn,N7),It&&(ce=!0,De+=`' +
3
+ `)}o(NM,"insertWrapDetails");function PM(a){return wt(a)||Pa(a)||!!(M2&&a&&a[M2])}o(PM,"isFlattenable");function Jo(a,c){var p=typeof a;return c=c??_,!!c&&(p=="number"||p!="symbol"&&bn.test(a))&&a>-1&&a%1==0&&a<c}o(Jo,"isIndex");function cn(a,c,p){if(!ur(p))return!1;var T=typeof c;return(T=="number"?xn(p)&&Jo(c,p.length):T=="string"&&c in p)?Li(p[c],a):!1}o(cn,"isIterateeCall");function Em(a,c){if(wt(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||$n(a)?!0:ct.test(a)||!oi.test(a)||c!=null&&a in er(c)}o(Em,"isKey");function BM(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}o(BM,"isKeyable");function Am(a){var c=Dh(a),p=$[c];if(typeof p!="function"||!(c in Ot.prototype))return!1;if(a===p)return!0;var T=xm(p);return!!T&&a===T[0]}o(Am,"isLaziable");function LM(a){return!!_2&&_2 in a}o(LM,"isMasked");var UM=ah?Yo:qm;function Su(a){var c=a&&a.constructor,p=typeof c=="function"&&c.prototype||Hf;return a===p}o(Su,"isPrototype");function _y(a){return a===a&&!ur(a)}o(_y,"isStrictComparable");function Ey(a,c){return function(p){return p==null?!1:p[a]===c&&(c!==r||a in er(p))}}o(Ey,"matchesStrictComparable");function FM(a){var c=Lh(a,function(T){return p.size===u&&p.clear(),T}),p=c.cache;return c}o(FM,"memoizeCapped");function $M(a,c){var p=a[1],T=c[1],U=p|T,K=U<(I|B|ne),re=T==ne&&p==P||T==ne&&p==V&&a[7].length<=c[8]||T==(ne|V)&&c[7].length<=c[8]&&p==P;if(!(K||re))return a;T&I&&(a[2]=c[2],U|=p&I?0:Y);var ce=c[3];if(ce){var be=a[3];a[3]=be?oy(be,ce,c[4]):ce,a[4]=be?Cs(a[3],d):c[4]}return ce=c[5],ce&&(be=a[5],a[5]=be?sy(be,ce,c[6]):ce,a[6]=be?Cs(a[5],d):c[6]),ce=c[7],ce&&(a[7]=ce),T&ne&&(a[8]=a[8]==null?c[8]:Wr(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=U,a}o($M,"mergeData");function qM(a){var c=[];if(a!=null)for(var p in er(a))c.push(p);return c}o(qM,"nativeKeysIn");function HM(a){return ch.call(a)}o(HM,"objectToString");function Ay(a,c,p){return c=Ar(c===r?a.length-1:c,0),function(){for(var T=arguments,U=-1,K=Ar(T.length-c,0),re=xe(K);++U<K;)re[U]=T[c+U];U=-1;for(var ce=xe(c+1);++U<c;)ce[U]=T[U];return ce[c]=p(re),Ln(a,this,ce)}}o(Ay,"overRest");function Sy(a,c){return c.length<2?a:Ra(a,mi(c,0,-1))}o(Sy,"parent");function zM(a,c){for(var p=a.length,T=Wr(c.length,p),U=yn(a);T--;){var K=c[T];a[T]=Jo(K,p)?U[K]:r}return a}o(zM,"reorder");function Sm(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}o(Sm,"safeGet");var My=Cy(J2),Mu=iS||function(a,c){return Cr.setTimeout(a,c)},Mm=Cy(hM);function Ty(a,c,p){var T=c+"";return Mm(a,NM(T,jM(DM(T),p)))}o(Ty,"setWrapToString");function Cy(a){var c=0,p=0;return function(){var T=fS(),U=h-(T-p);if(p=T,U>0){if(++c>=L)return arguments[0]}else c=0;return a.apply(r,arguments)}}o(Cy,"shortOut");function Oh(a,c){var p=-1,T=a.length,U=T-1;for(c=c===r?T:c;++p<c;){var K=fm(p,U),re=a[K];a[K]=a[p],a[p]=re}return a.length=c,a}o(Oh,"shuffleSelf");var ky=FM(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(ut,function(p,T,U,K){c.push(U?K.replace(fi,"$1"):T||p)}),c});function po(a){if(typeof a=="string"||$n(a))return a;var c=a+"";return c=="0"&&1/a==-m?"-0":c}o(po,"toKey");function Na(a){if(a!=null){try{return fh.call(a)}catch{}try{return a+""}catch{}}return""}o(Na,"toSource");function jM(a,c){return li(w,function(p){var T="_."+p[0];c&p[1]&&!nh(a,T)&&a.push(T)}),a.sort()}o(jM,"updateWrapDetails");function Iy(a){if(a instanceof Ot)return a.clone();var c=new di(a.__wrapped__,a.__chain__);return c.__actions__=yn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}o(Iy,"wrapperClone");function KM(a,c,p){(p?cn(a,c,p):c===r)?c=1:c=Ar(At(c),0);var T=a==null?0:a.length;if(!T||c<1)return[];for(var U=0,K=0,re=xe(mh(T/c));U<T;)re[K++]=mi(a,U,U+=c);return re}o(KM,"chunk");function VM(a){for(var c=-1,p=a==null?0:a.length,T=0,U=[];++c<p;){var K=a[c];K&&(U[T++]=K)}return U}o(VM,"compact");function GM(){var a=arguments.length;if(!a)return[];for(var c=xe(a-1),p=arguments[0],T=a;T--;)c[T-1]=arguments[T];return Ts(wt(p)?yn(p):[p],$r(c,1))}o(GM,"concat");var WM=Ct(function(a,c){return vr(a)?xu(a,$r(c,1,vr,!0)):[]}),JM=Ct(function(a,c){var p=bi(c);return vr(p)&&(p=r),vr(a)?xu(a,$r(c,1,vr,!0),Ze(p,2)):[]}),YM=Ct(function(a,c){var p=bi(c);return vr(p)&&(p=r),vr(a)?xu(a,$r(c,1,vr,!0),r,p):[]});function XM(a,c,p){var T=a==null?0:a.length;return T?(c=p||c===r?1:At(c),mi(a,c<0?0:c,T)):[]}o(XM,"drop");function ZM(a,c,p){var T=a==null?0:a.length;return T?(c=p||c===r?1:At(c),c=T-c,mi(a,0,c<0?0:c)):[]}o(ZM,"dropRight");function QM(a,c){return a&&a.length?Sh(a,Ze(c,3),!0,!0):[]}o(QM,"dropRightWhile");function eT(a,c){return a&&a.length?Sh(a,Ze(c,3),!0):[]}o(eT,"dropWhile");function tT(a,c,p,T){var U=a==null?0:a.length;return U?(p&&typeof p!="number"&&cn(a,c,p)&&(p=0,T=U),GS(a,c,p,T)):[]}o(tT,"fill");function Dy(a,c,p){var T=a==null?0:a.length;if(!T)return-1;var U=p==null?0:At(p);return U<0&&(U=Ar(T+U,0)),ih(a,Ze(c,3),U)}o(Dy,"findIndex");function Ry(a,c,p){var T=a==null?0:a.length;if(!T)return-1;var U=T-1;return p!==r&&(U=At(p),U=p<0?Ar(T+U,0):Wr(U,T-1)),ih(a,Ze(c,3),U,!0)}o(Ry,"findLastIndex");function Oy(a){var c=a==null?0:a.length;return c?$r(a,1):[]}o(Oy,"flatten");function rT(a){var c=a==null?0:a.length;return c?$r(a,m):[]}o(rT,"flattenDeep");function nT(a,c){var p=a==null?0:a.length;return p?(c=c===r?1:At(c),$r(a,c)):[]}o(nT,"flattenDepth");function iT(a){for(var c=-1,p=a==null?0:a.length,T={};++c<p;){var U=a[c];T[U[0]]=U[1]}return T}o(iT,"fromPairs");function Ny(a){return a&&a.length?a[0]:r}o(Ny,"head");function oT(a,c,p){var T=a==null?0:a.length;if(!T)return-1;var U=p==null?0:At(p);return U<0&&(U=Ar(T+U,0)),Ff(a,c,U)}o(oT,"indexOf");function sT(a){var c=a==null?0:a.length;return c?mi(a,0,-1):[]}o(sT,"initial");var aT=Ct(function(a){var c=cr(a,dm);return c.length&&c[0]===a[0]?nm(c):[]}),fT=Ct(function(a){var c=bi(a),p=cr(a,dm);return c===bi(p)?c=r:p.pop(),p.length&&p[0]===a[0]?nm(p,Ze(c,2)):[]}),cT=Ct(function(a){var c=bi(a),p=cr(a,dm);return c=typeof c=="function"?c:r,c&&p.pop(),p.length&&p[0]===a[0]?nm(p,r,c):[]});function uT(a,c){return a==null?"":sS.call(a,c)}o(uT,"join");function bi(a){var c=a==null?0:a.length;return c?a[c-1]:r}o(bi,"last");function lT(a,c,p){var T=a==null?0:a.length;if(!T)return-1;var U=T;return p!==r&&(U=At(p),U=U<0?Ar(T+U,0):Wr(U,T-1)),c===c?j7(a,c,U):ih(a,p2,U,!0)}o(lT,"lastIndexOf");function hT(a,c){return a&&a.length?K2(a,At(c)):r}o(hT,"nth");var dT=Ct(Py);function Py(a,c){return a&&a.length&&c&&c.length?am(a,c):a}o(Py,"pullAll");function pT(a,c,p){return a&&a.length&&c&&c.length?am(a,c,Ze(p,2)):a}o(pT,"pullAllBy");function mT(a,c,p){return a&&a.length&&c&&c.length?am(a,c,r,p):a}o(mT,"pullAllWith");var bT=Wo(function(a,c){var p=a==null?0:a.length,T=Qp(a,c);return W2(a,cr(c,function(U){return Jo(U,p)?+U:U}).sort(iy)),T});function gT(a,c){var p=[];if(!(a&&a.length))return p;var T=-1,U=[],K=a.length;for(c=Ze(c,3);++T<K;){var re=a[T];c(re,T,a)&&(p.push(re),U.push(T))}return W2(a,U),p}o(gT,"remove");function Tm(a){return a==null?a:uS.call(a)}o(Tm,"reverse");function vT(a,c,p){var T=a==null?0:a.length;return T?(p&&typeof p!="number"&&cn(a,c,p)?(c=0,p=T):(c=c==null?0:At(c),p=p===r?T:At(p)),mi(a,c,p)):[]}o(vT,"slice");function yT(a,c){return Ah(a,c)}o(yT,"sortedIndex");function xT(a,c,p){return um(a,c,Ze(p,2))}o(xT,"sortedIndexBy");function wT(a,c){var p=a==null?0:a.length;if(p){var T=Ah(a,c);if(T<p&&Li(a[T],c))return T}return-1}o(wT,"sortedIndexOf");function _T(a,c){return Ah(a,c,!0)}o(_T,"sortedLastIndex");function ET(a,c,p){return um(a,c,Ze(p,2),!0)}o(ET,"sortedLastIndexBy");function AT(a,c){var p=a==null?0:a.length;if(p){var T=Ah(a,c,!0)-1;if(Li(a[T],c))return T}return-1}o(AT,"sortedLastIndexOf");function ST(a){return a&&a.length?Y2(a):[]}o(ST,"sortedUniq");function MT(a,c){return a&&a.length?Y2(a,Ze(c,2)):[]}o(MT,"sortedUniqBy");function TT(a){var c=a==null?0:a.length;return c?mi(a,1,c):[]}o(TT,"tail");function CT(a,c,p){return a&&a.length?(c=p||c===r?1:At(c),mi(a,0,c<0?0:c)):[]}o(CT,"take");function kT(a,c,p){var T=a==null?0:a.length;return T?(c=p||c===r?1:At(c),c=T-c,mi(a,c<0?0:c,T)):[]}o(kT,"takeRight");function IT(a,c){return a&&a.length?Sh(a,Ze(c,3),!1,!0):[]}o(IT,"takeRightWhile");function DT(a,c){return a&&a.length?Sh(a,Ze(c,3)):[]}o(DT,"takeWhile");var RT=Ct(function(a){return Rs($r(a,1,vr,!0))}),OT=Ct(function(a){var c=bi(a);return vr(c)&&(c=r),Rs($r(a,1,vr,!0),Ze(c,2))}),NT=Ct(function(a){var c=bi(a);return c=typeof c=="function"?c:r,Rs($r(a,1,vr,!0),r,c)});function PT(a){return a&&a.length?Rs(a):[]}o(PT,"uniq");function BT(a,c){return a&&a.length?Rs(a,Ze(c,2)):[]}o(BT,"uniqBy");function LT(a,c){return c=typeof c=="function"?c:r,a&&a.length?Rs(a,r,c):[]}o(LT,"uniqWith");function Cm(a){if(!(a&&a.length))return[];var c=0;return a=Ms(a,function(p){if(vr(p))return c=Ar(p.length,c),!0}),Kp(c,function(p){return cr(a,Hp(p))})}o(Cm,"unzip");function By(a,c){if(!(a&&a.length))return[];var p=Cm(a);return c==null?p:cr(p,function(T){return Ln(c,r,T)})}o(By,"unzipWith");var UT=Ct(function(a,c){return vr(a)?xu(a,c):[]}),FT=Ct(function(a){return hm(Ms(a,vr))}),$T=Ct(function(a){var c=bi(a);return vr(c)&&(c=r),hm(Ms(a,vr),Ze(c,2))}),qT=Ct(function(a){var c=bi(a);return c=typeof c=="function"?c:r,hm(Ms(a,vr),r,c)}),HT=Ct(Cm);function zT(a,c){return ey(a||[],c||[],yu)}o(zT,"zipObject");function jT(a,c){return ey(a||[],c||[],Eu)}o(jT,"zipObjectDeep");var KT=Ct(function(a){var c=a.length,p=c>1?a[c-1]:r;return p=typeof p=="function"?(a.pop(),p):r,By(a,p)});function Ly(a){var c=$(a);return c.__chain__=!0,c}o(Ly,"chain");function VT(a,c){return c(a),a}o(VT,"tap");function Nh(a,c){return c(a)}o(Nh,"thru");var GT=Wo(function(a){var c=a.length,p=c?a[0]:0,T=this.__wrapped__,U=o(function(K){return Qp(K,a)},"interceptor");return c>1||this.__actions__.length||!(T instanceof Ot)||!Jo(p)?this.thru(U):(T=T.slice(p,+p+(c?1:0)),T.__actions__.push({func:Nh,args:[U],thisArg:r}),new di(T,this.__chain__).thru(function(K){return c&&!K.length&&K.push(r),K}))});function WT(){return Ly(this)}o(WT,"wrapperChain");function JT(){return new di(this.value(),this.__chain__)}o(JT,"wrapperCommit");function YT(){this.__values__===r&&(this.__values__=Xy(this.value()));var a=this.__index__>=this.__values__.length,c=a?r:this.__values__[this.__index__++];return{done:a,value:c}}o(YT,"wrapperNext");function XT(){return this}o(XT,"wrapperToIterator");function ZT(a){for(var c,p=this;p instanceof yh;){var T=Iy(p);T.__index__=0,T.__values__=r,c?U.__wrapped__=T:c=T;var U=T;p=p.__wrapped__}return U.__wrapped__=a,c}o(ZT,"wrapperPlant");function QT(){var a=this.__wrapped__;if(a instanceof Ot){var c=a;return this.__actions__.length&&(c=new Ot(this)),c=c.reverse(),c.__actions__.push({func:Nh,args:[Tm],thisArg:r}),new di(c,this.__chain__)}return this.thru(Tm)}o(QT,"wrapperReverse");function eC(){return Q2(this.__wrapped__,this.__actions__)}o(eC,"wrapperValue");var tC=Mh(function(a,c,p){Jt.call(a,p)?++a[p]:Vo(a,p,1)});function rC(a,c,p){var T=wt(a)?h2:VS;return p&&cn(a,c,p)&&(c=r),T(a,Ze(c,3))}o(rC,"every");function nC(a,c){var p=wt(a)?Ms:B2;return p(a,Ze(c,3))}o(nC,"filter");var iC=uy(Dy),oC=uy(Ry);function sC(a,c){return $r(Ph(a,c),1)}o(sC,"flatMap");function aC(a,c){return $r(Ph(a,c),m)}o(aC,"flatMapDeep");function fC(a,c,p){return p=p===r?1:At(p),$r(Ph(a,c),p)}o(fC,"flatMapDepth");function Uy(a,c){var p=wt(a)?li:Ds;return p(a,Ze(c,3))}o(Uy,"forEach");function Fy(a,c){var p=wt(a)?T7:P2;return p(a,Ze(c,3))}o(Fy,"forEachRight");var cC=Mh(function(a,c,p){Jt.call(a,p)?a[p].push(c):Vo(a,p,[c])});function uC(a,c,p,T){a=xn(a)?a:Yf(a),p=p&&!T?At(p):0;var U=a.length;return p<0&&(p=Ar(U+p,0)),$h(a)?p<=U&&a.indexOf(c,p)>-1:!!U&&Ff(a,c,p)>-1}o(uC,"includes");var lC=Ct(function(a,c,p){var T=-1,U=typeof c=="function",K=xn(a)?xe(a.length):[];return Ds(a,function(re){K[++T]=U?Ln(c,re,p):wu(re,c,p)}),K}),hC=Mh(function(a,c,p){Vo(a,p,c)});function Ph(a,c){var p=wt(a)?cr:H2;return p(a,Ze(c,3))}o(Ph,"map");function dC(a,c,p,T){return a==null?[]:(wt(c)||(c=c==null?[]:[c]),p=T?r:p,wt(p)||(p=p==null?[]:[p]),V2(a,c,p))}o(dC,"orderBy");var pC=Mh(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function mC(a,c,p){var T=wt(a)?$p:b2,U=arguments.length<3;return T(a,Ze(c,4),p,U,Ds)}o(mC,"reduce");function bC(a,c,p){var T=wt(a)?C7:b2,U=arguments.length<3;return T(a,Ze(c,4),p,U,P2)}o(bC,"reduceRight");function gC(a,c){var p=wt(a)?Ms:B2;return p(a,Uh(Ze(c,3)))}o(gC,"reject");function vC(a){var c=wt(a)?D2:uM;return c(a)}o(vC,"sample");function yC(a,c,p){(p?cn(a,c,p):c===r)?c=1:c=At(c);var T=wt(a)?qS:lM;return T(a,c)}o(yC,"sampleSize");function xC(a){var c=wt(a)?HS:dM;return c(a)}o(xC,"shuffle");function wC(a){if(a==null)return 0;if(xn(a))return $h(a)?qf(a):a.length;var c=Jr(a);return c==ae||c==W?a.size:om(a).length}o(wC,"size");function _C(a,c,p){var T=wt(a)?qp:pM;return p&&cn(a,c,p)&&(c=r),T(a,Ze(c,3))}o(_C,"some");var EC=Ct(function(a,c){if(a==null)return[];var p=c.length;return p>1&&cn(a,c[0],c[1])?c=[]:p>2&&cn(c[0],c[1],c[2])&&(c=[c[0]]),V2(a,$r(c,1),[])}),Bh=nS||function(){return Cr.Date.now()};function AC(a,c){if(typeof c!="function")throw new hi(i);return a=At(a),function(){if(--a<1)return c.apply(this,arguments)}}o(AC,"after");function $y(a,c,p){return c=p?r:c,c=a&&c==null?a.length:c,Go(a,ne,r,r,r,r,c)}o($y,"ary");function qy(a,c){var p;if(typeof c!="function")throw new hi(i);return a=At(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=r),p}}o(qy,"before");var km=Ct(function(a,c,p){var T=I;if(p.length){var U=Cs(p,Wf(km));T|=ee}return Go(a,T,c,p,U)}),Hy=Ct(function(a,c,p){var T=I|B;if(p.length){var U=Cs(p,Wf(Hy));T|=ee}return Go(c,T,a,p,U)});function zy(a,c,p){c=p?r:c;var T=Go(a,P,r,r,r,r,r,c);return T.placeholder=zy.placeholder,T}o(zy,"curry");function jy(a,c,p){c=p?r:c;var T=Go(a,J,r,r,r,r,r,c);return T.placeholder=jy.placeholder,T}o(jy,"curryRight");function Ky(a,c,p){var T,U,K,re,ce,be,Te=0,Ce=!1,De=!1,Le=!0;if(typeof a!="function")throw new hi(i);c=gi(c)||0,ur(p)&&(Ce=!!p.leading,De="maxWait"in p,K=De?Ar(gi(p.maxWait)||0,c):K,Le="trailing"in p?!!p.trailing:Le);function Ke(yr){var Ui=T,Zo=U;return T=U=r,Te=yr,re=a.apply(Zo,Ui),re}o(Ke,"invokeFunc");function et(yr){return Te=yr,ce=Mu(It,c),Ce?Ke(yr):re}o(et,"leadingEdge");function St(yr){var Ui=yr-be,Zo=yr-Te,u3=c-Ui;return De?Wr(u3,K-Zo):u3}o(St,"remainingWait");function tt(yr){var Ui=yr-be,Zo=yr-Te;return be===r||Ui>=c||Ui<0||De&&Zo>=K}o(tt,"shouldInvoke");function It(){var yr=Bh();if(tt(yr))return Nt(yr);ce=Mu(It,St(yr))}o(It,"timerExpired");function Nt(yr){return ce=r,Le&&T?Ke(yr):(T=U=r,re)}o(Nt,"trailingEdge");function qn(){ce!==r&&ty(ce),Te=0,T=be=U=ce=r}o(qn,"cancel");function un(){return ce===r?re:Nt(Bh())}o(un,"flush");function Hn(){var yr=Bh(),Ui=tt(yr);if(T=arguments,U=this,be=yr,Ui){if(ce===r)return et(be);if(De)return ty(ce),ce=Mu(It,c),Ke(be)}return ce===r&&(ce=Mu(It,c)),re}return o(Hn,"debounced"),Hn.cancel=qn,Hn.flush=un,Hn}o(Ky,"debounce");var SC=Ct(function(a,c){return N2(a,1,c)}),MC=Ct(function(a,c,p){return N2(a,gi(c)||0,p)});function TC(a){return Go(a,H)}o(TC,"flip");function Lh(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new hi(i);var p=o(function(){var T=arguments,U=c?c.apply(this,T):T[0],K=p.cache;if(K.has(U))return K.get(U);var re=a.apply(this,T);return p.cache=K.set(U,re)||K,re},"memoized");return p.cache=new(Lh.Cache||Ko),p}o(Lh,"memoize"),Lh.Cache=Ko;function Uh(a){if(typeof a!="function")throw new hi(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(Uh,"negate");function CC(a){return qy(2,a)}o(CC,"once");var kC=mM(function(a,c){c=c.length==1&&wt(c[0])?cr(c[0],Un(Ze())):cr($r(c,1),Un(Ze()));var p=c.length;return Ct(function(T){for(var U=-1,K=Wr(T.length,p);++U<K;)T[U]=c[U].call(this,T[U]);return Ln(a,this,T)})}),Im=Ct(function(a,c){var p=Cs(c,Wf(Im));return Go(a,ee,r,c,p)}),Vy=Ct(function(a,c){var p=Cs(c,Wf(Vy));return Go(a,X,r,c,p)}),IC=Wo(function(a,c){return Go(a,V,r,r,r,c)});function DC(a,c){if(typeof a!="function")throw new hi(i);return c=c===r?c:At(c),Ct(a,c)}o(DC,"rest");function RC(a,c){if(typeof a!="function")throw new hi(i);return c=c==null?0:Ar(At(c),0),Ct(function(p){var T=p[c],U=Ns(p,0,c);return T&&Ts(U,T),Ln(a,this,U)})}o(RC,"spread");function OC(a,c,p){var T=!0,U=!0;if(typeof a!="function")throw new hi(i);return ur(p)&&(T="leading"in p?!!p.leading:T,U="trailing"in p?!!p.trailing:U),Ky(a,c,{leading:T,maxWait:c,trailing:U})}o(OC,"throttle");function NC(a){return $y(a,1)}o(NC,"unary");function PC(a,c){return Im(pm(c),a)}o(PC,"wrap");function BC(){if(!arguments.length)return[];var a=arguments[0];return wt(a)?a:[a]}o(BC,"castArray");function LC(a){return pi(a,E)}o(LC,"clone");function UC(a,c){return c=typeof c=="function"?c:r,pi(a,E,c)}o(UC,"cloneWith");function FC(a){return pi(a,v|E)}o(FC,"cloneDeep");function $C(a,c){return c=typeof c=="function"?c:r,pi(a,v|E,c)}o($C,"cloneDeepWith");function qC(a,c){return c==null||O2(a,c,kr(c))}o(qC,"conformsTo");function Li(a,c){return a===c||a!==a&&c!==c}o(Li,"eq");var HC=Ih(rm),zC=Ih(function(a,c){return a>=c}),Pa=F2(function(){return arguments}())?F2:function(a){return lr(a)&&Jt.call(a,"callee")&&!S2.call(a,"callee")},wt=xe.isArray,jC=s2?Un(s2):ZS;function xn(a){return a!=null&&Fh(a.length)&&!Yo(a)}o(xn,"isArrayLike");function vr(a){return lr(a)&&xn(a)}o(vr,"isArrayLikeObject");function KC(a){return a===!0||a===!1||lr(a)&&fn(a)==Q}o(KC,"isBoolean");var Ps=oS||qm,VC=a2?Un(a2):QS;function GC(a){return lr(a)&&a.nodeType===1&&!Tu(a)}o(GC,"isElement");function WC(a){if(a==null)return!0;if(xn(a)&&(wt(a)||typeof a=="string"||typeof a.splice=="function"||Ps(a)||Jf(a)||Pa(a)))return!a.length;var c=Jr(a);if(c==ae||c==W)return!a.size;if(Su(a))return!om(a).length;for(var p in a)if(Jt.call(a,p))return!1;return!0}o(WC,"isEmpty");function JC(a,c){return _u(a,c)}o(JC,"isEqual");function YC(a,c,p){p=typeof p=="function"?p:r;var T=p?p(a,c):r;return T===r?_u(a,c,r,p):!!T}o(YC,"isEqualWith");function Dm(a){if(!lr(a))return!1;var c=fn(a);return c==j||c==q||typeof a.message=="string"&&typeof a.name=="string"&&!Tu(a)}o(Dm,"isError");function XC(a){return typeof a=="number"&&T2(a)}o(XC,"isFinite");function Yo(a){if(!ur(a))return!1;var c=fn(a);return c==G||c==te||c==D||c==ue}o(Yo,"isFunction");function Gy(a){return typeof a=="number"&&a==At(a)}o(Gy,"isInteger");function Fh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=_}o(Fh,"isLength");function ur(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}o(ur,"isObject");function lr(a){return a!=null&&typeof a=="object"}o(lr,"isObjectLike");var Wy=f2?Un(f2):tM;function ZC(a,c){return a===c||im(a,c,wm(c))}o(ZC,"isMatch");function QC(a,c,p){return p=typeof p=="function"?p:r,im(a,c,wm(c),p)}o(QC,"isMatchWith");function ek(a){return Jy(a)&&a!=+a}o(ek,"isNaN");function tk(a){if(UM(a))throw new xt(n);return $2(a)}o(tk,"isNative");function rk(a){return a===null}o(rk,"isNull");function nk(a){return a==null}o(nk,"isNil");function Jy(a){return typeof a=="number"||lr(a)&&fn(a)==Ae}o(Jy,"isNumber");function Tu(a){if(!lr(a)||fn(a)!=ie)return!1;var c=hh(a);if(c===null)return!0;var p=Jt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&fh.call(p)==Q7}o(Tu,"isPlainObject");var Rm=c2?Un(c2):rM;function ik(a){return Gy(a)&&a>=-_&&a<=_}o(ik,"isSafeInteger");var Yy=u2?Un(u2):nM;function $h(a){return typeof a=="string"||!wt(a)&&lr(a)&&fn(a)==pe}o($h,"isString");function $n(a){return typeof a=="symbol"||lr(a)&&fn(a)==ke}o($n,"isSymbol");var Jf=l2?Un(l2):iM;function ok(a){return a===r}o(ok,"isUndefined");function sk(a){return lr(a)&&Jr(a)==Pe}o(sk,"isWeakMap");function ak(a){return lr(a)&&fn(a)==Je}o(ak,"isWeakSet");var fk=Ih(sm),ck=Ih(function(a,c){return a<=c});function Xy(a){if(!a)return[];if(xn(a))return $h(a)?Pi(a):yn(a);if(pu&&a[pu])return q7(a[pu]());var c=Jr(a),p=c==ae?Gp:c==W?oh:Yf;return p(a)}o(Xy,"toArray");function Xo(a){if(!a)return a===0?a:0;if(a=gi(a),a===m||a===-m){var c=a<0?-1:1;return c*M}return a===a?a:0}o(Xo,"toFinite");function At(a){var c=Xo(a),p=c%1;return c===c?p?c-p:c:0}o(At,"toInteger");function Zy(a){return a?Da(At(a),0,y):0}o(Zy,"toLength");function gi(a){if(typeof a=="number")return a;if($n(a))return S;if(ur(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=ur(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=g2(a);var p=qt.test(a);return p||mn.test(a)?A7(a.slice(2),p?2:8):Bn.test(a)?S:+a}o(gi,"toNumber");function Qy(a){return ho(a,wn(a))}o(Qy,"toPlainObject");function uk(a){return a?Da(At(a),-_,_):a===0?a:0}o(uk,"toSafeInteger");function Kt(a){return a==null?"":Fn(a)}o(Kt,"toString");var lk=Vf(function(a,c){if(Su(c)||xn(c)){ho(c,kr(c),a);return}for(var p in c)Jt.call(c,p)&&yu(a,p,c[p])}),e3=Vf(function(a,c){ho(c,wn(c),a)}),qh=Vf(function(a,c,p,T){ho(c,wn(c),a,T)}),hk=Vf(function(a,c,p,T){ho(c,kr(c),a,T)}),dk=Wo(Qp);function pk(a,c){var p=Kf(a);return c==null?p:R2(p,c)}o(pk,"create");var mk=Ct(function(a,c){a=er(a);var p=-1,T=c.length,U=T>2?c[2]:r;for(U&&cn(c[0],c[1],U)&&(T=1);++p<T;)for(var K=c[p],re=wn(K),ce=-1,be=re.length;++ce<be;){var Te=re[ce],Ce=a[Te];(Ce===r||Li(Ce,Hf[Te])&&!Jt.call(a,Te))&&(a[Te]=K[Te])}return a}),bk=Ct(function(a){return a.push(r,gy),Ln(t3,r,a)});function gk(a,c){return d2(a,Ze(c,3),lo)}o(gk,"findKey");function vk(a,c){return d2(a,Ze(c,3),tm)}o(vk,"findLastKey");function yk(a,c){return a==null?a:em(a,Ze(c,3),wn)}o(yk,"forIn");function xk(a,c){return a==null?a:L2(a,Ze(c,3),wn)}o(xk,"forInRight");function wk(a,c){return a&&lo(a,Ze(c,3))}o(wk,"forOwn");function _k(a,c){return a&&tm(a,Ze(c,3))}o(_k,"forOwnRight");function Ek(a){return a==null?[]:_h(a,kr(a))}o(Ek,"functions");function Ak(a){return a==null?[]:_h(a,wn(a))}o(Ak,"functionsIn");function Om(a,c,p){var T=a==null?r:Ra(a,c);return T===r?p:T}o(Om,"get");function Sk(a,c){return a!=null&&xy(a,c,WS)}o(Sk,"has");function Nm(a,c){return a!=null&&xy(a,c,JS)}o(Nm,"hasIn");var Mk=hy(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=ch.call(c)),a[c]=p},Bm(_n)),Tk=hy(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=ch.call(c)),Jt.call(a,c)?a[c].push(p):a[c]=[p]},Ze),Ck=Ct(wu);function kr(a){return xn(a)?I2(a):om(a)}o(kr,"keys");function wn(a){return xn(a)?I2(a,!0):oM(a)}o(wn,"keysIn");function kk(a,c){var p={};return c=Ze(c,3),lo(a,function(T,U,K){Vo(p,c(T,U,K),T)}),p}o(kk,"mapKeys");function Ik(a,c){var p={};return c=Ze(c,3),lo(a,function(T,U,K){Vo(p,U,c(T,U,K))}),p}o(Ik,"mapValues");var Dk=Vf(function(a,c,p){Eh(a,c,p)}),t3=Vf(function(a,c,p,T){Eh(a,c,p,T)}),Rk=Wo(function(a,c){var p={};if(a==null)return p;var T=!1;c=cr(c,function(K){return K=Os(K,a),T||(T=K.length>1),K}),ho(a,ym(a),p),T&&(p=pi(p,v|x|E,MM));for(var U=c.length;U--;)lm(p,c[U]);return p});function Ok(a,c){return r3(a,Uh(Ze(c)))}o(Ok,"omitBy");var Nk=Wo(function(a,c){return a==null?{}:aM(a,c)});function r3(a,c){if(a==null)return{};var p=cr(ym(a),function(T){return[T]});return c=Ze(c),G2(a,p,function(T,U){return c(T,U[0])})}o(r3,"pickBy");function Pk(a,c,p){c=Os(c,a);var T=-1,U=c.length;for(U||(U=1,a=r);++T<U;){var K=a==null?r:a[po(c[T])];K===r&&(T=U,K=p),a=Yo(K)?K.call(a):K}return a}o(Pk,"result");function Bk(a,c,p){return a==null?a:Eu(a,c,p)}o(Bk,"set");function Lk(a,c,p,T){return T=typeof T=="function"?T:r,a==null?a:Eu(a,c,p,T)}o(Lk,"setWith");var n3=my(kr),i3=my(wn);function Uk(a,c,p){var T=wt(a),U=T||Ps(a)||Jf(a);if(c=Ze(c,4),p==null){var K=a&&a.constructor;U?p=T?new K:[]:ur(a)?p=Yo(K)?Kf(hh(a)):{}:p={}}return(U?li:lo)(a,function(re,ce,be){return c(p,re,ce,be)}),p}o(Uk,"transform");function Fk(a,c){return a==null?!0:lm(a,c)}o(Fk,"unset");function $k(a,c,p){return a==null?a:Z2(a,c,pm(p))}o($k,"update");function qk(a,c,p,T){return T=typeof T=="function"?T:r,a==null?a:Z2(a,c,pm(p),T)}o(qk,"updateWith");function Yf(a){return a==null?[]:Vp(a,kr(a))}o(Yf,"values");function Hk(a){return a==null?[]:Vp(a,wn(a))}o(Hk,"valuesIn");function zk(a,c,p){return p===r&&(p=c,c=r),p!==r&&(p=gi(p),p=p===p?p:0),c!==r&&(c=gi(c),c=c===c?c:0),Da(gi(a),c,p)}o(zk,"clamp");function jk(a,c,p){return c=Xo(c),p===r?(p=c,c=0):p=Xo(p),a=gi(a),YS(a,c,p)}o(jk,"inRange");function Kk(a,c,p){if(p&&typeof p!="boolean"&&cn(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=Xo(a),c===r?(c=a,a=0):c=Xo(c)),a>c){var T=a;a=c,c=T}if(p||a%1||c%1){var U=C2();return Wr(a+U*(c-a+E7("1e-"+((U+"").length-1))),c)}return fm(a,c)}o(Kk,"random");var Vk=Gf(function(a,c,p){return c=c.toLowerCase(),a+(p?o3(c):c)});function o3(a){return Pm(Kt(a).toLowerCase())}o(o3,"capitalize");function s3(a){return a=Kt(a),a&&a.replace(gn,B7).replace(d7,"")}o(s3,"deburr");function Gk(a,c,p){a=Kt(a),c=Fn(c);var T=a.length;p=p===r?T:Da(At(p),0,T);var U=p;return p-=c.length,p>=0&&a.slice(p,U)==c}o(Gk,"endsWith");function Wk(a){return a=Kt(a),a&&at.test(a)?a.replace(Pn,L7):a}o(Wk,"escape");function Jk(a){return a=Kt(a),a&&lt.test(a)?a.replace(pn,"\\$&"):a}o(Jk,"escapeRegExp");var Yk=Gf(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),Xk=Gf(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),Zk=cy("toLowerCase");function Qk(a,c,p){a=Kt(a),c=At(c);var T=c?qf(a):0;if(!c||T>=c)return a;var U=(c-T)/2;return kh(bh(U),p)+a+kh(mh(U),p)}o(Qk,"pad");function eI(a,c,p){a=Kt(a),c=At(c);var T=c?qf(a):0;return c&&T<c?a+kh(c-T,p):a}o(eI,"padEnd");function tI(a,c,p){a=Kt(a),c=At(c);var T=c?qf(a):0;return c&&T<c?kh(c-T,p)+a:a}o(tI,"padStart");function rI(a,c,p){return p||c==null?c=0:c&&(c=+c),cS(Kt(a).replace(Qe,""),c||0)}o(rI,"parseInt");function nI(a,c,p){return(p?cn(a,c,p):c===r)?c=1:c=At(c),cm(Kt(a),c)}o(nI,"repeat");function iI(){var a=arguments,c=Kt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}o(iI,"replace");var oI=Gf(function(a,c,p){return a+(p?"_":"")+c.toLowerCase()});function sI(a,c,p){return p&&typeof p!="number"&&cn(a,c,p)&&(c=p=r),p=p===r?y:p>>>0,p?(a=Kt(a),a&&(typeof c=="string"||c!=null&&!Rm(c))&&(c=Fn(c),!c&&$f(a))?Ns(Pi(a),0,p):a.split(c,p)):[]}o(sI,"split");var aI=Gf(function(a,c,p){return a+(p?" ":"")+Pm(c)});function fI(a,c,p){return a=Kt(a),p=p==null?0:Da(At(p),0,a.length),c=Fn(c),a.slice(p,p+c.length)==c}o(fI,"startsWith");function cI(a,c,p){var T=$.templateSettings;p&&cn(a,c,p)&&(c=r),a=Kt(a),c=qh({},c,T,by);var U=qh({},c.imports,T.imports,by),K=kr(U),re=Vp(U,K),ce,be,Te=0,Ce=c.interpolate||Fr,De="__p += '",Le=Wp((c.escape||Fr).source+"|"+Ce.source+"|"+(Ce===rt?bt:Fr).source+"|"+(c.evaluate||Fr).source+"|$","g"),Ke="//# sourceURL="+(Jt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++v7+"]")+`
4
+ `;a.replace(Le,function(tt,It,Nt,qn,un,Hn){return Nt||(Nt=qn),De+=a.slice(Te,Hn).replace(vn,U7),It&&(ce=!0,De+=`' +
5
5
  __e(`+It+`) +
6
6
  '`),un&&(be=!0,De+=`';
7
7
  `+un+`;
@@ -17,7 +17,7 @@ __p += '`),Nt&&(De+=`' +
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+De+`return __p
20
- }`;var St=a3(function(){return zt(K,Ke+"return "+De).apply(r,re)});if(St.source=De,km(St))throw St;return St}o(oI,"template");function sI(a){return Kt(a).toLowerCase()}o(sI,"toLower");function aI(a){return Kt(a).toUpperCase()}o(aI,"toUpper");function fI(a,c,p){if(a=Kt(a),a&&(p||c===r))return b2(a);if(!a||!(c=Fn(c)))return a;var M=Pi(a),U=Pi(c),K=g2(M,U),re=v2(M,U)+1;return Ns(M,K,re).join("")}o(fI,"trim");function cI(a,c,p){if(a=Kt(a),a&&(p||c===r))return a.slice(0,x2(a)+1);if(!a||!(c=Fn(c)))return a;var M=Pi(a),U=v2(M,Pi(c))+1;return Ns(M,0,U).join("")}o(cI,"trimEnd");function uI(a,c,p){if(a=Kt(a),a&&(p||c===r))return a.replace(Qe,"");if(!a||!(c=Fn(c)))return a;var M=Pi(a),U=g2(M,Pi(c));return Ns(M,U).join("")}o(uI,"trimStart");function lI(a,c){var p=z,M=he;if(ur(c)){var U="separator"in c?c.separator:U;p="length"in c?At(c.length):p,M="omission"in c?Fn(c.omission):M}a=Kt(a);var K=a.length;if($f(a)){var re=Pi(a);K=re.length}if(p>=K)return a;var ce=p-qf(M);if(ce<1)return M;var be=re?Ns(re,0,ce).join(""):a.slice(0,ce);if(U===r)return be+M;if(re&&(ce+=be.length-ce),Im(U)){if(a.slice(ce).search(U)){var Te,Ce=be;for(U.global||(U=Vp(U.source,Kt(nt.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(Fn(U),ce)!=ce){var Le=be.lastIndexOf(U);Le>-1&&(be=be.slice(0,Le))}return be+M}o(lI,"truncate");function hI(a){return a=Kt(a),a&&st.test(a)?a.replace(Xe,q7):a}o(hI,"unescape");var dI=Gf(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Om=fy("toUpperCase");function s3(a,c,p){return a=Kt(a),c=p?r:c,c===r?B7(a)?j7(a):T7(a):a.match(c)||[]}o(s3,"words");var a3=Ct(function(a,c){try{return Ln(a,r,c)}catch(p){return km(p)?p:new xt(p)}}),pI=Wo(function(a,c){return li(c,function(p){p=po(p),Vo(a,p,Tm(a[p],a))}),a});function mI(a){var c=a==null?0:a.length,p=Ze();return a=c?cr(a,function(M){if(typeof M[1]!="function")throw new hi(i);return[p(M[0]),M[1]]}):[],Ct(function(M){for(var U=-1;++U<c;){var K=a[U];if(Ln(K[0],this,M))return Ln(K[1],this,M)}})}o(mI,"cond");function bI(a){return qS(pi(a,v))}o(bI,"conforms");function Nm(a){return function(){return a}}o(Nm,"constant");function gI(a,c){return a==null||a!==a?c:a}o(gI,"defaultTo");var vI=uy(),yI=uy(!0);function _n(a){return a}o(_n,"identity");function Pm(a){return $2(typeof a=="function"?a:pi(a,v))}o(Pm,"iteratee");function xI(a){return H2(pi(a,v))}o(xI,"matches");function wI(a,c){return z2(a,pi(c,v))}o(wI,"matchesProperty");var _I=Ct(function(a,c){return function(p){return xu(p,a,c)}}),EI=Ct(function(a,c){return function(p){return xu(a,p,c)}});function Bm(a,c,p){var M=kr(c),U=wh(c,M);p==null&&!(ur(c)&&(U.length||!M.length))&&(p=c,c=a,a=this,U=wh(c,kr(c)));var K=!(ur(p)&&"chain"in p)||!!p.chain,re=Yo(a);return li(U,function(ce){var be=c[ce];a[ce]=be,re&&(a.prototype[ce]=function(){var Te=this.__chain__;if(K||Te){var Ce=a(this.__wrapped__),De=Ce.__actions__=yn(this.__actions__);return De.push({func:be,args:arguments,thisArg:a}),Ce.__chain__=Te,Ce}return be.apply(a,Ts([this.value()],arguments))})}),a}o(Bm,"mixin");function AI(){return Cr._===this&&(Cr._=Y7),this}o(AI,"noConflict");function Lm(){}o(Lm,"noop");function SI(a){return a=At(a),Ct(function(c){return j2(c,a)})}o(SI,"nthArg");var MI=pm(cr),TI=pm(l2),CI=pm(Fp);function f3(a){return wm(a)?$p(po(a)):iM(a)}o(f3,"property");function kI(a){return function(c){return a==null?r:Ra(a,c)}}o(kI,"propertyOf");var II=hy(),DI=hy(!0);function Um(){return[]}o(Um,"stubArray");function Fm(){return!1}o(Fm,"stubFalse");function RI(){return{}}o(RI,"stubObject");function OI(){return""}o(OI,"stubString");function NI(){return!0}o(NI,"stubTrue");function PI(a,c){if(a=At(a),a<1||a>_)return[];var p=y,M=Wr(a,y);c=Ze(c),a-=y;for(var U=zp(M,c);++p<a;)c(p);return U}o(PI,"times");function BI(a){return wt(a)?cr(a,po):$n(a)?[a]:yn(Cy(Kt(a)))}o(BI,"toPath");function LI(a){var c=++W7;return Kt(a)+c}o(LI,"uniqueId");var UI=Th(function(a,c){return a+c},0),FI=mm("ceil"),$I=Th(function(a,c){return a/c},1),qI=mm("floor");function HI(a){return a&&a.length?xh(a,_n,em):r}o(HI,"max");function zI(a,c){return a&&a.length?xh(a,Ze(c,2),em):r}o(zI,"maxBy");function jI(a){return p2(a,_n)}o(jI,"mean");function KI(a,c){return p2(a,Ze(c,2))}o(KI,"meanBy");function VI(a){return a&&a.length?xh(a,_n,im):r}o(VI,"min");function GI(a,c){return a&&a.length?xh(a,Ze(c,2),im):r}o(GI,"minBy");var WI=Th(function(a,c){return a*c},1),JI=mm("round"),YI=Th(function(a,c){return a-c},0);function XI(a){return a&&a.length?Hp(a,_n):0}o(XI,"sum");function ZI(a,c){return a&&a.length?Hp(a,Ze(c,2)):0}return o(ZI,"sumBy"),$.after=xC,$.ary=Fy,$.assign=ak,$.assignIn=Qy,$.assignInWith=$h,$.assignWith=fk,$.at=ck,$.before=$y,$.bind=Tm,$.bindAll=pI,$.bindKey=qy,$.castArray=RC,$.chain=By,$.chunk=qM,$.compact=HM,$.concat=zM,$.cond=mI,$.conforms=bI,$.constant=Nm,$.countBy=XT,$.create=uk,$.curry=Hy,$.curryRight=zy,$.debounce=jy,$.defaults=lk,$.defaultsDeep=hk,$.defer=wC,$.delay=_C,$.difference=jM,$.differenceBy=KM,$.differenceWith=VM,$.drop=GM,$.dropRight=WM,$.dropRightWhile=JM,$.dropWhile=YM,$.fill=XM,$.filter=QT,$.flatMap=rC,$.flatMapDeep=nC,$.flatMapDepth=iC,$.flatten=Ry,$.flattenDeep=ZM,$.flattenDepth=QM,$.flip=EC,$.flow=vI,$.flowRight=yI,$.fromPairs=eT,$.functions=yk,$.functionsIn=xk,$.groupBy=oC,$.initial=rT,$.intersection=nT,$.intersectionBy=iT,$.intersectionWith=oT,$.invert=_k,$.invertBy=Ek,$.invokeMap=aC,$.iteratee=Pm,$.keyBy=fC,$.keys=kr,$.keysIn=wn,$.map=Nh,$.mapKeys=Sk,$.mapValues=Mk,$.matches=xI,$.matchesProperty=wI,$.memoize=Bh,$.merge=Tk,$.mergeWith=e3,$.method=_I,$.methodOf=EI,$.mixin=Bm,$.negate=Lh,$.nthArg=SI,$.omit=Ck,$.omitBy=kk,$.once=AC,$.orderBy=cC,$.over=MI,$.overArgs=SC,$.overEvery=TI,$.overSome=CI,$.partial=Cm,$.partialRight=Ky,$.partition=uC,$.pick=Ik,$.pickBy=t3,$.property=f3,$.propertyOf=kI,$.pull=cT,$.pullAll=Ny,$.pullAllBy=uT,$.pullAllWith=lT,$.pullAt=hT,$.range=II,$.rangeRight=DI,$.rearg=MC,$.reject=dC,$.remove=dT,$.rest=TC,$.reverse=Sm,$.sampleSize=mC,$.set=Rk,$.setWith=Ok,$.shuffle=bC,$.slice=pT,$.sortBy=yC,$.sortedUniq=wT,$.sortedUniqBy=_T,$.split=rI,$.spread=CC,$.tail=ET,$.take=AT,$.takeRight=ST,$.takeRightWhile=MT,$.takeWhile=TT,$.tap=HT,$.throttle=kC,$.thru=Oh,$.toArray=Yy,$.toPairs=r3,$.toPairsIn=n3,$.toPath=BI,$.toPlainObject=Zy,$.transform=Nk,$.unary=IC,$.union=CT,$.unionBy=kT,$.unionWith=IT,$.uniq=DT,$.uniqBy=RT,$.uniqWith=OT,$.unset=Pk,$.unzip=Mm,$.unzipWith=Py,$.update=Bk,$.updateWith=Lk,$.values=Yf,$.valuesIn=Uk,$.without=NT,$.words=s3,$.wrap=DC,$.xor=PT,$.xorBy=BT,$.xorWith=LT,$.zip=UT,$.zipObject=FT,$.zipObjectDeep=$T,$.zipWith=qT,$.entries=r3,$.entriesIn=n3,$.extend=Qy,$.extendWith=$h,Bm($,$),$.add=UI,$.attempt=a3,$.camelCase=Hk,$.capitalize=i3,$.ceil=FI,$.clamp=Fk,$.clone=OC,$.cloneDeep=PC,$.cloneDeepWith=BC,$.cloneWith=NC,$.conformsTo=LC,$.deburr=o3,$.defaultTo=gI,$.divide=$I,$.endsWith=zk,$.eq=Li,$.escape=jk,$.escapeRegExp=Kk,$.every=ZT,$.find=eC,$.findIndex=Iy,$.findKey=dk,$.findLast=tC,$.findLastIndex=Dy,$.findLastKey=pk,$.floor=qI,$.forEach=Ly,$.forEachRight=Uy,$.forIn=mk,$.forInRight=bk,$.forOwn=gk,$.forOwnRight=vk,$.get=Dm,$.gt=UC,$.gte=FC,$.has=wk,$.hasIn=Rm,$.head=Oy,$.identity=_n,$.includes=sC,$.indexOf=tT,$.inRange=$k,$.invoke=Ak,$.isArguments=Pa,$.isArray=wt,$.isArrayBuffer=$C,$.isArrayLike=xn,$.isArrayLikeObject=vr,$.isBoolean=qC,$.isBuffer=Ps,$.isDate=HC,$.isElement=zC,$.isEmpty=jC,$.isEqual=KC,$.isEqualWith=VC,$.isError=km,$.isFinite=GC,$.isFunction=Yo,$.isInteger=Vy,$.isLength=Uh,$.isMap=Gy,$.isMatch=WC,$.isMatchWith=JC,$.isNaN=YC,$.isNative=XC,$.isNil=QC,$.isNull=ZC,$.isNumber=Wy,$.isObject=ur,$.isObjectLike=lr,$.isPlainObject=Mu,$.isRegExp=Im,$.isSafeInteger=ek,$.isSet=Jy,$.isString=Fh,$.isSymbol=$n,$.isTypedArray=Jf,$.isUndefined=tk,$.isWeakMap=rk,$.isWeakSet=nk,$.join=sT,$.kebabCase=Vk,$.last=bi,$.lastIndexOf=aT,$.lowerCase=Gk,$.lowerFirst=Wk,$.lt=ik,$.lte=ok,$.max=HI,$.maxBy=zI,$.mean=jI,$.meanBy=KI,$.min=VI,$.minBy=GI,$.stubArray=Um,$.stubFalse=Fm,$.stubObject=RI,$.stubString=OI,$.stubTrue=NI,$.multiply=WI,$.nth=fT,$.noConflict=AI,$.noop=Lm,$.now=Ph,$.pad=Jk,$.padEnd=Yk,$.padStart=Xk,$.parseInt=Zk,$.random=qk,$.reduce=lC,$.reduceRight=hC,$.repeat=Qk,$.replace=eI,$.result=Dk,$.round=JI,$.runInContext=de,$.sample=pC,$.size=gC,$.snakeCase=tI,$.some=vC,$.sortedIndex=mT,$.sortedIndexBy=bT,$.sortedIndexOf=gT,$.sortedLastIndex=vT,$.sortedLastIndexBy=yT,$.sortedLastIndexOf=xT,$.startCase=nI,$.startsWith=iI,$.subtract=YI,$.sum=XI,$.sumBy=ZI,$.template=oI,$.times=PI,$.toFinite=Xo,$.toInteger=At,$.toLength=Xy,$.toLower=sI,$.toNumber=gi,$.toSafeInteger=sk,$.toString=Kt,$.toUpper=aI,$.trim=fI,$.trimEnd=cI,$.trimStart=uI,$.truncate=lI,$.unescape=hI,$.uniqueId=LI,$.upperCase=dI,$.upperFirst=Om,$.each=Ly,$.eachRight=Uy,$.first=Oy,Bm($,function(){var a={};return lo($,function(c,p){Jt.call($.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),$.VERSION=e,li(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),li(["drop","take"],function(a,c){Ot.prototype[a]=function(p){p=p===r?1:Ar(At(p),0);var M=this.__filtered__&&!c?new Ot(this):this.clone();return M.__filtered__?M.__takeCount__=Wr(p,M.__takeCount__):M.__views__.push({size:Wr(p,y),type:a+(M.__dir__<0?"Right":"")}),M},Ot.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),li(["filter","map","takeWhile"],function(a,c){var p=c+1,M=p==g||p==l;Ot.prototype[a]=function(U){var K=this.clone();return K.__iteratees__.push({iteratee:Ze(U,3),type:p}),K.__filtered__=K.__filtered__||M,K}}),li(["head","last"],function(a,c){var p="take"+(c?"Right":"");Ot.prototype[a]=function(){return this[p](1).value()[0]}}),li(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");Ot.prototype[a]=function(){return this.__filtered__?new Ot(this):this[p](1)}}),Ot.prototype.compact=function(){return this.filter(_n)},Ot.prototype.find=function(a){return this.filter(a).head()},Ot.prototype.findLast=function(a){return this.reverse().find(a)},Ot.prototype.invokeMap=Ct(function(a,c){return typeof a=="function"?new Ot(this):this.map(function(p){return xu(p,a,c)})}),Ot.prototype.reject=function(a){return this.filter(Lh(Ze(a)))},Ot.prototype.slice=function(a,c){a=At(a);var p=this;return p.__filtered__&&(a>0||c<0)?new Ot(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==r&&(c=At(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ot.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ot.prototype.toArray=function(){return this.take(y)},lo(Ot.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),M=/^(?:head|last)$/.test(c),U=$[M?"take"+(c=="last"?"Right":""):c],K=M||/^find/.test(c);!U||($.prototype[c]=function(){var re=this.__wrapped__,ce=M?[1]:arguments,be=re instanceof Ot,Te=ce[0],Ce=be||wt(re),De=o(function(It){var Nt=U.apply($,Ts([It],ce));return M&&Le?Nt[0]:Nt},"interceptor");Ce&&p&&typeof Te=="function"&&Te.length!=1&&(be=Ce=!1);var Le=this.__chain__,Ke=!!this.__actions__.length,et=K&&!Le,St=be&&!Ke;if(!K&&Ce){re=St?re:new Ot(this);var tt=a.apply(re,ce);return tt.__actions__.push({func:Oh,args:[De],thisArg:r}),new di(tt,Le)}return et&&St?a.apply(this,ce):(tt=this.thru(De),et?M?tt.value()[0]:tt.value():tt)})}),li(["pop","push","shift","sort","splice","unshift"],function(a){var c=oh[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",M=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var U=arguments;if(M&&!this.__chain__){var K=this.value();return c.apply(wt(K)?K:[],U)}return this[p](function(re){return c.apply(wt(re)?re:[],U)})}}),lo(Ot.prototype,function(a,c){var p=$[c];if(p){var M=p.name+"";Jt.call(jf,M)||(jf[M]=[]),jf[M].push({name:c,func:p})}}),jf[Mh(r,B).name]=[{name:"wrapper",func:r}],Ot.prototype.clone=hS,Ot.prototype.reverse=dS,Ot.prototype.value=pS,$.prototype.at=zT,$.prototype.chain=jT,$.prototype.commit=KT,$.prototype.next=VT,$.prototype.plant=WT,$.prototype.reverse=JT,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=YT,$.prototype.first=$.prototype.head,du&&($.prototype[du]=GT),$},"runInContext"),ks=K7();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Cr._=ks,define(function(){return ks})):Ta?((Ta.exports=ks)._=ks,Pp._=ks):Cr._=ks}).call(Xf)});function Ba(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var Iu=Vt(()=>{o(Ba,"asUint8Array")});function Du(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ba(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var zh=Vt(()=>{Iu();o(Du,"allocUnsafe")});var p3={};Xt(p3,{concat:()=>Fi});function Fi(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=Du(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ba(t)}var $m=Vt(()=>{zh();Iu();o(Fi,"concat")});function vD(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),v=Math.log(u)/Math.log(256),x=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 B=0,Y=0,P=0,J=I.length;P!==J&&I[P]===0;)P++,B++;for(var ee=(J-P)*x+1>>>0,X=new Uint8Array(ee);P!==J;){for(var ne=I[P],V=0,H=ee-1;(ne!==0||V<Y)&&H!==-1;H--,V++)ne+=256*X[H]>>>0,X[H]=ne%u>>>0,ne=ne/u>>>0;if(ne!==0)throw new Error("Non-zero carry");Y=V,P++}for(var z=ee-Y;z!==ee&&X[z]===0;)z++;for(var he=d.repeat(B);z<ee;++z)he+=r.charAt(X[z]);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 B=0;if(I[B]!==" "){for(var Y=0,P=0;I[B]===d;)Y++,B++;for(var J=(I.length-B)*v+1>>>0,ee=new Uint8Array(J);I[B];){var X=t[I.charCodeAt(B)];if(X===255)return;for(var ne=0,V=J-1;(X!==0||ne<P)&&V!==-1;V--,ne++)X+=u*ee[V]>>>0,ee[V]=X%256>>>0,X=X/256>>>0;if(X!==0)throw new Error("Non-zero carry");P=ne,B++}if(I[B]!==" "){for(var H=J-P;H!==J&&ee[H]===0;)H++;for(var z=new Uint8Array(Y+(J-H)),he=Y;H!==J;)z[he++]=ee[H++];return z}}}o(O,"decodeUnsafe");function R(I){var B=O(I);if(B)return B;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:E,decodeUnsafe:O,decode:R}}var yD,xD,m3,b3=Vt(()=>{o(vD,"base");yD=vD,xD=yD,m3=xD});var xK,g3,Qo,v3,y3,Bs=Vt(()=>{xK=new Uint8Array(0),g3=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"),Qo=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"),v3=o(r=>new TextEncoder().encode(r),"fromString"),y3=o(r=>new TextDecoder().decode(r),"toString")});var jh,Kh,Vh,x3,Gh,Zf,Ls,wD,_D,hr,$i=Vt(()=>{b3();Bs();jh=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(jh,"Encoder");Kh=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 x3(this,e)}};o(Kh,"Decoder");Vh=class{constructor(e){this.decoders=e}or(e){return x3(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(Vh,"ComposedDecoder");x3=o((r,e)=>new Vh({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),"or"),Gh=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new jh(e,t,n),this.decoder=new Kh(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Gh,"Codec");Zf=o(({name:r,prefix:e,encode:t,decode:n})=>new Gh(r,e,t,n),"from"),Ls=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=m3(t,e);return Zf({prefix:r,name:e,encode:n,decode:s=>Qo(i(s))})},"baseX"),wD=o((r,e,t,n)=>{let i={};for(let x=0;x<e.length;++x)i[e[x]]=x;let s=r.length;for(;r[s-1]==="=";)--s;let f=new Uint8Array(s*t/8|0),u=0,d=0,v=0;for(let x=0;x<s;++x){let E=i[r[x]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|E,u+=t,u>=8&&(u-=8,f[v++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return f},"decode"),_D=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"),hr=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Zf({prefix:e,name:r,encode(i){return _D(i,n,t)},decode(i){return wD(i,n,t,r)}}),"rfc4648")});var Hm={};Xt(Hm,{identity:()=>ED});var ED,w3=Vt(()=>{$i();Bs();ED=Zf({prefix:"\0",name:"identity",encode:r=>y3(r),decode:r=>v3(r)})});var zm={};Xt(zm,{base2:()=>AD});var AD,_3=Vt(()=>{$i();AD=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var jm={};Xt(jm,{base8:()=>SD});var SD,E3=Vt(()=>{$i();SD=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Km={};Xt(Km,{base10:()=>MD});var MD,A3=Vt(()=>{$i();MD=Ls({prefix:"9",name:"base10",alphabet:"0123456789"})});var Vm={};Xt(Vm,{base16:()=>TD,base16upper:()=>CD});var TD,CD,S3=Vt(()=>{$i();TD=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),CD=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Gm={};Xt(Gm,{base32:()=>Qf,base32hex:()=>RD,base32hexpad:()=>ND,base32hexpadupper:()=>PD,base32hexupper:()=>OD,base32pad:()=>ID,base32padupper:()=>DD,base32upper:()=>kD,base32z:()=>BD});var Qf,kD,ID,DD,RD,OD,ND,PD,BD,Wm=Vt(()=>{$i();Qf=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),kD=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ID=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),DD=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),RD=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),OD=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ND=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),PD=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),BD=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Jm={};Xt(Jm,{base36:()=>qi,base36upper:()=>LD});var qi,LD,ec=Vt(()=>{$i();qi=Ls({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),LD=Ls({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Ym={};Xt(Ym,{base58btc:()=>vi,base58flickr:()=>UD});var vi,UD,Wh=Vt(()=>{$i();vi=Ls({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),UD=Ls({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Xm={};Xt(Xm,{base64:()=>FD,base64pad:()=>$D,base64url:()=>La,base64urlpad:()=>qD});var FD,$D,La,qD,Jh=Vt(()=>{$i();FD=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),$D=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),La=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),qD=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Zm={};Xt(Zm,{base256emoji:()=>VD});function jD(r){return r.reduce((e,t)=>(e+=HD[t],e),"")}function KD(r){let e=[];for(let t of r){let n=zD[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var M3,HD,zD,VD,T3=Vt(()=>{$i();M3=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}"),HD=M3.reduce((r,e,t)=>(r[t]=e,r),[]),zD=M3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(jD,"encode");o(KD,"decode");VD=Zf({prefix:"\u{1F680}",name:"base256emoji",encode:jD,decode:KD})});function I3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=YD;)e[t++]=r&255|C3,r/=128;for(;r&JD;)e[t++]=r&255|C3,r>>>=7;return e[t]=r|0,I3.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&k3)<<i:(f&k3)*Math.pow(2,i),i+=7}while(f>=ZD);return Qm.bytes=s-n,t}var GD,C3,WD,JD,YD,XD,ZD,k3,QD,eR,tR,rR,nR,iR,oR,sR,aR,fR,cR,uR,Ru,D3=Vt(()=>{GD=I3,C3=128,WD=127,JD=~WD,YD=Math.pow(2,31);o(I3,"encode");XD=Qm,ZD=128,k3=127;o(Qm,"read");QD=Math.pow(2,7),eR=Math.pow(2,14),tR=Math.pow(2,21),rR=Math.pow(2,28),nR=Math.pow(2,35),iR=Math.pow(2,42),oR=Math.pow(2,49),sR=Math.pow(2,56),aR=Math.pow(2,63),fR=o(function(r){return r<QD?1:r<eR?2:r<tR?3:r<rR?4:r<nR?5:r<iR?6:r<oR?7:r<sR?8:r<aR?9:10},"length"),cR={encode:GD,decode:XD,encodingLength:fR},uR=cR,Ru=uR});var Ou,tc,rc,Xh=Vt(()=>{D3();Ou=o((r,e=0)=>[Ru.decode(r,e),Ru.decode.bytes],"decode"),tc=o((r,e,t=0)=>(Ru.encode(r,e,t),e),"encodeTo"),rc=o(r=>Ru.encodingLength(r),"encodingLength")});var es,Zh,R3,Ua,Fa=Vt(()=>{Bs();Xh();es=o((r,e)=>{let t=e.byteLength,n=rc(r),i=n+rc(t),s=new Uint8Array(i+t);return tc(r,s,0),tc(t,s,n),s.set(e,i),new Ua(r,t,e,s)},"create"),Zh=o(r=>{let e=Qo(r),[t,n]=Ou(e),[i,s]=Ou(e.subarray(n)),f=e.subarray(n+s);if(f.byteLength!==i)throw new Error("Incorrect length");return new Ua(t,i,f,e)},"decode"),R3=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&g3(r.bytes,e.bytes),"equals"),Ua=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Ua,"Digest")});var e1,Qh,t1=Vt(()=>{Fa();e1=o(({name:r,code:e,encode:t})=>new Qh(r,e,t),"from"),Qh=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?es(this.code,t):t.then(n=>es(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(Qh,"Hasher")});var r1={};Xt(r1,{sha256:()=>Us,sha512:()=>lR});var N3,Us,lR,Pu=Vt(()=>{t1();N3=o(r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),"sha"),Us=e1({name:"sha2-256",code:18,encode:N3("SHA-256")}),lR=e1({name:"sha2-512",code:19,encode:N3("SHA-512")})});var n1={};Xt(n1,{identity:()=>ed});var P3,hR,B3,dR,ed,i1=Vt(()=>{Bs();Fa();P3=0,hR="identity",B3=Qo,dR=o(r=>es(P3,B3(r)),"digest"),ed={code:P3,name:hR,encode:B3,digest:dR}});var L3=Vt(()=>{Bs()});var qK,HK,U3=Vt(()=>{qK=new TextEncoder,HK=new TextDecoder});var Ye,bR,gR,vR,Bu,yR,F3,$3,td,rd,xR,wR,_R,Hi=Vt(()=>{Xh();Fa();Wh();Wm();Bs();Ye=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:rd,byteLength:rd,code:td,version:td,multihash:td,bytes:td,_baseCache:rd,asCID:rd})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Bu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==yR)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ye.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=es(e,t);return Ye.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&&R3(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return gR(t,i,e||vi.encoder);default:return vR(t,i,e||Qf.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 wR(/^0\.0/,_R),!!(e&&(e[$3]||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 Ye)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Ye(t,n,i,s||F3(t,n,i.bytes))}else if(e!=null&&e[$3]===!0){let{version:t,multihash:n,code:i}=e,s=Zh(n);return Ye.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!==Bu)throw new Error(`Version 0 CID must use dag-pb (code: ${Bu}) block encoding`);return new Ye(e,t,n,n.bytes)}case 1:{let i=F3(e,t,n.bytes);return new Ye(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Ye.create(0,Bu,e)}static createV1(e,t){return Ye.create(1,e,t)}static decode(e){let[t,n]=Ye.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Ye.inspectBytes(e),n=t.size-t.multihashSize,i=Qo(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 Ua(t.multihashCode,t.digestSize,s,i);return[t.version===0?Ye.createV0(f):Ye.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[E,O]=Ou(e.subarray(t));return t+=O,E},"next"),i=n(),s=Bu;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(),v=t+d,x=v-f;return{version:i,codec:s,multihashCode:u,digestSize:d,multihashSize:x,size:v}}static parse(e,t){let[n,i]=bR(e,t),s=Ye.decode(i);return s._baseCache.set(n,e),s}};o(Ye,"CID");bR=o((r,e)=>{switch(r[0]){case"Q":{let t=e||vi;return[vi.prefix,t.decode(`${vi.prefix}${r}`)]}case vi.prefix:{let t=e||vi;return[vi.prefix,t.decode(r)]}case Qf.prefix:{let t=e||Qf;return[Qf.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"),gR=o((r,e,t)=>{let{prefix:n}=t;if(n!==vi.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"),vR=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"),Bu=112,yR=18,F3=o((r,e,t)=>{let n=rc(r),i=n+rc(e),s=new Uint8Array(i+t.byteLength);return tc(r,s,0),tc(e,s,n),s.set(t,i),s},"encodeCID"),$3=Symbol.for("@ipld/js-cid/CID"),td={writable:!1,configurable:!1,enumerable:!0},rd={writable:!1,enumerable:!1,configurable:!1},xR="0.0.0-dev",wR=o((r,e)=>{if(r.test(xR))console.warn(e);else throw new Error(e)},"deprecate"),_R=`CID.isCID(v) is deprecated and will be removed in the next major release.
20
+ }`;var St=f3(function(){return zt(K,Ke+"return "+De).apply(r,re)});if(St.source=De,Dm(St))throw St;return St}o(cI,"template");function uI(a){return Kt(a).toLowerCase()}o(uI,"toLower");function lI(a){return Kt(a).toUpperCase()}o(lI,"toUpper");function hI(a,c,p){if(a=Kt(a),a&&(p||c===r))return g2(a);if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=Pi(c),K=v2(T,U),re=y2(T,U)+1;return Ns(T,K,re).join("")}o(hI,"trim");function dI(a,c,p){if(a=Kt(a),a&&(p||c===r))return a.slice(0,w2(a)+1);if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=y2(T,Pi(c))+1;return Ns(T,0,U).join("")}o(dI,"trimEnd");function pI(a,c,p){if(a=Kt(a),a&&(p||c===r))return a.replace(Qe,"");if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=v2(T,Pi(c));return Ns(T,U).join("")}o(pI,"trimStart");function mI(a,c){var p=z,T=he;if(ur(c)){var U="separator"in c?c.separator:U;p="length"in c?At(c.length):p,T="omission"in c?Fn(c.omission):T}a=Kt(a);var K=a.length;if($f(a)){var re=Pi(a);K=re.length}if(p>=K)return a;var ce=p-qf(T);if(ce<1)return T;var be=re?Ns(re,0,ce).join(""):a.slice(0,ce);if(U===r)return be+T;if(re&&(ce+=be.length-ce),Rm(U)){if(a.slice(ce).search(U)){var Te,Ce=be;for(U.global||(U=Wp(U.source,Kt(nt.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(Fn(U),ce)!=ce){var Le=be.lastIndexOf(U);Le>-1&&(be=be.slice(0,Le))}return be+T}o(mI,"truncate");function bI(a){return a=Kt(a),a&&st.test(a)?a.replace(Xe,K7):a}o(bI,"unescape");var gI=Gf(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Pm=cy("toUpperCase");function a3(a,c,p){return a=Kt(a),c=p?r:c,c===r?$7(a)?W7(a):D7(a):a.match(c)||[]}o(a3,"words");var f3=Ct(function(a,c){try{return Ln(a,r,c)}catch(p){return Dm(p)?p:new xt(p)}}),vI=Wo(function(a,c){return li(c,function(p){p=po(p),Vo(a,p,km(a[p],a))}),a});function yI(a){var c=a==null?0:a.length,p=Ze();return a=c?cr(a,function(T){if(typeof T[1]!="function")throw new hi(i);return[p(T[0]),T[1]]}):[],Ct(function(T){for(var U=-1;++U<c;){var K=a[U];if(Ln(K[0],this,T))return Ln(K[1],this,T)}})}o(yI,"cond");function xI(a){return KS(pi(a,v))}o(xI,"conforms");function Bm(a){return function(){return a}}o(Bm,"constant");function wI(a,c){return a==null||a!==a?c:a}o(wI,"defaultTo");var _I=ly(),EI=ly(!0);function _n(a){return a}o(_n,"identity");function Lm(a){return q2(typeof a=="function"?a:pi(a,v))}o(Lm,"iteratee");function AI(a){return z2(pi(a,v))}o(AI,"matches");function SI(a,c){return j2(a,pi(c,v))}o(SI,"matchesProperty");var MI=Ct(function(a,c){return function(p){return wu(p,a,c)}}),TI=Ct(function(a,c){return function(p){return wu(a,p,c)}});function Um(a,c,p){var T=kr(c),U=_h(c,T);p==null&&!(ur(c)&&(U.length||!T.length))&&(p=c,c=a,a=this,U=_h(c,kr(c)));var K=!(ur(p)&&"chain"in p)||!!p.chain,re=Yo(a);return li(U,function(ce){var be=c[ce];a[ce]=be,re&&(a.prototype[ce]=function(){var Te=this.__chain__;if(K||Te){var Ce=a(this.__wrapped__),De=Ce.__actions__=yn(this.__actions__);return De.push({func:be,args:arguments,thisArg:a}),Ce.__chain__=Te,Ce}return be.apply(a,Ts([this.value()],arguments))})}),a}o(Um,"mixin");function CI(){return Cr._===this&&(Cr._=eS),this}o(CI,"noConflict");function Fm(){}o(Fm,"noop");function kI(a){return a=At(a),Ct(function(c){return K2(c,a)})}o(kI,"nthArg");var II=bm(cr),DI=bm(h2),RI=bm(qp);function c3(a){return Em(a)?Hp(po(a)):fM(a)}o(c3,"property");function OI(a){return function(c){return a==null?r:Ra(a,c)}}o(OI,"propertyOf");var NI=dy(),PI=dy(!0);function $m(){return[]}o($m,"stubArray");function qm(){return!1}o(qm,"stubFalse");function BI(){return{}}o(BI,"stubObject");function LI(){return""}o(LI,"stubString");function UI(){return!0}o(UI,"stubTrue");function FI(a,c){if(a=At(a),a<1||a>_)return[];var p=y,T=Wr(a,y);c=Ze(c),a-=y;for(var U=Kp(T,c);++p<a;)c(p);return U}o(FI,"times");function $I(a){return wt(a)?cr(a,po):$n(a)?[a]:yn(ky(Kt(a)))}o($I,"toPath");function qI(a){var c=++Z7;return Kt(a)+c}o(qI,"uniqueId");var HI=Ch(function(a,c){return a+c},0),zI=gm("ceil"),jI=Ch(function(a,c){return a/c},1),KI=gm("floor");function VI(a){return a&&a.length?wh(a,_n,rm):r}o(VI,"max");function GI(a,c){return a&&a.length?wh(a,Ze(c,2),rm):r}o(GI,"maxBy");function WI(a){return m2(a,_n)}o(WI,"mean");function JI(a,c){return m2(a,Ze(c,2))}o(JI,"meanBy");function YI(a){return a&&a.length?wh(a,_n,sm):r}o(YI,"min");function XI(a,c){return a&&a.length?wh(a,Ze(c,2),sm):r}o(XI,"minBy");var ZI=Ch(function(a,c){return a*c},1),QI=gm("round"),eD=Ch(function(a,c){return a-c},0);function tD(a){return a&&a.length?jp(a,_n):0}o(tD,"sum");function rD(a,c){return a&&a.length?jp(a,Ze(c,2)):0}return o(rD,"sumBy"),$.after=AC,$.ary=$y,$.assign=lk,$.assignIn=e3,$.assignInWith=qh,$.assignWith=hk,$.at=dk,$.before=qy,$.bind=km,$.bindAll=vI,$.bindKey=Hy,$.castArray=BC,$.chain=Ly,$.chunk=KM,$.compact=VM,$.concat=GM,$.cond=yI,$.conforms=xI,$.constant=Bm,$.countBy=tC,$.create=pk,$.curry=zy,$.curryRight=jy,$.debounce=Ky,$.defaults=mk,$.defaultsDeep=bk,$.defer=SC,$.delay=MC,$.difference=WM,$.differenceBy=JM,$.differenceWith=YM,$.drop=XM,$.dropRight=ZM,$.dropRightWhile=QM,$.dropWhile=eT,$.fill=tT,$.filter=nC,$.flatMap=sC,$.flatMapDeep=aC,$.flatMapDepth=fC,$.flatten=Oy,$.flattenDeep=rT,$.flattenDepth=nT,$.flip=TC,$.flow=_I,$.flowRight=EI,$.fromPairs=iT,$.functions=Ek,$.functionsIn=Ak,$.groupBy=cC,$.initial=sT,$.intersection=aT,$.intersectionBy=fT,$.intersectionWith=cT,$.invert=Mk,$.invertBy=Tk,$.invokeMap=lC,$.iteratee=Lm,$.keyBy=hC,$.keys=kr,$.keysIn=wn,$.map=Ph,$.mapKeys=kk,$.mapValues=Ik,$.matches=AI,$.matchesProperty=SI,$.memoize=Lh,$.merge=Dk,$.mergeWith=t3,$.method=MI,$.methodOf=TI,$.mixin=Um,$.negate=Uh,$.nthArg=kI,$.omit=Rk,$.omitBy=Ok,$.once=CC,$.orderBy=dC,$.over=II,$.overArgs=kC,$.overEvery=DI,$.overSome=RI,$.partial=Im,$.partialRight=Vy,$.partition=pC,$.pick=Nk,$.pickBy=r3,$.property=c3,$.propertyOf=OI,$.pull=dT,$.pullAll=Py,$.pullAllBy=pT,$.pullAllWith=mT,$.pullAt=bT,$.range=NI,$.rangeRight=PI,$.rearg=IC,$.reject=gC,$.remove=gT,$.rest=DC,$.reverse=Tm,$.sampleSize=yC,$.set=Bk,$.setWith=Lk,$.shuffle=xC,$.slice=vT,$.sortBy=EC,$.sortedUniq=ST,$.sortedUniqBy=MT,$.split=sI,$.spread=RC,$.tail=TT,$.take=CT,$.takeRight=kT,$.takeRightWhile=IT,$.takeWhile=DT,$.tap=VT,$.throttle=OC,$.thru=Nh,$.toArray=Xy,$.toPairs=n3,$.toPairsIn=i3,$.toPath=$I,$.toPlainObject=Qy,$.transform=Uk,$.unary=NC,$.union=RT,$.unionBy=OT,$.unionWith=NT,$.uniq=PT,$.uniqBy=BT,$.uniqWith=LT,$.unset=Fk,$.unzip=Cm,$.unzipWith=By,$.update=$k,$.updateWith=qk,$.values=Yf,$.valuesIn=Hk,$.without=UT,$.words=a3,$.wrap=PC,$.xor=FT,$.xorBy=$T,$.xorWith=qT,$.zip=HT,$.zipObject=zT,$.zipObjectDeep=jT,$.zipWith=KT,$.entries=n3,$.entriesIn=i3,$.extend=e3,$.extendWith=qh,Um($,$),$.add=HI,$.attempt=f3,$.camelCase=Vk,$.capitalize=o3,$.ceil=zI,$.clamp=zk,$.clone=LC,$.cloneDeep=FC,$.cloneDeepWith=$C,$.cloneWith=UC,$.conformsTo=qC,$.deburr=s3,$.defaultTo=wI,$.divide=jI,$.endsWith=Gk,$.eq=Li,$.escape=Wk,$.escapeRegExp=Jk,$.every=rC,$.find=iC,$.findIndex=Dy,$.findKey=gk,$.findLast=oC,$.findLastIndex=Ry,$.findLastKey=vk,$.floor=KI,$.forEach=Uy,$.forEachRight=Fy,$.forIn=yk,$.forInRight=xk,$.forOwn=wk,$.forOwnRight=_k,$.get=Om,$.gt=HC,$.gte=zC,$.has=Sk,$.hasIn=Nm,$.head=Ny,$.identity=_n,$.includes=uC,$.indexOf=oT,$.inRange=jk,$.invoke=Ck,$.isArguments=Pa,$.isArray=wt,$.isArrayBuffer=jC,$.isArrayLike=xn,$.isArrayLikeObject=vr,$.isBoolean=KC,$.isBuffer=Ps,$.isDate=VC,$.isElement=GC,$.isEmpty=WC,$.isEqual=JC,$.isEqualWith=YC,$.isError=Dm,$.isFinite=XC,$.isFunction=Yo,$.isInteger=Gy,$.isLength=Fh,$.isMap=Wy,$.isMatch=ZC,$.isMatchWith=QC,$.isNaN=ek,$.isNative=tk,$.isNil=nk,$.isNull=rk,$.isNumber=Jy,$.isObject=ur,$.isObjectLike=lr,$.isPlainObject=Tu,$.isRegExp=Rm,$.isSafeInteger=ik,$.isSet=Yy,$.isString=$h,$.isSymbol=$n,$.isTypedArray=Jf,$.isUndefined=ok,$.isWeakMap=sk,$.isWeakSet=ak,$.join=uT,$.kebabCase=Yk,$.last=bi,$.lastIndexOf=lT,$.lowerCase=Xk,$.lowerFirst=Zk,$.lt=fk,$.lte=ck,$.max=VI,$.maxBy=GI,$.mean=WI,$.meanBy=JI,$.min=YI,$.minBy=XI,$.stubArray=$m,$.stubFalse=qm,$.stubObject=BI,$.stubString=LI,$.stubTrue=UI,$.multiply=ZI,$.nth=hT,$.noConflict=CI,$.noop=Fm,$.now=Bh,$.pad=Qk,$.padEnd=eI,$.padStart=tI,$.parseInt=rI,$.random=Kk,$.reduce=mC,$.reduceRight=bC,$.repeat=nI,$.replace=iI,$.result=Pk,$.round=QI,$.runInContext=de,$.sample=vC,$.size=wC,$.snakeCase=oI,$.some=_C,$.sortedIndex=yT,$.sortedIndexBy=xT,$.sortedIndexOf=wT,$.sortedLastIndex=_T,$.sortedLastIndexBy=ET,$.sortedLastIndexOf=AT,$.startCase=aI,$.startsWith=fI,$.subtract=eD,$.sum=tD,$.sumBy=rD,$.template=cI,$.times=FI,$.toFinite=Xo,$.toInteger=At,$.toLength=Zy,$.toLower=uI,$.toNumber=gi,$.toSafeInteger=uk,$.toString=Kt,$.toUpper=lI,$.trim=hI,$.trimEnd=dI,$.trimStart=pI,$.truncate=mI,$.unescape=bI,$.uniqueId=qI,$.upperCase=gI,$.upperFirst=Pm,$.each=Uy,$.eachRight=Fy,$.first=Ny,Um($,function(){var a={};return lo($,function(c,p){Jt.call($.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),$.VERSION=e,li(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),li(["drop","take"],function(a,c){Ot.prototype[a]=function(p){p=p===r?1:Ar(At(p),0);var T=this.__filtered__&&!c?new Ot(this):this.clone();return T.__filtered__?T.__takeCount__=Wr(p,T.__takeCount__):T.__views__.push({size:Wr(p,y),type:a+(T.__dir__<0?"Right":"")}),T},Ot.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),li(["filter","map","takeWhile"],function(a,c){var p=c+1,T=p==g||p==l;Ot.prototype[a]=function(U){var K=this.clone();return K.__iteratees__.push({iteratee:Ze(U,3),type:p}),K.__filtered__=K.__filtered__||T,K}}),li(["head","last"],function(a,c){var p="take"+(c?"Right":"");Ot.prototype[a]=function(){return this[p](1).value()[0]}}),li(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");Ot.prototype[a]=function(){return this.__filtered__?new Ot(this):this[p](1)}}),Ot.prototype.compact=function(){return this.filter(_n)},Ot.prototype.find=function(a){return this.filter(a).head()},Ot.prototype.findLast=function(a){return this.reverse().find(a)},Ot.prototype.invokeMap=Ct(function(a,c){return typeof a=="function"?new Ot(this):this.map(function(p){return wu(p,a,c)})}),Ot.prototype.reject=function(a){return this.filter(Uh(Ze(a)))},Ot.prototype.slice=function(a,c){a=At(a);var p=this;return p.__filtered__&&(a>0||c<0)?new Ot(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==r&&(c=At(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ot.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ot.prototype.toArray=function(){return this.take(y)},lo(Ot.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),T=/^(?:head|last)$/.test(c),U=$[T?"take"+(c=="last"?"Right":""):c],K=T||/^find/.test(c);!U||($.prototype[c]=function(){var re=this.__wrapped__,ce=T?[1]:arguments,be=re instanceof Ot,Te=ce[0],Ce=be||wt(re),De=o(function(It){var Nt=U.apply($,Ts([It],ce));return T&&Le?Nt[0]:Nt},"interceptor");Ce&&p&&typeof Te=="function"&&Te.length!=1&&(be=Ce=!1);var Le=this.__chain__,Ke=!!this.__actions__.length,et=K&&!Le,St=be&&!Ke;if(!K&&Ce){re=St?re:new Ot(this);var tt=a.apply(re,ce);return tt.__actions__.push({func:Nh,args:[De],thisArg:r}),new di(tt,Le)}return et&&St?a.apply(this,ce):(tt=this.thru(De),et?T?tt.value()[0]:tt.value():tt)})}),li(["pop","push","shift","sort","splice","unshift"],function(a){var c=sh[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",T=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var U=arguments;if(T&&!this.__chain__){var K=this.value();return c.apply(wt(K)?K:[],U)}return this[p](function(re){return c.apply(wt(re)?re:[],U)})}}),lo(Ot.prototype,function(a,c){var p=$[c];if(p){var T=p.name+"";Jt.call(jf,T)||(jf[T]=[]),jf[T].push({name:c,func:p})}}),jf[Th(r,B).name]=[{name:"wrapper",func:r}],Ot.prototype.clone=bS,Ot.prototype.reverse=gS,Ot.prototype.value=vS,$.prototype.at=GT,$.prototype.chain=WT,$.prototype.commit=JT,$.prototype.next=YT,$.prototype.plant=ZT,$.prototype.reverse=QT,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=eC,$.prototype.first=$.prototype.head,pu&&($.prototype[pu]=XT),$},"runInContext"),ks=J7();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Cr._=ks,define(function(){return ks})):Ta?((Ta.exports=ks)._=ks,Lp._=ks):Cr._=ks}).call(Xf)});function Ba(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var Du=Vt(()=>{o(Ba,"asUint8Array")});function Ru(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ba(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var jh=Vt(()=>{Du();o(Ru,"allocUnsafe")});var m3={};Xt(m3,{concat:()=>Fi});function Fi(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=Ru(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ba(t)}var Hm=Vt(()=>{jh();Du();o(Fi,"concat")});function _D(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),v=Math.log(u)/Math.log(256),x=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 B=0,Y=0,P=0,J=I.length;P!==J&&I[P]===0;)P++,B++;for(var ee=(J-P)*x+1>>>0,X=new Uint8Array(ee);P!==J;){for(var ne=I[P],V=0,H=ee-1;(ne!==0||V<Y)&&H!==-1;H--,V++)ne+=256*X[H]>>>0,X[H]=ne%u>>>0,ne=ne/u>>>0;if(ne!==0)throw new Error("Non-zero carry");Y=V,P++}for(var z=ee-Y;z!==ee&&X[z]===0;)z++;for(var he=d.repeat(B);z<ee;++z)he+=r.charAt(X[z]);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 B=0;if(I[B]!==" "){for(var Y=0,P=0;I[B]===d;)Y++,B++;for(var J=(I.length-B)*v+1>>>0,ee=new Uint8Array(J);I[B];){var X=t[I.charCodeAt(B)];if(X===255)return;for(var ne=0,V=J-1;(X!==0||ne<P)&&V!==-1;V--,ne++)X+=u*ee[V]>>>0,ee[V]=X%256>>>0,X=X/256>>>0;if(X!==0)throw new Error("Non-zero carry");P=ne,B++}if(I[B]!==" "){for(var H=J-P;H!==J&&ee[H]===0;)H++;for(var z=new Uint8Array(Y+(J-H)),he=Y;H!==J;)z[he++]=ee[H++];return z}}}o(O,"decodeUnsafe");function R(I){var B=O(I);if(B)return B;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:E,decodeUnsafe:O,decode:R}}var ED,AD,b3,g3=Vt(()=>{o(_D,"base");ED=_D,AD=ED,b3=AD});var CK,v3,Qo,y3,x3,Bs=Vt(()=>{CK=new Uint8Array(0),v3=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"),Qo=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"),y3=o(r=>new TextEncoder().encode(r),"fromString"),x3=o(r=>new TextDecoder().decode(r),"toString")});var Kh,Vh,Gh,w3,Wh,Zf,Ls,SD,MD,hr,$i=Vt(()=>{g3();Bs();Kh=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(Kh,"Encoder");Vh=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 w3(this,e)}};o(Vh,"Decoder");Gh=class{constructor(e){this.decoders=e}or(e){return w3(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(Gh,"ComposedDecoder");w3=o((r,e)=>new Gh({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),"or"),Wh=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Kh(e,t,n),this.decoder=new Vh(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Wh,"Codec");Zf=o(({name:r,prefix:e,encode:t,decode:n})=>new Wh(r,e,t,n),"from"),Ls=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=b3(t,e);return Zf({prefix:r,name:e,encode:n,decode:s=>Qo(i(s))})},"baseX"),SD=o((r,e,t,n)=>{let i={};for(let x=0;x<e.length;++x)i[e[x]]=x;let s=r.length;for(;r[s-1]==="=";)--s;let f=new Uint8Array(s*t/8|0),u=0,d=0,v=0;for(let x=0;x<s;++x){let E=i[r[x]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|E,u+=t,u>=8&&(u-=8,f[v++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return f},"decode"),MD=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"),hr=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Zf({prefix:e,name:r,encode(i){return MD(i,n,t)},decode(i){return SD(i,n,t,r)}}),"rfc4648")});var jm={};Xt(jm,{identity:()=>TD});var TD,_3=Vt(()=>{$i();Bs();TD=Zf({prefix:"\0",name:"identity",encode:r=>x3(r),decode:r=>y3(r)})});var Km={};Xt(Km,{base2:()=>CD});var CD,E3=Vt(()=>{$i();CD=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Vm={};Xt(Vm,{base8:()=>kD});var kD,A3=Vt(()=>{$i();kD=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Gm={};Xt(Gm,{base10:()=>ID});var ID,S3=Vt(()=>{$i();ID=Ls({prefix:"9",name:"base10",alphabet:"0123456789"})});var Wm={};Xt(Wm,{base16:()=>DD,base16upper:()=>RD});var DD,RD,M3=Vt(()=>{$i();DD=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),RD=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Jm={};Xt(Jm,{base32:()=>Qf,base32hex:()=>BD,base32hexpad:()=>UD,base32hexpadupper:()=>FD,base32hexupper:()=>LD,base32pad:()=>ND,base32padupper:()=>PD,base32upper:()=>OD,base32z:()=>$D});var Qf,OD,ND,PD,BD,LD,UD,FD,$D,Ym=Vt(()=>{$i();Qf=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),OD=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ND=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),PD=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),BD=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),LD=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),UD=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),FD=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$D=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Xm={};Xt(Xm,{base36:()=>qi,base36upper:()=>qD});var qi,qD,ec=Vt(()=>{$i();qi=Ls({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qD=Ls({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Zm={};Xt(Zm,{base58btc:()=>vi,base58flickr:()=>HD});var vi,HD,Jh=Vt(()=>{$i();vi=Ls({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),HD=Ls({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Qm={};Xt(Qm,{base64:()=>zD,base64pad:()=>jD,base64url:()=>La,base64urlpad:()=>KD});var zD,jD,La,KD,Yh=Vt(()=>{$i();zD=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jD=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),La=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),KD=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var e1={};Xt(e1,{base256emoji:()=>YD});function WD(r){return r.reduce((e,t)=>(e+=VD[t],e),"")}function JD(r){let e=[];for(let t of r){let n=GD[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var T3,VD,GD,YD,C3=Vt(()=>{$i();T3=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=T3.reduce((r,e,t)=>(r[t]=e,r),[]),GD=T3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(WD,"encode");o(JD,"decode");YD=Zf({prefix:"\u{1F680}",name:"base256emoji",encode:WD,decode:JD})});function D3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=eR;)e[t++]=r&255|k3,r/=128;for(;r&QD;)e[t++]=r&255|k3,r>>>=7;return e[t]=r|0,D3.bytes=t-n+1,e}function t1(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw t1.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&I3)<<i:(f&I3)*Math.pow(2,i),i+=7}while(f>=rR);return t1.bytes=s-n,t}var XD,k3,ZD,QD,eR,tR,rR,I3,nR,iR,oR,sR,aR,fR,cR,uR,lR,hR,dR,pR,Ou,R3=Vt(()=>{XD=D3,k3=128,ZD=127,QD=~ZD,eR=Math.pow(2,31);o(D3,"encode");tR=t1,rR=128,I3=127;o(t1,"read");nR=Math.pow(2,7),iR=Math.pow(2,14),oR=Math.pow(2,21),sR=Math.pow(2,28),aR=Math.pow(2,35),fR=Math.pow(2,42),cR=Math.pow(2,49),uR=Math.pow(2,56),lR=Math.pow(2,63),hR=o(function(r){return r<nR?1:r<iR?2:r<oR?3:r<sR?4:r<aR?5:r<fR?6:r<cR?7:r<uR?8:r<lR?9:10},"length"),dR={encode:XD,decode:tR,encodingLength:hR},pR=dR,Ou=pR});var Nu,tc,rc,Zh=Vt(()=>{R3();Nu=o((r,e=0)=>[Ou.decode(r,e),Ou.decode.bytes],"decode"),tc=o((r,e,t=0)=>(Ou.encode(r,e,t),e),"encodeTo"),rc=o(r=>Ou.encodingLength(r),"encodingLength")});var es,Qh,O3,Ua,Fa=Vt(()=>{Bs();Zh();es=o((r,e)=>{let t=e.byteLength,n=rc(r),i=n+rc(t),s=new Uint8Array(i+t);return tc(r,s,0),tc(t,s,n),s.set(e,i),new Ua(r,t,e,s)},"create"),Qh=o(r=>{let e=Qo(r),[t,n]=Nu(e),[i,s]=Nu(e.subarray(n)),f=e.subarray(n+s);if(f.byteLength!==i)throw new Error("Incorrect length");return new Ua(t,i,f,e)},"decode"),O3=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&v3(r.bytes,e.bytes),"equals"),Ua=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Ua,"Digest")});var r1,ed,n1=Vt(()=>{Fa();r1=o(({name:r,code:e,encode:t})=>new ed(r,e,t),"from"),ed=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?es(this.code,t):t.then(n=>es(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(ed,"Hasher")});var i1={};Xt(i1,{sha256:()=>Us,sha512:()=>mR});var P3,Us,mR,Bu=Vt(()=>{n1();P3=o(r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),"sha"),Us=r1({name:"sha2-256",code:18,encode:P3("SHA-256")}),mR=r1({name:"sha2-512",code:19,encode:P3("SHA-512")})});var o1={};Xt(o1,{identity:()=>td});var B3,bR,L3,gR,td,s1=Vt(()=>{Bs();Fa();B3=0,bR="identity",L3=Qo,gR=o(r=>es(B3,L3(r)),"digest"),td={code:B3,name:bR,encode:L3,digest:gR}});var U3=Vt(()=>{Bs()});var JK,YK,F3=Vt(()=>{JK=new TextEncoder,YK=new TextDecoder});var Ye,xR,wR,_R,Lu,ER,$3,q3,rd,nd,AR,SR,MR,Hi=Vt(()=>{Zh();Fa();Jh();Ym();Bs();Ye=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:nd,byteLength:nd,code:rd,version:rd,multihash:rd,bytes:rd,_baseCache:nd,asCID:nd})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Lu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ER)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ye.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=es(e,t);return Ye.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&&O3(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return wR(t,i,e||vi.encoder);default:return _R(t,i,e||Qf.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 SR(/^0\.0/,MR),!!(e&&(e[q3]||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 Ye)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Ye(t,n,i,s||$3(t,n,i.bytes))}else if(e!=null&&e[q3]===!0){let{version:t,multihash:n,code:i}=e,s=Qh(n);return Ye.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!==Lu)throw new Error(`Version 0 CID must use dag-pb (code: ${Lu}) block encoding`);return new Ye(e,t,n,n.bytes)}case 1:{let i=$3(e,t,n.bytes);return new Ye(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Ye.create(0,Lu,e)}static createV1(e,t){return Ye.create(1,e,t)}static decode(e){let[t,n]=Ye.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Ye.inspectBytes(e),n=t.size-t.multihashSize,i=Qo(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 Ua(t.multihashCode,t.digestSize,s,i);return[t.version===0?Ye.createV0(f):Ye.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[E,O]=Nu(e.subarray(t));return t+=O,E},"next"),i=n(),s=Lu;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(),v=t+d,x=v-f;return{version:i,codec:s,multihashCode:u,digestSize:d,multihashSize:x,size:v}}static parse(e,t){let[n,i]=xR(e,t),s=Ye.decode(i);return s._baseCache.set(n,e),s}};o(Ye,"CID");xR=o((r,e)=>{switch(r[0]){case"Q":{let t=e||vi;return[vi.prefix,t.decode(`${vi.prefix}${r}`)]}case vi.prefix:{let t=e||vi;return[vi.prefix,t.decode(r)]}case Qf.prefix:{let t=e||Qf;return[Qf.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"),wR=o((r,e,t)=>{let{prefix:n}=t;if(n!==vi.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"),_R=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"),Lu=112,ER=18,$3=o((r,e,t)=>{let n=rc(r),i=n+rc(e),s=new Uint8Array(i+t.byteLength);return tc(r,s,0),tc(e,s,n),s.set(t,i),s},"encodeCID"),q3=Symbol.for("@ipld/js-cid/CID"),rd={writable:!1,configurable:!1,enumerable:!0},nd={writable:!1,enumerable:!1,configurable:!1},AR="0.0.0-dev",SR=o((r,e)=>{if(r.test(AR))console.warn(e);else throw new Error(e)},"deprecate"),MR=`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,11 +31,11 @@ if (cid) {
31
31
  // Make sure to use cid instead of value
32
32
  doSomethingWithCID(cid)
33
33
  }
34
- `});var o1=Vt(()=>{Hi();Xh();Bs();t1();Fa()});var Lu,YK,s1=Vt(()=>{w3();_3();E3();A3();S3();Wm();ec();Wh();Jh();T3();Pu();i1();L3();U3();o1();Lu={...Hm,...zm,...jm,...Km,...Vm,...Gm,...Jm,...Ym,...Xm,...Zm},YK={...r1,...n1}});function H3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var q3,a1,ER,nd,f1=Vt(()=>{s1();zh();o(H3,"createCodec");q3=H3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),a1=H3("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=Du(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),ER={utf8:q3,"utf-8":q3,hex:Lu.base16,latin1:a1,ascii:a1,binary:a1,...Lu},nd=ER});var z3={};Xt(z3,{fromString:()=>Ft});function Ft(r,e="utf8"){let t=nd[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ba(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var id=Vt(()=>{f1();Iu();o(Ft,"fromString")});var j3={};Xt(j3,{toString:()=>Dt});function Dt(r,e="utf8"){let t=nd[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 nc=Vt(()=>{f1();o(Dt,"toString")});var K3=Re(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});function AR(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(AR,"imulShim");zn.mul=Math.imul||AR;function SR(r,e){return r+e|0}o(SR,"add");zn.add=SR;function MR(r,e){return r-e|0}o(MR,"sub");zn.sub=MR;function TR(r,e){return r<<e|r>>>32-e}o(TR,"rotl");zn.rotl=TR;function CR(r,e){return r<<32-e|r>>>e}o(CR,"rotr");zn.rotr=CR;function kR(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(kR,"isIntegerShim");zn.isInteger=Number.isInteger||kR;zn.MAX_SAFE_INTEGER=9007199254740991;zn.isSafeInteger=function(r){return zn.isInteger(r)&&r>=-zn.MAX_SAFE_INTEGER&&r<=zn.MAX_SAFE_INTEGER}});var $a=Re(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});var V3=K3();function IR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(IR,"readInt16BE");kt.readInt16BE=IR;function DR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(DR,"readUint16BE");kt.readUint16BE=DR;function RR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(RR,"readInt16LE");kt.readInt16LE=RR;function OR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(OR,"readUint16LE");kt.readUint16LE=OR;function G3(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(G3,"writeUint16BE");kt.writeUint16BE=G3;kt.writeInt16BE=G3;function W3(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(W3,"writeUint16LE");kt.writeUint16LE=W3;kt.writeInt16LE=W3;function c1(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(c1,"readInt32BE");kt.readInt32BE=c1;function u1(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(u1,"readUint32BE");kt.readUint32BE=u1;function l1(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(l1,"readInt32LE");kt.readInt32LE=l1;function h1(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(h1,"readUint32LE");kt.readUint32LE=h1;function od(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(od,"writeUint32BE");kt.writeUint32BE=od;kt.writeInt32BE=od;function sd(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(sd,"writeUint32LE");kt.writeUint32LE=sd;kt.writeInt32LE=sd;function NR(r,e){e===void 0&&(e=0);var t=c1(r,e),n=c1(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(NR,"readInt64BE");kt.readInt64BE=NR;function PR(r,e){e===void 0&&(e=0);var t=u1(r,e),n=u1(r,e+4);return t*4294967296+n}o(PR,"readUint64BE");kt.readUint64BE=PR;function BR(r,e){e===void 0&&(e=0);var t=l1(r,e),n=l1(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(BR,"readInt64LE");kt.readInt64LE=BR;function LR(r,e){e===void 0&&(e=0);var t=h1(r,e),n=h1(r,e+4);return n*4294967296+t}o(LR,"readUint64LE");kt.readUint64LE=LR;function J3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),od(r/4294967296>>>0,e,t),od(r>>>0,e,t+4),e}o(J3,"writeUint64BE");kt.writeUint64BE=J3;kt.writeInt64BE=J3;function Y3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),sd(r>>>0,e,t),sd(r/4294967296>>>0,e,t+4),e}o(Y3,"writeUint64LE");kt.writeUint64LE=Y3;kt.writeInt64LE=Y3;function UR(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(UR,"readUintBE");kt.readUintBE=UR;function FR(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(FR,"readUintLE");kt.readUintLE=FR;function $R(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(!V3.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($R,"writeUintBE");kt.writeUintBE=$R;function qR(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(!V3.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(qR,"writeUintLE");kt.writeUintLE=qR;function HR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(HR,"readFloat32BE");kt.readFloat32BE=HR;function zR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(zR,"readFloat32LE");kt.readFloat32LE=zR;function jR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(jR,"readFloat64BE");kt.readFloat64BE=jR;function KR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(KR,"readFloat64LE");kt.readFloat64LE=KR;function VR(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(VR,"writeFloat32BE");kt.writeFloat32BE=VR;function GR(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(GR,"writeFloat32LE");kt.writeFloat32LE=GR;function WR(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(WR,"writeFloat64BE");kt.writeFloat64BE=WR;function JR(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(JR,"writeFloat64LE");kt.writeFloat64LE=JR});var xi=Re(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});function YR(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(YR,"wipe");d1.wipe=YR});var Z3=Re(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var fd=$a(),ad=xi();Fs.DIGEST_LENGTH=32;Fs.BLOCK_SIZE=64;var X3=function(){function r(){this.digestLength=Fs.DIGEST_LENGTH,this.blockSize=Fs.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(){ad.wipe(this._buffer),ad.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&&(p1(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=p1(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;fd.writeUint32BE(i,this._buffer,f-8),fd.writeUint32BE(s,this._buffer,f-4),p1(this._temp,this._state,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)fd.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){ad.wipe(e.state),e.buffer&&ad.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Fs.SHA256=X3;var XR=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 p1(r,e,t,n,i){for(;i>=64;){for(var s=e[0],f=e[1],u=e[2],d=e[3],v=e[4],x=e[5],E=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;r[R]=fd.readUint32BE(t,I)}for(var R=16;R<64;R++){var B=r[R-2],Y=(B>>>17|B<<32-17)^(B>>>19|B<<32-19)^B>>>10;B=r[R-15];var P=(B>>>7|B<<32-7)^(B>>>18|B<<32-18)^B>>>3;r[R]=(Y+r[R-7]|0)+(P+r[R-16]|0)}for(var R=0;R<64;R++){var Y=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&x^~v&E)|0)+(O+(XR[R]+r[R]|0)|0)|0,P=((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=x,x=v,v=d+Y|0,d=u,u=f,f=s,s=Y+P|0}e[0]+=s,e[1]+=f,e[2]+=u,e[3]+=d,e[4]+=v,e[5]+=x,e[6]+=E,e[7]+=O,n+=64,i-=64}return n}o(p1,"hashBlocks");function ZR(r){var e=new X3;e.update(r);var t=e.digest();return e.clean(),t}o(ZR,"hash");Fs.hash=ZR});var m1=Re((xV,cd)=>{(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 cd=="object"&&cd.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),x=[31,7936,2031616,520093696],E=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],B=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Y=[224,256,384,512],P=[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 X=o(function(D,Q,se){return function(q){return new w(D,Q,D).update(q)[se]()}},"createOutputMethod"),ne=o(function(D,Q,se){return function(q,j){return new w(D,Q,j).update(q)[se]()}},"createShakeOutputMethod"),V=o(function(D,Q,se){return function(q,j,G,te){return l["cshake"+D].update(q,j,G,te)[se]()}},"createCshakeOutputMethod"),H=o(function(D,Q,se){return function(q,j,G,te){return l["kmac"+D].update(q,j,G,te)[se]()}},"createKmacOutputMethod"),z=o(function(D,Q,se,q){for(var j=0;j<J.length;++j){var G=J[j];D[G]=Q(se,q,G)}return D},"createOutputMethods"),he=o(function(D,Q){var se=X(D,Q,"hex");return se.create=function(){return new w(D,Q,D)},se.update=function(q){return se.create().update(q)},z(se,X,D,Q)},"createMethod"),L=o(function(D,Q){var se=ne(D,Q,"hex");return se.create=function(q){return new w(D,Q,q)},se.update=function(q,j){return se.create(j).update(q)},z(se,ne,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=ee[D],q=V(D,Q,"hex");return q.create=function(j,G,te){return!G&&!te?l["shake"+D].create(j):new w(D,Q,j).bytepad([G,te],se)},q.update=function(j,G,te,ae){return q.create(G,te,ae).update(j)},z(q,V,D,Q)},"createCshakeMethod"),g=o(function(D,Q){var se=ee[D],q=H(D,Q,"hex");return q.create=function(j,G,te){return new k(D,Q,G).bytepad(["KMAC",te],se).bytepad([j],se)},q.update=function(j,G,te,ae){return q.create(j,te,ae).update(G)},z(q,H,D,Q)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:Y,createMethod:he},{name:"sha3",padding:R,bits:Y,createMethod:he},{name:"shake",padding:x,bits:P,createMethod:L},{name:"cshake",padding:E,bits:P,createMethod:h},{name:"kmac",padding:E,bits:P,createMethod:g}],l={},m=[],_=0;_<b.length;++_)for(var S=b[_],A=S.bits,y=0;y<A.length;++y){var C=S.name+"_"+A[y];if(m.push(C),l[C]=S.createMethod(A[y],S.padding),S.name!=="sha3"){var N=S.name+A[y];m.push(N),l[N]=l[C]}}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 q=0;q<50;++q)this.s[q]=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 q=this.blocks,j=this.byteCount,G=D.length,te=this.blockCount,ae=0,Ae=this.s,ge,ie;ae<G;){if(this.reset)for(this.reset=!1,q[0]=this.block,ge=1;ge<te+1;++ge)q[ge]=0;if(Q)for(ge=this.start;ae<G&&ge<j;++ae)q[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<G&&ge<j;++ae)ie=D.charCodeAt(ae),ie<128?q[ge>>2]|=ie<<I[ge++&3]:ie<2048?(q[ge>>2]|=(192|ie>>6)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):ie<55296||ie>=57344?(q[ge>>2]|=(224|ie>>12)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):(ie=65536+((ie&1023)<<10|D.charCodeAt(++ae)&1023),q[ge>>2]|=(240|ie>>18)<<I[ge++&3],q[ge>>2]|=(128|ie>>12&63)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=j){for(this.start=ge-j,this.block=q[te],ge=0;ge<te;++ge)Ae[ge]^=q[ge];fe(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(D,Q){var se=D&255,q=1,j=[se];for(D=D>>8,se=D&255;se>0;)j.unshift(se),D=D>>8,se=D&255,++q;return Q?j.push(q):j.unshift(q),this.update(j),j.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 q=0,j=D.length;if(Q)q=j;else for(var G=0;G<D.length;++G){var te=D.charCodeAt(G);te<128?q+=1:te<2048?q+=2:te<55296||te>=57344?q+=3:(te=65536+((te&1023)<<10|D.charCodeAt(++G)&1023),q+=4)}return q+=this.encode(q*8),this.update(D),q},w.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),q=0;q<D.length;++q)se+=this.encodeString(D[q]);var j=Q-se%Q,G=[];return G.length=j,this.update(G),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,q=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)q[Q]^=D[Q];fe(q)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,j=0,G=0,te="",ae;G<se;){for(j=0;j<D&&G<se;++j,++G)ae=Q[j],te+=v[ae>>4&15]+v[ae&15]+v[ae>>12&15]+v[ae>>8&15]+v[ae>>20&15]+v[ae>>16&15]+v[ae>>28&15]+v[ae>>24&15];G%D===0&&(fe(Q),j=0)}return q&&(ae=Q[j],te+=v[ae>>4&15]+v[ae&15],q>1&&(te+=v[ae>>12&15]+v[ae>>8&15]),q>2&&(te+=v[ae>>20&15]+v[ae>>16&15])),te},w.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,j=0,G=0,te=this.outputBits>>3,ae;q?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(te);for(var Ae=new Uint32Array(ae);G<se;){for(j=0;j<D&&G<se;++j,++G)Ae[G]=Q[j];G%D===0&&fe(Q)}return q&&(Ae[j]=Q[j],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,q=this.extraBytes,j=0,G=0,te=[],ae,Ae;G<se;){for(j=0;j<D&&G<se;++j,++G)ae=G<<2,Ae=Q[j],te[ae]=Ae&255,te[ae+1]=Ae>>8&255,te[ae+2]=Ae>>16&255,te[ae+3]=Ae>>24&255;G%D===0&&fe(Q)}return q&&(ae=G<<2,Ae=Q[j],te[ae]=Ae&255,q>1&&(te[ae+1]=Ae>>8&255),q>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,q,j,G,te,ae,Ae,ge,ie,Me,ue,ve,W,pe,ke,je,Pe,Je,gr,le,oe,F,Z,me,ye,we,Ie,Rt,Fe,Ne,Lt,Ve,Xe,Pn,st,at,ii,ft,rt,oi,ct,ut,pn,lt,Qe,si,ht,dt,ai,pt,mt,fi,bt,nt,Bn,qt,Ht,mn,bn,gn,Fr,vn;for(q=0;q<48;q+=2)j=D[0]^D[10]^D[20]^D[30]^D[40],G=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],ie=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=j^(Ae<<1|ge>>>31),se=G^(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^(ie<<1|Me>>>31),se=ae^(Me<<1|ie>>>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=ie^(j<<1|G>>>31),se=Me^(G<<1|j>>>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],Qe=D[11]<<4|D[10]>>>28,si=D[10]<<4|D[11]>>>28,Ie=D[20]<<3|D[21]>>>29,Rt=D[21]<<3|D[20]>>>29,bn=D[31]<<9|D[30]>>>23,gn=D[30]<<9|D[31]>>>23,ct=D[40]<<18|D[41]>>>14,ut=D[41]<<18|D[40]>>>14,Xe=D[2]<<1|D[3]>>>31,Pn=D[3]<<1|D[2]>>>31,ke=D[13]<<12|D[12]>>>20,je=D[12]<<12|D[13]>>>20,ht=D[22]<<10|D[23]>>>22,dt=D[23]<<10|D[22]>>>22,Fe=D[33]<<13|D[32]>>>19,Ne=D[32]<<13|D[33]>>>19,Fr=D[42]<<2|D[43]>>>30,vn=D[43]<<2|D[42]>>>30,bt=D[5]<<30|D[4]>>>2,nt=D[4]<<30|D[5]>>>2,st=D[14]<<6|D[15]>>>26,at=D[15]<<6|D[14]>>>26,Pe=D[25]<<11|D[24]>>>21,Je=D[24]<<11|D[25]>>>21,ai=D[34]<<15|D[35]>>>17,pt=D[35]<<15|D[34]>>>17,Lt=D[45]<<29|D[44]>>>3,Ve=D[44]<<29|D[45]>>>3,Z=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Bn=D[17]<<23|D[16]>>>9,qt=D[16]<<23|D[17]>>>9,ii=D[26]<<25|D[27]>>>7,ft=D[27]<<25|D[26]>>>7,gr=D[36]<<21|D[37]>>>11,le=D[37]<<21|D[36]>>>11,mt=D[47]<<24|D[46]>>>8,fi=D[46]<<24|D[47]>>>8,pn=D[8]<<27|D[9]>>>5,lt=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,mn=D[28]<<7|D[29]>>>25,rt=D[38]<<8|D[39]>>>24,oi=D[39]<<8|D[38]>>>24,oe=D[48]<<14|D[49]>>>18,F=D[49]<<14|D[48]>>>18,D[0]=W^~ke&Pe,D[1]=pe^~je&Je,D[10]=Z^~ye&Ie,D[11]=me^~we&Rt,D[20]=Xe^~st&ii,D[21]=Pn^~at&ft,D[30]=pn^~Qe&ht,D[31]=lt^~si&dt,D[40]=bt^~Bn&Ht,D[41]=nt^~qt&mn,D[2]=ke^~Pe&gr,D[3]=je^~Je&le,D[12]=ye^~Ie&Fe,D[13]=we^~Rt&Ne,D[22]=st^~ii&rt,D[23]=at^~ft&oi,D[32]=Qe^~ht&ai,D[33]=si^~dt&pt,D[42]=Bn^~Ht&bn,D[43]=qt^~mn&gn,D[4]=Pe^~gr&oe,D[5]=Je^~le&F,D[14]=Ie^~Fe&Lt,D[15]=Rt^~Ne&Ve,D[24]=ii^~rt&ct,D[25]=ft^~oi&ut,D[34]=ht^~ai&mt,D[35]=dt^~pt&fi,D[44]=Ht^~bn&Fr,D[45]=mn^~gn&vn,D[6]=gr^~oe&W,D[7]=le^~F&pe,D[16]=Fe^~Lt&Z,D[17]=Ne^~Ve&me,D[26]=rt^~ct&Xe,D[27]=oi^~ut&Pn,D[36]=ai^~mt&pn,D[37]=pt^~fi&lt,D[46]=bn^~Fr&bt,D[47]=gn^~vn&nt,D[8]=oe^~W&ke,D[9]=F^~pe&je,D[18]=Lt^~Z&ye,D[19]=Ve^~me&we,D[28]=ct^~Xe&st,D[29]=ut^~Pn&at,D[38]=mt^~pn&Qe,D[39]=fi^~lt&si,D[48]=Fr^~bt&Bn,D[49]=vn^~nt&qt,D[0]^=B[q],D[1]^=B[q+1]},"f");if(f)cd.exports=l;else{for(_=0;_<m.length;++_)n[m[_]]=l[m[_]];u&&define(function(){return l})}})()});var Q3=Re((wV,QR)=>{QR.exports={name:"elliptic",version:"6.6.1",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 b1=Re(()=>{});var mo=Re((ex,g1)=>{(function(r,e){"use strict";function t(L,h){if(!L)throw new Error(h||"Assertion failed")}o(t,"assert");function n(L,h){L.super_=h;var g=o(function(){},"TempCtor");g.prototype=h.prototype,L.prototype=new g,L.prototype.constructor=L}o(n,"inherits");function i(L,h,g){if(i.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((h==="le"||h==="be")&&(g=h,h=10),this._init(L||0,h||10,g||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=b1().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,g){return h.cmp(g)>0?h:g},"max"),i.min=o(function(h,g){return h.cmp(g)<0?h:g},"min"),i.prototype._init=o(function(h,g,b){if(typeof h=="number")return this._initNumber(h,g,b);if(typeof h=="object")return this._initArray(h,g,b);g==="hex"&&(g=16),t(g===(g|0)&&g>=2&&g<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(g===16?this._parseHex(h,l,b):(this._parseBase(h,g,l),b==="le"&&this._initArray(this.toArray(),g,b)))},"init"),i.prototype._initNumber=o(function(h,g,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(),g,b)},"_initNumber"),i.prototype._initArray=o(function(h,g,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(L,h){var g=L.charCodeAt(h);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}o(f,"parseHex4Bits");function u(L,h,g){var b=f(L,g);return g-1>=h&&(b|=f(L,g-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,g,b){this.length=Math.ceil((h.length-g)/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>=g;l-=2)S=u(h,g,l)<<m,this.words[_]|=S&67108863,m>=18?(m-=18,_+=1,this.words[_]|=S>>>26):m+=8;else{var A=h.length-g;for(l=A%2===0?g+1:g;l<h.length;l+=2)S=u(h,g,l)<<m,this.words[_]|=S&67108863,m>=18?(m-=18,_+=1,this.words[_]|=S>>>26):m+=8}this.strip()},"_parseHex");function d(L,h,g,b){for(var l=0,m=Math.min(L.length,g),_=h;_<m;_++){var S=L.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,g,b){this.words=[0],this.length=1;for(var l=0,m=1;m<=67108863;m*=g)l++;l--,m=m/g|0;for(var _=h.length-b,S=_%l,A=Math.min(_,_-S)+b,y=0,C=b;C<A;C+=l)y=d(h,C,C+l,g),this.imuln(m),this.words[0]+y<67108864?this.words[0]+=y:this._iaddn(y);if(S!==0){var N=1;for(y=d(h,C,h.length,g),C=0;C<S;C++)N*=g;this.imuln(N),this.words[0]+y<67108864?this.words[0]+=y:this._iaddn(y)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var g=0;g<this.length;g++)h.words[g]=this.words[g];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 v=["","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"],x=[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,g){h=h||10,g=g|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,l+=2,l>=26&&(l-=26,_--),m!==0||_!==this.length-1?b=v[6-A.length]+A+b:b=A+b}for(m!==0&&(b=m.toString(16)+b);b.length%g!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var y=x[h],C=E[h];b="";var N=this.clone();for(N.negative=0;!N.isZero();){var w=N.modn(C).toString(h);N=N.idivn(C),N.isZero()?b=w+b:b=v[y-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%g!==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,g){return t(typeof s<"u"),this.toArrayLike(s,h,g)},"toBuffer"),i.prototype.toArray=o(function(h,g){return this.toArrayLike(Array,h,g)},"toArray"),i.prototype.toArrayLike=o(function(h,g,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 _=g==="le",S=new h(m),A,y,C=this.clone();if(_){for(y=0;!C.isZero();y++)A=C.andln(255),C.iushrn(8),S[y]=A;for(;y<m;y++)S[y]=0}else{for(y=0;y<m-l;y++)S[y]=0;for(y=0;!C.isZero();y++)A=C.andln(255),C.iushrn(8),S[m-y-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 g=h,b=0;return g>=4096&&(b+=13,g>>>=13),g>=64&&(b+=7,g>>>=7),g>=8&&(b+=4,g>>>=4),g>=2&&(b+=2,g>>>=2),b+g},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var g=h,b=0;return(g&8191)===0&&(b+=13,g>>>=13),(g&127)===0&&(b+=7,g>>>=7),(g&15)===0&&(b+=4,g>>>=4),(g&3)===0&&(b+=2,g>>>=2),(g&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],g=this._countBits(h);return(this.length-1)*26+g},"bitLength");function O(L){for(var h=new Array(L.bitLength()),g=0;g<h.length;g++){var b=g/26|0,l=g%26;h[g]=(L.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,g=0;g<this.length;g++){var b=this._zeroBits(this.words[g]);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 g=0;g<h.length;g++)this.words[g]=this.words[g]|h.words[g];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 g;this.length>h.length?g=h:g=this;for(var b=0;b<g.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=g.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 g,b;this.length>h.length?(g=this,b=h):(g=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=g.words[l]^b.words[l];if(this!==g)for(;l<g.length;l++)this.words[l]=g.words[l];return this.length=g.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 g=Math.ceil(h/26)|0,b=h%26;this._expand(g),b>0&&g--;for(var l=0;l<g;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,g){t(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),g?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 g;if(this.negative!==0&&h.negative===0)return this.negative=0,g=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,g=this.isub(h),h.negative=1,g._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var m=0,_=0;_<l.length;_++)g=(b.words[_]|0)+(l.words[_]|0)+m,this.words[_]=g&67108863,m=g>>>26;for(;m!==0&&_<b.length;_++)g=(b.words[_]|0)+m,this.words[_]=g&67108863,m=g>>>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 g;return h.negative!==0&&this.negative===0?(h.negative=0,g=this.sub(h),h.negative^=1,g):h.negative===0&&this.negative!==0?(this.negative=0,g=h.sub(this),this.negative=1,g):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 g=this.iadd(h);return h.negative=1,g._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++)g=(l.words[S]|0)-(m.words[S]|0)+_,_=g>>26,this.words[S]=g&67108863;for(;_!==0&&S<l.length;S++)g=(l.words[S]|0)+_,_=g>>26,this.words[S]=g&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(L,h,g){g.negative=h.negative^L.negative;var b=L.length+h.length|0;g.length=b,b=b-1|0;var l=L.words[0]|0,m=h.words[0]|0,_=l*m,S=_&67108863,A=_/67108864|0;g.words[0]=S;for(var y=1;y<b;y++){for(var C=A>>>26,N=A&67108863,w=Math.min(y,h.length-1),k=Math.max(0,y-L.length+1);k<=w;k++){var fe=y-k|0;l=L.words[fe]|0,m=h.words[k]|0,_=l*m+N,C+=_/67108864|0,N=_&67108863}g.words[y]=N|0,A=C|0}return A!==0?g.words[y]=A|0:g.length--,g.strip()}o(R,"smallMulTo");var I=o(function(h,g,b){var l=h.words,m=g.words,_=b.words,S=0,A,y,C,N=l[0]|0,w=N&8191,k=N>>>13,fe=l[1]|0,D=fe&8191,Q=fe>>>13,se=l[2]|0,q=se&8191,j=se>>>13,G=l[3]|0,te=G&8191,ae=G>>>13,Ae=l[4]|0,ge=Ae&8191,ie=Ae>>>13,Me=l[5]|0,ue=Me&8191,ve=Me>>>13,W=l[6]|0,pe=W&8191,ke=W>>>13,je=l[7]|0,Pe=je&8191,Je=je>>>13,gr=l[8]|0,le=gr&8191,oe=gr>>>13,F=l[9]|0,Z=F&8191,me=F>>>13,ye=m[0]|0,we=ye&8191,Ie=ye>>>13,Rt=m[1]|0,Fe=Rt&8191,Ne=Rt>>>13,Lt=m[2]|0,Ve=Lt&8191,Xe=Lt>>>13,Pn=m[3]|0,st=Pn&8191,at=Pn>>>13,ii=m[4]|0,ft=ii&8191,rt=ii>>>13,oi=m[5]|0,ct=oi&8191,ut=oi>>>13,pn=m[6]|0,lt=pn&8191,Qe=pn>>>13,si=m[7]|0,ht=si&8191,dt=si>>>13,ai=m[8]|0,pt=ai&8191,mt=ai>>>13,fi=m[9]|0,bt=fi&8191,nt=fi>>>13;b.negative=h.negative^g.negative,b.length=19,A=Math.imul(w,we),y=Math.imul(w,Ie),y=y+Math.imul(k,we)|0,C=Math.imul(k,Ie);var Bn=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,A=Math.imul(D,we),y=Math.imul(D,Ie),y=y+Math.imul(Q,we)|0,C=Math.imul(Q,Ie),A=A+Math.imul(w,Fe)|0,y=y+Math.imul(w,Ne)|0,y=y+Math.imul(k,Fe)|0,C=C+Math.imul(k,Ne)|0;var qt=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(qt>>>26)|0,qt&=67108863,A=Math.imul(q,we),y=Math.imul(q,Ie),y=y+Math.imul(j,we)|0,C=Math.imul(j,Ie),A=A+Math.imul(D,Fe)|0,y=y+Math.imul(D,Ne)|0,y=y+Math.imul(Q,Fe)|0,C=C+Math.imul(Q,Ne)|0,A=A+Math.imul(w,Ve)|0,y=y+Math.imul(w,Xe)|0,y=y+Math.imul(k,Ve)|0,C=C+Math.imul(k,Xe)|0;var Ht=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,A=Math.imul(te,we),y=Math.imul(te,Ie),y=y+Math.imul(ae,we)|0,C=Math.imul(ae,Ie),A=A+Math.imul(q,Fe)|0,y=y+Math.imul(q,Ne)|0,y=y+Math.imul(j,Fe)|0,C=C+Math.imul(j,Ne)|0,A=A+Math.imul(D,Ve)|0,y=y+Math.imul(D,Xe)|0,y=y+Math.imul(Q,Ve)|0,C=C+Math.imul(Q,Xe)|0,A=A+Math.imul(w,st)|0,y=y+Math.imul(w,at)|0,y=y+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var mn=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(mn>>>26)|0,mn&=67108863,A=Math.imul(ge,we),y=Math.imul(ge,Ie),y=y+Math.imul(ie,we)|0,C=Math.imul(ie,Ie),A=A+Math.imul(te,Fe)|0,y=y+Math.imul(te,Ne)|0,y=y+Math.imul(ae,Fe)|0,C=C+Math.imul(ae,Ne)|0,A=A+Math.imul(q,Ve)|0,y=y+Math.imul(q,Xe)|0,y=y+Math.imul(j,Ve)|0,C=C+Math.imul(j,Xe)|0,A=A+Math.imul(D,st)|0,y=y+Math.imul(D,at)|0,y=y+Math.imul(Q,st)|0,C=C+Math.imul(Q,at)|0,A=A+Math.imul(w,ft)|0,y=y+Math.imul(w,rt)|0,y=y+Math.imul(k,ft)|0,C=C+Math.imul(k,rt)|0;var bn=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(bn>>>26)|0,bn&=67108863,A=Math.imul(ue,we),y=Math.imul(ue,Ie),y=y+Math.imul(ve,we)|0,C=Math.imul(ve,Ie),A=A+Math.imul(ge,Fe)|0,y=y+Math.imul(ge,Ne)|0,y=y+Math.imul(ie,Fe)|0,C=C+Math.imul(ie,Ne)|0,A=A+Math.imul(te,Ve)|0,y=y+Math.imul(te,Xe)|0,y=y+Math.imul(ae,Ve)|0,C=C+Math.imul(ae,Xe)|0,A=A+Math.imul(q,st)|0,y=y+Math.imul(q,at)|0,y=y+Math.imul(j,st)|0,C=C+Math.imul(j,at)|0,A=A+Math.imul(D,ft)|0,y=y+Math.imul(D,rt)|0,y=y+Math.imul(Q,ft)|0,C=C+Math.imul(Q,rt)|0,A=A+Math.imul(w,ct)|0,y=y+Math.imul(w,ut)|0,y=y+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var gn=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(gn>>>26)|0,gn&=67108863,A=Math.imul(pe,we),y=Math.imul(pe,Ie),y=y+Math.imul(ke,we)|0,C=Math.imul(ke,Ie),A=A+Math.imul(ue,Fe)|0,y=y+Math.imul(ue,Ne)|0,y=y+Math.imul(ve,Fe)|0,C=C+Math.imul(ve,Ne)|0,A=A+Math.imul(ge,Ve)|0,y=y+Math.imul(ge,Xe)|0,y=y+Math.imul(ie,Ve)|0,C=C+Math.imul(ie,Xe)|0,A=A+Math.imul(te,st)|0,y=y+Math.imul(te,at)|0,y=y+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,A=A+Math.imul(q,ft)|0,y=y+Math.imul(q,rt)|0,y=y+Math.imul(j,ft)|0,C=C+Math.imul(j,rt)|0,A=A+Math.imul(D,ct)|0,y=y+Math.imul(D,ut)|0,y=y+Math.imul(Q,ct)|0,C=C+Math.imul(Q,ut)|0,A=A+Math.imul(w,lt)|0,y=y+Math.imul(w,Qe)|0,y=y+Math.imul(k,lt)|0,C=C+Math.imul(k,Qe)|0;var Fr=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,A=Math.imul(Pe,we),y=Math.imul(Pe,Ie),y=y+Math.imul(Je,we)|0,C=Math.imul(Je,Ie),A=A+Math.imul(pe,Fe)|0,y=y+Math.imul(pe,Ne)|0,y=y+Math.imul(ke,Fe)|0,C=C+Math.imul(ke,Ne)|0,A=A+Math.imul(ue,Ve)|0,y=y+Math.imul(ue,Xe)|0,y=y+Math.imul(ve,Ve)|0,C=C+Math.imul(ve,Xe)|0,A=A+Math.imul(ge,st)|0,y=y+Math.imul(ge,at)|0,y=y+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,A=A+Math.imul(te,ft)|0,y=y+Math.imul(te,rt)|0,y=y+Math.imul(ae,ft)|0,C=C+Math.imul(ae,rt)|0,A=A+Math.imul(q,ct)|0,y=y+Math.imul(q,ut)|0,y=y+Math.imul(j,ct)|0,C=C+Math.imul(j,ut)|0,A=A+Math.imul(D,lt)|0,y=y+Math.imul(D,Qe)|0,y=y+Math.imul(Q,lt)|0,C=C+Math.imul(Q,Qe)|0,A=A+Math.imul(w,ht)|0,y=y+Math.imul(w,dt)|0,y=y+Math.imul(k,ht)|0,C=C+Math.imul(k,dt)|0;var vn=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(vn>>>26)|0,vn&=67108863,A=Math.imul(le,we),y=Math.imul(le,Ie),y=y+Math.imul(oe,we)|0,C=Math.imul(oe,Ie),A=A+Math.imul(Pe,Fe)|0,y=y+Math.imul(Pe,Ne)|0,y=y+Math.imul(Je,Fe)|0,C=C+Math.imul(Je,Ne)|0,A=A+Math.imul(pe,Ve)|0,y=y+Math.imul(pe,Xe)|0,y=y+Math.imul(ke,Ve)|0,C=C+Math.imul(ke,Xe)|0,A=A+Math.imul(ue,st)|0,y=y+Math.imul(ue,at)|0,y=y+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,A=A+Math.imul(ge,ft)|0,y=y+Math.imul(ge,rt)|0,y=y+Math.imul(ie,ft)|0,C=C+Math.imul(ie,rt)|0,A=A+Math.imul(te,ct)|0,y=y+Math.imul(te,ut)|0,y=y+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,A=A+Math.imul(q,lt)|0,y=y+Math.imul(q,Qe)|0,y=y+Math.imul(j,lt)|0,C=C+Math.imul(j,Qe)|0,A=A+Math.imul(D,ht)|0,y=y+Math.imul(D,dt)|0,y=y+Math.imul(Q,ht)|0,C=C+Math.imul(Q,dt)|0,A=A+Math.imul(w,pt)|0,y=y+Math.imul(w,mt)|0,y=y+Math.imul(k,pt)|0,C=C+Math.imul(k,mt)|0;var ci=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(ci>>>26)|0,ci&=67108863,A=Math.imul(Z,we),y=Math.imul(Z,Ie),y=y+Math.imul(me,we)|0,C=Math.imul(me,Ie),A=A+Math.imul(le,Fe)|0,y=y+Math.imul(le,Ne)|0,y=y+Math.imul(oe,Fe)|0,C=C+Math.imul(oe,Ne)|0,A=A+Math.imul(Pe,Ve)|0,y=y+Math.imul(Pe,Xe)|0,y=y+Math.imul(Je,Ve)|0,C=C+Math.imul(Je,Xe)|0,A=A+Math.imul(pe,st)|0,y=y+Math.imul(pe,at)|0,y=y+Math.imul(ke,st)|0,C=C+Math.imul(ke,at)|0,A=A+Math.imul(ue,ft)|0,y=y+Math.imul(ue,rt)|0,y=y+Math.imul(ve,ft)|0,C=C+Math.imul(ve,rt)|0,A=A+Math.imul(ge,ct)|0,y=y+Math.imul(ge,ut)|0,y=y+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,A=A+Math.imul(te,lt)|0,y=y+Math.imul(te,Qe)|0,y=y+Math.imul(ae,lt)|0,C=C+Math.imul(ae,Qe)|0,A=A+Math.imul(q,ht)|0,y=y+Math.imul(q,dt)|0,y=y+Math.imul(j,ht)|0,C=C+Math.imul(j,dt)|0,A=A+Math.imul(D,pt)|0,y=y+Math.imul(D,mt)|0,y=y+Math.imul(Q,pt)|0,C=C+Math.imul(Q,mt)|0,A=A+Math.imul(w,bt)|0,y=y+Math.imul(w,nt)|0,y=y+Math.imul(k,bt)|0,C=C+Math.imul(k,nt)|0;var Lo=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,A=Math.imul(Z,Fe),y=Math.imul(Z,Ne),y=y+Math.imul(me,Fe)|0,C=Math.imul(me,Ne),A=A+Math.imul(le,Ve)|0,y=y+Math.imul(le,Xe)|0,y=y+Math.imul(oe,Ve)|0,C=C+Math.imul(oe,Xe)|0,A=A+Math.imul(Pe,st)|0,y=y+Math.imul(Pe,at)|0,y=y+Math.imul(Je,st)|0,C=C+Math.imul(Je,at)|0,A=A+Math.imul(pe,ft)|0,y=y+Math.imul(pe,rt)|0,y=y+Math.imul(ke,ft)|0,C=C+Math.imul(ke,rt)|0,A=A+Math.imul(ue,ct)|0,y=y+Math.imul(ue,ut)|0,y=y+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,A=A+Math.imul(ge,lt)|0,y=y+Math.imul(ge,Qe)|0,y=y+Math.imul(ie,lt)|0,C=C+Math.imul(ie,Qe)|0,A=A+Math.imul(te,ht)|0,y=y+Math.imul(te,dt)|0,y=y+Math.imul(ae,ht)|0,C=C+Math.imul(ae,dt)|0,A=A+Math.imul(q,pt)|0,y=y+Math.imul(q,mt)|0,y=y+Math.imul(j,pt)|0,C=C+Math.imul(j,mt)|0,A=A+Math.imul(D,bt)|0,y=y+Math.imul(D,nt)|0,y=y+Math.imul(Q,bt)|0,C=C+Math.imul(Q,nt)|0;var Uo=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,A=Math.imul(Z,Ve),y=Math.imul(Z,Xe),y=y+Math.imul(me,Ve)|0,C=Math.imul(me,Xe),A=A+Math.imul(le,st)|0,y=y+Math.imul(le,at)|0,y=y+Math.imul(oe,st)|0,C=C+Math.imul(oe,at)|0,A=A+Math.imul(Pe,ft)|0,y=y+Math.imul(Pe,rt)|0,y=y+Math.imul(Je,ft)|0,C=C+Math.imul(Je,rt)|0,A=A+Math.imul(pe,ct)|0,y=y+Math.imul(pe,ut)|0,y=y+Math.imul(ke,ct)|0,C=C+Math.imul(ke,ut)|0,A=A+Math.imul(ue,lt)|0,y=y+Math.imul(ue,Qe)|0,y=y+Math.imul(ve,lt)|0,C=C+Math.imul(ve,Qe)|0,A=A+Math.imul(ge,ht)|0,y=y+Math.imul(ge,dt)|0,y=y+Math.imul(ie,ht)|0,C=C+Math.imul(ie,dt)|0,A=A+Math.imul(te,pt)|0,y=y+Math.imul(te,mt)|0,y=y+Math.imul(ae,pt)|0,C=C+Math.imul(ae,mt)|0,A=A+Math.imul(q,bt)|0,y=y+Math.imul(q,nt)|0,y=y+Math.imul(j,bt)|0,C=C+Math.imul(j,nt)|0;var Fo=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,A=Math.imul(Z,st),y=Math.imul(Z,at),y=y+Math.imul(me,st)|0,C=Math.imul(me,at),A=A+Math.imul(le,ft)|0,y=y+Math.imul(le,rt)|0,y=y+Math.imul(oe,ft)|0,C=C+Math.imul(oe,rt)|0,A=A+Math.imul(Pe,ct)|0,y=y+Math.imul(Pe,ut)|0,y=y+Math.imul(Je,ct)|0,C=C+Math.imul(Je,ut)|0,A=A+Math.imul(pe,lt)|0,y=y+Math.imul(pe,Qe)|0,y=y+Math.imul(ke,lt)|0,C=C+Math.imul(ke,Qe)|0,A=A+Math.imul(ue,ht)|0,y=y+Math.imul(ue,dt)|0,y=y+Math.imul(ve,ht)|0,C=C+Math.imul(ve,dt)|0,A=A+Math.imul(ge,pt)|0,y=y+Math.imul(ge,mt)|0,y=y+Math.imul(ie,pt)|0,C=C+Math.imul(ie,mt)|0,A=A+Math.imul(te,bt)|0,y=y+Math.imul(te,nt)|0,y=y+Math.imul(ae,bt)|0,C=C+Math.imul(ae,nt)|0;var fo=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(fo>>>26)|0,fo&=67108863,A=Math.imul(Z,ft),y=Math.imul(Z,rt),y=y+Math.imul(me,ft)|0,C=Math.imul(me,rt),A=A+Math.imul(le,ct)|0,y=y+Math.imul(le,ut)|0,y=y+Math.imul(oe,ct)|0,C=C+Math.imul(oe,ut)|0,A=A+Math.imul(Pe,lt)|0,y=y+Math.imul(Pe,Qe)|0,y=y+Math.imul(Je,lt)|0,C=C+Math.imul(Je,Qe)|0,A=A+Math.imul(pe,ht)|0,y=y+Math.imul(pe,dt)|0,y=y+Math.imul(ke,ht)|0,C=C+Math.imul(ke,dt)|0,A=A+Math.imul(ue,pt)|0,y=y+Math.imul(ue,mt)|0,y=y+Math.imul(ve,pt)|0,C=C+Math.imul(ve,mt)|0,A=A+Math.imul(ge,bt)|0,y=y+Math.imul(ge,nt)|0,y=y+Math.imul(ie,bt)|0,C=C+Math.imul(ie,nt)|0;var co=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(co>>>26)|0,co&=67108863,A=Math.imul(Z,ct),y=Math.imul(Z,ut),y=y+Math.imul(me,ct)|0,C=Math.imul(me,ut),A=A+Math.imul(le,lt)|0,y=y+Math.imul(le,Qe)|0,y=y+Math.imul(oe,lt)|0,C=C+Math.imul(oe,Qe)|0,A=A+Math.imul(Pe,ht)|0,y=y+Math.imul(Pe,dt)|0,y=y+Math.imul(Je,ht)|0,C=C+Math.imul(Je,dt)|0,A=A+Math.imul(pe,pt)|0,y=y+Math.imul(pe,mt)|0,y=y+Math.imul(ke,pt)|0,C=C+Math.imul(ke,mt)|0,A=A+Math.imul(ue,bt)|0,y=y+Math.imul(ue,nt)|0,y=y+Math.imul(ve,bt)|0,C=C+Math.imul(ve,nt)|0;var uo=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(uo>>>26)|0,uo&=67108863,A=Math.imul(Z,lt),y=Math.imul(Z,Qe),y=y+Math.imul(me,lt)|0,C=Math.imul(me,Qe),A=A+Math.imul(le,ht)|0,y=y+Math.imul(le,dt)|0,y=y+Math.imul(oe,ht)|0,C=C+Math.imul(oe,dt)|0,A=A+Math.imul(Pe,pt)|0,y=y+Math.imul(Pe,mt)|0,y=y+Math.imul(Je,pt)|0,C=C+Math.imul(Je,mt)|0,A=A+Math.imul(pe,bt)|0,y=y+Math.imul(pe,nt)|0,y=y+Math.imul(ke,bt)|0,C=C+Math.imul(ke,nt)|0;var $o=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+($o>>>26)|0,$o&=67108863,A=Math.imul(Z,ht),y=Math.imul(Z,dt),y=y+Math.imul(me,ht)|0,C=Math.imul(me,dt),A=A+Math.imul(le,pt)|0,y=y+Math.imul(le,mt)|0,y=y+Math.imul(oe,pt)|0,C=C+Math.imul(oe,mt)|0,A=A+Math.imul(Pe,bt)|0,y=y+Math.imul(Pe,nt)|0,y=y+Math.imul(Je,bt)|0,C=C+Math.imul(Je,nt)|0;var qo=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(qo>>>26)|0,qo&=67108863,A=Math.imul(Z,pt),y=Math.imul(Z,mt),y=y+Math.imul(me,pt)|0,C=Math.imul(me,mt),A=A+Math.imul(le,bt)|0,y=y+Math.imul(le,nt)|0,y=y+Math.imul(oe,bt)|0,C=C+Math.imul(oe,nt)|0;var Ho=(S+A|0)+((y&8191)<<13)|0;S=(C+(y>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,A=Math.imul(Z,bt),y=Math.imul(Z,nt),y=y+Math.imul(me,bt)|0,C=Math.imul(me,nt);var zo=(S+A|0)+((y&8191)<<13)|0;return S=(C+(y>>>13)|0)+(zo>>>26)|0,zo&=67108863,_[0]=Bn,_[1]=qt,_[2]=Ht,_[3]=mn,_[4]=bn,_[5]=gn,_[6]=Fr,_[7]=vn,_[8]=ci,_[9]=Lo,_[10]=Uo,_[11]=Fo,_[12]=fo,_[13]=co,_[14]=uo,_[15]=$o,_[16]=qo,_[17]=Ho,_[18]=zo,S!==0&&(_[19]=S,b.length++),b},"comb10MulTo");Math.imul||(I=R);function B(L,h,g){g.negative=h.negative^L.negative,g.length=L.length+h.length;for(var b=0,l=0,m=0;m<g.length-1;m++){var _=l;l=0;for(var S=b&67108863,A=Math.min(m,h.length-1),y=Math.max(0,m-L.length+1);y<=A;y++){var C=m-y,N=L.words[C]|0,w=h.words[y]|0,k=N*w,fe=k&67108863;_=_+(k/67108864|0)|0,fe=fe+S|0,S=fe&67108863,_=_+(fe>>>26)|0,l+=_>>>26,_&=67108863}g.words[m]=S,b=_,_=l}return b!==0?g.words[m]=b:g.length--,g.strip()}o(B,"bigMulTo");function Y(L,h,g){var b=new P;return b.mulp(L,h,g)}o(Y,"jumboMulTo"),i.prototype.mulTo=o(function(h,g){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=I(this,h,g):l<63?b=R(this,h,g):l<1024?b=B(this,h,g):b=Y(this,h,g),b},"mulTo");function P(L,h){this.x=L,this.y=h}o(P,"FFTM"),P.prototype.makeRBT=o(function(h){for(var g=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)g[l]=this.revBin(l,b,h);return g},"makeRBT"),P.prototype.revBin=o(function(h,g,b){if(h===0||h===b-1)return h;for(var l=0,m=0;m<g;m++)l|=(h&1)<<g-m-1,h>>=1;return l},"revBin"),P.prototype.permute=o(function(h,g,b,l,m,_){for(var S=0;S<_;S++)l[S]=g[h[S]],m[S]=b[h[S]]},"permute"),P.prototype.transform=o(function(h,g,b,l,m,_){this.permute(_,h,g,b,l,m);for(var S=1;S<m;S<<=1)for(var A=S<<1,y=Math.cos(2*Math.PI/A),C=Math.sin(2*Math.PI/A),N=0;N<m;N+=A)for(var w=y,k=C,fe=0;fe<S;fe++){var D=b[N+fe],Q=l[N+fe],se=b[N+fe+S],q=l[N+fe+S],j=w*se-k*q;q=w*q+k*se,se=j,b[N+fe]=D+se,l[N+fe]=Q+q,b[N+fe+S]=D-se,l[N+fe+S]=Q-q,fe!==A&&(j=y*w-C*k,k=y*k+C*w,w=j)}},"transform"),P.prototype.guessLen13b=o(function(h,g){var b=Math.max(g,h)|1,l=b&1,m=0;for(b=b/2|0;b;b=b>>>1)m++;return 1<<m+1+l},"guessLen13b"),P.prototype.conjugate=o(function(h,g,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=g[l],g[l]=-g[b-l-1],g[b-l-1]=-m}},"conjugate"),P.prototype.normalize13b=o(function(h,g){for(var b=0,l=0;l<g/2;l++){var m=Math.round(h[2*l+1]/g)*8192+Math.round(h[2*l]/g)+b;h[l]=m&67108863,m<67108864?b=0:b=m/67108864|0}return h},"normalize13b"),P.prototype.convert13b=o(function(h,g,b,l){for(var m=0,_=0;_<g;_++)m=m+(h[_]|0),b[2*_]=m&8191,m=m>>>13,b[2*_+1]=m&8191,m=m>>>13;for(_=2*g;_<l;++_)b[_]=0;t(m===0),t((m&-8192)===0)},"convert13b"),P.prototype.stub=o(function(h){for(var g=new Array(h),b=0;b<h;b++)g[b]=0;return g},"stub"),P.prototype.mulp=o(function(h,g,b){var l=2*this.guessLen13b(h.length,g.length),m=this.makeRBT(l),_=this.stub(l),S=new Array(l),A=new Array(l),y=new Array(l),C=new Array(l),N=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,S,l),this.convert13b(g.words,g.length,C,l),this.transform(S,_,A,y,l,m),this.transform(C,_,N,w,l,m);for(var fe=0;fe<l;fe++){var D=A[fe]*N[fe]-y[fe]*w[fe];y[fe]=A[fe]*w[fe]+y[fe]*N[fe],A[fe]=D}return this.conjugate(A,y,l),this.transform(A,y,k,_,l,m),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^g.negative,b.length=h.length+g.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var g=new i(null);return g.words=new Array(this.length+h.length),this.mulTo(h,g)},"mul"),i.prototype.mulf=o(function(h){var g=new i(null);return g.words=new Array(this.length+h.length),Y(this,h,g)},"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 g=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,m=(l&67108863)+(g&67108863);g>>=26,g+=l/67108864|0,g+=m>>>26,this.words[b]=m&67108863}return g!==0&&(this.words[b]=g,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 g=O(h);if(g.length===0)return new i(1);for(var b=this,l=0;l<g.length&&g[l]===0;l++,b=b.sqr());if(++l<g.length)for(var m=b.sqr();l<g.length;l++,m=m.sqr())g[l]!==0&&(b=b.mul(m));return b},"pow"),i.prototype.iushln=o(function(h){t(typeof h=="number"&&h>=0);var g=h%26,b=(h-g)/26,l=67108863>>>26-g<<26-g,m;if(g!==0){var _=0;for(m=0;m<this.length;m++){var S=this.words[m]&l,A=(this.words[m]|0)-S<<g;this.words[m]=A|_,_=S>>>26-g}_&&(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,g,b){t(typeof h=="number"&&h>=0);var l;g?l=(g-g%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 y=0;y<_;y++)A.words[y]=this.words[y];A.length=_}if(_!==0)if(this.length>_)for(this.length-=_,y=0;y<this.length;y++)this.words[y]=this.words[y+_];else this.words[0]=0,this.length=1;var C=0;for(y=this.length-1;y>=0&&(C!==0||y>=l);y--){var N=this.words[y]|0;this.words[y]=C<<26-m|N>>>m,C=N&S}return A&&C!==0&&(A.words[A.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,g,b){return t(this.negative===0),this.iushrn(h,g,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 g=h%26,b=(h-g)/26,l=1<<g;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 g=h%26,b=(h-g)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(g!==0&&b++,this.length=Math.min(b,this.length),g!==0){var l=67108863^67108863>>>g<<g;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 g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},"_iaddn"),i.prototype.isubn=o(function(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 g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(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,g,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)*g;_-=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,g){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,y;if(g!=="mod"){y=new i(null),y.length=A+1,y.words=new Array(y.length);for(var C=0;C<y.length;C++)y.words[C]=0}var N=l.clone()._ishlnsubmul(m,1,A);N.negative===0&&(l=N,y&&(y.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);y&&(y.words[w]=k)}return y&&y.strip(),l.strip(),g!=="div"&&b!==0&&l.iushrn(b),{div:y||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,g,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,g),g!=="mod"&&(l=_.div.neg()),g!=="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(),g),g!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),g),g!=="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?g==="div"?{div:this.divn(h.words[0]),mod:null}:g==="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,g)},"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 g=this.divmod(h);if(g.mod.isZero())return g.div;var b=g.div.negative!==0?g.mod.isub(h):g.mod,l=h.ushrn(1),m=h.andln(1),_=b.cmp(l);return _<0||m===1&&_===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){t(h<=67108863);for(var g=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(g*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){t(h<=67108863);for(var g=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+g*67108864;this.words[b]=l/h|0,g=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 g=this,b=h.clone();g.negative!==0?g=g.umod(h):g=g.clone();for(var l=new i(1),m=new i(0),_=new i(0),S=new i(1),A=0;g.isEven()&&b.isEven();)g.iushrn(1),b.iushrn(1),++A;for(var y=b.clone(),C=g.clone();!g.isZero();){for(var N=0,w=1;(g.words[0]&w)===0&&N<26;++N,w<<=1);if(N>0)for(g.iushrn(N);N-- >0;)(l.isOdd()||m.isOdd())&&(l.iadd(y),m.isub(C)),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(y),S.isub(C)),_.iushrn(1),S.iushrn(1);g.cmp(b)>=0?(g.isub(b),l.isub(_),m.isub(S)):(b.isub(g),_.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 g=this,b=h.clone();g.negative!==0?g=g.umod(h):g=g.clone();for(var l=new i(1),m=new i(0),_=b.clone();g.cmpn(1)>0&&b.cmpn(1)>0;){for(var S=0,A=1;(g.words[0]&A)===0&&S<26;++S,A<<=1);if(S>0)for(g.iushrn(S);S-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var y=0,C=1;(b.words[0]&C)===0&&y<26;++y,C<<=1);if(y>0)for(b.iushrn(y);y-- >0;)m.isOdd()&&m.iadd(_),m.iushrn(1);g.cmp(b)>=0?(g.isub(b),l.isub(m)):(b.isub(g),m.isub(l))}var N;return g.cmpn(1)===0?N=l:N=m,N.cmpn(0)<0&&N.iadd(h),N},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var g=this.clone(),b=h.clone();g.negative=0,b.negative=0;for(var l=0;g.isEven()&&b.isEven();l++)g.iushrn(1),b.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;b.isEven();)b.iushrn(1);var m=g.cmp(b);if(m<0){var _=g;g=b,b=_}else if(m===0||b.cmpn(1)===0)break;g.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 g=h%26,b=(h-g)/26,l=1<<g;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 g=h<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var b;if(this.length>1)b=1;else{g&&(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 g=this.ucmp(h);return this.negative!==0?-g|0:g},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var g=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,m=h.words[b]|0;if(l!==m){l<m?g=-1:l>m&&(g=1);break}}return g},"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 z(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(L,h){this.name=L,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 g=h,b;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),b=g.bitLength();while(b>this.n);var l=b<this.n?-1:g.ucmp(this.p);return l===0?(g.words[0]=0,g.length=1):l>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},"ireduce"),ee.prototype.split=o(function(h,g){h.iushrn(this.n,0,g)},"split"),ee.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function X(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(X,"K256"),n(X,ee),X.prototype.split=o(function(h,g){for(var b=4194303,l=Math.min(h.length,9),m=0;m<l;m++)g.words[m]=h.words[m];if(g.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(g.words[g.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"),X.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var g=0,b=0;b<h.length;b++){var l=h.words[b]|0;g+=l*977,h.words[b]=g&67108863,g=l*64+(g/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function ne(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ne,"P224"),n(ne,ee);function V(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(V,"P192"),n(V,ee);function H(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(H,"P25519"),n(H,ee),H.prototype.imulK=o(function(h){for(var g=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+g,m=l&67108863;l>>>=26,h.words[b]=m,g=l}return g!==0&&(h.words[h.length++]=g),h},"imulK"),i._prime=o(function(h){if(J[h])return J[h];var g;if(h==="k256")g=new X;else if(h==="p224")g=new ne;else if(h==="p192")g=new V;else if(h==="p25519")g=new H;else throw new Error("Unknown prime "+h);return J[h]=g,g},"prime");function z(L){if(typeof L=="string"){var h=i._prime(L);this.m=h.p,this.prime=h}else t(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}o(z,"Red"),z.prototype._verify1=o(function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},"_verify1"),z.prototype._verify2=o(function(h,g){t((h.negative|g.negative)===0,"red works only with positives"),t(h.red&&h.red===g.red,"red works only with red numbers")},"_verify2"),z.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),z.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),z.prototype.add=o(function(h,g){this._verify2(h,g);var b=h.add(g);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),z.prototype.iadd=o(function(h,g){this._verify2(h,g);var b=h.iadd(g);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),z.prototype.sub=o(function(h,g){this._verify2(h,g);var b=h.sub(g);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),z.prototype.isub=o(function(h,g){this._verify2(h,g);var b=h.isub(g);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),z.prototype.shl=o(function(h,g){return this._verify1(h),this.imod(h.ushln(g))},"shl"),z.prototype.imul=o(function(h,g){return this._verify2(h,g),this.imod(h.imul(g))},"imul"),z.prototype.mul=o(function(h,g){return this._verify2(h,g),this.imod(h.mul(g))},"mul"),z.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),z.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),z.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var g=this.m.andln(3);if(t(g%2===1),g===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),y=this.m.bitLength();for(y=new i(2*y*y).toRed(this);this.pow(y,A).cmp(S)!==0;)y.redIAdd(S);for(var C=this.pow(y,l),N=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(C,new i(1).iushln(k-D-1));N=N.redMul(Q),C=Q.redSqr(),w=w.redMul(C),k=D}return N},"sqrt"),z.prototype.invm=o(function(h){var g=h._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},"invm"),z.prototype.pow=o(function(h,g){if(g.isZero())return new i(1).toRed(this);if(g.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,y=g.bitLength()%26;for(y===0&&(y=26),m=g.length-1;m>=0;m--){for(var C=g.words[m],N=y-1;N>=0;N--){var w=C>>N&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&S===0){A=0;continue}S<<=1,S|=w,A++,!(A!==b&&(m!==0||N!==0))&&(_=this.mul(_,l[S]),A=0,S=0)}y=26}return _},"pow"),z.prototype.convertTo=o(function(h){var g=h.umod(this.m);return g===h?g.clone():g},"convertTo"),z.prototype.convertFrom=o(function(h){var g=h.clone();return g.red=null,g},"convertFrom"),i.mont=o(function(h){return new he(h)},"mont");function he(L){z.call(this,L),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,z),he.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),he.prototype.convertFrom=o(function(h){var g=this.imod(h.mul(this.rinv));return g.red=null,g},"convertFrom"),he.prototype.imul=o(function(h,g){if(h.isZero()||g.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(g),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,g){if(h.isZero()||g.isZero())return new i(0)._forceRed(this);var b=h.mul(g),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 g=this.imod(h._invmp(this.m).mul(this.r2));return g._forceRed(this)},"invm")})(typeof g1>"u"||g1,ex)});var $s=Re((AV,rx)=>{rx.exports=tx;function tx(r,e){if(!r)throw new Error(e||"Assertion failed")}o(tx,"assert");tx.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var v1=Re(ox=>{"use strict";var ud=ox;function eO(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(eO,"toArray");ud.toArray=eO;function nx(r){return r.length===1?"0"+r:r}o(nx,"zero2");ud.zero2=nx;function ix(r){for(var e="",t=0;t<r.length;t++)e+=nx(r[t].toString(16));return e}o(ix,"toHex");ud.toHex=ix;ud.encode=o(function(e,t){return t==="hex"?ix(e):e},"encode")});var jn=Re(sx=>{"use strict";var zi=sx,tO=mo(),rO=$s(),ld=v1();zi.assert=rO;zi.toArray=ld.toArray;zi.zero2=ld.zero2;zi.toHex=ld.toHex;zi.encode=ld.encode;function nO(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(nO,"getNAF");zi.getNAF=nO;function iO(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 v;(u&1)===0?v=0:(s=e.andln(7)+i&7,(s===3||s===5)&&f===2?v=-u:v=u),t[1].push(v),2*n===d+1&&(n=1-n),2*i===v+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(iO,"getJSF");zi.getJSF=iO;function oO(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(oO,"cachedProperty");zi.cachedProperty=oO;function sO(r){return typeof r=="string"?zi.toArray(r,"hex"):r}o(sO,"parseBytes");zi.parseBytes=sO;function aO(r){return new tO(r,"hex","le")}o(aO,"intFromLE");zi.intFromLE=aO});var _1=Re((TV,w1)=>{var y1;w1.exports=o(function(e){return y1||(y1=new qs(null)),y1.generate(e)},"rand");function qs(r){this.rand=r}o(qs,"Rand");w1.exports.Rand=qs;qs.prototype.generate=o(function(e){return this._rand(e)},"generate");qs.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?qs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?qs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(qs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(x1=require("crypto"),typeof x1.randomBytes!="function")throw new Error("Not supported");qs.prototype._rand=o(function(e){return x1.randomBytes(e)},"_rand")}catch{}var x1});var Fu=Re((CV,ax)=>{"use strict";var qa=mo(),Uu=jn(),hd=Uu.getNAF,fO=Uu.getJSF,dd=Uu.assert;function Hs(r,e){this.type=r,this.p=new qa(e.p,16),this.red=e.prime?qa.red(e.prime):qa.mont(this.p),this.zero=new qa(0).toRed(this.red),this.one=new qa(1).toRed(this.red),this.two=new qa(2).toRed(this.red),this.n=e.n&&new qa(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(Hs,"BaseCurve");ax.exports=Hs;Hs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Hs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Hs.prototype._fixedNafMul=o(function(e,t){dd(e.precomputed);var n=e._getDoubles(),i=hd(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 v=u+n.step-1;v>=u;v--)d=(d<<1)+i[v];f.push(d)}for(var x=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()));x=x.add(E)}return x.toP()},"_fixedNafMul");Hs.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=hd(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var v=0;d>=0&&f[d]===0;d--)v++;if(d>=0&&v++,u=u.dblp(v),d<0)break;var x=f[d];dd(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(s[x-1>>1]):u=u.mixedAdd(s[-x-1>>1].neg()):x>0?u=u.add(s[x-1>>1]):u=u.add(s[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Hs.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,v=0,x,E,O;for(x=0;x<i;x++){O=t[x];var R=O._getNAFPoints(e);f[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var I=x-1,B=x;if(f[I]!==1||f[B]!==1){d[I]=hd(n[I],f[I],this._bitLength),d[B]=hd(n[B],f[B],this._bitLength),v=Math.max(d[I].length,v),v=Math.max(d[B].length,v);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=fO(n[I],n[B]);for(v=Math.max(J[0].length,v),d[I]=new Array(v),d[B]=new Array(v),E=0;E<v;E++){var ee=J[0][E]|0,X=J[1][E]|0;d[I][E]=P[(ee+1)*3+(X+1)],d[B][E]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var z=!0;for(E=0;E<i;E++)V[E]=d[E][x]|0,V[E]!==0&&(z=!1);if(!z)break;H++,x--}if(x>=0&&H++,ne=ne.dblp(H),x<0)break;for(E=0;E<i;E++){var he=V[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(x=0;x<i;x++)u[x]=null;return s?ne:ne.toP()},"_wnafMulAdd");function wi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(wi,"BasePoint");Hs.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Hs.prototype.decodePoint=o(function(e,t){e=Uu.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?dd(e[e.length-1]%2===0):e[0]===7&&dd(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");wi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");wi.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");wi.prototype.encode=o(function(e,t){return Uu.encode(this._encode(t),e)},"encode");wi.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");wi.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");wi.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");wi.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");wi.prototype._getBeta=o(function(){return null},"_getBeta");wi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var $u=Re((kV,E1)=>{typeof Object.create=="function"?E1.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"):E1.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 cx=Re((IV,fx)=>{"use strict";var cO=jn(),dr=mo(),A1=$u(),ic=Fu(),uO=cO.assert;function _i(r){ic.call(this,"short",r),this.a=new dr(r.a,16).toRed(this.red),this.b=new dr(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(_i,"ShortCurve");A1(_i,ic);fx.exports=_i;_i.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 dr(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 dr(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],uO(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 dr(u.a,16),b:new dr(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");_i.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:dr.mont(e),n=new dr(2).toRed(t).redInvm(),i=n.redNeg(),s=new dr(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");_i.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 dr(1),f=new dr(0),u=new dr(0),d=new dr(1),v,x,E,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var X=d.sub(ee.mul(f));if(!E&&P.cmp(t)<0)v=B.neg(),x=s,E=P.neg(),O=J;else if(E&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=X}R=P.neg(),I=J;var ne=E.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=v,I=x),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");_i.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),v=s.mul(n.b),x=f.mul(i.b),E=e.sub(u).sub(d),O=v.add(x).neg();return{k1:E,k2:O}},"_endoSplit");_i.prototype.pointFromX=o(function(e,t){e=new dr(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");_i.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");_i.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],v=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[f*2]=d,i[f*2+1]=v,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return x},"_endoWnafMulAdd");function Ir(r,e,t,n){ic.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new dr(e,16),this.y=new dr(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(Ir,"Point");A1(Ir,ic.BasePoint);_i.prototype.point=o(function(e,t,n){return new Ir(this,e,t,n)},"point");_i.prototype.pointFromJSON=o(function(e,t){return Ir.fromJSON(this,e,t)},"pointFromJSON");Ir.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");Ir.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");Ir.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");Ir.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");Ir.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Ir.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");Ir.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");Ir.prototype.getX=o(function(){return this.x.fromRed()},"getX");Ir.prototype.getY=o(function(){return this.y.fromRed()},"getY");Ir.prototype.mul=o(function(e){return e=new dr(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");Ir.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");Ir.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");Ir.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");Ir.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");Ir.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 qr(r,e,t,n){ic.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new dr(0)):(this.x=new dr(e,16),this.y=new dr(t,16),this.z=new dr(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(qr,"JPoint");A1(qr,ic.BasePoint);_i.prototype.jpoint=o(function(e,t,n){return new qr(this,e,t,n)},"jpoint");qr.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");qr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");qr.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),v=f.redSub(u);if(d.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=d.redSqr(),E=x.redMul(d),O=i.redMul(x),R=v.redSqr().redIAdd(E).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(f.redMul(E)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");qr.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 v=u.redSqr(),x=v.redMul(u),E=n.redMul(v),O=d.redSqr().redIAdd(x).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(x)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");qr.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,v=d.redSqr().redSqr(),x=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=x.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(v)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=x.redMul(d);t+1<e&&(v=v.redMul(R)),f=Y,d=ee,x=J}return this.curve.jpoint(f,x.redMul(s),d)},"dblp");qr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");qr.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),v=d.redSqr().redISub(u).redISub(u),x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),e=v,t=d.redMul(u.redISub(v)).redISub(x),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 B=E.redAdd(E).redIAdd(E),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");qr.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),v=d.redSqr().redISub(u).redISub(u);e=v;var x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),t=d.redMul(u.redISub(v)).redISub(x),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 B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");qr.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)),v=t.redAdd(t);v=v.redIAdd(v);var x=v.redMul(u),E=d.redSqr().redISub(x.redAdd(x)),O=x.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,B)},"_dbl");qr.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(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(v),E=t.redMul(x);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(x.redMul(v.redISub(x)).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");qr.prototype.mul=o(function(e,t){return e=new dr(e,t),this.curve._wnafMul(this,e)},"mul");qr.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");qr.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");qr.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");qr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var hx=Re((DV,lx)=>{"use strict";var oc=mo(),ux=$u(),pd=Fu(),lO=jn();function sc(r){pd.call(this,"mont",r),this.a=new oc(r.a,16).toRed(this.red),this.b=new oc(r.b,16).toRed(this.red),this.i4=new oc(4).toRed(this.red).redInvm(),this.two=new oc(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(sc,"MontCurve");ux(sc,pd);lx.exports=sc;sc.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 Dr(r,e,t){pd.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new oc(e,16),this.z=new oc(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(Dr,"Point");ux(Dr,pd.BasePoint);sc.prototype.decodePoint=o(function(e,t){return this.point(lO.toArray(e,t),1)},"decodePoint");sc.prototype.point=o(function(e,t){return new Dr(this,e,t)},"point");sc.prototype.pointFromJSON=o(function(e){return Dr.fromJSON(this,e)},"pointFromJSON");Dr.prototype.precompute=o(function(){},"precompute");Dr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Dr.fromJSON=o(function(e,t){return new Dr(e,t[0],t[1]||e.one)},"fromJSON");Dr.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");Dr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Dr.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");Dr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Dr.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),v=t.z.redMul(u.redAdd(d).redSqr()),x=t.x.redMul(u.redISub(d).redSqr());return this.curve.point(v,x)},"diffAdd");Dr.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");Dr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Dr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Dr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Dr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Dr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var mx=Re((RV,px)=>{"use strict";var hO=jn(),ts=mo(),dx=$u(),md=Fu(),dO=hO.assert;function bo(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,md.call(this,"edwards",r),this.a=new ts(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ts(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ts(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),dO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(bo,"EdwardsCurve");dx(bo,md);px.exports=bo;bo.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");bo.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");bo.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");bo.prototype.pointFromX=o(function(e,t){e=new ts(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");bo.prototype.pointFromY=o(function(e,t){e=new ts(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");bo.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){md.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 ts(e,16),this.y=new ts(t,16),this.z=n?new ts(n,16):this.curve.one,this.t=i&&new ts(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");dx(nr,md.BasePoint);bo.prototype.pointFromJSON=o(function(e){return nr.fromJSON(this,e)},"pointFromJSON");bo.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),v=s.redMul(u),x=f.redMul(d),E=s.redMul(d),O=u.redMul(f);return this.curve.point(v,x,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,v;if(this.curve.twisted){u=this.curve._mulA(t);var x=u.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(x.redSub(this.curve.two)),s=x.redMul(u.redSub(n)),f=x.redSqr().redSub(x).redSub(x)):(d=this.z.redSqr(),v=x.redSub(d).redISub(d),i=e.redSub(t).redISub(n).redMul(v),s=x.redMul(u.redSub(n)),f=x.redMul(v))}else u=t.redAdd(n),d=this.curve._mulC(this.z).redSqr(),v=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(v),s=this.curve._mulC(u).redMul(t.redISub(n)),f=u.redMul(v);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),v=n.redAdd(t),x=f.redMul(u),E=d.redMul(v),O=f.redMul(v),R=u.redMul(d);return this.curve.point(x,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),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),x=t.redMul(u).redMul(v),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(x,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 S1=Re(bx=>{"use strict";var bd=bx;bd.base=Fu();bd.short=cx();bd.mont=hx();bd.edwards=mx()});var ji=Re(tr=>{"use strict";var pO=$s(),mO=$u();tr.inherits=mO;function bO(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(bO,"isSurrogatePair");function gO(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):bO(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(gO,"toArray");tr.toArray=gO;function vO(r){for(var e="",t=0;t<r.length;t++)e+=vx(r[t].toString(16));return e}o(vO,"toHex");tr.toHex=vO;function gx(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(gx,"htonl");tr.htonl=gx;function yO(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=gx(i)),t+=yx(i.toString(16))}return t}o(yO,"toHex32");tr.toHex32=yO;function vx(r){return r.length===1?"0"+r:r}o(vx,"zero2");tr.zero2=vx;function yx(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(yx,"zero8");tr.zero8=yx;function xO(r,e,t,n){var i=t-e;pO(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(xO,"join32");tr.join32=xO;function wO(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(wO,"split32");tr.split32=wO;function _O(r,e){return r>>>e|r<<32-e}o(_O,"rotr32");tr.rotr32=_O;function EO(r,e){return r<<e|r>>>32-e}o(EO,"rotl32");tr.rotl32=EO;function AO(r,e){return r+e>>>0}o(AO,"sum32");tr.sum32=AO;function SO(r,e,t){return r+e+t>>>0}o(SO,"sum32_3");tr.sum32_3=SO;function MO(r,e,t,n){return r+e+t+n>>>0}o(MO,"sum32_4");tr.sum32_4=MO;function TO(r,e,t,n,i){return r+e+t+n+i>>>0}o(TO,"sum32_5");tr.sum32_5=TO;function CO(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(CO,"sum64");tr.sum64=CO;function kO(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(kO,"sum64_hi");tr.sum64_hi=kO;function IO(r,e,t,n){var i=e+n;return i>>>0}o(IO,"sum64_lo");tr.sum64_lo=IO;function DO(r,e,t,n,i,s,f,u){var d=0,v=e;v=v+n>>>0,d+=v<e?1:0,v=v+s>>>0,d+=v<s?1:0,v=v+u>>>0,d+=v<u?1:0;var x=r+t+i+f+d;return x>>>0}o(DO,"sum64_4_hi");tr.sum64_4_hi=DO;function RO(r,e,t,n,i,s,f,u){var d=e+n+s+u;return d>>>0}o(RO,"sum64_4_lo");tr.sum64_4_lo=RO;function OO(r,e,t,n,i,s,f,u,d,v){var x=0,E=e;E=E+n>>>0,x+=E<e?1:0,E=E+s>>>0,x+=E<s?1:0,E=E+u>>>0,x+=E<u?1:0,E=E+v>>>0,x+=E<v?1:0;var O=r+t+i+f+d+x;return O>>>0}o(OO,"sum64_5_hi");tr.sum64_5_hi=OO;function NO(r,e,t,n,i,s,f,u,d,v){var x=e+n+s+u+v;return x>>>0}o(NO,"sum64_5_lo");tr.sum64_5_lo=NO;function PO(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(PO,"rotr64_hi");tr.rotr64_hi=PO;function BO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(BO,"rotr64_lo");tr.rotr64_lo=BO;function LO(r,e,t){return r>>>t}o(LO,"shr64_hi");tr.shr64_hi=LO;function UO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(UO,"shr64_lo");tr.shr64_lo=UO});var ac=Re(wx=>{"use strict";var xx=ji(),FO=$s();function gd(){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(gd,"BlockHash");wx.BlockHash=gd;gd.prototype.update=o(function(e,t){if(e=xx.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=xx.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");gd.prototype.digest=o(function(e){return this.update(this._pad()),FO(this.pending===null),this._digest(e)},"digest");gd.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 M1=Re(rs=>{"use strict";var $O=ji(),go=$O.rotr32;function qO(r,e,t,n){if(r===0)return _x(e,t,n);if(r===1||r===3)return Ax(e,t,n);if(r===2)return Ex(e,t,n)}o(qO,"ft_1");rs.ft_1=qO;function _x(r,e,t){return r&e^~r&t}o(_x,"ch32");rs.ch32=_x;function Ex(r,e,t){return r&e^r&t^e&t}o(Ex,"maj32");rs.maj32=Ex;function Ax(r,e,t){return r^e^t}o(Ax,"p32");rs.p32=Ax;function HO(r){return go(r,2)^go(r,13)^go(r,22)}o(HO,"s0_256");rs.s0_256=HO;function zO(r){return go(r,6)^go(r,11)^go(r,25)}o(zO,"s1_256");rs.s1_256=zO;function jO(r){return go(r,7)^go(r,18)^r>>>3}o(jO,"g0_256");rs.g0_256=jO;function KO(r){return go(r,17)^go(r,19)^r>>>10}o(KO,"g1_256");rs.g1_256=KO});var Tx=Re((LV,Mx)=>{"use strict";var fc=ji(),VO=ac(),GO=M1(),T1=fc.rotl32,qu=fc.sum32,WO=fc.sum32_5,JO=GO.ft_1,Sx=VO.BlockHash,YO=[1518500249,1859775393,2400959708,3395469782];function vo(){if(!(this instanceof vo))return new vo;Sx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(vo,"SHA1");fc.inherits(vo,Sx);Mx.exports=vo;vo.blockSize=512;vo.outSize=160;vo.hmacStrength=80;vo.padLength=64;vo.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]=T1(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],v=this.h[4];for(i=0;i<n.length;i++){var x=~~(i/20),E=WO(T1(s,5),JO(x,f,u,d),v,n[i],YO[x]);v=d,d=u,u=T1(f,30),f=s,s=E}this.h[0]=qu(this.h[0],s),this.h[1]=qu(this.h[1],f),this.h[2]=qu(this.h[2],u),this.h[3]=qu(this.h[3],d),this.h[4]=qu(this.h[4],v)},"_update");vo.prototype._digest=o(function(e){return e==="hex"?fc.toHex32(this.h,"big"):fc.split32(this.h,"big")},"digest")});var C1=Re((UV,kx)=>{"use strict";var cc=ji(),XO=ac(),uc=M1(),ZO=$s(),Ki=cc.sum32,QO=cc.sum32_4,eN=cc.sum32_5,tN=uc.ch32,rN=uc.maj32,nN=uc.s0_256,iN=uc.s1_256,oN=uc.g0_256,sN=uc.g1_256,Cx=XO.BlockHash,aN=[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 yo(){if(!(this instanceof yo))return new yo;Cx.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=aN,this.W=new Array(64)}o(yo,"SHA256");cc.inherits(yo,Cx);kx.exports=yo;yo.blockSize=512;yo.outSize=256;yo.hmacStrength=192;yo.padLength=64;yo.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]=QO(sN(n[i-2]),n[i-7],oN(n[i-15]),n[i-16]);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],v=this.h[4],x=this.h[5],E=this.h[6],O=this.h[7];for(ZO(this.k.length===n.length),i=0;i<n.length;i++){var R=eN(O,iN(v),tN(v,x,E),this.k[i],n[i]),I=Ki(nN(s),rN(s,f,u));O=E,E=x,x=v,v=Ki(d,R),d=u,u=f,f=s,s=Ki(R,I)}this.h[0]=Ki(this.h[0],s),this.h[1]=Ki(this.h[1],f),this.h[2]=Ki(this.h[2],u),this.h[3]=Ki(this.h[3],d),this.h[4]=Ki(this.h[4],v),this.h[5]=Ki(this.h[5],x),this.h[6]=Ki(this.h[6],E),this.h[7]=Ki(this.h[7],O)},"_update");yo.prototype._digest=o(function(e){return e==="hex"?cc.toHex32(this.h,"big"):cc.split32(this.h,"big")},"digest")});var Rx=Re((FV,Dx)=>{"use strict";var k1=ji(),Ix=C1();function ns(){if(!(this instanceof ns))return new ns;Ix.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(ns,"SHA224");k1.inherits(ns,Ix);Dx.exports=ns;ns.blockSize=512;ns.outSize=224;ns.hmacStrength=192;ns.padLength=64;ns.prototype._digest=o(function(e){return e==="hex"?k1.toHex32(this.h.slice(0,7),"big"):k1.split32(this.h.slice(0,7),"big")},"digest")});var R1=Re(($V,Bx)=>{"use strict";var En=ji(),fN=ac(),cN=$s(),xo=En.rotr64_hi,wo=En.rotr64_lo,Ox=En.shr64_hi,Nx=En.shr64_lo,zs=En.sum64,I1=En.sum64_hi,D1=En.sum64_lo,uN=En.sum64_4_hi,lN=En.sum64_4_lo,hN=En.sum64_5_hi,dN=En.sum64_5_lo,Px=fN.BlockHash,pN=[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 Vi(){if(!(this instanceof Vi))return new Vi;Px.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=pN,this.W=new Array(160)}o(Vi,"SHA512");En.inherits(Vi,Px);Bx.exports=Vi;Vi.blockSize=1024;Vi.outSize=512;Vi.hmacStrength=192;Vi.padLength=128;Vi.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=SN(n[i-4],n[i-3]),f=MN(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],v=EN(n[i-30],n[i-29]),x=AN(n[i-30],n[i-29]),E=n[i-32],O=n[i-31];n[i]=uN(s,f,u,d,v,x,E,O),n[i+1]=lN(s,f,u,d,v,x,E,O)}},"_prepareBlock");Vi.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],v=this.h[5],x=this.h[6],E=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],B=this.h[11],Y=this.h[12],P=this.h[13],J=this.h[14],ee=this.h[15];cN(this.k.length===n.length);for(var X=0;X<n.length;X+=2){var ne=J,V=ee,H=wN(O,R),z=_N(O,R),he=mN(O,R,I,B,Y,P),L=bN(O,R,I,B,Y,P),h=this.k[X],g=this.k[X+1],b=n[X],l=n[X+1],m=hN(ne,V,H,z,he,L,h,g,b,l),_=dN(ne,V,H,z,he,L,h,g,b,l);ne=yN(i,s),V=xN(i,s),H=gN(i,s,f,u,d,v),z=vN(i,s,f,u,d,v);var S=I1(ne,V,H,z),A=D1(ne,V,H,z);J=Y,ee=P,Y=I,P=B,I=O,B=R,O=I1(x,E,m,_),R=D1(E,E,m,_),x=d,E=v,d=f,v=u,f=i,u=s,i=I1(m,_,S,A),s=D1(m,_,S,A)}zs(this.h,0,i,s),zs(this.h,2,f,u),zs(this.h,4,d,v),zs(this.h,6,x,E),zs(this.h,8,O,R),zs(this.h,10,I,B),zs(this.h,12,Y,P),zs(this.h,14,J,ee)},"_update");Vi.prototype._digest=o(function(e){return e==="hex"?En.toHex32(this.h,"big"):En.split32(this.h,"big")},"digest");function mN(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(mN,"ch64_hi");function bN(r,e,t,n,i,s){var f=e&n^~e&s;return f<0&&(f+=4294967296),f}o(bN,"ch64_lo");function gN(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(gN,"maj64_hi");function vN(r,e,t,n,i,s){var f=e&n^e&s^n&s;return f<0&&(f+=4294967296),f}o(vN,"maj64_lo");function yN(r,e){var t=xo(r,e,28),n=xo(e,r,2),i=xo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(yN,"s0_512_hi");function xN(r,e){var t=wo(r,e,28),n=wo(e,r,2),i=wo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(xN,"s0_512_lo");function wN(r,e){var t=xo(r,e,14),n=xo(r,e,18),i=xo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(wN,"s1_512_hi");function _N(r,e){var t=wo(r,e,14),n=wo(r,e,18),i=wo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(_N,"s1_512_lo");function EN(r,e){var t=xo(r,e,1),n=xo(r,e,8),i=Ox(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(EN,"g0_512_hi");function AN(r,e){var t=wo(r,e,1),n=wo(r,e,8),i=Nx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(AN,"g0_512_lo");function SN(r,e){var t=xo(r,e,19),n=xo(e,r,29),i=Ox(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(SN,"g1_512_hi");function MN(r,e){var t=wo(r,e,19),n=wo(e,r,29),i=Nx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(MN,"g1_512_lo")});var Fx=Re((qV,Ux)=>{"use strict";var O1=ji(),Lx=R1();function is(){if(!(this instanceof is))return new is;Lx.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(is,"SHA384");O1.inherits(is,Lx);Ux.exports=is;is.blockSize=1024;is.outSize=384;is.hmacStrength=192;is.padLength=128;is.prototype._digest=o(function(e){return e==="hex"?O1.toHex32(this.h.slice(0,12),"big"):O1.split32(this.h.slice(0,12),"big")},"digest")});var $x=Re(lc=>{"use strict";lc.sha1=Tx();lc.sha224=Rx();lc.sha256=C1();lc.sha384=Fx();lc.sha512=R1()});var Vx=Re(Kx=>{"use strict";var Ha=ji(),TN=ac(),vd=Ha.rotl32,qx=Ha.sum32,Hu=Ha.sum32_3,Hx=Ha.sum32_4,jx=TN.BlockHash;function _o(){if(!(this instanceof _o))return new _o;jx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(_o,"RIPEMD160");Ha.inherits(_o,jx);Kx.ripemd160=_o;_o.blockSize=512;_o.outSize=160;_o.hmacStrength=192;_o.padLength=64;_o.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,v=i,x=s,E=f,O=u,R=0;R<80;R++){var I=qx(vd(Hx(n,zx(R,i,s,f),e[IN[R]+t],CN(R)),RN[R]),u);n=u,u=f,f=vd(s,10),s=i,i=I,I=qx(vd(Hx(d,zx(79-R,v,x,E),e[DN[R]+t],kN(R)),ON[R]),O),d=O,O=E,E=vd(x,10),x=v,v=I}I=Hu(this.h[1],s,E),this.h[1]=Hu(this.h[2],f,O),this.h[2]=Hu(this.h[3],u,d),this.h[3]=Hu(this.h[4],n,v),this.h[4]=Hu(this.h[0],i,x),this.h[0]=I},"update");_o.prototype._digest=o(function(e){return e==="hex"?Ha.toHex32(this.h,"little"):Ha.split32(this.h,"little")},"digest");function zx(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(zx,"f");function CN(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(CN,"K");function kN(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(kN,"Kh");var IN=[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],DN=[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],RN=[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],ON=[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 Wx=Re((jV,Gx)=>{"use strict";var NN=ji(),PN=$s();function hc(r,e,t){if(!(this instanceof hc))return new hc(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(NN.toArray(e,t))}o(hc,"Hmac");Gx.exports=hc;hc.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),PN(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");hc.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");hc.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var zu=Re(Jx=>{var Hr=Jx;Hr.utils=ji();Hr.common=ac();Hr.sha=$x();Hr.ripemd=Vx();Hr.hmac=Wx();Hr.sha1=Hr.sha.sha1;Hr.sha256=Hr.sha.sha256;Hr.sha224=Hr.sha.sha224;Hr.sha384=Hr.sha.sha384;Hr.sha512=Hr.sha.sha512;Hr.ripemd160=Hr.ripemd.ripemd160});var Xx=Re((VV,Yx)=>{Yx.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 yd=Re(e6=>{"use strict";var P1=e6,js=zu(),N1=S1(),BN=jn(),Zx=BN.assert;function Qx(r){r.type==="short"?this.curve=new N1.short(r):r.type==="edwards"?this.curve=new N1.edwards(r):this.curve=new N1.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,Zx(this.g.validate(),"Invalid curve"),Zx(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(Qx,"PresetCurve");P1.PresetCurve=Qx;function Ks(r,e){Object.defineProperty(P1,r,{configurable:!0,enumerable:!0,get:function(){var t=new Qx(e);return Object.defineProperty(P1,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(Ks,"defineCurve");Ks("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:js.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Ks("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:js.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Ks("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:js.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Ks("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:js.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"]});Ks("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:js.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"]});Ks("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:js.sha256,gRed:!1,g:["9"]});Ks("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:js.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var B1;try{B1=Xx()}catch{B1=void 0}Ks("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:js.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",B1]})});var n6=Re((WV,r6)=>{"use strict";var LN=zu(),za=v1(),t6=$s();function Vs(r){if(!(this instanceof Vs))return new Vs(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=za.toArray(r.entropy,r.entropyEnc||"hex"),t=za.toArray(r.nonce,r.nonceEnc||"hex"),n=za.toArray(r.pers,r.persEnc||"hex");t6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(Vs,"HmacDRBG");r6.exports=Vs;Vs.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");Vs.prototype._hmac=o(function(){return new LN.hmac(this.hash,this.K)},"hmac");Vs.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");Vs.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=za.toArray(e,t),n=za.toArray(n,i),t6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Vs.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=za.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++,za.encode(f,t)},"generate")});var o6=Re((JV,i6)=>{"use strict";var UN=mo(),FN=jn(),L1=FN.assert;function Yr(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(Yr,"KeyPair");i6.exports=Yr;Yr.fromPublic=o(function(e,t,n){return t instanceof Yr?t:new Yr(e,{pub:t,pubEnc:n})},"fromPublic");Yr.fromPrivate=o(function(e,t,n){return t instanceof Yr?t:new Yr(e,{priv:t,privEnc:n})},"fromPrivate");Yr.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");Yr.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");Yr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Yr.prototype._importPrivate=o(function(e,t){this.priv=new UN(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Yr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?L1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&L1(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");Yr.prototype.derive=o(function(e){return e.validate()||L1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Yr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");Yr.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");Yr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var f6=Re((YV,a6)=>{"use strict";var xd=mo(),$1=jn(),$N=$1.assert;function wd(r,e){if(r instanceof wd)return r;this._importDER(r,e)||($N(r.r&&r.s,"Signature without r or s"),this.r=new xd(r.r,16),this.s=new xd(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(wd,"Signature");a6.exports=wd;function qN(){this.place=0}o(qN,"Position");function U1(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(U1,"getLength");function s6(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(s6,"rmPadding");wd.prototype._importDER=o(function(e,t){e=$1.toArray(e,t);var n=new qN;if(e[n.place++]!==48)return!1;var i=U1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=U1(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=U1(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 xd(f),this.s=new xd(d),this.recoveryParam=null,!0},"_importDER");function F1(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(F1,"constructLength");wd.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=s6(t),n=s6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];F1(i,t.length),i=i.concat(t),i.push(2),F1(i,n.length);var s=i.concat(n),f=[48];return F1(f,s.length),f=f.concat(s),$1.encode(f,e)},"toDER")});var l6=Re((XV,u6)=>{"use strict";var Gi=mo(),c6=n6(),HN=jn(),q1=yd(),zN=_1(),ja=HN.assert,H1=o6(),_d=f6();function Ei(r){if(!(this instanceof Ei))return new Ei(r);typeof r=="string"&&(ja(Object.prototype.hasOwnProperty.call(q1,r),"Unknown curve "+r),r=q1[r]),r instanceof q1.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(Ei,"EC");u6.exports=Ei;Ei.prototype.keyPair=o(function(e){return new H1(this,e)},"keyPair");Ei.prototype.keyFromPrivate=o(function(e,t){return H1.fromPrivate(this,e,t)},"keyFromPrivate");Ei.prototype.keyFromPublic=o(function(e,t){return H1.fromPublic(this,e,t)},"keyFromPublic");Ei.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new c6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||zN(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Gi(2));;){var s=new Gi(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");Ei.prototype._truncateToN=o(function(e,t,n){var i;if(Gi.isBN(e)||typeof e=="number")e=new Gi(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new Gi(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new Gi(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");Ei.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!Gi.isBN(e)){ja(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),ja(e.length>>>0===e.length);for(var s=0;s<e.length;s++)ja((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),ja(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);ja(new Gi(d).eq(e),"Can not sign message");for(var v=new c6({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),x=this.n.sub(new Gi(1)),E=0;;E++){var O=i.k?i.k(E):new Gi(v.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(x)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new _d({r:B,s:Y,recoveryParam:P})}}}}}},"sign");Ei.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new _d(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),v=d.mul(e).umod(this.n),x=d.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)},"verify");Ei.prototype.recoverPubKey=function(r,e,t,n){ja((3&t)===t,"The recovery param is more than two bits"),e=new _d(e,n);var i=this.n,s=new Gi(r),f=e.r,u=e.s,d=t&1,v=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var x=e.r.invm(i),E=i.sub(s).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(E,f,O)};Ei.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new _d(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 m6=Re((ZV,p6)=>{"use strict";var ju=jn(),d6=ju.assert,h6=ju.parseBytes,dc=ju.cachedProperty;function Rr(r,e){this.eddsa=r,this._secret=h6(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=h6(e.pub)}o(Rr,"KeyPair");Rr.fromPublic=o(function(e,t){return t instanceof Rr?t:new Rr(e,{pub:t})},"fromPublic");Rr.fromSecret=o(function(e,t){return t instanceof Rr?t:new Rr(e,{secret:t})},"fromSecret");Rr.prototype.secret=o(function(){return this._secret},"secret");dc(Rr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));dc(Rr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));dc(Rr,"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"));dc(Rr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));dc(Rr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));dc(Rr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Rr.prototype.sign=o(function(e){return d6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Rr.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Rr.prototype.getSecret=o(function(e){return d6(this._secret,"KeyPair is public only"),ju.encode(this.secret(),e)},"getSecret");Rr.prototype.getPublic=o(function(e){return ju.encode(this.pubBytes(),e)},"getPublic");p6.exports=Rr});var v6=Re((QV,g6)=>{"use strict";var jN=mo(),Ed=jn(),b6=Ed.assert,Ad=Ed.cachedProperty,KN=Ed.parseBytes;function Ka(r,e){this.eddsa=r,typeof e!="object"&&(e=KN(e)),Array.isArray(e)&&(b6(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),b6(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof jN&&(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(Ka,"Signature");Ad(Ka,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));Ad(Ka,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));Ad(Ka,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));Ad(Ka,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Ka.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Ka.prototype.toHex=o(function(){return Ed.encode(this.toBytes(),"hex").toUpperCase()},"toHex");g6.exports=Ka});var E6=Re((eG,_6)=>{"use strict";var VN=zu(),GN=yd(),pc=jn(),WN=pc.assert,x6=pc.parseBytes,w6=m6(),y6=v6();function An(r){if(WN(r==="ed25519","only tested with ed25519 so far"),!(this instanceof An))return new An(r);r=GN[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=VN.sha512}o(An,"EDDSA");_6.exports=An;An.prototype.sign=o(function(e,t){e=x6(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");An.prototype.verify=o(function(e,t,n){if(e=x6(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");An.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return pc.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");An.prototype.keyFromPublic=o(function(e){return w6.fromPublic(this,e)},"keyFromPublic");An.prototype.keyFromSecret=o(function(e){return w6.fromSecret(this,e)},"keyFromSecret");An.prototype.makeSignature=o(function(e){return e instanceof y6?e:new y6(this,e)},"makeSignature");An.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");An.prototype.decodePoint=o(function(e){e=pc.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=pc.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");An.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");An.prototype.decodeInt=o(function(e){return pc.intFromLE(e)},"decodeInt");An.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var S6=Re(A6=>{"use strict";var Va=A6;Va.version=Q3().version;Va.utils=jn();Va.rand=_1();Va.curve=S1();Va.curves=yd();Va.ec=l6();Va.eddsa=E6()});var T6=Re(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.BrowserRandomSource=void 0;var M6=65536,Sd=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+=M6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,M6)));return t}};o(Sd,"BrowserRandomSource");Md.BrowserRandomSource=Sd});var C6=Re(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.NodeRandomSource=void 0;var JN=xi(),Td=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,JN.wipe)(t),n}};o(Td,"NodeRandomSource");Cd.NodeRandomSource=Td});var k6=Re(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.SystemRandomSource=void 0;var YN=T6(),XN=C6(),kd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new YN.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new XN.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(kd,"SystemRandomSource");Id.SystemRandomSource=kd});var Ga=Re(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.randomStringForEntropy=Xr.randomString=Xr.randomUint32=Xr.randomBytes=Xr.defaultRandomSource=void 0;var ZN=k6(),QN=$a(),I6=xi();Xr.defaultRandomSource=new ZN.SystemRandomSource;function z1(r,e=Xr.defaultRandomSource){return e.randomBytes(r)}o(z1,"randomBytes");Xr.randomBytes=z1;function eP(r=Xr.defaultRandomSource){let e=z1(4,r),t=(0,QN.readUint32LE)(e);return(0,I6.wipe)(e),t}o(eP,"randomUint32");Xr.randomUint32=eP;var D6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function R6(r,e=D6,t=Xr.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=z1(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,I6.wipe)(f)}return n}o(R6,"randomString");Xr.randomString=R6;function tP(r,e=D6,t=Xr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return R6(n,e,t)}o(tP,"randomStringForEntropy");Xr.randomStringForEntropy=tP});var P6=Re(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var bc=$a(),mc=xi();os.DIGEST_LENGTH=64;os.BLOCK_SIZE=128;var N6=function(){function r(){this.digestLength=os.DIGEST_LENGTH,this.blockSize=os.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(){mc.wipe(this._buffer),mc.wipe(this._tempHi),mc.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<os.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(j1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=j1(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;bc.writeUint32BE(i,this._buffer,f-8),bc.writeUint32BE(s,this._buffer,f-4),j1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)bc.writeUint32BE(this._stateHi[u],e,u*8),bc.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){mc.wipe(e.stateHi),mc.wipe(e.stateLo),e.buffer&&mc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();os.SHA512=N6;var O6=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 j1(r,e,t,n,i,s,f){for(var u=t[0],d=t[1],v=t[2],x=t[3],E=t[4],O=t[5],R=t[6],I=t[7],B=n[0],Y=n[1],P=n[2],J=n[3],ee=n[4],X=n[5],ne=n[6],V=n[7],H,z,he,L,h,g,b,l;f>=128;){for(var m=0;m<16;m++){var _=8*m+s;r[m]=bc.readUint32BE(i,_),e[m]=bc.readUint32BE(i,_+4)}for(var m=0;m<80;m++){var S=u,A=d,y=v,C=x,N=E,w=O,k=R,fe=I,D=B,Q=Y,se=P,q=J,j=ee,G=X,te=ne,ae=V;if(H=I,z=V,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=(E>>>14|ee<<32-14)^(E>>>18|ee<<32-18)^(ee>>>41-32|E<<32-(41-32)),z=(ee>>>14|E<<32-14)^(ee>>>18|E<<32-18)^(E>>>41-32|ee<<32-(41-32)),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=E&O^~E&R,z=ee&X^~ee&ne,h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=O6[m*2],z=O6[m*2+1],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=r[m%16],z=e[m%16],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,he=b&65535|l<<16,L=h&65535|g<<16,H=he,z=L,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=(u>>>28|B<<32-28)^(B>>>34-32|u<<32-(34-32))^(B>>>39-32|u<<32-(39-32)),z=(B>>>28|u<<32-28)^(u>>>34-32|B<<32-(34-32))^(u>>>39-32|B<<32-(39-32)),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=u&d^u&v^d&v,z=B&Y^B&P^Y&P,h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,fe=b&65535|l<<16,ae=h&65535|g<<16,H=C,z=q,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=he,z=L,h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,C=b&65535|l<<16,q=h&65535|g<<16,d=S,v=A,x=y,E=C,O=N,R=w,I=k,u=fe,Y=D,P=Q,J=se,ee=q,X=j,ne=G,V=te,B=ae,m%16===15)for(var _=0;_<16;_++)H=r[_],z=e[_],h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=r[(_+9)%16],z=e[(_+9)%16],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,he=r[(_+1)%16],L=e[(_+1)%16],H=(he>>>1|L<<32-1)^(he>>>8|L<<32-8)^he>>>7,z=(L>>>1|he<<32-1)^(L>>>8|he<<32-8)^(L>>>7|he<<32-7),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,he=r[(_+14)%16],L=e[(_+14)%16],H=(he>>>19|L<<32-19)^(L>>>61-32|he<<32-(61-32))^he>>>6,z=(L>>>19|he<<32-19)^(he>>>61-32|L<<32-(61-32))^(L>>>6|he<<32-6),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,r[_]=b&65535|l<<16,e[_]=h&65535|g<<16}H=u,z=B,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[0],z=n[0],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[0]=u=b&65535|l<<16,n[0]=B=h&65535|g<<16,H=d,z=Y,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[1],z=n[1],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[1]=d=b&65535|l<<16,n[1]=Y=h&65535|g<<16,H=v,z=P,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[2],z=n[2],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[2]=v=b&65535|l<<16,n[2]=P=h&65535|g<<16,H=x,z=J,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[3],z=n[3],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[3]=x=b&65535|l<<16,n[3]=J=h&65535|g<<16,H=E,z=ee,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[4],z=n[4],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[4]=E=b&65535|l<<16,n[4]=ee=h&65535|g<<16,H=O,z=X,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[5],z=n[5],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[5]=O=b&65535|l<<16,n[5]=X=h&65535|g<<16,H=R,z=ne,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[6],z=n[6],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[6]=R=b&65535|l<<16,n[6]=ne=h&65535|g<<16,H=I,z=V,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[7],z=n[7],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[7]=I=b&65535|l<<16,n[7]=V=h&65535|g<<16,s+=128,f-=128}return s}o(j1,"hashBlocks");function rP(r){var e=new N6;e.update(r);var t=e.digest();return e.clean(),t}o(rP,"hash");os.hash=rP});var Dd=Re(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.convertSecretKeyToX25519=Gt.convertPublicKeyToX25519=Gt.verify=Gt.sign=Gt.extractPublicKeyFromSecretKey=Gt.generateKeyPair=Gt.generateKeyPairFromSeed=Gt.SEED_LENGTH=Gt.SECRET_KEY_LENGTH=Gt.PUBLIC_KEY_LENGTH=Gt.SIGNATURE_LENGTH=void 0;var nP=Ga(),Ku=P6(),$6=xi();Gt.SIGNATURE_LENGTH=64;Gt.PUBLIC_KEY_LENGTH=32;Gt.SECRET_KEY_LENGTH=64;Gt.SEED_LENGTH=32;function We(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(We,"gf");var iP=new Uint8Array(32);iP[0]=9;var G1=We(),gc=We([1]),oP=We([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),sP=We([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),B6=We([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),L6=We([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),aP=We([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Gs(r,e){for(let t=0;t<16;t++)r[t]=e[t]|0}o(Gs,"set25519");function K1(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(K1,"car25519");function q6(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(q6,"sel25519");function Vu(r,e){let t=We(),n=We();for(let i=0;i<16;i++)n[i]=e[i];K1(n),K1(n),K1(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,q6(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(Vu,"pack25519");function H6(r,e){let t=0;for(let n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(H6,"verify32");function U6(r,e){let t=new Uint8Array(32),n=new Uint8Array(32);return Vu(t,r),Vu(n,e),H6(t,n)}o(U6,"neq25519");function z6(r){let e=new Uint8Array(32);return Vu(e,r),e[0]&1}o(z6,"par25519");function fP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(fP,"unpack25519");function Wa(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Wa,"add");function Ya(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ya,"sub");function Zt(r,e,t){let n,i,s=0,f=0,u=0,d=0,v=0,x=0,E=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,X=0,ne=0,V=0,H=0,z=0,he=0,L=0,h=0,g=0,b=0,l=0,m=0,_=0,S=0,A=0,y=0,C=t[0],N=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],j=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*w,d+=n*k,v+=n*fe,x+=n*D,E+=n*Q,O+=n*se,R+=n*q,I+=n*j,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,X+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*w,v+=n*k,x+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*j,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,X+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,v+=n*w,x+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*j,P+=n*G,J+=n*te,ee+=n*ae,X+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,v+=n*N,x+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*j,J+=n*G,ee+=n*te,X+=n*ae,ne+=n*Ae,V+=n*ge,H+=n*ie,n=e[4],v+=n*C,x+=n*N,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*j,ee+=n*G,X+=n*te,ne+=n*ae,V+=n*Ae,H+=n*ge,z+=n*ie,n=e[5],x+=n*C,E+=n*N,O+=n*w,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*j,X+=n*G,ne+=n*te,V+=n*ae,H+=n*Ae,z+=n*ge,he+=n*ie,n=e[6],E+=n*C,O+=n*N,R+=n*w,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,X+=n*j,ne+=n*G,V+=n*te,H+=n*ae,z+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*w,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,X+=n*q,ne+=n*j,V+=n*G,H+=n*te,z+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*w,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,X+=n*se,ne+=n*q,V+=n*j,H+=n*G,z+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,g+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*w,P+=n*k,J+=n*fe,ee+=n*D,X+=n*Q,ne+=n*se,V+=n*q,H+=n*j,z+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,g+=n*ge,b+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*w,J+=n*k,ee+=n*fe,X+=n*D,ne+=n*Q,V+=n*se,H+=n*q,z+=n*j,he+=n*G,L+=n*te,h+=n*ae,g+=n*Ae,b+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*w,ee+=n*k,X+=n*fe,ne+=n*D,V+=n*Q,H+=n*se,z+=n*q,he+=n*j,L+=n*G,h+=n*te,g+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*w,X+=n*k,ne+=n*fe,V+=n*D,H+=n*Q,z+=n*se,he+=n*q,L+=n*j,h+=n*G,g+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ie,n=e[13],J+=n*C,ee+=n*N,X+=n*w,ne+=n*k,V+=n*fe,H+=n*D,z+=n*Q,he+=n*se,L+=n*q,h+=n*j,g+=n*G,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,S+=n*ie,n=e[14],ee+=n*C,X+=n*N,ne+=n*w,V+=n*k,H+=n*fe,z+=n*D,he+=n*Q,L+=n*se,h+=n*q,g+=n*j,b+=n*G,l+=n*te,m+=n*ae,_+=n*Ae,S+=n*ge,A+=n*ie,n=e[15],X+=n*C,ne+=n*N,V+=n*w,H+=n*k,z+=n*fe,he+=n*D,L+=n*Q,h+=n*se,g+=n*q,b+=n*j,l+=n*G,m+=n*te,_+=n*ae,S+=n*Ae,A+=n*ge,y+=n*ie,s+=38*ne,f+=38*V,u+=38*H,d+=38*z,v+=38*he,x+=38*L,E+=38*h,O+=38*g,R+=38*b,I+=38*l,B+=38*m,Y+=38*_,P+=38*S,J+=38*A,ee+=38*y,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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=v,r[5]=x,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=X}o(Zt,"mul");function Ja(r,e){Zt(r,e,e)}o(Ja,"square");function j6(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Ja(t,t),n!==2&&n!==4&&Zt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(j6,"inv25519");function cP(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Ja(t,t),n!==1&&Zt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(cP,"pow2523");function W1(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We(),v=We(),x=We();Ya(t,r[1],r[0]),Ya(x,e[1],e[0]),Zt(t,t,x),Wa(n,r[0],r[1]),Wa(x,e[0],e[1]),Zt(n,n,x),Zt(i,r[3],e[3]),Zt(i,i,sP),Zt(s,r[2],e[2]),Wa(s,s,s),Ya(f,n,t),Ya(u,s,i),Wa(d,s,i),Wa(v,n,t),Zt(r[0],f,u),Zt(r[1],v,d),Zt(r[2],d,u),Zt(r[3],f,v)}o(W1,"edadd");function F6(r,e,t){for(let n=0;n<4;n++)q6(r[n],e[n],t)}o(F6,"cswap");function Y1(r,e){let t=We(),n=We(),i=We();j6(i,e[2]),Zt(t,e[0],i),Zt(n,e[1],i),Vu(r,n),r[31]^=z6(t)<<7}o(Y1,"pack");function K6(r,e,t){Gs(r[0],G1),Gs(r[1],gc),Gs(r[2],gc),Gs(r[3],G1);for(let n=255;n>=0;--n){let i=t[n/8|0]>>(n&7)&1;F6(r,e,i),W1(e,r),W1(r,r),F6(r,e,i)}}o(K6,"scalarmult");function X1(r,e){let t=[We(),We(),We(),We()];Gs(t[0],B6),Gs(t[1],L6),Gs(t[2],gc),Zt(t[3],B6,L6),K6(r,t,e)}o(X1,"scalarbase");function V6(r){if(r.length!==Gt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Gt.SEED_LENGTH} bytes`);let e=(0,Ku.hash)(r);e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(32),n=[We(),We(),We(),We()];X1(n,e),Y1(t,n);let i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(V6,"generateKeyPairFromSeed");Gt.generateKeyPairFromSeed=V6;function uP(r){let e=(0,nP.randomBytes)(32,r),t=V6(e);return(0,$6.wipe)(e),t}o(uP,"generateKeyPair");Gt.generateKeyPair=uP;function lP(r){if(r.length!==Gt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Gt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(r.subarray(32))}o(lP,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=lP;var V1=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 G6(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]*V1[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)*V1[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*V1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(G6,"modL");function J1(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;G6(r,e)}o(J1,"reduce");function hP(r,e){let t=new Float64Array(64),n=[We(),We(),We(),We()],i=(0,Ku.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 Ku.SHA512;f.update(s.subarray(32)),f.update(e);let u=f.digest();f.clean(),J1(u),X1(n,u),Y1(s,n),f.reset(),f.update(s.subarray(0,32)),f.update(r.subarray(32)),f.update(e);let d=f.digest();J1(d);for(let v=0;v<32;v++)t[v]=u[v];for(let v=0;v<32;v++)for(let x=0;x<32;x++)t[v+x]+=d[v]*i[x];return G6(s.subarray(32),t),s}o(hP,"sign");Gt.sign=hP;function W6(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We();return Gs(r[2],gc),fP(r[1],e),Ja(i,r[1]),Zt(s,i,oP),Ya(i,i,r[2]),Wa(s,r[2],s),Ja(f,s),Ja(u,f),Zt(d,u,f),Zt(t,d,i),Zt(t,t,s),cP(t,t),Zt(t,t,i),Zt(t,t,s),Zt(t,t,s),Zt(r[0],t,s),Ja(n,r[0]),Zt(n,n,s),U6(n,i)&&Zt(r[0],r[0],aP),Ja(n,r[0]),Zt(n,n,s),U6(n,i)?-1:(z6(r[0])===e[31]>>7&&Ya(r[0],G1,r[0]),Zt(r[3],r[0],r[1]),0)}o(W6,"unpackneg");function dP(r,e,t){let n=new Uint8Array(32),i=[We(),We(),We(),We()],s=[We(),We(),We(),We()];if(t.length!==Gt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Gt.SIGNATURE_LENGTH} bytes`);if(W6(s,r))return!1;let f=new Ku.SHA512;f.update(t.subarray(0,32)),f.update(r),f.update(e);let u=f.digest();return J1(u),K6(i,s,u),X1(s,t.subarray(32)),W1(i,s),Y1(n,i),!H6(t,n)}o(dP,"verify");Gt.verify=dP;function pP(r){let e=[We(),We(),We(),We()];if(W6(e,r))throw new Error("Ed25519: invalid public key");let t=We(),n=We(),i=e[1];Wa(t,gc,i),Ya(n,gc,i),j6(n,n),Zt(t,t,n);let s=new Uint8Array(32);return Vu(s,t),s}o(pP,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=pP;function mP(r){let e=(0,Ku.hash)(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(e.subarray(0,32));return(0,$6.wipe)(e),t}o(mP,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=mP});var Y6=Re((fG,J6)=>{"use strict";J6.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 ew=Re(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.sharedKey=pr.generateKeyPair=pr.generateKeyPairFromSeed=pr.scalarMultBase=pr.scalarMult=pr.SHARED_KEY_LENGTH=pr.SECRET_KEY_LENGTH=pr.PUBLIC_KEY_LENGTH=void 0;var bP=Ga(),gP=xi();pr.PUBLIC_KEY_LENGTH=32;pr.SECRET_KEY_LENGTH=32;pr.SHARED_KEY_LENGTH=32;function Eo(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(Eo,"gf");var X6=new Uint8Array(32);X6[0]=9;var vP=Eo([56129,1]);function Z1(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(Z1,"car25519");function Gu(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(Gu,"sel25519");function yP(r,e){let t=Eo(),n=Eo();for(let i=0;i<16;i++)n[i]=e[i];Z1(n),Z1(n),Z1(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,Gu(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(yP,"pack25519");function xP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(xP,"unpack25519");function Rd(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Rd,"add");function Od(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Od,"sub");function ss(r,e,t){let n,i,s=0,f=0,u=0,d=0,v=0,x=0,E=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,X=0,ne=0,V=0,H=0,z=0,he=0,L=0,h=0,g=0,b=0,l=0,m=0,_=0,S=0,A=0,y=0,C=t[0],N=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],j=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*w,d+=n*k,v+=n*fe,x+=n*D,E+=n*Q,O+=n*se,R+=n*q,I+=n*j,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,X+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*w,v+=n*k,x+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*j,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,X+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,v+=n*w,x+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*j,P+=n*G,J+=n*te,ee+=n*ae,X+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,v+=n*N,x+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*j,J+=n*G,ee+=n*te,X+=n*ae,ne+=n*Ae,V+=n*ge,H+=n*ie,n=e[4],v+=n*C,x+=n*N,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*j,ee+=n*G,X+=n*te,ne+=n*ae,V+=n*Ae,H+=n*ge,z+=n*ie,n=e[5],x+=n*C,E+=n*N,O+=n*w,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*j,X+=n*G,ne+=n*te,V+=n*ae,H+=n*Ae,z+=n*ge,he+=n*ie,n=e[6],E+=n*C,O+=n*N,R+=n*w,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,X+=n*j,ne+=n*G,V+=n*te,H+=n*ae,z+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*w,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,X+=n*q,ne+=n*j,V+=n*G,H+=n*te,z+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*w,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,X+=n*se,ne+=n*q,V+=n*j,H+=n*G,z+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,g+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*w,P+=n*k,J+=n*fe,ee+=n*D,X+=n*Q,ne+=n*se,V+=n*q,H+=n*j,z+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,g+=n*ge,b+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*w,J+=n*k,ee+=n*fe,X+=n*D,ne+=n*Q,V+=n*se,H+=n*q,z+=n*j,he+=n*G,L+=n*te,h+=n*ae,g+=n*Ae,b+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*w,ee+=n*k,X+=n*fe,ne+=n*D,V+=n*Q,H+=n*se,z+=n*q,he+=n*j,L+=n*G,h+=n*te,g+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*w,X+=n*k,ne+=n*fe,V+=n*D,H+=n*Q,z+=n*se,he+=n*q,L+=n*j,h+=n*G,g+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ie,n=e[13],J+=n*C,ee+=n*N,X+=n*w,ne+=n*k,V+=n*fe,H+=n*D,z+=n*Q,he+=n*se,L+=n*q,h+=n*j,g+=n*G,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,S+=n*ie,n=e[14],ee+=n*C,X+=n*N,ne+=n*w,V+=n*k,H+=n*fe,z+=n*D,he+=n*Q,L+=n*se,h+=n*q,g+=n*j,b+=n*G,l+=n*te,m+=n*ae,_+=n*Ae,S+=n*ge,A+=n*ie,n=e[15],X+=n*C,ne+=n*N,V+=n*w,H+=n*k,z+=n*fe,he+=n*D,L+=n*Q,h+=n*se,g+=n*q,b+=n*j,l+=n*G,m+=n*te,_+=n*ae,S+=n*Ae,A+=n*ge,y+=n*ie,s+=38*ne,f+=38*V,u+=38*H,d+=38*z,v+=38*he,x+=38*L,E+=38*h,O+=38*g,R+=38*b,I+=38*l,B+=38*m,Y+=38*_,P+=38*S,J+=38*A,ee+=38*y,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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=v,r[5]=x,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=X}o(ss,"mul");function Wu(r,e){ss(r,e,e)}o(Wu,"square");function wP(r,e){let t=Eo();for(let n=0;n<16;n++)t[n]=e[n];for(let n=253;n>=0;n--)Wu(t,t),n!==2&&n!==4&&ss(t,t,e);for(let n=0;n<16;n++)r[n]=t[n]}o(wP,"inv25519");function Q1(r,e){let t=new Uint8Array(32),n=new Float64Array(80),i=Eo(),s=Eo(),f=Eo(),u=Eo(),d=Eo(),v=Eo();for(let R=0;R<31;R++)t[R]=r[R];t[31]=r[31]&127|64,t[0]&=248,xP(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;Gu(i,s,I),Gu(f,u,I),Rd(d,i,f),Od(i,i,f),Rd(f,s,u),Od(s,s,u),Wu(u,d),Wu(v,i),ss(i,f,i),ss(f,s,d),Rd(d,i,f),Od(i,i,f),Wu(s,i),Od(f,u,v),ss(i,f,vP),Rd(i,i,u),ss(f,f,i),ss(i,u,v),ss(u,s,n),Wu(s,d),Gu(i,s,I),Gu(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 x=n.subarray(32),E=n.subarray(16);wP(x,x),ss(E,E,x);let O=new Uint8Array(32);return yP(O,E),O}o(Q1,"scalarMult");pr.scalarMult=Q1;function Z6(r){return Q1(r,X6)}o(Z6,"scalarMultBase");pr.scalarMultBase=Z6;function Q6(r){if(r.length!==pr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${pr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(r);return{publicKey:Z6(e),secretKey:e}}o(Q6,"generateKeyPairFromSeed");pr.generateKeyPairFromSeed=Q6;function _P(r){let e=(0,bP.randomBytes)(32,r),t=Q6(e);return(0,gP.wipe)(e),t}o(_P,"generateKeyPair");pr.generateKeyPair=_P;function EP(r,e,t=!1){if(r.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==pr.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(EP,"sharedKey");pr.sharedKey=EP});var tb=Re(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var Zr=$a(),eb=xi(),AP=20;function SP(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],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],x=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],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=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,X=i,ne=s,V=f,H=u,z=d,he=v,L=x,h=E,g=O,b=R,l=I,m=B,_=Y,S=P,A=J,y=0;y<AP;y+=2)ee=ee+H|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,H^=h,H=H>>>32-12|H<<12,X=X+z|0,_^=X,_=_>>>32-16|_<<16,g=g+_|0,z^=g,z=z>>>32-12|z<<12,ne=ne+he|0,S^=ne,S=S>>>32-16|S<<16,b=b+S|0,he^=b,he=he>>>32-12|he<<12,V=V+L|0,A^=V,A=A>>>32-16|A<<16,l=l+A|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,S^=ne,S=S>>>32-8|S<<8,b=b+S|0,he^=b,he=he>>>32-7|he<<7,V=V+L|0,A^=V,A=A>>>32-8|A<<8,l=l+A|0,L^=l,L=L>>>32-7|L<<7,X=X+z|0,_^=X,_=_>>>32-8|_<<8,g=g+_|0,z^=g,z=z>>>32-7|z<<7,ee=ee+H|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,H^=h,H=H>>>32-7|H<<7,ee=ee+z|0,A^=ee,A=A>>>32-16|A<<16,b=b+A|0,z^=b,z=z>>>32-12|z<<12,X=X+he|0,m^=X,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,_^=ne,_=_>>>32-16|_<<16,h=h+_|0,L^=h,L=L>>>32-12|L<<12,V=V+H|0,S^=V,S=S>>>32-16|S<<16,g=g+S|0,H^=g,H=H>>>32-12|H<<12,ne=ne+L|0,_^=ne,_=_>>>32-8|_<<8,h=h+_|0,L^=h,L=L>>>32-7|L<<7,V=V+H|0,S^=V,S=S>>>32-8|S<<8,g=g+S|0,H^=g,H=H>>>32-7|H<<7,X=X+he|0,m^=X,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+z|0,A^=ee,A=A>>>32-8|A<<8,b=b+A|0,z^=b,z=z>>>32-7|z<<7;Zr.writeUint32LE(ee+n|0,r,0),Zr.writeUint32LE(X+i|0,r,4),Zr.writeUint32LE(ne+s|0,r,8),Zr.writeUint32LE(V+f|0,r,12),Zr.writeUint32LE(H+u|0,r,16),Zr.writeUint32LE(z+d|0,r,20),Zr.writeUint32LE(he+v|0,r,24),Zr.writeUint32LE(L+x|0,r,28),Zr.writeUint32LE(h+E|0,r,32),Zr.writeUint32LE(g+O|0,r,36),Zr.writeUint32LE(b+R|0,r,40),Zr.writeUint32LE(l+I|0,r,44),Zr.writeUint32LE(m+B|0,r,48),Zr.writeUint32LE(_+Y|0,r,52),Zr.writeUint32LE(S+P|0,r,56),Zr.writeUint32LE(A+J|0,r,60)}o(SP,"core");function tw(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){SP(u,s,r);for(var v=d;v<d+64&&v<t.length;v++)n[v]=t[v]^u[v-d];TP(s,0,f)}return eb.wipe(u),i===0&&eb.wipe(s),n}o(tw,"streamXOR");Nd.streamXOR=tw;function MP(r,e,t,n){return n===void 0&&(n=0),eb.wipe(t),tw(r,e,t,t,n)}o(MP,"stream");Nd.stream=MP;function TP(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(TP,"incrementCounter")});var ow=Re(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});var Ws=$a(),rw=xi(),CP=tb(),kP=20;function nw(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=iw(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var f=CP.streamXOR(i,s,t,n);return rw.wipe(i),f}o(nw,"streamXOR");Ju.streamXOR=nw;function IP(r,e,t){return rw.wipe(t),nw(r,e,t,t)}o(IP,"stream");Ju.stream=IP;function iw(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],v=r[11]<<24|r[10]<<16|r[9]<<8|r[8],x=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],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=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,X=i,ne=s,V=f,H=u,z=d,he=v,L=x,h=E,g=O,b=R,l=I,m=B,_=Y,S=P,A=J,y=0;y<kP;y+=2)ee=ee+H|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,H^=h,H=H>>>32-12|H<<12,X=X+z|0,_^=X,_=_>>>32-16|_<<16,g=g+_|0,z^=g,z=z>>>32-12|z<<12,ne=ne+he|0,S^=ne,S=S>>>32-16|S<<16,b=b+S|0,he^=b,he=he>>>32-12|he<<12,V=V+L|0,A^=V,A=A>>>32-16|A<<16,l=l+A|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,S^=ne,S=S>>>32-8|S<<8,b=b+S|0,he^=b,he=he>>>32-7|he<<7,V=V+L|0,A^=V,A=A>>>32-8|A<<8,l=l+A|0,L^=l,L=L>>>32-7|L<<7,X=X+z|0,_^=X,_=_>>>32-8|_<<8,g=g+_|0,z^=g,z=z>>>32-7|z<<7,ee=ee+H|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,H^=h,H=H>>>32-7|H<<7,ee=ee+z|0,A^=ee,A=A>>>32-16|A<<16,b=b+A|0,z^=b,z=z>>>32-12|z<<12,X=X+he|0,m^=X,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,_^=ne,_=_>>>32-16|_<<16,h=h+_|0,L^=h,L=L>>>32-12|L<<12,V=V+H|0,S^=V,S=S>>>32-16|S<<16,g=g+S|0,H^=g,H=H>>>32-12|H<<12,ne=ne+L|0,_^=ne,_=_>>>32-8|_<<8,h=h+_|0,L^=h,L=L>>>32-7|L<<7,V=V+H|0,S^=V,S=S>>>32-8|S<<8,g=g+S|0,H^=g,H=H>>>32-7|H<<7,X=X+he|0,m^=X,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+z|0,A^=ee,A=A>>>32-8|A<<8,b=b+A|0,z^=b,z=z>>>32-7|z<<7;return Ws.writeUint32LE(ee,t,0),Ws.writeUint32LE(X,t,4),Ws.writeUint32LE(ne,t,8),Ws.writeUint32LE(V,t,12),Ws.writeUint32LE(m,t,16),Ws.writeUint32LE(_,t,20),Ws.writeUint32LE(S,t,24),Ws.writeUint32LE(A,t,28),t}o(iw,"hchacha");Ju.hchacha=iw});var rb=Re(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});function DP(r,e,t){return~(r-1)&e|r-1&t}o(DP,"select");vc.select=DP;function RP(r,e){return(r|0)-(e|0)-1>>>31&1}o(RP,"lessOrEqual");vc.lessOrEqual=RP;function sw(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(sw,"compare");vc.compare=sw;function OP(r,e){return r.length===0||e.length===0?!1:sw(r,e)!==0}o(OP,"equal");vc.equal=OP});var fw=Re(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var NP=rb(),Pd=xi();as.DIGEST_LENGTH=16;var aw=function(){function r(e){this.digestLength=as.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 v=e[14]|e[15]<<8;this._r[8]=(d>>>8|v<<8)&8191,this._r[9]=v>>>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],v=this._h[4],x=this._h[5],E=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],B=this._r[0],Y=this._r[1],P=this._r[2],J=this._r[3],ee=this._r[4],X=this._r[5],ne=this._r[6],V=this._r[7],H=this._r[8],z=this._r[9];n>=16;){var he=e[t+0]|e[t+1]<<8;s+=he&8191;var L=e[t+2]|e[t+3]<<8;f+=(he>>>13|L<<3)&8191;var h=e[t+4]|e[t+5]<<8;u+=(L>>>10|h<<6)&8191;var g=e[t+6]|e[t+7]<<8;d+=(h>>>7|g<<9)&8191;var b=e[t+8]|e[t+9]<<8;v+=(g>>>4|b<<12)&8191,x+=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*B,A+=f*(5*z),A+=u*(5*H),A+=d*(5*V),A+=v*(5*ne),S=A>>>13,A&=8191,A+=x*(5*X),A+=E*(5*ee),A+=O*(5*J),A+=R*(5*P),A+=I*(5*Y),S+=A>>>13,A&=8191;var y=S;y+=s*Y,y+=f*B,y+=u*(5*z),y+=d*(5*H),y+=v*(5*V),S=y>>>13,y&=8191,y+=x*(5*ne),y+=E*(5*X),y+=O*(5*ee),y+=R*(5*J),y+=I*(5*P),S+=y>>>13,y&=8191;var C=S;C+=s*P,C+=f*Y,C+=u*B,C+=d*(5*z),C+=v*(5*H),S=C>>>13,C&=8191,C+=x*(5*V),C+=E*(5*ne),C+=O*(5*X),C+=R*(5*ee),C+=I*(5*J),S+=C>>>13,C&=8191;var N=S;N+=s*J,N+=f*P,N+=u*Y,N+=d*B,N+=v*(5*z),S=N>>>13,N&=8191,N+=x*(5*H),N+=E*(5*V),N+=O*(5*ne),N+=R*(5*X),N+=I*(5*ee),S+=N>>>13,N&=8191;var w=S;w+=s*ee,w+=f*J,w+=u*P,w+=d*Y,w+=v*B,S=w>>>13,w&=8191,w+=x*(5*z),w+=E*(5*H),w+=O*(5*V),w+=R*(5*ne),w+=I*(5*X),S+=w>>>13,w&=8191;var k=S;k+=s*X,k+=f*ee,k+=u*J,k+=d*P,k+=v*Y,S=k>>>13,k&=8191,k+=x*B,k+=E*(5*z),k+=O*(5*H),k+=R*(5*V),k+=I*(5*ne),S+=k>>>13,k&=8191;var fe=S;fe+=s*ne,fe+=f*X,fe+=u*ee,fe+=d*J,fe+=v*P,S=fe>>>13,fe&=8191,fe+=x*Y,fe+=E*B,fe+=O*(5*z),fe+=R*(5*H),fe+=I*(5*V),S+=fe>>>13,fe&=8191;var D=S;D+=s*V,D+=f*ne,D+=u*X,D+=d*ee,D+=v*J,S=D>>>13,D&=8191,D+=x*P,D+=E*Y,D+=O*B,D+=R*(5*z),D+=I*(5*H),S+=D>>>13,D&=8191;var Q=S;Q+=s*H,Q+=f*V,Q+=u*ne,Q+=d*X,Q+=v*ee,S=Q>>>13,Q&=8191,Q+=x*J,Q+=E*P,Q+=O*Y,Q+=R*B,Q+=I*(5*z),S+=Q>>>13,Q&=8191;var se=S;se+=s*z,se+=f*H,se+=u*V,se+=d*ne,se+=v*X,S=se>>>13,se&=8191,se+=x*ee,se+=E*J,se+=O*P,se+=R*Y,se+=I*B,S+=se>>>13,se&=8191,S=(S<<2)+S|0,S=S+A|0,A=S&8191,S=S>>>13,y+=S,s=A,f=y,u=C,d=N,v=w,x=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]=v,this._h[5]=x,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 Pd.wipe(this._buffer),Pd.wipe(this._r),Pd.wipe(this._h),Pd.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();as.Poly1305=aw;function PP(r,e){var t=new aw(r);t.update(e);var n=t.digest();return t.clean(),n}o(PP,"oneTimeAuth");as.oneTimeAuth=PP;function BP(r,e){return r.length!==as.DIGEST_LENGTH||e.length!==as.DIGEST_LENGTH?!1:NP.equal(r,e)}o(BP,"equal");as.equal=BP});var lw=Re(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var Bd=tb(),LP=fw(),Yu=xi(),cw=$a(),UP=rb();fs.KEY_LENGTH=32;fs.NONCE_LENGTH=12;fs.TAG_LENGTH=16;var uw=new Uint8Array(16),FP=function(){function r(e){if(this.nonceLength=fs.NONCE_LENGTH,this.tagLength=fs.TAG_LENGTH,e.length!==fs.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);Bd.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 Bd.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),Yu.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);Bd.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),!UP.equal(u,t.subarray(t.length-this.tagLength,t.length)))return null;var d=t.length-this.tagLength,v;if(i){if(i.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");v=i}else v=new Uint8Array(d);return Bd.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),v,4),Yu.wipe(s),v},r.prototype.clean=function(){return Yu.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new LP.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(uw.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(uw.subarray(n.length%16));var f=new Uint8Array(8);i&&cw.writeUint64LE(i.length,f),s.update(f),cw.writeUint64LE(n.length,f),s.update(f);for(var u=s.digest(),d=0;d<u.length;d++)e[d]=u[d];s.clean(),Yu.wipe(u),Yu.wipe(f)},r}();fs.ChaCha20Poly1305=FP});var pw=Re(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var hw=ow(),dw=lw(),Xu=xi();cs.KEY_LENGTH=32;cs.NONCE_LENGTH=24;cs.TAG_LENGTH=16;var $P=function(){function r(e){if(this.nonceLength=cs.NONCE_LENGTH,this.tagLength=cs.TAG_LENGTH,e.length!==cs.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=hw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new dw.ChaCha20Poly1305(s),d=u.seal(f,t,n,i);return Xu.wipe(s),Xu.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=hw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new dw.ChaCha20Poly1305(s),d=u.open(f,t,n,i);return Xu.wipe(s),Xu.wipe(f),u.clean(),d},r.prototype.clean=function(){return Xu.wipe(this._key),this},r}();cs.XChaCha20Poly1305=$P});var o5=Re(e0=>{"use strict";e0.byteLength=aL;e0.toByteArray=cL;e0.fromByteArray=hL;var So=[],Ti=[],sL=typeof Uint8Array<"u"?Uint8Array:Array,Cb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(nf=0,n5=Cb.length;nf<n5;++nf)So[nf]=Cb[nf],Ti[Cb.charCodeAt(nf)]=nf;var nf,n5;Ti["-".charCodeAt(0)]=62;Ti["_".charCodeAt(0)]=63;function i5(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(i5,"getLens");function aL(r){var e=i5(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(aL,"byteLength");function fL(r,e,t){return(e+t)*3/4-t}o(fL,"_byteLength");function cL(r){var e,t=i5(r),n=t[0],i=t[1],s=new sL(fL(r,n,i)),f=0,u=i>0?n-4:n,d;for(d=0;d<u;d+=4)e=Ti[r.charCodeAt(d)]<<18|Ti[r.charCodeAt(d+1)]<<12|Ti[r.charCodeAt(d+2)]<<6|Ti[r.charCodeAt(d+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return i===2&&(e=Ti[r.charCodeAt(d)]<<2|Ti[r.charCodeAt(d+1)]>>4,s[f++]=e&255),i===1&&(e=Ti[r.charCodeAt(d)]<<10|Ti[r.charCodeAt(d+1)]<<4|Ti[r.charCodeAt(d+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}o(cL,"toByteArray");function uL(r){return So[r>>18&63]+So[r>>12&63]+So[r>>6&63]+So[r&63]}o(uL,"tripletToBase64");function lL(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(uL(n));return i.join("")}o(lL,"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(lL(r,f,f+s>u?u:f+s));return n===1?(e=r[t-1],i.push(So[e>>2]+So[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(So[e>>10]+So[e>>4&63]+So[e<<2&63]+"=")),i.join("")}o(hL,"fromByteArray")});var s5=Re(kb=>{kb.read=function(r,e,t,n,i){var s,f,u=i*8-n-1,d=(1<<u)-1,v=d>>1,x=-7,E=t?i-1:0,O=t?-1:1,R=r[e+E];for(E+=O,s=R&(1<<-x)-1,R>>=-x,x+=u;x>0;s=s*256+r[e+E],E+=O,x-=8);for(f=s&(1<<-x)-1,s>>=-x,x+=n;x>0;f=f*256+r[e+E],E+=O,x-=8);if(s===0)s=1-v;else{if(s===d)return f?NaN:(R?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-v}return(R?-1:1)*f*Math.pow(2,s-n)};kb.write=function(r,e,t,n,i,s){var f,u,d,v=s*8-i-1,x=(1<<v)-1,E=x>>1,O=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:s-1,I=n?1:-1,B=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=x):(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>=x?(u=0,f=x):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,v+=i;v>0;r[t+R]=f&255,R+=I,f/=256,v-=8);r[t+R-I]|=B*128}});var n0=Re(Cc=>{"use strict";var Ib=o5(),Tc=s5(),a5=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Cc.Buffer=Se;Cc.SlowBuffer=vL;Cc.INSPECT_MAX_BYTES=50;var t0=2147483647;Cc.kMaxLength=t0;Se.TYPED_ARRAY_SUPPORT=dL();!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 dL(){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(dL,"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 ls(r){if(r>t0)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Se.prototype),e}o(ls,"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 Nb(r)}return u5(r,e,t)}o(Se,"Buffer");Se.poolSize=8192;function u5(r,e,t){if(typeof r=="string")return mL(r,e);if(ArrayBuffer.isView(r))return bL(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(Mo(r,ArrayBuffer)||r&&Mo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mo(r,SharedArrayBuffer)||r&&Mo(r.buffer,SharedArrayBuffer)))return Rb(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=gL(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(u5,"from");Se.from=function(r,e,t){return u5(r,e,t)};Object.setPrototypeOf(Se.prototype,Uint8Array.prototype);Object.setPrototypeOf(Se,Uint8Array);function l5(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(l5,"assertSize");function pL(r,e,t){return l5(r),r<=0?ls(r):e!==void 0?typeof t=="string"?ls(r).fill(e,t):ls(r).fill(e):ls(r)}o(pL,"alloc");Se.alloc=function(r,e,t){return pL(r,e,t)};function Nb(r){return l5(r),ls(r<0?0:Pb(r)|0)}o(Nb,"allocUnsafe");Se.allocUnsafe=function(r){return Nb(r)};Se.allocUnsafeSlow=function(r){return Nb(r)};function mL(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Se.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=h5(r,e)|0,n=ls(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(mL,"fromString");function Db(r){for(var e=r.length<0?0:Pb(r.length)|0,t=ls(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}o(Db,"fromArrayLike");function bL(r){if(Mo(r,Uint8Array)){var e=new Uint8Array(r);return Rb(e.buffer,e.byteOffset,e.byteLength)}return Db(r)}o(bL,"fromArrayView");function Rb(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(Rb,"fromArrayBuffer");function gL(r){if(Se.isBuffer(r)){var e=Pb(r.length)|0,t=ls(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Bb(r.length)?ls(0):Db(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Db(r.data)}o(gL,"fromObject");function Pb(r){if(r>=t0)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t0.toString(16)+" bytes");return r|0}o(Pb,"checked");function vL(r){return+r!=r&&(r=0),Se.alloc(+r)}o(vL,"SlowBuffer");Se.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==Se.prototype},"isBuffer");Se.compare=o(function(e,t){if(Mo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),Mo(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(Mo(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 h5(r,e){if(Se.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Mo(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 Ob(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return v5(r).length;default:if(i)return n?-1:Ob(r).length;e=(""+e).toLowerCase(),i=!0}}o(h5,"byteLength");Se.byteLength=h5;function yL(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 kL(this,e,t);case"utf8":case"utf-8":return p5(this,e,t);case"ascii":return TL(this,e,t);case"latin1":case"binary":return CL(this,e,t);case"base64":return SL(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IL(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o(yL,"slowToString");Se.prototype._isBuffer=!0;function of(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}o(of,"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)of(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)of(this,t,t+3),of(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)of(this,t,t+7),of(this,t+1,t+6),of(this,t+2,t+5),of(this,t+3,t+4);return this},"swap64");Se.prototype.toString=o(function(){var e=this.length;return e===0?"":arguments.length===0?p5(this,0,e):yL.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=Cc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");a5&&(Se.prototype[a5]=Se.prototype.inspect);Se.prototype.compare=o(function(e,t,n,i,s){if(Mo(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),v=this.slice(i,s),x=e.slice(t,n),E=0;E<d;++E)if(v[E]!==x[E]){f=v[E],u=x[E];break}return f<u?-1:u<f?1:0},"compare");function d5(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,Bb(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:f5(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):f5(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(d5,"bidirectionalIndexOf");function f5(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 v;if(i){var x=-1;for(v=t;v<f;v++)if(d(r,v)===d(e,x===-1?0:v-x)){if(x===-1&&(x=v),v-x+1===u)return x*s}else x!==-1&&(v-=v-x),x=-1}else for(t+u>f&&(t=f-u),v=t;v>=0;v--){for(var E=!0,O=0;O<u;O++)if(d(r,v+O)!==d(e,O)){E=!1;break}if(E)return v}return-1}o(f5,"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 d5(this,e,t,n,!0)},"indexOf");Se.prototype.lastIndexOf=o(function(e,t,n){return d5(this,e,t,n,!1)},"lastIndexOf");function xL(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(Bb(u))return f;r[t+f]=u}return f}o(xL,"hexWrite");function wL(r,e,t,n){return r0(Ob(e,r.length-t),r,t,n)}o(wL,"utf8Write");function _L(r,e,t,n){return r0(OL(e),r,t,n)}o(_L,"asciiWrite");function EL(r,e,t,n){return r0(v5(e),r,t,n)}o(EL,"base64Write");function AL(r,e,t,n){return r0(NL(e,r.length-t),r,t,n)}o(AL,"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 xL(this,e,t,n);case"utf8":case"utf-8":return wL(this,e,t,n);case"ascii":case"latin1":case"binary":return _L(this,e,t,n);case"base64":return EL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return AL(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 SL(r,e,t){return e===0&&t===r.length?Ib.fromByteArray(r):Ib.fromByteArray(r.slice(e,t))}o(SL,"base64Slice");function p5(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,v,x,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],v=r[i+2],(d&192)===128&&(v&192)===128&&(E=(s&15)<<12|(d&63)<<6|v&63,E>2047&&(E<55296||E>57343)&&(f=E));break;case 4:d=r[i+1],v=r[i+2],x=r[i+3],(d&192)===128&&(v&192)===128&&(x&192)===128&&(E=(s&15)<<18|(d&63)<<12|(v&63)<<6|x&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 ML(n)}o(p5,"utf8Slice");var c5=4096;function ML(r){var e=r.length;if(e<=c5)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=c5));return t}o(ML,"decodeCodePointsArray");function TL(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(TL,"asciiSlice");function CL(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(CL,"latin1Slice");function kL(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+=PL[r[s]];return i}o(kL,"hexSlice");function IL(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(IL,"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 Nr(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(Nr,"checkOffset");Se.prototype.readUintLE=Se.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(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||Nr(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||Nr(e,1,this.length),this[e]},"readUInt8");Se.prototype.readUint16LE=Se.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(e,4,this.length),Tc.read(this,e,!0,23,4)},"readFloatLE");Se.prototype.readFloatBE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),Tc.read(this,e,!1,23,4)},"readFloatBE");Se.prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Tc.read(this,e,!0,52,8)},"readDoubleLE");Se.prototype.readDoubleBE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Tc.read(this,e,!1,52,8)},"readDoubleBE");function Tn(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(Tn,"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;Tn(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;Tn(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||Tn(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||Tn(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||Tn(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||Tn(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||Tn(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);Tn(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);Tn(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||Tn(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||Tn(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||Tn(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||Tn(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||Tn(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 m5(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(m5,"checkIEEE754");function b5(r,e,t,n,i){return e=+e,t=t>>>0,i||m5(r,e,t,4,34028234663852886e22,-34028234663852886e22),Tc.write(r,e,t,n,23,4),t+4}o(b5,"writeFloat");Se.prototype.writeFloatLE=o(function(e,t,n){return b5(this,e,t,!0,n)},"writeFloatLE");Se.prototype.writeFloatBE=o(function(e,t,n){return b5(this,e,t,!1,n)},"writeFloatBE");function g5(r,e,t,n,i){return e=+e,t=t>>>0,i||m5(r,e,t,8,17976931348623157e292,-17976931348623157e292),Tc.write(r,e,t,n,52,8),t+8}o(g5,"writeDouble");Se.prototype.writeDoubleLE=o(function(e,t,n){return g5(this,e,t,!0,n)},"writeDoubleLE");Se.prototype.writeDoubleBE=o(function(e,t,n){return g5(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 DL=/[^+/0-9A-Za-z-_]/g;function RL(r){if(r=r.split("=")[0],r=r.trim().replace(DL,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}o(RL,"base64clean");function Ob(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(Ob,"utf8ToBytes");function OL(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}o(OL,"asciiToBytes");function NL(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(NL,"utf16leToBytes");function v5(r){return Ib.toByteArray(RL(r))}o(v5,"base64ToBytes");function r0(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(r0,"blitBuffer");function Mo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}o(Mo,"isInstance");function Bb(r){return r!==r}o(Bb,"numberIsNaN");var PL=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 Xi=Re((VW,y5)=>{y5.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 al=Re((GW,x5)=>{x5.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 _5=Re(Pr=>{var{Buffer:Mr}=n0(),i0=4294967292,o0=4294967293,Lb=4294967294,w5=4294967295,Ue=[0,1,3,7,15,31,63,127,255,511,1023],Zs=["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"],BL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Jn=[];BL.forEach(r=>{Jn.push(r.charCodeAt(0))});Pr.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}`)}),Mr.from(e)},decode(r,e){function t(I,B){if((B&192)!==128)return o0;let Y=((I&Ue[5])<<6)+(B&Ue[6]);return Y<128?i0:Y}o(t,"bytes2");function n(I,B,Y){if((Y&192)!==128||(B&192)!==128)return o0;let P=((I&Ue[4])<<12)+((B&Ue[6])<<6)+(Y&Ue[6]);return P<2048?i0:P>=55296&&P<=57343?Lb:P}o(n,"bytes3");function i(I,B,Y,P){if((P&192)!==128||(Y&192)!==128||(B&192)!==128)return o0;let J=(((I&Ue[3])<<2)+(B>>4&Ue[2])<<16)+((B&Ue[4])<<12)+((Y&Ue[6])<<6)+(P&Ue[6]);return J<65536?i0:J>1114111?Lb:J}o(i,"bytes4");let s,f,u,d,v,x,E=r.length,O=e?3:0,R=[];for(;O<E;){f=r[O],s=w5;let I=!0;for(;I;){if(f>=0&&f<=127){s=f,x=1;break}if(u=O+1,u<E&&f>=194&&f<=223){s=t(f,r[u]),x=2;break}if(d=O+2,d<E&&f>=224&&f<=239){s=n(f,r[u],r[d]),x=3;break}if(v=O+3,v<E&&f>=240&&f<=244){s=i(f,r[u],r[d],r[v]),x=4;break}break}if(s>1114111){let B=`byte[${O}]`;throw s===w5?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${B}`):s===o0?new RangeError(`utf8.decode: illegal trailing byte found at: ${B}`):s===Lb?new RangeError(`utf8.decode: code point out of range found at: ${B}`):s===i0?new RangeError(`utf8.decode: non-shortest form found at: ${B}`):new RangeError(`utf8.decode: unrecognized error found at: ${B}`)}R.push(s),O+=x}return R}};Pr.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 Mr.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,v,x,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(x=(r[i]<<8)+r[d],x<55296||x>57343){f=x,u=2;break}if(v=i+3,v<n&&(E=(r[i+2]<<8)+r[v],x<=56319&&E>=56320&&E<=57343)){f=65536+(x-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}};Pr.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 Mr.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,v,x,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(x=(r[d]<<8)+r[i],x<55296||x>57343){f=x,u=2;break}if(v=i+3,v<n&&(E=(r[v]<<8)+r[i+2],x<=56319&&E>=56320&&E<=57343)){f=65536+(x-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}};Pr.utf32be={encode(r){let e=Mr.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}};Pr.utf32le={encode(r){let e=Mr.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}};Pr.uint7={encode(r){let e=Mr.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}};Pr.uint8={encode(r){let e=Mr.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}};Pr.uint16be={encode(r){let e=Mr.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}};Pr.uint16le={encode(r){let e=Mr.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}};Pr.uint32be={encode(r){let e=Mr.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}};Pr.uint32le={encode(r){let e=Mr.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}};Pr.string={encode(r){return Pr.utf16le.encode(r).toString("utf16le")},decode(r){return Pr.utf16le.decode(Mr.from(r,"utf16le"),0)}};Pr.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${Zs[n]}`;else if(n>=127&&n<=255)i+=`\`x${Zs[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Zs[n>>8&Ue[8]]}${Zs[n&Ue[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let f=n>>24&Ue[8];f>0&&(i+=Zs[f]),i+=`${Zs[n>>16&Ue[8]]+Zs[n>>8&Ue[8]]+Zs[n&Ue[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Mr.from(i).forEach(f=>{e.push(f)})}}return Mr.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 B=String.fromCodePoint(R[E],R[E+1]);I.char=parseInt(B,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 B=String.fromCodePoint(R[E],R[E+1],R[E+2],R[E+3]);I.char=parseInt(B,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},B="";for(;E<O&&e(R[E]);)B+=String.fromCodePoint(R[E]),E+=1;return I.char=parseInt(B,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,v,x=0;for(;x<f;){for(;;){if(v=!0,r[x]!==96){s.push(r[x]),x+=1,v=!1;break}if(u=x+1,u>=f)break;if(r[u]===96){s.push(96),x+=2,v=!1;break}if(r[u]===120){if(d=t(u+1,f,r),d.error)break;s.push(d.char),x=d.nexti,v=!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),x=d.nexti,v=!1;break}if(d=n(u+1,f,r),d.error)break;s.push(d.char),x=d.nexti,v=!1;break}break}if(v)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${x}]`)}return s}};var fl=13,Ci=10;Pr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case fl:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(fl),e.push(Ci);break;case Ci:e.push(fl),e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&(e.push(fl),e.push(Ci)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case fl:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(Ci);break;case Ci:e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&e.push(Ci),e}};Pr.base64={encode(r){if(r.length===0)return Mr.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,f=Mr.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(x){let E=[],O=0;for(let R=0;R<x.length;R+=1){let I=x[R],B=!0;for(;B&&!(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:Mr.from(E)}}if(o(e,"validate"),r.length===0)return Mr.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,f,u,d=i.length/4,v=Mr.alloc(d*3-n);n>0&&(d-=1),f=0,s=0;for(let x=0;x<d;x+=1)u=i[s++]<<18,u+=i[s++]<<12,u+=i[s++]<<6,u+=i[s++],v[f++]=u>>16&Ue[8],v[f++]=u>>8&Ue[8],v[f++]=u&Ue[8];return n===1&&(u=i[s++]<<18,u+=i[s++]<<12,u+=i[s]<<6,v[f++]=u>>16&Ue[8],v[f]=u>>8&Ue[8]),n===2&&(u=i[s++]<<18,u+=i[s++]<<12,v[f]=u>>16&Ue[8]),v},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 a1=Vt(()=>{Hi();Zh();Bs();n1();Fa()});var Uu,iV,f1=Vt(()=>{_3();E3();A3();S3();M3();Ym();ec();Jh();Yh();C3();Bu();s1();U3();F3();a1();Uu={...jm,...Km,...Vm,...Gm,...Wm,...Jm,...Xm,...Zm,...Qm,...e1},iV={...i1,...o1}});function z3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var H3,c1,TR,id,u1=Vt(()=>{f1();jh();o(z3,"createCodec");H3=z3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),c1=z3("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=Ru(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),TR={utf8:H3,"utf-8":H3,hex:Uu.base16,latin1:c1,ascii:c1,binary:c1,...Uu},id=TR});var j3={};Xt(j3,{fromString:()=>Ft});function Ft(r,e="utf8"){let t=id[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ba(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var od=Vt(()=>{u1();Du();o(Ft,"fromString")});var K3={};Xt(K3,{toString:()=>Dt});function Dt(r,e="utf8"){let t=id[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 nc=Vt(()=>{u1();o(Dt,"toString")});var V3=Re(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});function CR(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(CR,"imulShim");zn.mul=Math.imul||CR;function kR(r,e){return r+e|0}o(kR,"add");zn.add=kR;function IR(r,e){return r-e|0}o(IR,"sub");zn.sub=IR;function DR(r,e){return r<<e|r>>>32-e}o(DR,"rotl");zn.rotl=DR;function RR(r,e){return r<<32-e|r>>>e}o(RR,"rotr");zn.rotr=RR;function OR(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(OR,"isIntegerShim");zn.isInteger=Number.isInteger||OR;zn.MAX_SAFE_INTEGER=9007199254740991;zn.isSafeInteger=function(r){return zn.isInteger(r)&&r>=-zn.MAX_SAFE_INTEGER&&r<=zn.MAX_SAFE_INTEGER}});var $a=Re(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});var G3=V3();function NR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(NR,"readInt16BE");kt.readInt16BE=NR;function PR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(PR,"readUint16BE");kt.readUint16BE=PR;function BR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(BR,"readInt16LE");kt.readInt16LE=BR;function LR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(LR,"readUint16LE");kt.readUint16LE=LR;function W3(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(W3,"writeUint16BE");kt.writeUint16BE=W3;kt.writeInt16BE=W3;function J3(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(J3,"writeUint16LE");kt.writeUint16LE=J3;kt.writeInt16LE=J3;function l1(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(l1,"readInt32BE");kt.readInt32BE=l1;function h1(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(h1,"readUint32BE");kt.readUint32BE=h1;function d1(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(d1,"readInt32LE");kt.readInt32LE=d1;function p1(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(p1,"readUint32LE");kt.readUint32LE=p1;function sd(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(sd,"writeUint32BE");kt.writeUint32BE=sd;kt.writeInt32BE=sd;function ad(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(ad,"writeUint32LE");kt.writeUint32LE=ad;kt.writeInt32LE=ad;function UR(r,e){e===void 0&&(e=0);var t=l1(r,e),n=l1(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(UR,"readInt64BE");kt.readInt64BE=UR;function FR(r,e){e===void 0&&(e=0);var t=h1(r,e),n=h1(r,e+4);return t*4294967296+n}o(FR,"readUint64BE");kt.readUint64BE=FR;function $R(r,e){e===void 0&&(e=0);var t=d1(r,e),n=d1(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o($R,"readInt64LE");kt.readInt64LE=$R;function qR(r,e){e===void 0&&(e=0);var t=p1(r,e),n=p1(r,e+4);return n*4294967296+t}o(qR,"readUint64LE");kt.readUint64LE=qR;function Y3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),sd(r/4294967296>>>0,e,t),sd(r>>>0,e,t+4),e}o(Y3,"writeUint64BE");kt.writeUint64BE=Y3;kt.writeInt64BE=Y3;function X3(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ad(r>>>0,e,t),ad(r/4294967296>>>0,e,t+4),e}o(X3,"writeUint64LE");kt.writeUint64LE=X3;kt.writeInt64LE=X3;function HR(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(HR,"readUintBE");kt.readUintBE=HR;function zR(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(zR,"readUintLE");kt.readUintLE=zR;function jR(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(!G3.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(jR,"writeUintBE");kt.writeUintBE=jR;function KR(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(!G3.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(KR,"writeUintLE");kt.writeUintLE=KR;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");kt.readFloat32BE=VR;function GR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(GR,"readFloat32LE");kt.readFloat32LE=GR;function WR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(WR,"readFloat64BE");kt.readFloat64BE=WR;function JR(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(JR,"readFloat64LE");kt.readFloat64LE=JR;function YR(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(YR,"writeFloat32BE");kt.writeFloat32BE=YR;function XR(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(XR,"writeFloat32LE");kt.writeFloat32LE=XR;function ZR(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(ZR,"writeFloat64BE");kt.writeFloat64BE=ZR;function QR(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(QR,"writeFloat64LE");kt.writeFloat64LE=QR});var xi=Re(m1=>{"use strict";Object.defineProperty(m1,"__esModule",{value:!0});function eO(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(eO,"wipe");m1.wipe=eO});var Q3=Re(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var cd=$a(),fd=xi();Fs.DIGEST_LENGTH=32;Fs.BLOCK_SIZE=64;var Z3=function(){function r(){this.digestLength=Fs.DIGEST_LENGTH,this.blockSize=Fs.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(){fd.wipe(this._buffer),fd.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&&(b1(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=b1(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;cd.writeUint32BE(i,this._buffer,f-8),cd.writeUint32BE(s,this._buffer,f-4),b1(this._temp,this._state,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)cd.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){fd.wipe(e.state),e.buffer&&fd.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Fs.SHA256=Z3;var tO=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 b1(r,e,t,n,i){for(;i>=64;){for(var s=e[0],f=e[1],u=e[2],d=e[3],v=e[4],x=e[5],E=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;r[R]=cd.readUint32BE(t,I)}for(var R=16;R<64;R++){var B=r[R-2],Y=(B>>>17|B<<32-17)^(B>>>19|B<<32-19)^B>>>10;B=r[R-15];var P=(B>>>7|B<<32-7)^(B>>>18|B<<32-18)^B>>>3;r[R]=(Y+r[R-7]|0)+(P+r[R-16]|0)}for(var R=0;R<64;R++){var Y=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&x^~v&E)|0)+(O+(tO[R]+r[R]|0)|0)|0,P=((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=x,x=v,v=d+Y|0,d=u,u=f,f=s,s=Y+P|0}e[0]+=s,e[1]+=f,e[2]+=u,e[3]+=d,e[4]+=v,e[5]+=x,e[6]+=E,e[7]+=O,n+=64,i-=64}return n}o(b1,"hashBlocks");function rO(r){var e=new Z3;e.update(r);var t=e.digest();return e.clean(),t}o(rO,"hash");Fs.hash=rO});var g1=Re((CV,ud)=>{(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 ud=="object"&&ud.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),x=[31,7936,2031616,520093696],E=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],B=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Y=[224,256,384,512],P=[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 X=o(function(D,Q,se){return function(q){return new w(D,Q,D).update(q)[se]()}},"createOutputMethod"),ne=o(function(D,Q,se){return function(q,j){return new w(D,Q,j).update(q)[se]()}},"createShakeOutputMethod"),V=o(function(D,Q,se){return function(q,j,G,te){return l["cshake"+D].update(q,j,G,te)[se]()}},"createCshakeOutputMethod"),H=o(function(D,Q,se){return function(q,j,G,te){return l["kmac"+D].update(q,j,G,te)[se]()}},"createKmacOutputMethod"),z=o(function(D,Q,se,q){for(var j=0;j<J.length;++j){var G=J[j];D[G]=Q(se,q,G)}return D},"createOutputMethods"),he=o(function(D,Q){var se=X(D,Q,"hex");return se.create=function(){return new w(D,Q,D)},se.update=function(q){return se.create().update(q)},z(se,X,D,Q)},"createMethod"),L=o(function(D,Q){var se=ne(D,Q,"hex");return se.create=function(q){return new w(D,Q,q)},se.update=function(q,j){return se.create(j).update(q)},z(se,ne,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=ee[D],q=V(D,Q,"hex");return q.create=function(j,G,te){return!G&&!te?l["shake"+D].create(j):new w(D,Q,j).bytepad([G,te],se)},q.update=function(j,G,te,ae){return q.create(G,te,ae).update(j)},z(q,V,D,Q)},"createCshakeMethod"),g=o(function(D,Q){var se=ee[D],q=H(D,Q,"hex");return q.create=function(j,G,te){return new k(D,Q,G).bytepad(["KMAC",te],se).bytepad([j],se)},q.update=function(j,G,te,ae){return q.create(j,te,ae).update(G)},z(q,H,D,Q)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:Y,createMethod:he},{name:"sha3",padding:R,bits:Y,createMethod:he},{name:"shake",padding:x,bits:P,createMethod:L},{name:"cshake",padding:E,bits:P,createMethod:h},{name:"kmac",padding:E,bits:P,createMethod:g}],l={},m=[],_=0;_<b.length;++_)for(var M=b[_],S=M.bits,y=0;y<S.length;++y){var C=M.name+"_"+S[y];if(m.push(C),l[C]=M.createMethod(S[y],M.padding),M.name!=="sha3"){var N=M.name+S[y];m.push(N),l[N]=l[C]}}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 q=0;q<50;++q)this.s[q]=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 q=this.blocks,j=this.byteCount,G=D.length,te=this.blockCount,ae=0,Ae=this.s,ge,ie;ae<G;){if(this.reset)for(this.reset=!1,q[0]=this.block,ge=1;ge<te+1;++ge)q[ge]=0;if(Q)for(ge=this.start;ae<G&&ge<j;++ae)q[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<G&&ge<j;++ae)ie=D.charCodeAt(ae),ie<128?q[ge>>2]|=ie<<I[ge++&3]:ie<2048?(q[ge>>2]|=(192|ie>>6)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):ie<55296||ie>=57344?(q[ge>>2]|=(224|ie>>12)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):(ie=65536+((ie&1023)<<10|D.charCodeAt(++ae)&1023),q[ge>>2]|=(240|ie>>18)<<I[ge++&3],q[ge>>2]|=(128|ie>>12&63)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=j){for(this.start=ge-j,this.block=q[te],ge=0;ge<te;++ge)Ae[ge]^=q[ge];fe(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(D,Q){var se=D&255,q=1,j=[se];for(D=D>>8,se=D&255;se>0;)j.unshift(se),D=D>>8,se=D&255,++q;return Q?j.push(q):j.unshift(q),this.update(j),j.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 q=0,j=D.length;if(Q)q=j;else for(var G=0;G<D.length;++G){var te=D.charCodeAt(G);te<128?q+=1:te<2048?q+=2:te<55296||te>=57344?q+=3:(te=65536+((te&1023)<<10|D.charCodeAt(++G)&1023),q+=4)}return q+=this.encode(q*8),this.update(D),q},w.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),q=0;q<D.length;++q)se+=this.encodeString(D[q]);var j=Q-se%Q,G=[];return G.length=j,this.update(G),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,q=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)q[Q]^=D[Q];fe(q)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,j=0,G=0,te="",ae;G<se;){for(j=0;j<D&&G<se;++j,++G)ae=Q[j],te+=v[ae>>4&15]+v[ae&15]+v[ae>>12&15]+v[ae>>8&15]+v[ae>>20&15]+v[ae>>16&15]+v[ae>>28&15]+v[ae>>24&15];G%D===0&&(fe(Q),j=0)}return q&&(ae=Q[j],te+=v[ae>>4&15]+v[ae&15],q>1&&(te+=v[ae>>12&15]+v[ae>>8&15]),q>2&&(te+=v[ae>>20&15]+v[ae>>16&15])),te},w.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,j=0,G=0,te=this.outputBits>>3,ae;q?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(te);for(var Ae=new Uint32Array(ae);G<se;){for(j=0;j<D&&G<se;++j,++G)Ae[G]=Q[j];G%D===0&&fe(Q)}return q&&(Ae[j]=Q[j],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,q=this.extraBytes,j=0,G=0,te=[],ae,Ae;G<se;){for(j=0;j<D&&G<se;++j,++G)ae=G<<2,Ae=Q[j],te[ae]=Ae&255,te[ae+1]=Ae>>8&255,te[ae+2]=Ae>>16&255,te[ae+3]=Ae>>24&255;G%D===0&&fe(Q)}return q&&(ae=G<<2,Ae=Q[j],te[ae]=Ae&255,q>1&&(te[ae+1]=Ae>>8&255),q>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,q,j,G,te,ae,Ae,ge,ie,Me,ue,ve,W,pe,ke,je,Pe,Je,gr,le,oe,F,Z,me,ye,we,Ie,Rt,Fe,Ne,Lt,Ve,Xe,Pn,st,at,ii,ft,rt,oi,ct,ut,pn,lt,Qe,si,ht,dt,ai,pt,mt,fi,bt,nt,Bn,qt,Ht,mn,bn,gn,Fr,vn;for(q=0;q<48;q+=2)j=D[0]^D[10]^D[20]^D[30]^D[40],G=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],ie=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=j^(Ae<<1|ge>>>31),se=G^(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^(ie<<1|Me>>>31),se=ae^(Me<<1|ie>>>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=ie^(j<<1|G>>>31),se=Me^(G<<1|j>>>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],Qe=D[11]<<4|D[10]>>>28,si=D[10]<<4|D[11]>>>28,Ie=D[20]<<3|D[21]>>>29,Rt=D[21]<<3|D[20]>>>29,bn=D[31]<<9|D[30]>>>23,gn=D[30]<<9|D[31]>>>23,ct=D[40]<<18|D[41]>>>14,ut=D[41]<<18|D[40]>>>14,Xe=D[2]<<1|D[3]>>>31,Pn=D[3]<<1|D[2]>>>31,ke=D[13]<<12|D[12]>>>20,je=D[12]<<12|D[13]>>>20,ht=D[22]<<10|D[23]>>>22,dt=D[23]<<10|D[22]>>>22,Fe=D[33]<<13|D[32]>>>19,Ne=D[32]<<13|D[33]>>>19,Fr=D[42]<<2|D[43]>>>30,vn=D[43]<<2|D[42]>>>30,bt=D[5]<<30|D[4]>>>2,nt=D[4]<<30|D[5]>>>2,st=D[14]<<6|D[15]>>>26,at=D[15]<<6|D[14]>>>26,Pe=D[25]<<11|D[24]>>>21,Je=D[24]<<11|D[25]>>>21,ai=D[34]<<15|D[35]>>>17,pt=D[35]<<15|D[34]>>>17,Lt=D[45]<<29|D[44]>>>3,Ve=D[44]<<29|D[45]>>>3,Z=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Bn=D[17]<<23|D[16]>>>9,qt=D[16]<<23|D[17]>>>9,ii=D[26]<<25|D[27]>>>7,ft=D[27]<<25|D[26]>>>7,gr=D[36]<<21|D[37]>>>11,le=D[37]<<21|D[36]>>>11,mt=D[47]<<24|D[46]>>>8,fi=D[46]<<24|D[47]>>>8,pn=D[8]<<27|D[9]>>>5,lt=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,mn=D[28]<<7|D[29]>>>25,rt=D[38]<<8|D[39]>>>24,oi=D[39]<<8|D[38]>>>24,oe=D[48]<<14|D[49]>>>18,F=D[49]<<14|D[48]>>>18,D[0]=W^~ke&Pe,D[1]=pe^~je&Je,D[10]=Z^~ye&Ie,D[11]=me^~we&Rt,D[20]=Xe^~st&ii,D[21]=Pn^~at&ft,D[30]=pn^~Qe&ht,D[31]=lt^~si&dt,D[40]=bt^~Bn&Ht,D[41]=nt^~qt&mn,D[2]=ke^~Pe&gr,D[3]=je^~Je&le,D[12]=ye^~Ie&Fe,D[13]=we^~Rt&Ne,D[22]=st^~ii&rt,D[23]=at^~ft&oi,D[32]=Qe^~ht&ai,D[33]=si^~dt&pt,D[42]=Bn^~Ht&bn,D[43]=qt^~mn&gn,D[4]=Pe^~gr&oe,D[5]=Je^~le&F,D[14]=Ie^~Fe&Lt,D[15]=Rt^~Ne&Ve,D[24]=ii^~rt&ct,D[25]=ft^~oi&ut,D[34]=ht^~ai&mt,D[35]=dt^~pt&fi,D[44]=Ht^~bn&Fr,D[45]=mn^~gn&vn,D[6]=gr^~oe&W,D[7]=le^~F&pe,D[16]=Fe^~Lt&Z,D[17]=Ne^~Ve&me,D[26]=rt^~ct&Xe,D[27]=oi^~ut&Pn,D[36]=ai^~mt&pn,D[37]=pt^~fi&lt,D[46]=bn^~Fr&bt,D[47]=gn^~vn&nt,D[8]=oe^~W&ke,D[9]=F^~pe&je,D[18]=Lt^~Z&ye,D[19]=Ve^~me&we,D[28]=ct^~Xe&st,D[29]=ut^~Pn&at,D[38]=mt^~pn&Qe,D[39]=fi^~lt&si,D[48]=Fr^~bt&Bn,D[49]=vn^~nt&qt,D[0]^=B[q],D[1]^=B[q+1]},"f");if(f)ud.exports=l;else{for(_=0;_<m.length;++_)n[m[_]]=l[m[_]];u&&define(function(){return l})}})()});var ex=Re((kV,nO)=>{nO.exports={name:"elliptic",version:"6.6.1",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 v1=Re(()=>{});var mo=Re((tx,y1)=>{(function(r,e){"use strict";function t(L,h){if(!L)throw new Error(h||"Assertion failed")}o(t,"assert");function n(L,h){L.super_=h;var g=o(function(){},"TempCtor");g.prototype=h.prototype,L.prototype=new g,L.prototype.constructor=L}o(n,"inherits");function i(L,h,g){if(i.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((h==="le"||h==="be")&&(g=h,h=10),this._init(L||0,h||10,g||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=v1().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,g){return h.cmp(g)>0?h:g},"max"),i.min=o(function(h,g){return h.cmp(g)<0?h:g},"min"),i.prototype._init=o(function(h,g,b){if(typeof h=="number")return this._initNumber(h,g,b);if(typeof h=="object")return this._initArray(h,g,b);g==="hex"&&(g=16),t(g===(g|0)&&g>=2&&g<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(g===16?this._parseHex(h,l,b):(this._parseBase(h,g,l),b==="le"&&this._initArray(this.toArray(),g,b)))},"init"),i.prototype._initNumber=o(function(h,g,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(),g,b)},"_initNumber"),i.prototype._initArray=o(function(h,g,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,_,M=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]|=_<<M&67108863,this.words[m+1]=_>>>26-M&67108863,M+=24,M>=26&&(M-=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]|=_<<M&67108863,this.words[m+1]=_>>>26-M&67108863,M+=24,M>=26&&(M-=26,m++);return this.strip()},"_initArray");function f(L,h){var g=L.charCodeAt(h);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}o(f,"parseHex4Bits");function u(L,h,g){var b=f(L,g);return g-1>=h&&(b|=f(L,g-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,g,b){this.length=Math.ceil((h.length-g)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m=0,_=0,M;if(b==="be")for(l=h.length-1;l>=g;l-=2)M=u(h,g,l)<<m,this.words[_]|=M&67108863,m>=18?(m-=18,_+=1,this.words[_]|=M>>>26):m+=8;else{var S=h.length-g;for(l=S%2===0?g+1:g;l<h.length;l+=2)M=u(h,g,l)<<m,this.words[_]|=M&67108863,m>=18?(m-=18,_+=1,this.words[_]|=M>>>26):m+=8}this.strip()},"_parseHex");function d(L,h,g,b){for(var l=0,m=Math.min(L.length,g),_=h;_<m;_++){var M=L.charCodeAt(_)-48;l*=b,M>=49?l+=M-49+10:M>=17?l+=M-17+10:l+=M}return l}o(d,"parseBase"),i.prototype._parseBase=o(function(h,g,b){this.words=[0],this.length=1;for(var l=0,m=1;m<=67108863;m*=g)l++;l--,m=m/g|0;for(var _=h.length-b,M=_%l,S=Math.min(_,_-M)+b,y=0,C=b;C<S;C+=l)y=d(h,C,C+l,g),this.imuln(m),this.words[0]+y<67108864?this.words[0]+=y:this._iaddn(y);if(M!==0){var N=1;for(y=d(h,C,h.length,g),C=0;C<M;C++)N*=g;this.imuln(N),this.words[0]+y<67108864?this.words[0]+=y:this._iaddn(y)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var g=0;g<this.length;g++)h.words[g]=this.words[g];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 v=["","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"],x=[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,g){h=h||10,g=g|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,m=0,_=0;_<this.length;_++){var M=this.words[_],S=((M<<l|m)&16777215).toString(16);m=M>>>24-l&16777215,l+=2,l>=26&&(l-=26,_--),m!==0||_!==this.length-1?b=v[6-S.length]+S+b:b=S+b}for(m!==0&&(b=m.toString(16)+b);b.length%g!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var y=x[h],C=E[h];b="";var N=this.clone();for(N.negative=0;!N.isZero();){var w=N.modn(C).toString(h);N=N.idivn(C),N.isZero()?b=w+b:b=v[y-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%g!==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,g){return t(typeof s<"u"),this.toArrayLike(s,h,g)},"toBuffer"),i.prototype.toArray=o(function(h,g){return this.toArrayLike(Array,h,g)},"toArray"),i.prototype.toArrayLike=o(function(h,g,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 _=g==="le",M=new h(m),S,y,C=this.clone();if(_){for(y=0;!C.isZero();y++)S=C.andln(255),C.iushrn(8),M[y]=S;for(;y<m;y++)M[y]=0}else{for(y=0;y<m-l;y++)M[y]=0;for(y=0;!C.isZero();y++)S=C.andln(255),C.iushrn(8),M[m-y-1]=S}return M},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var g=h,b=0;return g>=4096&&(b+=13,g>>>=13),g>=64&&(b+=7,g>>>=7),g>=8&&(b+=4,g>>>=4),g>=2&&(b+=2,g>>>=2),b+g},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var g=h,b=0;return(g&8191)===0&&(b+=13,g>>>=13),(g&127)===0&&(b+=7,g>>>=7),(g&15)===0&&(b+=4,g>>>=4),(g&3)===0&&(b+=2,g>>>=2),(g&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],g=this._countBits(h);return(this.length-1)*26+g},"bitLength");function O(L){for(var h=new Array(L.bitLength()),g=0;g<h.length;g++){var b=g/26|0,l=g%26;h[g]=(L.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,g=0;g<this.length;g++){var b=this._zeroBits(this.words[g]);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 g=0;g<h.length;g++)this.words[g]=this.words[g]|h.words[g];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 g;this.length>h.length?g=h:g=this;for(var b=0;b<g.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=g.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 g,b;this.length>h.length?(g=this,b=h):(g=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=g.words[l]^b.words[l];if(this!==g)for(;l<g.length;l++)this.words[l]=g.words[l];return this.length=g.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 g=Math.ceil(h/26)|0,b=h%26;this._expand(g),b>0&&g--;for(var l=0;l<g;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,g){t(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),g?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 g;if(this.negative!==0&&h.negative===0)return this.negative=0,g=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,g=this.isub(h),h.negative=1,g._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var m=0,_=0;_<l.length;_++)g=(b.words[_]|0)+(l.words[_]|0)+m,this.words[_]=g&67108863,m=g>>>26;for(;m!==0&&_<b.length;_++)g=(b.words[_]|0)+m,this.words[_]=g&67108863,m=g>>>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 g;return h.negative!==0&&this.negative===0?(h.negative=0,g=this.sub(h),h.negative^=1,g):h.negative===0&&this.negative!==0?(this.negative=0,g=h.sub(this),this.negative=1,g):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 g=this.iadd(h);return h.negative=1,g._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,M=0;M<m.length;M++)g=(l.words[M]|0)-(m.words[M]|0)+_,_=g>>26,this.words[M]=g&67108863;for(;_!==0&&M<l.length;M++)g=(l.words[M]|0)+_,_=g>>26,this.words[M]=g&67108863;if(_===0&&M<l.length&&l!==this)for(;M<l.length;M++)this.words[M]=l.words[M];return this.length=Math.max(this.length,M),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(L,h,g){g.negative=h.negative^L.negative;var b=L.length+h.length|0;g.length=b,b=b-1|0;var l=L.words[0]|0,m=h.words[0]|0,_=l*m,M=_&67108863,S=_/67108864|0;g.words[0]=M;for(var y=1;y<b;y++){for(var C=S>>>26,N=S&67108863,w=Math.min(y,h.length-1),k=Math.max(0,y-L.length+1);k<=w;k++){var fe=y-k|0;l=L.words[fe]|0,m=h.words[k]|0,_=l*m+N,C+=_/67108864|0,N=_&67108863}g.words[y]=N|0,S=C|0}return S!==0?g.words[y]=S|0:g.length--,g.strip()}o(R,"smallMulTo");var I=o(function(h,g,b){var l=h.words,m=g.words,_=b.words,M=0,S,y,C,N=l[0]|0,w=N&8191,k=N>>>13,fe=l[1]|0,D=fe&8191,Q=fe>>>13,se=l[2]|0,q=se&8191,j=se>>>13,G=l[3]|0,te=G&8191,ae=G>>>13,Ae=l[4]|0,ge=Ae&8191,ie=Ae>>>13,Me=l[5]|0,ue=Me&8191,ve=Me>>>13,W=l[6]|0,pe=W&8191,ke=W>>>13,je=l[7]|0,Pe=je&8191,Je=je>>>13,gr=l[8]|0,le=gr&8191,oe=gr>>>13,F=l[9]|0,Z=F&8191,me=F>>>13,ye=m[0]|0,we=ye&8191,Ie=ye>>>13,Rt=m[1]|0,Fe=Rt&8191,Ne=Rt>>>13,Lt=m[2]|0,Ve=Lt&8191,Xe=Lt>>>13,Pn=m[3]|0,st=Pn&8191,at=Pn>>>13,ii=m[4]|0,ft=ii&8191,rt=ii>>>13,oi=m[5]|0,ct=oi&8191,ut=oi>>>13,pn=m[6]|0,lt=pn&8191,Qe=pn>>>13,si=m[7]|0,ht=si&8191,dt=si>>>13,ai=m[8]|0,pt=ai&8191,mt=ai>>>13,fi=m[9]|0,bt=fi&8191,nt=fi>>>13;b.negative=h.negative^g.negative,b.length=19,S=Math.imul(w,we),y=Math.imul(w,Ie),y=y+Math.imul(k,we)|0,C=Math.imul(k,Ie);var Bn=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,S=Math.imul(D,we),y=Math.imul(D,Ie),y=y+Math.imul(Q,we)|0,C=Math.imul(Q,Ie),S=S+Math.imul(w,Fe)|0,y=y+Math.imul(w,Ne)|0,y=y+Math.imul(k,Fe)|0,C=C+Math.imul(k,Ne)|0;var qt=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(qt>>>26)|0,qt&=67108863,S=Math.imul(q,we),y=Math.imul(q,Ie),y=y+Math.imul(j,we)|0,C=Math.imul(j,Ie),S=S+Math.imul(D,Fe)|0,y=y+Math.imul(D,Ne)|0,y=y+Math.imul(Q,Fe)|0,C=C+Math.imul(Q,Ne)|0,S=S+Math.imul(w,Ve)|0,y=y+Math.imul(w,Xe)|0,y=y+Math.imul(k,Ve)|0,C=C+Math.imul(k,Xe)|0;var Ht=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,S=Math.imul(te,we),y=Math.imul(te,Ie),y=y+Math.imul(ae,we)|0,C=Math.imul(ae,Ie),S=S+Math.imul(q,Fe)|0,y=y+Math.imul(q,Ne)|0,y=y+Math.imul(j,Fe)|0,C=C+Math.imul(j,Ne)|0,S=S+Math.imul(D,Ve)|0,y=y+Math.imul(D,Xe)|0,y=y+Math.imul(Q,Ve)|0,C=C+Math.imul(Q,Xe)|0,S=S+Math.imul(w,st)|0,y=y+Math.imul(w,at)|0,y=y+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var mn=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(mn>>>26)|0,mn&=67108863,S=Math.imul(ge,we),y=Math.imul(ge,Ie),y=y+Math.imul(ie,we)|0,C=Math.imul(ie,Ie),S=S+Math.imul(te,Fe)|0,y=y+Math.imul(te,Ne)|0,y=y+Math.imul(ae,Fe)|0,C=C+Math.imul(ae,Ne)|0,S=S+Math.imul(q,Ve)|0,y=y+Math.imul(q,Xe)|0,y=y+Math.imul(j,Ve)|0,C=C+Math.imul(j,Xe)|0,S=S+Math.imul(D,st)|0,y=y+Math.imul(D,at)|0,y=y+Math.imul(Q,st)|0,C=C+Math.imul(Q,at)|0,S=S+Math.imul(w,ft)|0,y=y+Math.imul(w,rt)|0,y=y+Math.imul(k,ft)|0,C=C+Math.imul(k,rt)|0;var bn=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(bn>>>26)|0,bn&=67108863,S=Math.imul(ue,we),y=Math.imul(ue,Ie),y=y+Math.imul(ve,we)|0,C=Math.imul(ve,Ie),S=S+Math.imul(ge,Fe)|0,y=y+Math.imul(ge,Ne)|0,y=y+Math.imul(ie,Fe)|0,C=C+Math.imul(ie,Ne)|0,S=S+Math.imul(te,Ve)|0,y=y+Math.imul(te,Xe)|0,y=y+Math.imul(ae,Ve)|0,C=C+Math.imul(ae,Xe)|0,S=S+Math.imul(q,st)|0,y=y+Math.imul(q,at)|0,y=y+Math.imul(j,st)|0,C=C+Math.imul(j,at)|0,S=S+Math.imul(D,ft)|0,y=y+Math.imul(D,rt)|0,y=y+Math.imul(Q,ft)|0,C=C+Math.imul(Q,rt)|0,S=S+Math.imul(w,ct)|0,y=y+Math.imul(w,ut)|0,y=y+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var gn=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(gn>>>26)|0,gn&=67108863,S=Math.imul(pe,we),y=Math.imul(pe,Ie),y=y+Math.imul(ke,we)|0,C=Math.imul(ke,Ie),S=S+Math.imul(ue,Fe)|0,y=y+Math.imul(ue,Ne)|0,y=y+Math.imul(ve,Fe)|0,C=C+Math.imul(ve,Ne)|0,S=S+Math.imul(ge,Ve)|0,y=y+Math.imul(ge,Xe)|0,y=y+Math.imul(ie,Ve)|0,C=C+Math.imul(ie,Xe)|0,S=S+Math.imul(te,st)|0,y=y+Math.imul(te,at)|0,y=y+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,S=S+Math.imul(q,ft)|0,y=y+Math.imul(q,rt)|0,y=y+Math.imul(j,ft)|0,C=C+Math.imul(j,rt)|0,S=S+Math.imul(D,ct)|0,y=y+Math.imul(D,ut)|0,y=y+Math.imul(Q,ct)|0,C=C+Math.imul(Q,ut)|0,S=S+Math.imul(w,lt)|0,y=y+Math.imul(w,Qe)|0,y=y+Math.imul(k,lt)|0,C=C+Math.imul(k,Qe)|0;var Fr=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,S=Math.imul(Pe,we),y=Math.imul(Pe,Ie),y=y+Math.imul(Je,we)|0,C=Math.imul(Je,Ie),S=S+Math.imul(pe,Fe)|0,y=y+Math.imul(pe,Ne)|0,y=y+Math.imul(ke,Fe)|0,C=C+Math.imul(ke,Ne)|0,S=S+Math.imul(ue,Ve)|0,y=y+Math.imul(ue,Xe)|0,y=y+Math.imul(ve,Ve)|0,C=C+Math.imul(ve,Xe)|0,S=S+Math.imul(ge,st)|0,y=y+Math.imul(ge,at)|0,y=y+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,S=S+Math.imul(te,ft)|0,y=y+Math.imul(te,rt)|0,y=y+Math.imul(ae,ft)|0,C=C+Math.imul(ae,rt)|0,S=S+Math.imul(q,ct)|0,y=y+Math.imul(q,ut)|0,y=y+Math.imul(j,ct)|0,C=C+Math.imul(j,ut)|0,S=S+Math.imul(D,lt)|0,y=y+Math.imul(D,Qe)|0,y=y+Math.imul(Q,lt)|0,C=C+Math.imul(Q,Qe)|0,S=S+Math.imul(w,ht)|0,y=y+Math.imul(w,dt)|0,y=y+Math.imul(k,ht)|0,C=C+Math.imul(k,dt)|0;var vn=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(vn>>>26)|0,vn&=67108863,S=Math.imul(le,we),y=Math.imul(le,Ie),y=y+Math.imul(oe,we)|0,C=Math.imul(oe,Ie),S=S+Math.imul(Pe,Fe)|0,y=y+Math.imul(Pe,Ne)|0,y=y+Math.imul(Je,Fe)|0,C=C+Math.imul(Je,Ne)|0,S=S+Math.imul(pe,Ve)|0,y=y+Math.imul(pe,Xe)|0,y=y+Math.imul(ke,Ve)|0,C=C+Math.imul(ke,Xe)|0,S=S+Math.imul(ue,st)|0,y=y+Math.imul(ue,at)|0,y=y+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,S=S+Math.imul(ge,ft)|0,y=y+Math.imul(ge,rt)|0,y=y+Math.imul(ie,ft)|0,C=C+Math.imul(ie,rt)|0,S=S+Math.imul(te,ct)|0,y=y+Math.imul(te,ut)|0,y=y+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,S=S+Math.imul(q,lt)|0,y=y+Math.imul(q,Qe)|0,y=y+Math.imul(j,lt)|0,C=C+Math.imul(j,Qe)|0,S=S+Math.imul(D,ht)|0,y=y+Math.imul(D,dt)|0,y=y+Math.imul(Q,ht)|0,C=C+Math.imul(Q,dt)|0,S=S+Math.imul(w,pt)|0,y=y+Math.imul(w,mt)|0,y=y+Math.imul(k,pt)|0,C=C+Math.imul(k,mt)|0;var ci=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(ci>>>26)|0,ci&=67108863,S=Math.imul(Z,we),y=Math.imul(Z,Ie),y=y+Math.imul(me,we)|0,C=Math.imul(me,Ie),S=S+Math.imul(le,Fe)|0,y=y+Math.imul(le,Ne)|0,y=y+Math.imul(oe,Fe)|0,C=C+Math.imul(oe,Ne)|0,S=S+Math.imul(Pe,Ve)|0,y=y+Math.imul(Pe,Xe)|0,y=y+Math.imul(Je,Ve)|0,C=C+Math.imul(Je,Xe)|0,S=S+Math.imul(pe,st)|0,y=y+Math.imul(pe,at)|0,y=y+Math.imul(ke,st)|0,C=C+Math.imul(ke,at)|0,S=S+Math.imul(ue,ft)|0,y=y+Math.imul(ue,rt)|0,y=y+Math.imul(ve,ft)|0,C=C+Math.imul(ve,rt)|0,S=S+Math.imul(ge,ct)|0,y=y+Math.imul(ge,ut)|0,y=y+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,S=S+Math.imul(te,lt)|0,y=y+Math.imul(te,Qe)|0,y=y+Math.imul(ae,lt)|0,C=C+Math.imul(ae,Qe)|0,S=S+Math.imul(q,ht)|0,y=y+Math.imul(q,dt)|0,y=y+Math.imul(j,ht)|0,C=C+Math.imul(j,dt)|0,S=S+Math.imul(D,pt)|0,y=y+Math.imul(D,mt)|0,y=y+Math.imul(Q,pt)|0,C=C+Math.imul(Q,mt)|0,S=S+Math.imul(w,bt)|0,y=y+Math.imul(w,nt)|0,y=y+Math.imul(k,bt)|0,C=C+Math.imul(k,nt)|0;var Lo=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,S=Math.imul(Z,Fe),y=Math.imul(Z,Ne),y=y+Math.imul(me,Fe)|0,C=Math.imul(me,Ne),S=S+Math.imul(le,Ve)|0,y=y+Math.imul(le,Xe)|0,y=y+Math.imul(oe,Ve)|0,C=C+Math.imul(oe,Xe)|0,S=S+Math.imul(Pe,st)|0,y=y+Math.imul(Pe,at)|0,y=y+Math.imul(Je,st)|0,C=C+Math.imul(Je,at)|0,S=S+Math.imul(pe,ft)|0,y=y+Math.imul(pe,rt)|0,y=y+Math.imul(ke,ft)|0,C=C+Math.imul(ke,rt)|0,S=S+Math.imul(ue,ct)|0,y=y+Math.imul(ue,ut)|0,y=y+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,S=S+Math.imul(ge,lt)|0,y=y+Math.imul(ge,Qe)|0,y=y+Math.imul(ie,lt)|0,C=C+Math.imul(ie,Qe)|0,S=S+Math.imul(te,ht)|0,y=y+Math.imul(te,dt)|0,y=y+Math.imul(ae,ht)|0,C=C+Math.imul(ae,dt)|0,S=S+Math.imul(q,pt)|0,y=y+Math.imul(q,mt)|0,y=y+Math.imul(j,pt)|0,C=C+Math.imul(j,mt)|0,S=S+Math.imul(D,bt)|0,y=y+Math.imul(D,nt)|0,y=y+Math.imul(Q,bt)|0,C=C+Math.imul(Q,nt)|0;var Uo=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,S=Math.imul(Z,Ve),y=Math.imul(Z,Xe),y=y+Math.imul(me,Ve)|0,C=Math.imul(me,Xe),S=S+Math.imul(le,st)|0,y=y+Math.imul(le,at)|0,y=y+Math.imul(oe,st)|0,C=C+Math.imul(oe,at)|0,S=S+Math.imul(Pe,ft)|0,y=y+Math.imul(Pe,rt)|0,y=y+Math.imul(Je,ft)|0,C=C+Math.imul(Je,rt)|0,S=S+Math.imul(pe,ct)|0,y=y+Math.imul(pe,ut)|0,y=y+Math.imul(ke,ct)|0,C=C+Math.imul(ke,ut)|0,S=S+Math.imul(ue,lt)|0,y=y+Math.imul(ue,Qe)|0,y=y+Math.imul(ve,lt)|0,C=C+Math.imul(ve,Qe)|0,S=S+Math.imul(ge,ht)|0,y=y+Math.imul(ge,dt)|0,y=y+Math.imul(ie,ht)|0,C=C+Math.imul(ie,dt)|0,S=S+Math.imul(te,pt)|0,y=y+Math.imul(te,mt)|0,y=y+Math.imul(ae,pt)|0,C=C+Math.imul(ae,mt)|0,S=S+Math.imul(q,bt)|0,y=y+Math.imul(q,nt)|0,y=y+Math.imul(j,bt)|0,C=C+Math.imul(j,nt)|0;var Fo=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,S=Math.imul(Z,st),y=Math.imul(Z,at),y=y+Math.imul(me,st)|0,C=Math.imul(me,at),S=S+Math.imul(le,ft)|0,y=y+Math.imul(le,rt)|0,y=y+Math.imul(oe,ft)|0,C=C+Math.imul(oe,rt)|0,S=S+Math.imul(Pe,ct)|0,y=y+Math.imul(Pe,ut)|0,y=y+Math.imul(Je,ct)|0,C=C+Math.imul(Je,ut)|0,S=S+Math.imul(pe,lt)|0,y=y+Math.imul(pe,Qe)|0,y=y+Math.imul(ke,lt)|0,C=C+Math.imul(ke,Qe)|0,S=S+Math.imul(ue,ht)|0,y=y+Math.imul(ue,dt)|0,y=y+Math.imul(ve,ht)|0,C=C+Math.imul(ve,dt)|0,S=S+Math.imul(ge,pt)|0,y=y+Math.imul(ge,mt)|0,y=y+Math.imul(ie,pt)|0,C=C+Math.imul(ie,mt)|0,S=S+Math.imul(te,bt)|0,y=y+Math.imul(te,nt)|0,y=y+Math.imul(ae,bt)|0,C=C+Math.imul(ae,nt)|0;var fo=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(fo>>>26)|0,fo&=67108863,S=Math.imul(Z,ft),y=Math.imul(Z,rt),y=y+Math.imul(me,ft)|0,C=Math.imul(me,rt),S=S+Math.imul(le,ct)|0,y=y+Math.imul(le,ut)|0,y=y+Math.imul(oe,ct)|0,C=C+Math.imul(oe,ut)|0,S=S+Math.imul(Pe,lt)|0,y=y+Math.imul(Pe,Qe)|0,y=y+Math.imul(Je,lt)|0,C=C+Math.imul(Je,Qe)|0,S=S+Math.imul(pe,ht)|0,y=y+Math.imul(pe,dt)|0,y=y+Math.imul(ke,ht)|0,C=C+Math.imul(ke,dt)|0,S=S+Math.imul(ue,pt)|0,y=y+Math.imul(ue,mt)|0,y=y+Math.imul(ve,pt)|0,C=C+Math.imul(ve,mt)|0,S=S+Math.imul(ge,bt)|0,y=y+Math.imul(ge,nt)|0,y=y+Math.imul(ie,bt)|0,C=C+Math.imul(ie,nt)|0;var co=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(co>>>26)|0,co&=67108863,S=Math.imul(Z,ct),y=Math.imul(Z,ut),y=y+Math.imul(me,ct)|0,C=Math.imul(me,ut),S=S+Math.imul(le,lt)|0,y=y+Math.imul(le,Qe)|0,y=y+Math.imul(oe,lt)|0,C=C+Math.imul(oe,Qe)|0,S=S+Math.imul(Pe,ht)|0,y=y+Math.imul(Pe,dt)|0,y=y+Math.imul(Je,ht)|0,C=C+Math.imul(Je,dt)|0,S=S+Math.imul(pe,pt)|0,y=y+Math.imul(pe,mt)|0,y=y+Math.imul(ke,pt)|0,C=C+Math.imul(ke,mt)|0,S=S+Math.imul(ue,bt)|0,y=y+Math.imul(ue,nt)|0,y=y+Math.imul(ve,bt)|0,C=C+Math.imul(ve,nt)|0;var uo=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(uo>>>26)|0,uo&=67108863,S=Math.imul(Z,lt),y=Math.imul(Z,Qe),y=y+Math.imul(me,lt)|0,C=Math.imul(me,Qe),S=S+Math.imul(le,ht)|0,y=y+Math.imul(le,dt)|0,y=y+Math.imul(oe,ht)|0,C=C+Math.imul(oe,dt)|0,S=S+Math.imul(Pe,pt)|0,y=y+Math.imul(Pe,mt)|0,y=y+Math.imul(Je,pt)|0,C=C+Math.imul(Je,mt)|0,S=S+Math.imul(pe,bt)|0,y=y+Math.imul(pe,nt)|0,y=y+Math.imul(ke,bt)|0,C=C+Math.imul(ke,nt)|0;var $o=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+($o>>>26)|0,$o&=67108863,S=Math.imul(Z,ht),y=Math.imul(Z,dt),y=y+Math.imul(me,ht)|0,C=Math.imul(me,dt),S=S+Math.imul(le,pt)|0,y=y+Math.imul(le,mt)|0,y=y+Math.imul(oe,pt)|0,C=C+Math.imul(oe,mt)|0,S=S+Math.imul(Pe,bt)|0,y=y+Math.imul(Pe,nt)|0,y=y+Math.imul(Je,bt)|0,C=C+Math.imul(Je,nt)|0;var qo=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(qo>>>26)|0,qo&=67108863,S=Math.imul(Z,pt),y=Math.imul(Z,mt),y=y+Math.imul(me,pt)|0,C=Math.imul(me,mt),S=S+Math.imul(le,bt)|0,y=y+Math.imul(le,nt)|0,y=y+Math.imul(oe,bt)|0,C=C+Math.imul(oe,nt)|0;var Ho=(M+S|0)+((y&8191)<<13)|0;M=(C+(y>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,S=Math.imul(Z,bt),y=Math.imul(Z,nt),y=y+Math.imul(me,bt)|0,C=Math.imul(me,nt);var zo=(M+S|0)+((y&8191)<<13)|0;return M=(C+(y>>>13)|0)+(zo>>>26)|0,zo&=67108863,_[0]=Bn,_[1]=qt,_[2]=Ht,_[3]=mn,_[4]=bn,_[5]=gn,_[6]=Fr,_[7]=vn,_[8]=ci,_[9]=Lo,_[10]=Uo,_[11]=Fo,_[12]=fo,_[13]=co,_[14]=uo,_[15]=$o,_[16]=qo,_[17]=Ho,_[18]=zo,M!==0&&(_[19]=M,b.length++),b},"comb10MulTo");Math.imul||(I=R);function B(L,h,g){g.negative=h.negative^L.negative,g.length=L.length+h.length;for(var b=0,l=0,m=0;m<g.length-1;m++){var _=l;l=0;for(var M=b&67108863,S=Math.min(m,h.length-1),y=Math.max(0,m-L.length+1);y<=S;y++){var C=m-y,N=L.words[C]|0,w=h.words[y]|0,k=N*w,fe=k&67108863;_=_+(k/67108864|0)|0,fe=fe+M|0,M=fe&67108863,_=_+(fe>>>26)|0,l+=_>>>26,_&=67108863}g.words[m]=M,b=_,_=l}return b!==0?g.words[m]=b:g.length--,g.strip()}o(B,"bigMulTo");function Y(L,h,g){var b=new P;return b.mulp(L,h,g)}o(Y,"jumboMulTo"),i.prototype.mulTo=o(function(h,g){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=I(this,h,g):l<63?b=R(this,h,g):l<1024?b=B(this,h,g):b=Y(this,h,g),b},"mulTo");function P(L,h){this.x=L,this.y=h}o(P,"FFTM"),P.prototype.makeRBT=o(function(h){for(var g=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)g[l]=this.revBin(l,b,h);return g},"makeRBT"),P.prototype.revBin=o(function(h,g,b){if(h===0||h===b-1)return h;for(var l=0,m=0;m<g;m++)l|=(h&1)<<g-m-1,h>>=1;return l},"revBin"),P.prototype.permute=o(function(h,g,b,l,m,_){for(var M=0;M<_;M++)l[M]=g[h[M]],m[M]=b[h[M]]},"permute"),P.prototype.transform=o(function(h,g,b,l,m,_){this.permute(_,h,g,b,l,m);for(var M=1;M<m;M<<=1)for(var S=M<<1,y=Math.cos(2*Math.PI/S),C=Math.sin(2*Math.PI/S),N=0;N<m;N+=S)for(var w=y,k=C,fe=0;fe<M;fe++){var D=b[N+fe],Q=l[N+fe],se=b[N+fe+M],q=l[N+fe+M],j=w*se-k*q;q=w*q+k*se,se=j,b[N+fe]=D+se,l[N+fe]=Q+q,b[N+fe+M]=D-se,l[N+fe+M]=Q-q,fe!==S&&(j=y*w-C*k,k=y*k+C*w,w=j)}},"transform"),P.prototype.guessLen13b=o(function(h,g){var b=Math.max(g,h)|1,l=b&1,m=0;for(b=b/2|0;b;b=b>>>1)m++;return 1<<m+1+l},"guessLen13b"),P.prototype.conjugate=o(function(h,g,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=g[l],g[l]=-g[b-l-1],g[b-l-1]=-m}},"conjugate"),P.prototype.normalize13b=o(function(h,g){for(var b=0,l=0;l<g/2;l++){var m=Math.round(h[2*l+1]/g)*8192+Math.round(h[2*l]/g)+b;h[l]=m&67108863,m<67108864?b=0:b=m/67108864|0}return h},"normalize13b"),P.prototype.convert13b=o(function(h,g,b,l){for(var m=0,_=0;_<g;_++)m=m+(h[_]|0),b[2*_]=m&8191,m=m>>>13,b[2*_+1]=m&8191,m=m>>>13;for(_=2*g;_<l;++_)b[_]=0;t(m===0),t((m&-8192)===0)},"convert13b"),P.prototype.stub=o(function(h){for(var g=new Array(h),b=0;b<h;b++)g[b]=0;return g},"stub"),P.prototype.mulp=o(function(h,g,b){var l=2*this.guessLen13b(h.length,g.length),m=this.makeRBT(l),_=this.stub(l),M=new Array(l),S=new Array(l),y=new Array(l),C=new Array(l),N=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,M,l),this.convert13b(g.words,g.length,C,l),this.transform(M,_,S,y,l,m),this.transform(C,_,N,w,l,m);for(var fe=0;fe<l;fe++){var D=S[fe]*N[fe]-y[fe]*w[fe];y[fe]=S[fe]*w[fe]+y[fe]*N[fe],S[fe]=D}return this.conjugate(S,y,l),this.transform(S,y,k,_,l,m),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^g.negative,b.length=h.length+g.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var g=new i(null);return g.words=new Array(this.length+h.length),this.mulTo(h,g)},"mul"),i.prototype.mulf=o(function(h){var g=new i(null);return g.words=new Array(this.length+h.length),Y(this,h,g)},"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 g=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,m=(l&67108863)+(g&67108863);g>>=26,g+=l/67108864|0,g+=m>>>26,this.words[b]=m&67108863}return g!==0&&(this.words[b]=g,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 g=O(h);if(g.length===0)return new i(1);for(var b=this,l=0;l<g.length&&g[l]===0;l++,b=b.sqr());if(++l<g.length)for(var m=b.sqr();l<g.length;l++,m=m.sqr())g[l]!==0&&(b=b.mul(m));return b},"pow"),i.prototype.iushln=o(function(h){t(typeof h=="number"&&h>=0);var g=h%26,b=(h-g)/26,l=67108863>>>26-g<<26-g,m;if(g!==0){var _=0;for(m=0;m<this.length;m++){var M=this.words[m]&l,S=(this.words[m]|0)-M<<g;this.words[m]=S|_,_=M>>>26-g}_&&(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,g,b){t(typeof h=="number"&&h>=0);var l;g?l=(g-g%26)/26:l=0;var m=h%26,_=Math.min((h-m)/26,this.length),M=67108863^67108863>>>m<<m,S=b;if(l-=_,l=Math.max(0,l),S){for(var y=0;y<_;y++)S.words[y]=this.words[y];S.length=_}if(_!==0)if(this.length>_)for(this.length-=_,y=0;y<this.length;y++)this.words[y]=this.words[y+_];else this.words[0]=0,this.length=1;var C=0;for(y=this.length-1;y>=0&&(C!==0||y>=l);y--){var N=this.words[y]|0;this.words[y]=C<<26-m|N>>>m,C=N&M}return S&&C!==0&&(S.words[S.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,g,b){return t(this.negative===0),this.iushrn(h,g,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 g=h%26,b=(h-g)/26,l=1<<g;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 g=h%26,b=(h-g)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(g!==0&&b++,this.length=Math.min(b,this.length),g!==0){var l=67108863^67108863>>>g<<g;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 g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},"_iaddn"),i.prototype.isubn=o(function(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 g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(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,g,b){var l=h.length+b,m;this._expand(l);var _,M=0;for(m=0;m<h.length;m++){_=(this.words[m+b]|0)+M;var S=(h.words[m]|0)*g;_-=S&67108863,M=(_>>26)-(S/67108864|0),this.words[m+b]=_&67108863}for(;m<this.length-b;m++)_=(this.words[m+b]|0)+M,M=_>>26,this.words[m+b]=_&67108863;if(M===0)return this.strip();for(t(M===-1),M=0,m=0;m<this.length;m++)_=-(this.words[m]|0)+M,M=_>>26,this.words[m]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,g){var b=this.length-h.length,l=this.clone(),m=h,_=m.words[m.length-1]|0,M=this._countBits(_);b=26-M,b!==0&&(m=m.ushln(b),l.iushln(b),_=m.words[m.length-1]|0);var S=l.length-m.length,y;if(g!=="mod"){y=new i(null),y.length=S+1,y.words=new Array(y.length);for(var C=0;C<y.length;C++)y.words[C]=0}var N=l.clone()._ishlnsubmul(m,1,S);N.negative===0&&(l=N,y&&(y.words[S]=1));for(var w=S-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);y&&(y.words[w]=k)}return y&&y.strip(),l.strip(),g!=="div"&&b!==0&&l.iushrn(b),{div:y||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,g,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,g),g!=="mod"&&(l=_.div.neg()),g!=="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(),g),g!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),g),g!=="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?g==="div"?{div:this.divn(h.words[0]),mod:null}:g==="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,g)},"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 g=this.divmod(h);if(g.mod.isZero())return g.div;var b=g.div.negative!==0?g.mod.isub(h):g.mod,l=h.ushrn(1),m=h.andln(1),_=b.cmp(l);return _<0||m===1&&_===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){t(h<=67108863);for(var g=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(g*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){t(h<=67108863);for(var g=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+g*67108864;this.words[b]=l/h|0,g=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 g=this,b=h.clone();g.negative!==0?g=g.umod(h):g=g.clone();for(var l=new i(1),m=new i(0),_=new i(0),M=new i(1),S=0;g.isEven()&&b.isEven();)g.iushrn(1),b.iushrn(1),++S;for(var y=b.clone(),C=g.clone();!g.isZero();){for(var N=0,w=1;(g.words[0]&w)===0&&N<26;++N,w<<=1);if(N>0)for(g.iushrn(N);N-- >0;)(l.isOdd()||m.isOdd())&&(l.iadd(y),m.isub(C)),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()||M.isOdd())&&(_.iadd(y),M.isub(C)),_.iushrn(1),M.iushrn(1);g.cmp(b)>=0?(g.isub(b),l.isub(_),m.isub(M)):(b.isub(g),_.isub(l),M.isub(m))}return{a:_,b:M,gcd:b.iushln(S)}},"egcd"),i.prototype._invmp=o(function(h){t(h.negative===0),t(!h.isZero());var g=this,b=h.clone();g.negative!==0?g=g.umod(h):g=g.clone();for(var l=new i(1),m=new i(0),_=b.clone();g.cmpn(1)>0&&b.cmpn(1)>0;){for(var M=0,S=1;(g.words[0]&S)===0&&M<26;++M,S<<=1);if(M>0)for(g.iushrn(M);M-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var y=0,C=1;(b.words[0]&C)===0&&y<26;++y,C<<=1);if(y>0)for(b.iushrn(y);y-- >0;)m.isOdd()&&m.iadd(_),m.iushrn(1);g.cmp(b)>=0?(g.isub(b),l.isub(m)):(b.isub(g),m.isub(l))}var N;return g.cmpn(1)===0?N=l:N=m,N.cmpn(0)<0&&N.iadd(h),N},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var g=this.clone(),b=h.clone();g.negative=0,b.negative=0;for(var l=0;g.isEven()&&b.isEven();l++)g.iushrn(1),b.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;b.isEven();)b.iushrn(1);var m=g.cmp(b);if(m<0){var _=g;g=b,b=_}else if(m===0||b.cmpn(1)===0)break;g.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 g=h%26,b=(h-g)/26,l=1<<g;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var m=l,_=b;m!==0&&_<this.length;_++){var M=this.words[_]|0;M+=m,m=M>>>26,M&=67108863,this.words[_]=M}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 g=h<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var b;if(this.length>1)b=1;else{g&&(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 g=this.ucmp(h);return this.negative!==0?-g|0:g},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var g=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,m=h.words[b]|0;if(l!==m){l<m?g=-1:l>m&&(g=1);break}}return g},"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 z(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(L,h){this.name=L,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 g=h,b;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),b=g.bitLength();while(b>this.n);var l=b<this.n?-1:g.ucmp(this.p);return l===0?(g.words[0]=0,g.length=1):l>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},"ireduce"),ee.prototype.split=o(function(h,g){h.iushrn(this.n,0,g)},"split"),ee.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function X(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(X,"K256"),n(X,ee),X.prototype.split=o(function(h,g){for(var b=4194303,l=Math.min(h.length,9),m=0;m<l;m++)g.words[m]=h.words[m];if(g.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(g.words[g.length++]=_&b,m=10;m<h.length;m++){var M=h.words[m]|0;h.words[m-10]=(M&b)<<4|_>>>22,_=M}_>>>=22,h.words[m-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},"split"),X.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var g=0,b=0;b<h.length;b++){var l=h.words[b]|0;g+=l*977,h.words[b]=g&67108863,g=l*64+(g/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function ne(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ne,"P224"),n(ne,ee);function V(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(V,"P192"),n(V,ee);function H(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(H,"P25519"),n(H,ee),H.prototype.imulK=o(function(h){for(var g=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+g,m=l&67108863;l>>>=26,h.words[b]=m,g=l}return g!==0&&(h.words[h.length++]=g),h},"imulK"),i._prime=o(function(h){if(J[h])return J[h];var g;if(h==="k256")g=new X;else if(h==="p224")g=new ne;else if(h==="p192")g=new V;else if(h==="p25519")g=new H;else throw new Error("Unknown prime "+h);return J[h]=g,g},"prime");function z(L){if(typeof L=="string"){var h=i._prime(L);this.m=h.p,this.prime=h}else t(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}o(z,"Red"),z.prototype._verify1=o(function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},"_verify1"),z.prototype._verify2=o(function(h,g){t((h.negative|g.negative)===0,"red works only with positives"),t(h.red&&h.red===g.red,"red works only with red numbers")},"_verify2"),z.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),z.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),z.prototype.add=o(function(h,g){this._verify2(h,g);var b=h.add(g);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),z.prototype.iadd=o(function(h,g){this._verify2(h,g);var b=h.iadd(g);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),z.prototype.sub=o(function(h,g){this._verify2(h,g);var b=h.sub(g);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),z.prototype.isub=o(function(h,g){this._verify2(h,g);var b=h.isub(g);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),z.prototype.shl=o(function(h,g){return this._verify1(h),this.imod(h.ushln(g))},"shl"),z.prototype.imul=o(function(h,g){return this._verify2(h,g),this.imod(h.imul(g))},"imul"),z.prototype.mul=o(function(h,g){return this._verify2(h,g),this.imod(h.mul(g))},"mul"),z.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),z.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),z.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var g=this.m.andln(3);if(t(g%2===1),g===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),M=_.redNeg(),S=this.m.subn(1).iushrn(1),y=this.m.bitLength();for(y=new i(2*y*y).toRed(this);this.pow(y,S).cmp(M)!==0;)y.redIAdd(M);for(var C=this.pow(y,l),N=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(C,new i(1).iushln(k-D-1));N=N.redMul(Q),C=Q.redSqr(),w=w.redMul(C),k=D}return N},"sqrt"),z.prototype.invm=o(function(h){var g=h._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},"invm"),z.prototype.pow=o(function(h,g){if(g.isZero())return new i(1).toRed(this);if(g.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],M=0,S=0,y=g.bitLength()%26;for(y===0&&(y=26),m=g.length-1;m>=0;m--){for(var C=g.words[m],N=y-1;N>=0;N--){var w=C>>N&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&M===0){S=0;continue}M<<=1,M|=w,S++,!(S!==b&&(m!==0||N!==0))&&(_=this.mul(_,l[M]),S=0,M=0)}y=26}return _},"pow"),z.prototype.convertTo=o(function(h){var g=h.umod(this.m);return g===h?g.clone():g},"convertTo"),z.prototype.convertFrom=o(function(h){var g=h.clone();return g.red=null,g},"convertFrom"),i.mont=o(function(h){return new he(h)},"mont");function he(L){z.call(this,L),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,z),he.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),he.prototype.convertFrom=o(function(h){var g=this.imod(h.mul(this.rinv));return g.red=null,g},"convertFrom"),he.prototype.imul=o(function(h,g){if(h.isZero()||g.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(g),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,g){if(h.isZero()||g.isZero())return new i(0)._forceRed(this);var b=h.mul(g),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 g=this.imod(h._invmp(this.m).mul(this.r2));return g._forceRed(this)},"invm")})(typeof y1>"u"||y1,tx)});var $s=Re((RV,nx)=>{nx.exports=rx;function rx(r,e){if(!r)throw new Error(e||"Assertion failed")}o(rx,"assert");rx.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var x1=Re(sx=>{"use strict";var ld=sx;function iO(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(iO,"toArray");ld.toArray=iO;function ix(r){return r.length===1?"0"+r:r}o(ix,"zero2");ld.zero2=ix;function ox(r){for(var e="",t=0;t<r.length;t++)e+=ix(r[t].toString(16));return e}o(ox,"toHex");ld.toHex=ox;ld.encode=o(function(e,t){return t==="hex"?ox(e):e},"encode")});var jn=Re(ax=>{"use strict";var zi=ax,oO=mo(),sO=$s(),hd=x1();zi.assert=sO;zi.toArray=hd.toArray;zi.zero2=hd.zero2;zi.toHex=hd.toHex;zi.encode=hd.encode;function aO(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(aO,"getNAF");zi.getNAF=aO;function fO(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 v;(u&1)===0?v=0:(s=e.andln(7)+i&7,(s===3||s===5)&&f===2?v=-u:v=u),t[1].push(v),2*n===d+1&&(n=1-n),2*i===v+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(fO,"getJSF");zi.getJSF=fO;function cO(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(cO,"cachedProperty");zi.cachedProperty=cO;function uO(r){return typeof r=="string"?zi.toArray(r,"hex"):r}o(uO,"parseBytes");zi.parseBytes=uO;function lO(r){return new oO(r,"hex","le")}o(lO,"intFromLE");zi.intFromLE=lO});var A1=Re((PV,E1)=>{var w1;E1.exports=o(function(e){return w1||(w1=new qs(null)),w1.generate(e)},"rand");function qs(r){this.rand=r}o(qs,"Rand");E1.exports.Rand=qs;qs.prototype.generate=o(function(e){return this._rand(e)},"generate");qs.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?qs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?qs.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(qs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(_1=require("crypto"),typeof _1.randomBytes!="function")throw new Error("Not supported");qs.prototype._rand=o(function(e){return _1.randomBytes(e)},"_rand")}catch{}var _1});var $u=Re((BV,fx)=>{"use strict";var qa=mo(),Fu=jn(),dd=Fu.getNAF,hO=Fu.getJSF,pd=Fu.assert;function Hs(r,e){this.type=r,this.p=new qa(e.p,16),this.red=e.prime?qa.red(e.prime):qa.mont(this.p),this.zero=new qa(0).toRed(this.red),this.one=new qa(1).toRed(this.red),this.two=new qa(2).toRed(this.red),this.n=e.n&&new qa(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(Hs,"BaseCurve");fx.exports=Hs;Hs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Hs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Hs.prototype._fixedNafMul=o(function(e,t){pd(e.precomputed);var n=e._getDoubles(),i=dd(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 v=u+n.step-1;v>=u;v--)d=(d<<1)+i[v];f.push(d)}for(var x=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()));x=x.add(E)}return x.toP()},"_fixedNafMul");Hs.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=dd(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var v=0;d>=0&&f[d]===0;d--)v++;if(d>=0&&v++,u=u.dblp(v),d<0)break;var x=f[d];pd(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(s[x-1>>1]):u=u.mixedAdd(s[-x-1>>1].neg()):x>0?u=u.add(s[x-1>>1]):u=u.add(s[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Hs.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,v=0,x,E,O;for(x=0;x<i;x++){O=t[x];var R=O._getNAFPoints(e);f[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var I=x-1,B=x;if(f[I]!==1||f[B]!==1){d[I]=dd(n[I],f[I],this._bitLength),d[B]=dd(n[B],f[B],this._bitLength),v=Math.max(d[I].length,v),v=Math.max(d[B].length,v);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=hO(n[I],n[B]);for(v=Math.max(J[0].length,v),d[I]=new Array(v),d[B]=new Array(v),E=0;E<v;E++){var ee=J[0][E]|0,X=J[1][E]|0;d[I][E]=P[(ee+1)*3+(X+1)],d[B][E]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var z=!0;for(E=0;E<i;E++)V[E]=d[E][x]|0,V[E]!==0&&(z=!1);if(!z)break;H++,x--}if(x>=0&&H++,ne=ne.dblp(H),x<0)break;for(E=0;E<i;E++){var he=V[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(x=0;x<i;x++)u[x]=null;return s?ne:ne.toP()},"_wnafMulAdd");function wi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(wi,"BasePoint");Hs.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Hs.prototype.decodePoint=o(function(e,t){e=Fu.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?pd(e[e.length-1]%2===0):e[0]===7&&pd(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");wi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");wi.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");wi.prototype.encode=o(function(e,t){return Fu.encode(this._encode(t),e)},"encode");wi.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");wi.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");wi.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");wi.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");wi.prototype._getBeta=o(function(){return null},"_getBeta");wi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var qu=Re((LV,S1)=>{typeof Object.create=="function"?S1.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"):S1.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 ux=Re((UV,cx)=>{"use strict";var dO=jn(),dr=mo(),M1=qu(),ic=$u(),pO=dO.assert;function _i(r){ic.call(this,"short",r),this.a=new dr(r.a,16).toRed(this.red),this.b=new dr(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(_i,"ShortCurve");M1(_i,ic);cx.exports=_i;_i.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 dr(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 dr(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],pO(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 dr(u.a,16),b:new dr(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");_i.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:dr.mont(e),n=new dr(2).toRed(t).redInvm(),i=n.redNeg(),s=new dr(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");_i.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 dr(1),f=new dr(0),u=new dr(0),d=new dr(1),v,x,E,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var X=d.sub(ee.mul(f));if(!E&&P.cmp(t)<0)v=B.neg(),x=s,E=P.neg(),O=J;else if(E&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=X}R=P.neg(),I=J;var ne=E.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=v,I=x),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");_i.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),v=s.mul(n.b),x=f.mul(i.b),E=e.sub(u).sub(d),O=v.add(x).neg();return{k1:E,k2:O}},"_endoSplit");_i.prototype.pointFromX=o(function(e,t){e=new dr(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");_i.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");_i.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],v=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[f*2]=d,i[f*2+1]=v,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return x},"_endoWnafMulAdd");function Ir(r,e,t,n){ic.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new dr(e,16),this.y=new dr(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(Ir,"Point");M1(Ir,ic.BasePoint);_i.prototype.point=o(function(e,t,n){return new Ir(this,e,t,n)},"point");_i.prototype.pointFromJSON=o(function(e,t){return Ir.fromJSON(this,e,t)},"pointFromJSON");Ir.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");Ir.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");Ir.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");Ir.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");Ir.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Ir.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");Ir.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");Ir.prototype.getX=o(function(){return this.x.fromRed()},"getX");Ir.prototype.getY=o(function(){return this.y.fromRed()},"getY");Ir.prototype.mul=o(function(e){return e=new dr(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");Ir.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");Ir.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");Ir.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");Ir.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");Ir.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 qr(r,e,t,n){ic.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new dr(0)):(this.x=new dr(e,16),this.y=new dr(t,16),this.z=new dr(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(qr,"JPoint");M1(qr,ic.BasePoint);_i.prototype.jpoint=o(function(e,t,n){return new qr(this,e,t,n)},"jpoint");qr.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");qr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");qr.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),v=f.redSub(u);if(d.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=d.redSqr(),E=x.redMul(d),O=i.redMul(x),R=v.redSqr().redIAdd(E).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(f.redMul(E)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");qr.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 v=u.redSqr(),x=v.redMul(u),E=n.redMul(v),O=d.redSqr().redIAdd(x).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(x)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");qr.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,v=d.redSqr().redSqr(),x=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=x.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(v)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=x.redMul(d);t+1<e&&(v=v.redMul(R)),f=Y,d=ee,x=J}return this.curve.jpoint(f,x.redMul(s),d)},"dblp");qr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");qr.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),v=d.redSqr().redISub(u).redISub(u),x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),e=v,t=d.redMul(u.redISub(v)).redISub(x),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 B=E.redAdd(E).redIAdd(E),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");qr.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),v=d.redSqr().redISub(u).redISub(u);e=v;var x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),t=d.redMul(u.redISub(v)).redISub(x),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 B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");qr.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)),v=t.redAdd(t);v=v.redIAdd(v);var x=v.redMul(u),E=d.redSqr().redISub(x.redAdd(x)),O=x.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,B)},"_dbl");qr.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(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(v),E=t.redMul(x);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(x.redMul(v.redISub(x)).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");qr.prototype.mul=o(function(e,t){return e=new dr(e,t),this.curve._wnafMul(this,e)},"mul");qr.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");qr.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");qr.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");qr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var dx=Re((FV,hx)=>{"use strict";var oc=mo(),lx=qu(),md=$u(),mO=jn();function sc(r){md.call(this,"mont",r),this.a=new oc(r.a,16).toRed(this.red),this.b=new oc(r.b,16).toRed(this.red),this.i4=new oc(4).toRed(this.red).redInvm(),this.two=new oc(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(sc,"MontCurve");lx(sc,md);hx.exports=sc;sc.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 Dr(r,e,t){md.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new oc(e,16),this.z=new oc(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(Dr,"Point");lx(Dr,md.BasePoint);sc.prototype.decodePoint=o(function(e,t){return this.point(mO.toArray(e,t),1)},"decodePoint");sc.prototype.point=o(function(e,t){return new Dr(this,e,t)},"point");sc.prototype.pointFromJSON=o(function(e){return Dr.fromJSON(this,e)},"pointFromJSON");Dr.prototype.precompute=o(function(){},"precompute");Dr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Dr.fromJSON=o(function(e,t){return new Dr(e,t[0],t[1]||e.one)},"fromJSON");Dr.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");Dr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Dr.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");Dr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Dr.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),v=t.z.redMul(u.redAdd(d).redSqr()),x=t.x.redMul(u.redISub(d).redSqr());return this.curve.point(v,x)},"diffAdd");Dr.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");Dr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Dr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Dr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Dr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Dr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var bx=Re(($V,mx)=>{"use strict";var bO=jn(),ts=mo(),px=qu(),bd=$u(),gO=bO.assert;function bo(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,bd.call(this,"edwards",r),this.a=new ts(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ts(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ts(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),gO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(bo,"EdwardsCurve");px(bo,bd);mx.exports=bo;bo.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");bo.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");bo.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");bo.prototype.pointFromX=o(function(e,t){e=new ts(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");bo.prototype.pointFromY=o(function(e,t){e=new ts(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");bo.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){bd.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 ts(e,16),this.y=new ts(t,16),this.z=n?new ts(n,16):this.curve.one,this.t=i&&new ts(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");px(nr,bd.BasePoint);bo.prototype.pointFromJSON=o(function(e){return nr.fromJSON(this,e)},"pointFromJSON");bo.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),v=s.redMul(u),x=f.redMul(d),E=s.redMul(d),O=u.redMul(f);return this.curve.point(v,x,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,v;if(this.curve.twisted){u=this.curve._mulA(t);var x=u.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(x.redSub(this.curve.two)),s=x.redMul(u.redSub(n)),f=x.redSqr().redSub(x).redSub(x)):(d=this.z.redSqr(),v=x.redSub(d).redISub(d),i=e.redSub(t).redISub(n).redMul(v),s=x.redMul(u.redSub(n)),f=x.redMul(v))}else u=t.redAdd(n),d=this.curve._mulC(this.z).redSqr(),v=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(v),s=this.curve._mulC(u).redMul(t.redISub(n)),f=u.redMul(v);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),v=n.redAdd(t),x=f.redMul(u),E=d.redMul(v),O=f.redMul(v),R=u.redMul(d);return this.curve.point(x,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),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),x=t.redMul(u).redMul(v),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(x,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 T1=Re(gx=>{"use strict";var gd=gx;gd.base=$u();gd.short=ux();gd.mont=dx();gd.edwards=bx()});var ji=Re(tr=>{"use strict";var vO=$s(),yO=qu();tr.inherits=yO;function xO(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(xO,"isSurrogatePair");function wO(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):xO(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(wO,"toArray");tr.toArray=wO;function _O(r){for(var e="",t=0;t<r.length;t++)e+=yx(r[t].toString(16));return e}o(_O,"toHex");tr.toHex=_O;function vx(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(vx,"htonl");tr.htonl=vx;function EO(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=vx(i)),t+=xx(i.toString(16))}return t}o(EO,"toHex32");tr.toHex32=EO;function yx(r){return r.length===1?"0"+r:r}o(yx,"zero2");tr.zero2=yx;function xx(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(xx,"zero8");tr.zero8=xx;function AO(r,e,t,n){var i=t-e;vO(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(AO,"join32");tr.join32=AO;function SO(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(SO,"split32");tr.split32=SO;function MO(r,e){return r>>>e|r<<32-e}o(MO,"rotr32");tr.rotr32=MO;function TO(r,e){return r<<e|r>>>32-e}o(TO,"rotl32");tr.rotl32=TO;function CO(r,e){return r+e>>>0}o(CO,"sum32");tr.sum32=CO;function kO(r,e,t){return r+e+t>>>0}o(kO,"sum32_3");tr.sum32_3=kO;function IO(r,e,t,n){return r+e+t+n>>>0}o(IO,"sum32_4");tr.sum32_4=IO;function DO(r,e,t,n,i){return r+e+t+n+i>>>0}o(DO,"sum32_5");tr.sum32_5=DO;function RO(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(RO,"sum64");tr.sum64=RO;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");tr.sum64_hi=OO;function NO(r,e,t,n){var i=e+n;return i>>>0}o(NO,"sum64_lo");tr.sum64_lo=NO;function PO(r,e,t,n,i,s,f,u){var d=0,v=e;v=v+n>>>0,d+=v<e?1:0,v=v+s>>>0,d+=v<s?1:0,v=v+u>>>0,d+=v<u?1:0;var x=r+t+i+f+d;return x>>>0}o(PO,"sum64_4_hi");tr.sum64_4_hi=PO;function BO(r,e,t,n,i,s,f,u){var d=e+n+s+u;return d>>>0}o(BO,"sum64_4_lo");tr.sum64_4_lo=BO;function LO(r,e,t,n,i,s,f,u,d,v){var x=0,E=e;E=E+n>>>0,x+=E<e?1:0,E=E+s>>>0,x+=E<s?1:0,E=E+u>>>0,x+=E<u?1:0,E=E+v>>>0,x+=E<v?1:0;var O=r+t+i+f+d+x;return O>>>0}o(LO,"sum64_5_hi");tr.sum64_5_hi=LO;function UO(r,e,t,n,i,s,f,u,d,v){var x=e+n+s+u+v;return x>>>0}o(UO,"sum64_5_lo");tr.sum64_5_lo=UO;function FO(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(FO,"rotr64_hi");tr.rotr64_hi=FO;function $O(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o($O,"rotr64_lo");tr.rotr64_lo=$O;function qO(r,e,t){return r>>>t}o(qO,"shr64_hi");tr.shr64_hi=qO;function HO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(HO,"shr64_lo");tr.shr64_lo=HO});var ac=Re(_x=>{"use strict";var wx=ji(),zO=$s();function vd(){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(vd,"BlockHash");_x.BlockHash=vd;vd.prototype.update=o(function(e,t){if(e=wx.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=wx.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");vd.prototype.digest=o(function(e){return this.update(this._pad()),zO(this.pending===null),this._digest(e)},"digest");vd.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 C1=Re(rs=>{"use strict";var jO=ji(),go=jO.rotr32;function KO(r,e,t,n){if(r===0)return Ex(e,t,n);if(r===1||r===3)return Sx(e,t,n);if(r===2)return Ax(e,t,n)}o(KO,"ft_1");rs.ft_1=KO;function Ex(r,e,t){return r&e^~r&t}o(Ex,"ch32");rs.ch32=Ex;function Ax(r,e,t){return r&e^r&t^e&t}o(Ax,"maj32");rs.maj32=Ax;function Sx(r,e,t){return r^e^t}o(Sx,"p32");rs.p32=Sx;function VO(r){return go(r,2)^go(r,13)^go(r,22)}o(VO,"s0_256");rs.s0_256=VO;function GO(r){return go(r,6)^go(r,11)^go(r,25)}o(GO,"s1_256");rs.s1_256=GO;function WO(r){return go(r,7)^go(r,18)^r>>>3}o(WO,"g0_256");rs.g0_256=WO;function JO(r){return go(r,17)^go(r,19)^r>>>10}o(JO,"g1_256");rs.g1_256=JO});var Cx=Re((KV,Tx)=>{"use strict";var fc=ji(),YO=ac(),XO=C1(),k1=fc.rotl32,Hu=fc.sum32,ZO=fc.sum32_5,QO=XO.ft_1,Mx=YO.BlockHash,eN=[1518500249,1859775393,2400959708,3395469782];function vo(){if(!(this instanceof vo))return new vo;Mx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(vo,"SHA1");fc.inherits(vo,Mx);Tx.exports=vo;vo.blockSize=512;vo.outSize=160;vo.hmacStrength=80;vo.padLength=64;vo.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]=k1(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],v=this.h[4];for(i=0;i<n.length;i++){var x=~~(i/20),E=ZO(k1(s,5),QO(x,f,u,d),v,n[i],eN[x]);v=d,d=u,u=k1(f,30),f=s,s=E}this.h[0]=Hu(this.h[0],s),this.h[1]=Hu(this.h[1],f),this.h[2]=Hu(this.h[2],u),this.h[3]=Hu(this.h[3],d),this.h[4]=Hu(this.h[4],v)},"_update");vo.prototype._digest=o(function(e){return e==="hex"?fc.toHex32(this.h,"big"):fc.split32(this.h,"big")},"digest")});var I1=Re((VV,Ix)=>{"use strict";var cc=ji(),tN=ac(),uc=C1(),rN=$s(),Ki=cc.sum32,nN=cc.sum32_4,iN=cc.sum32_5,oN=uc.ch32,sN=uc.maj32,aN=uc.s0_256,fN=uc.s1_256,cN=uc.g0_256,uN=uc.g1_256,kx=tN.BlockHash,lN=[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 yo(){if(!(this instanceof yo))return new yo;kx.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=lN,this.W=new Array(64)}o(yo,"SHA256");cc.inherits(yo,kx);Ix.exports=yo;yo.blockSize=512;yo.outSize=256;yo.hmacStrength=192;yo.padLength=64;yo.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]=nN(uN(n[i-2]),n[i-7],cN(n[i-15]),n[i-16]);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],v=this.h[4],x=this.h[5],E=this.h[6],O=this.h[7];for(rN(this.k.length===n.length),i=0;i<n.length;i++){var R=iN(O,fN(v),oN(v,x,E),this.k[i],n[i]),I=Ki(aN(s),sN(s,f,u));O=E,E=x,x=v,v=Ki(d,R),d=u,u=f,f=s,s=Ki(R,I)}this.h[0]=Ki(this.h[0],s),this.h[1]=Ki(this.h[1],f),this.h[2]=Ki(this.h[2],u),this.h[3]=Ki(this.h[3],d),this.h[4]=Ki(this.h[4],v),this.h[5]=Ki(this.h[5],x),this.h[6]=Ki(this.h[6],E),this.h[7]=Ki(this.h[7],O)},"_update");yo.prototype._digest=o(function(e){return e==="hex"?cc.toHex32(this.h,"big"):cc.split32(this.h,"big")},"digest")});var Ox=Re((GV,Rx)=>{"use strict";var D1=ji(),Dx=I1();function ns(){if(!(this instanceof ns))return new ns;Dx.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(ns,"SHA224");D1.inherits(ns,Dx);Rx.exports=ns;ns.blockSize=512;ns.outSize=224;ns.hmacStrength=192;ns.padLength=64;ns.prototype._digest=o(function(e){return e==="hex"?D1.toHex32(this.h.slice(0,7),"big"):D1.split32(this.h.slice(0,7),"big")},"digest")});var N1=Re((WV,Lx)=>{"use strict";var En=ji(),hN=ac(),dN=$s(),xo=En.rotr64_hi,wo=En.rotr64_lo,Nx=En.shr64_hi,Px=En.shr64_lo,zs=En.sum64,R1=En.sum64_hi,O1=En.sum64_lo,pN=En.sum64_4_hi,mN=En.sum64_4_lo,bN=En.sum64_5_hi,gN=En.sum64_5_lo,Bx=hN.BlockHash,vN=[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 Vi(){if(!(this instanceof Vi))return new Vi;Bx.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=vN,this.W=new Array(160)}o(Vi,"SHA512");En.inherits(Vi,Bx);Lx.exports=Vi;Vi.blockSize=1024;Vi.outSize=512;Vi.hmacStrength=192;Vi.padLength=128;Vi.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=kN(n[i-4],n[i-3]),f=IN(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],v=TN(n[i-30],n[i-29]),x=CN(n[i-30],n[i-29]),E=n[i-32],O=n[i-31];n[i]=pN(s,f,u,d,v,x,E,O),n[i+1]=mN(s,f,u,d,v,x,E,O)}},"_prepareBlock");Vi.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],v=this.h[5],x=this.h[6],E=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],B=this.h[11],Y=this.h[12],P=this.h[13],J=this.h[14],ee=this.h[15];dN(this.k.length===n.length);for(var X=0;X<n.length;X+=2){var ne=J,V=ee,H=SN(O,R),z=MN(O,R),he=yN(O,R,I,B,Y,P),L=xN(O,R,I,B,Y,P),h=this.k[X],g=this.k[X+1],b=n[X],l=n[X+1],m=bN(ne,V,H,z,he,L,h,g,b,l),_=gN(ne,V,H,z,he,L,h,g,b,l);ne=EN(i,s),V=AN(i,s),H=wN(i,s,f,u,d,v),z=_N(i,s,f,u,d,v);var M=R1(ne,V,H,z),S=O1(ne,V,H,z);J=Y,ee=P,Y=I,P=B,I=O,B=R,O=R1(x,E,m,_),R=O1(E,E,m,_),x=d,E=v,d=f,v=u,f=i,u=s,i=R1(m,_,M,S),s=O1(m,_,M,S)}zs(this.h,0,i,s),zs(this.h,2,f,u),zs(this.h,4,d,v),zs(this.h,6,x,E),zs(this.h,8,O,R),zs(this.h,10,I,B),zs(this.h,12,Y,P),zs(this.h,14,J,ee)},"_update");Vi.prototype._digest=o(function(e){return e==="hex"?En.toHex32(this.h,"big"):En.split32(this.h,"big")},"digest");function yN(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(yN,"ch64_hi");function xN(r,e,t,n,i,s){var f=e&n^~e&s;return f<0&&(f+=4294967296),f}o(xN,"ch64_lo");function wN(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(wN,"maj64_hi");function _N(r,e,t,n,i,s){var f=e&n^e&s^n&s;return f<0&&(f+=4294967296),f}o(_N,"maj64_lo");function EN(r,e){var t=xo(r,e,28),n=xo(e,r,2),i=xo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(EN,"s0_512_hi");function AN(r,e){var t=wo(r,e,28),n=wo(e,r,2),i=wo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(AN,"s0_512_lo");function SN(r,e){var t=xo(r,e,14),n=xo(r,e,18),i=xo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(SN,"s1_512_hi");function MN(r,e){var t=wo(r,e,14),n=wo(r,e,18),i=wo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(MN,"s1_512_lo");function TN(r,e){var t=xo(r,e,1),n=xo(r,e,8),i=Nx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(TN,"g0_512_hi");function CN(r,e){var t=wo(r,e,1),n=wo(r,e,8),i=Px(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(CN,"g0_512_lo");function kN(r,e){var t=xo(r,e,19),n=xo(e,r,29),i=Nx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(kN,"g1_512_hi");function IN(r,e){var t=wo(r,e,19),n=wo(e,r,29),i=Px(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(IN,"g1_512_lo")});var $x=Re((JV,Fx)=>{"use strict";var P1=ji(),Ux=N1();function is(){if(!(this instanceof is))return new is;Ux.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(is,"SHA384");P1.inherits(is,Ux);Fx.exports=is;is.blockSize=1024;is.outSize=384;is.hmacStrength=192;is.padLength=128;is.prototype._digest=o(function(e){return e==="hex"?P1.toHex32(this.h.slice(0,12),"big"):P1.split32(this.h.slice(0,12),"big")},"digest")});var qx=Re(lc=>{"use strict";lc.sha1=Cx();lc.sha224=Ox();lc.sha256=I1();lc.sha384=$x();lc.sha512=N1()});var Gx=Re(Vx=>{"use strict";var Ha=ji(),DN=ac(),yd=Ha.rotl32,Hx=Ha.sum32,zu=Ha.sum32_3,zx=Ha.sum32_4,Kx=DN.BlockHash;function _o(){if(!(this instanceof _o))return new _o;Kx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(_o,"RIPEMD160");Ha.inherits(_o,Kx);Vx.ripemd160=_o;_o.blockSize=512;_o.outSize=160;_o.hmacStrength=192;_o.padLength=64;_o.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,v=i,x=s,E=f,O=u,R=0;R<80;R++){var I=Hx(yd(zx(n,jx(R,i,s,f),e[NN[R]+t],RN(R)),BN[R]),u);n=u,u=f,f=yd(s,10),s=i,i=I,I=Hx(yd(zx(d,jx(79-R,v,x,E),e[PN[R]+t],ON(R)),LN[R]),O),d=O,O=E,E=yd(x,10),x=v,v=I}I=zu(this.h[1],s,E),this.h[1]=zu(this.h[2],f,O),this.h[2]=zu(this.h[3],u,d),this.h[3]=zu(this.h[4],n,v),this.h[4]=zu(this.h[0],i,x),this.h[0]=I},"update");_o.prototype._digest=o(function(e){return e==="hex"?Ha.toHex32(this.h,"little"):Ha.split32(this.h,"little")},"digest");function jx(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(jx,"f");function RN(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(RN,"K");function ON(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(ON,"Kh");var NN=[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],PN=[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],BN=[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],LN=[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 Jx=Re((ZV,Wx)=>{"use strict";var UN=ji(),FN=$s();function hc(r,e,t){if(!(this instanceof hc))return new hc(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(hc,"Hmac");Wx.exports=hc;hc.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),FN(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");hc.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");hc.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var ju=Re(Yx=>{var Hr=Yx;Hr.utils=ji();Hr.common=ac();Hr.sha=qx();Hr.ripemd=Gx();Hr.hmac=Jx();Hr.sha1=Hr.sha.sha1;Hr.sha256=Hr.sha.sha256;Hr.sha224=Hr.sha.sha224;Hr.sha384=Hr.sha.sha384;Hr.sha512=Hr.sha.sha512;Hr.ripemd160=Hr.ripemd.ripemd160});var Zx=Re((eG,Xx)=>{Xx.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 xd=Re(t6=>{"use strict";var L1=t6,js=ju(),B1=T1(),$N=jn(),Qx=$N.assert;function e6(r){r.type==="short"?this.curve=new B1.short(r):r.type==="edwards"?this.curve=new B1.edwards(r):this.curve=new B1.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,Qx(this.g.validate(),"Invalid curve"),Qx(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(e6,"PresetCurve");L1.PresetCurve=e6;function Ks(r,e){Object.defineProperty(L1,r,{configurable:!0,enumerable:!0,get:function(){var t=new e6(e);return Object.defineProperty(L1,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(Ks,"defineCurve");Ks("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:js.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Ks("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:js.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Ks("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:js.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Ks("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:js.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"]});Ks("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:js.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"]});Ks("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:js.sha256,gRed:!1,g:["9"]});Ks("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:js.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var U1;try{U1=Zx()}catch{U1=void 0}Ks("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:js.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",U1]})});var i6=Re((rG,n6)=>{"use strict";var qN=ju(),za=x1(),r6=$s();function Vs(r){if(!(this instanceof Vs))return new Vs(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=za.toArray(r.entropy,r.entropyEnc||"hex"),t=za.toArray(r.nonce,r.nonceEnc||"hex"),n=za.toArray(r.pers,r.persEnc||"hex");r6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(Vs,"HmacDRBG");n6.exports=Vs;Vs.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");Vs.prototype._hmac=o(function(){return new qN.hmac(this.hash,this.K)},"hmac");Vs.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");Vs.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=za.toArray(e,t),n=za.toArray(n,i),r6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Vs.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=za.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++,za.encode(f,t)},"generate")});var s6=Re((nG,o6)=>{"use strict";var HN=mo(),zN=jn(),F1=zN.assert;function Yr(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(Yr,"KeyPair");o6.exports=Yr;Yr.fromPublic=o(function(e,t,n){return t instanceof Yr?t:new Yr(e,{pub:t,pubEnc:n})},"fromPublic");Yr.fromPrivate=o(function(e,t,n){return t instanceof Yr?t:new Yr(e,{priv:t,privEnc:n})},"fromPrivate");Yr.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");Yr.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");Yr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Yr.prototype._importPrivate=o(function(e,t){this.priv=new HN(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Yr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?F1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&F1(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");Yr.prototype.derive=o(function(e){return e.validate()||F1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Yr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");Yr.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");Yr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var c6=Re((iG,f6)=>{"use strict";var wd=mo(),H1=jn(),jN=H1.assert;function _d(r,e){if(r instanceof _d)return r;this._importDER(r,e)||(jN(r.r&&r.s,"Signature without r or s"),this.r=new wd(r.r,16),this.s=new wd(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(_d,"Signature");f6.exports=_d;function KN(){this.place=0}o(KN,"Position");function $1(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($1,"getLength");function a6(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(a6,"rmPadding");_d.prototype._importDER=o(function(e,t){e=H1.toArray(e,t);var n=new KN;if(e[n.place++]!==48)return!1;var i=$1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=$1(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=$1(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 wd(f),this.s=new wd(d),this.recoveryParam=null,!0},"_importDER");function q1(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(q1,"constructLength");_d.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=a6(t),n=a6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];q1(i,t.length),i=i.concat(t),i.push(2),q1(i,n.length);var s=i.concat(n),f=[48];return q1(f,s.length),f=f.concat(s),H1.encode(f,e)},"toDER")});var h6=Re((oG,l6)=>{"use strict";var Gi=mo(),u6=i6(),VN=jn(),z1=xd(),GN=A1(),ja=VN.assert,j1=s6(),Ed=c6();function Ei(r){if(!(this instanceof Ei))return new Ei(r);typeof r=="string"&&(ja(Object.prototype.hasOwnProperty.call(z1,r),"Unknown curve "+r),r=z1[r]),r instanceof z1.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(Ei,"EC");l6.exports=Ei;Ei.prototype.keyPair=o(function(e){return new j1(this,e)},"keyPair");Ei.prototype.keyFromPrivate=o(function(e,t){return j1.fromPrivate(this,e,t)},"keyFromPrivate");Ei.prototype.keyFromPublic=o(function(e,t){return j1.fromPublic(this,e,t)},"keyFromPublic");Ei.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new u6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||GN(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Gi(2));;){var s=new Gi(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");Ei.prototype._truncateToN=o(function(e,t,n){var i;if(Gi.isBN(e)||typeof e=="number")e=new Gi(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new Gi(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new Gi(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");Ei.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!Gi.isBN(e)){ja(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),ja(e.length>>>0===e.length);for(var s=0;s<e.length;s++)ja((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),ja(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);ja(new Gi(d).eq(e),"Can not sign message");for(var v=new u6({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),x=this.n.sub(new Gi(1)),E=0;;E++){var O=i.k?i.k(E):new Gi(v.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(x)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new Ed({r:B,s:Y,recoveryParam:P})}}}}}},"sign");Ei.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new Ed(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),v=d.mul(e).umod(this.n),x=d.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)},"verify");Ei.prototype.recoverPubKey=function(r,e,t,n){ja((3&t)===t,"The recovery param is more than two bits"),e=new Ed(e,n);var i=this.n,s=new Gi(r),f=e.r,u=e.s,d=t&1,v=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var x=e.r.invm(i),E=i.sub(s).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(E,f,O)};Ei.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Ed(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 b6=Re((sG,m6)=>{"use strict";var Ku=jn(),p6=Ku.assert,d6=Ku.parseBytes,dc=Ku.cachedProperty;function Rr(r,e){this.eddsa=r,this._secret=d6(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=d6(e.pub)}o(Rr,"KeyPair");Rr.fromPublic=o(function(e,t){return t instanceof Rr?t:new Rr(e,{pub:t})},"fromPublic");Rr.fromSecret=o(function(e,t){return t instanceof Rr?t:new Rr(e,{secret:t})},"fromSecret");Rr.prototype.secret=o(function(){return this._secret},"secret");dc(Rr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));dc(Rr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));dc(Rr,"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"));dc(Rr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));dc(Rr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));dc(Rr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Rr.prototype.sign=o(function(e){return p6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Rr.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Rr.prototype.getSecret=o(function(e){return p6(this._secret,"KeyPair is public only"),Ku.encode(this.secret(),e)},"getSecret");Rr.prototype.getPublic=o(function(e){return Ku.encode(this.pubBytes(),e)},"getPublic");m6.exports=Rr});var y6=Re((aG,v6)=>{"use strict";var WN=mo(),Ad=jn(),g6=Ad.assert,Sd=Ad.cachedProperty,JN=Ad.parseBytes;function Ka(r,e){this.eddsa=r,typeof e!="object"&&(e=JN(e)),Array.isArray(e)&&(g6(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),g6(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof WN&&(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(Ka,"Signature");Sd(Ka,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));Sd(Ka,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));Sd(Ka,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));Sd(Ka,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Ka.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Ka.prototype.toHex=o(function(){return Ad.encode(this.toBytes(),"hex").toUpperCase()},"toHex");v6.exports=Ka});var A6=Re((fG,E6)=>{"use strict";var YN=ju(),XN=xd(),pc=jn(),ZN=pc.assert,w6=pc.parseBytes,_6=b6(),x6=y6();function An(r){if(ZN(r==="ed25519","only tested with ed25519 so far"),!(this instanceof An))return new An(r);r=XN[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=YN.sha512}o(An,"EDDSA");E6.exports=An;An.prototype.sign=o(function(e,t){e=w6(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");An.prototype.verify=o(function(e,t,n){if(e=w6(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");An.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return pc.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");An.prototype.keyFromPublic=o(function(e){return _6.fromPublic(this,e)},"keyFromPublic");An.prototype.keyFromSecret=o(function(e){return _6.fromSecret(this,e)},"keyFromSecret");An.prototype.makeSignature=o(function(e){return e instanceof x6?e:new x6(this,e)},"makeSignature");An.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");An.prototype.decodePoint=o(function(e){e=pc.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=pc.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");An.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");An.prototype.decodeInt=o(function(e){return pc.intFromLE(e)},"decodeInt");An.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var M6=Re(S6=>{"use strict";var Va=S6;Va.version=ex().version;Va.utils=jn();Va.rand=A1();Va.curve=T1();Va.curves=xd();Va.ec=h6();Va.eddsa=A6()});var C6=Re(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.BrowserRandomSource=void 0;var T6=65536,Md=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+=T6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,T6)));return t}};o(Md,"BrowserRandomSource");Td.BrowserRandomSource=Md});var k6=Re(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.NodeRandomSource=void 0;var QN=xi(),Cd=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,QN.wipe)(t),n}};o(Cd,"NodeRandomSource");kd.NodeRandomSource=Cd});var I6=Re(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.SystemRandomSource=void 0;var eP=C6(),tP=k6(),Id=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new eP.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new tP.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(Id,"SystemRandomSource");Dd.SystemRandomSource=Id});var Ga=Re(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.randomStringForEntropy=Xr.randomString=Xr.randomUint32=Xr.randomBytes=Xr.defaultRandomSource=void 0;var rP=I6(),nP=$a(),D6=xi();Xr.defaultRandomSource=new rP.SystemRandomSource;function K1(r,e=Xr.defaultRandomSource){return e.randomBytes(r)}o(K1,"randomBytes");Xr.randomBytes=K1;function iP(r=Xr.defaultRandomSource){let e=K1(4,r),t=(0,nP.readUint32LE)(e);return(0,D6.wipe)(e),t}o(iP,"randomUint32");Xr.randomUint32=iP;var R6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function O6(r,e=R6,t=Xr.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=K1(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,D6.wipe)(f)}return n}o(O6,"randomString");Xr.randomString=O6;function oP(r,e=R6,t=Xr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return O6(n,e,t)}o(oP,"randomStringForEntropy");Xr.randomStringForEntropy=oP});var B6=Re(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var bc=$a(),mc=xi();os.DIGEST_LENGTH=64;os.BLOCK_SIZE=128;var P6=function(){function r(){this.digestLength=os.DIGEST_LENGTH,this.blockSize=os.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(){mc.wipe(this._buffer),mc.wipe(this._tempHi),mc.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<os.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(V1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=V1(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;bc.writeUint32BE(i,this._buffer,f-8),bc.writeUint32BE(s,this._buffer,f-4),V1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)bc.writeUint32BE(this._stateHi[u],e,u*8),bc.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){mc.wipe(e.stateHi),mc.wipe(e.stateLo),e.buffer&&mc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();os.SHA512=P6;var N6=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 V1(r,e,t,n,i,s,f){for(var u=t[0],d=t[1],v=t[2],x=t[3],E=t[4],O=t[5],R=t[6],I=t[7],B=n[0],Y=n[1],P=n[2],J=n[3],ee=n[4],X=n[5],ne=n[6],V=n[7],H,z,he,L,h,g,b,l;f>=128;){for(var m=0;m<16;m++){var _=8*m+s;r[m]=bc.readUint32BE(i,_),e[m]=bc.readUint32BE(i,_+4)}for(var m=0;m<80;m++){var M=u,S=d,y=v,C=x,N=E,w=O,k=R,fe=I,D=B,Q=Y,se=P,q=J,j=ee,G=X,te=ne,ae=V;if(H=I,z=V,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=(E>>>14|ee<<32-14)^(E>>>18|ee<<32-18)^(ee>>>41-32|E<<32-(41-32)),z=(ee>>>14|E<<32-14)^(ee>>>18|E<<32-18)^(E>>>41-32|ee<<32-(41-32)),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=E&O^~E&R,z=ee&X^~ee&ne,h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=N6[m*2],z=N6[m*2+1],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=r[m%16],z=e[m%16],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,he=b&65535|l<<16,L=h&65535|g<<16,H=he,z=L,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=(u>>>28|B<<32-28)^(B>>>34-32|u<<32-(34-32))^(B>>>39-32|u<<32-(39-32)),z=(B>>>28|u<<32-28)^(u>>>34-32|B<<32-(34-32))^(u>>>39-32|B<<32-(39-32)),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,H=u&d^u&v^d&v,z=B&Y^B&P^Y&P,h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,fe=b&65535|l<<16,ae=h&65535|g<<16,H=C,z=q,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=he,z=L,h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,C=b&65535|l<<16,q=h&65535|g<<16,d=M,v=S,x=y,E=C,O=N,R=w,I=k,u=fe,Y=D,P=Q,J=se,ee=q,X=j,ne=G,V=te,B=ae,m%16===15)for(var _=0;_<16;_++)H=r[_],z=e[_],h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=r[(_+9)%16],z=e[(_+9)%16],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,he=r[(_+1)%16],L=e[(_+1)%16],H=(he>>>1|L<<32-1)^(he>>>8|L<<32-8)^he>>>7,z=(L>>>1|he<<32-1)^(L>>>8|he<<32-8)^(L>>>7|he<<32-7),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,he=r[(_+14)%16],L=e[(_+14)%16],H=(he>>>19|L<<32-19)^(L>>>61-32|he<<32-(61-32))^he>>>6,z=(L>>>19|he<<32-19)^(he>>>61-32|L<<32-(61-32))^(L>>>6|he<<32-6),h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,r[_]=b&65535|l<<16,e[_]=h&65535|g<<16}H=u,z=B,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[0],z=n[0],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[0]=u=b&65535|l<<16,n[0]=B=h&65535|g<<16,H=d,z=Y,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[1],z=n[1],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[1]=d=b&65535|l<<16,n[1]=Y=h&65535|g<<16,H=v,z=P,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[2],z=n[2],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[2]=v=b&65535|l<<16,n[2]=P=h&65535|g<<16,H=x,z=J,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[3],z=n[3],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[3]=x=b&65535|l<<16,n[3]=J=h&65535|g<<16,H=E,z=ee,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[4],z=n[4],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[4]=E=b&65535|l<<16,n[4]=ee=h&65535|g<<16,H=O,z=X,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[5],z=n[5],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[5]=O=b&65535|l<<16,n[5]=X=h&65535|g<<16,H=R,z=ne,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[6],z=n[6],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[6]=R=b&65535|l<<16,n[6]=ne=h&65535|g<<16,H=I,z=V,h=z&65535,g=z>>>16,b=H&65535,l=H>>>16,H=t[7],z=n[7],h+=z&65535,g+=z>>>16,b+=H&65535,l+=H>>>16,g+=h>>>16,b+=g>>>16,l+=b>>>16,t[7]=I=b&65535|l<<16,n[7]=V=h&65535|g<<16,s+=128,f-=128}return s}o(V1,"hashBlocks");function sP(r){var e=new P6;e.update(r);var t=e.digest();return e.clean(),t}o(sP,"hash");os.hash=sP});var Rd=Re(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.convertSecretKeyToX25519=Gt.convertPublicKeyToX25519=Gt.verify=Gt.sign=Gt.extractPublicKeyFromSecretKey=Gt.generateKeyPair=Gt.generateKeyPairFromSeed=Gt.SEED_LENGTH=Gt.SECRET_KEY_LENGTH=Gt.PUBLIC_KEY_LENGTH=Gt.SIGNATURE_LENGTH=void 0;var aP=Ga(),Vu=B6(),q6=xi();Gt.SIGNATURE_LENGTH=64;Gt.PUBLIC_KEY_LENGTH=32;Gt.SECRET_KEY_LENGTH=64;Gt.SEED_LENGTH=32;function We(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(We,"gf");var fP=new Uint8Array(32);fP[0]=9;var J1=We(),gc=We([1]),cP=We([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),uP=We([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),L6=We([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),U6=We([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),lP=We([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Gs(r,e){for(let t=0;t<16;t++)r[t]=e[t]|0}o(Gs,"set25519");function G1(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(G1,"car25519");function H6(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(H6,"sel25519");function Gu(r,e){let t=We(),n=We();for(let i=0;i<16;i++)n[i]=e[i];G1(n),G1(n),G1(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,H6(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(Gu,"pack25519");function z6(r,e){let t=0;for(let n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(z6,"verify32");function F6(r,e){let t=new Uint8Array(32),n=new Uint8Array(32);return Gu(t,r),Gu(n,e),z6(t,n)}o(F6,"neq25519");function j6(r){let e=new Uint8Array(32);return Gu(e,r),e[0]&1}o(j6,"par25519");function hP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(hP,"unpack25519");function Wa(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Wa,"add");function Ya(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ya,"sub");function Zt(r,e,t){let n,i,s=0,f=0,u=0,d=0,v=0,x=0,E=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,X=0,ne=0,V=0,H=0,z=0,he=0,L=0,h=0,g=0,b=0,l=0,m=0,_=0,M=0,S=0,y=0,C=t[0],N=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],j=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*w,d+=n*k,v+=n*fe,x+=n*D,E+=n*Q,O+=n*se,R+=n*q,I+=n*j,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,X+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*w,v+=n*k,x+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*j,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,X+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,v+=n*w,x+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*j,P+=n*G,J+=n*te,ee+=n*ae,X+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,v+=n*N,x+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*j,J+=n*G,ee+=n*te,X+=n*ae,ne+=n*Ae,V+=n*ge,H+=n*ie,n=e[4],v+=n*C,x+=n*N,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*j,ee+=n*G,X+=n*te,ne+=n*ae,V+=n*Ae,H+=n*ge,z+=n*ie,n=e[5],x+=n*C,E+=n*N,O+=n*w,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*j,X+=n*G,ne+=n*te,V+=n*ae,H+=n*Ae,z+=n*ge,he+=n*ie,n=e[6],E+=n*C,O+=n*N,R+=n*w,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,X+=n*j,ne+=n*G,V+=n*te,H+=n*ae,z+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*w,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,X+=n*q,ne+=n*j,V+=n*G,H+=n*te,z+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*w,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,X+=n*se,ne+=n*q,V+=n*j,H+=n*G,z+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,g+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*w,P+=n*k,J+=n*fe,ee+=n*D,X+=n*Q,ne+=n*se,V+=n*q,H+=n*j,z+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,g+=n*ge,b+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*w,J+=n*k,ee+=n*fe,X+=n*D,ne+=n*Q,V+=n*se,H+=n*q,z+=n*j,he+=n*G,L+=n*te,h+=n*ae,g+=n*Ae,b+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*w,ee+=n*k,X+=n*fe,ne+=n*D,V+=n*Q,H+=n*se,z+=n*q,he+=n*j,L+=n*G,h+=n*te,g+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*w,X+=n*k,ne+=n*fe,V+=n*D,H+=n*Q,z+=n*se,he+=n*q,L+=n*j,h+=n*G,g+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ie,n=e[13],J+=n*C,ee+=n*N,X+=n*w,ne+=n*k,V+=n*fe,H+=n*D,z+=n*Q,he+=n*se,L+=n*q,h+=n*j,g+=n*G,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,M+=n*ie,n=e[14],ee+=n*C,X+=n*N,ne+=n*w,V+=n*k,H+=n*fe,z+=n*D,he+=n*Q,L+=n*se,h+=n*q,g+=n*j,b+=n*G,l+=n*te,m+=n*ae,_+=n*Ae,M+=n*ge,S+=n*ie,n=e[15],X+=n*C,ne+=n*N,V+=n*w,H+=n*k,z+=n*fe,he+=n*D,L+=n*Q,h+=n*se,g+=n*q,b+=n*j,l+=n*G,m+=n*te,_+=n*ae,M+=n*Ae,S+=n*ge,y+=n*ie,s+=38*ne,f+=38*V,u+=38*H,d+=38*z,v+=38*he,x+=38*L,E+=38*h,O+=38*g,R+=38*b,I+=38*l,B+=38*m,Y+=38*_,P+=38*M,J+=38*S,ee+=38*y,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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=v,r[5]=x,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=X}o(Zt,"mul");function Ja(r,e){Zt(r,e,e)}o(Ja,"square");function K6(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Ja(t,t),n!==2&&n!==4&&Zt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(K6,"inv25519");function dP(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Ja(t,t),n!==1&&Zt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(dP,"pow2523");function Y1(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We(),v=We(),x=We();Ya(t,r[1],r[0]),Ya(x,e[1],e[0]),Zt(t,t,x),Wa(n,r[0],r[1]),Wa(x,e[0],e[1]),Zt(n,n,x),Zt(i,r[3],e[3]),Zt(i,i,uP),Zt(s,r[2],e[2]),Wa(s,s,s),Ya(f,n,t),Ya(u,s,i),Wa(d,s,i),Wa(v,n,t),Zt(r[0],f,u),Zt(r[1],v,d),Zt(r[2],d,u),Zt(r[3],f,v)}o(Y1,"edadd");function $6(r,e,t){for(let n=0;n<4;n++)H6(r[n],e[n],t)}o($6,"cswap");function Z1(r,e){let t=We(),n=We(),i=We();K6(i,e[2]),Zt(t,e[0],i),Zt(n,e[1],i),Gu(r,n),r[31]^=j6(t)<<7}o(Z1,"pack");function V6(r,e,t){Gs(r[0],J1),Gs(r[1],gc),Gs(r[2],gc),Gs(r[3],J1);for(let n=255;n>=0;--n){let i=t[n/8|0]>>(n&7)&1;$6(r,e,i),Y1(e,r),Y1(r,r),$6(r,e,i)}}o(V6,"scalarmult");function Q1(r,e){let t=[We(),We(),We(),We()];Gs(t[0],L6),Gs(t[1],U6),Gs(t[2],gc),Zt(t[3],L6,U6),V6(r,t,e)}o(Q1,"scalarbase");function G6(r){if(r.length!==Gt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Gt.SEED_LENGTH} bytes`);let e=(0,Vu.hash)(r);e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(32),n=[We(),We(),We(),We()];Q1(n,e),Z1(t,n);let i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(G6,"generateKeyPairFromSeed");Gt.generateKeyPairFromSeed=G6;function pP(r){let e=(0,aP.randomBytes)(32,r),t=G6(e);return(0,q6.wipe)(e),t}o(pP,"generateKeyPair");Gt.generateKeyPair=pP;function mP(r){if(r.length!==Gt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Gt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(r.subarray(32))}o(mP,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=mP;var W1=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 W6(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]*W1[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)*W1[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*W1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(W6,"modL");function X1(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;W6(r,e)}o(X1,"reduce");function bP(r,e){let t=new Float64Array(64),n=[We(),We(),We(),We()],i=(0,Vu.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 Vu.SHA512;f.update(s.subarray(32)),f.update(e);let u=f.digest();f.clean(),X1(u),Q1(n,u),Z1(s,n),f.reset(),f.update(s.subarray(0,32)),f.update(r.subarray(32)),f.update(e);let d=f.digest();X1(d);for(let v=0;v<32;v++)t[v]=u[v];for(let v=0;v<32;v++)for(let x=0;x<32;x++)t[v+x]+=d[v]*i[x];return W6(s.subarray(32),t),s}o(bP,"sign");Gt.sign=bP;function J6(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We();return Gs(r[2],gc),hP(r[1],e),Ja(i,r[1]),Zt(s,i,cP),Ya(i,i,r[2]),Wa(s,r[2],s),Ja(f,s),Ja(u,f),Zt(d,u,f),Zt(t,d,i),Zt(t,t,s),dP(t,t),Zt(t,t,i),Zt(t,t,s),Zt(t,t,s),Zt(r[0],t,s),Ja(n,r[0]),Zt(n,n,s),F6(n,i)&&Zt(r[0],r[0],lP),Ja(n,r[0]),Zt(n,n,s),F6(n,i)?-1:(j6(r[0])===e[31]>>7&&Ya(r[0],J1,r[0]),Zt(r[3],r[0],r[1]),0)}o(J6,"unpackneg");function gP(r,e,t){let n=new Uint8Array(32),i=[We(),We(),We(),We()],s=[We(),We(),We(),We()];if(t.length!==Gt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Gt.SIGNATURE_LENGTH} bytes`);if(J6(s,r))return!1;let f=new Vu.SHA512;f.update(t.subarray(0,32)),f.update(r),f.update(e);let u=f.digest();return X1(u),V6(i,s,u),Q1(s,t.subarray(32)),Y1(i,s),Z1(n,i),!z6(t,n)}o(gP,"verify");Gt.verify=gP;function vP(r){let e=[We(),We(),We(),We()];if(J6(e,r))throw new Error("Ed25519: invalid public key");let t=We(),n=We(),i=e[1];Wa(t,gc,i),Ya(n,gc,i),K6(n,n),Zt(t,t,n);let s=new Uint8Array(32);return Gu(s,t),s}o(vP,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=vP;function yP(r){let e=(0,Vu.hash)(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(e.subarray(0,32));return(0,q6.wipe)(e),t}o(yP,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=yP});var X6=Re((bG,Y6)=>{"use strict";Y6.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 tw=Re(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.sharedKey=pr.generateKeyPair=pr.generateKeyPairFromSeed=pr.scalarMultBase=pr.scalarMult=pr.SHARED_KEY_LENGTH=pr.SECRET_KEY_LENGTH=pr.PUBLIC_KEY_LENGTH=void 0;var xP=Ga(),wP=xi();pr.PUBLIC_KEY_LENGTH=32;pr.SECRET_KEY_LENGTH=32;pr.SHARED_KEY_LENGTH=32;function Eo(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(Eo,"gf");var Z6=new Uint8Array(32);Z6[0]=9;var _P=Eo([56129,1]);function eb(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(eb,"car25519");function Wu(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(Wu,"sel25519");function EP(r,e){let t=Eo(),n=Eo();for(let i=0;i<16;i++)n[i]=e[i];eb(n),eb(n),eb(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,Wu(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(EP,"pack25519");function AP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(AP,"unpack25519");function Od(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Od,"add");function Nd(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Nd,"sub");function ss(r,e,t){let n,i,s=0,f=0,u=0,d=0,v=0,x=0,E=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,X=0,ne=0,V=0,H=0,z=0,he=0,L=0,h=0,g=0,b=0,l=0,m=0,_=0,M=0,S=0,y=0,C=t[0],N=t[1],w=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],j=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*w,d+=n*k,v+=n*fe,x+=n*D,E+=n*Q,O+=n*se,R+=n*q,I+=n*j,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,X+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*w,v+=n*k,x+=n*fe,E+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*j,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,X+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,v+=n*w,x+=n*k,E+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*j,P+=n*G,J+=n*te,ee+=n*ae,X+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,v+=n*N,x+=n*w,E+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*j,J+=n*G,ee+=n*te,X+=n*ae,ne+=n*Ae,V+=n*ge,H+=n*ie,n=e[4],v+=n*C,x+=n*N,E+=n*w,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*j,ee+=n*G,X+=n*te,ne+=n*ae,V+=n*Ae,H+=n*ge,z+=n*ie,n=e[5],x+=n*C,E+=n*N,O+=n*w,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*j,X+=n*G,ne+=n*te,V+=n*ae,H+=n*Ae,z+=n*ge,he+=n*ie,n=e[6],E+=n*C,O+=n*N,R+=n*w,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,X+=n*j,ne+=n*G,V+=n*te,H+=n*ae,z+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*w,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,X+=n*q,ne+=n*j,V+=n*G,H+=n*te,z+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*w,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,X+=n*se,ne+=n*q,V+=n*j,H+=n*G,z+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,g+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*w,P+=n*k,J+=n*fe,ee+=n*D,X+=n*Q,ne+=n*se,V+=n*q,H+=n*j,z+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,g+=n*ge,b+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*w,J+=n*k,ee+=n*fe,X+=n*D,ne+=n*Q,V+=n*se,H+=n*q,z+=n*j,he+=n*G,L+=n*te,h+=n*ae,g+=n*Ae,b+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*w,ee+=n*k,X+=n*fe,ne+=n*D,V+=n*Q,H+=n*se,z+=n*q,he+=n*j,L+=n*G,h+=n*te,g+=n*ae,b+=n*Ae,l+=n*ge,m+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*w,X+=n*k,ne+=n*fe,V+=n*D,H+=n*Q,z+=n*se,he+=n*q,L+=n*j,h+=n*G,g+=n*te,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*ie,n=e[13],J+=n*C,ee+=n*N,X+=n*w,ne+=n*k,V+=n*fe,H+=n*D,z+=n*Q,he+=n*se,L+=n*q,h+=n*j,g+=n*G,b+=n*te,l+=n*ae,m+=n*Ae,_+=n*ge,M+=n*ie,n=e[14],ee+=n*C,X+=n*N,ne+=n*w,V+=n*k,H+=n*fe,z+=n*D,he+=n*Q,L+=n*se,h+=n*q,g+=n*j,b+=n*G,l+=n*te,m+=n*ae,_+=n*Ae,M+=n*ge,S+=n*ie,n=e[15],X+=n*C,ne+=n*N,V+=n*w,H+=n*k,z+=n*fe,he+=n*D,L+=n*Q,h+=n*se,g+=n*q,b+=n*j,l+=n*G,m+=n*te,_+=n*ae,M+=n*Ae,S+=n*ge,y+=n*ie,s+=38*ne,f+=38*V,u+=38*H,d+=38*z,v+=38*he,x+=38*L,E+=38*h,O+=38*g,R+=38*b,I+=38*l,B+=38*m,Y+=38*_,P+=38*M,J+=38*S,ee+=38*y,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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=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=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=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=X+i+65535,i=Math.floor(n/65536),X=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=v,r[5]=x,r[6]=E,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=X}o(ss,"mul");function Ju(r,e){ss(r,e,e)}o(Ju,"square");function SP(r,e){let t=Eo();for(let n=0;n<16;n++)t[n]=e[n];for(let n=253;n>=0;n--)Ju(t,t),n!==2&&n!==4&&ss(t,t,e);for(let n=0;n<16;n++)r[n]=t[n]}o(SP,"inv25519");function tb(r,e){let t=new Uint8Array(32),n=new Float64Array(80),i=Eo(),s=Eo(),f=Eo(),u=Eo(),d=Eo(),v=Eo();for(let R=0;R<31;R++)t[R]=r[R];t[31]=r[31]&127|64,t[0]&=248,AP(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;Wu(i,s,I),Wu(f,u,I),Od(d,i,f),Nd(i,i,f),Od(f,s,u),Nd(s,s,u),Ju(u,d),Ju(v,i),ss(i,f,i),ss(f,s,d),Od(d,i,f),Nd(i,i,f),Ju(s,i),Nd(f,u,v),ss(i,f,_P),Od(i,i,u),ss(f,f,i),ss(i,u,v),ss(u,s,n),Ju(s,d),Wu(i,s,I),Wu(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 x=n.subarray(32),E=n.subarray(16);SP(x,x),ss(E,E,x);let O=new Uint8Array(32);return EP(O,E),O}o(tb,"scalarMult");pr.scalarMult=tb;function Q6(r){return tb(r,Z6)}o(Q6,"scalarMultBase");pr.scalarMultBase=Q6;function ew(r){if(r.length!==pr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${pr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(r);return{publicKey:Q6(e),secretKey:e}}o(ew,"generateKeyPairFromSeed");pr.generateKeyPairFromSeed=ew;function MP(r){let e=(0,xP.randomBytes)(32,r),t=ew(e);return(0,wP.wipe)(e),t}o(MP,"generateKeyPair");pr.generateKeyPair=MP;function TP(r,e,t=!1){if(r.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=tb(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(TP,"sharedKey");pr.sharedKey=TP});var nb=Re(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var Zr=$a(),rb=xi(),CP=20;function kP(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],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],x=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],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=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,X=i,ne=s,V=f,H=u,z=d,he=v,L=x,h=E,g=O,b=R,l=I,m=B,_=Y,M=P,S=J,y=0;y<CP;y+=2)ee=ee+H|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,H^=h,H=H>>>32-12|H<<12,X=X+z|0,_^=X,_=_>>>32-16|_<<16,g=g+_|0,z^=g,z=z>>>32-12|z<<12,ne=ne+he|0,M^=ne,M=M>>>32-16|M<<16,b=b+M|0,he^=b,he=he>>>32-12|he<<12,V=V+L|0,S^=V,S=S>>>32-16|S<<16,l=l+S|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,M^=ne,M=M>>>32-8|M<<8,b=b+M|0,he^=b,he=he>>>32-7|he<<7,V=V+L|0,S^=V,S=S>>>32-8|S<<8,l=l+S|0,L^=l,L=L>>>32-7|L<<7,X=X+z|0,_^=X,_=_>>>32-8|_<<8,g=g+_|0,z^=g,z=z>>>32-7|z<<7,ee=ee+H|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,H^=h,H=H>>>32-7|H<<7,ee=ee+z|0,S^=ee,S=S>>>32-16|S<<16,b=b+S|0,z^=b,z=z>>>32-12|z<<12,X=X+he|0,m^=X,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,_^=ne,_=_>>>32-16|_<<16,h=h+_|0,L^=h,L=L>>>32-12|L<<12,V=V+H|0,M^=V,M=M>>>32-16|M<<16,g=g+M|0,H^=g,H=H>>>32-12|H<<12,ne=ne+L|0,_^=ne,_=_>>>32-8|_<<8,h=h+_|0,L^=h,L=L>>>32-7|L<<7,V=V+H|0,M^=V,M=M>>>32-8|M<<8,g=g+M|0,H^=g,H=H>>>32-7|H<<7,X=X+he|0,m^=X,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+z|0,S^=ee,S=S>>>32-8|S<<8,b=b+S|0,z^=b,z=z>>>32-7|z<<7;Zr.writeUint32LE(ee+n|0,r,0),Zr.writeUint32LE(X+i|0,r,4),Zr.writeUint32LE(ne+s|0,r,8),Zr.writeUint32LE(V+f|0,r,12),Zr.writeUint32LE(H+u|0,r,16),Zr.writeUint32LE(z+d|0,r,20),Zr.writeUint32LE(he+v|0,r,24),Zr.writeUint32LE(L+x|0,r,28),Zr.writeUint32LE(h+E|0,r,32),Zr.writeUint32LE(g+O|0,r,36),Zr.writeUint32LE(b+R|0,r,40),Zr.writeUint32LE(l+I|0,r,44),Zr.writeUint32LE(m+B|0,r,48),Zr.writeUint32LE(_+Y|0,r,52),Zr.writeUint32LE(M+P|0,r,56),Zr.writeUint32LE(S+J|0,r,60)}o(kP,"core");function rw(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){kP(u,s,r);for(var v=d;v<d+64&&v<t.length;v++)n[v]=t[v]^u[v-d];DP(s,0,f)}return rb.wipe(u),i===0&&rb.wipe(s),n}o(rw,"streamXOR");Pd.streamXOR=rw;function IP(r,e,t,n){return n===void 0&&(n=0),rb.wipe(t),rw(r,e,t,t,n)}o(IP,"stream");Pd.stream=IP;function DP(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(DP,"incrementCounter")});var sw=Re(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});var Ws=$a(),nw=xi(),RP=nb(),OP=20;function iw(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=ow(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var f=RP.streamXOR(i,s,t,n);return nw.wipe(i),f}o(iw,"streamXOR");Yu.streamXOR=iw;function NP(r,e,t){return nw.wipe(t),iw(r,e,t,t)}o(NP,"stream");Yu.stream=NP;function ow(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],v=r[11]<<24|r[10]<<16|r[9]<<8|r[8],x=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],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=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,X=i,ne=s,V=f,H=u,z=d,he=v,L=x,h=E,g=O,b=R,l=I,m=B,_=Y,M=P,S=J,y=0;y<OP;y+=2)ee=ee+H|0,m^=ee,m=m>>>32-16|m<<16,h=h+m|0,H^=h,H=H>>>32-12|H<<12,X=X+z|0,_^=X,_=_>>>32-16|_<<16,g=g+_|0,z^=g,z=z>>>32-12|z<<12,ne=ne+he|0,M^=ne,M=M>>>32-16|M<<16,b=b+M|0,he^=b,he=he>>>32-12|he<<12,V=V+L|0,S^=V,S=S>>>32-16|S<<16,l=l+S|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,M^=ne,M=M>>>32-8|M<<8,b=b+M|0,he^=b,he=he>>>32-7|he<<7,V=V+L|0,S^=V,S=S>>>32-8|S<<8,l=l+S|0,L^=l,L=L>>>32-7|L<<7,X=X+z|0,_^=X,_=_>>>32-8|_<<8,g=g+_|0,z^=g,z=z>>>32-7|z<<7,ee=ee+H|0,m^=ee,m=m>>>32-8|m<<8,h=h+m|0,H^=h,H=H>>>32-7|H<<7,ee=ee+z|0,S^=ee,S=S>>>32-16|S<<16,b=b+S|0,z^=b,z=z>>>32-12|z<<12,X=X+he|0,m^=X,m=m>>>32-16|m<<16,l=l+m|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,_^=ne,_=_>>>32-16|_<<16,h=h+_|0,L^=h,L=L>>>32-12|L<<12,V=V+H|0,M^=V,M=M>>>32-16|M<<16,g=g+M|0,H^=g,H=H>>>32-12|H<<12,ne=ne+L|0,_^=ne,_=_>>>32-8|_<<8,h=h+_|0,L^=h,L=L>>>32-7|L<<7,V=V+H|0,M^=V,M=M>>>32-8|M<<8,g=g+M|0,H^=g,H=H>>>32-7|H<<7,X=X+he|0,m^=X,m=m>>>32-8|m<<8,l=l+m|0,he^=l,he=he>>>32-7|he<<7,ee=ee+z|0,S^=ee,S=S>>>32-8|S<<8,b=b+S|0,z^=b,z=z>>>32-7|z<<7;return Ws.writeUint32LE(ee,t,0),Ws.writeUint32LE(X,t,4),Ws.writeUint32LE(ne,t,8),Ws.writeUint32LE(V,t,12),Ws.writeUint32LE(m,t,16),Ws.writeUint32LE(_,t,20),Ws.writeUint32LE(M,t,24),Ws.writeUint32LE(S,t,28),t}o(ow,"hchacha");Yu.hchacha=ow});var ib=Re(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});function PP(r,e,t){return~(r-1)&e|r-1&t}o(PP,"select");vc.select=PP;function BP(r,e){return(r|0)-(e|0)-1>>>31&1}o(BP,"lessOrEqual");vc.lessOrEqual=BP;function aw(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(aw,"compare");vc.compare=aw;function LP(r,e){return r.length===0||e.length===0?!1:aw(r,e)!==0}o(LP,"equal");vc.equal=LP});var cw=Re(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var UP=ib(),Bd=xi();as.DIGEST_LENGTH=16;var fw=function(){function r(e){this.digestLength=as.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 v=e[14]|e[15]<<8;this._r[8]=(d>>>8|v<<8)&8191,this._r[9]=v>>>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],v=this._h[4],x=this._h[5],E=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],B=this._r[0],Y=this._r[1],P=this._r[2],J=this._r[3],ee=this._r[4],X=this._r[5],ne=this._r[6],V=this._r[7],H=this._r[8],z=this._r[9];n>=16;){var he=e[t+0]|e[t+1]<<8;s+=he&8191;var L=e[t+2]|e[t+3]<<8;f+=(he>>>13|L<<3)&8191;var h=e[t+4]|e[t+5]<<8;u+=(L>>>10|h<<6)&8191;var g=e[t+6]|e[t+7]<<8;d+=(h>>>7|g<<9)&8191;var b=e[t+8]|e[t+9]<<8;v+=(g>>>4|b<<12)&8191,x+=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 M=0,S=M;S+=s*B,S+=f*(5*z),S+=u*(5*H),S+=d*(5*V),S+=v*(5*ne),M=S>>>13,S&=8191,S+=x*(5*X),S+=E*(5*ee),S+=O*(5*J),S+=R*(5*P),S+=I*(5*Y),M+=S>>>13,S&=8191;var y=M;y+=s*Y,y+=f*B,y+=u*(5*z),y+=d*(5*H),y+=v*(5*V),M=y>>>13,y&=8191,y+=x*(5*ne),y+=E*(5*X),y+=O*(5*ee),y+=R*(5*J),y+=I*(5*P),M+=y>>>13,y&=8191;var C=M;C+=s*P,C+=f*Y,C+=u*B,C+=d*(5*z),C+=v*(5*H),M=C>>>13,C&=8191,C+=x*(5*V),C+=E*(5*ne),C+=O*(5*X),C+=R*(5*ee),C+=I*(5*J),M+=C>>>13,C&=8191;var N=M;N+=s*J,N+=f*P,N+=u*Y,N+=d*B,N+=v*(5*z),M=N>>>13,N&=8191,N+=x*(5*H),N+=E*(5*V),N+=O*(5*ne),N+=R*(5*X),N+=I*(5*ee),M+=N>>>13,N&=8191;var w=M;w+=s*ee,w+=f*J,w+=u*P,w+=d*Y,w+=v*B,M=w>>>13,w&=8191,w+=x*(5*z),w+=E*(5*H),w+=O*(5*V),w+=R*(5*ne),w+=I*(5*X),M+=w>>>13,w&=8191;var k=M;k+=s*X,k+=f*ee,k+=u*J,k+=d*P,k+=v*Y,M=k>>>13,k&=8191,k+=x*B,k+=E*(5*z),k+=O*(5*H),k+=R*(5*V),k+=I*(5*ne),M+=k>>>13,k&=8191;var fe=M;fe+=s*ne,fe+=f*X,fe+=u*ee,fe+=d*J,fe+=v*P,M=fe>>>13,fe&=8191,fe+=x*Y,fe+=E*B,fe+=O*(5*z),fe+=R*(5*H),fe+=I*(5*V),M+=fe>>>13,fe&=8191;var D=M;D+=s*V,D+=f*ne,D+=u*X,D+=d*ee,D+=v*J,M=D>>>13,D&=8191,D+=x*P,D+=E*Y,D+=O*B,D+=R*(5*z),D+=I*(5*H),M+=D>>>13,D&=8191;var Q=M;Q+=s*H,Q+=f*V,Q+=u*ne,Q+=d*X,Q+=v*ee,M=Q>>>13,Q&=8191,Q+=x*J,Q+=E*P,Q+=O*Y,Q+=R*B,Q+=I*(5*z),M+=Q>>>13,Q&=8191;var se=M;se+=s*z,se+=f*H,se+=u*V,se+=d*ne,se+=v*X,M=se>>>13,se&=8191,se+=x*ee,se+=E*J,se+=O*P,se+=R*Y,se+=I*B,M+=se>>>13,se&=8191,M=(M<<2)+M|0,M=M+S|0,S=M&8191,M=M>>>13,y+=M,s=S,f=y,u=C,d=N,v=w,x=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]=v,this._h[5]=x,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 Bd.wipe(this._buffer),Bd.wipe(this._r),Bd.wipe(this._h),Bd.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();as.Poly1305=fw;function FP(r,e){var t=new fw(r);t.update(e);var n=t.digest();return t.clean(),n}o(FP,"oneTimeAuth");as.oneTimeAuth=FP;function $P(r,e){return r.length!==as.DIGEST_LENGTH||e.length!==as.DIGEST_LENGTH?!1:UP.equal(r,e)}o($P,"equal");as.equal=$P});var hw=Re(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var Ld=nb(),qP=cw(),Xu=xi(),uw=$a(),HP=ib();fs.KEY_LENGTH=32;fs.NONCE_LENGTH=12;fs.TAG_LENGTH=16;var lw=new Uint8Array(16),zP=function(){function r(e){if(this.nonceLength=fs.NONCE_LENGTH,this.tagLength=fs.TAG_LENGTH,e.length!==fs.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);Ld.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 Ld.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),Xu.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);Ld.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),!HP.equal(u,t.subarray(t.length-this.tagLength,t.length)))return null;var d=t.length-this.tagLength,v;if(i){if(i.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");v=i}else v=new Uint8Array(d);return Ld.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),v,4),Xu.wipe(s),v},r.prototype.clean=function(){return Xu.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new qP.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(lw.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(lw.subarray(n.length%16));var f=new Uint8Array(8);i&&uw.writeUint64LE(i.length,f),s.update(f),uw.writeUint64LE(n.length,f),s.update(f);for(var u=s.digest(),d=0;d<u.length;d++)e[d]=u[d];s.clean(),Xu.wipe(u),Xu.wipe(f)},r}();fs.ChaCha20Poly1305=zP});var mw=Re(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var dw=sw(),pw=hw(),Zu=xi();cs.KEY_LENGTH=32;cs.NONCE_LENGTH=24;cs.TAG_LENGTH=16;var jP=function(){function r(e){if(this.nonceLength=cs.NONCE_LENGTH,this.tagLength=cs.TAG_LENGTH,e.length!==cs.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=dw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new pw.ChaCha20Poly1305(s),d=u.seal(f,t,n,i);return Zu.wipe(s),Zu.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=dw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new pw.ChaCha20Poly1305(s),d=u.open(f,t,n,i);return Zu.wipe(s),Zu.wipe(f),u.clean(),d},r.prototype.clean=function(){return Zu.wipe(this._key),this},r}();cs.XChaCha20Poly1305=jP});var s5=Re(t0=>{"use strict";t0.byteLength=lL;t0.toByteArray=dL;t0.fromByteArray=bL;var So=[],Ti=[],uL=typeof Uint8Array<"u"?Uint8Array:Array,Ib="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(nf=0,i5=Ib.length;nf<i5;++nf)So[nf]=Ib[nf],Ti[Ib.charCodeAt(nf)]=nf;var nf,i5;Ti["-".charCodeAt(0)]=62;Ti["_".charCodeAt(0)]=63;function o5(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(o5,"getLens");function lL(r){var e=o5(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(lL,"byteLength");function hL(r,e,t){return(e+t)*3/4-t}o(hL,"_byteLength");function dL(r){var e,t=o5(r),n=t[0],i=t[1],s=new uL(hL(r,n,i)),f=0,u=i>0?n-4:n,d;for(d=0;d<u;d+=4)e=Ti[r.charCodeAt(d)]<<18|Ti[r.charCodeAt(d+1)]<<12|Ti[r.charCodeAt(d+2)]<<6|Ti[r.charCodeAt(d+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return i===2&&(e=Ti[r.charCodeAt(d)]<<2|Ti[r.charCodeAt(d+1)]>>4,s[f++]=e&255),i===1&&(e=Ti[r.charCodeAt(d)]<<10|Ti[r.charCodeAt(d+1)]<<4|Ti[r.charCodeAt(d+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}o(dL,"toByteArray");function pL(r){return So[r>>18&63]+So[r>>12&63]+So[r>>6&63]+So[r&63]}o(pL,"tripletToBase64");function mL(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(pL(n));return i.join("")}o(mL,"encodeChunk");function bL(r){for(var e,t=r.length,n=t%3,i=[],s=16383,f=0,u=t-n;f<u;f+=s)i.push(mL(r,f,f+s>u?u:f+s));return n===1?(e=r[t-1],i.push(So[e>>2]+So[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(So[e>>10]+So[e>>4&63]+So[e<<2&63]+"=")),i.join("")}o(bL,"fromByteArray")});var a5=Re(Db=>{Db.read=function(r,e,t,n,i){var s,f,u=i*8-n-1,d=(1<<u)-1,v=d>>1,x=-7,E=t?i-1:0,O=t?-1:1,R=r[e+E];for(E+=O,s=R&(1<<-x)-1,R>>=-x,x+=u;x>0;s=s*256+r[e+E],E+=O,x-=8);for(f=s&(1<<-x)-1,s>>=-x,x+=n;x>0;f=f*256+r[e+E],E+=O,x-=8);if(s===0)s=1-v;else{if(s===d)return f?NaN:(R?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-v}return(R?-1:1)*f*Math.pow(2,s-n)};Db.write=function(r,e,t,n,i,s){var f,u,d,v=s*8-i-1,x=(1<<v)-1,E=x>>1,O=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:s-1,I=n?1:-1,B=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=x):(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>=x?(u=0,f=x):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,v+=i;v>0;r[t+R]=f&255,R+=I,f/=256,v-=8);r[t+R-I]|=B*128}});var i0=Re(Cc=>{"use strict";var Rb=s5(),Tc=a5(),f5=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Cc.Buffer=Se;Cc.SlowBuffer=_L;Cc.INSPECT_MAX_BYTES=50;var r0=2147483647;Cc.kMaxLength=r0;Se.TYPED_ARRAY_SUPPORT=gL();!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 gL(){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(gL,"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 ls(r){if(r>r0)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Se.prototype),e}o(ls,"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 Bb(r)}return l5(r,e,t)}o(Se,"Buffer");Se.poolSize=8192;function l5(r,e,t){if(typeof r=="string")return yL(r,e);if(ArrayBuffer.isView(r))return xL(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(Mo(r,ArrayBuffer)||r&&Mo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mo(r,SharedArrayBuffer)||r&&Mo(r.buffer,SharedArrayBuffer)))return Nb(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=wL(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(l5,"from");Se.from=function(r,e,t){return l5(r,e,t)};Object.setPrototypeOf(Se.prototype,Uint8Array.prototype);Object.setPrototypeOf(Se,Uint8Array);function h5(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(h5,"assertSize");function vL(r,e,t){return h5(r),r<=0?ls(r):e!==void 0?typeof t=="string"?ls(r).fill(e,t):ls(r).fill(e):ls(r)}o(vL,"alloc");Se.alloc=function(r,e,t){return vL(r,e,t)};function Bb(r){return h5(r),ls(r<0?0:Lb(r)|0)}o(Bb,"allocUnsafe");Se.allocUnsafe=function(r){return Bb(r)};Se.allocUnsafeSlow=function(r){return Bb(r)};function yL(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Se.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=d5(r,e)|0,n=ls(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(yL,"fromString");function Ob(r){for(var e=r.length<0?0:Lb(r.length)|0,t=ls(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}o(Ob,"fromArrayLike");function xL(r){if(Mo(r,Uint8Array)){var e=new Uint8Array(r);return Nb(e.buffer,e.byteOffset,e.byteLength)}return Ob(r)}o(xL,"fromArrayView");function Nb(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(Nb,"fromArrayBuffer");function wL(r){if(Se.isBuffer(r)){var e=Lb(r.length)|0,t=ls(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Ub(r.length)?ls(0):Ob(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Ob(r.data)}o(wL,"fromObject");function Lb(r){if(r>=r0)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r0.toString(16)+" bytes");return r|0}o(Lb,"checked");function _L(r){return+r!=r&&(r=0),Se.alloc(+r)}o(_L,"SlowBuffer");Se.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==Se.prototype},"isBuffer");Se.compare=o(function(e,t){if(Mo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),Mo(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(Mo(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 d5(r,e){if(Se.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Mo(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 Pb(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return y5(r).length;default:if(i)return n?-1:Pb(r).length;e=(""+e).toLowerCase(),i=!0}}o(d5,"byteLength");Se.byteLength=d5;function EL(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 OL(this,e,t);case"utf8":case"utf-8":return m5(this,e,t);case"ascii":return DL(this,e,t);case"latin1":case"binary":return RL(this,e,t);case"base64":return kL(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return NL(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o(EL,"slowToString");Se.prototype._isBuffer=!0;function of(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}o(of,"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)of(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)of(this,t,t+3),of(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)of(this,t,t+7),of(this,t+1,t+6),of(this,t+2,t+5),of(this,t+3,t+4);return this},"swap64");Se.prototype.toString=o(function(){var e=this.length;return e===0?"":arguments.length===0?m5(this,0,e):EL.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=Cc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");f5&&(Se.prototype[f5]=Se.prototype.inspect);Se.prototype.compare=o(function(e,t,n,i,s){if(Mo(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),v=this.slice(i,s),x=e.slice(t,n),E=0;E<d;++E)if(v[E]!==x[E]){f=v[E],u=x[E];break}return f<u?-1:u<f?1:0},"compare");function p5(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,Ub(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:c5(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):c5(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(p5,"bidirectionalIndexOf");function c5(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 v;if(i){var x=-1;for(v=t;v<f;v++)if(d(r,v)===d(e,x===-1?0:v-x)){if(x===-1&&(x=v),v-x+1===u)return x*s}else x!==-1&&(v-=v-x),x=-1}else for(t+u>f&&(t=f-u),v=t;v>=0;v--){for(var E=!0,O=0;O<u;O++)if(d(r,v+O)!==d(e,O)){E=!1;break}if(E)return v}return-1}o(c5,"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 p5(this,e,t,n,!0)},"indexOf");Se.prototype.lastIndexOf=o(function(e,t,n){return p5(this,e,t,n,!1)},"lastIndexOf");function AL(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(Ub(u))return f;r[t+f]=u}return f}o(AL,"hexWrite");function SL(r,e,t,n){return n0(Pb(e,r.length-t),r,t,n)}o(SL,"utf8Write");function ML(r,e,t,n){return n0(LL(e),r,t,n)}o(ML,"asciiWrite");function TL(r,e,t,n){return n0(y5(e),r,t,n)}o(TL,"base64Write");function CL(r,e,t,n){return n0(UL(e,r.length-t),r,t,n)}o(CL,"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 AL(this,e,t,n);case"utf8":case"utf-8":return SL(this,e,t,n);case"ascii":case"latin1":case"binary":return ML(this,e,t,n);case"base64":return TL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return CL(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 kL(r,e,t){return e===0&&t===r.length?Rb.fromByteArray(r):Rb.fromByteArray(r.slice(e,t))}o(kL,"base64Slice");function m5(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,v,x,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],v=r[i+2],(d&192)===128&&(v&192)===128&&(E=(s&15)<<12|(d&63)<<6|v&63,E>2047&&(E<55296||E>57343)&&(f=E));break;case 4:d=r[i+1],v=r[i+2],x=r[i+3],(d&192)===128&&(v&192)===128&&(x&192)===128&&(E=(s&15)<<18|(d&63)<<12|(v&63)<<6|x&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 IL(n)}o(m5,"utf8Slice");var u5=4096;function IL(r){var e=r.length;if(e<=u5)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=u5));return t}o(IL,"decodeCodePointsArray");function DL(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(DL,"asciiSlice");function RL(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(RL,"latin1Slice");function OL(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+=FL[r[s]];return i}o(OL,"hexSlice");function NL(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(NL,"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 Nr(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(Nr,"checkOffset");Se.prototype.readUintLE=Se.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(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||Nr(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||Nr(e,1,this.length),this[e]},"readUInt8");Se.prototype.readUint16LE=Se.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(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||Nr(e,4,this.length),Tc.read(this,e,!0,23,4)},"readFloatLE");Se.prototype.readFloatBE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),Tc.read(this,e,!1,23,4)},"readFloatBE");Se.prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Tc.read(this,e,!0,52,8)},"readDoubleLE");Se.prototype.readDoubleBE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Tc.read(this,e,!1,52,8)},"readDoubleBE");function Tn(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(Tn,"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;Tn(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;Tn(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||Tn(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||Tn(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||Tn(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||Tn(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||Tn(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);Tn(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);Tn(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||Tn(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||Tn(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||Tn(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||Tn(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||Tn(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 b5(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(b5,"checkIEEE754");function g5(r,e,t,n,i){return e=+e,t=t>>>0,i||b5(r,e,t,4,34028234663852886e22,-34028234663852886e22),Tc.write(r,e,t,n,23,4),t+4}o(g5,"writeFloat");Se.prototype.writeFloatLE=o(function(e,t,n){return g5(this,e,t,!0,n)},"writeFloatLE");Se.prototype.writeFloatBE=o(function(e,t,n){return g5(this,e,t,!1,n)},"writeFloatBE");function v5(r,e,t,n,i){return e=+e,t=t>>>0,i||b5(r,e,t,8,17976931348623157e292,-17976931348623157e292),Tc.write(r,e,t,n,52,8),t+8}o(v5,"writeDouble");Se.prototype.writeDoubleLE=o(function(e,t,n){return v5(this,e,t,!0,n)},"writeDoubleLE");Se.prototype.writeDoubleBE=o(function(e,t,n){return v5(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 PL=/[^+/0-9A-Za-z-_]/g;function BL(r){if(r=r.split("=")[0],r=r.trim().replace(PL,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}o(BL,"base64clean");function Pb(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(Pb,"utf8ToBytes");function LL(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}o(LL,"asciiToBytes");function UL(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(UL,"utf16leToBytes");function y5(r){return Rb.toByteArray(BL(r))}o(y5,"base64ToBytes");function n0(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(n0,"blitBuffer");function Mo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}o(Mo,"isInstance");function Ub(r){return r!==r}o(Ub,"numberIsNaN");var FL=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 Xi=Re((eJ,x5)=>{x5.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 fl=Re((tJ,w5)=>{w5.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 E5=Re(Pr=>{var{Buffer:Mr}=i0(),o0=4294967292,s0=4294967293,Fb=4294967294,_5=4294967295,Ue=[0,1,3,7,15,31,63,127,255,511,1023],Zs=["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"],$L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Jn=[];$L.forEach(r=>{Jn.push(r.charCodeAt(0))});Pr.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}`)}),Mr.from(e)},decode(r,e){function t(I,B){if((B&192)!==128)return s0;let Y=((I&Ue[5])<<6)+(B&Ue[6]);return Y<128?o0:Y}o(t,"bytes2");function n(I,B,Y){if((Y&192)!==128||(B&192)!==128)return s0;let P=((I&Ue[4])<<12)+((B&Ue[6])<<6)+(Y&Ue[6]);return P<2048?o0:P>=55296&&P<=57343?Fb:P}o(n,"bytes3");function i(I,B,Y,P){if((P&192)!==128||(Y&192)!==128||(B&192)!==128)return s0;let J=(((I&Ue[3])<<2)+(B>>4&Ue[2])<<16)+((B&Ue[4])<<12)+((Y&Ue[6])<<6)+(P&Ue[6]);return J<65536?o0:J>1114111?Fb:J}o(i,"bytes4");let s,f,u,d,v,x,E=r.length,O=e?3:0,R=[];for(;O<E;){f=r[O],s=_5;let I=!0;for(;I;){if(f>=0&&f<=127){s=f,x=1;break}if(u=O+1,u<E&&f>=194&&f<=223){s=t(f,r[u]),x=2;break}if(d=O+2,d<E&&f>=224&&f<=239){s=n(f,r[u],r[d]),x=3;break}if(v=O+3,v<E&&f>=240&&f<=244){s=i(f,r[u],r[d],r[v]),x=4;break}break}if(s>1114111){let B=`byte[${O}]`;throw s===_5?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${B}`):s===s0?new RangeError(`utf8.decode: illegal trailing byte found at: ${B}`):s===Fb?new RangeError(`utf8.decode: code point out of range found at: ${B}`):s===o0?new RangeError(`utf8.decode: non-shortest form found at: ${B}`):new RangeError(`utf8.decode: unrecognized error found at: ${B}`)}R.push(s),O+=x}return R}};Pr.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 Mr.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,v,x,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(x=(r[i]<<8)+r[d],x<55296||x>57343){f=x,u=2;break}if(v=i+3,v<n&&(E=(r[i+2]<<8)+r[v],x<=56319&&E>=56320&&E<=57343)){f=65536+(x-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}};Pr.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 Mr.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,v,x,E;for(;i<n;){for(;;){if(d=i+1,d<n){if(x=(r[d]<<8)+r[i],x<55296||x>57343){f=x,u=2;break}if(v=i+3,v<n&&(E=(r[v]<<8)+r[i+2],x<=56319&&E>=56320&&E<=57343)){f=65536+(x-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}};Pr.utf32be={encode(r){let e=Mr.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}};Pr.utf32le={encode(r){let e=Mr.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}};Pr.uint7={encode(r){let e=Mr.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}};Pr.uint8={encode(r){let e=Mr.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}};Pr.uint16be={encode(r){let e=Mr.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}};Pr.uint16le={encode(r){let e=Mr.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}};Pr.uint32be={encode(r){let e=Mr.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}};Pr.uint32le={encode(r){let e=Mr.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}};Pr.string={encode(r){return Pr.utf16le.encode(r).toString("utf16le")},decode(r){return Pr.utf16le.decode(Mr.from(r,"utf16le"),0)}};Pr.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${Zs[n]}`;else if(n>=127&&n<=255)i+=`\`x${Zs[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Zs[n>>8&Ue[8]]}${Zs[n&Ue[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let f=n>>24&Ue[8];f>0&&(i+=Zs[f]),i+=`${Zs[n>>16&Ue[8]]+Zs[n>>8&Ue[8]]+Zs[n&Ue[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Mr.from(i).forEach(f=>{e.push(f)})}}return Mr.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 B=String.fromCodePoint(R[E],R[E+1]);I.char=parseInt(B,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 B=String.fromCodePoint(R[E],R[E+1],R[E+2],R[E+3]);I.char=parseInt(B,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},B="";for(;E<O&&e(R[E]);)B+=String.fromCodePoint(R[E]),E+=1;return I.char=parseInt(B,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,v,x=0;for(;x<f;){for(;;){if(v=!0,r[x]!==96){s.push(r[x]),x+=1,v=!1;break}if(u=x+1,u>=f)break;if(r[u]===96){s.push(96),x+=2,v=!1;break}if(r[u]===120){if(d=t(u+1,f,r),d.error)break;s.push(d.char),x=d.nexti,v=!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),x=d.nexti,v=!1;break}if(d=n(u+1,f,r),d.error)break;s.push(d.char),x=d.nexti,v=!1;break}break}if(v)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${x}]`)}return s}};var cl=13,Ci=10;Pr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case cl:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(cl),e.push(Ci);break;case Ci:e.push(cl),e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&(e.push(cl),e.push(Ci)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case cl:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(Ci);break;case Ci:e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&e.push(Ci),e}};Pr.base64={encode(r){if(r.length===0)return Mr.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,f=Mr.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(x){let E=[],O=0;for(let R=0;R<x.length;R+=1){let I=x[R],B=!0;for(;B&&!(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:Mr.from(E)}}if(o(e,"validate"),r.length===0)return Mr.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,f,u,d=i.length/4,v=Mr.alloc(d*3-n);n>0&&(d-=1),f=0,s=0;for(let x=0;x<d;x+=1)u=i[s++]<<18,u+=i[s++]<<12,u+=i[s++]<<6,u+=i[s++],v[f++]=u>>16&Ue[8],v[f++]=u>>8&Ue[8],v[f++]=u&Ue[8];return n===1&&(u=i[s++]<<18,u+=i[s++]<<12,u+=i[s]<<6,v[f++]=u>>16&Ue[8],v[f]=u>>8&Ue[8]),n===2&&(u=i[s++]<<18,u+=i[s++]<<12,v[f]=u>>16&Ue[8]),v},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
38
- ${d}`,t=1;break;default:e+=s+f+u+d,t+=4;break}}o(n,"buildLine");function i(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===47||s===61}o(i,"validate");for(let s=0;s<r.length;s+=4){for(let f=s;f<s+4;f+=1)if(!i(r[f]))throw new RangeError(`base64.toString: buf[${f}]: ${r[f]} : not valid base64 character code`);n(String.fromCharCode(r[s]),String.fromCharCode(r[s+1]),String.fromCharCode(r[s+2]),String.fromCharCode(r[s+3]))}return e}}});var Hb=Re(Oc=>{var{Buffer:Ub}=n0(),jt=_5(),cl="UTF8",$b="UTF16",To="UTF16BE",hs="UTF16LE",qb="UTF32",Co="UTF32BE",ds="UTF32LE",kc="UINT7",E5="ASCII",A5="BINARY",Ic="UINT8",S5="UINT16",s0="UINT16LE",Dc="UINT16BE",M5="UINT32",a0="UINT32LE",Rc="UINT32BE",f0="ESCAPED",Qs="STRING",LL=o(function(e){e.type=cl;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),UL=o(function(e){let t=e.data;switch(e.bom=0,e.type){case $b:e.type=To,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=hs,e.bom=2));break;case To:if(e.type=To,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${To}" specified but BOM is for "${hs}"`)}break;case hs:if(e.type=hs,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${hs}" specified but BOM is for "${To}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),FL=o(function(e){let t=e.data;switch(e.bom=0,e.type){case qb:e.type=Co,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=ds,e.bom=4));break;case Co:if(e.type=Co,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${Co} specified but BOM is for ${ds}"`);break;case ds:if(e.type=ds,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${ds}" specified but BOM is for "${Co}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),$L=o(function(e,t){function n(s){let f={type:"",base64:!1},d=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return d&&(d[2]&&(f.type=d[2].toUpperCase()),d[1]&&(f.base64=!0)),f}o(n,"getType");let i=n(e.toUpperCase());if(i.base64){if(i.type===Qs)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${Qs}`);if(Ub.isBuffer(t))i.data=jt.base64.decode(t);else if(typeof t=="string"){let s=Ub.from(t,"ascii");i.data=jt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case cl:LL(i);break;case $b:case To:case hs:UL(i);break;case qb:case Co:case ds:FL(i);break;case S5:i.type=Dc;break;case M5:i.type=Rc;break;case E5:i.type=kc;break;case A5:i.type=Ic;break;case kc:case Ic:case s0:case Dc:case a0:case Rc:case Qs:case f0:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===Qs){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Ub.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),qL=o(function(e,t){function n(s){let f,u,d={crlf:!1,lf:!1,base64:!1,type:""},v=!0;for(;v;){if(u=s,f=s.slice(0,5),f==="CRLF:"){d.crlf=!0,u=s.slice(5);break}if(f=s.slice(0,3),f==="LF:"){d.lf=!0,u=s.slice(3);break}break}return f=u.split(":"),f.length===1?d.type=f[0]:f.length===2&&f[1]==="BASE64"&&(d.base64=!0,d.type=f[0]),d}if(o(n,"getType"),!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case cl:case To:case hs:case Co:case ds:case kc:case Ic:case s0:case Dc:case a0:case Rc:case f0:break;case Qs:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${Qs}`);break;case E5:i.type=kc;break;case A5:i.type=Ic;break;case $b:i.type=To;break;case qb:i.type=Co;break;case S5:i.type=Dc;break;case M5:i.type=Rc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),Fb=o(function(e,t){switch(e){case cl:return jt.utf8.encode(t);case To:return jt.utf16be.encode(t);case hs:return jt.utf16le.encode(t);case Co:return jt.utf32be.encode(t);case ds:return jt.utf32le.encode(t);case kc:return jt.uint7.encode(t);case Ic:return jt.uint8.encode(t);case Dc:return jt.uint16be.encode(t);case s0:return jt.uint16le.encode(t);case Rc:return jt.uint32be.encode(t);case a0:return jt.uint32le.encode(t);case Qs:return jt.string.encode(t);case f0:return jt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),HL=o(function(e){switch(e.type){case cl:return jt.utf8.decode(e.data,e.bom);case hs:return jt.utf16le.decode(e.data,e.bom);case To:return jt.utf16be.decode(e.data,e.bom);case Co:return jt.utf32be.decode(e.data,e.bom);case ds:return jt.utf32le.decode(e.data,e.bom);case kc:return jt.uint7.decode(e.data);case Ic:return jt.uint8.decode(e.data);case Dc:return jt.uint16be.decode(e.data);case s0:return jt.uint16le.decode(e.data);case Rc:return jt.uint32be.decode(e.data);case a0:return jt.uint32le.decode(e.data);case Qs:return jt.string.decode(e.data);case f0:return jt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Oc.decode=o(function(e,t){let n=$L(e,t);return HL(n)},"exportsDecode");Oc.encode=o(function(e,t){let n,i,s=qL(e,t);return s.crlf?(n=jt.lineEnds.crlf(t),i=Fb(s.type,n)):s.lf?(n=jt.lineEnds.lf(t),i=Fb(s.type,n)):i=Fb(s.type,t),s.base64&&(i=jt.base64.encode(i)),i},"exportsEncode");var zL=o(function(e,t,n){return Oc.encode(n,Oc.decode(e,t))},"convert");Oc.convert=zL});var zb=Re((YW,T5)=>{T5.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
38
+ ${d}`,t=1;break;default:e+=s+f+u+d,t+=4;break}}o(n,"buildLine");function i(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===47||s===61}o(i,"validate");for(let s=0;s<r.length;s+=4){for(let f=s;f<s+4;f+=1)if(!i(r[f]))throw new RangeError(`base64.toString: buf[${f}]: ${r[f]} : not valid base64 character code`);n(String.fromCharCode(r[s]),String.fromCharCode(r[s+1]),String.fromCharCode(r[s+2]),String.fromCharCode(r[s+3]))}return e}}});var jb=Re(Oc=>{var{Buffer:$b}=i0(),jt=E5(),ul="UTF8",Hb="UTF16",To="UTF16BE",hs="UTF16LE",zb="UTF32",Co="UTF32BE",ds="UTF32LE",kc="UINT7",A5="ASCII",S5="BINARY",Ic="UINT8",M5="UINT16",a0="UINT16LE",Dc="UINT16BE",T5="UINT32",f0="UINT32LE",Rc="UINT32BE",c0="ESCAPED",Qs="STRING",qL=o(function(e){e.type=ul;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),HL=o(function(e){let t=e.data;switch(e.bom=0,e.type){case Hb:e.type=To,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=hs,e.bom=2));break;case To:if(e.type=To,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${To}" specified but BOM is for "${hs}"`)}break;case hs:if(e.type=hs,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${hs}" specified but BOM is for "${To}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),zL=o(function(e){let t=e.data;switch(e.bom=0,e.type){case zb:e.type=Co,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=ds,e.bom=4));break;case Co:if(e.type=Co,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${Co} specified but BOM is for ${ds}"`);break;case ds:if(e.type=ds,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${ds}" specified but BOM is for "${Co}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),jL=o(function(e,t){function n(s){let f={type:"",base64:!1},d=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return d&&(d[2]&&(f.type=d[2].toUpperCase()),d[1]&&(f.base64=!0)),f}o(n,"getType");let i=n(e.toUpperCase());if(i.base64){if(i.type===Qs)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${Qs}`);if($b.isBuffer(t))i.data=jt.base64.decode(t);else if(typeof t=="string"){let s=$b.from(t,"ascii");i.data=jt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case ul:qL(i);break;case Hb:case To:case hs:HL(i);break;case zb:case Co:case ds:zL(i);break;case M5:i.type=Dc;break;case T5:i.type=Rc;break;case A5:i.type=kc;break;case S5:i.type=Ic;break;case kc:case Ic:case a0:case Dc:case f0:case Rc:case Qs:case c0:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===Qs){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!$b.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),KL=o(function(e,t){function n(s){let f,u,d={crlf:!1,lf:!1,base64:!1,type:""},v=!0;for(;v;){if(u=s,f=s.slice(0,5),f==="CRLF:"){d.crlf=!0,u=s.slice(5);break}if(f=s.slice(0,3),f==="LF:"){d.lf=!0,u=s.slice(3);break}break}return f=u.split(":"),f.length===1?d.type=f[0]:f.length===2&&f[1]==="BASE64"&&(d.base64=!0,d.type=f[0]),d}if(o(n,"getType"),!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case ul:case To:case hs:case Co:case ds:case kc:case Ic:case a0:case Dc:case f0:case Rc:case c0:break;case Qs:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${Qs}`);break;case A5:i.type=kc;break;case S5:i.type=Ic;break;case Hb:i.type=To;break;case zb:i.type=Co;break;case M5:i.type=Dc;break;case T5:i.type=Rc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),qb=o(function(e,t){switch(e){case ul:return jt.utf8.encode(t);case To:return jt.utf16be.encode(t);case hs:return jt.utf16le.encode(t);case Co:return jt.utf32be.encode(t);case ds:return jt.utf32le.encode(t);case kc:return jt.uint7.encode(t);case Ic:return jt.uint8.encode(t);case Dc:return jt.uint16be.encode(t);case a0:return jt.uint16le.encode(t);case Rc:return jt.uint32be.encode(t);case f0:return jt.uint32le.encode(t);case Qs:return jt.string.encode(t);case c0:return jt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),VL=o(function(e){switch(e.type){case ul:return jt.utf8.decode(e.data,e.bom);case hs:return jt.utf16le.decode(e.data,e.bom);case To:return jt.utf16be.decode(e.data,e.bom);case Co:return jt.utf32be.decode(e.data,e.bom);case ds:return jt.utf32le.decode(e.data,e.bom);case kc:return jt.uint7.decode(e.data);case Ic:return jt.uint8.decode(e.data);case Dc:return jt.uint16be.decode(e.data);case a0:return jt.uint16le.decode(e.data);case Rc:return jt.uint32be.decode(e.data);case f0:return jt.uint32le.decode(e.data);case Qs:return jt.string.decode(e.data);case c0:return jt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Oc.decode=o(function(e,t){let n=jL(e,t);return VL(n)},"exportsDecode");Oc.encode=o(function(e,t){let n,i,s=KL(e,t);return s.crlf?(n=jt.lineEnds.crlf(t),i=qb(s.type,n)):s.lf?(n=jt.lineEnds.lf(t),i=qb(s.type,n)):i=qb(s.type,t),s.base64&&(i=jt.base64.encode(i)),i},"exportsEncode");var GL=o(function(e,t,n){return Oc.encode(n,Oc.decode(e,t))},"convert");Oc.convert=GL});var Kb=Re((iJ,C5)=>{C5.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
39
39
  .apg-mono {
40
40
  font-family: monospace;
41
41
  }
@@ -249,13 +249,13 @@ table.apg-attrs a {
249
249
  table.apg-attrs a:hover {
250
250
  color: #8caae6 !important;
251
251
  }
252
- `},"emittcss")});var af=Re(ir=>{var Cn=al(),jb=Hb(),jL=zb(),mr=Xi(),ea="utilities.js: ",sf=o(function(r,e,t){let n,i=e,s=!0;for(;s;){if(r<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=r;break}if(i>=r){i=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=i+t,n>r){n=r;break}break}return{beg:i,end:n}},"getBounds");ir.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${ea}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
252
+ `},"emittcss")});var af=Re(ir=>{var Cn=fl(),Vb=jb(),WL=Kb(),mr=Xi(),ea="utilities.js: ",sf=o(function(r,e,t){let n,i=e,s=!0;for(;s;){if(r<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=r;break}if(i>=r){i=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=i+t,n>r){n=r;break}break}return{beg:i,end:n}},"getBounds");ir.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${ea}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
253
253
  `,n+=`<html lang="en">
254
254
  `,n+=`<head>
255
255
  `,n+=`<meta charset="utf-8">
256
256
  `,n+=`<title>${t}</title>
257
257
  `,n+=`<style>
258
- `,n+=jL(),n+=`</style>
258
+ `,n+=WL(),n+=`</style>
259
259
  `,n+=`</head>
260
260
  <body>
261
261
  `,n+=`<p>${new Date}</p>
@@ -280,7 +280,7 @@ 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?jb.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};ir.stringToChars=function(r){return jb.decode("STRING",r)};ir.opcodeToString=function(r){let e="unknown";switch(r){case mr.ALT:e="ALT";break;case mr.CAT:e="CAT";break;case mr.RNM:e="RNM";break;case mr.UDT:e="UDT";break;case mr.AND:e="AND";break;case mr.NOT:e="NOT";break;case mr.REP:e="REP";break;case mr.TRG:e="TRG";break;case mr.TBS:e="TBS";break;case mr.TLS:e="TLS";break;case mr.BKR:e="BKR";break;case mr.BKA:e="BKA";break;case mr.BKN:e="BKN";break;case mr.ABG:e="ABG";break;case mr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};ir.stateToString=function(r){let e="unknown";switch(r){case mr.ACTIVE:e="ACTIVE";break;case mr.MATCH:e="MATCH";break;case mr.EMPTY:e="EMPTY";break;case mr.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(`${ea}charsToDec: input must be an array of integers`);let i=sf(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(`${ea}charsToHex: input must be an array of integers`);let i=sf(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(`${ea}charsToHex: input must be an array of integers`);let i=sf(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 KL(r){return!(r>=55296&&r<=57343||r>1114111)}o(KL,"isUnicode");ir.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ea}charsToUnicode: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)KL(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(`${ea}charsToJsUnicode: input must be an array of integers`);let i=sf(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(`${ea}charsToAscii: input must be an array of integers`);let i=sf(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(`${ea}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=sf(r.length,e,t);for(let f=s.beg;f<s.end;f+=1)i=r[f],i<32||i===127?n+=`<span class="${Cn.CLASS_CTRLCHAR}">${ir.asciiChars[i]}</span>`:i>127?n+=`<span class="${Cn.CLASS_CTRLCHAR}">U+${ir.charToHex(i)}</span>`:n+=ir.asciiChars[i];return n};ir.stringToAsciiHtml=function(r){let e=jb.decode("STRING",r);return this.charsToAsciiHtml(e)}});var k5=Re((ZW,C5)=>{C5.exports=o(function(){let e=Xi(),t=af(),n="ast.js: ",i=this,s=null,f=null,u=null,d=0,v=[],x=[],E=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(B,Y,P){E.length=0,O.length=0,v.length=0,d=0,s=B,f=Y,u=P;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)v[J]=!1,x[J]=null;for(let X in i.callbacks){let ne=X.toLowerCase();if(J=ee.indexOf(ne),J<0)throw new Error(`${n}init: node '${X}' not a rule or udt name`);typeof i.callbacks[X]=="function"&&(v[J]=!0,x[J]=i.callbacks[X]),i.callbacks[X]===!0&&(v[J]=!0)}},"init"),this.ruleDefined=o(function(B){return v[B]!==!1},"ruleDefined"),this.udtDefined=o(function(B){return v[s.length+B]!==!1},"udtDefined"),this.down=o(function(B,Y){let P=O.length;return E.push(P),O.push({name:Y,thisIndex:P,thatIndex:null,state:e.SEM_PRE,callbackIndex:B,phraseIndex:null,phraseLength:null,stack:E.length}),P},"down"),this.up=o(function(B,Y,P,J){let ee=O.length,X=E.pop();return O.push({name:Y,thisIndex:ee,thatIndex:X,state:e.SEM_POST,callbackIndex:B,phraseIndex:P,phraseLength:J,stack:E.length}),O[X].thatIndex=ee,O[X].phraseIndex=P,O[X].phraseLength=J,ee},"up"),this.translate=o(function(B){let Y,P,J;for(let ee=0;ee<O.length;ee+=1)J=O[ee],P=x[J.callbackIndex],J.state===e.SEM_PRE?P!==null&&(Y=P(e.SEM_PRE,u,J.phraseIndex,J.phraseLength,B),Y===e.SEM_SKIP&&(ee=J.thatIndex)):P!==null&&P(e.SEM_POST,u,J.phraseIndex,J.phraseLength,B)},"translate"),this.setLength=o(function(B){O.length=B,B>0?E.length=O[B-1].stack:E.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let B="";for(let Y=0;Y<I;Y+=1)B+=" ";return B}o(R,"indent"),this.toXml=o(function(B){let Y=t.charsToDec,P="decimal integer character codes";if(typeof B=="string"&&B.length>=3){let X=B.slice(0,3).toLowerCase();X==="asc"?(Y=t.charsToAscii,P="ASCII for printing characters, hex for non-printing"):X==="hex"?(Y=t.charsToHex,P="hexadecimal integer character codes"):X==="uni"&&(Y=t.charsToUnicode,P="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?Vb.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};ir.stringToChars=function(r){return Vb.decode("STRING",r)};ir.opcodeToString=function(r){let e="unknown";switch(r){case mr.ALT:e="ALT";break;case mr.CAT:e="CAT";break;case mr.RNM:e="RNM";break;case mr.UDT:e="UDT";break;case mr.AND:e="AND";break;case mr.NOT:e="NOT";break;case mr.REP:e="REP";break;case mr.TRG:e="TRG";break;case mr.TBS:e="TBS";break;case mr.TLS:e="TLS";break;case mr.BKR:e="BKR";break;case mr.BKA:e="BKA";break;case mr.BKN:e="BKN";break;case mr.ABG:e="ABG";break;case mr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};ir.stateToString=function(r){let e="unknown";switch(r){case mr.ACTIVE:e="ACTIVE";break;case mr.MATCH:e="MATCH";break;case mr.EMPTY:e="EMPTY";break;case mr.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(`${ea}charsToDec: input must be an array of integers`);let i=sf(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(`${ea}charsToHex: input must be an array of integers`);let i=sf(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(`${ea}charsToHex: input must be an array of integers`);let i=sf(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 JL(r){return!(r>=55296&&r<=57343||r>1114111)}o(JL,"isUnicode");ir.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ea}charsToUnicode: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)JL(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(`${ea}charsToJsUnicode: input must be an array of integers`);let i=sf(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(`${ea}charsToAscii: input must be an array of integers`);let i=sf(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(`${ea}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=sf(r.length,e,t);for(let f=s.beg;f<s.end;f+=1)i=r[f],i<32||i===127?n+=`<span class="${Cn.CLASS_CTRLCHAR}">${ir.asciiChars[i]}</span>`:i>127?n+=`<span class="${Cn.CLASS_CTRLCHAR}">U+${ir.charToHex(i)}</span>`:n+=ir.asciiChars[i];return n};ir.stringToAsciiHtml=function(r){let e=Vb.decode("STRING",r);return this.charsToAsciiHtml(e)}});var I5=Re((sJ,k5)=>{k5.exports=o(function(){let e=Xi(),t=af(),n="ast.js: ",i=this,s=null,f=null,u=null,d=0,v=[],x=[],E=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(B,Y,P){E.length=0,O.length=0,v.length=0,d=0,s=B,f=Y,u=P;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)v[J]=!1,x[J]=null;for(let X in i.callbacks){let ne=X.toLowerCase();if(J=ee.indexOf(ne),J<0)throw new Error(`${n}init: node '${X}' not a rule or udt name`);typeof i.callbacks[X]=="function"&&(v[J]=!0,x[J]=i.callbacks[X]),i.callbacks[X]===!0&&(v[J]=!0)}},"init"),this.ruleDefined=o(function(B){return v[B]!==!1},"ruleDefined"),this.udtDefined=o(function(B){return v[s.length+B]!==!1},"udtDefined"),this.down=o(function(B,Y){let P=O.length;return E.push(P),O.push({name:Y,thisIndex:P,thatIndex:null,state:e.SEM_PRE,callbackIndex:B,phraseIndex:null,phraseLength:null,stack:E.length}),P},"down"),this.up=o(function(B,Y,P,J){let ee=O.length,X=E.pop();return O.push({name:Y,thisIndex:ee,thatIndex:X,state:e.SEM_POST,callbackIndex:B,phraseIndex:P,phraseLength:J,stack:E.length}),O[X].thatIndex=ee,O[X].phraseIndex=P,O[X].phraseLength=J,ee},"up"),this.translate=o(function(B){let Y,P,J;for(let ee=0;ee<O.length;ee+=1)J=O[ee],P=x[J.callbackIndex],J.state===e.SEM_PRE?P!==null&&(Y=P(e.SEM_PRE,u,J.phraseIndex,J.phraseLength,B),Y===e.SEM_SKIP&&(ee=J.thatIndex)):P!==null&&P(e.SEM_POST,u,J.phraseIndex,J.phraseLength,B)},"translate"),this.setLength=o(function(B){O.length=B,B>0?E.length=O[B-1].stack:E.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let B="";for(let Y=0;Y<I;Y+=1)B+=" ";return B}o(R,"indent"),this.toXml=o(function(B){let Y=t.charsToDec,P="decimal integer character codes";if(typeof B=="string"&&B.length>=3){let X=B.slice(0,3).toLowerCase();X==="asc"?(Y=t.charsToAscii,P="ASCII for printing characters, hex for non-printing"):X==="hex"?(Y=t.charsToHex,P="hexadecimal integer character codes"):X==="uni"&&(Y=t.charsToUnicode,P="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
285
  `,J+=`<!-- input string, ${P} -->
286
286
  `,J+=R(ee+2),J+=Y(u),J+=`
@@ -288,7 +288,7 @@ table.apg-attrs a:hover {
288
288
  `,J+=R(ee+2),J+=Y(u,X.phraseIndex,X.phraseLength),J+=`
289
289
  `):(J+=R(ee),J+=`</node><!-- name="${X.name}" -->
290
290
  `,ee-=1)}),J+=`</root>
291
- `,J},"toSml"),this.phrases=o(function(){let B={},Y,P;for(Y=0;Y<O.length;Y+=1)P=O[Y],P.state===e.SEM_PRE&&(Array.isArray(B[P.name])||(B[P.name]=[]),B[P.name].push({index:P.phraseIndex,length:P.phraseLength}));return B},"phrases")},"exportsAst")});var Kb=Re((QW,I5)=>{I5.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 R5=Re((eJ,D5)=>{D5.exports=o(function(){let e=Xi(),t=af(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let f=null,u=null,d,v,x,E,O=0,R=0,I=0,B=null,Y=null,P=null,J=null,ee=null,X=0,ne=1/0,V=1/0,H=o(function(oe,F,Z){let me=`${n}evaluateRule(): `;if(oe>=P.length)throw new Error(`${me}rule index: ${oe} out of range`);if(F>=x)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"),z=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>=x)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,X=0,E=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],P=null,J=null,u=null,d=0,v=0,x=0,B=null,Y=null,ee=null,f=null},"clear"),L=o(function(){let le=[],oe=o(function(){let Z={};P.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 L,this.pFrame=new L,this.evaluateRule=H,this.evaluateUdt=z,this.refresh=o(function(){oe.state=e.ACTIVE,oe.phraseLength=0,oe.lookAround=E[E.length-1]},"refresh")},"systemData"),g=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(P,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(P,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(P,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`);P=le.rules,J=le.udts},"initializeGrammar"),y=o(function(le){let oe=`${n}initializeStartRule(): `,F=null;if(typeof le=="number"){if(le>=P.length)throw new Error(`${oe}start rule index too large: max: ${P.length}: index: ${le}`);F=le}else if(typeof le=="string"){let Z=le.toLowerCase();for(let me=0;me<P.length;me+=1)if(Z===P[me].lower){F=P[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"),C=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,v=Ie,x=d+v},"initializeInputChars"),N=o(function(){let le=`${n}initializeCallbacks(): `,oe;for(B=[],Y=[],oe=0;oe<P.length;oe+=1)B[oe]=null;for(oe=0;oe<J.length;oe+=1)Y[oe]=null;let F,Z=[];for(oe=0;oe<P.length;oe+=1)Z.push(P[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<P.length?B[oe]=F:Y[oe-P.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(Y[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(ne=Math.floor(le),ne<=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(V=Math.floor(le),V<=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=y(oe);N(),_(),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===v?Z=!0:Z=!1;break;default:throw new Error("unrecognized state")}return{success:Z,state:we.state,length:v,matched:we.phraseLength,maxMatched:X,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:x,subLength:v}},"privateParse");this.parseSubstring=o(function(oe,F,Z,me,ye,we){return he(),C(Z,me,ye),w(oe,F,we)},"parseSubstring"),this.parse=o(function(oe,F,Z,me){return he(),C(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],Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Ne=0;Ne<Ie.children.length;Ne+=1)if(s(Ie.children[Ne],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(Rt),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 Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Ne=!0;for(;Ne&&!(me>=x||(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(Rt),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,Rt,Fe=f[le],Ne=P[Fe.index],Lt=B[Ne.index],Ve=!b();if(Ve&&(me=i.ast&&i.ast.ruleDefined(Fe.index),me&&(Z=i.ast.getLength(),i.ast.down(Fe.index,P[Fe.index].name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Rt=F.pFrame,F.pFrame=new L),Lt===null)ye=f,f=Ne.opcodes,s(0,oe,F),f=ye;else{let Xe=x-oe;F.ruleIndex=Ne.index,Lt(F,u,oe,ee),Q(Ne,F,Xe,!0),F.state===e.ACTIVE&&(ye=f,f=Ne.opcodes,s(0,oe,F),f=ye,F.ruleIndex=Ne.index,Lt(F,u,oe,ee),Q(Ne,F,Xe,!1))}Ve&&(me&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(Fe.index,Ne.name,oe,F.phraseLength)),F.pFrame=Rt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opRNM"),q=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"),j=o(function(le,oe,F){let Z,me,ye,we,Ie,Rt,Fe=f[le],Ne=J[Fe.index];F.UdtIndex=Ne.index;let Lt=!b();Lt&&(ye=i.ast&&i.ast.udtDefined(Fe.index),ye&&(me=P.length+Fe.index,Z=i.ast.getLength(),i.ast.down(me,Ne.name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Rt=F.pFrame,F.pFrame=new L);let Ve=x-oe;Y[Fe.index](F,u,oe,ee),q(Ne,F,Ve),Lt&&(ye&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(me,Ne.name,oe,F.phraseLength)),F.pFrame=Rt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opUDT"),G=o(function(le,oe,F){E.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:x,charsLength:v}),x=u.length,v=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(x=Z.charsEnd,v=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:x,charsLength:v}),x=u.length,v=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(x=Z.charsEnd,v=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<x&&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<=x){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<=x){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"),ie=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<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Rt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Rt===null)return;let Ne=Rt.phraseIndex,Lt=Rt.phraseLength;if(Lt===0){F.state=e.EMPTY;return}if(oe+Lt<=x){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[oe+Z],ye=u[Ne+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[Ne+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],Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Ne=Ie.children.length-1;Ne>=0;Ne-=1)if(s(Ie.children[Ne],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(Rt),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 Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Ne=!0;for(;Ne&&!(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(Rt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(Z))},"opREPBehind"),je=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"),Pe=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"),Je=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"),gr=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];F.state=e.NOMATCH,F.phraseLength=0,Ie.index<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Rt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Rt===null)return;let Ne=Rt.phraseIndex,Lt=Rt.phraseLength;if(Lt===0){F.state=e.EMPTY,F.phraseLength=0;return}let Ve=oe-Lt;if(Ve>=0){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[Ve+Z],ye=u[Ne+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[Ve+Z],ye=u[Ne+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>V)throw new Error(`parser: maximum number of node hits exceeded: ${V}`);if(O+=1,O>R&&(R=O,R>ne))throw new Error(`parser: maximum parse tree depth exceeded: ${ne}`);if(Z.refresh(),i.trace!==null){let we=g();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:j(oe,F,Z);break;case e.AND:G(oe,F,Z);break;case e.NOT:te(oe,F,Z);break;case e.TRG:je(oe,F,Z);break;case e.TBS:Pe(oe,F,Z);break;case e.TLS:Je(oe,F,Z);break;case e.BKR:gr(oe,F,Z);break;case e.BKA:ve(oe,F,Z);break;case e.BKN:W(oe,F,Z);break;case e.ABG:ie(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:j(oe,F,Z);break;case e.AND:G(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:ie(oe,F,Z);break;case e.AEN:Me(oe,F,Z);break;default:me=!1;break}if(!b()&&F+Z.phraseLength>X&&(X=F+Z.phraseLength),i.stats!==null&&i.stats.collect(ye,Z),i.trace!==null){let we=g();i.trace.up(ye,Z.state,F,Z.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var N5=Re((tJ,O5)=>{O5.exports=o(function(){let e=Xi(),t=af(),n=al(),i="stats.js: ",s=[],f=[],u=[],d,v=[],x=[];this.statsObject="statsObject";let E="stats",O=o(function(V,H){return V.lower<H.lower?-1:V.lower>H.lower?1:0},"sortAlpha"),R=o(function(V,H){return V.total<H.total?1:V.total>H.total?-1:O(V,H)},"sortHits"),I=o(function(V,H){return V.index<H.index?-1:V.index>H.index?1:0},"sortIndex"),B=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),Y=o(function(){u.length=0,d=new B,u[e.ALT]=new B,u[e.CAT]=new B,u[e.REP]=new B,u[e.RNM]=new B,u[e.TRG]=new B,u[e.TBS]=new B,u[e.TLS]=new B,u[e.UDT]=new B,u[e.AND]=new B,u[e.NOT]=new B,u[e.BKR]=new B,u[e.BKA]=new B,u[e.BKN]=new B,u[e.ABG]=new B,u[e.AEN]=new B,v.length=0;for(let V=0;V<s.length;V+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:s[V].name,lower:s[V].lower,index:s[V].index});if(f.length>0){x.length=0;for(let V=0;V<f.length;V+=1)x.push({empty:0,match:0,nomatch:0,total:0,name:f[V].name,lower:f[V].lower,index:f[V].index})}},"clear"),P=o(function(V,H){switch(V.total+=1,H){case e.EMPTY:V.empty+=1;break;case e.MATCH:V.match+=1;break;case e.NOMATCH:V.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${H}`)}},"incStat"),J=o(function(V,H){let z="";return z+="<tr>",z+=`<td class="${n.CLASS_ACTIVE}">${V}</td>`,z+=`<td class="${n.CLASS_EMPTY}">${H.empty}</td>`,z+=`<td class="${n.CLASS_MATCH}">${H.match}</td>`,z+=`<td class="${n.CLASS_NOMATCH}">${H.nomatch}</td>`,z+=`<td class="${n.CLASS_ACTIVE}">${H.total}</td>`,z+=`</tr>
291
+ `,J},"toSml"),this.phrases=o(function(){let B={},Y,P;for(Y=0;Y<O.length;Y+=1)P=O[Y],P.state===e.SEM_PRE&&(Array.isArray(B[P.name])||(B[P.name]=[]),B[P.name].push({index:P.phraseIndex,length:P.phraseLength}));return B},"phrases")},"exportsAst")});var Gb=Re((aJ,D5)=>{D5.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 O5=Re((fJ,R5)=>{R5.exports=o(function(){let e=Xi(),t=af(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let f=null,u=null,d,v,x,E,O=0,R=0,I=0,B=null,Y=null,P=null,J=null,ee=null,X=0,ne=1/0,V=1/0,H=o(function(oe,F,Z){let me=`${n}evaluateRule(): `;if(oe>=P.length)throw new Error(`${me}rule index: ${oe} out of range`);if(F>=x)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"),z=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>=x)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,X=0,E=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],P=null,J=null,u=null,d=0,v=0,x=0,B=null,Y=null,ee=null,f=null},"clear"),L=o(function(){let le=[],oe=o(function(){let Z={};P.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 L,this.pFrame=new L,this.evaluateRule=H,this.evaluateUdt=z,this.refresh=o(function(){oe.state=e.ACTIVE,oe.phraseLength=0,oe.lookAround=E[E.length-1]},"refresh")},"systemData"),g=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(P,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(P,J,u)},"initializeTrace"),M=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(P,J)},"initializeStats"),S=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`);P=le.rules,J=le.udts},"initializeGrammar"),y=o(function(le){let oe=`${n}initializeStartRule(): `,F=null;if(typeof le=="number"){if(le>=P.length)throw new Error(`${oe}start rule index too large: max: ${P.length}: index: ${le}`);F=le}else if(typeof le=="string"){let Z=le.toLowerCase();for(let me=0;me<P.length;me+=1)if(Z===P[me].lower){F=P[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"),C=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,v=Ie,x=d+v},"initializeInputChars"),N=o(function(){let le=`${n}initializeCallbacks(): `,oe;for(B=[],Y=[],oe=0;oe<P.length;oe+=1)B[oe]=null;for(oe=0;oe<J.length;oe+=1)Y[oe]=null;let F,Z=[];for(oe=0;oe<P.length;oe+=1)Z.push(P[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<P.length?B[oe]=F:Y[oe-P.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(Y[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(ne=Math.floor(le),ne<=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(V=Math.floor(le),V<=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(): `;S(le);let ye=y(oe);N(),_(),M(),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===v?Z=!0:Z=!1;break;default:throw new Error("unrecognized state")}return{success:Z,state:we.state,length:v,matched:we.phraseLength,maxMatched:X,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:x,subLength:v}},"privateParse");this.parseSubstring=o(function(oe,F,Z,me,ye,we){return he(),C(Z,me,ye),w(oe,F,we)},"parseSubstring"),this.parse=o(function(oe,F,Z,me){return he(),C(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],Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Ne=0;Ne<Ie.children.length;Ne+=1)if(s(Ie.children[Ne],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(Rt),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 Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Ne=!0;for(;Ne&&!(me>=x||(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(Rt),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,Rt,Fe=f[le],Ne=P[Fe.index],Lt=B[Ne.index],Ve=!b();if(Ve&&(me=i.ast&&i.ast.ruleDefined(Fe.index),me&&(Z=i.ast.getLength(),i.ast.down(Fe.index,P[Fe.index].name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Rt=F.pFrame,F.pFrame=new L),Lt===null)ye=f,f=Ne.opcodes,s(0,oe,F),f=ye;else{let Xe=x-oe;F.ruleIndex=Ne.index,Lt(F,u,oe,ee),Q(Ne,F,Xe,!0),F.state===e.ACTIVE&&(ye=f,f=Ne.opcodes,s(0,oe,F),f=ye,F.ruleIndex=Ne.index,Lt(F,u,oe,ee),Q(Ne,F,Xe,!1))}Ve&&(me&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(Fe.index,Ne.name,oe,F.phraseLength)),F.pFrame=Rt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opRNM"),q=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"),j=o(function(le,oe,F){let Z,me,ye,we,Ie,Rt,Fe=f[le],Ne=J[Fe.index];F.UdtIndex=Ne.index;let Lt=!b();Lt&&(ye=i.ast&&i.ast.udtDefined(Fe.index),ye&&(me=P.length+Fe.index,Z=i.ast.getLength(),i.ast.down(me,Ne.name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Rt=F.pFrame,F.pFrame=new L);let Ve=x-oe;Y[Fe.index](F,u,oe,ee),q(Ne,F,Ve),Lt&&(ye&&(F.state===e.NOMATCH?i.ast.setLength(Z):i.ast.up(me,Ne.name,oe,F.phraseLength)),F.pFrame=Rt,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opUDT"),G=o(function(le,oe,F){E.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:x,charsLength:v}),x=u.length,v=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(x=Z.charsEnd,v=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:x,charsLength:v}),x=u.length,v=u.length-d,s(le+1,oe,F);let Z=E.pop();switch(x=Z.charsEnd,v=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<x&&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<=x){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<=x){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"),ie=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<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Rt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Rt===null)return;let Ne=Rt.phraseIndex,Lt=Rt.phraseLength;if(Lt===0){F.state=e.EMPTY;return}if(oe+Lt<=x){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[oe+Z],ye=u[Ne+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[Ne+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],Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),Z=!0,ye=oe,we=0;for(let Ne=Ie.children.length-1;Ne>=0;Ne-=1)if(s(Ie.children[Ne],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(Rt),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 Rt=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(Z=i.ast.getLength());let Ne=!0;for(;Ne&&!(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(Rt),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(Z))},"opREPBehind"),je=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"),Pe=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"),Je=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"),gr=o(function(le,oe,F){let Z,me,ye,we,Ie=f[le];F.state=e.NOMATCH,F.phraseLength=0,Ie.index<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Rt=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Rt===null)return;let Ne=Rt.phraseIndex,Lt=Rt.phraseLength;if(Lt===0){F.state=e.EMPTY,F.phraseLength=0;return}let Ve=oe-Lt;if(Ve>=0){if(Fe){for(Z=0;Z<Lt;Z+=1)if(me=u[Ve+Z],ye=u[Ne+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[Ve+Z],ye=u[Ne+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>V)throw new Error(`parser: maximum number of node hits exceeded: ${V}`);if(O+=1,O>R&&(R=O,R>ne))throw new Error(`parser: maximum parse tree depth exceeded: ${ne}`);if(Z.refresh(),i.trace!==null){let we=g();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:j(oe,F,Z);break;case e.AND:G(oe,F,Z);break;case e.NOT:te(oe,F,Z);break;case e.TRG:je(oe,F,Z);break;case e.TBS:Pe(oe,F,Z);break;case e.TLS:Je(oe,F,Z);break;case e.BKR:gr(oe,F,Z);break;case e.BKA:ve(oe,F,Z);break;case e.BKN:W(oe,F,Z);break;case e.ABG:ie(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:j(oe,F,Z);break;case e.AND:G(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:ie(oe,F,Z);break;case e.AEN:Me(oe,F,Z);break;default:me=!1;break}if(!b()&&F+Z.phraseLength>X&&(X=F+Z.phraseLength),i.stats!==null&&i.stats.collect(ye,Z),i.trace!==null){let we=g();i.trace.up(ye,Z.state,F,Z.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var P5=Re((cJ,N5)=>{N5.exports=o(function(){let e=Xi(),t=af(),n=fl(),i="stats.js: ",s=[],f=[],u=[],d,v=[],x=[];this.statsObject="statsObject";let E="stats",O=o(function(V,H){return V.lower<H.lower?-1:V.lower>H.lower?1:0},"sortAlpha"),R=o(function(V,H){return V.total<H.total?1:V.total>H.total?-1:O(V,H)},"sortHits"),I=o(function(V,H){return V.index<H.index?-1:V.index>H.index?1:0},"sortIndex"),B=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),Y=o(function(){u.length=0,d=new B,u[e.ALT]=new B,u[e.CAT]=new B,u[e.REP]=new B,u[e.RNM]=new B,u[e.TRG]=new B,u[e.TBS]=new B,u[e.TLS]=new B,u[e.UDT]=new B,u[e.AND]=new B,u[e.NOT]=new B,u[e.BKR]=new B,u[e.BKA]=new B,u[e.BKN]=new B,u[e.ABG]=new B,u[e.AEN]=new B,v.length=0;for(let V=0;V<s.length;V+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:s[V].name,lower:s[V].lower,index:s[V].index});if(f.length>0){x.length=0;for(let V=0;V<f.length;V+=1)x.push({empty:0,match:0,nomatch:0,total:0,name:f[V].name,lower:f[V].lower,index:f[V].index})}},"clear"),P=o(function(V,H){switch(V.total+=1,H){case e.EMPTY:V.empty+=1;break;case e.MATCH:V.match+=1;break;case e.NOMATCH:V.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${H}`)}},"incStat"),J=o(function(V,H){let z="";return z+="<tr>",z+=`<td class="${n.CLASS_ACTIVE}">${V}</td>`,z+=`<td class="${n.CLASS_EMPTY}">${H.empty}</td>`,z+=`<td class="${n.CLASS_MATCH}">${H.match}</td>`,z+=`<td class="${n.CLASS_NOMATCH}">${H.nomatch}</td>`,z+=`<td class="${n.CLASS_ACTIVE}">${H.total}</td>`,z+=`</tr>
292
292
  `,z},"displayRow"),ee=o(function(){let V="";return V+=J("ALT",u[e.ALT]),V+=J("CAT",u[e.CAT]),V+=J("REP",u[e.REP]),V+=J("RNM",u[e.RNM]),V+=J("TRG",u[e.TRG]),V+=J("TBS",u[e.TBS]),V+=J("TLS",u[e.TLS]),V+=J("UDT",u[e.UDT]),V+=J("AND",u[e.AND]),V+=J("NOT",u[e.NOT]),V+=J("BKR",u[e.BKR]),V+=J("BKA",u[e.BKA]),V+=J("BKN",u[e.BKN]),V+=J("ABG",u[e.ABG]),V+=J("AEN",u[e.AEN]),V+=J("totals",d),V},"displayOpsOnly"),X=o(function(){let V="";V+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
293
293
  `,V+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
294
294
  `;for(let H=0;H<s.length;H+=1)v[H].total>0&&(V+="<tr>",V+=`<td class="${n.CLASS_ACTIVE}">${v[H].name}</td>`,V+=`<td class="${n.CLASS_EMPTY}">${v[H].empty}</td>`,V+=`<td class="${n.CLASS_MATCH}">${v[H].match}</td>`,V+=`<td class="${n.CLASS_NOMATCH}">${v[H].nomatch}</td>`,V+=`<td class="${n.CLASS_ACTIVE}">${v[H].total}</td>`,V+=`</tr>
@@ -303,9 +303,9 @@ table.apg-attrs a:hover {
303
303
  `,z+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
304
304
  `,z+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
305
305
  `;let he=!0;for(;he;){if(V===void 0){z+=ee();break}if(V===null){z+=ee();break}if(V==="ops"){z+=ee();break}if(V==="index"){v.sort(I),x.length>0&&x.sort(I),z+=ee(),z+=X();break}if(V==="hits"){v.sort(R),x.length>0&&x.sort(I),z+=ee(),z+=X();break}if(V==="alpha"){v.sort(O),x.length>0&&x.sort(O),z+=ee(),z+=X();break}break}return z+=`</table>
306
- `,z},"toHtml"),this.toHtmlPage=o(function(V,H,z){return t.htmlToPage(this.toHtml(V,H),z)},"toHtmlPage")},"statsFunc")});var B5=Re((rJ,P5)=>{P5.exports=o(function(){let e=af(),t=al(),n=new(Kb()),i=Xi(),s="trace.js: ",f=this,u=16,d=10,v=8,x=32,E=80,O=5,R=[],I=5e3,B=-1,Y=0,P=0,J=[],ee=null,X=null,ne=null,V=[],H=[],z=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,he=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,L=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let q=o(function(G){V[i.ALT]=G,V[i.CAT]=G,V[i.REP]=G,V[i.TLS]=G,V[i.TBS]=G,V[i.TRG]=G,V[i.AND]=G,V[i.NOT]=G,V[i.BKR]=G,V[i.BKA]=G,V[i.BKN]=G,V[i.ABG]=G,V[i.AEN]=G},"setOperators"),j=0;for(let G in f.filter.operators)j+=1;if(j===0){q(!1);return}for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="<ALL>"){q(!0);return}if(te==="<NONE>"){q(!1);return}}q(!1);for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="ALT")V[i.ALT]=f.filter.operators[G]===!0;else if(te==="CAT")V[i.CAT]=f.filter.operators[G]===!0;else if(te==="REP")V[i.REP]=f.filter.operators[G]===!0;else if(te==="AND")V[i.AND]=f.filter.operators[G]===!0;else if(te==="NOT")V[i.NOT]=f.filter.operators[G]===!0;else if(te==="TLS")V[i.TLS]=f.filter.operators[G]===!0;else if(te==="TBS")V[i.TBS]=f.filter.operators[G]===!0;else if(te==="TRG")V[i.TRG]=f.filter.operators[G]===!0;else if(te==="BKR")V[i.BKR]=f.filter.operators[G]===!0;else if(te==="BKA")V[i.BKA]=f.filter.operators[G]===!0;else if(te==="BKN")V[i.BKN]=f.filter.operators[G]===!0;else if(te==="ABG")V[i.ABG]=f.filter.operators[G]===!0;else if(te==="AEN")V[i.AEN]=f.filter.operators[G]===!0;else throw new Error(`${s}initOpratorFilter: '${G}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),g=o(function(){let q=o(function(ae){V[i.RNM]=ae,V[i.UDT]=ae;let Ae=X.length+ne.length;H.length=0;for(let ge=0;ge<Ae;ge+=1)H.push(ae)},"setRules"),j,G,te=[];for(G=0;G<X.length;G+=1)te.push(X[G].lower);for(G=0;G<ne.length;G+=1)te.push(ne[G].lower);H.length=0,j=0;for(let ae in f.filter.rules)j+=1;if(j===0){q(!0);return}for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){q(!0);return}if(Ae==="<none>"){q(!1);return}}q(!1),V[i.RNM]=!0,V[i.UDT]=!0;for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(G=te.indexOf(Ae),G<0)throw new Error(`${s}initRuleFilter: '${ae}' not a valid rule or udt name`);H[G]=f.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(q,j){if(B=-1,typeof q=="number"&&q>0)I=Math.ceil(q);else{I=0;return}typeof j=="number"&&(B=Math.floor(j),B<0&&(B=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return B},this.init=function(q,j,G){R.length=0,J.length=0,Y=0,P=0,ee=G,X=q,ne=j,h(),g(),n.init(I)};let b=o(function(q){let j=!1;return q.type===i.RNM?V[q.type]&&H[q.index]?j=!0:j=!1:q.type===i.UDT?V[q.type]&&H[X.length+q.index]?j=!0:j=!1:j=V[q.type],j},"filterOps"),l=o(function(q){return B===-1||q<=B},"filterRecords");this.down=function(q,j,G,te,ae,Ae){l(Y)&&b(q)&&(J.push(Y),R[n.increment()]={dirUp:!1,depth:P,thisLine:Y,thatLine:void 0,opcode:q,state:j,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1,P+=1)},this.up=function(q,j,G,te,ae,Ae){if(l(Y)&&b(q)){let ge=Y,ie=J.pop(),Me=n.getListIndex(ie);Me!==-1&&(R[Me].thatLine=ge),P-=1,R[n.increment()]={dirUp:!0,depth:P,thisLine:ge,thatLine:ie,opcode:q,state:j,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1}};let m=o(function(){function q(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=X[Z.index].name;break;case i.UDT:F.opData=ne[Z.index].name;break;case i.BKR:Z.index<X.length?me=X[Z.index].name:me=ne[Z.index-X.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(q,"nodeOpcode");function j(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(j,"nodePhrase");let G=-1;function te(F,Z,me){let ye={id:G++,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,q(ye,Z.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=j(),q(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=j(Z.state,Z.phraseIndex,Z.phraseLength),F.down||q(F,Z.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,ie=1;function Me(F){if(ge+=1,F.branch=ie,ge>P&&(P=ge),F.children.length===0)Ae+=1;else for(let Z=0;Z<F.children.length;Z+=1)Z>0&&(ie+=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,je,Pe=!0,Je=te(null,null,-1);for(ve.push(Je),pe=Je,n.forEach(F=>{if(je=R[F],Pe&&(Pe=!1,je.depth>0)){let Z=je.dirUp?je.depth+1:je.depth;for(let me=0;me<Z;me+=1)ke=pe,pe=te(pe,null,me),ve.push(pe),ke.children.push(pe)}je.dirUp?(pe=ve.pop(),ae(pe,je),pe=ve[ve.length-1]):(ke=pe,pe=te(pe,je,je.depth),ve.push(pe),ke.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(Je.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=Je.children[0];let gr=W;for(;W&&!W.down&&!W.up;)gr=W,W=W.children[0];W=gr,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<X.length;F+=1)le.rules[F]=X[F].name;le.udts=[];for(let F=0;F<ne.length;F+=1)le.udts[F]=ne[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=P,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(q){let j=m();return q?JSON.stringify(j):j},this.toHtmlPage=function(q,j,G){return e.htmlToPage(this.toHtml(q,j),G)};let _=o(function(q,j){let G;switch(q){case u:G="hexadecimal";break;case d:G="decimal";break;case v:G="ASCII";break;case x:G="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${q}`)}let te="";return te+=`<p>display mode: ${G}</p>
306
+ `,z},"toHtml"),this.toHtmlPage=o(function(V,H,z){return t.htmlToPage(this.toHtml(V,H),z)},"toHtmlPage")},"statsFunc")});var L5=Re((uJ,B5)=>{B5.exports=o(function(){let e=af(),t=fl(),n=new(Gb()),i=Xi(),s="trace.js: ",f=this,u=16,d=10,v=8,x=32,E=80,O=5,R=[],I=5e3,B=-1,Y=0,P=0,J=[],ee=null,X=null,ne=null,V=[],H=[],z=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,he=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,L=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let q=o(function(G){V[i.ALT]=G,V[i.CAT]=G,V[i.REP]=G,V[i.TLS]=G,V[i.TBS]=G,V[i.TRG]=G,V[i.AND]=G,V[i.NOT]=G,V[i.BKR]=G,V[i.BKA]=G,V[i.BKN]=G,V[i.ABG]=G,V[i.AEN]=G},"setOperators"),j=0;for(let G in f.filter.operators)j+=1;if(j===0){q(!1);return}for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="<ALL>"){q(!0);return}if(te==="<NONE>"){q(!1);return}}q(!1);for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="ALT")V[i.ALT]=f.filter.operators[G]===!0;else if(te==="CAT")V[i.CAT]=f.filter.operators[G]===!0;else if(te==="REP")V[i.REP]=f.filter.operators[G]===!0;else if(te==="AND")V[i.AND]=f.filter.operators[G]===!0;else if(te==="NOT")V[i.NOT]=f.filter.operators[G]===!0;else if(te==="TLS")V[i.TLS]=f.filter.operators[G]===!0;else if(te==="TBS")V[i.TBS]=f.filter.operators[G]===!0;else if(te==="TRG")V[i.TRG]=f.filter.operators[G]===!0;else if(te==="BKR")V[i.BKR]=f.filter.operators[G]===!0;else if(te==="BKA")V[i.BKA]=f.filter.operators[G]===!0;else if(te==="BKN")V[i.BKN]=f.filter.operators[G]===!0;else if(te==="ABG")V[i.ABG]=f.filter.operators[G]===!0;else if(te==="AEN")V[i.AEN]=f.filter.operators[G]===!0;else throw new Error(`${s}initOpratorFilter: '${G}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),g=o(function(){let q=o(function(ae){V[i.RNM]=ae,V[i.UDT]=ae;let Ae=X.length+ne.length;H.length=0;for(let ge=0;ge<Ae;ge+=1)H.push(ae)},"setRules"),j,G,te=[];for(G=0;G<X.length;G+=1)te.push(X[G].lower);for(G=0;G<ne.length;G+=1)te.push(ne[G].lower);H.length=0,j=0;for(let ae in f.filter.rules)j+=1;if(j===0){q(!0);return}for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){q(!0);return}if(Ae==="<none>"){q(!1);return}}q(!1),V[i.RNM]=!0,V[i.UDT]=!0;for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(G=te.indexOf(Ae),G<0)throw new Error(`${s}initRuleFilter: '${ae}' not a valid rule or udt name`);H[G]=f.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(q,j){if(B=-1,typeof q=="number"&&q>0)I=Math.ceil(q);else{I=0;return}typeof j=="number"&&(B=Math.floor(j),B<0&&(B=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return B},this.init=function(q,j,G){R.length=0,J.length=0,Y=0,P=0,ee=G,X=q,ne=j,h(),g(),n.init(I)};let b=o(function(q){let j=!1;return q.type===i.RNM?V[q.type]&&H[q.index]?j=!0:j=!1:q.type===i.UDT?V[q.type]&&H[X.length+q.index]?j=!0:j=!1:j=V[q.type],j},"filterOps"),l=o(function(q){return B===-1||q<=B},"filterRecords");this.down=function(q,j,G,te,ae,Ae){l(Y)&&b(q)&&(J.push(Y),R[n.increment()]={dirUp:!1,depth:P,thisLine:Y,thatLine:void 0,opcode:q,state:j,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1,P+=1)},this.up=function(q,j,G,te,ae,Ae){if(l(Y)&&b(q)){let ge=Y,ie=J.pop(),Me=n.getListIndex(ie);Me!==-1&&(R[Me].thatLine=ge),P-=1,R[n.increment()]={dirUp:!0,depth:P,thisLine:ge,thatLine:ie,opcode:q,state:j,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1}};let m=o(function(){function q(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=X[Z.index].name;break;case i.UDT:F.opData=ne[Z.index].name;break;case i.BKR:Z.index<X.length?me=X[Z.index].name:me=ne[Z.index-X.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(q,"nodeOpcode");function j(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(j,"nodePhrase");let G=-1;function te(F,Z,me){let ye={id:G++,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,q(ye,Z.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=j(),q(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=j(Z.state,Z.phraseIndex,Z.phraseLength),F.down||q(F,Z.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,ie=1;function Me(F){if(ge+=1,F.branch=ie,ge>P&&(P=ge),F.children.length===0)Ae+=1;else for(let Z=0;Z<F.children.length;Z+=1)Z>0&&(ie+=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,je,Pe=!0,Je=te(null,null,-1);for(ve.push(Je),pe=Je,n.forEach(F=>{if(je=R[F],Pe&&(Pe=!1,je.depth>0)){let Z=je.dirUp?je.depth+1:je.depth;for(let me=0;me<Z;me+=1)ke=pe,pe=te(pe,null,me),ve.push(pe),ke.children.push(pe)}je.dirUp?(pe=ve.pop(),ae(pe,je),pe=ve[ve.length-1]):(ke=pe,pe=te(pe,je,je.depth),ve.push(pe),ke.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(Je.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=Je.children[0];let gr=W;for(;W&&!W.down&&!W.up;)gr=W,W=W.children[0];W=gr,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<X.length;F+=1)le.rules[F]=X[F].name;le.udts=[];for(let F=0;F<ne.length;F+=1)le.udts[F]=ne[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=P,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(q){let j=m();return q?JSON.stringify(j):j},this.toHtmlPage=function(q,j,G){return e.htmlToPage(this.toHtml(q,j),G)};let _=o(function(q,j){let G;switch(q){case u:G="hexadecimal";break;case d:G="decimal";break;case v:G="ASCII";break;case x:G="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${q}`)}let te="";return te+=`<p>display mode: ${G}</p>
307
307
  `,te+=`<table class="${t.CLASS_TRACE}">
308
- `,typeof j=="string"&&(te+=`<caption>${j}</caption>`),te},"htmlHeader"),S=o(function(){let q="";return q+=`</table>
308
+ `,typeof j=="string"&&(te+=`<caption>${j}</caption>`),te},"htmlHeader"),M=o(function(){let q="";return q+=`</table>
309
309
  `,q+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
310
310
  `,q+=`(a)&nbsp;-&nbsp;line number<br>
311
311
  `,q+=`(b)&nbsp;-&nbsp;matching line number<br>
@@ -348,11 +348,11 @@ table.apg-attrs a:hover {
348
348
  `,q+=`ABG - anchor - begin of input string<br>
349
349
  `,q+=`AEN - anchor - end of input string<br>
350
350
  `,q+=`</p>
351
- `,q},"htmlFooter");this.indent=function(q){let j="";for(let G=0;G<q;G+=1)j+=".";return j};let A=o(function(q,j){let G="";if(j.type===i.TRG)if(q===u||q===x){let te=j.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),G+=q===u?"%x":"U+",G+=te,te=j.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`),G+=`&ndash;${te}`}else G=`%d${j.min.toString(10)}&ndash;${j.max.toString(10)}`;return G},"displayTrg"),y=o(function(q,j){let G="";if(j.type===i.REP)if(q===u){let te=j.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),G=`x${te}`,j.max<1/0?(te=j.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`)):te="inf",G+=`&ndash;${te}`}else j.max<1/0?G=`${j.min.toString(10)}&ndash;${j.max.toString(10)}`:G=`${j.min.toString(10)}&ndash;inf`;return G},"displayRep"),C=o(function(q,j){let G="";if(j.type===i.TBS){let te=Math.min(j.string.length,O*2);if(q===u||q===x){G+=q===u?"%x":"U+";for(let ae=0;ae<te;ae+=1){let Ae;ae>0&&(G+="."),Ae=j.string[ae].toString(16).toUpperCase(),Ae.length%2!==0&&(Ae=`0${Ae}`),G+=Ae}}else{G="%d";for(let ae=0;ae<te;ae+=1)ae>0&&(G+="."),G+=j.string[ae].toString(10)}te<j.string.length&&(G+=he)}return G},"displayTbs"),N=o(function(q,j){let G="";if(j.type===i.TLS){let te=Math.min(j.string.length,O);if(q===u||q===d){let ae,Ae,ge;q===u?(G="%x",ge=16):(G="%d",ge=10);for(let ie=0;ie<te;ie+=1)ie>0&&(G+="."),Ae=j.string[ie],Ae>=97&&Ae<=122?(ae=Ae-32,G+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):Ae>=65&&Ae<=90?(ae=Ae,Ae+=32,G+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):G+=Ae.toString(ge).toUpperCase();te<j.string.length&&(G+=he)}else{G='"';for(let ae=0;ae<te;ae+=1)G+=e.asciiChars[j.string[ae]];te<j.string.length&&(G+=he),G+='"'}}return G},"displayTls"),w=o(function(q,j,G,te,ae){if(te===0)return"";let Ae="",ge=ae?",":"";switch(q){case u:Ae=ge+e.charsToHex(j,G,te);break;case d:if(ae)return`,${e.charsToDec(j,G,te)}`;Ae=ge+e.charsToDec(j,G,te);break;case x:Ae=e.charsToUnicode(j,G,te);break;case v:default:Ae=e.charsToAsciiHtml(j,G,te);break}return Ae},"subPhrase"),k=o(function(q,j,G,te,ae,Ae){let ge="",ie,Me,ue,ve,W=z,pe=`<span class="${t.CLASS_LOOKBEHIND}">`,ke=`<span class="${t.CLASS_REMAINDER}">`,je="</span>",Pe=!1;switch(G){case i.EMPTY:ge+=L;case i.NOMATCH:case i.MATCH:case i.ACTIVE:ie=te-ae,Me=Ae-ie,ue=Ae,ve=j.length-ue;break;default:throw new Error("unrecognized state")}return W=z,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=pe,ge+=w(q,j,ie,Me,Pe),ge+=je,Pe=!0),ve>0&&(ge+=ke,ge+=w(q,j,ue,ve,Pe),ge+=je),ge+W},"displayBehind"),fe=o(function(q,j,G,te,ae,Ae){let ge="",ie,Me,ue,ve,W=z,pe=`<span class="${t.CLASS_REMAINDER}">`,ke="</span>",je=!1;switch(G){case i.EMPTY:ge+=L;case i.NOMATCH:case i.ACTIVE:ie=te,Me=0,ue=te,ve=j.length-ue;break;case i.MATCH:ie=te,Me=ae,ue=te+Me,ve=j.length-ue;break;default:throw new Error("unrecognized state")}return W=z,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=Ae,ge+=w(q,j,ie,Me,je),ge+=ke,je=!0),ve>0&&(ge+=pe,ge+=w(q,j,ue,ve,je),ge+=ke),ge+W},"displayForward"),D=o(function(q,j,G,te,ae){let Ae=`<span class="${t.CLASS_LOOKAHEAD}">`;return fe(q,j,G,te,ae,Ae)},"displayAhead"),Q=o(function(q,j,G,te,ae){let Ae=`<span class="${t.CLASS_MATCH}">`;return fe(q,j,G,te,ae,Ae)},"displayNone"),se=o(function(q){if(X===null)return"";let j="",G,te,ae,Ae,ge,ie;return j+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",j+=`<th>operator</th><th>phrase</th></tr>
352
- `,n.forEach(Me=>{let ue=R[Me];switch(G=ue.thisLine,te=ue.thatLine!==void 0?ue.thatLine:"--",ae=!1,Ae=!1,ge=!1,ue.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,ie=ue.lookAnchor),(ue.opcode.type===i.AND||ue.opcode.type===i.NOT)&&(ae=!0,ge=!0,ie=ue.phraseIndex),ue.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,ie=ue.lookAnchor),(ue.opcode.type===i.BKA||ue.opcode.type===i.BKN)&&(Ae=!0,ge=!0,ie=ue.phraseIndex),j+="<tr>",j+=`<td>${G}</td><td>${te}</td>`,j+=`<td>${ue.phraseIndex}</td>`,j+=`<td>${ue.phraseLength}</td>`,j+=`<td>${ue.depth}</td>`,j+="<td>",ue.state){case i.ACTIVE:j+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:j+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:j+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:j+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:j+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(j+="</td>",j+="<td>",j+=f.indent(ue.depth),ae?j+=`<span class="${t.CLASS_LOOKAHEAD}">`:Ae&&(j+=`<span class="${t.CLASS_LOOKBEHIND}">`),j+=e.opcodeToString(ue.opcode.type),ue.opcode.type===i.RNM&&(j+=`(${X[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";j+=`(\\${ve}${W}${X[ue.opcode.index].name}) `}ue.opcode.type===i.UDT&&(j+=`(${ne[ue.opcode.index].name}) `),ue.opcode.type===i.TRG&&(j+=`(${A(q,ue.opcode)}) `),ue.opcode.type===i.TBS&&(j+=`(${C(q,ue.opcode)}) `),ue.opcode.type===i.TLS&&(j+=`(${N(q,ue.opcode)}) `),ue.opcode.type===i.REP&&(j+=`(${y(q,ue.opcode)}) `),ge&&(j+="</span>"),j+="</td>",j+="<td>",Ae?j+=k(q,ee,ue.state,ue.phraseIndex,ue.phraseLength,ie):ae?j+=D(q,ee,ue.state,ue.phraseIndex,ue.phraseLength):j+=Q(q,ee,ue.state,ue.phraseIndex,ue.phraseLength),j+=`</td></tr>
351
+ `,q},"htmlFooter");this.indent=function(q){let j="";for(let G=0;G<q;G+=1)j+=".";return j};let S=o(function(q,j){let G="";if(j.type===i.TRG)if(q===u||q===x){let te=j.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),G+=q===u?"%x":"U+",G+=te,te=j.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`),G+=`&ndash;${te}`}else G=`%d${j.min.toString(10)}&ndash;${j.max.toString(10)}`;return G},"displayTrg"),y=o(function(q,j){let G="";if(j.type===i.REP)if(q===u){let te=j.min.toString(16).toUpperCase();te.length%2!==0&&(te=`0${te}`),G=`x${te}`,j.max<1/0?(te=j.max.toString(16).toUpperCase(),te.length%2!==0&&(te=`0${te}`)):te="inf",G+=`&ndash;${te}`}else j.max<1/0?G=`${j.min.toString(10)}&ndash;${j.max.toString(10)}`:G=`${j.min.toString(10)}&ndash;inf`;return G},"displayRep"),C=o(function(q,j){let G="";if(j.type===i.TBS){let te=Math.min(j.string.length,O*2);if(q===u||q===x){G+=q===u?"%x":"U+";for(let ae=0;ae<te;ae+=1){let Ae;ae>0&&(G+="."),Ae=j.string[ae].toString(16).toUpperCase(),Ae.length%2!==0&&(Ae=`0${Ae}`),G+=Ae}}else{G="%d";for(let ae=0;ae<te;ae+=1)ae>0&&(G+="."),G+=j.string[ae].toString(10)}te<j.string.length&&(G+=he)}return G},"displayTbs"),N=o(function(q,j){let G="";if(j.type===i.TLS){let te=Math.min(j.string.length,O);if(q===u||q===d){let ae,Ae,ge;q===u?(G="%x",ge=16):(G="%d",ge=10);for(let ie=0;ie<te;ie+=1)ie>0&&(G+="."),Ae=j.string[ie],Ae>=97&&Ae<=122?(ae=Ae-32,G+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):Ae>=65&&Ae<=90?(ae=Ae,Ae+=32,G+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):G+=Ae.toString(ge).toUpperCase();te<j.string.length&&(G+=he)}else{G='"';for(let ae=0;ae<te;ae+=1)G+=e.asciiChars[j.string[ae]];te<j.string.length&&(G+=he),G+='"'}}return G},"displayTls"),w=o(function(q,j,G,te,ae){if(te===0)return"";let Ae="",ge=ae?",":"";switch(q){case u:Ae=ge+e.charsToHex(j,G,te);break;case d:if(ae)return`,${e.charsToDec(j,G,te)}`;Ae=ge+e.charsToDec(j,G,te);break;case x:Ae=e.charsToUnicode(j,G,te);break;case v:default:Ae=e.charsToAsciiHtml(j,G,te);break}return Ae},"subPhrase"),k=o(function(q,j,G,te,ae,Ae){let ge="",ie,Me,ue,ve,W=z,pe=`<span class="${t.CLASS_LOOKBEHIND}">`,ke=`<span class="${t.CLASS_REMAINDER}">`,je="</span>",Pe=!1;switch(G){case i.EMPTY:ge+=L;case i.NOMATCH:case i.MATCH:case i.ACTIVE:ie=te-ae,Me=Ae-ie,ue=Ae,ve=j.length-ue;break;default:throw new Error("unrecognized state")}return W=z,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=pe,ge+=w(q,j,ie,Me,Pe),ge+=je,Pe=!0),ve>0&&(ge+=ke,ge+=w(q,j,ue,ve,Pe),ge+=je),ge+W},"displayBehind"),fe=o(function(q,j,G,te,ae,Ae){let ge="",ie,Me,ue,ve,W=z,pe=`<span class="${t.CLASS_REMAINDER}">`,ke="</span>",je=!1;switch(G){case i.EMPTY:ge+=L;case i.NOMATCH:case i.ACTIVE:ie=te,Me=0,ue=te,ve=j.length-ue;break;case i.MATCH:ie=te,Me=ae,ue=te+Me,ve=j.length-ue;break;default:throw new Error("unrecognized state")}return W=z,Me>E?(Me=E,W=he,ve=0):Me+ve>E&&(W=he,ve=E-Me),Me>0&&(ge+=Ae,ge+=w(q,j,ie,Me,je),ge+=ke,je=!0),ve>0&&(ge+=pe,ge+=w(q,j,ue,ve,je),ge+=ke),ge+W},"displayForward"),D=o(function(q,j,G,te,ae){let Ae=`<span class="${t.CLASS_LOOKAHEAD}">`;return fe(q,j,G,te,ae,Ae)},"displayAhead"),Q=o(function(q,j,G,te,ae){let Ae=`<span class="${t.CLASS_MATCH}">`;return fe(q,j,G,te,ae,Ae)},"displayNone"),se=o(function(q){if(X===null)return"";let j="",G,te,ae,Ae,ge,ie;return j+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",j+=`<th>operator</th><th>phrase</th></tr>
352
+ `,n.forEach(Me=>{let ue=R[Me];switch(G=ue.thisLine,te=ue.thatLine!==void 0?ue.thatLine:"--",ae=!1,Ae=!1,ge=!1,ue.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,ie=ue.lookAnchor),(ue.opcode.type===i.AND||ue.opcode.type===i.NOT)&&(ae=!0,ge=!0,ie=ue.phraseIndex),ue.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,ie=ue.lookAnchor),(ue.opcode.type===i.BKA||ue.opcode.type===i.BKN)&&(Ae=!0,ge=!0,ie=ue.phraseIndex),j+="<tr>",j+=`<td>${G}</td><td>${te}</td>`,j+=`<td>${ue.phraseIndex}</td>`,j+=`<td>${ue.phraseLength}</td>`,j+=`<td>${ue.depth}</td>`,j+="<td>",ue.state){case i.ACTIVE:j+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:j+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:j+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:j+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:j+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(j+="</td>",j+="<td>",j+=f.indent(ue.depth),ae?j+=`<span class="${t.CLASS_LOOKAHEAD}">`:Ae&&(j+=`<span class="${t.CLASS_LOOKBEHIND}">`),j+=e.opcodeToString(ue.opcode.type),ue.opcode.type===i.RNM&&(j+=`(${X[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";j+=`(\\${ve}${W}${X[ue.opcode.index].name}) `}ue.opcode.type===i.UDT&&(j+=`(${ne[ue.opcode.index].name}) `),ue.opcode.type===i.TRG&&(j+=`(${S(q,ue.opcode)}) `),ue.opcode.type===i.TBS&&(j+=`(${C(q,ue.opcode)}) `),ue.opcode.type===i.TLS&&(j+=`(${N(q,ue.opcode)}) `),ue.opcode.type===i.REP&&(j+=`(${y(q,ue.opcode)}) `),ge&&(j+="</span>"),j+="</td>",j+="<td>",Ae?j+=k(q,ee,ue.state,ue.phraseIndex,ue.phraseLength,ie):ae?j+=D(q,ee,ue.state,ue.phraseIndex,ue.phraseLength):j+=Q(q,ee,ue.state,ue.phraseIndex,ue.phraseLength),j+=`</td></tr>
353
353
  `}),j+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",j+=`<th>operator</th><th>phrase</th></tr>
354
354
  `,j+=`</table>
355
- `,j},"htmlTable");this.toHtml=function(q,j){let G=v;if(typeof q=="string"&&q.length>=3){let ae=q.toLowerCase().slice(0,3);ae==="hex"?G=u:ae==="dec"?G=d:ae==="uni"&&(G=x)}let te="";return te+=_(G,j),te+=se(G),te+=S(),te}},"exportTrace")});var ff=Re((nJ,L5)=>{L5.exports={ast:k5(),circular:Kb(),ids:Xi(),parser:R5(),stats:N5(),trace:B5(),utils:af(),emitcss:zb(),style:al()}});var F5=Re((iJ,U5)=>{U5.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]
355
+ `,j},"htmlTable");this.toHtml=function(q,j){let G=v;if(typeof q=="string"&&q.length>=3){let ae=q.toLowerCase().slice(0,3);ae==="hex"?G=u:ae==="dec"?G=d:ae==="uni"&&(G=x)}let te="";return te+=_(G,j),te+=se(G),te+=M(),te}},"exportTrace")});var ff=Re((lJ,U5)=>{U5.exports={ast:I5(),circular:Gb(),ids:Xi(),parser:O5(),stats:P5(),trace:L5(),utils:af(),emitcss:Kb(),style:fl()}});var $5=Re((hJ,F5)=>{F5.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]
356
356
  `,t+=`line = line-text end
357
357
  `,t+=`line-text = *(valid/invalid)
358
358
  `,t+=`last-line = 1*(valid/invalid)
@@ -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 q5=Re($5=>{var Qr=Xi(),VL=af();function GL(r,e,t,n,i){return r===Qr.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}),Qr.SEM_OK}o(GL,"semLine");function WL(r,e,t,n,i){return r===Qr.SEM_PRE&&(i.textLength=n),Qr.SEM_OK}o(WL,"semLineText");function JL(r,e,t,n,i){return r===Qr.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})),Qr.SEM_OK}o(JL,"semLastLine");function YL(r,e,t,n,i){return r===Qr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${VL.charToHex(e[t])}'`}),Qr.SEM_OK}o(YL,"semInvalid");function XL(r,e,t,n,i){return r===Qr.SEM_POST&&(i.lineNo+=1),Qr.SEM_OK}o(XL,"semEnd");function ZL(r,e,t,n,i){return r===Qr.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)"})),Qr.SEM_OK}o(ZL,"semLF");function QL(r,e,t,n,i){return r===Qr.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)"})),Qr.SEM_OK}o(QL,"semCR");function eU(r,e,t,n,i){return r===Qr.SEM_PRE&&(i.endType="CRLF"),Qr.SEM_OK}o(eU,"semCRLF");var ps=[];ps.line=GL;ps["line-text"]=WL;ps["last-line"]=JL;ps.invalid=YL;ps.end=XL;ps.lf=ZL;ps.cr=QL;ps.crlf=eU;$5.callbacks=ps});var z5=Re((sJ,H5)=>{H5.exports=o(function(e,t,n,i){let s="scanner.js: ",f=ff(),u=new(F5()),{callbacks:d}=q5(),v=[],x=new f.parser;if(x.ast=new f.ast,x.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);x.trace=i}if(x.parse(u,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:v,lineNo:0,errors:t,strict:!!n};return x.ast.translate(O),v},"exfn")});var K5=Re((aJ,j5)=>{j5.exports=o(function(){let e="syntax-callbacks.js: ",t=ff(),n=t.ids,i,s=o(function(N,w,k,fe){switch(N.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),v=o(function(C,N,w,k){switch(C.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"),x=o(function(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),B=o(function(C,N,w,k){switch(C.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"),Y=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,w,C.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(N,w,C.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"),P=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,w,C.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(C,N,w){switch(C.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(C,N,w,k){switch(C.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"),X=o(function(C,N,w,k){switch(C.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"),ne=o(function(C,N,w,k){switch(C.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"),V=o(function(C,N,w){switch(C.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"),H=o(function(C,N,w,k){switch(C.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"),z=o(function(C,N,w,k){switch(C.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(C,N,w){switch(C.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"),L=o(function(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),g=o(function(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(C.phraseLength===1&&k.strict){let fe=N[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(C,N,w,k){switch(C.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"),y=o(function(C,N,w,k){switch(C.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=x,this.callbacks.basicelementerr=_,this.callbacks.clsclose=z,this.callbacks.clsopen=V,this.callbacks.clsstring=H,this.callbacks.definedaserror=v,this.callbacks.file=s,this.callbacks.groupclose=b,this.callbacks.groupopen=g,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=L,this.callbacks.repetition=y,this.callbacks.rule=f,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=X,this.callbacks.tlsclose=ne,this.callbacks.tlsopen=J,this.callbacks.tlsstring=ee,this.callbacks.udtop=P,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=Y,this.callbacks.abgop=I,this.callbacks.aenop=B},"exfn")});var G5=Re((fJ,V5)=>{V5.exports=o(function(){let e=ff(),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(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===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(ie===t.SEM_POST){let ke;W.rules.forEach(je=>{je.isBkr=!1,je.opcodes.forEach(Pe=>{Pe.type===t.RNM&&(ke=W.ruleNames.get(Pe.index.name),ke===-1?(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Rule name '${Pe.index.name}' used but not defined.`}),Pe.index=-1):Pe.index=ke.index)})}),W.udts.forEach(je=>{je.isBkr=!1}),W.rules.forEach(je=>{je.opcodes.forEach(Pe=>{Pe.type===t.BKR&&(je.hasBkr=!0,ke=W.ruleNames.get(Pe.index.name),ke!==-1?(W.rules[ke.index].isBkr=!0,Pe.index=ke.index):(ke=W.udtNames.get(Pe.index.name),ke!==-1?(W.udts[ke.index].isBkr=!0,Pe.index=W.rules.length+ke.index):(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Back reference name '${Pe.index.name}' refers to undefined rule or unamed UDT.`}),Pe.index=-1)))})})}return pe}o(u,"semFile");function d(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===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 v(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)W.ruleName="",W.definedas="";else if(ie===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(v,"semRuleLookup");function x(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===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 ie===t.SEM_POST&&(W.altStack.pop(),W.altStack.length>0?W.topStack=W.altStack[W.altStack.length-1]:W.topStack=null);return pe}o(x,"semAlternation");function E(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.topStack.alt.children.push(W.opcodes.length),W.topStack.cat={type:t.CAT,children:[]},W.opcodes.push(W.topStack.cat)):ie===t.SEM_POST&&(W.topStack.cat=null),pe}o(E,"semConcatenation");function O(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&W.topStack.cat.children.push(W.opcodes.length),pe}o(O,"semRepetition");function R(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.REP,min:0,max:1,char:ue}),pe}o(R,"semOptionOpen");function I(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.ruleName=e.utils.charsToString(Me,ue,ve)),pe}o(I,"semRuleName");function B(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="="),pe}o(B,"semDefined");function Y(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="=/"),pe}o(Y,"semIncAlt");function P(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===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)):ie===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(P,"semRepOp");function J(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(J,"semRepMin");function ee(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(ee,"semRepMax");function X(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve),W.min=W.max),pe}o(X,"semRepMinMax");function ne(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AND}),pe}o(ne,"semAndOp");function V(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.NOT}),pe}o(V,"semNotOp");function H(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.RNM,index:{phraseIndex:ue,name:e.utils.charsToString(Me,ue,ve)}}),pe}o(H,"semRnmOp");function z(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.ABG}),pe}o(z,"semAbgOp");function he(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AEN}),pe}o(he,"semAenOp");function L(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKA}),pe}o(L,"semBkaOp");function h(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKN}),pe}o(h,"semBknOp");function g(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.ci=!0,W.cs=!1,W.um=!0,W.pm=!1):ie===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(g,"semBkrOp");function b(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.ci=!0),pe}o(b,"semBkrCi");function l(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.cs=!0),pe}o(l,"semBkrCs");function m(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.um=!0),pe}o(m,"semBkrUm");function _(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.pm=!0),pe}o(_,"semBkrPm");function S(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.bkrname={phraseIndex:ue,phraseLength:ve}),pe}o(S,"semBkrName");function A(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),je=W.udtNames.add(ke);if(je===-1){if(je=W.udtNames.get(ke),je===-1)throw new Error("semUdtEmpty: name look up error")}else W.udts.push({name:je.name,lower:je.lower,index:je.index,empty:!0});W.opcodes.push({type:t.UDT,empty:!0,index:je.index})}return pe}o(A,"semUdtEmpty");function y(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),je=W.udtNames.add(ke);if(je===-1){if(je=W.udtNames.get(ke),je===-1)throw new Error("semUdtNonEmpty: name look up error")}else W.udts.push({name:je.name,lower:je.lower,index:je.index,empty:!1});W.opcodes.push({type:t.UDT,empty:!1,index:je.index,syntax:null,semantic:null})}return pe}o(y,"semUdtNonEmpty");function C(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.tlscase=!0),pe}o(C,"semTlsOp");function N(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&ve>0&&(Me[ue+1]===83||Me[ue+1]===115)&&(W.tlscase=!1),pe}o(N,"semTlsCase");function w(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST)if(W.tlscase){let ke=Me.slice(ue,ue+ve);for(let je=0;je<ke.length;je+=1)ke[je]>=65&&ke[je]<=90&&(ke[je]+=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(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===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(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?W.tbsstr=[]:ie===t.SEM_POST&&W.opcodes.push({type:t.TBS,string:W.tbsstr}),pe}o(fe,"semTbsOp");function D(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.min=0,W.max=0):ie===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(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(Q,"semDmin");function se(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(se,"semDmax");function q(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=s(Me,ue,ve)),pe}o(q,"semBmin");function j(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=s(Me,ue,ve)),pe}o(j,"semBmax");function G(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=f(Me,ue,ve)),pe}o(G,"semXmin");function te(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=f(Me,ue,ve)),pe}o(te,"semXmax");function ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(i(Me,ue,ve)),pe}o(ae,"semDstring");function Ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(s(Me,ue,ve)),pe}o(Ae,"semBstring");function ge(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(f(Me,ue,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=z,this.callbacks.aenop=he,this.callbacks.alternation=x,this.callbacks.andop=ne,this.callbacks.bmax=j,this.callbacks.bmin=q,this.callbacks.bkaop=L,this.callbacks.bknop=h,this.callbacks.bkrop=g,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=B,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=Y,this.callbacks.notop=V,this.callbacks.optionopen=R,this.callbacks["rep-max"]=ee,this.callbacks["rep-min"]=J,this.callbacks["rep-min-max"]=X,this.callbacks.repetition=O,this.callbacks.repop=P,this.callbacks.rnmop=H,this.callbacks.rule=d,this.callbacks.rulelookup=v,this.callbacks.rulename=I,this.callbacks.tbsop=fe,this.callbacks.tlscase=N,this.callbacks.tlsstring=w,this.callbacks.tlsop=C,this.callbacks.trgop=D,this.callbacks["udt-empty"]=A,this.callbacks["udt-non-empty"]=y,this.callbacks.xmax=te,this.callbacks.xmin=G,this.callbacks.xstring=ge},"exfn")});var J5=Re((cJ,W5)=>{W5.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 H5=Re(q5=>{var Qr=Xi(),YL=af();function XL(r,e,t,n,i){return r===Qr.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}),Qr.SEM_OK}o(XL,"semLine");function ZL(r,e,t,n,i){return r===Qr.SEM_PRE&&(i.textLength=n),Qr.SEM_OK}o(ZL,"semLineText");function QL(r,e,t,n,i){return r===Qr.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})),Qr.SEM_OK}o(QL,"semLastLine");function eU(r,e,t,n,i){return r===Qr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${YL.charToHex(e[t])}'`}),Qr.SEM_OK}o(eU,"semInvalid");function tU(r,e,t,n,i){return r===Qr.SEM_POST&&(i.lineNo+=1),Qr.SEM_OK}o(tU,"semEnd");function rU(r,e,t,n,i){return r===Qr.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)"})),Qr.SEM_OK}o(rU,"semLF");function nU(r,e,t,n,i){return r===Qr.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)"})),Qr.SEM_OK}o(nU,"semCR");function iU(r,e,t,n,i){return r===Qr.SEM_PRE&&(i.endType="CRLF"),Qr.SEM_OK}o(iU,"semCRLF");var ps=[];ps.line=XL;ps["line-text"]=ZL;ps["last-line"]=QL;ps.invalid=eU;ps.end=tU;ps.lf=rU;ps.cr=nU;ps.crlf=iU;q5.callbacks=ps});var j5=Re((pJ,z5)=>{z5.exports=o(function(e,t,n,i){let s="scanner.js: ",f=ff(),u=new($5()),{callbacks:d}=H5(),v=[],x=new f.parser;if(x.ast=new f.ast,x.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);x.trace=i}if(x.parse(u,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:v,lineNo:0,errors:t,strict:!!n};return x.ast.translate(O),v},"exfn")});var V5=Re((mJ,K5)=>{K5.exports=o(function(){let e="syntax-callbacks.js: ",t=ff(),n=t.ids,i,s=o(function(N,w,k,fe){switch(N.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),v=o(function(C,N,w,k){switch(C.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"),x=o(function(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),B=o(function(C,N,w,k){switch(C.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"),Y=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,w,C.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(N,w,C.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"),P=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,w,C.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(C,N,w){switch(C.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(C,N,w,k){switch(C.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"),X=o(function(C,N,w,k){switch(C.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"),ne=o(function(C,N,w,k){switch(C.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"),V=o(function(C,N,w){switch(C.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"),H=o(function(C,N,w,k){switch(C.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"),z=o(function(C,N,w,k){switch(C.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(C,N,w){switch(C.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"),L=o(function(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),g=o(function(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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(C,N,w,k){switch(C.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"),M=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(C.phraseLength===1&&k.strict){let fe=N[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"),S=o(function(C,N,w,k){switch(C.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"),y=o(function(C,N,w,k){switch(C.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=x,this.callbacks.basicelementerr=_,this.callbacks.clsclose=z,this.callbacks.clsopen=V,this.callbacks.clsstring=H,this.callbacks.definedaserror=v,this.callbacks.file=s,this.callbacks.groupclose=b,this.callbacks.groupopen=g,this.callbacks.lineenderror=S,this.callbacks.lineend=M,this.callbacks.notop=E,this.callbacks.optionclose=m,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=he,this.callbacks.prosvalstring=L,this.callbacks.repetition=y,this.callbacks.rule=f,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=X,this.callbacks.tlsclose=ne,this.callbacks.tlsopen=J,this.callbacks.tlsstring=ee,this.callbacks.udtop=P,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=Y,this.callbacks.abgop=I,this.callbacks.aenop=B},"exfn")});var W5=Re((bJ,G5)=>{G5.exports=o(function(){let e=ff(),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(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===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(ie===t.SEM_POST){let ke;W.rules.forEach(je=>{je.isBkr=!1,je.opcodes.forEach(Pe=>{Pe.type===t.RNM&&(ke=W.ruleNames.get(Pe.index.name),ke===-1?(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Rule name '${Pe.index.name}' used but not defined.`}),Pe.index=-1):Pe.index=ke.index)})}),W.udts.forEach(je=>{je.isBkr=!1}),W.rules.forEach(je=>{je.opcodes.forEach(Pe=>{Pe.type===t.BKR&&(je.hasBkr=!0,ke=W.ruleNames.get(Pe.index.name),ke!==-1?(W.rules[ke.index].isBkr=!0,Pe.index=ke.index):(ke=W.udtNames.get(Pe.index.name),ke!==-1?(W.udts[ke.index].isBkr=!0,Pe.index=W.rules.length+ke.index):(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Back reference name '${Pe.index.name}' refers to undefined rule or unamed UDT.`}),Pe.index=-1)))})})}return pe}o(u,"semFile");function d(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===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 v(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)W.ruleName="",W.definedas="";else if(ie===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(v,"semRuleLookup");function x(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===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 ie===t.SEM_POST&&(W.altStack.pop(),W.altStack.length>0?W.topStack=W.altStack[W.altStack.length-1]:W.topStack=null);return pe}o(x,"semAlternation");function E(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.topStack.alt.children.push(W.opcodes.length),W.topStack.cat={type:t.CAT,children:[]},W.opcodes.push(W.topStack.cat)):ie===t.SEM_POST&&(W.topStack.cat=null),pe}o(E,"semConcatenation");function O(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&W.topStack.cat.children.push(W.opcodes.length),pe}o(O,"semRepetition");function R(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.REP,min:0,max:1,char:ue}),pe}o(R,"semOptionOpen");function I(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.ruleName=e.utils.charsToString(Me,ue,ve)),pe}o(I,"semRuleName");function B(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="="),pe}o(B,"semDefined");function Y(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="=/"),pe}o(Y,"semIncAlt");function P(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===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)):ie===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(P,"semRepOp");function J(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(J,"semRepMin");function ee(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(ee,"semRepMax");function X(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve),W.min=W.max),pe}o(X,"semRepMinMax");function ne(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AND}),pe}o(ne,"semAndOp");function V(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.NOT}),pe}o(V,"semNotOp");function H(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.RNM,index:{phraseIndex:ue,name:e.utils.charsToString(Me,ue,ve)}}),pe}o(H,"semRnmOp");function z(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.ABG}),pe}o(z,"semAbgOp");function he(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AEN}),pe}o(he,"semAenOp");function L(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKA}),pe}o(L,"semBkaOp");function h(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKN}),pe}o(h,"semBknOp");function g(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.ci=!0,W.cs=!1,W.um=!0,W.pm=!1):ie===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(g,"semBkrOp");function b(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.ci=!0),pe}o(b,"semBkrCi");function l(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.cs=!0),pe}o(l,"semBkrCs");function m(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.um=!0),pe}o(m,"semBkrUm");function _(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.pm=!0),pe}o(_,"semBkrPm");function M(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.bkrname={phraseIndex:ue,phraseLength:ve}),pe}o(M,"semBkrName");function S(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),je=W.udtNames.add(ke);if(je===-1){if(je=W.udtNames.get(ke),je===-1)throw new Error("semUdtEmpty: name look up error")}else W.udts.push({name:je.name,lower:je.lower,index:je.index,empty:!0});W.opcodes.push({type:t.UDT,empty:!0,index:je.index})}return pe}o(S,"semUdtEmpty");function y(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),je=W.udtNames.add(ke);if(je===-1){if(je=W.udtNames.get(ke),je===-1)throw new Error("semUdtNonEmpty: name look up error")}else W.udts.push({name:je.name,lower:je.lower,index:je.index,empty:!1});W.opcodes.push({type:t.UDT,empty:!1,index:je.index,syntax:null,semantic:null})}return pe}o(y,"semUdtNonEmpty");function C(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.tlscase=!0),pe}o(C,"semTlsOp");function N(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&ve>0&&(Me[ue+1]===83||Me[ue+1]===115)&&(W.tlscase=!1),pe}o(N,"semTlsCase");function w(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST)if(W.tlscase){let ke=Me.slice(ue,ue+ve);for(let je=0;je<ke.length;je+=1)ke[je]>=65&&ke[je]<=90&&(ke[je]+=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(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===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(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?W.tbsstr=[]:ie===t.SEM_POST&&W.opcodes.push({type:t.TBS,string:W.tbsstr}),pe}o(fe,"semTbsOp");function D(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.min=0,W.max=0):ie===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(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(Q,"semDmin");function se(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(se,"semDmax");function q(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=s(Me,ue,ve)),pe}o(q,"semBmin");function j(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=s(Me,ue,ve)),pe}o(j,"semBmax");function G(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=f(Me,ue,ve)),pe}o(G,"semXmin");function te(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=f(Me,ue,ve)),pe}o(te,"semXmax");function ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(i(Me,ue,ve)),pe}o(ae,"semDstring");function Ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(s(Me,ue,ve)),pe}o(Ae,"semBstring");function ge(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(f(Me,ue,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=z,this.callbacks.aenop=he,this.callbacks.alternation=x,this.callbacks.andop=ne,this.callbacks.bmax=j,this.callbacks.bmin=q,this.callbacks.bkaop=L,this.callbacks.bknop=h,this.callbacks.bkrop=g,this.callbacks["bkr-name"]=M,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=B,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=Y,this.callbacks.notop=V,this.callbacks.optionopen=R,this.callbacks["rep-max"]=ee,this.callbacks["rep-min"]=J,this.callbacks["rep-min-max"]=X,this.callbacks.repetition=O,this.callbacks.repop=P,this.callbacks.rnmop=H,this.callbacks.rule=d,this.callbacks.rulelookup=v,this.callbacks.rulename=I,this.callbacks.tbsop=fe,this.callbacks.tlscase=N,this.callbacks.tlsstring=w,this.callbacks.tlsop=C,this.callbacks.trgop=D,this.callbacks["udt-empty"]=S,this.callbacks["udt-non-empty"]=y,this.callbacks.xmax=te,this.callbacks.xmin=G,this.callbacks.xstring=ge},"exfn")});var Y5=Re((gJ,J5)=>{J5.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,7 +533,7 @@ 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 X5=Re((uJ,Y5)=>{Y5.exports=o(function(){let e="parser: ",t=ff(),n=t.ids,i=new(K5()),s=new(G5()),f=new(J5()),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 B=0;B<O.length;B+=1)if(R>=O[B].beginChar&&R<O[B].beginChar+O[B].length)return B;return-1},"findLine"),v=o(function(O,R){let I=-1;if(R<O.length){for(let B=R;B<O.length;B+=1)if(O[B]!==null){I=O[B];break}}return I},"translateIndex"),x=o(function(O){O.forEach(R=>{let I=[],B=[],Y=0;R.opcodes.forEach(P=>{P.type===n.ALT&&P.children.length===1||P.type===n.CAT&&P.children.length===1||P.type===n.REP&&P.min===1&&P.max===1?B.push(null):(B.push(Y),I.push(P),Y+=1)}),B.push(Y),I.forEach(P=>{if(P.type===n.ALT||P.type===n.CAT)for(let J=0;J<P.children.length;J+=1)P.children[J]=v(B,P.children[J])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,B,Y,P){if(P){if(P.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=P}let J={};J.errors=I,J.strict=!!B,J.lite=!!Y,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 B={};return B.errors=I,B.lines=R,B.findLine=d,B.charsLength=O.length,u.ast.translate(B),I.length?null:(x(B.rules),{rules:B.rules,udts:B.udts,lineMap:B.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,B,Y){let P="",J=!1,ee=!1;Y&&(Y.typescript?(J=!0,ee=!1):Y.lite&&(J=!1,ee=!0));let X,ne,V,H=0,z=1/0,he=0,L=[],h=[],g=0,b=0,l=0,m=0,_=0,S=0,A=0,y=0,C=0,N=0,w=0,k=0,fe=0,D=0,Q=0;I.forEach(q=>{L.push(q.lower),H+=q.opcodes.length,q.opcodes.forEach(j=>{switch(j.type){case n.ALT:g+=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(y+=1,X=0;X<j.string.length;X+=1)j.string[X]<z&&(z=j.string[X]),j.string[X]>he&&(he=j.string[X]);break;case n.TBS:for(C+=1,X=0;X<j.string.length;X+=1)j.string[X]<z&&(z=j.string[X]),j.string[X]>he&&(he=j.string[X]);break;case n.TRG:N+=1,j.min<z&&(z=j.min),j.max>he&&(he=j.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),L.sort(),B.length>0&&(B.forEach(q=>{h.push(q.lower)}),h.sort()),P+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
536
+ `,t},"toString")},"grammar")});var Z5=Re((vJ,X5)=>{X5.exports=o(function(){let e="parser: ",t=ff(),n=t.ids,i=new(V5()),s=new(W5()),f=new(Y5()),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 B=0;B<O.length;B+=1)if(R>=O[B].beginChar&&R<O[B].beginChar+O[B].length)return B;return-1},"findLine"),v=o(function(O,R){let I=-1;if(R<O.length){for(let B=R;B<O.length;B+=1)if(O[B]!==null){I=O[B];break}}return I},"translateIndex"),x=o(function(O){O.forEach(R=>{let I=[],B=[],Y=0;R.opcodes.forEach(P=>{P.type===n.ALT&&P.children.length===1||P.type===n.CAT&&P.children.length===1||P.type===n.REP&&P.min===1&&P.max===1?B.push(null):(B.push(Y),I.push(P),Y+=1)}),B.push(Y),I.forEach(P=>{if(P.type===n.ALT||P.type===n.CAT)for(let J=0;J<P.children.length;J+=1)P.children[J]=v(B,P.children[J])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,B,Y,P){if(P){if(P.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=P}let J={};J.errors=I,J.strict=!!B,J.lite=!!Y,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 B={};return B.errors=I,B.lines=R,B.findLine=d,B.charsLength=O.length,u.ast.translate(B),I.length?null:(x(B.rules),{rules:B.rules,udts:B.udts,lineMap:B.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,B,Y){let P="",J=!1,ee=!1;Y&&(Y.typescript?(J=!0,ee=!1):Y.lite&&(J=!1,ee=!0));let X,ne,V,H=0,z=1/0,he=0,L=[],h=[],g=0,b=0,l=0,m=0,_=0,M=0,S=0,y=0,C=0,N=0,w=0,k=0,fe=0,D=0,Q=0;I.forEach(q=>{L.push(q.lower),H+=q.opcodes.length,q.opcodes.forEach(j=>{switch(j.type){case n.ALT:g+=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:M+=1;break;case n.NOT:S+=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(y+=1,X=0;X<j.string.length;X+=1)j.string[X]<z&&(z=j.string[X]),j.string[X]>he&&(he=j.string[X]);break;case n.TBS:for(C+=1,X=0;X<j.string.length;X+=1)j.string[X]<z&&(z=j.string[X]),j.string[X]>he&&(he=j.string[X]);break;case n.TRG:N+=1,j.min<z&&(z=j.min),j.max>he&&(he=j.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),L.sort(),B.length>0&&(B.forEach(q=>{h.push(q.lower)}),h.sort()),P+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
537
537
  `,P+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
538
538
  `,P+=`//
539
539
  `,P+=`// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
@@ -556,8 +556,8 @@ table.apg-attrs a:hover {
556
556
  `,P+=` // TRG = ${N}
557
557
  `,P+=` // --- SABNF superset opcodes
558
558
  `,P+=` // UDT = ${m}
559
- `,P+=` // AND = ${S}
560
- `,P+=` // NOT = ${A}
559
+ `,P+=` // AND = ${M}
560
+ `,P+=` // NOT = ${S}
561
561
  `,ee||(P+=` // BKA = ${k}
562
562
  `,P+=` // BKN = ${fe}
563
563
  `,P+=` // BKR = ${w}
@@ -601,7 +601,7 @@ table.apg-attrs a:hover {
601
601
  `}),P+=` return str;
602
602
  `,P+=` }
603
603
  `,P+=`}
604
- `,P},"generateSource"),this.generateObject=o(function(O,R,I){let B={},Y=[],P=[],J=O.slice(0);return B.grammarObject="grammarObject",R.forEach(ee=>{Y.push(ee.lower)}),Y.sort(),I.length>0&&(I.forEach(ee=>{P.push(ee.lower)}),P.sort()),B.callbacks=[],Y.forEach(ee=>{B.callbacks[ee]=!1}),I.length>0&&P.forEach(ee=>{B.callbacks[ee]=!1}),B.rules=R,B.udts=I,B.toString=o(function(){return J},"toStringFunc"),B},"generateObject")},"exportParser")});var Q5=Re((lJ,Z5)=>{Z5.exports=o(function(){let e=Xi(),t="rule-attributes.js",n=null;function i(L){return L.left||L.nested||L.right||L.cyclic?!1:L.empty}o(i,"isEmptyOnly");function s(L){return!!(L.left||L.nested||L.right||L.cyclic)}o(s,"isRecursive");function f(L,h){let g=0,b=0,l=0;for(g=0;g<h;g+=1)if(L[g].nested)return!0;for(g=0;g<h;g+=1)if(L[g].right&&!L[g].leaf){for(b=g+1;b<h;b+=1)if(!i(L[b]))return!0}for(g=h-1;g>=0;g-=1)if(L[g].left&&!L[g].leaf){for(b=g-1;b>=0;b-=1)if(!i(L[b]))return!0}for(g=0;g<h;g+=1)if(!L[g].empty&&!s(L[g])){for(b=g+1;b<h;b+=1)if(s(L[b])){for(l=b+1;l<h;l+=1)if(!L[l].empty&&!s(L[l]))return!0}}return!1}o(f,"isCatNested");function u(L,h){for(let g=0;g<h;g+=1)if(!L[g].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(L,h){for(let g=0;g<h;g+=1){if(L[g].left)return!0;if(!L[g].empty)return!1}return!1}o(d,"isCatLeft");function v(L,h){for(let g=h-1;g>=0;g-=1){if(L[g].right)return!0;if(!L[g].empty)return!1}return!1}o(v,"isCatRight");function x(L,h){for(let g=0;g<h;g+=1)if(!L[g].empty)return!1;return!0}o(x,"isCatEmpty");function E(L,h){for(let g=0;g<h;g+=1)if(!L[g].finite)return!1;return!0}o(E,"isCatFinite");function O(L,h,g,b){let l=0,m=h[g],_=m.children.length,S=[];for(l=0;l<_;l+=1)S.push(L.attrGen());for(l=0;l<_;l+=1)B(L,h,m.children[l],S[l]);b.left=d(S,_),b.right=v(S,_),b.nested=f(S,_),b.empty=x(S,_),b.finite=E(S,_),b.cyclic=u(S,_)}o(O,"cat");function R(L,h,g,b){let l=0,m=h[g],_=m.children.length,S=[];for(l=0;l<_;l+=1)S.push(L.attrGen());for(l=0;l<_;l+=1)B(L,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(L,h,g,b){let l=h[g];l.index>=L.ruleCount?(b.empty=L.udts[l.index-L.ruleCount].empty,b.finite=!0):(Y(L,l.index,b),b.left=!1,b.nested=!1,b.right=!1,b.cyclic=!1)}o(I,"bkr");function B(L,h,g,b){L.attrInit(b);let l=h[g];switch(l.type){case e.ALT:R(L,h,g,b);break;case e.CAT:O(L,h,g,b);break;case e.REP:B(L,h,g+1,b),l.min===0&&(b.empty=!0,b.finite=!0);break;case e.RNM:Y(L,h[g].index,b);break;case e.BKR:I(L,h,g,b);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:B(L,h,g+1,b),b.empty=!0;break;case e.TLS:b.empty=!h[g].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(B,"opEval");function Y(L,h,g){let b=L.attrsWorking[h];b.isComplete?L.attrCopy(g,b):b.isOpen?h===L.startRule?h===L.startRule&&(g.left=!0,g.right=!0,g.cyclic=!0,g.leaf=!0):g.finite=!0:(b.isOpen=!0,B(L,b.rule.opcodes,0,g),b.left=g.left,b.right=g.right,b.nested=g.nested,b.empty=g.empty,b.finite=g.finite,b.cyclic=g.cyclic,b.leaf=!1,b.isOpen=!1,b.isComplete=!0)}o(Y,"ruleAttrsEval");let P=o(L=>{n=L;let h=0,g=0,b=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(g=0;g<n.ruleCount;g+=1)n.attrInit(n.attrsWorking[g]);n.startRule=h,Y(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(L=>L?"t":"f","truth"),ee=o(L=>L?"e":"f","tError"),X=o(L=>L?"t":"e","fError"),ne=o((L,h,g,b)=>{let l=`${L}:${h}:`;return l+=`${ee(g.left)} `,l+=`${J(g.nested)} `,l+=`${J(g.right)} `,l+=`${ee(g.cyclic)} `,l+=`${X(g.finite)} `,l+=`${J(g.empty)}:`,l+=`${n.typeToString(b.recursiveType)}:`,l+=b.recursiveType===e.ATTR_MR?b.groupNumber:"-",l+=`:${g.rule.name}
604
+ `,P},"generateSource"),this.generateObject=o(function(O,R,I){let B={},Y=[],P=[],J=O.slice(0);return B.grammarObject="grammarObject",R.forEach(ee=>{Y.push(ee.lower)}),Y.sort(),I.length>0&&(I.forEach(ee=>{P.push(ee.lower)}),P.sort()),B.callbacks=[],Y.forEach(ee=>{B.callbacks[ee]=!1}),I.length>0&&P.forEach(ee=>{B.callbacks[ee]=!1}),B.rules=R,B.udts=I,B.toString=o(function(){return J},"toStringFunc"),B},"generateObject")},"exportParser")});var e8=Re((yJ,Q5)=>{Q5.exports=o(function(){let e=Xi(),t="rule-attributes.js",n=null;function i(L){return L.left||L.nested||L.right||L.cyclic?!1:L.empty}o(i,"isEmptyOnly");function s(L){return!!(L.left||L.nested||L.right||L.cyclic)}o(s,"isRecursive");function f(L,h){let g=0,b=0,l=0;for(g=0;g<h;g+=1)if(L[g].nested)return!0;for(g=0;g<h;g+=1)if(L[g].right&&!L[g].leaf){for(b=g+1;b<h;b+=1)if(!i(L[b]))return!0}for(g=h-1;g>=0;g-=1)if(L[g].left&&!L[g].leaf){for(b=g-1;b>=0;b-=1)if(!i(L[b]))return!0}for(g=0;g<h;g+=1)if(!L[g].empty&&!s(L[g])){for(b=g+1;b<h;b+=1)if(s(L[b])){for(l=b+1;l<h;l+=1)if(!L[l].empty&&!s(L[l]))return!0}}return!1}o(f,"isCatNested");function u(L,h){for(let g=0;g<h;g+=1)if(!L[g].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(L,h){for(let g=0;g<h;g+=1){if(L[g].left)return!0;if(!L[g].empty)return!1}return!1}o(d,"isCatLeft");function v(L,h){for(let g=h-1;g>=0;g-=1){if(L[g].right)return!0;if(!L[g].empty)return!1}return!1}o(v,"isCatRight");function x(L,h){for(let g=0;g<h;g+=1)if(!L[g].empty)return!1;return!0}o(x,"isCatEmpty");function E(L,h){for(let g=0;g<h;g+=1)if(!L[g].finite)return!1;return!0}o(E,"isCatFinite");function O(L,h,g,b){let l=0,m=h[g],_=m.children.length,M=[];for(l=0;l<_;l+=1)M.push(L.attrGen());for(l=0;l<_;l+=1)B(L,h,m.children[l],M[l]);b.left=d(M,_),b.right=v(M,_),b.nested=f(M,_),b.empty=x(M,_),b.finite=E(M,_),b.cyclic=u(M,_)}o(O,"cat");function R(L,h,g,b){let l=0,m=h[g],_=m.children.length,M=[];for(l=0;l<_;l+=1)M.push(L.attrGen());for(l=0;l<_;l+=1)B(L,h,m.children[l],M[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)M[l].left&&(b.left=!0),M[l].nested&&(b.nested=!0),M[l].right&&(b.right=!0),M[l].empty&&(b.empty=!0),M[l].finite&&(b.finite=!0),M[l].cyclic&&(b.cyclic=!0)}o(R,"alt");function I(L,h,g,b){let l=h[g];l.index>=L.ruleCount?(b.empty=L.udts[l.index-L.ruleCount].empty,b.finite=!0):(Y(L,l.index,b),b.left=!1,b.nested=!1,b.right=!1,b.cyclic=!1)}o(I,"bkr");function B(L,h,g,b){L.attrInit(b);let l=h[g];switch(l.type){case e.ALT:R(L,h,g,b);break;case e.CAT:O(L,h,g,b);break;case e.REP:B(L,h,g+1,b),l.min===0&&(b.empty=!0,b.finite=!0);break;case e.RNM:Y(L,h[g].index,b);break;case e.BKR:I(L,h,g,b);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:B(L,h,g+1,b),b.empty=!0;break;case e.TLS:b.empty=!h[g].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(B,"opEval");function Y(L,h,g){let b=L.attrsWorking[h];b.isComplete?L.attrCopy(g,b):b.isOpen?h===L.startRule?h===L.startRule&&(g.left=!0,g.right=!0,g.cyclic=!0,g.leaf=!0):g.finite=!0:(b.isOpen=!0,B(L,b.rule.opcodes,0,g),b.left=g.left,b.right=g.right,b.nested=g.nested,b.empty=g.empty,b.finite=g.finite,b.cyclic=g.cyclic,b.leaf=!1,b.isOpen=!1,b.isComplete=!0)}o(Y,"ruleAttrsEval");let P=o(L=>{n=L;let h=0,g=0,b=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(g=0;g<n.ruleCount;g+=1)n.attrInit(n.attrsWorking[g]);n.startRule=h,Y(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(L=>L?"t":"f","truth"),ee=o(L=>L?"e":"f","tError"),X=o(L=>L?"t":"e","fError"),ne=o((L,h,g,b)=>{let l=`${L}:${h}:`;return l+=`${ee(g.left)} `,l+=`${J(g.nested)} `,l+=`${J(g.right)} `,l+=`${ee(g.cyclic)} `,l+=`${X(g.finite)} `,l+=`${J(g.empty)}:`,l+=`${n.typeToString(b.recursiveType)}:`,l+=b.recursiveType===e.ATTR_MR?b.groupNumber:"-",l+=`:${g.rule.name}
605
605
  `,l},"showAttr"),V=o(()=>{let L=`LEGEND - t=true, f=false, e=error
606
606
  `;return L+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
607
607
  `,L},"showLegend"),H=o(()=>{let L=null,h=null,g="";if(g+=`RULE ATTRIBUTES WITH ERRORS
@@ -610,7 +610,7 @@ table.apg-attrs a:hover {
610
610
  `;return L.charCodeAt(0)===97?(h+=`alphabetical by rule name
611
611
  `,h+=g,h+=V(),h+=z(97)):L.charCodeAt(0)===116?(h+=`ordered by rule type
612
612
  `,h+=g,h+=V(),h+=z(116)):(h+=`ordered by rule index
613
- `,h+=g,h+=V(),h+=z()),h},"showAttributes"),showAttributeErrors:H}},"exportRuleAttributes")()});var t8=Re((hJ,e8)=>{e8.exports=(()=>{let r=Xi(),e=null,t=o((f,u,d,v)=>{let x=0,E=0,O=u[d];v[d]=!0;let R=O.rule.opcodes;for(x=0;x<R.length;x+=1){let I=R[x];if(I.type===r.RNM)for(O.refersTo[I.index]=!0,v[I.index]||t(f,u,I.index,v),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,v[I.index]||t(f,u,I.index,v)):O.refersToUdt[f-I.index]=!0)}},"scan"),n=o(f=>{e=f;let u=0,d=0,v=0,x=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(v=-1,u=0;u<e.ruleCount;u+=1)if(x=e.ruleDeps[u],x.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&&x.refersTo[d]&&E.refersTo[u]&&(O&&(v+=1,x.recursiveType=r.ATTR_MR,x.groupNumber=v,O=!1),E.recursiveType=r.ATTR_MR,E.groupNumber=v));e.isMutuallyRecursive=v>-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,v=0,x=0,E=e.ruleCount-1,O=e.udtCount-1,R=100,I="",B="",Y="=> ",P="<= ",J=!1,ee=null,{ruleIndexes:X}=e,{udtIndexes:ne}=e;for(f===97?(X=e.ruleAlphaIndexes,ne=e.udtAlphaIndexes):f===116&&(X=e.ruleTypeIndexes,ne=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(ee=e.ruleDeps[X[u]],B=`${X[u]}:${e.typeToString(ee.recursiveType)}:`,e.isMutuallyRecursive&&(B+=ee.groupNumber>-1?ee.groupNumber:"-",B+=":"),B+=" ",I+=`${B+e.rules[X[u]].name}
613
+ `,h+=g,h+=V(),h+=z()),h},"showAttributes"),showAttributeErrors:H}},"exportRuleAttributes")()});var r8=Re((xJ,t8)=>{t8.exports=(()=>{let r=Xi(),e=null,t=o((f,u,d,v)=>{let x=0,E=0,O=u[d];v[d]=!0;let R=O.rule.opcodes;for(x=0;x<R.length;x+=1){let I=R[x];if(I.type===r.RNM)for(O.refersTo[I.index]=!0,v[I.index]||t(f,u,I.index,v),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,v[I.index]||t(f,u,I.index,v)):O.refersToUdt[f-I.index]=!0)}},"scan"),n=o(f=>{e=f;let u=0,d=0,v=0,x=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(v=-1,u=0;u<e.ruleCount;u+=1)if(x=e.ruleDeps[u],x.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&&x.refersTo[d]&&E.refersTo[u]&&(O&&(v+=1,x.recursiveType=r.ATTR_MR,x.groupNumber=v,O=!1),E.recursiveType=r.ATTR_MR,E.groupNumber=v));e.isMutuallyRecursive=v>-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,v=0,x=0,E=e.ruleCount-1,O=e.udtCount-1,R=100,I="",B="",Y="=> ",P="<= ",J=!1,ee=null,{ruleIndexes:X}=e,{udtIndexes:ne}=e;for(f===97?(X=e.ruleAlphaIndexes,ne=e.udtAlphaIndexes):f===116&&(X=e.ruleTypeIndexes,ne=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(ee=e.ruleDeps[X[u]],B=`${X[u]}:${e.typeToString(ee.recursiveType)}:`,e.isMutuallyRecursive&&(B+=ee.groupNumber>-1?ee.groupNumber:"-",B+=":"),B+=" ",I+=`${B+e.rules[X[u]].name}
614
614
  `,J=!0,v=0,x=I.length,I+=B,d=0;d<e.ruleCount;d+=1)ee.refersTo[X[d]]&&(J?(I+=Y,J=!1,I+=e.ruleDeps[X[d]].rule.name):I+=`, ${e.ruleDeps[X[d]].rule.name}`,v+=1),I.length-x>R&&d!==E&&(I+=`
615
615
  ${B}${Y}`,x=I.length);if(e.udtCount)for(d=0;d<e.udtCount;d+=1)ee.refersToUdt[ne[d]]&&(J?(I+=Y,J=!1,I+=e.udts[ne[d]].name):I+=`, ${e.udts[ne[d]].name}`,v+=1),I.length-x>R&&d!==O&&(I+=`
616
616
  ${B}${Y}`,x=I.length);for(v===0&&(I+=`=> <none>
@@ -625,35 +625,35 @@ ${B}${Y}`,x=I.length);v===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 n8=Re((dJ,r8)=>{r8.exports=o(function(){let e=Xi(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=Q5(),{ruleDependencies:s,showRuleDependencies:f}=t8();class u{constructor(x,E){this.rules=x,this.udts=E,this.ruleCount=x.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(x[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(x){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:x}}attrInit(x){x.left=!1,x.nested=!1,x.right=!1,x.empty=!1,x.finite=!1,x.cyclic=!1,x.leaf=!1,x.isOpen=!1,x.isComplete=!1}attrCopy(x,E){x.left=E.left,x.nested=E.nested,x.right=E.right,x.empty=E.empty,x.finite=E.finite,x.cyclic=E.cyclic,x.leaf=E.leaf,x.isOpen=E.isOpen,x.isComplete=E.isComplete,x.rule=E.rule}rdGen(x,E,O){return{rule:x,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(E),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(E)}}typeToString(x){switch(x){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(x){let E=[];if(x>0)for(let O=0;O<x;O+=1)E.push(!1);return E}falsifyArray(x){for(let E=0;E<x.length;E+=1)x[E]=!1}indexArray(x){let E=[];if(x>0)for(let O=0;O<x;O+=1)E.push(O);return E}compRulesAlpha(x,E){return this.rules[x].lower<this.rules[E].lower?-1:this.rules[x].lower>this.rules[E].lower?1:0}compUdtsAlpha(x,E){return this.udts[x].lower<this.udts[E].lower?-1:this.udts[x].lower>this.udts[E].lower?1:0}compRulesType(x,E){return this.ruleDeps[x].recursiveType<this.ruleDeps[E].recursiveType?-1:this.ruleDeps[x].recursiveType>this.ruleDeps[E].recursiveType?1:0}compRulesGroup(x,E){if(this.ruleDeps[x].recursiveType===e.ATTR_MR&&this.ruleDeps[E].recursiveType===e.ATTR_MR){if(this.ruleDeps[x].groupNumber<this.ruleDeps[E].groupNumber)return-1;if(this.ruleDeps[x].groupNumber>this.ruleDeps[E].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(x=[],E=[],O=[],R=[]){let I=new u(x,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 o8=Re((pJ,i8)=>{i8.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],f="index"){let u="showRules",d=[],v=[],x=[],E=[],O=i,R=s,I=i.length,B=s.length,Y="RULE/UDT NAMES",P;function J(X,ne){return O[X].lower<O[ne].lower?-1:O[X].lower>O[ne].lower?1:0}o(J,"compRulesAlpha");function ee(X,ne){return R[X].lower<R[ne].lower?-1:R[X].lower>R[ne].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(P=0;P<I;P+=1)x.push(P);if(d=x.slice(0),d.sort(J),B){for(P=0;P<B;P+=1)E.push(P);v=E.slice(0),v.sort(ee)}if(f.charCodeAt(0)===97){for(Y+=` - alphabetical by rule/UDT name
628
+ `,u+=i(null))),u},"showRuleDependencies")}})()});var i8=Re((wJ,n8)=>{n8.exports=o(function(){let e=Xi(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=e8(),{ruleDependencies:s,showRuleDependencies:f}=r8();class u{constructor(x,E){this.rules=x,this.udts=E,this.ruleCount=x.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(x[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(x){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:x}}attrInit(x){x.left=!1,x.nested=!1,x.right=!1,x.empty=!1,x.finite=!1,x.cyclic=!1,x.leaf=!1,x.isOpen=!1,x.isComplete=!1}attrCopy(x,E){x.left=E.left,x.nested=E.nested,x.right=E.right,x.empty=E.empty,x.finite=E.finite,x.cyclic=E.cyclic,x.leaf=E.leaf,x.isOpen=E.isOpen,x.isComplete=E.isComplete,x.rule=E.rule}rdGen(x,E,O){return{rule:x,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(E),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(E)}}typeToString(x){switch(x){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(x){let E=[];if(x>0)for(let O=0;O<x;O+=1)E.push(!1);return E}falsifyArray(x){for(let E=0;E<x.length;E+=1)x[E]=!1}indexArray(x){let E=[];if(x>0)for(let O=0;O<x;O+=1)E.push(O);return E}compRulesAlpha(x,E){return this.rules[x].lower<this.rules[E].lower?-1:this.rules[x].lower>this.rules[E].lower?1:0}compUdtsAlpha(x,E){return this.udts[x].lower<this.udts[E].lower?-1:this.udts[x].lower>this.udts[E].lower?1:0}compRulesType(x,E){return this.ruleDeps[x].recursiveType<this.ruleDeps[E].recursiveType?-1:this.ruleDeps[x].recursiveType>this.ruleDeps[E].recursiveType?1:0}compRulesGroup(x,E){if(this.ruleDeps[x].recursiveType===e.ATTR_MR&&this.ruleDeps[E].recursiveType===e.ATTR_MR){if(this.ruleDeps[x].groupNumber<this.ruleDeps[E].groupNumber)return-1;if(this.ruleDeps[x].groupNumber>this.ruleDeps[E].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(x=[],E=[],O=[],R=[]){let I=new u(x,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 s8=Re((_J,o8)=>{o8.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],f="index"){let u="showRules",d=[],v=[],x=[],E=[],O=i,R=s,I=i.length,B=s.length,Y="RULE/UDT NAMES",P;function J(X,ne){return O[X].lower<O[ne].lower?-1:O[X].lower>O[ne].lower?1:0}o(J,"compRulesAlpha");function ee(X,ne){return R[X].lower<R[ne].lower?-1:R[X].lower>R[ne].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(P=0;P<I;P+=1)x.push(P);if(d=x.slice(0),d.sort(J),B){for(P=0;P<B;P+=1)E.push(P);v=E.slice(0),v.sort(ee)}if(f.charCodeAt(0)===97){for(Y+=` - alphabetical by rule/UDT name
629
629
  `,P=0;P<I;P+=1)Y+=`${P}: ${d[P]}: ${O[d[P]].name}
630
630
  `;if(B)for(P=0;P<B;P+=1)Y+=`${P}: ${v[P]}: ${R[v[P]].name}
631
631
  `}else{for(Y+=` - ordered by rule/UDT index
632
632
  `,P=0;P<I;P+=1)Y+=`${P}: ${O[P].name}
633
633
  `;if(B)for(P=0;P<B;P+=1)Y+=`${P}: ${R[P].name}
634
- `}return Y},"showRules")},"exfn")()});var a8=Re((mJ,s8)=>{s8.exports=o(function(e){let{Buffer:t}=n0(),n="api.js: ",i=this,s=ff(),f=Hb(),u=z5(),d=new(X5()),{attributes:v,showAttributes:x,showAttributeErrors:E,showRuleDependencies:O}=n8(),R=o8(),I=o(function(h,g,b){let S=`<span class="${s.style.CLASS_CTRLCHAR}">`,A="</span>",y=`<span class="${s.style.CLASS_NOMATCH}">`,C="</span>",N,w="",k=!0;for(;k&&!(!Array.isArray(h)||h.length===0);){if(typeof g!="number")throw new Error("abnfToHtml: beg must be type number");if(g>=h.length)break;typeof b!="number"||g+b>=h.length?N=h.length:N=g+b;let fe=0;for(let D=g;D<N;D+=1){let Q=h[D];if(Q>=32&&Q<=126)switch(fe===1?(w+=A,fe=0):fe===2&&(w+=C,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+=C+S,fe=1),Q===9&&(w+="TAB"),Q===10&&(w+="LF"),Q===13&&(w+="CR")):(fe===0?(w+=y,fe=2):fe===1&&(w+=A+y,fe=2),w+=`\\x${s.utils.charToHex(Q)}`)}fe===2&&(w+=C),fe===1&&(w+=A);break}return w},"abnfToHtml"),B=o(function(h,g,b){let l="";for(let m=g;m<g+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"),Y=o(function(h){let g="Annotated Input Grammar";return h.forEach(b=>{g+=`
634
+ `}return Y},"showRules")},"exfn")()});var f8=Re((EJ,a8)=>{a8.exports=o(function(e){let{Buffer:t}=i0(),n="api.js: ",i=this,s=ff(),f=jb(),u=j5(),d=new(Z5()),{attributes:v,showAttributes:x,showAttributeErrors:E,showRuleDependencies:O}=i8(),R=s8(),I=o(function(h,g,b){let M=`<span class="${s.style.CLASS_CTRLCHAR}">`,S="</span>",y=`<span class="${s.style.CLASS_NOMATCH}">`,C="</span>",N,w="",k=!0;for(;k&&!(!Array.isArray(h)||h.length===0);){if(typeof g!="number")throw new Error("abnfToHtml: beg must be type number");if(g>=h.length)break;typeof b!="number"||g+b>=h.length?N=h.length:N=g+b;let fe=0;for(let D=g;D<N;D+=1){let Q=h[D];if(Q>=32&&Q<=126)switch(fe===1?(w+=S,fe=0):fe===2&&(w+=C,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+=M,fe=1):fe===2&&(w+=C+M,fe=1),Q===9&&(w+="TAB"),Q===10&&(w+="LF"),Q===13&&(w+="CR")):(fe===0?(w+=y,fe=2):fe===1&&(w+=S+y,fe=2),w+=`\\x${s.utils.charToHex(Q)}`)}fe===2&&(w+=C),fe===1&&(w+=S);break}return w},"abnfToHtml"),B=o(function(h,g,b){let l="";for(let m=g;m<g+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"),Y=o(function(h){let g="Annotated Input Grammar";return h.forEach(b=>{g+=`
635
635
  `,g+=`line no: ${b.lineNo}`,g+=` : char index: ${b.beginChar}`,g+=` : length: ${b.length}`,g+=` : abnf: ${B(i.chars,b.beginChar,b.length)}`}),g+=`
636
636
  `,g},"linesToAscii"),P=o(function(h){let g="";return g+=`<table class="${s.style.CLASS_GRAMMAR}">
637
637
  `,g+=`<caption>Annotated Input Grammar</caption>
638
638
  `,g+="<tr>",g+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",g+=`</tr>
639
639
  `,h.forEach(l=>{g+="<tr>",g+=`<td>${l.lineNo}`,g+=`</td><td>${l.beginChar}`,g+=`</td><td>${l.length}`,g+=`</td><td>${I(i.chars,l.beginChar,l.length)}`,g+="</td>",g+=`</tr>
640
640
  `}),g+=`</table>
641
- `,g},"linesToHtml"),J=o(function(h,g,b,l){let[m]=s,_="",S=`<span class="${m.CLASS_NOMATCH}">&raquo;</span>`;return _+=`<p><table class="${m.CLASS_GRAMMAR}">
641
+ `,g},"linesToHtml"),J=o(function(h,g,b,l){let[m]=s,_="",M=`<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 y,C,N,w,k,fe="",D="";g.length===0?(k=S,C=0):(y=g[A.line],N=y.beginChar,A.char>N&&(fe=I(b,N,A.char-N)),N=A.char,w=y.beginChar+y.length,N<w&&(D=I(b,N,w-N)),k=fe+S+D,C=A.char-y.beginChar,_+="<tr>",_+=`<td>${A.line}</td><td>${y.beginChar}</td><td>${C}</td><td>${k}</td>`,_+=`</tr>
645
- `,_+="<tr>",_+=`<td colspan="3"></td><td>&uarr;:&nbsp;${s.utils.stringToAsciiHtml(A.msg)}</td>`,_+=`</tr>
644
+ `,h.forEach(S=>{let y,C,N,w,k,fe="",D="";g.length===0?(k=M,C=0):(y=g[S.line],N=y.beginChar,S.char>N&&(fe=I(b,N,S.char-N)),N=S.char,w=y.beginChar+y.length,N<w&&(D=I(b,N,w-N)),k=fe+M+D,C=S.char-y.beginChar,_+="<tr>",_+=`<td>${S.line}</td><td>${y.beginChar}</td><td>${C}</td><td>${k}</td>`,_+=`</tr>
645
+ `,_+="<tr>",_+=`<td colspan="3"></td><td>&uarr;:&nbsp;${s.utils.stringToAsciiHtml(S.msg)}</td>`,_+=`</tr>
646
646
  `)}),_+=`</table></p>
647
- `,_},"errorsToHtml"),ee=o(function(h,g,b){let l,m,_,S;return l="",h.forEach(A=>{m=g[A.line],l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${A.char-m.beginChar}: `,_=m.beginChar,S=A.char-m.beginChar,l+=B(b,_,S),l+=" >> ",_=A.char,S=m.beginChar+m.length-A.char,l+=B(b,_,S),l+=`
648
- `,l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${A.char-m.beginChar}: `,l+="error: ",l+=A.msg,l+=`
649
- `}),l},"errorsToAscii"),X=!1,ne=!1,V=!1,H=!1,z=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,g){this.lines=u(this.chars,this.errors,h,g),X=!0},"scan"),this.parse=o(function(h,g,b){if(!X)throw new Error(`${n}grammar not scanned`);d.syntax(this.chars,this.lines,this.errors,h,g,b),ne=!0},"parse"),this.translate=o(function(){if(!ne)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,V=!0)},"translate"),this.attributes=o(function(){if(!V)throw new Error(`${n}grammar not scanned, parsed and translated`);return z=v(this.rules,this.udts,he,this.errors),H=!0,z},"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 g=d.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=g.rules,this.udts=g.udts,he=g.lineMap,z=v(this.rules,this.udts,he,this.errors),H=!0)},"generate"),this.displayRules=o(function(h="index"){if(!V)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(!H)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return O(h)},"displayRuleDependencies"),this.displayAttributes=o(function(h="index"){if(!H)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return z&&E(h),x(h)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!H)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return E()},"displayAttributeErrors"),this.toSource=o(function(h=void 0){if(!H)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(z)throw new Error(`${n}can't generate parser source - attributes have ${z} errors`);return d.generateSource(this.chars,this.lines,this.rules,this.udts,h)},"toSource"),this.toObject=o(function(){if(!H)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(z)throw new Error(`${n}can't generate parser source - attributes have ${z} 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 Y(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return P(this.lines)},"linesToHtmlFunc")},"api")});var ng=Re((E8,rg)=>{(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=b1().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,y,C=0;if(_==="be")for(S=l.length-1,A=0;S>=0;S-=3)y=l[S]|l[S-1]<<8|l[S-2]<<16,this.words[A]|=y<<C&67108863,this.words[A+1]=y>>>26-C&67108863,C+=24,C>=26&&(C-=26,A++);else if(_==="le")for(S=0,A=0;S<l.length;S+=3)y=l[S]|l[S+1]<<8|l[S+2]<<16,this.words[A]|=y<<C&67108863,this.words[A+1]=y>>>26-C&67108863,C+=24,C>=26&&(C-=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,y=0,C;if(_==="be")for(S=l.length-1;S>=m;S-=2)C=u(l,m,S)<<A,this.words[y]|=C&67108863,A>=18?(A-=18,y+=1,this.words[y]|=C>>>26):A+=8;else{var N=l.length-m;for(S=N%2===0?m+1:m;S<l.length;S+=2)C=u(l,m,S)<<A,this.words[y]|=C&67108863,A>=18?(A-=18,y+=1,this.words[y]|=C>>>26):A+=8}this._strip()},"_parseHex");function d(b,l,m,_){for(var S=0,A=0,y=Math.min(b.length,m),C=l;C<y;C++){var N=b.charCodeAt(C)-48;S*=_,N>=49?A=N-49+10:N>=17?A=N-17+10:A=N,t(N>=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 y=l.length-_,C=y%S,N=Math.min(y,y-C)+_,w=0,k=_;k<N;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(C!==0){var fe=1;for(w=d(l,k,l.length,m),k=0;k<C;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 v(b,l){b.words=l.words,b.length=l.length,b.negative=l.negative,b.red=l.red}if(o(v,"move"),i.prototype._move=o(function(l){v(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")]=x}catch{i.prototype.inspect=x}else i.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(x,"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,y=0;y<this.length;y++){var C=this.words[y],N=((C<<S|A)&16777215).toString(16);A=C>>>24-S&16777215,S+=2,S>=26&&(S-=26,y--),A!==0||y!==this.length-1?_=E[6-N.length]+N+_:_=N+_}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 y=I(l,A),C=m==="le"?"LE":"BE";return this["_toArrayLike"+C](y,S),y},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,m){for(var _=0,S=0,A=0,y=0;A<this.length;A++){var C=this.words[A]<<y|S;l[_++]=C&255,_<l.length&&(l[_++]=C>>8&255),_<l.length&&(l[_++]=C>>16&255),y===6?(_<l.length&&(l[_++]=C>>24&255),S=0,y=0):(S=C>>>24,y+=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,y=0;A<this.length;A++){var C=this.words[A]<<y|S;l[_--]=C&255,_>=0&&(l[_--]=C>>8&255),_>=0&&(l[_--]=C>>16&255),y===6?(_>=0&&(l[_--]=C>>24&255),S=0,y=0):(S=C>>>24,y+=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 B(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(B,"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,y=0;y<S.length;y++)m=(_.words[y]|0)+(S.words[y]|0)+A,this.words[y]=m&67108863,A=m>>>26;for(;A!==0&&y<_.length;y++)m=(_.words[y]|0)+A,this.words[y]=m&67108863,A=m>>>26;if(this.length=_.length,A!==0)this.words[this.length]=A,this.length++;else if(_!==this)for(;y<_.length;y++)this.words[y]=_.words[y];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 y=0,C=0;C<A.length;C++)m=(S.words[C]|0)-(A.words[C]|0)+y,y=m>>26,this.words[C]=m&67108863;for(;y!==0&&C<S.length;C++)m=(S.words[C]|0)+y,y=m>>26,this.words[C]=m&67108863;if(y===0&&C<S.length&&S!==this)for(;C<S.length;C++)this.words[C]=S.words[C];return this.length=Math.max(this.length,C),S!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function Y(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,y=S*A,C=y&67108863,N=y/67108864|0;m.words[0]=C;for(var w=1;w<_;w++){for(var k=N>>>26,fe=N&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,y=S*A+fe,k+=y/67108864|0,fe=y&67108863}m.words[w]=fe|0,N=k|0}return N!==0?m.words[w]=N|0:m.length--,m._strip()}o(Y,"smallMulTo");var P=o(function(l,m,_){var S=l.words,A=m.words,y=_.words,C=0,N,w,k,fe=S[0]|0,D=fe&8191,Q=fe>>>13,se=S[1]|0,q=se&8191,j=se>>>13,G=S[2]|0,te=G&8191,ae=G>>>13,Ae=S[3]|0,ge=Ae&8191,ie=Ae>>>13,Me=S[4]|0,ue=Me&8191,ve=Me>>>13,W=S[5]|0,pe=W&8191,ke=W>>>13,je=S[6]|0,Pe=je&8191,Je=je>>>13,gr=S[7]|0,le=gr&8191,oe=gr>>>13,F=S[8]|0,Z=F&8191,me=F>>>13,ye=S[9]|0,we=ye&8191,Ie=ye>>>13,Rt=A[0]|0,Fe=Rt&8191,Ne=Rt>>>13,Lt=A[1]|0,Ve=Lt&8191,Xe=Lt>>>13,Pn=A[2]|0,st=Pn&8191,at=Pn>>>13,ii=A[3]|0,ft=ii&8191,rt=ii>>>13,oi=A[4]|0,ct=oi&8191,ut=oi>>>13,pn=A[5]|0,lt=pn&8191,Qe=pn>>>13,si=A[6]|0,ht=si&8191,dt=si>>>13,ai=A[7]|0,pt=ai&8191,mt=ai>>>13,fi=A[8]|0,bt=fi&8191,nt=fi>>>13,Bn=A[9]|0,qt=Bn&8191,Ht=Bn>>>13;_.negative=l.negative^m.negative,_.length=19,N=Math.imul(D,Fe),w=Math.imul(D,Ne),w=w+Math.imul(Q,Fe)|0,k=Math.imul(Q,Ne);var mn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(mn>>>26)|0,mn&=67108863,N=Math.imul(q,Fe),w=Math.imul(q,Ne),w=w+Math.imul(j,Fe)|0,k=Math.imul(j,Ne),N=N+Math.imul(D,Ve)|0,w=w+Math.imul(D,Xe)|0,w=w+Math.imul(Q,Ve)|0,k=k+Math.imul(Q,Xe)|0;var bn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(bn>>>26)|0,bn&=67108863,N=Math.imul(te,Fe),w=Math.imul(te,Ne),w=w+Math.imul(ae,Fe)|0,k=Math.imul(ae,Ne),N=N+Math.imul(q,Ve)|0,w=w+Math.imul(q,Xe)|0,w=w+Math.imul(j,Ve)|0,k=k+Math.imul(j,Xe)|0,N=N+Math.imul(D,st)|0,w=w+Math.imul(D,at)|0,w=w+Math.imul(Q,st)|0,k=k+Math.imul(Q,at)|0;var gn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(gn>>>26)|0,gn&=67108863,N=Math.imul(ge,Fe),w=Math.imul(ge,Ne),w=w+Math.imul(ie,Fe)|0,k=Math.imul(ie,Ne),N=N+Math.imul(te,Ve)|0,w=w+Math.imul(te,Xe)|0,w=w+Math.imul(ae,Ve)|0,k=k+Math.imul(ae,Xe)|0,N=N+Math.imul(q,st)|0,w=w+Math.imul(q,at)|0,w=w+Math.imul(j,st)|0,k=k+Math.imul(j,at)|0,N=N+Math.imul(D,ft)|0,w=w+Math.imul(D,rt)|0,w=w+Math.imul(Q,ft)|0,k=k+Math.imul(Q,rt)|0;var Fr=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,N=Math.imul(ue,Fe),w=Math.imul(ue,Ne),w=w+Math.imul(ve,Fe)|0,k=Math.imul(ve,Ne),N=N+Math.imul(ge,Ve)|0,w=w+Math.imul(ge,Xe)|0,w=w+Math.imul(ie,Ve)|0,k=k+Math.imul(ie,Xe)|0,N=N+Math.imul(te,st)|0,w=w+Math.imul(te,at)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,N=N+Math.imul(q,ft)|0,w=w+Math.imul(q,rt)|0,w=w+Math.imul(j,ft)|0,k=k+Math.imul(j,rt)|0,N=N+Math.imul(D,ct)|0,w=w+Math.imul(D,ut)|0,w=w+Math.imul(Q,ct)|0,k=k+Math.imul(Q,ut)|0;var vn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(vn>>>26)|0,vn&=67108863,N=Math.imul(pe,Fe),w=Math.imul(pe,Ne),w=w+Math.imul(ke,Fe)|0,k=Math.imul(ke,Ne),N=N+Math.imul(ue,Ve)|0,w=w+Math.imul(ue,Xe)|0,w=w+Math.imul(ve,Ve)|0,k=k+Math.imul(ve,Xe)|0,N=N+Math.imul(ge,st)|0,w=w+Math.imul(ge,at)|0,w=w+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,N=N+Math.imul(te,ft)|0,w=w+Math.imul(te,rt)|0,w=w+Math.imul(ae,ft)|0,k=k+Math.imul(ae,rt)|0,N=N+Math.imul(q,ct)|0,w=w+Math.imul(q,ut)|0,w=w+Math.imul(j,ct)|0,k=k+Math.imul(j,ut)|0,N=N+Math.imul(D,lt)|0,w=w+Math.imul(D,Qe)|0,w=w+Math.imul(Q,lt)|0,k=k+Math.imul(Q,Qe)|0;var ci=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ci>>>26)|0,ci&=67108863,N=Math.imul(Pe,Fe),w=Math.imul(Pe,Ne),w=w+Math.imul(Je,Fe)|0,k=Math.imul(Je,Ne),N=N+Math.imul(pe,Ve)|0,w=w+Math.imul(pe,Xe)|0,w=w+Math.imul(ke,Ve)|0,k=k+Math.imul(ke,Xe)|0,N=N+Math.imul(ue,st)|0,w=w+Math.imul(ue,at)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,N=N+Math.imul(ge,ft)|0,w=w+Math.imul(ge,rt)|0,w=w+Math.imul(ie,ft)|0,k=k+Math.imul(ie,rt)|0,N=N+Math.imul(te,ct)|0,w=w+Math.imul(te,ut)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,N=N+Math.imul(q,lt)|0,w=w+Math.imul(q,Qe)|0,w=w+Math.imul(j,lt)|0,k=k+Math.imul(j,Qe)|0,N=N+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 Lo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,N=Math.imul(le,Fe),w=Math.imul(le,Ne),w=w+Math.imul(oe,Fe)|0,k=Math.imul(oe,Ne),N=N+Math.imul(Pe,Ve)|0,w=w+Math.imul(Pe,Xe)|0,w=w+Math.imul(Je,Ve)|0,k=k+Math.imul(Je,Xe)|0,N=N+Math.imul(pe,st)|0,w=w+Math.imul(pe,at)|0,w=w+Math.imul(ke,st)|0,k=k+Math.imul(ke,at)|0,N=N+Math.imul(ue,ft)|0,w=w+Math.imul(ue,rt)|0,w=w+Math.imul(ve,ft)|0,k=k+Math.imul(ve,rt)|0,N=N+Math.imul(ge,ct)|0,w=w+Math.imul(ge,ut)|0,w=w+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,N=N+Math.imul(te,lt)|0,w=w+Math.imul(te,Qe)|0,w=w+Math.imul(ae,lt)|0,k=k+Math.imul(ae,Qe)|0,N=N+Math.imul(q,ht)|0,w=w+Math.imul(q,dt)|0,w=w+Math.imul(j,ht)|0,k=k+Math.imul(j,dt)|0,N=N+Math.imul(D,pt)|0,w=w+Math.imul(D,mt)|0,w=w+Math.imul(Q,pt)|0,k=k+Math.imul(Q,mt)|0;var Uo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,N=Math.imul(Z,Fe),w=Math.imul(Z,Ne),w=w+Math.imul(me,Fe)|0,k=Math.imul(me,Ne),N=N+Math.imul(le,Ve)|0,w=w+Math.imul(le,Xe)|0,w=w+Math.imul(oe,Ve)|0,k=k+Math.imul(oe,Xe)|0,N=N+Math.imul(Pe,st)|0,w=w+Math.imul(Pe,at)|0,w=w+Math.imul(Je,st)|0,k=k+Math.imul(Je,at)|0,N=N+Math.imul(pe,ft)|0,w=w+Math.imul(pe,rt)|0,w=w+Math.imul(ke,ft)|0,k=k+Math.imul(ke,rt)|0,N=N+Math.imul(ue,ct)|0,w=w+Math.imul(ue,ut)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,N=N+Math.imul(ge,lt)|0,w=w+Math.imul(ge,Qe)|0,w=w+Math.imul(ie,lt)|0,k=k+Math.imul(ie,Qe)|0,N=N+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,N=N+Math.imul(q,pt)|0,w=w+Math.imul(q,mt)|0,w=w+Math.imul(j,pt)|0,k=k+Math.imul(j,mt)|0,N=N+Math.imul(D,bt)|0,w=w+Math.imul(D,nt)|0,w=w+Math.imul(Q,bt)|0,k=k+Math.imul(Q,nt)|0;var Fo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,N=Math.imul(we,Fe),w=Math.imul(we,Ne),w=w+Math.imul(Ie,Fe)|0,k=Math.imul(Ie,Ne),N=N+Math.imul(Z,Ve)|0,w=w+Math.imul(Z,Xe)|0,w=w+Math.imul(me,Ve)|0,k=k+Math.imul(me,Xe)|0,N=N+Math.imul(le,st)|0,w=w+Math.imul(le,at)|0,w=w+Math.imul(oe,st)|0,k=k+Math.imul(oe,at)|0,N=N+Math.imul(Pe,ft)|0,w=w+Math.imul(Pe,rt)|0,w=w+Math.imul(Je,ft)|0,k=k+Math.imul(Je,rt)|0,N=N+Math.imul(pe,ct)|0,w=w+Math.imul(pe,ut)|0,w=w+Math.imul(ke,ct)|0,k=k+Math.imul(ke,ut)|0,N=N+Math.imul(ue,lt)|0,w=w+Math.imul(ue,Qe)|0,w=w+Math.imul(ve,lt)|0,k=k+Math.imul(ve,Qe)|0,N=N+Math.imul(ge,ht)|0,w=w+Math.imul(ge,dt)|0,w=w+Math.imul(ie,ht)|0,k=k+Math.imul(ie,dt)|0,N=N+Math.imul(te,pt)|0,w=w+Math.imul(te,mt)|0,w=w+Math.imul(ae,pt)|0,k=k+Math.imul(ae,mt)|0,N=N+Math.imul(q,bt)|0,w=w+Math.imul(q,nt)|0,w=w+Math.imul(j,bt)|0,k=k+Math.imul(j,nt)|0,N=N+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 fo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,N=Math.imul(we,Ve),w=Math.imul(we,Xe),w=w+Math.imul(Ie,Ve)|0,k=Math.imul(Ie,Xe),N=N+Math.imul(Z,st)|0,w=w+Math.imul(Z,at)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,N=N+Math.imul(le,ft)|0,w=w+Math.imul(le,rt)|0,w=w+Math.imul(oe,ft)|0,k=k+Math.imul(oe,rt)|0,N=N+Math.imul(Pe,ct)|0,w=w+Math.imul(Pe,ut)|0,w=w+Math.imul(Je,ct)|0,k=k+Math.imul(Je,ut)|0,N=N+Math.imul(pe,lt)|0,w=w+Math.imul(pe,Qe)|0,w=w+Math.imul(ke,lt)|0,k=k+Math.imul(ke,Qe)|0,N=N+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,N=N+Math.imul(ge,pt)|0,w=w+Math.imul(ge,mt)|0,w=w+Math.imul(ie,pt)|0,k=k+Math.imul(ie,mt)|0,N=N+Math.imul(te,bt)|0,w=w+Math.imul(te,nt)|0,w=w+Math.imul(ae,bt)|0,k=k+Math.imul(ae,nt)|0,N=N+Math.imul(q,qt)|0,w=w+Math.imul(q,Ht)|0,w=w+Math.imul(j,qt)|0,k=k+Math.imul(j,Ht)|0;var co=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(co>>>26)|0,co&=67108863,N=Math.imul(we,st),w=Math.imul(we,at),w=w+Math.imul(Ie,st)|0,k=Math.imul(Ie,at),N=N+Math.imul(Z,ft)|0,w=w+Math.imul(Z,rt)|0,w=w+Math.imul(me,ft)|0,k=k+Math.imul(me,rt)|0,N=N+Math.imul(le,ct)|0,w=w+Math.imul(le,ut)|0,w=w+Math.imul(oe,ct)|0,k=k+Math.imul(oe,ut)|0,N=N+Math.imul(Pe,lt)|0,w=w+Math.imul(Pe,Qe)|0,w=w+Math.imul(Je,lt)|0,k=k+Math.imul(Je,Qe)|0,N=N+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,N=N+Math.imul(ue,pt)|0,w=w+Math.imul(ue,mt)|0,w=w+Math.imul(ve,pt)|0,k=k+Math.imul(ve,mt)|0,N=N+Math.imul(ge,bt)|0,w=w+Math.imul(ge,nt)|0,w=w+Math.imul(ie,bt)|0,k=k+Math.imul(ie,nt)|0,N=N+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 uo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(uo>>>26)|0,uo&=67108863,N=Math.imul(we,ft),w=Math.imul(we,rt),w=w+Math.imul(Ie,ft)|0,k=Math.imul(Ie,rt),N=N+Math.imul(Z,ct)|0,w=w+Math.imul(Z,ut)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,N=N+Math.imul(le,lt)|0,w=w+Math.imul(le,Qe)|0,w=w+Math.imul(oe,lt)|0,k=k+Math.imul(oe,Qe)|0,N=N+Math.imul(Pe,ht)|0,w=w+Math.imul(Pe,dt)|0,w=w+Math.imul(Je,ht)|0,k=k+Math.imul(Je,dt)|0,N=N+Math.imul(pe,pt)|0,w=w+Math.imul(pe,mt)|0,w=w+Math.imul(ke,pt)|0,k=k+Math.imul(ke,mt)|0,N=N+Math.imul(ue,bt)|0,w=w+Math.imul(ue,nt)|0,w=w+Math.imul(ve,bt)|0,k=k+Math.imul(ve,nt)|0,N=N+Math.imul(ge,qt)|0,w=w+Math.imul(ge,Ht)|0,w=w+Math.imul(ie,qt)|0,k=k+Math.imul(ie,Ht)|0;var $o=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+($o>>>26)|0,$o&=67108863,N=Math.imul(we,ct),w=Math.imul(we,ut),w=w+Math.imul(Ie,ct)|0,k=Math.imul(Ie,ut),N=N+Math.imul(Z,lt)|0,w=w+Math.imul(Z,Qe)|0,w=w+Math.imul(me,lt)|0,k=k+Math.imul(me,Qe)|0,N=N+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,N=N+Math.imul(Pe,pt)|0,w=w+Math.imul(Pe,mt)|0,w=w+Math.imul(Je,pt)|0,k=k+Math.imul(Je,mt)|0,N=N+Math.imul(pe,bt)|0,w=w+Math.imul(pe,nt)|0,w=w+Math.imul(ke,bt)|0,k=k+Math.imul(ke,nt)|0,N=N+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 qo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(qo>>>26)|0,qo&=67108863,N=Math.imul(we,lt),w=Math.imul(we,Qe),w=w+Math.imul(Ie,lt)|0,k=Math.imul(Ie,Qe),N=N+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,N=N+Math.imul(le,pt)|0,w=w+Math.imul(le,mt)|0,w=w+Math.imul(oe,pt)|0,k=k+Math.imul(oe,mt)|0,N=N+Math.imul(Pe,bt)|0,w=w+Math.imul(Pe,nt)|0,w=w+Math.imul(Je,bt)|0,k=k+Math.imul(Je,nt)|0,N=N+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 Ho=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,N=Math.imul(we,ht),w=Math.imul(we,dt),w=w+Math.imul(Ie,ht)|0,k=Math.imul(Ie,dt),N=N+Math.imul(Z,pt)|0,w=w+Math.imul(Z,mt)|0,w=w+Math.imul(me,pt)|0,k=k+Math.imul(me,mt)|0,N=N+Math.imul(le,bt)|0,w=w+Math.imul(le,nt)|0,w=w+Math.imul(oe,bt)|0,k=k+Math.imul(oe,nt)|0,N=N+Math.imul(Pe,qt)|0,w=w+Math.imul(Pe,Ht)|0,w=w+Math.imul(Je,qt)|0,k=k+Math.imul(Je,Ht)|0;var zo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(zo>>>26)|0,zo&=67108863,N=Math.imul(we,pt),w=Math.imul(we,mt),w=w+Math.imul(Ie,pt)|0,k=Math.imul(Ie,mt),N=N+Math.imul(Z,bt)|0,w=w+Math.imul(Z,nt)|0,w=w+Math.imul(me,bt)|0,k=k+Math.imul(me,nt)|0,N=N+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 Pf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Pf>>>26)|0,Pf&=67108863,N=Math.imul(we,bt),w=Math.imul(we,nt),w=w+Math.imul(Ie,bt)|0,k=Math.imul(Ie,nt),N=N+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 Bf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Bf>>>26)|0,Bf&=67108863,N=Math.imul(we,qt),w=Math.imul(we,Ht),w=w+Math.imul(Ie,qt)|0,k=Math.imul(Ie,Ht);var Lf=(C+N|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(Lf>>>26)|0,Lf&=67108863,y[0]=mn,y[1]=bn,y[2]=gn,y[3]=Fr,y[4]=vn,y[5]=ci,y[6]=Lo,y[7]=Uo,y[8]=Fo,y[9]=fo,y[10]=co,y[11]=uo,y[12]=$o,y[13]=qo,y[14]=Ho,y[15]=zo,y[16]=Pf,y[17]=Bf,y[18]=Lf,C!==0&&(y[19]=C,_.length++),_},"comb10MulTo");Math.imul||(P=Y);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 y=S;S=0;for(var C=_&67108863,N=Math.min(A,l.length-1),w=Math.max(0,A-b.length+1);w<=N;w++){var k=A-w,fe=b.words[k]|0,D=l.words[w]|0,Q=fe*D,se=Q&67108863;y=y+(Q/67108864|0)|0,se=se+C|0,C=se&67108863,y=y+(se>>>26)|0,S+=y>>>26,y&=67108863}m.words[A]=C,_=y,y=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?_=P(this,l,m):S<63?_=Y(this,l,m):S<1024?_=J(this,l,m):_=ee(this,l,m),_},"mulTo");function X(b,l){this.x=b,this.y=l}o(X,"FFTM"),X.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"),X.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"),X.prototype.permute=o(function(l,m,_,S,A,y){for(var C=0;C<y;C++)S[C]=m[l[C]],A[C]=_[l[C]]},"permute"),X.prototype.transform=o(function(l,m,_,S,A,y){this.permute(y,l,m,_,S,A);for(var C=1;C<A;C<<=1)for(var N=C<<1,w=Math.cos(2*Math.PI/N),k=Math.sin(2*Math.PI/N),fe=0;fe<A;fe+=N)for(var D=w,Q=k,se=0;se<C;se++){var q=_[fe+se],j=S[fe+se],G=_[fe+se+C],te=S[fe+se+C],ae=D*G-Q*te;te=D*te+Q*G,G=ae,_[fe+se]=q+G,S[fe+se]=j+te,_[fe+se+C]=q-G,S[fe+se+C]=j-te,se!==N&&(ae=w*D-k*Q,Q=w*Q+k*D,D=ae)}},"transform"),X.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"),X.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"),X.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"),X.prototype.convert13b=o(function(l,m,_,S){for(var A=0,y=0;y<m;y++)A=A+(l[y]|0),_[2*y]=A&8191,A=A>>>13,_[2*y+1]=A&8191,A=A>>>13;for(y=2*m;y<S;++y)_[y]=0;t(A===0),t((A&-8192)===0)},"convert13b"),X.prototype.stub=o(function(l){for(var m=new Array(l),_=0;_<l;_++)m[_]=0;return m},"stub"),X.prototype.mulp=o(function(l,m,_){var S=2*this.guessLen13b(l.length,m.length),A=this.makeRBT(S),y=this.stub(S),C=new Array(S),N=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,C,S),this.convert13b(m.words,m.length,k,S),this.transform(C,y,N,w,S,A),this.transform(k,y,fe,D,S,A);for(var se=0;se<S;se++){var q=N[se]*fe[se]-w[se]*D[se];w[se]=N[se]*D[se]+w[se]*fe[se],N[se]=q}return this.conjugate(N,w,S),this.transform(N,w,Q,y,S,A),this.conjugate(Q,y,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,y=(A&67108863)+(_&67108863);_>>=26,_+=A/67108864|0,_+=y>>>26,this.words[S]=y&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=B(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 y=0;for(A=0;A<this.length;A++){var C=this.words[A]&S,N=(this.words[A]|0)-C<<m;this.words[A]=N|y,y=C>>>26-m}y&&(this.words[A]=y,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,y=Math.min((l-A)/26,this.length),C=67108863^67108863>>>A<<A,N=_;if(S-=y,S=Math.max(0,S),N){for(var w=0;w<y;w++)N.words[w]=this.words[w];N.length=y}if(y!==0)if(this.length>y)for(this.length-=y,w=0;w<this.length;w++)this.words[w]=this.words[w+y];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&C}return N&&k!==0&&(N.words[N.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 y,C=0;for(A=0;A<l.length;A++){y=(this.words[A+_]|0)+C;var N=(l.words[A]|0)*m;y-=N&67108863,C=(y>>26)-(N/67108864|0),this.words[A+_]=y&67108863}for(;A<this.length-_;A++)y=(this.words[A+_]|0)+C,C=y>>26,this.words[A+_]=y&67108863;if(C===0)return this._strip();for(t(C===-1),C=0,A=0;A<this.length;A++)y=-(this.words[A]|0)+C,C=y>>26,this.words[A]=y&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,y=A.words[A.length-1]|0,C=this._countBits(y);_=26-C,_!==0&&(A=A.ushln(_),S.iushln(_),y=A.words[A.length-1]|0);var N=S.length-A.length,w;if(m!=="mod"){w=new i(null),w.length=N+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,N);fe.negative===0&&(S=fe,w&&(w.words[N]=1));for(var D=N-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/y|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,y;return this.negative!==0&&l.negative===0?(y=this.neg().divmod(l,m),m!=="mod"&&(S=y.div.neg()),m!=="div"&&(A=y.mod.neg(),_&&A.negative!==0&&A.iadd(l)),{div:S,mod:A}):this.negative===0&&l.negative!==0?(y=this.divmod(l.neg(),m),m!=="mod"&&(S=y.div.neg()),{div:S,mod:y.mod}):(this.negative&l.negative)!==0?(y=this.neg().divmod(l.neg(),m),m!=="div"&&(A=y.mod.neg(),_&&A.negative!==0&&A.isub(l)),{div:y.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),y=_.cmp(S);return y<0||A===1&&y===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),y=new i(0),C=new i(1),N=0;m.isEven()&&_.isEven();)m.iushrn(1),_.iushrn(1),++N;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;)(y.isOdd()||C.isOdd())&&(y.iadd(w),C.isub(k)),y.iushrn(1),C.iushrn(1);m.cmp(_)>=0?(m.isub(_),S.isub(y),A.isub(C)):(_.isub(m),y.isub(S),C.isub(A))}return{a:y,b:C,gcd:_.iushln(N)}},"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),y=_.clone();m.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,N=1;(m.words[0]&N)===0&&C<26;++C,N<<=1);if(C>0)for(m.iushrn(C);C-- >0;)S.isOdd()&&S.iadd(y),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(y),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 y=m;m=_,_=y}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,y=_;A!==0&&y<this.length;y++){var C=this.words[y]|0;C+=A,A=C>>>26,C&=67108863,this.words[y]=C}return A!==0&&(this.words[y]=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 ne={k256:null,p224:null,p192:null,p25519:null};function V(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(V,"MPrime"),V.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),V.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"),V.prototype.split=o(function(l,m){l.iushrn(this.n,0,m)},"split"),V.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,V),H.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 y=l.words[9];for(m.words[m.length++]=y&_,A=10;A<l.length;A++){var C=l.words[A]|0;l.words[A-10]=(C&_)<<4|y>>>22,y=C}y>>>=22,l.words[A-10]=y,y===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var 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 z(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(z,"P224"),n(z,V);function he(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(he,"P192"),n(he,V);function L(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,V),L.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(ne[l])return ne[l];var m;if(l==="k256")m=new H;else if(l==="p224")m=new z;else if(l==="p192")m=new he;else if(l==="p25519")m=new L;else throw new Error("Unknown prime "+l);return ne[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):(v(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 y=new i(1).toRed(this),C=y.redNeg(),N=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,N).cmp(C)!==0;)w.redIAdd(C);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(y)!==0;){for(var se=D,q=0;se.cmp(y)!==0;q++)se=se.redSqr();t(q<Q);var j=this.pow(k,new i(1).iushln(Q-q-1));fe=fe.redMul(j),k=j.redSqr(),D=D.redMul(k),Q=q}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 y=S[0],C=0,N=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(y!==S[0]&&(y=this.sqr(y)),D===0&&C===0){N=0;continue}C<<=1,C|=D,N++,!(N!==_&&(A!==0||fe!==0))&&(y=this.mul(y,S[C]),N=0,C=0)}w=26}return y},"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 g(l)},"mont");function g(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(g,"Mont"),n(g,h),g.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),g.prototype.convertFrom=o(function(l){var m=this.imod(l.mul(this.rinv));return m.red=null,m},"convertFrom"),g.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),y=A;return A.cmp(this.m)>=0?y=A.isub(this.m):A.cmpn(0)<0&&(y=A.iadd(this.m)),y._forceRed(this)},"imul"),g.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),y=A;return A.cmp(this.m)>=0?y=A.isub(this.m):A.cmpn(0)<0&&(y=A.iadd(this.m)),y._forceRed(this)},"mul"),g.prototype.invm=o(function(l){var m=this.imod(l._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm")})(typeof rg>"u"||rg,E8)});var a_=Re((uX,s_)=>{s_.exports=gg;var o_=128,OU=127,NU=~OU,PU=Math.pow(2,31);function gg(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw gg.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=PU;)e[t++]=r&255|o_,r/=128;for(;r&NU;)e[t++]=r&255|o_,r>>>=7;return e[t]=r|0,gg.bytes=t-n+1,e}o(gg,"encode")});var u_=Re((lX,c_)=>{c_.exports=vg;var BU=128,f_=127;function vg(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u||i>49)throw vg.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&f_)<<i:(f&f_)*Math.pow(2,i),i+=7}while(f>=BU);return vg.bytes=s-n,t}o(vg,"read")});var h_=Re((hX,l_)=>{var LU=Math.pow(2,7),UU=Math.pow(2,14),FU=Math.pow(2,21),$U=Math.pow(2,28),qU=Math.pow(2,35),HU=Math.pow(2,42),zU=Math.pow(2,49),jU=Math.pow(2,56),KU=Math.pow(2,63);l_.exports=function(r){return r<LU?1:r<UU?2:r<FU?3:r<$U?4:r<qU?5:r<HU?6:r<zU?7:r<jU?8:r<KU?9:10}});var wl=Re((dX,d_)=>{d_.exports={encode:a_(),decode:u_(),encodingLength:h_()}});var A_=Re((vX,E_)=>{"use strict";E_.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 v={key:u,value:f[u]},x={key:d,value:f[d]};return s(v,x)}}}(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 v=i.push(f)-1,x=Object.keys(f).sort(n&&n(f));for(d="",u=0;u<x.length;u++){var E=x[u],O=s(f[E]);!O||(d&&(d+=","),d+=JSON.stringify(E)+":"+O)}return i.splice(v,1),"{"+d+"}"}},"stringify")(r)}});var Kc=Re((Ml,qc)=>{var TF=200,H_="__lodash_hash_undefined__",z_=9007199254740991,$g="[object Arguments]",CF="[object Array]",j_="[object Boolean]",K_="[object Date]",kF="[object Error]",qg="[object Function]",V_="[object GeneratorFunction]",N0="[object Map]",G_="[object Number]",Hg="[object Object]",D_="[object Promise]",W_="[object RegExp]",P0="[object Set]",J_="[object String]",Y_="[object Symbol]",Ng="[object WeakMap]",X_="[object ArrayBuffer]",B0="[object DataView]",Z_="[object Float32Array]",Q_="[object Float64Array]",eE="[object Int8Array]",tE="[object Int16Array]",rE="[object Int32Array]",nE="[object Uint8Array]",iE="[object Uint8ClampedArray]",oE="[object Uint16Array]",sE="[object Uint32Array]",IF=/[\\^$.*+?()[\]{}|]/g,DF=/\w*$/,RF=/^\[object .+?Constructor\]$/,OF=/^(?:0|[1-9]\d*)$/,or={};or[$g]=or[CF]=or[X_]=or[B0]=or[j_]=or[K_]=or[Z_]=or[Q_]=or[eE]=or[tE]=or[rE]=or[N0]=or[G_]=or[Hg]=or[W_]=or[P0]=or[J_]=or[Y_]=or[nE]=or[iE]=or[oE]=or[sE]=!0;or[kF]=or[qg]=or[Ng]=!1;var NF=typeof global=="object"&&global&&global.Object===Object&&global,PF=typeof self=="object"&&self&&self.Object===Object&&self,ms=NF||PF||Function("return this")(),aE=typeof Ml=="object"&&Ml&&!Ml.nodeType&&Ml,R_=aE&&typeof qc=="object"&&qc&&!qc.nodeType&&qc,BF=R_&&R_.exports===aE;function LF(r,e){return r.set(e[0],e[1]),r}o(LF,"addMapEntry");function UF(r,e){return r.add(e),r}o(UF,"addSetEntry");function FF(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(FF,"arrayEach");function $F(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o($F,"arrayPush");function fE(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(fE,"arrayReduce");function qF(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(qF,"baseTimes");function HF(r,e){return r?.[e]}o(HF,"getValue");function cE(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}o(cE,"isHostObject");function O_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(O_,"mapToArray");function zg(r,e){return function(t){return r(e(t))}}o(zg,"overArg");function N_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(N_,"setToArray");var zF=Array.prototype,jF=Function.prototype,L0=Object.prototype,Og=ms["__core-js_shared__"],P_=function(){var r=/[^.]+$/.exec(Og&&Og.keys&&Og.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),uE=jF.toString,fa=L0.hasOwnProperty,U0=L0.toString,KF=RegExp("^"+uE.call(fa).replace(IF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B_=BF?ms.Buffer:void 0,L_=ms.Symbol,U_=ms.Uint8Array,VF=zg(Object.getPrototypeOf,Object),GF=Object.create,WF=L0.propertyIsEnumerable,JF=zF.splice,F_=Object.getOwnPropertySymbols,YF=B_?B_.isBuffer:void 0,XF=zg(Object.keys,Object),Pg=jc(ms,"DataView"),Tl=jc(ms,"Map"),Bg=jc(ms,"Promise"),Lg=jc(ms,"Set"),Ug=jc(ms,"WeakMap"),Cl=jc(Object,"create"),ZF=bf(Pg),QF=bf(Tl),e$=bf(Bg),t$=bf(Lg),r$=bf(Ug),$_=L_?L_.prototype:void 0,q_=$_?$_.valueOf:void 0;function mf(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(mf,"Hash");function n$(){this.__data__=Cl?Cl(null):{}}o(n$,"hashClear");function i$(r){return this.has(r)&&delete this.__data__[r]}o(i$,"hashDelete");function o$(r){var e=this.__data__;if(Cl){var t=e[r];return t===H_?void 0:t}return fa.call(e,r)?e[r]:void 0}o(o$,"hashGet");function s$(r){var e=this.__data__;return Cl?e[r]!==void 0:fa.call(e,r)}o(s$,"hashHas");function a$(r,e){var t=this.__data__;return t[r]=Cl&&e===void 0?H_:e,this}o(a$,"hashSet");mf.prototype.clear=n$;mf.prototype.delete=i$;mf.prototype.get=o$;mf.prototype.has=s$;mf.prototype.set=a$;function bs(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(bs,"ListCache");function f$(){this.__data__=[]}o(f$,"listCacheClear");function c$(r){var e=this.__data__,t=F0(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():JF.call(e,t,1),!0}o(c$,"listCacheDelete");function u$(r){var e=this.__data__,t=F0(e,r);return t<0?void 0:e[t][1]}o(u$,"listCacheGet");function l$(r){return F0(this.__data__,r)>-1}o(l$,"listCacheHas");function h$(r,e){var t=this.__data__,n=F0(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(h$,"listCacheSet");bs.prototype.clear=f$;bs.prototype.delete=c$;bs.prototype.get=u$;bs.prototype.has=l$;bs.prototype.set=h$;function Hc(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(Hc,"MapCache");function d$(){this.__data__={hash:new mf,map:new(Tl||bs),string:new mf}}o(d$,"mapCacheClear");function p$(r){return $0(this,r).delete(r)}o(p$,"mapCacheDelete");function m$(r){return $0(this,r).get(r)}o(m$,"mapCacheGet");function b$(r){return $0(this,r).has(r)}o(b$,"mapCacheHas");function g$(r,e){return $0(this,r).set(r,e),this}o(g$,"mapCacheSet");Hc.prototype.clear=d$;Hc.prototype.delete=p$;Hc.prototype.get=m$;Hc.prototype.has=b$;Hc.prototype.set=g$;function zc(r){this.__data__=new bs(r)}o(zc,"Stack");function v$(){this.__data__=new bs}o(v$,"stackClear");function y$(r){return this.__data__.delete(r)}o(y$,"stackDelete");function x$(r){return this.__data__.get(r)}o(x$,"stackGet");function w$(r){return this.__data__.has(r)}o(w$,"stackHas");function _$(r,e){var t=this.__data__;if(t instanceof bs){var n=t.__data__;if(!Tl||n.length<TF-1)return n.push([r,e]),this;t=this.__data__=new Hc(n)}return t.set(r,e),this}o(_$,"stackSet");zc.prototype.clear=v$;zc.prototype.delete=y$;zc.prototype.get=x$;zc.prototype.has=w$;zc.prototype.set=_$;function E$(r,e){var t=Kg(r)||G$(r)?qF(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||fa.call(r,s))&&!(i&&(s=="length"||z$(s,n)))&&t.push(s);return t}o(E$,"arrayLikeKeys");function lE(r,e,t){var n=r[e];(!(fa.call(r,e)&&mE(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(lE,"assignValue");function F0(r,e){for(var t=r.length;t--;)if(mE(r[t][0],e))return t;return-1}o(F0,"assocIndexOf");function A$(r,e){return r&&hE(e,Vg(e),r)}o(A$,"baseAssign");function Fg(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(!q0(r))return r;var d=Kg(r);if(d){if(u=$$(r),!e)return L$(r,u)}else{var v=pf(r),x=v==qg||v==V_;if(J$(r))return I$(r,e);if(v==Hg||v==$g||x&&!s){if(cE(r))return s?r:{};if(u=q$(x?{}:r),!e)return U$(r,A$(u,r))}else{if(!or[v])return s?r:{};u=H$(r,v,Fg,e)}}f||(f=new zc);var E=f.get(r);if(E)return E;if(f.set(r,u),!d)var O=t?F$(r):Vg(r);return FF(O||r,function(R,I){O&&(I=R,R=r[I]),lE(u,I,Fg(R,e,t,n,I,r,f))}),u}o(Fg,"baseClone");function S$(r){return q0(r)?GF(r):{}}o(S$,"baseCreate");function M$(r,e,t){var n=e(r);return Kg(r)?n:$F(n,t(r))}o(M$,"baseGetAllKeys");function T$(r){return U0.call(r)}o(T$,"baseGetTag");function C$(r){if(!q0(r)||K$(r))return!1;var e=gE(r)||cE(r)?KF:RF;return e.test(bf(r))}o(C$,"baseIsNative");function k$(r){if(!pE(r))return XF(r);var e=[];for(var t in Object(r))fa.call(r,t)&&t!="constructor"&&e.push(t);return e}o(k$,"baseKeys");function I$(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(I$,"cloneBuffer");function jg(r){var e=new r.constructor(r.byteLength);return new U_(e).set(new U_(r)),e}o(jg,"cloneArrayBuffer");function D$(r,e){var t=e?jg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(D$,"cloneDataView");function R$(r,e,t){var n=e?t(O_(r),!0):O_(r);return fE(n,LF,new r.constructor)}o(R$,"cloneMap");function O$(r){var e=new r.constructor(r.source,DF.exec(r));return e.lastIndex=r.lastIndex,e}o(O$,"cloneRegExp");function N$(r,e,t){var n=e?t(N_(r),!0):N_(r);return fE(n,UF,new r.constructor)}o(N$,"cloneSet");function P$(r){return q_?Object(q_.call(r)):{}}o(P$,"cloneSymbol");function B$(r,e){var t=e?jg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(B$,"cloneTypedArray");function L$(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(L$,"copyArray");function hE(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;lE(t,f,u===void 0?r[f]:u)}return t}o(hE,"copyObject");function U$(r,e){return hE(r,dE(r),e)}o(U$,"copySymbols");function F$(r){return M$(r,Vg,dE)}o(F$,"getAllKeys");function $0(r,e){var t=r.__data__;return j$(e)?t[typeof e=="string"?"string":"hash"]:t.map}o($0,"getMapData");function jc(r,e){var t=HF(r,e);return C$(t)?t:void 0}o(jc,"getNative");var dE=F_?zg(F_,Object):Z$,pf=T$;(Pg&&pf(new Pg(new ArrayBuffer(1)))!=B0||Tl&&pf(new Tl)!=N0||Bg&&pf(Bg.resolve())!=D_||Lg&&pf(new Lg)!=P0||Ug&&pf(new Ug)!=Ng)&&(pf=o(function(r){var e=U0.call(r),t=e==Hg?r.constructor:void 0,n=t?bf(t):void 0;if(n)switch(n){case ZF:return B0;case QF:return N0;case e$:return D_;case t$:return P0;case r$:return Ng}return e},"getTag"));function $$(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&fa.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o($$,"initCloneArray");function q$(r){return typeof r.constructor=="function"&&!pE(r)?S$(VF(r)):{}}o(q$,"initCloneObject");function H$(r,e,t,n){var i=r.constructor;switch(e){case X_:return jg(r);case j_:case K_:return new i(+r);case B0:return D$(r,n);case Z_:case Q_:case eE:case tE:case rE:case nE:case iE:case oE:case sE:return B$(r,n);case N0:return R$(r,n,t);case G_:case J_:return new i(r);case W_:return O$(r);case P0:return N$(r,n,t);case Y_:return P$(r)}}o(H$,"initCloneByTag");function z$(r,e){return e=e??z_,!!e&&(typeof r=="number"||OF.test(r))&&r>-1&&r%1==0&&r<e}o(z$,"isIndex");function j$(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(j$,"isKeyable");function K$(r){return!!P_&&P_ in r}o(K$,"isMasked");function pE(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||L0;return r===t}o(pE,"isPrototype");function bf(r){if(r!=null){try{return uE.call(r)}catch{}try{return r+""}catch{}}return""}o(bf,"toSource");function V$(r){return Fg(r,!0,!0)}o(V$,"cloneDeep");function mE(r,e){return r===e||r!==r&&e!==e}o(mE,"eq");function G$(r){return W$(r)&&fa.call(r,"callee")&&(!WF.call(r,"callee")||U0.call(r)==$g)}o(G$,"isArguments");var Kg=Array.isArray;function bE(r){return r!=null&&Y$(r.length)&&!gE(r)}o(bE,"isArrayLike");function W$(r){return X$(r)&&bE(r)}o(W$,"isArrayLikeObject");var J$=YF||Q$;function gE(r){var e=q0(r)?U0.call(r):"";return e==qg||e==V_}o(gE,"isFunction");function Y$(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=z_}o(Y$,"isLength");function q0(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(q0,"isObject");function X$(r){return!!r&&typeof r=="object"}o(X$,"isObjectLike");function Vg(r){return bE(r)?E$(r):k$(r)}o(Vg,"keys");function Z$(){return[]}o(Z$,"stubArray");function Q$(){return!1}o(Q$,"stubFalse");qc.exports=V$});var l9=Re((ua,u9)=>{var dp=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,pp=function(){function r(){this.fetch=!1,this.DOMException=dp.DOMException}return o(r,"F"),r.prototype=dp,new r}();(function(r){var e=function(t){var n=typeof r<"u"&&r||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function s(h){return h&&DataView.prototype.isPrototypeOf(h)}if(o(s,"isDataView"),i.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function d(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}o(d,"normalizeName");function v(h){return typeof h!="string"&&(h=String(h)),h}o(v,"normalizeValue");function x(h){var g={next:function(){var b=h.shift();return{done:b===void 0,value:b}}};return i.iterable&&(g[Symbol.iterator]=function(){return g}),g}o(x,"iteratorFor");function E(h){this.map={},h instanceof E?h.forEach(function(g,b){this.append(b,g)},this):Array.isArray(h)?h.forEach(function(g){if(g.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+g.length);this.append(g[0],g[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(g){this.append(g,h[g])},this)}o(E,"Headers"),E.prototype.append=function(h,g){h=d(h),g=v(g);var b=this.map[h];this.map[h]=b?b+", "+g:g},E.prototype.delete=function(h){delete this.map[d(h)]},E.prototype.get=function(h){return h=d(h),this.has(h)?this.map[h]:null},E.prototype.has=function(h){return this.map.hasOwnProperty(d(h))},E.prototype.set=function(h,g){this.map[d(h)]=v(g)},E.prototype.forEach=function(h,g){for(var b in this.map)this.map.hasOwnProperty(b)&&h.call(g,this.map[b],b,this)},E.prototype.keys=function(){var h=[];return this.forEach(function(g,b){h.push(b)}),x(h)},E.prototype.values=function(){var h=[];return this.forEach(function(g){h.push(g)}),x(h)},E.prototype.entries=function(){var h=[];return this.forEach(function(g,b){h.push([b,g])}),x(h)},i.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function O(h){if(!h._noBody){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}}o(O,"consumed");function R(h){return new Promise(function(g,b){h.onload=function(){g(h.result)},h.onerror=function(){b(h.error)}})}o(R,"fileReaderReady");function I(h){var g=new FileReader,b=R(g);return g.readAsArrayBuffer(h),b}o(I,"readBlobAsArrayBuffer");function B(h){var g=new FileReader,b=R(g),l=/charset=([A-Za-z0-9_-]+)/.exec(h.type),m=l?l[1]:"utf-8";return g.readAsText(h,m),b}o(B,"readBlobAsText");function Y(h){for(var g=new Uint8Array(h),b=new Array(g.length),l=0;l<g.length;l++)b[l]=String.fromCharCode(g[l]);return b.join("")}o(Y,"readArrayBufferAsText");function P(h){if(h.slice)return h.slice(0);var g=new Uint8Array(h.byteLength);return g.set(new Uint8Array(h)),g.buffer}o(P,"bufferClone");function J(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:i.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:i.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():i.arrayBuffer&&i.blob&&s(h)?(this._bodyArrayBuffer=P(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||u(h))?this._bodyArrayBuffer=P(h):this._bodyText=h=Object.prototype.toString.call(h):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var h=O(this);if(h)return h;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(){if(this._bodyArrayBuffer){var h=O(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var h=O(this);if(h)return h;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(V)}),this.json=function(){return this.text().then(JSON.parse)},this}o(J,"Body");var ee=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function X(h){var g=h.toUpperCase();return ee.indexOf(g)>-1?g:h}o(X,"normalizeMethod");function ne(h,g){if(!(this instanceof ne))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');g=g||{};var b=g.body;if(h instanceof ne){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,g.headers||(this.headers=new E(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!b&&h._bodyInit!=null&&(b=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new E(g.headers)),this.method=X(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal||function(){if("AbortController"in n){var _=new AbortController;return _.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&b)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(b),(this.method==="GET"||this.method==="HEAD")&&(g.cache==="no-store"||g.cache==="no-cache")){var l=/([?&])_=[^&]*/;if(l.test(this.url))this.url=this.url.replace(l,"$1_="+new Date().getTime());else{var m=/\?/;this.url+=(m.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}o(ne,"Request"),ne.prototype.clone=function(){return new ne(this,{body:this._bodyInit})};function V(h){var g=new FormData;return h.trim().split("&").forEach(function(b){if(b){var l=b.split("="),m=l.shift().replace(/\+/g," "),_=l.join("=").replace(/\+/g," ");g.append(decodeURIComponent(m),decodeURIComponent(_))}}),g}o(V,"decode");function H(h){var g=new E,b=h.replace(/\r?\n[\t ]+/g," ");return b.split("\r").map(function(l){return l.indexOf(`
650
- `)===0?l.substr(1,l.length):l}).forEach(function(l){var m=l.split(":"),_=m.shift().trim();if(_){var S=m.join(":").trim();try{g.append(_,S)}catch(A){console.warn("Response "+A.message)}}}),g}o(H,"parseHeaders"),J.call(ne.prototype);function z(h,g){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=g.statusText===void 0?"":""+g.statusText,this.headers=new E(g.headers),this.url=g.url||"",this._initBody(h)}o(z,"Response"),J.call(z.prototype),z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},z.error=function(){var h=new z(null,{status:200,statusText:""});return h.ok=!1,h.status=0,h.type="error",h};var he=[301,302,303,307,308];z.redirect=function(h,g){if(he.indexOf(g)===-1)throw new RangeError("Invalid status code");return new z(null,{status:g,headers:{location:h}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(g,b){this.message=g,this.name=b;var l=Error(g);this.stack=l.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function L(h,g){return new Promise(function(b,l){var m=new ne(h,g);if(m.signal&&m.signal.aborted)return l(new t.DOMException("Aborted","AbortError"));var _=new XMLHttpRequest;function S(){_.abort()}o(S,"abortXhr"),_.onload=function(){var C={statusText:_.statusText,headers:H(_.getAllResponseHeaders()||"")};m.url.indexOf("file://")===0&&(_.status<200||_.status>599)?C.status=200:C.status=_.status,C.url="responseURL"in _?_.responseURL:C.headers.get("X-Request-URL");var N="response"in _?_.response:_.responseText;setTimeout(function(){b(new z(N,C))},0)},_.onerror=function(){setTimeout(function(){l(new TypeError("Network request failed"))},0)},_.ontimeout=function(){setTimeout(function(){l(new TypeError("Network request timed out"))},0)},_.onabort=function(){setTimeout(function(){l(new t.DOMException("Aborted","AbortError"))},0)};function A(C){try{return C===""&&n.location.href?n.location.href:C}catch{return C}}if(o(A,"fixUrl"),_.open(m.method,A(m.url),!0),m.credentials==="include"?_.withCredentials=!0:m.credentials==="omit"&&(_.withCredentials=!1),"responseType"in _&&(i.blob?_.responseType="blob":i.arrayBuffer&&(_.responseType="arraybuffer")),g&&typeof g.headers=="object"&&!(g.headers instanceof E||n.Headers&&g.headers instanceof n.Headers)){var y=[];Object.getOwnPropertyNames(g.headers).forEach(function(C){y.push(d(C)),_.setRequestHeader(C,v(g.headers[C]))}),m.headers.forEach(function(C,N){y.indexOf(N)===-1&&_.setRequestHeader(N,C)})}else m.headers.forEach(function(C,N){_.setRequestHeader(N,C)});m.signal&&(m.signal.addEventListener("abort",S),_.onreadystatechange=function(){_.readyState===4&&m.signal.removeEventListener("abort",S)}),_.send(typeof m._bodyInit>"u"?null:m._bodyInit)})}return o(L,"fetch"),L.polyfill=!0,n.fetch||(n.fetch=L,n.Headers=E,n.Request=ne,n.Response=z),t.Headers=E,t.Request=ne,t.Response=z,t.fetch=L,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(pp);pp.fetch.ponyfill=!0;delete pp.fetch.polyfill;var nu=dp.fetch?dp:pp;ua=nu.fetch;ua.default=nu.fetch;ua.fetch=nu.fetch;ua.Headers=nu.Headers;ua.Request=nu.Request;ua.Response=nu.Response;u9.exports=ua});var _9=Re((tne,w9)=>{"use strict";var Uq=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=Hq(n),this._batchScheduleFn=zq(n),this._cacheKeyFn=jq(n),this._cacheMap=Kq(n),this._batch=null,this.name=Vq(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=$q(this),s=this._cacheMap,f;if(s){f=this._cacheKeyFn(n);var u=s.get(f);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(x){d.push(function(){x(u)})})}}i.keys.push(n);var v=new Promise(function(x,E){i.callbacks.push({resolve:x,reject:E})});return s&&s.set(f,v),v},"load"),e.loadMany=o(function(n){if(!x9(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}(),Fq=typeof process=="object"&&typeof process.nextTick=="function"?function(r){yv||(yv=Promise.resolve()),yv.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},yv;function $q(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(){qq(r,t)}),t}o($q,"getCurrentBatch");function qq(r,e){if(e.hasDispatched=!0,e.keys.length===0){wv(e);return}var t;try{t=r._batchLoadFn(e.keys)}catch(n){return xv(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 xv(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(!x9(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."+(`
647
+ `,_},"errorsToHtml"),ee=o(function(h,g,b){let l,m,_,M;return l="",h.forEach(S=>{m=g[S.line],l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${S.char-m.beginChar}: `,_=m.beginChar,M=S.char-m.beginChar,l+=B(b,_,M),l+=" >> ",_=S.char,M=m.beginChar+m.length-S.char,l+=B(b,_,M),l+=`
648
+ `,l+=`${m.lineNo}: `,l+=`${m.beginChar}: `,l+=`${S.char-m.beginChar}: `,l+="error: ",l+=S.msg,l+=`
649
+ `}),l},"errorsToAscii"),X=!1,ne=!1,V=!1,H=!1,z=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,g){this.lines=u(this.chars,this.errors,h,g),X=!0},"scan"),this.parse=o(function(h,g,b){if(!X)throw new Error(`${n}grammar not scanned`);d.syntax(this.chars,this.lines,this.errors,h,g,b),ne=!0},"parse"),this.translate=o(function(){if(!ne)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,V=!0)},"translate"),this.attributes=o(function(){if(!V)throw new Error(`${n}grammar not scanned, parsed and translated`);return z=v(this.rules,this.udts,he,this.errors),H=!0,z},"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 g=d.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=g.rules,this.udts=g.udts,he=g.lineMap,z=v(this.rules,this.udts,he,this.errors),H=!0)},"generate"),this.displayRules=o(function(h="index"){if(!V)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(!H)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return O(h)},"displayRuleDependencies"),this.displayAttributes=o(function(h="index"){if(!H)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return z&&E(h),x(h)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!H)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return E()},"displayAttributeErrors"),this.toSource=o(function(h=void 0){if(!H)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(z)throw new Error(`${n}can't generate parser source - attributes have ${z} errors`);return d.generateSource(this.chars,this.lines,this.rules,this.udts,h)},"toSource"),this.toObject=o(function(){if(!H)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(z)throw new Error(`${n}can't generate parser source - attributes have ${z} 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 Y(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return P(this.lines)},"linesToHtmlFunc")},"api")});var og=Re((A8,ig)=>{(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=v1().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 M=0;l[0]==="-"&&(M++,this.negative=1),M<l.length&&(m===16?this._parseHex(l,M,_):(this._parseBase(l,m,M),_==="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 M=0;M<this.length;M++)this.words[M]=0;var S,y,C=0;if(_==="be")for(M=l.length-1,S=0;M>=0;M-=3)y=l[M]|l[M-1]<<8|l[M-2]<<16,this.words[S]|=y<<C&67108863,this.words[S+1]=y>>>26-C&67108863,C+=24,C>=26&&(C-=26,S++);else if(_==="le")for(M=0,S=0;M<l.length;M+=3)y=l[M]|l[M+1]<<8|l[M+2]<<16,this.words[S]|=y<<C&67108863,this.words[S+1]=y>>>26-C&67108863,C+=24,C>=26&&(C-=26,S++);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 M=0;M<this.length;M++)this.words[M]=0;var S=0,y=0,C;if(_==="be")for(M=l.length-1;M>=m;M-=2)C=u(l,m,M)<<S,this.words[y]|=C&67108863,S>=18?(S-=18,y+=1,this.words[y]|=C>>>26):S+=8;else{var N=l.length-m;for(M=N%2===0?m+1:m;M<l.length;M+=2)C=u(l,m,M)<<S,this.words[y]|=C&67108863,S>=18?(S-=18,y+=1,this.words[y]|=C>>>26):S+=8}this._strip()},"_parseHex");function d(b,l,m,_){for(var M=0,S=0,y=Math.min(b.length,m),C=l;C<y;C++){var N=b.charCodeAt(C)-48;M*=_,N>=49?S=N-49+10:N>=17?S=N-17+10:S=N,t(N>=0&&S<_,"Invalid character"),M+=S}return M}o(d,"parseBase"),i.prototype._parseBase=o(function(l,m,_){this.words=[0],this.length=1;for(var M=0,S=1;S<=67108863;S*=m)M++;M--,S=S/m|0;for(var y=l.length-_,C=y%M,N=Math.min(y,y-C)+_,w=0,k=_;k<N;k+=M)w=d(l,k,k+M,m),this.imuln(S),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(C!==0){var fe=1;for(w=d(l,k,l.length,m),k=0;k<C;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 v(b,l){b.words=l.words,b.length=l.length,b.negative=l.negative,b.red=l.red}if(o(v,"move"),i.prototype._move=o(function(l){v(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")]=x}catch{i.prototype.inspect=x}else i.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(x,"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 M=0,S=0,y=0;y<this.length;y++){var C=this.words[y],N=((C<<M|S)&16777215).toString(16);S=C>>>24-M&16777215,M+=2,M>=26&&(M-=26,y--),S!==0||y!==this.length-1?_=E[6-N.length]+N+_:_=N+_}for(S!==0&&(_=S.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 M=this.byteLength(),S=_||Math.max(1,M);t(M<=S,"byte array longer than desired length"),t(S>0,"Requested array length <= 0");var y=I(l,S),C=m==="le"?"LE":"BE";return this["_toArrayLike"+C](y,M),y},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,m){for(var _=0,M=0,S=0,y=0;S<this.length;S++){var C=this.words[S]<<y|M;l[_++]=C&255,_<l.length&&(l[_++]=C>>8&255),_<l.length&&(l[_++]=C>>16&255),y===6?(_<l.length&&(l[_++]=C>>24&255),M=0,y=0):(M=C>>>24,y+=2)}if(_<l.length)for(l[_++]=M;_<l.length;)l[_++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,m){for(var _=l.length-1,M=0,S=0,y=0;S<this.length;S++){var C=this.words[S]<<y|M;l[_--]=C&255,_>=0&&(l[_--]=C>>8&255),_>=0&&(l[_--]=C>>16&255),y===6?(_>=0&&(l[_--]=C>>24&255),M=0,y=0):(M=C>>>24,y+=2)}if(_>=0)for(l[_--]=M;_>=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 B(b){for(var l=new Array(b.bitLength()),m=0;m<l.length;m++){var _=m/26|0,M=m%26;l[m]=b.words[_]>>>M&1}return l}o(B,"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 M=0;M<_.length;M++)this.words[M]=m.words[M]^_.words[M];if(this!==m)for(;M<m.length;M++)this.words[M]=m.words[M];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 M=0;M<m;M++)this.words[M]=~this.words[M]&67108863;return _>0&&(this.words[M]=~this.words[M]&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,M=l%26;return this._expand(_+1),m?this.words[_]=this.words[_]|1<<M:this.words[_]=this.words[_]&~(1<<M),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 _,M;this.length>l.length?(_=this,M=l):(_=l,M=this);for(var S=0,y=0;y<M.length;y++)m=(_.words[y]|0)+(M.words[y]|0)+S,this.words[y]=m&67108863,S=m>>>26;for(;S!==0&&y<_.length;y++)m=(_.words[y]|0)+S,this.words[y]=m&67108863,S=m>>>26;if(this.length=_.length,S!==0)this.words[this.length]=S,this.length++;else if(_!==this)for(;y<_.length;y++)this.words[y]=_.words[y];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 M,S;_>0?(M=this,S=l):(M=l,S=this);for(var y=0,C=0;C<S.length;C++)m=(M.words[C]|0)-(S.words[C]|0)+y,y=m>>26,this.words[C]=m&67108863;for(;y!==0&&C<M.length;C++)m=(M.words[C]|0)+y,y=m>>26,this.words[C]=m&67108863;if(y===0&&C<M.length&&M!==this)for(;C<M.length;C++)this.words[C]=M.words[C];return this.length=Math.max(this.length,C),M!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function Y(b,l,m){m.negative=l.negative^b.negative;var _=b.length+l.length|0;m.length=_,_=_-1|0;var M=b.words[0]|0,S=l.words[0]|0,y=M*S,C=y&67108863,N=y/67108864|0;m.words[0]=C;for(var w=1;w<_;w++){for(var k=N>>>26,fe=N&67108863,D=Math.min(w,l.length-1),Q=Math.max(0,w-b.length+1);Q<=D;Q++){var se=w-Q|0;M=b.words[se]|0,S=l.words[Q]|0,y=M*S+fe,k+=y/67108864|0,fe=y&67108863}m.words[w]=fe|0,N=k|0}return N!==0?m.words[w]=N|0:m.length--,m._strip()}o(Y,"smallMulTo");var P=o(function(l,m,_){var M=l.words,S=m.words,y=_.words,C=0,N,w,k,fe=M[0]|0,D=fe&8191,Q=fe>>>13,se=M[1]|0,q=se&8191,j=se>>>13,G=M[2]|0,te=G&8191,ae=G>>>13,Ae=M[3]|0,ge=Ae&8191,ie=Ae>>>13,Me=M[4]|0,ue=Me&8191,ve=Me>>>13,W=M[5]|0,pe=W&8191,ke=W>>>13,je=M[6]|0,Pe=je&8191,Je=je>>>13,gr=M[7]|0,le=gr&8191,oe=gr>>>13,F=M[8]|0,Z=F&8191,me=F>>>13,ye=M[9]|0,we=ye&8191,Ie=ye>>>13,Rt=S[0]|0,Fe=Rt&8191,Ne=Rt>>>13,Lt=S[1]|0,Ve=Lt&8191,Xe=Lt>>>13,Pn=S[2]|0,st=Pn&8191,at=Pn>>>13,ii=S[3]|0,ft=ii&8191,rt=ii>>>13,oi=S[4]|0,ct=oi&8191,ut=oi>>>13,pn=S[5]|0,lt=pn&8191,Qe=pn>>>13,si=S[6]|0,ht=si&8191,dt=si>>>13,ai=S[7]|0,pt=ai&8191,mt=ai>>>13,fi=S[8]|0,bt=fi&8191,nt=fi>>>13,Bn=S[9]|0,qt=Bn&8191,Ht=Bn>>>13;_.negative=l.negative^m.negative,_.length=19,N=Math.imul(D,Fe),w=Math.imul(D,Ne),w=w+Math.imul(Q,Fe)|0,k=Math.imul(Q,Ne);var mn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(mn>>>26)|0,mn&=67108863,N=Math.imul(q,Fe),w=Math.imul(q,Ne),w=w+Math.imul(j,Fe)|0,k=Math.imul(j,Ne),N=N+Math.imul(D,Ve)|0,w=w+Math.imul(D,Xe)|0,w=w+Math.imul(Q,Ve)|0,k=k+Math.imul(Q,Xe)|0;var bn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(bn>>>26)|0,bn&=67108863,N=Math.imul(te,Fe),w=Math.imul(te,Ne),w=w+Math.imul(ae,Fe)|0,k=Math.imul(ae,Ne),N=N+Math.imul(q,Ve)|0,w=w+Math.imul(q,Xe)|0,w=w+Math.imul(j,Ve)|0,k=k+Math.imul(j,Xe)|0,N=N+Math.imul(D,st)|0,w=w+Math.imul(D,at)|0,w=w+Math.imul(Q,st)|0,k=k+Math.imul(Q,at)|0;var gn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(gn>>>26)|0,gn&=67108863,N=Math.imul(ge,Fe),w=Math.imul(ge,Ne),w=w+Math.imul(ie,Fe)|0,k=Math.imul(ie,Ne),N=N+Math.imul(te,Ve)|0,w=w+Math.imul(te,Xe)|0,w=w+Math.imul(ae,Ve)|0,k=k+Math.imul(ae,Xe)|0,N=N+Math.imul(q,st)|0,w=w+Math.imul(q,at)|0,w=w+Math.imul(j,st)|0,k=k+Math.imul(j,at)|0,N=N+Math.imul(D,ft)|0,w=w+Math.imul(D,rt)|0,w=w+Math.imul(Q,ft)|0,k=k+Math.imul(Q,rt)|0;var Fr=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,N=Math.imul(ue,Fe),w=Math.imul(ue,Ne),w=w+Math.imul(ve,Fe)|0,k=Math.imul(ve,Ne),N=N+Math.imul(ge,Ve)|0,w=w+Math.imul(ge,Xe)|0,w=w+Math.imul(ie,Ve)|0,k=k+Math.imul(ie,Xe)|0,N=N+Math.imul(te,st)|0,w=w+Math.imul(te,at)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,N=N+Math.imul(q,ft)|0,w=w+Math.imul(q,rt)|0,w=w+Math.imul(j,ft)|0,k=k+Math.imul(j,rt)|0,N=N+Math.imul(D,ct)|0,w=w+Math.imul(D,ut)|0,w=w+Math.imul(Q,ct)|0,k=k+Math.imul(Q,ut)|0;var vn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(vn>>>26)|0,vn&=67108863,N=Math.imul(pe,Fe),w=Math.imul(pe,Ne),w=w+Math.imul(ke,Fe)|0,k=Math.imul(ke,Ne),N=N+Math.imul(ue,Ve)|0,w=w+Math.imul(ue,Xe)|0,w=w+Math.imul(ve,Ve)|0,k=k+Math.imul(ve,Xe)|0,N=N+Math.imul(ge,st)|0,w=w+Math.imul(ge,at)|0,w=w+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,N=N+Math.imul(te,ft)|0,w=w+Math.imul(te,rt)|0,w=w+Math.imul(ae,ft)|0,k=k+Math.imul(ae,rt)|0,N=N+Math.imul(q,ct)|0,w=w+Math.imul(q,ut)|0,w=w+Math.imul(j,ct)|0,k=k+Math.imul(j,ut)|0,N=N+Math.imul(D,lt)|0,w=w+Math.imul(D,Qe)|0,w=w+Math.imul(Q,lt)|0,k=k+Math.imul(Q,Qe)|0;var ci=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ci>>>26)|0,ci&=67108863,N=Math.imul(Pe,Fe),w=Math.imul(Pe,Ne),w=w+Math.imul(Je,Fe)|0,k=Math.imul(Je,Ne),N=N+Math.imul(pe,Ve)|0,w=w+Math.imul(pe,Xe)|0,w=w+Math.imul(ke,Ve)|0,k=k+Math.imul(ke,Xe)|0,N=N+Math.imul(ue,st)|0,w=w+Math.imul(ue,at)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,N=N+Math.imul(ge,ft)|0,w=w+Math.imul(ge,rt)|0,w=w+Math.imul(ie,ft)|0,k=k+Math.imul(ie,rt)|0,N=N+Math.imul(te,ct)|0,w=w+Math.imul(te,ut)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,N=N+Math.imul(q,lt)|0,w=w+Math.imul(q,Qe)|0,w=w+Math.imul(j,lt)|0,k=k+Math.imul(j,Qe)|0,N=N+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 Lo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,N=Math.imul(le,Fe),w=Math.imul(le,Ne),w=w+Math.imul(oe,Fe)|0,k=Math.imul(oe,Ne),N=N+Math.imul(Pe,Ve)|0,w=w+Math.imul(Pe,Xe)|0,w=w+Math.imul(Je,Ve)|0,k=k+Math.imul(Je,Xe)|0,N=N+Math.imul(pe,st)|0,w=w+Math.imul(pe,at)|0,w=w+Math.imul(ke,st)|0,k=k+Math.imul(ke,at)|0,N=N+Math.imul(ue,ft)|0,w=w+Math.imul(ue,rt)|0,w=w+Math.imul(ve,ft)|0,k=k+Math.imul(ve,rt)|0,N=N+Math.imul(ge,ct)|0,w=w+Math.imul(ge,ut)|0,w=w+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,N=N+Math.imul(te,lt)|0,w=w+Math.imul(te,Qe)|0,w=w+Math.imul(ae,lt)|0,k=k+Math.imul(ae,Qe)|0,N=N+Math.imul(q,ht)|0,w=w+Math.imul(q,dt)|0,w=w+Math.imul(j,ht)|0,k=k+Math.imul(j,dt)|0,N=N+Math.imul(D,pt)|0,w=w+Math.imul(D,mt)|0,w=w+Math.imul(Q,pt)|0,k=k+Math.imul(Q,mt)|0;var Uo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,N=Math.imul(Z,Fe),w=Math.imul(Z,Ne),w=w+Math.imul(me,Fe)|0,k=Math.imul(me,Ne),N=N+Math.imul(le,Ve)|0,w=w+Math.imul(le,Xe)|0,w=w+Math.imul(oe,Ve)|0,k=k+Math.imul(oe,Xe)|0,N=N+Math.imul(Pe,st)|0,w=w+Math.imul(Pe,at)|0,w=w+Math.imul(Je,st)|0,k=k+Math.imul(Je,at)|0,N=N+Math.imul(pe,ft)|0,w=w+Math.imul(pe,rt)|0,w=w+Math.imul(ke,ft)|0,k=k+Math.imul(ke,rt)|0,N=N+Math.imul(ue,ct)|0,w=w+Math.imul(ue,ut)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,N=N+Math.imul(ge,lt)|0,w=w+Math.imul(ge,Qe)|0,w=w+Math.imul(ie,lt)|0,k=k+Math.imul(ie,Qe)|0,N=N+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,N=N+Math.imul(q,pt)|0,w=w+Math.imul(q,mt)|0,w=w+Math.imul(j,pt)|0,k=k+Math.imul(j,mt)|0,N=N+Math.imul(D,bt)|0,w=w+Math.imul(D,nt)|0,w=w+Math.imul(Q,bt)|0,k=k+Math.imul(Q,nt)|0;var Fo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,N=Math.imul(we,Fe),w=Math.imul(we,Ne),w=w+Math.imul(Ie,Fe)|0,k=Math.imul(Ie,Ne),N=N+Math.imul(Z,Ve)|0,w=w+Math.imul(Z,Xe)|0,w=w+Math.imul(me,Ve)|0,k=k+Math.imul(me,Xe)|0,N=N+Math.imul(le,st)|0,w=w+Math.imul(le,at)|0,w=w+Math.imul(oe,st)|0,k=k+Math.imul(oe,at)|0,N=N+Math.imul(Pe,ft)|0,w=w+Math.imul(Pe,rt)|0,w=w+Math.imul(Je,ft)|0,k=k+Math.imul(Je,rt)|0,N=N+Math.imul(pe,ct)|0,w=w+Math.imul(pe,ut)|0,w=w+Math.imul(ke,ct)|0,k=k+Math.imul(ke,ut)|0,N=N+Math.imul(ue,lt)|0,w=w+Math.imul(ue,Qe)|0,w=w+Math.imul(ve,lt)|0,k=k+Math.imul(ve,Qe)|0,N=N+Math.imul(ge,ht)|0,w=w+Math.imul(ge,dt)|0,w=w+Math.imul(ie,ht)|0,k=k+Math.imul(ie,dt)|0,N=N+Math.imul(te,pt)|0,w=w+Math.imul(te,mt)|0,w=w+Math.imul(ae,pt)|0,k=k+Math.imul(ae,mt)|0,N=N+Math.imul(q,bt)|0,w=w+Math.imul(q,nt)|0,w=w+Math.imul(j,bt)|0,k=k+Math.imul(j,nt)|0,N=N+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 fo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,N=Math.imul(we,Ve),w=Math.imul(we,Xe),w=w+Math.imul(Ie,Ve)|0,k=Math.imul(Ie,Xe),N=N+Math.imul(Z,st)|0,w=w+Math.imul(Z,at)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,N=N+Math.imul(le,ft)|0,w=w+Math.imul(le,rt)|0,w=w+Math.imul(oe,ft)|0,k=k+Math.imul(oe,rt)|0,N=N+Math.imul(Pe,ct)|0,w=w+Math.imul(Pe,ut)|0,w=w+Math.imul(Je,ct)|0,k=k+Math.imul(Je,ut)|0,N=N+Math.imul(pe,lt)|0,w=w+Math.imul(pe,Qe)|0,w=w+Math.imul(ke,lt)|0,k=k+Math.imul(ke,Qe)|0,N=N+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,N=N+Math.imul(ge,pt)|0,w=w+Math.imul(ge,mt)|0,w=w+Math.imul(ie,pt)|0,k=k+Math.imul(ie,mt)|0,N=N+Math.imul(te,bt)|0,w=w+Math.imul(te,nt)|0,w=w+Math.imul(ae,bt)|0,k=k+Math.imul(ae,nt)|0,N=N+Math.imul(q,qt)|0,w=w+Math.imul(q,Ht)|0,w=w+Math.imul(j,qt)|0,k=k+Math.imul(j,Ht)|0;var co=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(co>>>26)|0,co&=67108863,N=Math.imul(we,st),w=Math.imul(we,at),w=w+Math.imul(Ie,st)|0,k=Math.imul(Ie,at),N=N+Math.imul(Z,ft)|0,w=w+Math.imul(Z,rt)|0,w=w+Math.imul(me,ft)|0,k=k+Math.imul(me,rt)|0,N=N+Math.imul(le,ct)|0,w=w+Math.imul(le,ut)|0,w=w+Math.imul(oe,ct)|0,k=k+Math.imul(oe,ut)|0,N=N+Math.imul(Pe,lt)|0,w=w+Math.imul(Pe,Qe)|0,w=w+Math.imul(Je,lt)|0,k=k+Math.imul(Je,Qe)|0,N=N+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,N=N+Math.imul(ue,pt)|0,w=w+Math.imul(ue,mt)|0,w=w+Math.imul(ve,pt)|0,k=k+Math.imul(ve,mt)|0,N=N+Math.imul(ge,bt)|0,w=w+Math.imul(ge,nt)|0,w=w+Math.imul(ie,bt)|0,k=k+Math.imul(ie,nt)|0,N=N+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 uo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(uo>>>26)|0,uo&=67108863,N=Math.imul(we,ft),w=Math.imul(we,rt),w=w+Math.imul(Ie,ft)|0,k=Math.imul(Ie,rt),N=N+Math.imul(Z,ct)|0,w=w+Math.imul(Z,ut)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,N=N+Math.imul(le,lt)|0,w=w+Math.imul(le,Qe)|0,w=w+Math.imul(oe,lt)|0,k=k+Math.imul(oe,Qe)|0,N=N+Math.imul(Pe,ht)|0,w=w+Math.imul(Pe,dt)|0,w=w+Math.imul(Je,ht)|0,k=k+Math.imul(Je,dt)|0,N=N+Math.imul(pe,pt)|0,w=w+Math.imul(pe,mt)|0,w=w+Math.imul(ke,pt)|0,k=k+Math.imul(ke,mt)|0,N=N+Math.imul(ue,bt)|0,w=w+Math.imul(ue,nt)|0,w=w+Math.imul(ve,bt)|0,k=k+Math.imul(ve,nt)|0,N=N+Math.imul(ge,qt)|0,w=w+Math.imul(ge,Ht)|0,w=w+Math.imul(ie,qt)|0,k=k+Math.imul(ie,Ht)|0;var $o=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+($o>>>26)|0,$o&=67108863,N=Math.imul(we,ct),w=Math.imul(we,ut),w=w+Math.imul(Ie,ct)|0,k=Math.imul(Ie,ut),N=N+Math.imul(Z,lt)|0,w=w+Math.imul(Z,Qe)|0,w=w+Math.imul(me,lt)|0,k=k+Math.imul(me,Qe)|0,N=N+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,N=N+Math.imul(Pe,pt)|0,w=w+Math.imul(Pe,mt)|0,w=w+Math.imul(Je,pt)|0,k=k+Math.imul(Je,mt)|0,N=N+Math.imul(pe,bt)|0,w=w+Math.imul(pe,nt)|0,w=w+Math.imul(ke,bt)|0,k=k+Math.imul(ke,nt)|0,N=N+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 qo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(qo>>>26)|0,qo&=67108863,N=Math.imul(we,lt),w=Math.imul(we,Qe),w=w+Math.imul(Ie,lt)|0,k=Math.imul(Ie,Qe),N=N+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,N=N+Math.imul(le,pt)|0,w=w+Math.imul(le,mt)|0,w=w+Math.imul(oe,pt)|0,k=k+Math.imul(oe,mt)|0,N=N+Math.imul(Pe,bt)|0,w=w+Math.imul(Pe,nt)|0,w=w+Math.imul(Je,bt)|0,k=k+Math.imul(Je,nt)|0,N=N+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 Ho=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,N=Math.imul(we,ht),w=Math.imul(we,dt),w=w+Math.imul(Ie,ht)|0,k=Math.imul(Ie,dt),N=N+Math.imul(Z,pt)|0,w=w+Math.imul(Z,mt)|0,w=w+Math.imul(me,pt)|0,k=k+Math.imul(me,mt)|0,N=N+Math.imul(le,bt)|0,w=w+Math.imul(le,nt)|0,w=w+Math.imul(oe,bt)|0,k=k+Math.imul(oe,nt)|0,N=N+Math.imul(Pe,qt)|0,w=w+Math.imul(Pe,Ht)|0,w=w+Math.imul(Je,qt)|0,k=k+Math.imul(Je,Ht)|0;var zo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(zo>>>26)|0,zo&=67108863,N=Math.imul(we,pt),w=Math.imul(we,mt),w=w+Math.imul(Ie,pt)|0,k=Math.imul(Ie,mt),N=N+Math.imul(Z,bt)|0,w=w+Math.imul(Z,nt)|0,w=w+Math.imul(me,bt)|0,k=k+Math.imul(me,nt)|0,N=N+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 Pf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Pf>>>26)|0,Pf&=67108863,N=Math.imul(we,bt),w=Math.imul(we,nt),w=w+Math.imul(Ie,bt)|0,k=Math.imul(Ie,nt),N=N+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 Bf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Bf>>>26)|0,Bf&=67108863,N=Math.imul(we,qt),w=Math.imul(we,Ht),w=w+Math.imul(Ie,qt)|0,k=Math.imul(Ie,Ht);var Lf=(C+N|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(Lf>>>26)|0,Lf&=67108863,y[0]=mn,y[1]=bn,y[2]=gn,y[3]=Fr,y[4]=vn,y[5]=ci,y[6]=Lo,y[7]=Uo,y[8]=Fo,y[9]=fo,y[10]=co,y[11]=uo,y[12]=$o,y[13]=qo,y[14]=Ho,y[15]=zo,y[16]=Pf,y[17]=Bf,y[18]=Lf,C!==0&&(y[19]=C,_.length++),_},"comb10MulTo");Math.imul||(P=Y);function J(b,l,m){m.negative=l.negative^b.negative,m.length=b.length+l.length;for(var _=0,M=0,S=0;S<m.length-1;S++){var y=M;M=0;for(var C=_&67108863,N=Math.min(S,l.length-1),w=Math.max(0,S-b.length+1);w<=N;w++){var k=S-w,fe=b.words[k]|0,D=l.words[w]|0,Q=fe*D,se=Q&67108863;y=y+(Q/67108864|0)|0,se=se+C|0,C=se&67108863,y=y+(se>>>26)|0,M+=y>>>26,y&=67108863}m.words[S]=C,_=y,y=M}return _!==0?m.words[S]=_: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 _,M=this.length+l.length;return this.length===10&&l.length===10?_=P(this,l,m):M<63?_=Y(this,l,m):M<1024?_=J(this,l,m):_=ee(this,l,m),_},"mulTo");function X(b,l){this.x=b,this.y=l}o(X,"FFTM"),X.prototype.makeRBT=o(function(l){for(var m=new Array(l),_=i.prototype._countBits(l)-1,M=0;M<l;M++)m[M]=this.revBin(M,_,l);return m},"makeRBT"),X.prototype.revBin=o(function(l,m,_){if(l===0||l===_-1)return l;for(var M=0,S=0;S<m;S++)M|=(l&1)<<m-S-1,l>>=1;return M},"revBin"),X.prototype.permute=o(function(l,m,_,M,S,y){for(var C=0;C<y;C++)M[C]=m[l[C]],S[C]=_[l[C]]},"permute"),X.prototype.transform=o(function(l,m,_,M,S,y){this.permute(y,l,m,_,M,S);for(var C=1;C<S;C<<=1)for(var N=C<<1,w=Math.cos(2*Math.PI/N),k=Math.sin(2*Math.PI/N),fe=0;fe<S;fe+=N)for(var D=w,Q=k,se=0;se<C;se++){var q=_[fe+se],j=M[fe+se],G=_[fe+se+C],te=M[fe+se+C],ae=D*G-Q*te;te=D*te+Q*G,G=ae,_[fe+se]=q+G,M[fe+se]=j+te,_[fe+se+C]=q-G,M[fe+se+C]=j-te,se!==N&&(ae=w*D-k*Q,Q=w*Q+k*D,D=ae)}},"transform"),X.prototype.guessLen13b=o(function(l,m){var _=Math.max(m,l)|1,M=_&1,S=0;for(_=_/2|0;_;_=_>>>1)S++;return 1<<S+1+M},"guessLen13b"),X.prototype.conjugate=o(function(l,m,_){if(!(_<=1))for(var M=0;M<_/2;M++){var S=l[M];l[M]=l[_-M-1],l[_-M-1]=S,S=m[M],m[M]=-m[_-M-1],m[_-M-1]=-S}},"conjugate"),X.prototype.normalize13b=o(function(l,m){for(var _=0,M=0;M<m/2;M++){var S=Math.round(l[2*M+1]/m)*8192+Math.round(l[2*M]/m)+_;l[M]=S&67108863,S<67108864?_=0:_=S/67108864|0}return l},"normalize13b"),X.prototype.convert13b=o(function(l,m,_,M){for(var S=0,y=0;y<m;y++)S=S+(l[y]|0),_[2*y]=S&8191,S=S>>>13,_[2*y+1]=S&8191,S=S>>>13;for(y=2*m;y<M;++y)_[y]=0;t(S===0),t((S&-8192)===0)},"convert13b"),X.prototype.stub=o(function(l){for(var m=new Array(l),_=0;_<l;_++)m[_]=0;return m},"stub"),X.prototype.mulp=o(function(l,m,_){var M=2*this.guessLen13b(l.length,m.length),S=this.makeRBT(M),y=this.stub(M),C=new Array(M),N=new Array(M),w=new Array(M),k=new Array(M),fe=new Array(M),D=new Array(M),Q=_.words;Q.length=M,this.convert13b(l.words,l.length,C,M),this.convert13b(m.words,m.length,k,M),this.transform(C,y,N,w,M,S),this.transform(k,y,fe,D,M,S);for(var se=0;se<M;se++){var q=N[se]*fe[se]-w[se]*D[se];w[se]=N[se]*D[se]+w[se]*fe[se],N[se]=q}return this.conjugate(N,w,M),this.transform(N,w,Q,y,M,S),this.conjugate(Q,y,M),this.normalize13b(Q,M),_.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,M=0;M<this.length;M++){var S=(this.words[M]|0)*l,y=(S&67108863)+(_&67108863);_>>=26,_+=S/67108864|0,_+=y>>>26,this.words[M]=y&67108863}return _!==0&&(this.words[M]=_,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=B(l);if(m.length===0)return new i(1);for(var _=this,M=0;M<m.length&&m[M]===0;M++,_=_.sqr());if(++M<m.length)for(var S=_.sqr();M<m.length;M++,S=S.sqr())m[M]!==0&&(_=_.mul(S));return _},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26,M=67108863>>>26-m<<26-m,S;if(m!==0){var y=0;for(S=0;S<this.length;S++){var C=this.words[S]&M,N=(this.words[S]|0)-C<<m;this.words[S]=N|y,y=C>>>26-m}y&&(this.words[S]=y,this.length++)}if(_!==0){for(S=this.length-1;S>=0;S--)this.words[S+_]=this.words[S];for(S=0;S<_;S++)this.words[S]=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 M;m?M=(m-m%26)/26:M=0;var S=l%26,y=Math.min((l-S)/26,this.length),C=67108863^67108863>>>S<<S,N=_;if(M-=y,M=Math.max(0,M),N){for(var w=0;w<y;w++)N.words[w]=this.words[w];N.length=y}if(y!==0)if(this.length>y)for(this.length-=y,w=0;w<this.length;w++)this.words[w]=this.words[w+y];else this.words[0]=0,this.length=1;var k=0;for(w=this.length-1;w>=0&&(k!==0||w>=M);w--){var fe=this.words[w]|0;this.words[w]=k<<26-S|fe>>>S,k=fe&C}return N&&k!==0&&(N.words[N.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,M=1<<m;if(this.length<=_)return!1;var S=this.words[_];return!!(S&M)},"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 M=67108863^67108863>>>m<<m;this.words[this.length-1]&=M}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 M=l.length+_,S;this._expand(M);var y,C=0;for(S=0;S<l.length;S++){y=(this.words[S+_]|0)+C;var N=(l.words[S]|0)*m;y-=N&67108863,C=(y>>26)-(N/67108864|0),this.words[S+_]=y&67108863}for(;S<this.length-_;S++)y=(this.words[S+_]|0)+C,C=y>>26,this.words[S+_]=y&67108863;if(C===0)return this._strip();for(t(C===-1),C=0,S=0;S<this.length;S++)y=-(this.words[S]|0)+C,C=y>>26,this.words[S]=y&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,m){var _=this.length-l.length,M=this.clone(),S=l,y=S.words[S.length-1]|0,C=this._countBits(y);_=26-C,_!==0&&(S=S.ushln(_),M.iushln(_),y=S.words[S.length-1]|0);var N=M.length-S.length,w;if(m!=="mod"){w=new i(null),w.length=N+1,w.words=new Array(w.length);for(var k=0;k<w.length;k++)w.words[k]=0}var fe=M.clone()._ishlnsubmul(S,1,N);fe.negative===0&&(M=fe,w&&(w.words[N]=1));for(var D=N-1;D>=0;D--){var Q=(M.words[S.length+D]|0)*67108864+(M.words[S.length+D-1]|0);for(Q=Math.min(Q/y|0,67108863),M._ishlnsubmul(S,Q,D);M.negative!==0;)Q--,M.negative=0,M._ishlnsubmul(S,1,D),M.isZero()||(M.negative^=1);w&&(w.words[D]=Q)}return w&&w._strip(),M._strip(),m!=="div"&&_!==0&&M.iushrn(_),{div:w||null,mod:M}},"_wordDiv"),i.prototype.divmod=o(function(l,m,_){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var M,S,y;return this.negative!==0&&l.negative===0?(y=this.neg().divmod(l,m),m!=="mod"&&(M=y.div.neg()),m!=="div"&&(S=y.mod.neg(),_&&S.negative!==0&&S.iadd(l)),{div:M,mod:S}):this.negative===0&&l.negative!==0?(y=this.divmod(l.neg(),m),m!=="mod"&&(M=y.div.neg()),{div:M,mod:y.mod}):(this.negative&l.negative)!==0?(y=this.neg().divmod(l.neg(),m),m!=="div"&&(S=y.mod.neg(),_&&S.negative!==0&&S.isub(l)),{div:y.div,mod:S}):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,M=l.ushrn(1),S=l.andln(1),y=_.cmp(M);return y<0||S===1&&y===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,M=0,S=this.length-1;S>=0;S--)M=(_*M+(this.words[S]|0))%l;return m?-M:M},"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,M=this.length-1;M>=0;M--){var S=(this.words[M]|0)+_*67108864;this.words[M]=S/l|0,_=S%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 M=new i(1),S=new i(0),y=new i(0),C=new i(1),N=0;m.isEven()&&_.isEven();)m.iushrn(1),_.iushrn(1),++N;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;)(M.isOdd()||S.isOdd())&&(M.iadd(w),S.isub(k)),M.iushrn(1),S.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;)(y.isOdd()||C.isOdd())&&(y.iadd(w),C.isub(k)),y.iushrn(1),C.iushrn(1);m.cmp(_)>=0?(m.isub(_),M.isub(y),S.isub(C)):(_.isub(m),y.isub(M),C.isub(S))}return{a:y,b:C,gcd:_.iushln(N)}},"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 M=new i(1),S=new i(0),y=_.clone();m.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,N=1;(m.words[0]&N)===0&&C<26;++C,N<<=1);if(C>0)for(m.iushrn(C);C-- >0;)M.isOdd()&&M.iadd(y),M.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;)S.isOdd()&&S.iadd(y),S.iushrn(1);m.cmp(_)>=0?(m.isub(_),M.isub(S)):(_.isub(m),S.isub(M))}var fe;return m.cmpn(1)===0?fe=M:fe=S,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 M=0;m.isEven()&&_.isEven();M++)m.iushrn(1),_.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;_.isEven();)_.iushrn(1);var S=m.cmp(_);if(S<0){var y=m;m=_,_=y}else if(S===0||_.cmpn(1)===0)break;m.isub(_)}while(!0);return _.iushln(M)},"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,M=1<<m;if(this.length<=_)return this._expand(_+1),this.words[_]|=M,this;for(var S=M,y=_;S!==0&&y<this.length;y++){var C=this.words[y]|0;C+=S,S=C>>>26,C&=67108863,this.words[y]=C}return S!==0&&(this.words[y]=S,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 M=this.words[0]|0;_=M===l?0:M<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 M=this.words[_]|0,S=l.words[_]|0;if(M!==S){M<S?m=-1:M>S&&(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 ne={k256:null,p224:null,p192:null,p25519:null};function V(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(V,"MPrime"),V.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),V.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 M=_<this.n?-1:m.ucmp(this.p);return M===0?(m.words[0]=0,m.length=1):M>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),V.prototype.split=o(function(l,m){l.iushrn(this.n,0,m)},"split"),V.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,V),H.prototype.split=o(function(l,m){for(var _=4194303,M=Math.min(l.length,9),S=0;S<M;S++)m.words[S]=l.words[S];if(m.length=M,l.length<=9){l.words[0]=0,l.length=1;return}var y=l.words[9];for(m.words[m.length++]=y&_,S=10;S<l.length;S++){var C=l.words[S]|0;l.words[S-10]=(C&_)<<4|y>>>22,y=C}y>>>=22,l.words[S-10]=y,y===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var m=0,_=0;_<l.length;_++){var M=l.words[_]|0;m+=M*977,l.words[_]=m&67108863,m=M*64+(m/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function z(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(z,"P224"),n(z,V);function he(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(he,"P192"),n(he,V);function L(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,V),L.prototype.imulK=o(function(l){for(var m=0,_=0;_<l.length;_++){var M=(l.words[_]|0)*19+m,S=M&67108863;M>>>=26,l.words[_]=S,m=M}return m!==0&&(l.words[l.length++]=m),l},"imulK"),i._prime=o(function(l){if(ne[l])return ne[l];var m;if(l==="k256")m=new H;else if(l==="p224")m=new z;else if(l==="p192")m=new he;else if(l==="p25519")m=new L;else throw new Error("Unknown prime "+l);return ne[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):(v(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 M=this.m.subn(1),S=0;!M.isZero()&&M.andln(1)===0;)S++,M.iushrn(1);t(!M.isZero());var y=new i(1).toRed(this),C=y.redNeg(),N=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,N).cmp(C)!==0;)w.redIAdd(C);for(var k=this.pow(w,M),fe=this.pow(l,M.addn(1).iushrn(1)),D=this.pow(l,M),Q=S;D.cmp(y)!==0;){for(var se=D,q=0;se.cmp(y)!==0;q++)se=se.redSqr();t(q<Q);var j=this.pow(k,new i(1).iushln(Q-q-1));fe=fe.redMul(j),k=j.redSqr(),D=D.redMul(k),Q=q}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,M=new Array(1<<_);M[0]=new i(1).toRed(this),M[1]=l;for(var S=2;S<M.length;S++)M[S]=this.mul(M[S-1],l);var y=M[0],C=0,N=0,w=m.bitLength()%26;for(w===0&&(w=26),S=m.length-1;S>=0;S--){for(var k=m.words[S],fe=w-1;fe>=0;fe--){var D=k>>fe&1;if(y!==M[0]&&(y=this.sqr(y)),D===0&&C===0){N=0;continue}C<<=1,C|=D,N++,!(N!==_&&(S!==0||fe!==0))&&(y=this.mul(y,M[C]),N=0,C=0)}w=26}return y},"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 g(l)},"mont");function g(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(g,"Mont"),n(g,h),g.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),g.prototype.convertFrom=o(function(l){var m=this.imod(l.mul(this.rinv));return m.red=null,m},"convertFrom"),g.prototype.imul=o(function(l,m){if(l.isZero()||m.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(m),M=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=_.isub(M).iushrn(this.shift),y=S;return S.cmp(this.m)>=0?y=S.isub(this.m):S.cmpn(0)<0&&(y=S.iadd(this.m)),y._forceRed(this)},"imul"),g.prototype.mul=o(function(l,m){if(l.isZero()||m.isZero())return new i(0)._forceRed(this);var _=l.mul(m),M=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=_.isub(M).iushrn(this.shift),y=S;return S.cmp(this.m)>=0?y=S.isub(this.m):S.cmpn(0)<0&&(y=S.iadd(this.m)),y._forceRed(this)},"mul"),g.prototype.invm=o(function(l){var m=this.imod(l._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm")})(typeof ig>"u"||ig,A8)});var f_=Re((vX,a_)=>{a_.exports=yg;var s_=128,LU=127,UU=~LU,FU=Math.pow(2,31);function yg(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw yg.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=FU;)e[t++]=r&255|s_,r/=128;for(;r&UU;)e[t++]=r&255|s_,r>>>=7;return e[t]=r|0,yg.bytes=t-n+1,e}o(yg,"encode")});var l_=Re((yX,u_)=>{u_.exports=xg;var $U=128,c_=127;function xg(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u||i>49)throw xg.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&c_)<<i:(f&c_)*Math.pow(2,i),i+=7}while(f>=$U);return xg.bytes=s-n,t}o(xg,"read")});var d_=Re((xX,h_)=>{var qU=Math.pow(2,7),HU=Math.pow(2,14),zU=Math.pow(2,21),jU=Math.pow(2,28),KU=Math.pow(2,35),VU=Math.pow(2,42),GU=Math.pow(2,49),WU=Math.pow(2,56),JU=Math.pow(2,63);h_.exports=function(r){return r<qU?1:r<HU?2:r<zU?3:r<jU?4:r<KU?5:r<VU?6:r<GU?7:r<WU?8:r<JU?9:10}});var _l=Re((wX,p_)=>{p_.exports={encode:f_(),decode:l_(),encodingLength:d_()}});var S_=Re((MX,A_)=>{"use strict";A_.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 v={key:u,value:f[u]},x={key:d,value:f[d]};return s(v,x)}}}(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 v=i.push(f)-1,x=Object.keys(f).sort(n&&n(f));for(d="",u=0;u<x.length;u++){var E=x[u],O=s(f[E]);!O||(d&&(d+=","),d+=JSON.stringify(E)+":"+O)}return i.splice(v,1),"{"+d+"}"}},"stringify")(r)}});var Kc=Re((Tl,qc)=>{var DF=200,z_="__lodash_hash_undefined__",j_=9007199254740991,Hg="[object Arguments]",RF="[object Array]",K_="[object Boolean]",V_="[object Date]",OF="[object Error]",zg="[object Function]",G_="[object GeneratorFunction]",P0="[object Map]",W_="[object Number]",jg="[object Object]",R_="[object Promise]",J_="[object RegExp]",B0="[object Set]",Y_="[object String]",X_="[object Symbol]",Bg="[object WeakMap]",Z_="[object ArrayBuffer]",L0="[object DataView]",Q_="[object Float32Array]",eE="[object Float64Array]",tE="[object Int8Array]",rE="[object Int16Array]",nE="[object Int32Array]",iE="[object Uint8Array]",oE="[object Uint8ClampedArray]",sE="[object Uint16Array]",aE="[object Uint32Array]",NF=/[\\^$.*+?()[\]{}|]/g,PF=/\w*$/,BF=/^\[object .+?Constructor\]$/,LF=/^(?:0|[1-9]\d*)$/,or={};or[Hg]=or[RF]=or[Z_]=or[L0]=or[K_]=or[V_]=or[Q_]=or[eE]=or[tE]=or[rE]=or[nE]=or[P0]=or[W_]=or[jg]=or[J_]=or[B0]=or[Y_]=or[X_]=or[iE]=or[oE]=or[sE]=or[aE]=!0;or[OF]=or[zg]=or[Bg]=!1;var UF=typeof global=="object"&&global&&global.Object===Object&&global,FF=typeof self=="object"&&self&&self.Object===Object&&self,ms=UF||FF||Function("return this")(),fE=typeof Tl=="object"&&Tl&&!Tl.nodeType&&Tl,O_=fE&&typeof qc=="object"&&qc&&!qc.nodeType&&qc,$F=O_&&O_.exports===fE;function qF(r,e){return r.set(e[0],e[1]),r}o(qF,"addMapEntry");function HF(r,e){return r.add(e),r}o(HF,"addSetEntry");function zF(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(zF,"arrayEach");function jF(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(jF,"arrayPush");function cE(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(cE,"arrayReduce");function KF(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(KF,"baseTimes");function VF(r,e){return r?.[e]}o(VF,"getValue");function uE(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}o(uE,"isHostObject");function N_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(N_,"mapToArray");function Kg(r,e){return function(t){return r(e(t))}}o(Kg,"overArg");function P_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(P_,"setToArray");var GF=Array.prototype,WF=Function.prototype,U0=Object.prototype,Pg=ms["__core-js_shared__"],B_=function(){var r=/[^.]+$/.exec(Pg&&Pg.keys&&Pg.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),lE=WF.toString,fa=U0.hasOwnProperty,F0=U0.toString,JF=RegExp("^"+lE.call(fa).replace(NF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L_=$F?ms.Buffer:void 0,U_=ms.Symbol,F_=ms.Uint8Array,YF=Kg(Object.getPrototypeOf,Object),XF=Object.create,ZF=U0.propertyIsEnumerable,QF=GF.splice,$_=Object.getOwnPropertySymbols,e$=L_?L_.isBuffer:void 0,t$=Kg(Object.keys,Object),Lg=jc(ms,"DataView"),Cl=jc(ms,"Map"),Ug=jc(ms,"Promise"),Fg=jc(ms,"Set"),$g=jc(ms,"WeakMap"),kl=jc(Object,"create"),r$=bf(Lg),n$=bf(Cl),i$=bf(Ug),o$=bf(Fg),s$=bf($g),q_=U_?U_.prototype:void 0,H_=q_?q_.valueOf:void 0;function mf(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(mf,"Hash");function a$(){this.__data__=kl?kl(null):{}}o(a$,"hashClear");function f$(r){return this.has(r)&&delete this.__data__[r]}o(f$,"hashDelete");function c$(r){var e=this.__data__;if(kl){var t=e[r];return t===z_?void 0:t}return fa.call(e,r)?e[r]:void 0}o(c$,"hashGet");function u$(r){var e=this.__data__;return kl?e[r]!==void 0:fa.call(e,r)}o(u$,"hashHas");function l$(r,e){var t=this.__data__;return t[r]=kl&&e===void 0?z_:e,this}o(l$,"hashSet");mf.prototype.clear=a$;mf.prototype.delete=f$;mf.prototype.get=c$;mf.prototype.has=u$;mf.prototype.set=l$;function bs(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(bs,"ListCache");function h$(){this.__data__=[]}o(h$,"listCacheClear");function d$(r){var e=this.__data__,t=$0(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():QF.call(e,t,1),!0}o(d$,"listCacheDelete");function p$(r){var e=this.__data__,t=$0(e,r);return t<0?void 0:e[t][1]}o(p$,"listCacheGet");function m$(r){return $0(this.__data__,r)>-1}o(m$,"listCacheHas");function b$(r,e){var t=this.__data__,n=$0(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(b$,"listCacheSet");bs.prototype.clear=h$;bs.prototype.delete=d$;bs.prototype.get=p$;bs.prototype.has=m$;bs.prototype.set=b$;function Hc(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(Hc,"MapCache");function g$(){this.__data__={hash:new mf,map:new(Cl||bs),string:new mf}}o(g$,"mapCacheClear");function v$(r){return q0(this,r).delete(r)}o(v$,"mapCacheDelete");function y$(r){return q0(this,r).get(r)}o(y$,"mapCacheGet");function x$(r){return q0(this,r).has(r)}o(x$,"mapCacheHas");function w$(r,e){return q0(this,r).set(r,e),this}o(w$,"mapCacheSet");Hc.prototype.clear=g$;Hc.prototype.delete=v$;Hc.prototype.get=y$;Hc.prototype.has=x$;Hc.prototype.set=w$;function zc(r){this.__data__=new bs(r)}o(zc,"Stack");function _$(){this.__data__=new bs}o(_$,"stackClear");function E$(r){return this.__data__.delete(r)}o(E$,"stackDelete");function A$(r){return this.__data__.get(r)}o(A$,"stackGet");function S$(r){return this.__data__.has(r)}o(S$,"stackHas");function M$(r,e){var t=this.__data__;if(t instanceof bs){var n=t.__data__;if(!Cl||n.length<DF-1)return n.push([r,e]),this;t=this.__data__=new Hc(n)}return t.set(r,e),this}o(M$,"stackSet");zc.prototype.clear=_$;zc.prototype.delete=E$;zc.prototype.get=A$;zc.prototype.has=S$;zc.prototype.set=M$;function T$(r,e){var t=Gg(r)||X$(r)?KF(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||fa.call(r,s))&&!(i&&(s=="length"||G$(s,n)))&&t.push(s);return t}o(T$,"arrayLikeKeys");function hE(r,e,t){var n=r[e];(!(fa.call(r,e)&&bE(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(hE,"assignValue");function $0(r,e){for(var t=r.length;t--;)if(bE(r[t][0],e))return t;return-1}o($0,"assocIndexOf");function C$(r,e){return r&&dE(e,Wg(e),r)}o(C$,"baseAssign");function qg(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(!H0(r))return r;var d=Gg(r);if(d){if(u=j$(r),!e)return q$(r,u)}else{var v=pf(r),x=v==zg||v==G_;if(Q$(r))return N$(r,e);if(v==jg||v==Hg||x&&!s){if(uE(r))return s?r:{};if(u=K$(x?{}:r),!e)return H$(r,C$(u,r))}else{if(!or[v])return s?r:{};u=V$(r,v,qg,e)}}f||(f=new zc);var E=f.get(r);if(E)return E;if(f.set(r,u),!d)var O=t?z$(r):Wg(r);return zF(O||r,function(R,I){O&&(I=R,R=r[I]),hE(u,I,qg(R,e,t,n,I,r,f))}),u}o(qg,"baseClone");function k$(r){return H0(r)?XF(r):{}}o(k$,"baseCreate");function I$(r,e,t){var n=e(r);return Gg(r)?n:jF(n,t(r))}o(I$,"baseGetAllKeys");function D$(r){return F0.call(r)}o(D$,"baseGetTag");function R$(r){if(!H0(r)||J$(r))return!1;var e=vE(r)||uE(r)?JF:BF;return e.test(bf(r))}o(R$,"baseIsNative");function O$(r){if(!mE(r))return t$(r);var e=[];for(var t in Object(r))fa.call(r,t)&&t!="constructor"&&e.push(t);return e}o(O$,"baseKeys");function N$(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(N$,"cloneBuffer");function Vg(r){var e=new r.constructor(r.byteLength);return new F_(e).set(new F_(r)),e}o(Vg,"cloneArrayBuffer");function P$(r,e){var t=e?Vg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(P$,"cloneDataView");function B$(r,e,t){var n=e?t(N_(r),!0):N_(r);return cE(n,qF,new r.constructor)}o(B$,"cloneMap");function L$(r){var e=new r.constructor(r.source,PF.exec(r));return e.lastIndex=r.lastIndex,e}o(L$,"cloneRegExp");function U$(r,e,t){var n=e?t(P_(r),!0):P_(r);return cE(n,HF,new r.constructor)}o(U$,"cloneSet");function F$(r){return H_?Object(H_.call(r)):{}}o(F$,"cloneSymbol");function $$(r,e){var t=e?Vg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o($$,"cloneTypedArray");function q$(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(q$,"copyArray");function dE(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;hE(t,f,u===void 0?r[f]:u)}return t}o(dE,"copyObject");function H$(r,e){return dE(r,pE(r),e)}o(H$,"copySymbols");function z$(r){return I$(r,Wg,pE)}o(z$,"getAllKeys");function q0(r,e){var t=r.__data__;return W$(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(q0,"getMapData");function jc(r,e){var t=VF(r,e);return R$(t)?t:void 0}o(jc,"getNative");var pE=$_?Kg($_,Object):rq,pf=D$;(Lg&&pf(new Lg(new ArrayBuffer(1)))!=L0||Cl&&pf(new Cl)!=P0||Ug&&pf(Ug.resolve())!=R_||Fg&&pf(new Fg)!=B0||$g&&pf(new $g)!=Bg)&&(pf=o(function(r){var e=F0.call(r),t=e==jg?r.constructor:void 0,n=t?bf(t):void 0;if(n)switch(n){case r$:return L0;case n$:return P0;case i$:return R_;case o$:return B0;case s$:return Bg}return e},"getTag"));function j$(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&fa.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(j$,"initCloneArray");function K$(r){return typeof r.constructor=="function"&&!mE(r)?k$(YF(r)):{}}o(K$,"initCloneObject");function V$(r,e,t,n){var i=r.constructor;switch(e){case Z_:return Vg(r);case K_:case V_:return new i(+r);case L0:return P$(r,n);case Q_:case eE:case tE:case rE:case nE:case iE:case oE:case sE:case aE:return $$(r,n);case P0:return B$(r,n,t);case W_:case Y_:return new i(r);case J_:return L$(r);case B0:return U$(r,n,t);case X_:return F$(r)}}o(V$,"initCloneByTag");function G$(r,e){return e=e??j_,!!e&&(typeof r=="number"||LF.test(r))&&r>-1&&r%1==0&&r<e}o(G$,"isIndex");function W$(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(W$,"isKeyable");function J$(r){return!!B_&&B_ in r}o(J$,"isMasked");function mE(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||U0;return r===t}o(mE,"isPrototype");function bf(r){if(r!=null){try{return lE.call(r)}catch{}try{return r+""}catch{}}return""}o(bf,"toSource");function Y$(r){return qg(r,!0,!0)}o(Y$,"cloneDeep");function bE(r,e){return r===e||r!==r&&e!==e}o(bE,"eq");function X$(r){return Z$(r)&&fa.call(r,"callee")&&(!ZF.call(r,"callee")||F0.call(r)==Hg)}o(X$,"isArguments");var Gg=Array.isArray;function gE(r){return r!=null&&eq(r.length)&&!vE(r)}o(gE,"isArrayLike");function Z$(r){return tq(r)&&gE(r)}o(Z$,"isArrayLikeObject");var Q$=e$||nq;function vE(r){var e=H0(r)?F0.call(r):"";return e==zg||e==G_}o(vE,"isFunction");function eq(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=j_}o(eq,"isLength");function H0(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(H0,"isObject");function tq(r){return!!r&&typeof r=="object"}o(tq,"isObjectLike");function Wg(r){return gE(r)?T$(r):O$(r)}o(Wg,"keys");function rq(){return[]}o(rq,"stubArray");function nq(){return!1}o(nq,"stubFalse");qc.exports=Y$});var h9=Re((ua,l9)=>{var pp=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,mp=function(){function r(){this.fetch=!1,this.DOMException=pp.DOMException}return o(r,"F"),r.prototype=pp,new r}();(function(r){var e=function(t){var n=typeof r<"u"&&r||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function s(h){return h&&DataView.prototype.isPrototypeOf(h)}if(o(s,"isDataView"),i.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function d(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}o(d,"normalizeName");function v(h){return typeof h!="string"&&(h=String(h)),h}o(v,"normalizeValue");function x(h){var g={next:function(){var b=h.shift();return{done:b===void 0,value:b}}};return i.iterable&&(g[Symbol.iterator]=function(){return g}),g}o(x,"iteratorFor");function E(h){this.map={},h instanceof E?h.forEach(function(g,b){this.append(b,g)},this):Array.isArray(h)?h.forEach(function(g){if(g.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+g.length);this.append(g[0],g[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(g){this.append(g,h[g])},this)}o(E,"Headers"),E.prototype.append=function(h,g){h=d(h),g=v(g);var b=this.map[h];this.map[h]=b?b+", "+g:g},E.prototype.delete=function(h){delete this.map[d(h)]},E.prototype.get=function(h){return h=d(h),this.has(h)?this.map[h]:null},E.prototype.has=function(h){return this.map.hasOwnProperty(d(h))},E.prototype.set=function(h,g){this.map[d(h)]=v(g)},E.prototype.forEach=function(h,g){for(var b in this.map)this.map.hasOwnProperty(b)&&h.call(g,this.map[b],b,this)},E.prototype.keys=function(){var h=[];return this.forEach(function(g,b){h.push(b)}),x(h)},E.prototype.values=function(){var h=[];return this.forEach(function(g){h.push(g)}),x(h)},E.prototype.entries=function(){var h=[];return this.forEach(function(g,b){h.push([b,g])}),x(h)},i.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function O(h){if(!h._noBody){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}}o(O,"consumed");function R(h){return new Promise(function(g,b){h.onload=function(){g(h.result)},h.onerror=function(){b(h.error)}})}o(R,"fileReaderReady");function I(h){var g=new FileReader,b=R(g);return g.readAsArrayBuffer(h),b}o(I,"readBlobAsArrayBuffer");function B(h){var g=new FileReader,b=R(g),l=/charset=([A-Za-z0-9_-]+)/.exec(h.type),m=l?l[1]:"utf-8";return g.readAsText(h,m),b}o(B,"readBlobAsText");function Y(h){for(var g=new Uint8Array(h),b=new Array(g.length),l=0;l<g.length;l++)b[l]=String.fromCharCode(g[l]);return b.join("")}o(Y,"readArrayBufferAsText");function P(h){if(h.slice)return h.slice(0);var g=new Uint8Array(h.byteLength);return g.set(new Uint8Array(h)),g.buffer}o(P,"bufferClone");function J(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:i.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:i.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():i.arrayBuffer&&i.blob&&s(h)?(this._bodyArrayBuffer=P(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||u(h))?this._bodyArrayBuffer=P(h):this._bodyText=h=Object.prototype.toString.call(h):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var h=O(this);if(h)return h;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(){if(this._bodyArrayBuffer){var h=O(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var h=O(this);if(h)return h;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(V)}),this.json=function(){return this.text().then(JSON.parse)},this}o(J,"Body");var ee=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function X(h){var g=h.toUpperCase();return ee.indexOf(g)>-1?g:h}o(X,"normalizeMethod");function ne(h,g){if(!(this instanceof ne))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');g=g||{};var b=g.body;if(h instanceof ne){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,g.headers||(this.headers=new E(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!b&&h._bodyInit!=null&&(b=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new E(g.headers)),this.method=X(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal||function(){if("AbortController"in n){var _=new AbortController;return _.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&b)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(b),(this.method==="GET"||this.method==="HEAD")&&(g.cache==="no-store"||g.cache==="no-cache")){var l=/([?&])_=[^&]*/;if(l.test(this.url))this.url=this.url.replace(l,"$1_="+new Date().getTime());else{var m=/\?/;this.url+=(m.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}o(ne,"Request"),ne.prototype.clone=function(){return new ne(this,{body:this._bodyInit})};function V(h){var g=new FormData;return h.trim().split("&").forEach(function(b){if(b){var l=b.split("="),m=l.shift().replace(/\+/g," "),_=l.join("=").replace(/\+/g," ");g.append(decodeURIComponent(m),decodeURIComponent(_))}}),g}o(V,"decode");function H(h){var g=new E,b=h.replace(/\r?\n[\t ]+/g," ");return b.split("\r").map(function(l){return l.indexOf(`
650
+ `)===0?l.substr(1,l.length):l}).forEach(function(l){var m=l.split(":"),_=m.shift().trim();if(_){var M=m.join(":").trim();try{g.append(_,M)}catch(S){console.warn("Response "+S.message)}}}),g}o(H,"parseHeaders"),J.call(ne.prototype);function z(h,g){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=g.statusText===void 0?"":""+g.statusText,this.headers=new E(g.headers),this.url=g.url||"",this._initBody(h)}o(z,"Response"),J.call(z.prototype),z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},z.error=function(){var h=new z(null,{status:200,statusText:""});return h.ok=!1,h.status=0,h.type="error",h};var he=[301,302,303,307,308];z.redirect=function(h,g){if(he.indexOf(g)===-1)throw new RangeError("Invalid status code");return new z(null,{status:g,headers:{location:h}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(g,b){this.message=g,this.name=b;var l=Error(g);this.stack=l.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function L(h,g){return new Promise(function(b,l){var m=new ne(h,g);if(m.signal&&m.signal.aborted)return l(new t.DOMException("Aborted","AbortError"));var _=new XMLHttpRequest;function M(){_.abort()}o(M,"abortXhr"),_.onload=function(){var C={statusText:_.statusText,headers:H(_.getAllResponseHeaders()||"")};m.url.indexOf("file://")===0&&(_.status<200||_.status>599)?C.status=200:C.status=_.status,C.url="responseURL"in _?_.responseURL:C.headers.get("X-Request-URL");var N="response"in _?_.response:_.responseText;setTimeout(function(){b(new z(N,C))},0)},_.onerror=function(){setTimeout(function(){l(new TypeError("Network request failed"))},0)},_.ontimeout=function(){setTimeout(function(){l(new TypeError("Network request timed out"))},0)},_.onabort=function(){setTimeout(function(){l(new t.DOMException("Aborted","AbortError"))},0)};function S(C){try{return C===""&&n.location.href?n.location.href:C}catch{return C}}if(o(S,"fixUrl"),_.open(m.method,S(m.url),!0),m.credentials==="include"?_.withCredentials=!0:m.credentials==="omit"&&(_.withCredentials=!1),"responseType"in _&&(i.blob?_.responseType="blob":i.arrayBuffer&&(_.responseType="arraybuffer")),g&&typeof g.headers=="object"&&!(g.headers instanceof E||n.Headers&&g.headers instanceof n.Headers)){var y=[];Object.getOwnPropertyNames(g.headers).forEach(function(C){y.push(d(C)),_.setRequestHeader(C,v(g.headers[C]))}),m.headers.forEach(function(C,N){y.indexOf(N)===-1&&_.setRequestHeader(N,C)})}else m.headers.forEach(function(C,N){_.setRequestHeader(N,C)});m.signal&&(m.signal.addEventListener("abort",M),_.onreadystatechange=function(){_.readyState===4&&m.signal.removeEventListener("abort",M)}),_.send(typeof m._bodyInit>"u"?null:m._bodyInit)})}return o(L,"fetch"),L.polyfill=!0,n.fetch||(n.fetch=L,n.Headers=E,n.Request=ne,n.Response=z),t.Headers=E,t.Request=ne,t.Response=z,t.fetch=L,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(mp);mp.fetch.ponyfill=!0;delete mp.fetch.polyfill;var nu=pp.fetch?pp:mp;ua=nu.fetch;ua.default=nu.fetch;ua.fetch=nu.fetch;ua.Headers=nu.Headers;ua.Request=nu.Request;ua.Response=nu.Response;l9.exports=ua});var E9=Re((cne,_9)=>{"use strict";var Hq=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=Gq(n),this._cacheKeyFn=Wq(n),this._cacheMap=Jq(n),this._batch=null,this.name=Yq(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=jq(this),s=this._cacheMap,f;if(s){f=this._cacheKeyFn(n);var u=s.get(f);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(x){d.push(function(){x(u)})})}}i.keys.push(n);var v=new Promise(function(x,E){i.callbacks.push({resolve:x,reject:E})});return s&&s.set(f,v),v},"load"),e.loadMany=o(function(n){if(!w9(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}(),zq=typeof process=="object"&&typeof process.nextTick=="function"?function(r){wv||(wv=Promise.resolve()),wv.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},wv;function jq(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(){Kq(r,t)}),t}o(jq,"getCurrentBatch");function Kq(r,e){if(e.hasDispatched=!0,e.keys.length===0){Ev(e);return}var t;try{t=r._batchLoadFn(e.keys)}catch(n){return _v(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 _v(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(!w9(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."+(`
651
651
 
652
652
  Keys:
653
653
  `+String(e.keys))+(`
654
654
 
655
655
  Values:
656
- `+String(n)));wv(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){xv(r,e,n)})}o(qq,"dispatchBatch");function xv(r,e,t){wv(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(xv,"failedDispatch");function wv(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(wv,"resolveCacheHits");function Hq(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(Hq,"getValidMaxBatchSize");function zq(r){var e=r&&r.batchScheduleFn;if(e===void 0)return Fq;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(zq,"getValidBatchScheduleFn");function jq(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(jq,"getValidCacheKeyFn");function Kq(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(Kq,"getValidCacheMap");function Vq(r){return r&&r.name?r.name:null}o(Vq,"getValidName");function x9(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(x9,"isArrayLike");w9.exports=Uq});var L9=Re((Cne,B9)=>{"use strict";function uH(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),v=Math.log(256)/Math.log(f);function x(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,B=0,Y=0,P=R.length;Y!==P&&R[Y]===0;)Y++,I++;for(var J=(P-Y)*v+1>>>0,ee=new Uint8Array(J);Y!==P;){for(var X=R[Y],ne=0,V=J-1;(X!==0||ne<B)&&V!==-1;V--,ne++)X+=256*ee[V]>>>0,ee[V]=X%f>>>0,X=X/f>>>0;if(X!==0)throw new Error("Non-zero carry");B=ne,Y++}for(var H=J-B;H!==J&&ee[H]===0;)H++;for(var z=u.repeat(I);H<J;++H)z+=r.charAt(ee[H]);return z}o(x,"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 B=0,Y=0;R[I]===u;)B++,I++;for(var P=(R.length-I)*d+1>>>0,J=new Uint8Array(P);R[I];){var ee=e[R.charCodeAt(I)];if(ee===255)return;for(var X=0,ne=P-1;(ee!==0||X<Y)&&ne!==-1;ne--,X++)ee+=f*J[ne]>>>0,J[ne]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");Y=X,I++}if(R[I]!==" "){for(var V=P-Y;V!==P&&J[V]===0;)V++;for(var H=new Uint8Array(B+(P-V)),z=B;V!==P;)H[z++]=J[V++];return H}}}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:x,decodeUnsafe:E,decode:O}}o(uH,"base");B9.exports=uH});var bp=Re((kne,U9)=>{"use strict";var lH=new TextDecoder,hH=o(r=>lH.decode(r),"decodeText"),dH=new TextEncoder,pH=o(r=>dH.encode(r),"encodeText");function mH(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(mH,"concat");U9.exports={decodeText:hH,encodeText:pH,concat:mH}});var $9=Re((Ine,F9)=>{"use strict";var{encodeText:bH}=bp(),gp=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=bH(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(gp,"Base");F9.exports=gp});var H9=Re((Dne,q9)=>{"use strict";var gH=o((r,e,t)=>{let n={};for(let v=0;v<e.length;++v)n[e[v]]=v;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 v=0;v<i;++v){let x=n[r[v]];if(x===void 0)throw new SyntaxError("Invalid character "+r[v]);u=u<<t|x,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"),vH=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"),yH=o(r=>e=>({encode(t){return vH(t,e,r)},decode(t){return gH(t,e,r)}}),"rfc4648");q9.exports={rfc4648:yH}});var V9=Re((Rne,K9)=>{"use strict";var Hl=L9(),xH=$9(),{rfc4648:Gr}=H9(),{decodeText:wH,encodeText:_H}=bp(),EH=o(()=>({encode:wH,decode:_H}),"identity"),z9=[["identity","\0",EH,""],["base2","0",Gr(1),"01"],["base8","7",Gr(3),"01234567"],["base10","9",Hl,"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",Hl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Hl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Hl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Hl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],j9=z9.reduce((r,e)=>(r[e[0]]=new xH(e[0],e[1],e[2],e[3]),r),{}),AH=z9.reduce((r,e)=>(r[e[1]]=j9[e[0]],r),{});K9.exports={names:j9,codes:AH}});var J9=Re((ws,W9)=>{"use strict";var iu=V9(),{encodeText:SH,decodeText:vp,concat:G9}=bp();function MH(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=Mf(r);return IH(t,e),G9([n,e],n.length+e.length)}o(MH,"multibase");function TH(r,e){let t=Mf(r),n=SH(t.encode(e));return G9([t.codeBuf,n],t.codeBuf.length+n.length)}o(TH,"encode");function CH(r){r instanceof Uint8Array&&(r=vp(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),Mf(r[0]).decode(r.substring(1))}o(CH,"decode");function kH(r){if(r instanceof Uint8Array&&(r=vp(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return Mf(r[0]).name}catch{return!1}}o(kH,"isEncoded");function IH(r,e){Mf(r).decode(vp(e))}o(IH,"validEncode");function Mf(r){if(Object.prototype.hasOwnProperty.call(iu.names,r))return iu.names[r];if(Object.prototype.hasOwnProperty.call(iu.codes,r))return iu.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(Mf,"encoding");function DH(r){return r instanceof Uint8Array&&(r=vp(r)),Mf(r[0])}o(DH,"encodingFromData");ws=W9.exports=MH;ws.encode=TH;ws.decode=CH;ws.isEncoded=kH;ws.encoding=Mf;ws.encodingFromData=DH;var RH=Object.freeze(iu.names),OH=Object.freeze(iu.codes);ws.names=RH;ws.codes=OH});var Q9=Re((One,Z9)=>{Z9.exports=X9;var Y9=128,NH=127,PH=~NH,BH=Math.pow(2,31);function X9(r,e,t){e=e||[],t=t||0;for(var n=t;r>=BH;)e[t++]=r&255|Y9,r/=128;for(;r&PH;)e[t++]=r&255|Y9,r>>>=7;return e[t]=r|0,X9.bytes=t-n+1,e}o(X9,"encode")});var rA=Re((Nne,tA)=>{tA.exports=Dv;var LH=128,eA=127;function Dv(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw Dv.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&eA)<<i:(f&eA)*Math.pow(2,i),i+=7}while(f>=LH);return Dv.bytes=s-n,t}o(Dv,"read")});var iA=Re((Pne,nA)=>{var UH=Math.pow(2,7),FH=Math.pow(2,14),$H=Math.pow(2,21),qH=Math.pow(2,28),HH=Math.pow(2,35),zH=Math.pow(2,42),jH=Math.pow(2,49),KH=Math.pow(2,56),VH=Math.pow(2,63);nA.exports=function(r){return r<UH?1:r<FH?2:r<$H?3:r<qH?4:r<HH?5:r<zH?6:r<jH?7:r<KH?8:r<VH?9:10}});var sA=Re((Bne,oA)=>{oA.exports={encode:Q9(),decode:rA(),encodingLength:iA()}});var fA=Re((Lne,aA)=>{"use strict";var GH=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});aA.exports={names:GH}});var mA=Re((Une,pA)=>{"use strict";var cA=J9(),ou=sA(),{names:zl}=fA(),{toString:yp}=(nc(),qh(j3)),{fromString:WH}=(id(),qh(z3)),{concat:JH}=($m(),qh(p3)),su={};for(let r in zl){let e=r;su[zl[e]]=e}Object.freeze(su);function YH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return yp(r,"base16")}o(YH,"toHexString");function XH(r){return WH(r,"base16")}o(XH,"fromHexString");function ZH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return yp(cA.encode("base58btc",r)).slice(1)}o(ZH,"toB58String");function QH(r){let e=r instanceof Uint8Array?yp(r):r;return cA.decode("z"+e)}o(QH,"fromB58String");function uA(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=ou.decode(r);if(!hA(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(ou.decode.bytes);let t=ou.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(ou.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${yp(r,"base16")}`);return{code:e,name:su[e],length:t,digest:r}}o(uA,"decode");function ez(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=lA(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=ou.encode(n),s=ou.encode(t);return JH([i,s,r],i.length+s.length+r.length)}o(ez,"encode");function lA(r){let e=r;if(typeof r=="string"){if(zl[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=zl[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(su[e]===void 0&&!Rv(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(lA,"coerceCode");function Rv(r){return r>0&&r<16}o(Rv,"isAppCode");function hA(r){return!!(Rv(r)||su[r])}o(hA,"isValidCode");function dA(r){uA(r)}o(dA,"validate");function tz(r){return dA(r),r.subarray(0,2)}o(tz,"prefix");pA.exports={names:zl,codes:su,toHexString:YH,fromHexString:XH,toB58String:ZH,fromB58String:QH,decode:uA,encode:ez,coerceCode:lA,isAppCode:Rv,validate:dA,prefix:tz,isValidCode:hA}});var cK={};Xt(cK,{CeramicURIValidator:()=>jv,default:()=>fK,getCeramicPlugin:()=>kp,streamIdToCeramicURI:()=>Cp});module.exports=qh(cK);var ZA=Ut(l3());function iD(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(iD,"_catch");function oD(){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 v;return((v=d.didResolutionMetadata)==null?void 0:v.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(oD,"inMemoryCache");function sD(r,e){return e()}o(sD,"noCache");var aD="(?:%[0-9a-fA-F]{2})",h3=`(?:[a-zA-Z0-9._-]|${aD})`,fD="([a-z0-9]+)",cD=`((?:${h3}*:)*(${h3}+))`,d3="[a-zA-Z0-9_.:%-]",uD=`;${d3}+=${d3}*`,lD=`((${uD})*)`,hD="(/[^#?]*)?",dD="([?][^#]*)?",pD="(#.*)?",mD=new RegExp(`^did:${fD}:${cD}${lD}${hD}${dD}${pD}$`);function bD(r){if(r===""||!r)return null;let e=r.match(mD);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(bD,"parse");var Hh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function gD(r){return function(e,t,n){try{return Promise.resolve(iD(function(){return Promise.resolve(r(e,t,n)).then(function(i){return{...Hh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...Hh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(gD,"wrapLegacyResolver");var ku=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?oD():t.cache||sD,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=gD(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=bD(e);if(i===null)return Promise.resolve({...Hh,didResolutionMetadata:{error:"invalidDid"}});let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve({...Hh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(ku,"Resolver");$m();id();nc();zh();Iu();s1();var ab=Ut(Z3()),_w=Ut(m1()),fb=Ut(S6()),Ud=Ut(Dd()),Ew=Ut(Y6()),Zu=Ut(ew()),cb=Ut(pw()),ub=Ut(Ga());function Ai(r){return Dt(r,"base64url")}o(Ai,"bytesToBase64url");function Sn(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Ft(e,"base64url")}o(Sn,"base64ToBytes");function lb(r){return Ft(r,"base58btc")}o(lb,"base58ToBytes");function ib(r){let e=r.startsWith("0x")?r.substring(2):r;return Ft(e.toLowerCase(),"base16")}o(ib,"hexToBytes");function ob(r){return Ai(Ft(r))}o(ob,"encodeBase64url");function Aw(r){return Dt(Sn(r))}o(Aw,"decodeBase64url");function Xa(r){return Dt(r,"base16")}o(Xa,"bytesToHex");function Sw(r){return Ft(r)}o(Sw,"stringToBytes");function qP({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Ft(r,"base16"),0),i.set(Ft(e,"base16"),32),n){if(typeof t>"u")throw new Error("Signer did not return a recoveryParam");i[64]=t}return Ai(i)}o(qP,"toJose");function HP(r){let e=Sn(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=Xa(e.slice(0,32)),n=Xa(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(HP,"fromJose");function Mw(r,e){return Fi([Sn(r),Sn(e)])}o(Mw,"toSealed");var zP=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,jP=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,KP=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function VP(r){if(typeof r=="string"){if(zP.test(r))return ib(r);if(jP.test(r))return lb(r);if(KP.test(r))return Sn(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(VP,"parseKey");function Tw(r){let e=typeof r=="string"?Ft(r):r;return(0,ab.hash)(e)}o(Tw,"sha256");function GP(r){return new Uint8Array(_w.keccak_256.arrayBuffer(r))}o(GP,"keccak");function WP(r){let e=Ft(r.slice(2),"base16");return`0x${Dt(GP(e).slice(-20),"base16")}`}o(WP,"toEthereumAddress");function sb(r,e=new Uint8Array(4)){let t=Ft(r.toString(),"base10");return e.set(t,4-t.length),e}o(sb,"writeUint32BE");var nb=o(r=>Fi([sb(r.length),r]),"lengthAndInput");function Cw(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=Fi([nb(Ft(t)),nb(typeof n>"u"?new Uint8Array(0):n),nb(typeof i>"u"?new Uint8Array(0):i),sb(e)]);return(0,ab.hash)(Fi([sb(1),r,s]))}o(Cw,"concatKDF");var gG=new fb.ec("secp256k1");function kw(r){let e=VP(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"?Sw(t):t,i=(0,Ud.sign)(e,n);return Promise.resolve(Ai(i))}catch(n){return Promise.reject(n)}}}o(kw,"EdDSASigner");function Iw(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Iw,"instanceOfEcdsaSignature");function mw(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Iw(i))return qP(i,r);if(r&&typeof HP(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(mw,"ES256KSignerAlg");function bw(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Iw(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(bw,"Ed25519SignerAlg");var JP={ES256K:mw(),"ES256K-R":mw(!0),Ed25519:bw(),EdDSA:bw()};function YP(r){let e=JP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(YP,"SignerAlg");var hb=new fb.ec("secp256k1");function Ld(r,e=!1){let t=Sn(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=Xa(t.slice(0,32)),i=Xa(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(Ld,"toSignatureObject");function db(r){if(r.publicKeyBase58)return lb(r.publicKeyBase58);if(r.publicKeyBase64)return Sn(r.publicKeyBase64);if(r.publicKeyHex)return ib(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return ib(hb.keyFromPublic({x:Xa(Sn(r.publicKeyJwk.x)),y:Xa(Sn(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Lu;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(db,"extractPublicKeyBytes");function XP(r,e,t){let n=Tw(r),i=Ld(e),s=t.filter(({ethereumAddress:d,blockchainAccountId:v})=>typeof d>"u"&&typeof v>"u"),f=t.filter(({ethereumAddress:d,blockchainAccountId:v})=>typeof d<"u"||typeof v!==void 0),u=s.find(d=>{try{let v=db(d);return hb.keyFromPublic(v).verify(n,i)}catch{return!1}});if(!u&&f.length>0&&(u=Dw(r,e,f)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(XP,"verifyES256K");function Dw(r,e,t){let n;if(e.length>86)n=[Ld(e,!0)];else{let f=Ld(e,!1);n=[{...f,recoveryParam:0},{...f,recoveryParam:1}]}let i=o(f=>{let u=Tw(r),d=hb.recoverPubKey(u,f,f.recoveryParam),v=d.encode("hex"),x=d.encode("hex",!0),E=WP(v);return t.find(R=>{var I,B,Y;let P=Xa(db(R));return P===v||P===x||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===E||((B=R.blockchainAccountId)==null||(Y=B.split("@eip155"))==null?void 0:Y[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(Dw,"verifyRecoverableES256K");function gw(r,e,t){let n=Sw(r),i=Sn(e),s=t.find(f=>(0,Ud.verify)(db(f),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(gw,"verifyEd25519");var ZP={ES256K:XP,"ES256K-R":Dw,Ed25519:gw,EdDSA:gw};function Rw(r){let e=ZP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(Rw,"VerifierAlgorithm");Rw.toSignatureObject=Ld;var Ow=o(function(r,e,t={},n={}){try{t.alg||(t.alg=QP);let i=typeof r=="string"?r:vw(r,n.canonicalize),s=[vw(t,n.canonicalize),i].join("."),f=YP(t.alg);return Promise.resolve(f(s,e)).then(function(u){return[s,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var QP="ES256K";function vw(r,e=!1){return ob(e?(0,Ew.default)(r):JSON.stringify(r))}o(vw,"encodeSection");function eB(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Aw(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(eB,"decodeJWS");function tB({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),Rw(r.alg)(e,t,n)}o(tB,"verifyJWSDecoded");function Nw(r,e){let t=eB(r);return tB(t,e)}o(Nw,"verifyJWS");function rB(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 Za,d=Sr.bind(null,u,2);return(n===0?i.then(x):n===1?s.then(v):f.then(E)).then(void 0,d),u;function v(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){Sr(u,1,s);return}if(i.then){i.then(x).then(void 0,d);return}s=t(),Js(s)&&(s=s.v)}while(!s||!s.then);s.then(v).then(void 0,d)}o(v,"_resumeAfterBody");function x(O){O?(s=t(),s&&s.then?s.then(v).then(void 0,d):v(s)):Sr(u,1,s)}o(x,"_resumeAfterTest");function E(){(i=r())?i.then?i.then(x).then(void 0,d):x(i):Sr(u,1,s)}o(E,"_resumeAfterUpdate")}o(rB,"_for");var Pw=o(function(r,e){try{let n=function(v){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let t;oB(r);let i=JSON.parse(Aw(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Mw(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,Sn(r.iv),f)).then(function(v){u=v}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let v=0;return rB(function(){return!u&&v<r.recipients.length},function(){return v++},function(){let x=r.recipients[v];Object.assign(x.header,i);let E=function(){if(x.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Sn(r.iv),f,x)).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"),yw=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Sr(r,e,t){if(!r.s){if(t instanceof Za)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=Sr.bind(null,r,e);return}if(t&&t.then){t.then(Sr.bind(null,r,e),Sr.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(Sr,"_settle");var Za=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{Sr(n,1,s(this.v))}catch(f){Sr(n,2,f)}return n}else return this}return this.o=function(s){try{let f=s.v;s.s&1?Sr(n,1,e?e(f):f):t?Sr(n,1,t(f)):Sr(n,2,f)}catch(f){Sr(n,2,f)}},n},r}();function Js(r){return r instanceof Za&&r.s&1}o(Js,"_isSettledPact");function nB(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=Sr.bind(null,i=new Za,2)));return}i?Sr(i,1,u):i=u}catch(d){Sr(i||(i=new Za),2,d)}}return o(f,"_cycle"),f(),i}o(nB,"_forTo");function iB(r,e,t){if(typeof r[yw]=="function"){let x=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(x,f||(f=Sr.bind(null,s=new Za,2)));return}s?Sr(s,1,E):s=E}catch(O){Sr(s||(s=new Za),2,O)}};o(x,"_cycle");var n=r[yw](),i,s,f;if(x(),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=[],v=0;v<r.length;v++)d.push(r[v]);return nB(d,function(x){return e(d[x])},t)}o(iB,"_forOf");function oB(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(oB,"validateJWE");function xw({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let f={protected:n,iv:Ai(t),ciphertext:Ai(r),tag:Ai(e)};return s&&(f.aad=Ai(s)),i&&(f.recipients=[i]),f}o(xw,"encodeJWE");var Bw=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 xw(i,n)})}else{let i=e[0].enc;if(!e.reduce((d,v)=>d&&v.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,f,u=iB(e,function(d){let v=function(){return s?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(s)).then(function(x){if(x){var E,O;(E=f)==null||(O=E.recipients)==null||O.push(x)}}):Promise.resolve(d.encrypt(r,t,n)).then(function(x){s=x.cek,f=xw(x,n)})}();if(v&&v.then)return v.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return f}):f)}}catch(i){return Promise.reject(i)}},"createJWE");var Lw=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 v=((u=f.keyAgreement)==null?void 0:u.map(x=>typeof x=="string"?[...f.publicKey||[],...f.verificationMethod||[]].find(E=>E.id===x):x).filter(x=>typeof x<"u")).filter(x=>x.type==="X25519KeyAgreementKey2019"&&Boolean(x.publicKeyBase58));if(!v.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return v.map(x=>aB(lb(x.publicKeyBase58),x.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 Uw(r){let e=new cb.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,ub.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(Uw,"xc20pEncrypter");function sB(r){let e=o(function(s,f={},u){try{let d=ob(JSON.stringify(Object.assign({alg:i},f,{enc:n}))),v=new Uint8Array(Buffer.from(u?`${d}.${Ai(u)}`:d));return Promise.resolve({...t(s,v),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),t=Uw(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(sB,"xc20pDirEncrypter");function ww(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 cb.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(ww,"xc20pDirDecrypter");function aB(r,e){let t=o(function(u,d={},v){try{Object.assign(d,{alg:void 0});let x=(0,ub.randomBytes)(32);return Promise.resolve(sB(x).encrypt(u,d,v)).then(function(E){return Promise.resolve(n(x)).then(function(O){return{...E,recipient:O,cek:x}})})}catch(x){return Promise.reject(x)}},"encrypt"),n=o(function(u){try{let d=(0,Zu.generateKeyPair)(),v=(0,Zu.sharedKey)(d.secretKey,r),x=Cw(v,s,i),E=Uw(x)(u),O={encrypted_key:Ai(E.ciphertext),header:{alg:i,iv:Ai(E.iv),tag:Ai(E.tag),epk:{kty:"OKP",crv:f,x:Ai(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(aB,"x25519Encrypter");function fB(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(fB,"validateHeader");function Fw(r){let e=o(function(s,f,u,d){try{let E=function(){let B=Cw(R,n,t),Y=Mw(d.encrypted_key,d.header.tag);return Promise.resolve(ww(B).decrypt(Y,Sn(d.header.iv))).then(function(P){return P===null?null:ww(P).decrypt(s,f,u)})};o(E,"_temp4");var v,x;if(fB((v=d)==null?void 0:v.header),d=d,((x=d.header.epk)==null?void 0:x.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=Sn(d.header.epk.x),R,I=function(){if(r instanceof Uint8Array)R=(0,Zu.sharedKey)(r,O);else return Promise.resolve(r(O)).then(function(B){R=B})}();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(Fw,"x25519Decrypter");o1();var Fd=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),pb=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=Ye.asCID(f);d?yield[u.join("/"),d]:typeof f=="object"&&(yield*pb(f,u))}else{let s=Ye.asCID(n);s?yield[i.join("/"),s]:yield*pb(n,i)}}},"links"),mb=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"&&!Ye.asCID(n))if(Array.isArray(n))for(let[s,f]of n.entries()){let u=[...i,s];yield u.join("/"),typeof f=="object"&&!Ye.asCID(f)&&(yield*mb(f,u))}else yield*mb(n,i)}},"tree"),cB=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=Ye.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),Qu=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:Fd(),bytes:Fd(),value:Fd(),asBlock:Fd()})}links(){return pb(this.value,[])}tree(){return mb(this.value,[])}get(e="/"){return cB(this.value,e.split("/").filter(Boolean))}};o(Qu,"Block");var Qa=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=Ye.create(1,e.code,i);return new Qu({value:r,bytes:n,cid:s})},"encode"),$w=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=Ye.create(1,e.code,i);return new Qu({value:n,bytes:r,cid:s})},"decode");Hi();Pu();i1();Jh();var Yi={};Xt(Yi,{code:()=>Sc,decode:()=>Mb,encode:()=>rf,name:()=>KB});var uB=["string","number","bigint","symbol"],lB=["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 qw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(uB.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(hB(r))return"Buffer";let t=dB(r);return t||"Object"}o(qw,"is");function hB(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(hB,"isBuffer");function dB(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(lB.includes(e))return e}o(dB,"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 qe=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(qe,"Token");var yc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",pB=new TextDecoder,mB=new TextEncoder;function $d(r){return yc&&globalThis.Buffer.isBuffer(r)}o($d,"isBuffer");function gb(r){return r instanceof Uint8Array?$d(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(gb,"asU8A");var Kw=yc?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):zw(r,e,t):(r,e,t)=>t-e>64?pB.decode(r.subarray(e,t)):zw(r,e,t),Vw=yc?r=>r.length>64?globalThis.Buffer.from(r):Hw(r):r=>r.length>64?mB.encode(r):Hw(r),Ao=o(r=>Uint8Array.from(r),"fromArray"),xc=yc?(r,e,t)=>$d(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Gw=yc?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),gb(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},Ww=yc?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Jw(r,e){if($d(r)&&$d(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(Jw,"compare");function Hw(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(Hw,"utf8ToBytes");function zw(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,v,x;switch(f){case 1:i<128&&(s=i);break;case 2:u=r[e+1],(u&192)===128&&(x=(i&31)<<6|u&63,x>127&&(s=x));break;case 3:u=r[e+1],d=r[e+2],(u&192)===128&&(d&192)===128&&(x=(i&15)<<12|(u&63)<<6|d&63,x>2047&&(x<55296||x>57343)&&(s=x));break;case 4:u=r[e+1],d=r[e+2],v=r[e+3],(u&192)===128&&(d&192)===128&&(v&192)===128&&(x=(i&15)<<18|(u&63)<<12|(d&63)<<6|v&63,x>65535&&x<1114112&&(s=x))}}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 bB(n)}o(zw,"utf8Slice");var jw=4096;function bB(r){let e=r.length;if(e<=jw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=jw));return t}o(bB,"decodeCodePointsArray");var gB=256,wc=class{constructor(e=gB){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=Ww(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=xc(n,0,this.cursor)}else t=Gw(this.chunks,this.cursor);return e&&this.reset(),t}};o(wc,"Bl");var yt="CBOR decode error:",vb="CBOR encode error:",el=[];el[23]=1;el[24]=2;el[25]=3;el[26]=5;el[27]=9;function us(r,e,t){if(r.length-e<t)throw new Error(`${yt} not enough data for type`)}o(us,"assertEnoughData");var Or=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Kn(r,e,t){us(r,e,1);let n=r[e];if(t.strict===!0&&n<Or[0])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Kn,"readUint8");function Vn(r,e,t){us(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Or[1])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Vn,"readUint16");function Gn(r,e,t){us(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Or[2])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Gn,"readUint32");function Wn(r,e,t){us(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<Or[3])throw new Error(`${yt} 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(`${yt} integers outside of the safe integer range are not supported`)}o(Wn,"readUint64");function Yw(r,e,t,n){return new qe(_e.uint,Kn(r,e+1,n),2)}o(Yw,"decodeUint8");function Xw(r,e,t,n){return new qe(_e.uint,Vn(r,e+1,n),3)}o(Xw,"decodeUint16");function Zw(r,e,t,n){return new qe(_e.uint,Gn(r,e+1,n),5)}o(Zw,"decodeUint32");function Qw(r,e,t,n){return new qe(_e.uint,Wn(r,e+1,n),9)}o(Qw,"decodeUint64");function Si(r,e){return zr(r,0,e.value)}o(Si,"encodeUint");function zr(r,e,t){if(t<Or[0]){let n=Number(t);r.push([e|n])}else if(t<Or[1]){let n=Number(t);r.push([e|24,n])}else if(t<Or[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Or[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<Or[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(`${yt} encountered BigInt larger than allowable range`)}}o(zr,"encodeUintValue");Si.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");zr.encodedSize=o(function(e){return e<Or[0]?1:e<Or[1]?2:e<Or[2]?3:e<Or[3]?5:9},"encodedSize");Si.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function e4(r,e,t,n){return new qe(_e.negint,-1-Kn(r,e+1,n),2)}o(e4,"decodeNegint8");function t4(r,e,t,n){return new qe(_e.negint,-1-Vn(r,e+1,n),3)}o(t4,"decodeNegint16");function r4(r,e,t,n){return new qe(_e.negint,-1-Gn(r,e+1,n),5)}o(r4,"decodeNegint32");var yb=BigInt(-1),n4=BigInt(1);function i4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new qe(_e.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${yt} integers outside of the safe integer range are not supported`);return new qe(_e.negint,yb-BigInt(i),9)}o(i4,"decodeNegint64");function qd(r,e){let t=e.value,n=typeof t=="bigint"?t*yb-n4:t*-1-1;zr(r,e.type.majorEncoded,n)}o(qd,"encodeNegint");qd.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*yb-n4:t*-1-1;return n<Or[0]?1:n<Or[1]?2:n<Or[2]?3:n<Or[3]?5:9},"encodedSize");qd.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function tl(r,e,t,n){us(r,e,t+n);let i=xc(r,e+t,e+t+n);return new qe(_e.bytes,i,t+n)}o(tl,"toToken");function o4(r,e,t,n){return tl(r,e,1,t)}o(o4,"decodeBytesCompact");function s4(r,e,t,n){return tl(r,e,2,Kn(r,e+1,n))}o(s4,"decodeBytes8");function a4(r,e,t,n){return tl(r,e,3,Vn(r,e+1,n))}o(a4,"decodeBytes16");function f4(r,e,t,n){return tl(r,e,5,Gn(r,e+1,n))}o(f4,"decodeBytes32");function c4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer bytes lengths not supported`);return tl(r,e,9,i)}o(c4,"decodeBytes64");function Hd(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===_e.string?Vw(r.value):r.value),r.encodedBytes}o(Hd,"tokenBytes");function _c(r,e){let t=Hd(e);zr(r,e.type.majorEncoded,t.length),r.push(t)}o(_c,"encodeBytes");_c.encodedSize=o(function(e){let t=Hd(e);return zr.encodedSize(t.length)+t.length},"encodedSize");_c.compareTokens=o(function(e,t){return yB(Hd(e),Hd(t))},"compareTokens");function yB(r,e){return r.length<e.length?-1:r.length>e.length?1:Jw(r,e)}o(yB,"compareBytes");function rl(r,e,t,n,i){let s=t+n;us(r,e,s);let f=new qe(_e.string,Kw(r,e+t,e+s),s);return i.retainStringBytes===!0&&(f.byteValue=xc(r,e+t,e+s)),f}o(rl,"toToken");function u4(r,e,t,n){return rl(r,e,1,t,n)}o(u4,"decodeStringCompact");function l4(r,e,t,n){return rl(r,e,2,Kn(r,e+1,n),n)}o(l4,"decodeString8");function h4(r,e,t,n){return rl(r,e,3,Vn(r,e+1,n),n)}o(h4,"decodeString16");function d4(r,e,t,n){return rl(r,e,5,Gn(r,e+1,n),n)}o(d4,"decodeString32");function p4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer string lengths not supported`);return rl(r,e,9,i,n)}o(p4,"decodeString64");var m4=_c;function Ec(r,e,t,n){return new qe(_e.array,n,t)}o(Ec,"toToken");function b4(r,e,t,n){return Ec(r,e,1,t)}o(b4,"decodeArrayCompact");function g4(r,e,t,n){return Ec(r,e,2,Kn(r,e+1,n))}o(g4,"decodeArray8");function v4(r,e,t,n){return Ec(r,e,3,Vn(r,e+1,n))}o(v4,"decodeArray16");function y4(r,e,t,n){return Ec(r,e,5,Gn(r,e+1,n))}o(y4,"decodeArray32");function x4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer array lengths not supported`);return Ec(r,e,9,i)}o(x4,"decodeArray64");function w4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Ec(r,e,1,1/0)}o(w4,"decodeArrayIndefinite");function zd(r,e){zr(r,_e.array.majorEncoded,e.value)}o(zd,"encodeArray");zd.compareTokens=Si.compareTokens;zd.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");function Ac(r,e,t,n){return new qe(_e.map,n,t)}o(Ac,"toToken");function _4(r,e,t,n){return Ac(r,e,1,t)}o(_4,"decodeMapCompact");function E4(r,e,t,n){return Ac(r,e,2,Kn(r,e+1,n))}o(E4,"decodeMap8");function A4(r,e,t,n){return Ac(r,e,3,Vn(r,e+1,n))}o(A4,"decodeMap16");function S4(r,e,t,n){return Ac(r,e,5,Gn(r,e+1,n))}o(S4,"decodeMap32");function M4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer map lengths not supported`);return Ac(r,e,9,i)}o(M4,"decodeMap64");function T4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Ac(r,e,1,1/0)}o(T4,"decodeMapIndefinite");function jd(r,e){zr(r,_e.map.majorEncoded,e.value)}o(jd,"encodeMap");jd.compareTokens=Si.compareTokens;jd.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");function C4(r,e,t,n){return new qe(_e.tag,t,1)}o(C4,"decodeTagCompact");function k4(r,e,t,n){return new qe(_e.tag,Kn(r,e+1,n),2)}o(k4,"decodeTag8");function I4(r,e,t,n){return new qe(_e.tag,Vn(r,e+1,n),3)}o(I4,"decodeTag16");function D4(r,e,t,n){return new qe(_e.tag,Gn(r,e+1,n),5)}o(D4,"decodeTag32");function R4(r,e,t,n){return new qe(_e.tag,Wn(r,e+1,n),9)}o(R4,"decodeTag64");function Kd(r,e){zr(r,_e.tag.majorEncoded,e.value)}o(Kd,"encodeTag");Kd.compareTokens=Si.compareTokens;Kd.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");var SB=20,MB=21,TB=22,CB=23;function O4(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${yt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new qe(_e.null,null,1):new qe(_e.undefined,void 0,1)}o(O4,"decodeUndefined");function N4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return new qe(_e.break,void 0,1)}o(N4,"decodeBreak");function xb(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${yt} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${yt} Infinity values are not supported`)}return new qe(_e.float,r,e)}o(xb,"createToken");function P4(r,e,t,n){return xb(wb(r,e+1),3,n)}o(P4,"decodeFloat16");function B4(r,e,t,n){return xb(_b(r,e+1),5,n)}o(B4,"decodeFloat32");function L4(r,e,t,n){return xb(q4(r,e+1),9,n)}o(L4,"decodeFloat64");function Vd(r,e,t){let n=e.value;if(n===!1)r.push([_e.float.majorEncoded|SB]);else if(n===!0)r.push([_e.float.majorEncoded|MB]);else if(n===null)r.push([_e.float.majorEncoded|TB]);else if(n===void 0)r.push([_e.float.majorEncoded|CB]);else{let i,s=!1;(!t||t.float64!==!0)&&(F4(n),i=wb(Wi,1),n===i||Number.isNaN(n)?(Wi[0]=249,r.push(Wi.slice(0,3)),s=!0):($4(n),i=_b(Wi,1),n===i&&(Wi[0]=250,r.push(Wi.slice(0,5)),s=!0))),s||(kB(n),i=q4(Wi,1),Wi[0]=251,r.push(Wi.slice(0,9)))}}o(Vd,"encodeFloat");Vd.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){F4(n);let i=wb(Wi,1);if(n===i||Number.isNaN(n))return 3;if($4(n),i=_b(Wi,1),n===i)return 5}return 9},"encodedSize");var U4=new ArrayBuffer(9),Mi=new DataView(U4,1),Wi=new Uint8Array(U4,0);function F4(r){if(r===1/0)Mi.setUint16(0,31744,!1);else if(r===-1/0)Mi.setUint16(0,64512,!1);else if(Number.isNaN(r))Mi.setUint16(0,32256,!1);else{Mi.setFloat32(0,r);let e=Mi.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)Mi.setUint16(0,31744,!1);else if(t===0)Mi.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?Mi.setUint16(0,0):i<-14?Mi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Mi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(F4,"encodeFloat16");function wb(r,e){if(r.length-e<2)throw new Error(`${yt} 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(wb,"readFloat16");function $4(r){Mi.setFloat32(0,r,!1)}o($4,"encodeFloat32");function _b(r,e){if(r.length-e<4)throw new Error(`${yt} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(_b,"readFloat32");function kB(r){Mi.setFloat64(0,r,!1)}o(kB,"encodeFloat64");function q4(r,e){if(r.length-e<8)throw new Error(`${yt} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(q4,"readFloat64");Vd.compareTokens=Si.compareTokens;function $t(r,e,t){throw new Error(`${yt} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o($t,"invalidMinor");function Gd(r){return()=>{throw new Error(`${yt} ${r}`)}}o(Gd,"errorer");var Be=[];for(let r=0;r<=23;r++)Be[r]=$t;Be[24]=Yw;Be[25]=Xw;Be[26]=Zw;Be[27]=Qw;Be[28]=$t;Be[29]=$t;Be[30]=$t;Be[31]=$t;for(let r=32;r<=55;r++)Be[r]=$t;Be[56]=e4;Be[57]=t4;Be[58]=r4;Be[59]=i4;Be[60]=$t;Be[61]=$t;Be[62]=$t;Be[63]=$t;for(let r=64;r<=87;r++)Be[r]=o4;Be[88]=s4;Be[89]=a4;Be[90]=f4;Be[91]=c4;Be[92]=$t;Be[93]=$t;Be[94]=$t;Be[95]=Gd("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)Be[r]=u4;Be[120]=l4;Be[121]=h4;Be[122]=d4;Be[123]=p4;Be[124]=$t;Be[125]=$t;Be[126]=$t;Be[127]=Gd("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)Be[r]=b4;Be[152]=g4;Be[153]=v4;Be[154]=y4;Be[155]=x4;Be[156]=$t;Be[157]=$t;Be[158]=$t;Be[159]=w4;for(let r=160;r<=183;r++)Be[r]=_4;Be[184]=E4;Be[185]=A4;Be[186]=S4;Be[187]=M4;Be[188]=$t;Be[189]=$t;Be[190]=$t;Be[191]=T4;for(let r=192;r<=215;r++)Be[r]=C4;Be[216]=k4;Be[217]=I4;Be[218]=D4;Be[219]=R4;Be[220]=$t;Be[221]=$t;Be[222]=$t;Be[223]=$t;for(let r=224;r<=243;r++)Be[r]=Gd("simple values are not supported");Be[244]=$t;Be[245]=$t;Be[246]=$t;Be[247]=O4;Be[248]=Gd("simple values are not supported");Be[249]=P4;Be[250]=B4;Be[251]=L4;Be[252]=$t;Be[253]=$t;Be[254]=$t;Be[255]=N4;var Ji=[];for(let r=0;r<24;r++)Ji[r]=new qe(_e.uint,r,1);for(let r=-1;r>=-24;r--)Ji[31-r]=new qe(_e.negint,r,1);Ji[64]=new qe(_e.bytes,new Uint8Array(0),1);Ji[96]=new qe(_e.string,"",1);Ji[128]=new qe(_e.array,0,1);Ji[160]=new qe(_e.map,0,1);Ji[244]=new qe(_e.false,!1,1);Ji[245]=new qe(_e.true,!0,1);Ji[246]=new qe(_e.null,null,1);function H4(r){switch(r.type){case _e.false:return Ao([244]);case _e.true:return Ao([245]);case _e.null:return Ao([246]);case _e.bytes:return r.value.length?void 0:Ao([64]);case _e.string:return r.value===""?Ao([96]):void 0;case _e.array:return r.value===0?Ao([128]):void 0;case _e.map:return r.value===0?Ao([160]):void 0;case _e.uint:return r.value<24?Ao([Number(r.value)]):void 0;case _e.negint:if(r.value>=-24)return Ao([31-Number(r.value)])}}o(H4,"quickEncodeToken");var DB={float64:!1,mapSorter:NB,quickEncodeToken:H4};function RB(){let r=[];return r[_e.uint.major]=Si,r[_e.negint.major]=qd,r[_e.bytes.major]=_c,r[_e.string.major]=m4,r[_e.array.major]=zd,r[_e.map.major]=jd,r[_e.tag.major]=Kd,r[_e.float.major]=Vd,r}o(RB,"makeCborEncoders");var z4=RB(),Eb=new wc,tf=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(`${vb} object contains circular references`);return new tf(t,e)}};o(tf,"Ref");var Ys={null:new qe(_e.null,null),undefined:new qe(_e.undefined,void 0),true:new qe(_e.true,!0),false:new qe(_e.false,!1),emptyArray:new qe(_e.array,0),emptyMap:new qe(_e.map,0)},Xs={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new qe(_e.float,r):r>=0?new qe(_e.uint,r):new qe(_e.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new qe(_e.uint,r):new qe(_e.negint,r)},Uint8Array(r,e,t,n){return new qe(_e.bytes,r)},string(r,e,t,n){return new qe(_e.string,r)},boolean(r,e,t,n){return r?Ys.true:Ys.false},null(r,e,t,n){return Ys.null},undefined(r,e,t,n){return Ys.undefined},ArrayBuffer(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[Ys.emptyArray,new qe(_e.break)]:Ys.emptyArray;n=tf.createCheck(n,r);let i=[],s=0;for(let f of r)i[s++]=Wd(f,t,n);return t.addBreakTokens?[new qe(_e.array,r.length),i,new qe(_e.break)]:[new qe(_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?[Ys.emptyMap,new qe(_e.break)]:Ys.emptyMap;n=tf.createCheck(n,r);let u=[],d=0;for(let v of s)u[d++]=[Wd(v,t,n),Wd(i?r.get(v):r[v],t,n)];return OB(u,t),t.addBreakTokens?[new qe(_e.map,f),u,new qe(_e.break)]:[new qe(_e.map,f),u]}};Xs.Map=Xs.Object;Xs.Buffer=Xs.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Xs[`${r}Array`]=Xs.DataView;function Wd(r,e={},t){let n=qw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||Xs[n];if(typeof i=="function"){let f=i(r,n,e,t);if(f!=null)return f}let s=Xs[n];if(!s)throw new Error(`${vb} unsupported type: ${n}`);return s(r,n,e,t)}o(Wd,"objectToTokens");function OB(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(OB,"sortMapEntries");function NB(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=z4[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(NB,"mapSorter");function j4(r,e,t,n){if(Array.isArray(e))for(let i of e)j4(r,i,t,n);else t[e.type.major](r,e,n)}o(j4,"tokensToEncoded");function PB(r,e,t){let n=Wd(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 wc(f);if(s(u,n,t),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return gb(u.chunks[0])}}return Eb.reset(),j4(Eb,n,e,t),Eb.toBytes(!0)}o(PB,"encodeCustom");function Ab(r,e){return e=Object.assign({},DB,e),PB(r,z4,e)}o(Ab,"encode");var BB={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Jd=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=Ji[e];if(t===void 0){let n=Be[e];if(!n)throw new Error(`${yt} 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(Jd,"Tokeniser");var nl=Symbol.for("DONE"),Yd=Symbol.for("BREAK");function LB(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=il(e,t);if(s===Yd){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed array`)}if(s===nl)throw new Error(`${yt} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(LB,"tokenToArray");function UB(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=il(e,t);if(u===Yd){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed map`)}if(u===nl)throw new Error(`${yt} found map but not enough entries (got ${f} [no key], expected ${r.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${yt} non-string keys not supported (got ${typeof u})`);if(t.rejectDuplicateMapKeys===!0&&(n&&s.has(u)||!n&&u in i))throw new Error(`${yt} found repeat map key "${u}"`);let d=il(e,t);if(d===nl)throw new Error(`${yt} 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(UB,"tokenToMap");function il(r,e){if(r.done())return nl;let t=r.next();if(t.type===_e.break)return Yd;if(t.type.terminal)return t.value;if(t.type===_e.array)return LB(t,r,e);if(t.type===_e.map)return UB(t,r,e);if(t.type===_e.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=il(r,e);return e.tags[t.value](n)}throw new Error(`${yt} tag not supported (${t.value})`)}throw new Error("unsupported")}o(il,"tokensToObject");function Sb(r,e){if(!(r instanceof Uint8Array))throw new Error(`${yt} data to decode must be a Uint8Array`);e=Object.assign({},BB,e);let t=e.tokenizer||new Jd(r,e),n=il(t,e);if(n===nl)throw new Error(`${yt} did not find any content to decode`);if(n===Yd)throw new Error(`${yt} got unexpected break`);if(!t.done())throw new Error(`${yt} too many terminals, data makes no sense`);return n}o(Sb,"decode");Hi();var K4=42;function $B(r){if(r.asCID!==r)return null;let e=Ye.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new qe(_e.tag,K4),new qe(_e.bytes,t)]}o($B,"cidEncoder");function qB(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(qB,"undefinedEncoder");function HB(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(HB,"numberEncoder");var zB={float64:!0,typeEncoders:{Object:$B,undefined:qB,number:HB}};function jB(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ye.decode(r.subarray(1))}o(jB,"cidDecoder");var V4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};V4.tags[K4]=jB;var KB="dag-cbor",Sc=113,rf=o(r=>Ab(r,zB),"encode"),Mb=o(r=>Sb(r,V4),"decode");var VB=24;async function G4(r){let e=await Qa({value:r,codec:Yi,hasher:Us});return{cid:e.cid,linkedBlock:e.bytes}}o(G4,"encodePayload");function GB(r,e=VB){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(GB,"pad");async function WB(r){return(await Qa({value:r,codec:Yi,hasher:ed})).cid}o(WB,"encodeIdentityCID");function JB(r){if(r=Ye.asCID(r),r.code!==Sc)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==ed.code)throw new Error("CID must use identity multihash");return Mb(r.multihash.digest)}o(JB,"decodeIdentityCID");async function W4(r,e){return GB((await WB(r)).bytes,e)}o(W4,"prepareCleartext");function J4(r){return JB(Ye.decodeFirst(r)[0])}o(J4,"decodeCleartext");var Y4=Symbol("abortable"),Xd=Symbol("aborted");function X4(r,e){if(e.aborted)return Promise.reject(Xd);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Xd)}),Promise.race([r,n])}o(X4,"abortable");var Z4=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 Zd="utils_abort_request";var ln;(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"})(ln||(ln={}));var Q4={[ln.PARSE_ERROR]:"Parse error",[ln.INVALID_REQUEST]:"Invalid request",[ln.METHOD_NOT_FOUND]:"Method not found",[ln.INVALID_PARAMS]:"Invalid params",[ln.INTERNAL_ERROR]:"Internal error"};function YB(r){return-32e3>=r&&r>=-32099}o(YB,"isServerError");function Qd(r){return Q4[r.toString()]??(YB(r)?"Server error":"Application error")}o(Qd,"getErrorMessage");var Mn=class extends Error{static fromObject(e){return new Mn(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,Mn.prototype),this.code=e,this.data=n,this.message=t??Qd(e)}};o(Mn,"RPCError");function ol(r){let e=Q4[r];return o(function(n){return new Mn(r,e,n)},"createError")}o(ol,"createErrorFactory");var XB=ol(ln.PARSE_ERROR),kW=ol(ln.INVALID_REQUEST),IW=ol(ln.METHOD_NOT_FOUND),DW=ol(ln.INVALID_PARAMS),RW=ol(ln.INTERNAL_ERROR);function ZB(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(ZB,"_checkPrivateRedeclaration");function QB(r,e){return e.get?e.get.call(r):e.value}o(QB,"_classApplyDescriptorGet");function eL(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(eL,"_classApplyDescriptorSet");function e5(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(e5,"_classExtractFieldDescriptor");function Tb(r,e){var t=e5(r,e,"get");return QB(r,t)}o(Tb,"_classPrivateFieldGet");function tL(r,e,t){ZB(r,e),e.set(r,t)}o(tL,"_classPrivateFieldInit");function rL(r,e,t){var n=e5(r,e,"set");return eL(r,n,t),t}o(rL,"_classPrivateFieldSet");var sl=new WeakMap,Mc=class{get connection(){return Tb(this,sl)}createID(){return Z4()}request(e,t=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Xd);let s=this.createID(),f=Tb(this,sl).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 Mn.fromObject(u.error);return u.result});return i==null?f:(i.addEventListener("abort",()=>{this.notify(Zd,{id:s})}),X4(f,i))}async notify(e,t=void 0){await Tb(this,sl).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){tL(this,sl,{writable:!0,value:void 0}),rL(this,sl,e)}};o(Mc,"RPCClient");function t5(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Qd(e)}}}o(t5,"createErrorResponse");function nL(r,e,t){console.warn("Unhandled handler error",e,t)}o(nL,"fallbackOnHandlerError");function iL(r,e){console.warn("Unhandled invalid message",e)}o(iL,"fallbackOnInvalidMessage");function oL(r,e){console.warn("Unhandled notification",e)}o(oL,"fallbackOnNotification");function r5(r,e={}){let t=e.onHandlerError??nL,n=e.onInvalidMessage??iL,i=e.onNotification??oL,s={};function f(u,d){if(d.method===Zd){let v=d.params?.id;v!=null&&s[v]?.abort()}else i(u,d)}return o(f,"handleNotification"),o(async function(d,v){let x=v.id;if(v.jsonrpc!=="2.0"||v.method==null)return x==null?(n(d,v),null):t5(x,ln.INVALID_REQUEST);let E=r[v.method];if(E==null)return x==null?(f(d,v),null):t5(x,ln.METHOD_NOT_FOUND);try{let O;if(x!=null&&E[Y4]){let I=new AbortController;s[x]=I,O=E(d,v.params,{signal:I.signal})}else O=E(d,v.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return x==null||s[x]?.signal.aborted?null:{jsonrpc:"2.0",id:x,result:R}}catch(O){if(x==null||s[x]?.signal.aborted)return t(d,v,O),null;let R;if(O instanceof Mn)R=O.toObject();else{t(d,v,O);let I=O.code??-32e3;R={code:I,message:O.message||Qd(I)}}return{jsonrpc:"2.0",id:x,error:R}}finally{x!=null&&delete s[x]}},"handleRequest")}o(r5,"createHandler");Hi();var f8=Ut(a8(),1),en=Ut(ff(),1);var tU=`
656
+ `+String(n)));Ev(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){_v(r,e,n)})}o(Kq,"dispatchBatch");function _v(r,e,t){Ev(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(_v,"failedDispatch");function Ev(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Ev,"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 Gq(r){var e=r&&r.batchScheduleFn;if(e===void 0)return zq;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(Gq,"getValidBatchScheduleFn");function Wq(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(Wq,"getValidCacheKeyFn");function Jq(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(Jq,"getValidCacheMap");function Yq(r){return r&&r.name?r.name:null}o(Yq,"getValidName");function w9(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(w9,"isArrayLike");_9.exports=Hq});var U9=Re((Bne,L9)=>{"use strict";function pH(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),v=Math.log(256)/Math.log(f);function x(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,B=0,Y=0,P=R.length;Y!==P&&R[Y]===0;)Y++,I++;for(var J=(P-Y)*v+1>>>0,ee=new Uint8Array(J);Y!==P;){for(var X=R[Y],ne=0,V=J-1;(X!==0||ne<B)&&V!==-1;V--,ne++)X+=256*ee[V]>>>0,ee[V]=X%f>>>0,X=X/f>>>0;if(X!==0)throw new Error("Non-zero carry");B=ne,Y++}for(var H=J-B;H!==J&&ee[H]===0;)H++;for(var z=u.repeat(I);H<J;++H)z+=r.charAt(ee[H]);return z}o(x,"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 B=0,Y=0;R[I]===u;)B++,I++;for(var P=(R.length-I)*d+1>>>0,J=new Uint8Array(P);R[I];){var ee=e[R.charCodeAt(I)];if(ee===255)return;for(var X=0,ne=P-1;(ee!==0||X<Y)&&ne!==-1;ne--,X++)ee+=f*J[ne]>>>0,J[ne]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");Y=X,I++}if(R[I]!==" "){for(var V=P-Y;V!==P&&J[V]===0;)V++;for(var H=new Uint8Array(B+(P-V)),z=B;V!==P;)H[z++]=J[V++];return H}}}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:x,decodeUnsafe:E,decode:O}}o(pH,"base");L9.exports=pH});var gp=Re((Lne,F9)=>{"use strict";var mH=new TextDecoder,bH=o(r=>mH.decode(r),"decodeText"),gH=new TextEncoder,vH=o(r=>gH.encode(r),"encodeText");function yH(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(yH,"concat");F9.exports={decodeText:bH,encodeText:vH,concat:yH}});var q9=Re((Une,$9)=>{"use strict";var{encodeText:xH}=gp(),vp=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=xH(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(vp,"Base");$9.exports=vp});var z9=Re((Fne,H9)=>{"use strict";var wH=o((r,e,t)=>{let n={};for(let v=0;v<e.length;++v)n[e[v]]=v;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 v=0;v<i;++v){let x=n[r[v]];if(x===void 0)throw new SyntaxError("Invalid character "+r[v]);u=u<<t|x,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"),_H=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"),EH=o(r=>e=>({encode(t){return _H(t,e,r)},decode(t){return wH(t,e,r)}}),"rfc4648");H9.exports={rfc4648:EH}});var G9=Re(($ne,V9)=>{"use strict";var zl=U9(),AH=q9(),{rfc4648:Gr}=z9(),{decodeText:SH,encodeText:MH}=gp(),TH=o(()=>({encode:SH,decode:MH}),"identity"),j9=[["identity","\0",TH,""],["base2","0",Gr(1),"01"],["base8","7",Gr(3),"01234567"],["base10","9",zl,"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",zl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",zl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",zl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",zl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],K9=j9.reduce((r,e)=>(r[e[0]]=new AH(e[0],e[1],e[2],e[3]),r),{}),CH=j9.reduce((r,e)=>(r[e[1]]=K9[e[0]],r),{});V9.exports={names:K9,codes:CH}});var Y9=Re((ws,J9)=>{"use strict";var iu=G9(),{encodeText:kH,decodeText:yp,concat:W9}=gp();function IH(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=Mf(r);return NH(t,e),W9([n,e],n.length+e.length)}o(IH,"multibase");function DH(r,e){let t=Mf(r),n=kH(t.encode(e));return W9([t.codeBuf,n],t.codeBuf.length+n.length)}o(DH,"encode");function RH(r){r instanceof Uint8Array&&(r=yp(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),Mf(r[0]).decode(r.substring(1))}o(RH,"decode");function OH(r){if(r instanceof Uint8Array&&(r=yp(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return Mf(r[0]).name}catch{return!1}}o(OH,"isEncoded");function NH(r,e){Mf(r).decode(yp(e))}o(NH,"validEncode");function Mf(r){if(Object.prototype.hasOwnProperty.call(iu.names,r))return iu.names[r];if(Object.prototype.hasOwnProperty.call(iu.codes,r))return iu.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(Mf,"encoding");function PH(r){return r instanceof Uint8Array&&(r=yp(r)),Mf(r[0])}o(PH,"encodingFromData");ws=J9.exports=IH;ws.encode=DH;ws.decode=RH;ws.isEncoded=OH;ws.encoding=Mf;ws.encodingFromData=PH;var BH=Object.freeze(iu.names),LH=Object.freeze(iu.codes);ws.names=BH;ws.codes=LH});var eA=Re((qne,Q9)=>{Q9.exports=Z9;var X9=128,UH=127,FH=~UH,$H=Math.pow(2,31);function Z9(r,e,t){e=e||[],t=t||0;for(var n=t;r>=$H;)e[t++]=r&255|X9,r/=128;for(;r&FH;)e[t++]=r&255|X9,r>>>=7;return e[t]=r|0,Z9.bytes=t-n+1,e}o(Z9,"encode")});var nA=Re((Hne,rA)=>{rA.exports=Ov;var qH=128,tA=127;function Ov(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw Ov.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&tA)<<i:(f&tA)*Math.pow(2,i),i+=7}while(f>=qH);return Ov.bytes=s-n,t}o(Ov,"read")});var oA=Re((zne,iA)=>{var HH=Math.pow(2,7),zH=Math.pow(2,14),jH=Math.pow(2,21),KH=Math.pow(2,28),VH=Math.pow(2,35),GH=Math.pow(2,42),WH=Math.pow(2,49),JH=Math.pow(2,56),YH=Math.pow(2,63);iA.exports=function(r){return r<HH?1:r<zH?2:r<jH?3:r<KH?4:r<VH?5:r<GH?6:r<WH?7:r<JH?8:r<YH?9:10}});var aA=Re((jne,sA)=>{sA.exports={encode:eA(),decode:nA(),encodingLength:oA()}});var cA=Re((Kne,fA)=>{"use strict";var XH=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});fA.exports={names:XH}});var bA=Re((Vne,mA)=>{"use strict";var uA=Y9(),ou=aA(),{names:jl}=cA(),{toString:xp}=(nc(),Hh(K3)),{fromString:ZH}=(od(),Hh(j3)),{concat:QH}=(Hm(),Hh(m3)),su={};for(let r in jl){let e=r;su[jl[e]]=e}Object.freeze(su);function ez(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return xp(r,"base16")}o(ez,"toHexString");function tz(r){return ZH(r,"base16")}o(tz,"fromHexString");function rz(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return xp(uA.encode("base58btc",r)).slice(1)}o(rz,"toB58String");function nz(r){let e=r instanceof Uint8Array?xp(r):r;return uA.decode("z"+e)}o(nz,"fromB58String");function lA(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=ou.decode(r);if(!dA(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(ou.decode.bytes);let t=ou.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(ou.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${xp(r,"base16")}`);return{code:e,name:su[e],length:t,digest:r}}o(lA,"decode");function iz(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=hA(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=ou.encode(n),s=ou.encode(t);return QH([i,s,r],i.length+s.length+r.length)}o(iz,"encode");function hA(r){let e=r;if(typeof r=="string"){if(jl[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=jl[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(su[e]===void 0&&!Nv(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(hA,"coerceCode");function Nv(r){return r>0&&r<16}o(Nv,"isAppCode");function dA(r){return!!(Nv(r)||su[r])}o(dA,"isValidCode");function pA(r){lA(r)}o(pA,"validate");function oz(r){return pA(r),r.subarray(0,2)}o(oz,"prefix");mA.exports={names:jl,codes:su,toHexString:ez,fromHexString:tz,toB58String:rz,fromB58String:nz,decode:lA,encode:iz,coerceCode:hA,isAppCode:Nv,validate:pA,prefix:oz,isValidCode:dA}});var gK={};Xt(gK,{CeramicURIValidator:()=>Kv,default:()=>bK,getCeramicPlugin:()=>Dp,streamIdToCeramicURI:()=>Ip});module.exports=Hh(gK);var r7=Ut(h3());function fD(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(fD,"_catch");function cD(){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 v;return((v=d.didResolutionMetadata)==null?void 0:v.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(cD,"inMemoryCache");function uD(r,e){return e()}o(uD,"noCache");var lD="(?:%[0-9a-fA-F]{2})",d3=`(?:[a-zA-Z0-9._-]|${lD})`,hD="([a-z0-9]+)",dD=`((?:${d3}*:)*(${d3}+))`,p3="[a-zA-Z0-9_.:%-]",pD=`;${p3}+=${p3}*`,mD=`((${pD})*)`,bD="(/[^#?]*)?",gD="([?][^#]*)?",vD="(#.*)?",yD=new RegExp(`^did:${hD}:${dD}${mD}${bD}${gD}${vD}$`);function xD(r){if(r===""||!r)return null;let e=r.match(yD);if(e){let t={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:r};if(e[4]){let n=e[4].slice(1).split(";");t.params={};for(let i of n){let s=i.split("=");t.params[s[0]]=s[1]}}return e[6]&&(t.path=e[6]),e[7]&&(t.query=e[7].slice(1)),e[8]&&(t.fragment=e[8].slice(1)),t}return null}o(xD,"parse");var zh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function wD(r){return function(e,t,n){try{return Promise.resolve(fD(function(){return Promise.resolve(r(e,t,n)).then(function(i){return{...zh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...zh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(wD,"wrapLegacyResolver");var Iu=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?cD():t.cache||uD,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=wD(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=xD(e);if(i===null)return Promise.resolve({...zh,didResolutionMetadata:{error:"invalidDid"}});let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve({...zh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(Iu,"Resolver");Hm();od();nc();jh();Du();f1();var cb=Ut(Q3()),Ew=Ut(g1()),ub=Ut(M6()),Fd=Ut(Rd()),Aw=Ut(X6()),Qu=Ut(tw()),lb=Ut(mw()),hb=Ut(Ga());function Ai(r){return Dt(r,"base64url")}o(Ai,"bytesToBase64url");function Sn(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Ft(e,"base64url")}o(Sn,"base64ToBytes");function db(r){return Ft(r,"base58btc")}o(db,"base58ToBytes");function sb(r){let e=r.startsWith("0x")?r.substring(2):r;return Ft(e.toLowerCase(),"base16")}o(sb,"hexToBytes");function ab(r){return Ai(Ft(r))}o(ab,"encodeBase64url");function Sw(r){return Dt(Sn(r))}o(Sw,"decodeBase64url");function Xa(r){return Dt(r,"base16")}o(Xa,"bytesToHex");function Mw(r){return Ft(r)}o(Mw,"stringToBytes");function KP({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Ft(r,"base16"),0),i.set(Ft(e,"base16"),32),n){if(typeof t>"u")throw new Error("Signer did not return a recoveryParam");i[64]=t}return Ai(i)}o(KP,"toJose");function VP(r){let e=Sn(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=Xa(e.slice(0,32)),n=Xa(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(VP,"fromJose");function Tw(r,e){return Fi([Sn(r),Sn(e)])}o(Tw,"toSealed");var GP=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,WP=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,JP=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function YP(r){if(typeof r=="string"){if(GP.test(r))return sb(r);if(WP.test(r))return db(r);if(JP.test(r))return Sn(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(YP,"parseKey");function Cw(r){let e=typeof r=="string"?Ft(r):r;return(0,cb.hash)(e)}o(Cw,"sha256");function XP(r){return new Uint8Array(Ew.keccak_256.arrayBuffer(r))}o(XP,"keccak");function ZP(r){let e=Ft(r.slice(2),"base16");return`0x${Dt(XP(e).slice(-20),"base16")}`}o(ZP,"toEthereumAddress");function fb(r,e=new Uint8Array(4)){let t=Ft(r.toString(),"base10");return e.set(t,4-t.length),e}o(fb,"writeUint32BE");var ob=o(r=>Fi([fb(r.length),r]),"lengthAndInput");function kw(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=Fi([ob(Ft(t)),ob(typeof n>"u"?new Uint8Array(0):n),ob(typeof i>"u"?new Uint8Array(0):i),fb(e)]);return(0,cb.hash)(Fi([fb(1),r,s]))}o(kw,"concatKDF");var SG=new ub.ec("secp256k1");function Iw(r){let e=YP(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"?Mw(t):t,i=(0,Fd.sign)(e,n);return Promise.resolve(Ai(i))}catch(n){return Promise.reject(n)}}}o(Iw,"EdDSASigner");function Dw(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Dw,"instanceOfEcdsaSignature");function bw(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Dw(i))return KP(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(bw,"ES256KSignerAlg");function gw(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Dw(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(gw,"Ed25519SignerAlg");var QP={ES256K:bw(),"ES256K-R":bw(!0),Ed25519:gw(),EdDSA:gw()};function eB(r){let e=QP[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(eB,"SignerAlg");var pb=new ub.ec("secp256k1");function Ud(r,e=!1){let t=Sn(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=Xa(t.slice(0,32)),i=Xa(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(Ud,"toSignatureObject");function mb(r){if(r.publicKeyBase58)return db(r.publicKeyBase58);if(r.publicKeyBase64)return Sn(r.publicKeyBase64);if(r.publicKeyHex)return sb(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return sb(pb.keyFromPublic({x:Xa(Sn(r.publicKeyJwk.x)),y:Xa(Sn(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Uu;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(mb,"extractPublicKeyBytes");function tB(r,e,t){let n=Cw(r),i=Ud(e),s=t.filter(({ethereumAddress:d,blockchainAccountId:v})=>typeof d>"u"&&typeof v>"u"),f=t.filter(({ethereumAddress:d,blockchainAccountId:v})=>typeof d<"u"||typeof v!==void 0),u=s.find(d=>{try{let v=mb(d);return pb.keyFromPublic(v).verify(n,i)}catch{return!1}});if(!u&&f.length>0&&(u=Rw(r,e,f)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(tB,"verifyES256K");function Rw(r,e,t){let n;if(e.length>86)n=[Ud(e,!0)];else{let f=Ud(e,!1);n=[{...f,recoveryParam:0},{...f,recoveryParam:1}]}let i=o(f=>{let u=Cw(r),d=pb.recoverPubKey(u,f,f.recoveryParam),v=d.encode("hex"),x=d.encode("hex",!0),E=ZP(v);return t.find(R=>{var I,B,Y;let P=Xa(mb(R));return P===v||P===x||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===E||((B=R.blockchainAccountId)==null||(Y=B.split("@eip155"))==null?void 0:Y[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(Rw,"verifyRecoverableES256K");function vw(r,e,t){let n=Mw(r),i=Sn(e),s=t.find(f=>(0,Fd.verify)(mb(f),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(vw,"verifyEd25519");var rB={ES256K:tB,"ES256K-R":Rw,Ed25519:vw,EdDSA:vw};function Ow(r){let e=rB[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(Ow,"VerifierAlgorithm");Ow.toSignatureObject=Ud;var Nw=o(function(r,e,t={},n={}){try{t.alg||(t.alg=nB);let i=typeof r=="string"?r:yw(r,n.canonicalize),s=[yw(t,n.canonicalize),i].join("."),f=eB(t.alg);return Promise.resolve(f(s,e)).then(function(u){return[s,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var nB="ES256K";function yw(r,e=!1){return ab(e?(0,Aw.default)(r):JSON.stringify(r))}o(yw,"encodeSection");function iB(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Sw(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(iB,"decodeJWS");function oB({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),Ow(r.alg)(e,t,n)}o(oB,"verifyJWSDecoded");function Pw(r,e){let t=iB(r);return oB(t,e)}o(Pw,"verifyJWS");function sB(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 Za,d=Sr.bind(null,u,2);return(n===0?i.then(x):n===1?s.then(v):f.then(E)).then(void 0,d),u;function v(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){Sr(u,1,s);return}if(i.then){i.then(x).then(void 0,d);return}s=t(),Js(s)&&(s=s.v)}while(!s||!s.then);s.then(v).then(void 0,d)}o(v,"_resumeAfterBody");function x(O){O?(s=t(),s&&s.then?s.then(v).then(void 0,d):v(s)):Sr(u,1,s)}o(x,"_resumeAfterTest");function E(){(i=r())?i.then?i.then(x).then(void 0,d):x(i):Sr(u,1,s)}o(E,"_resumeAfterUpdate")}o(sB,"_for");var Bw=o(function(r,e){try{let n=function(v){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let t;cB(r);let i=JSON.parse(Sw(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Tw(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,Sn(r.iv),f)).then(function(v){u=v}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let v=0;return sB(function(){return!u&&v<r.recipients.length},function(){return v++},function(){let x=r.recipients[v];Object.assign(x.header,i);let E=function(){if(x.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Sn(r.iv),f,x)).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"),xw=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Sr(r,e,t){if(!r.s){if(t instanceof Za)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=Sr.bind(null,r,e);return}if(t&&t.then){t.then(Sr.bind(null,r,e),Sr.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(Sr,"_settle");var Za=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{Sr(n,1,s(this.v))}catch(f){Sr(n,2,f)}return n}else return this}return this.o=function(s){try{let f=s.v;s.s&1?Sr(n,1,e?e(f):f):t?Sr(n,1,t(f)):Sr(n,2,f)}catch(f){Sr(n,2,f)}},n},r}();function Js(r){return r instanceof Za&&r.s&1}o(Js,"_isSettledPact");function aB(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=Sr.bind(null,i=new Za,2)));return}i?Sr(i,1,u):i=u}catch(d){Sr(i||(i=new Za),2,d)}}return o(f,"_cycle"),f(),i}o(aB,"_forTo");function fB(r,e,t){if(typeof r[xw]=="function"){let x=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(x,f||(f=Sr.bind(null,s=new Za,2)));return}s?Sr(s,1,E):s=E}catch(O){Sr(s||(s=new Za),2,O)}};o(x,"_cycle");var n=r[xw](),i,s,f;if(x(),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=[],v=0;v<r.length;v++)d.push(r[v]);return aB(d,function(x){return e(d[x])},t)}o(fB,"_forOf");function cB(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(cB,"validateJWE");function ww({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let f={protected:n,iv:Ai(t),ciphertext:Ai(r),tag:Ai(e)};return s&&(f.aad=Ai(s)),i&&(f.recipients=[i]),f}o(ww,"encodeJWE");var Lw=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 ww(i,n)})}else{let i=e[0].enc;if(!e.reduce((d,v)=>d&&v.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,f,u=fB(e,function(d){let v=function(){return s?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(s)).then(function(x){if(x){var E,O;(E=f)==null||(O=E.recipients)==null||O.push(x)}}):Promise.resolve(d.encrypt(r,t,n)).then(function(x){s=x.cek,f=ww(x,n)})}();if(v&&v.then)return v.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return f}):f)}}catch(i){return Promise.reject(i)}},"createJWE");var Uw=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 v=((u=f.keyAgreement)==null?void 0:u.map(x=>typeof x=="string"?[...f.publicKey||[],...f.verificationMethod||[]].find(E=>E.id===x):x).filter(x=>typeof x<"u")).filter(x=>x.type==="X25519KeyAgreementKey2019"&&Boolean(x.publicKeyBase58));if(!v.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return v.map(x=>lB(db(x.publicKeyBase58),x.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 Fw(r){let e=new lb.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,hb.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(Fw,"xc20pEncrypter");function uB(r){let e=o(function(s,f={},u){try{let d=ab(JSON.stringify(Object.assign({alg:i},f,{enc:n}))),v=new Uint8Array(Buffer.from(u?`${d}.${Ai(u)}`:d));return Promise.resolve({...t(s,v),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),t=Fw(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(uB,"xc20pDirEncrypter");function _w(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 lb.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(_w,"xc20pDirDecrypter");function lB(r,e){let t=o(function(u,d={},v){try{Object.assign(d,{alg:void 0});let x=(0,hb.randomBytes)(32);return Promise.resolve(uB(x).encrypt(u,d,v)).then(function(E){return Promise.resolve(n(x)).then(function(O){return{...E,recipient:O,cek:x}})})}catch(x){return Promise.reject(x)}},"encrypt"),n=o(function(u){try{let d=(0,Qu.generateKeyPair)(),v=(0,Qu.sharedKey)(d.secretKey,r),x=kw(v,s,i),E=Fw(x)(u),O={encrypted_key:Ai(E.ciphertext),header:{alg:i,iv:Ai(E.iv),tag:Ai(E.tag),epk:{kty:"OKP",crv:f,x:Ai(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(lB,"x25519Encrypter");function hB(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(hB,"validateHeader");function $w(r){let e=o(function(s,f,u,d){try{let E=function(){let B=kw(R,n,t),Y=Tw(d.encrypted_key,d.header.tag);return Promise.resolve(_w(B).decrypt(Y,Sn(d.header.iv))).then(function(P){return P===null?null:_w(P).decrypt(s,f,u)})};o(E,"_temp4");var v,x;if(hB((v=d)==null?void 0:v.header),d=d,((x=d.header.epk)==null?void 0:x.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=Sn(d.header.epk.x),R,I=function(){if(r instanceof Uint8Array)R=(0,Qu.sharedKey)(r,O);else return Promise.resolve(r(O)).then(function(B){R=B})}();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($w,"x25519Decrypter");a1();var $d=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),bb=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=Ye.asCID(f);d?yield[u.join("/"),d]:typeof f=="object"&&(yield*bb(f,u))}else{let s=Ye.asCID(n);s?yield[i.join("/"),s]:yield*bb(n,i)}}},"links"),gb=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"&&!Ye.asCID(n))if(Array.isArray(n))for(let[s,f]of n.entries()){let u=[...i,s];yield u.join("/"),typeof f=="object"&&!Ye.asCID(f)&&(yield*gb(f,u))}else yield*gb(n,i)}},"tree"),dB=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=Ye.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),el=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:$d(),bytes:$d(),value:$d(),asBlock:$d()})}links(){return bb(this.value,[])}tree(){return gb(this.value,[])}get(e="/"){return dB(this.value,e.split("/").filter(Boolean))}};o(el,"Block");var Qa=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=Ye.create(1,e.code,i);return new el({value:r,bytes:n,cid:s})},"encode"),qw=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=Ye.create(1,e.code,i);return new el({value:n,bytes:r,cid:s})},"decode");Hi();Bu();s1();Yh();var Yi={};Xt(Yi,{code:()=>Sc,decode:()=>Cb,encode:()=>rf,name:()=>JB});var pB=["string","number","bigint","symbol"],mB=["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 Hw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(pB.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(bB(r))return"Buffer";let t=gB(r);return t||"Object"}o(Hw,"is");function bB(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(bB,"isBuffer");function gB(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(mB.includes(e))return e}o(gB,"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 qe=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(qe,"Token");var yc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",vB=new TextDecoder,yB=new TextEncoder;function qd(r){return yc&&globalThis.Buffer.isBuffer(r)}o(qd,"isBuffer");function yb(r){return r instanceof Uint8Array?qd(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(yb,"asU8A");var Vw=yc?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):jw(r,e,t):(r,e,t)=>t-e>64?vB.decode(r.subarray(e,t)):jw(r,e,t),Gw=yc?r=>r.length>64?globalThis.Buffer.from(r):zw(r):r=>r.length>64?yB.encode(r):zw(r),Ao=o(r=>Uint8Array.from(r),"fromArray"),xc=yc?(r,e,t)=>qd(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Ww=yc?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),yb(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},Jw=yc?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Yw(r,e){if(qd(r)&&qd(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(Yw,"compare");function zw(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(zw,"utf8ToBytes");function jw(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,v,x;switch(f){case 1:i<128&&(s=i);break;case 2:u=r[e+1],(u&192)===128&&(x=(i&31)<<6|u&63,x>127&&(s=x));break;case 3:u=r[e+1],d=r[e+2],(u&192)===128&&(d&192)===128&&(x=(i&15)<<12|(u&63)<<6|d&63,x>2047&&(x<55296||x>57343)&&(s=x));break;case 4:u=r[e+1],d=r[e+2],v=r[e+3],(u&192)===128&&(d&192)===128&&(v&192)===128&&(x=(i&15)<<18|(u&63)<<12|(d&63)<<6|v&63,x>65535&&x<1114112&&(s=x))}}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 xB(n)}o(jw,"utf8Slice");var Kw=4096;function xB(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(xB,"decodeCodePointsArray");var wB=256,wc=class{constructor(e=wB){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=Jw(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=xc(n,0,this.cursor)}else t=Ww(this.chunks,this.cursor);return e&&this.reset(),t}};o(wc,"Bl");var yt="CBOR decode error:",xb="CBOR encode error:",tl=[];tl[23]=1;tl[24]=2;tl[25]=3;tl[26]=5;tl[27]=9;function us(r,e,t){if(r.length-e<t)throw new Error(`${yt} not enough data for type`)}o(us,"assertEnoughData");var Or=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Kn(r,e,t){us(r,e,1);let n=r[e];if(t.strict===!0&&n<Or[0])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Kn,"readUint8");function Vn(r,e,t){us(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Or[1])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Vn,"readUint16");function Gn(r,e,t){us(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Or[2])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Gn,"readUint32");function Wn(r,e,t){us(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<Or[3])throw new Error(`${yt} 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(`${yt} integers outside of the safe integer range are not supported`)}o(Wn,"readUint64");function Xw(r,e,t,n){return new qe(_e.uint,Kn(r,e+1,n),2)}o(Xw,"decodeUint8");function Zw(r,e,t,n){return new qe(_e.uint,Vn(r,e+1,n),3)}o(Zw,"decodeUint16");function Qw(r,e,t,n){return new qe(_e.uint,Gn(r,e+1,n),5)}o(Qw,"decodeUint32");function e4(r,e,t,n){return new qe(_e.uint,Wn(r,e+1,n),9)}o(e4,"decodeUint64");function Si(r,e){return zr(r,0,e.value)}o(Si,"encodeUint");function zr(r,e,t){if(t<Or[0]){let n=Number(t);r.push([e|n])}else if(t<Or[1]){let n=Number(t);r.push([e|24,n])}else if(t<Or[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Or[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<Or[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(`${yt} encountered BigInt larger than allowable range`)}}o(zr,"encodeUintValue");Si.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");zr.encodedSize=o(function(e){return e<Or[0]?1:e<Or[1]?2:e<Or[2]?3:e<Or[3]?5:9},"encodedSize");Si.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function t4(r,e,t,n){return new qe(_e.negint,-1-Kn(r,e+1,n),2)}o(t4,"decodeNegint8");function r4(r,e,t,n){return new qe(_e.negint,-1-Vn(r,e+1,n),3)}o(r4,"decodeNegint16");function n4(r,e,t,n){return new qe(_e.negint,-1-Gn(r,e+1,n),5)}o(n4,"decodeNegint32");var wb=BigInt(-1),i4=BigInt(1);function o4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new qe(_e.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${yt} integers outside of the safe integer range are not supported`);return new qe(_e.negint,wb-BigInt(i),9)}o(o4,"decodeNegint64");function Hd(r,e){let t=e.value,n=typeof t=="bigint"?t*wb-i4:t*-1-1;zr(r,e.type.majorEncoded,n)}o(Hd,"encodeNegint");Hd.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*wb-i4:t*-1-1;return n<Or[0]?1:n<Or[1]?2:n<Or[2]?3:n<Or[3]?5:9},"encodedSize");Hd.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function rl(r,e,t,n){us(r,e,t+n);let i=xc(r,e+t,e+t+n);return new qe(_e.bytes,i,t+n)}o(rl,"toToken");function s4(r,e,t,n){return rl(r,e,1,t)}o(s4,"decodeBytesCompact");function a4(r,e,t,n){return rl(r,e,2,Kn(r,e+1,n))}o(a4,"decodeBytes8");function f4(r,e,t,n){return rl(r,e,3,Vn(r,e+1,n))}o(f4,"decodeBytes16");function c4(r,e,t,n){return rl(r,e,5,Gn(r,e+1,n))}o(c4,"decodeBytes32");function u4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer bytes lengths not supported`);return rl(r,e,9,i)}o(u4,"decodeBytes64");function zd(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===_e.string?Gw(r.value):r.value),r.encodedBytes}o(zd,"tokenBytes");function _c(r,e){let t=zd(e);zr(r,e.type.majorEncoded,t.length),r.push(t)}o(_c,"encodeBytes");_c.encodedSize=o(function(e){let t=zd(e);return zr.encodedSize(t.length)+t.length},"encodedSize");_c.compareTokens=o(function(e,t){return EB(zd(e),zd(t))},"compareTokens");function EB(r,e){return r.length<e.length?-1:r.length>e.length?1:Yw(r,e)}o(EB,"compareBytes");function nl(r,e,t,n,i){let s=t+n;us(r,e,s);let f=new qe(_e.string,Vw(r,e+t,e+s),s);return i.retainStringBytes===!0&&(f.byteValue=xc(r,e+t,e+s)),f}o(nl,"toToken");function l4(r,e,t,n){return nl(r,e,1,t,n)}o(l4,"decodeStringCompact");function h4(r,e,t,n){return nl(r,e,2,Kn(r,e+1,n),n)}o(h4,"decodeString8");function d4(r,e,t,n){return nl(r,e,3,Vn(r,e+1,n),n)}o(d4,"decodeString16");function p4(r,e,t,n){return nl(r,e,5,Gn(r,e+1,n),n)}o(p4,"decodeString32");function m4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer string lengths not supported`);return nl(r,e,9,i,n)}o(m4,"decodeString64");var b4=_c;function Ec(r,e,t,n){return new qe(_e.array,n,t)}o(Ec,"toToken");function g4(r,e,t,n){return Ec(r,e,1,t)}o(g4,"decodeArrayCompact");function v4(r,e,t,n){return Ec(r,e,2,Kn(r,e+1,n))}o(v4,"decodeArray8");function y4(r,e,t,n){return Ec(r,e,3,Vn(r,e+1,n))}o(y4,"decodeArray16");function x4(r,e,t,n){return Ec(r,e,5,Gn(r,e+1,n))}o(x4,"decodeArray32");function w4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer array lengths not supported`);return Ec(r,e,9,i)}o(w4,"decodeArray64");function _4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Ec(r,e,1,1/0)}o(_4,"decodeArrayIndefinite");function jd(r,e){zr(r,_e.array.majorEncoded,e.value)}o(jd,"encodeArray");jd.compareTokens=Si.compareTokens;jd.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");function Ac(r,e,t,n){return new qe(_e.map,n,t)}o(Ac,"toToken");function E4(r,e,t,n){return Ac(r,e,1,t)}o(E4,"decodeMapCompact");function A4(r,e,t,n){return Ac(r,e,2,Kn(r,e+1,n))}o(A4,"decodeMap8");function S4(r,e,t,n){return Ac(r,e,3,Vn(r,e+1,n))}o(S4,"decodeMap16");function M4(r,e,t,n){return Ac(r,e,5,Gn(r,e+1,n))}o(M4,"decodeMap32");function T4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer map lengths not supported`);return Ac(r,e,9,i)}o(T4,"decodeMap64");function C4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Ac(r,e,1,1/0)}o(C4,"decodeMapIndefinite");function Kd(r,e){zr(r,_e.map.majorEncoded,e.value)}o(Kd,"encodeMap");Kd.compareTokens=Si.compareTokens;Kd.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");function k4(r,e,t,n){return new qe(_e.tag,t,1)}o(k4,"decodeTagCompact");function I4(r,e,t,n){return new qe(_e.tag,Kn(r,e+1,n),2)}o(I4,"decodeTag8");function D4(r,e,t,n){return new qe(_e.tag,Vn(r,e+1,n),3)}o(D4,"decodeTag16");function R4(r,e,t,n){return new qe(_e.tag,Gn(r,e+1,n),5)}o(R4,"decodeTag32");function O4(r,e,t,n){return new qe(_e.tag,Wn(r,e+1,n),9)}o(O4,"decodeTag64");function Vd(r,e){zr(r,_e.tag.majorEncoded,e.value)}o(Vd,"encodeTag");Vd.compareTokens=Si.compareTokens;Vd.encodedSize=o(function(e){return zr.encodedSize(e.value)},"encodedSize");var kB=20,IB=21,DB=22,RB=23;function N4(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${yt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new qe(_e.null,null,1):new qe(_e.undefined,void 0,1)}o(N4,"decodeUndefined");function P4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return new qe(_e.break,void 0,1)}o(P4,"decodeBreak");function _b(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${yt} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${yt} Infinity values are not supported`)}return new qe(_e.float,r,e)}o(_b,"createToken");function B4(r,e,t,n){return _b(Eb(r,e+1),3,n)}o(B4,"decodeFloat16");function L4(r,e,t,n){return _b(Ab(r,e+1),5,n)}o(L4,"decodeFloat32");function U4(r,e,t,n){return _b(H4(r,e+1),9,n)}o(U4,"decodeFloat64");function Gd(r,e,t){let n=e.value;if(n===!1)r.push([_e.float.majorEncoded|kB]);else if(n===!0)r.push([_e.float.majorEncoded|IB]);else if(n===null)r.push([_e.float.majorEncoded|DB]);else if(n===void 0)r.push([_e.float.majorEncoded|RB]);else{let i,s=!1;(!t||t.float64!==!0)&&($4(n),i=Eb(Wi,1),n===i||Number.isNaN(n)?(Wi[0]=249,r.push(Wi.slice(0,3)),s=!0):(q4(n),i=Ab(Wi,1),n===i&&(Wi[0]=250,r.push(Wi.slice(0,5)),s=!0))),s||(OB(n),i=H4(Wi,1),Wi[0]=251,r.push(Wi.slice(0,9)))}}o(Gd,"encodeFloat");Gd.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){$4(n);let i=Eb(Wi,1);if(n===i||Number.isNaN(n))return 3;if(q4(n),i=Ab(Wi,1),n===i)return 5}return 9},"encodedSize");var F4=new ArrayBuffer(9),Mi=new DataView(F4,1),Wi=new Uint8Array(F4,0);function $4(r){if(r===1/0)Mi.setUint16(0,31744,!1);else if(r===-1/0)Mi.setUint16(0,64512,!1);else if(Number.isNaN(r))Mi.setUint16(0,32256,!1);else{Mi.setFloat32(0,r);let e=Mi.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)Mi.setUint16(0,31744,!1);else if(t===0)Mi.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?Mi.setUint16(0,0):i<-14?Mi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Mi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o($4,"encodeFloat16");function Eb(r,e){if(r.length-e<2)throw new Error(`${yt} 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(Eb,"readFloat16");function q4(r){Mi.setFloat32(0,r,!1)}o(q4,"encodeFloat32");function Ab(r,e){if(r.length-e<4)throw new Error(`${yt} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(Ab,"readFloat32");function OB(r){Mi.setFloat64(0,r,!1)}o(OB,"encodeFloat64");function H4(r,e){if(r.length-e<8)throw new Error(`${yt} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(H4,"readFloat64");Gd.compareTokens=Si.compareTokens;function $t(r,e,t){throw new Error(`${yt} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o($t,"invalidMinor");function Wd(r){return()=>{throw new Error(`${yt} ${r}`)}}o(Wd,"errorer");var Be=[];for(let r=0;r<=23;r++)Be[r]=$t;Be[24]=Xw;Be[25]=Zw;Be[26]=Qw;Be[27]=e4;Be[28]=$t;Be[29]=$t;Be[30]=$t;Be[31]=$t;for(let r=32;r<=55;r++)Be[r]=$t;Be[56]=t4;Be[57]=r4;Be[58]=n4;Be[59]=o4;Be[60]=$t;Be[61]=$t;Be[62]=$t;Be[63]=$t;for(let r=64;r<=87;r++)Be[r]=s4;Be[88]=a4;Be[89]=f4;Be[90]=c4;Be[91]=u4;Be[92]=$t;Be[93]=$t;Be[94]=$t;Be[95]=Wd("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)Be[r]=l4;Be[120]=h4;Be[121]=d4;Be[122]=p4;Be[123]=m4;Be[124]=$t;Be[125]=$t;Be[126]=$t;Be[127]=Wd("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)Be[r]=g4;Be[152]=v4;Be[153]=y4;Be[154]=x4;Be[155]=w4;Be[156]=$t;Be[157]=$t;Be[158]=$t;Be[159]=_4;for(let r=160;r<=183;r++)Be[r]=E4;Be[184]=A4;Be[185]=S4;Be[186]=M4;Be[187]=T4;Be[188]=$t;Be[189]=$t;Be[190]=$t;Be[191]=C4;for(let r=192;r<=215;r++)Be[r]=k4;Be[216]=I4;Be[217]=D4;Be[218]=R4;Be[219]=O4;Be[220]=$t;Be[221]=$t;Be[222]=$t;Be[223]=$t;for(let r=224;r<=243;r++)Be[r]=Wd("simple values are not supported");Be[244]=$t;Be[245]=$t;Be[246]=$t;Be[247]=N4;Be[248]=Wd("simple values are not supported");Be[249]=B4;Be[250]=L4;Be[251]=U4;Be[252]=$t;Be[253]=$t;Be[254]=$t;Be[255]=P4;var Ji=[];for(let r=0;r<24;r++)Ji[r]=new qe(_e.uint,r,1);for(let r=-1;r>=-24;r--)Ji[31-r]=new qe(_e.negint,r,1);Ji[64]=new qe(_e.bytes,new Uint8Array(0),1);Ji[96]=new qe(_e.string,"",1);Ji[128]=new qe(_e.array,0,1);Ji[160]=new qe(_e.map,0,1);Ji[244]=new qe(_e.false,!1,1);Ji[245]=new qe(_e.true,!0,1);Ji[246]=new qe(_e.null,null,1);function z4(r){switch(r.type){case _e.false:return Ao([244]);case _e.true:return Ao([245]);case _e.null:return Ao([246]);case _e.bytes:return r.value.length?void 0:Ao([64]);case _e.string:return r.value===""?Ao([96]):void 0;case _e.array:return r.value===0?Ao([128]):void 0;case _e.map:return r.value===0?Ao([160]):void 0;case _e.uint:return r.value<24?Ao([Number(r.value)]):void 0;case _e.negint:if(r.value>=-24)return Ao([31-Number(r.value)])}}o(z4,"quickEncodeToken");var PB={float64:!1,mapSorter:UB,quickEncodeToken:z4};function BB(){let r=[];return r[_e.uint.major]=Si,r[_e.negint.major]=Hd,r[_e.bytes.major]=_c,r[_e.string.major]=b4,r[_e.array.major]=jd,r[_e.map.major]=Kd,r[_e.tag.major]=Vd,r[_e.float.major]=Gd,r}o(BB,"makeCborEncoders");var j4=BB(),Sb=new wc,tf=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(`${xb} object contains circular references`);return new tf(t,e)}};o(tf,"Ref");var Ys={null:new qe(_e.null,null),undefined:new qe(_e.undefined,void 0),true:new qe(_e.true,!0),false:new qe(_e.false,!1),emptyArray:new qe(_e.array,0),emptyMap:new qe(_e.map,0)},Xs={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new qe(_e.float,r):r>=0?new qe(_e.uint,r):new qe(_e.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new qe(_e.uint,r):new qe(_e.negint,r)},Uint8Array(r,e,t,n){return new qe(_e.bytes,r)},string(r,e,t,n){return new qe(_e.string,r)},boolean(r,e,t,n){return r?Ys.true:Ys.false},null(r,e,t,n){return Ys.null},undefined(r,e,t,n){return Ys.undefined},ArrayBuffer(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[Ys.emptyArray,new qe(_e.break)]:Ys.emptyArray;n=tf.createCheck(n,r);let i=[],s=0;for(let f of r)i[s++]=Jd(f,t,n);return t.addBreakTokens?[new qe(_e.array,r.length),i,new qe(_e.break)]:[new qe(_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?[Ys.emptyMap,new qe(_e.break)]:Ys.emptyMap;n=tf.createCheck(n,r);let u=[],d=0;for(let v of s)u[d++]=[Jd(v,t,n),Jd(i?r.get(v):r[v],t,n)];return LB(u,t),t.addBreakTokens?[new qe(_e.map,f),u,new qe(_e.break)]:[new qe(_e.map,f),u]}};Xs.Map=Xs.Object;Xs.Buffer=Xs.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Xs[`${r}Array`]=Xs.DataView;function Jd(r,e={},t){let n=Hw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||Xs[n];if(typeof i=="function"){let f=i(r,n,e,t);if(f!=null)return f}let s=Xs[n];if(!s)throw new Error(`${xb} unsupported type: ${n}`);return s(r,n,e,t)}o(Jd,"objectToTokens");function LB(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(LB,"sortMapEntries");function UB(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=j4[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(UB,"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 FB(r,e,t){let n=Jd(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 wc(f);if(s(u,n,t),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return yb(u.chunks[0])}}return Sb.reset(),K4(Sb,n,e,t),Sb.toBytes(!0)}o(FB,"encodeCustom");function Mb(r,e){return e=Object.assign({},PB,e),FB(r,j4,e)}o(Mb,"encode");var $B={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Yd=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=Ji[e];if(t===void 0){let n=Be[e];if(!n)throw new Error(`${yt} 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(Yd,"Tokeniser");var il=Symbol.for("DONE"),Xd=Symbol.for("BREAK");function qB(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=ol(e,t);if(s===Xd){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed array`)}if(s===il)throw new Error(`${yt} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(qB,"tokenToArray");function HB(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=ol(e,t);if(u===Xd){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed map`)}if(u===il)throw new Error(`${yt} found map but not enough entries (got ${f} [no key], expected ${r.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${yt} non-string keys not supported (got ${typeof u})`);if(t.rejectDuplicateMapKeys===!0&&(n&&s.has(u)||!n&&u in i))throw new Error(`${yt} found repeat map key "${u}"`);let d=ol(e,t);if(d===il)throw new Error(`${yt} 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(HB,"tokenToMap");function ol(r,e){if(r.done())return il;let t=r.next();if(t.type===_e.break)return Xd;if(t.type.terminal)return t.value;if(t.type===_e.array)return qB(t,r,e);if(t.type===_e.map)return HB(t,r,e);if(t.type===_e.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=ol(r,e);return e.tags[t.value](n)}throw new Error(`${yt} tag not supported (${t.value})`)}throw new Error("unsupported")}o(ol,"tokensToObject");function Tb(r,e){if(!(r instanceof Uint8Array))throw new Error(`${yt} data to decode must be a Uint8Array`);e=Object.assign({},$B,e);let t=e.tokenizer||new Yd(r,e),n=ol(t,e);if(n===il)throw new Error(`${yt} did not find any content to decode`);if(n===Xd)throw new Error(`${yt} got unexpected break`);if(!t.done())throw new Error(`${yt} too many terminals, data makes no sense`);return n}o(Tb,"decode");Hi();var V4=42;function jB(r){if(r.asCID!==r)return null;let e=Ye.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new qe(_e.tag,V4),new qe(_e.bytes,t)]}o(jB,"cidEncoder");function KB(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(KB,"undefinedEncoder");function VB(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(VB,"numberEncoder");var GB={float64:!0,typeEncoders:{Object:jB,undefined:KB,number:VB}};function WB(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ye.decode(r.subarray(1))}o(WB,"cidDecoder");var G4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};G4.tags[V4]=WB;var JB="dag-cbor",Sc=113,rf=o(r=>Mb(r,GB),"encode"),Cb=o(r=>Tb(r,G4),"decode");var YB=24;async function W4(r){let e=await Qa({value:r,codec:Yi,hasher:Us});return{cid:e.cid,linkedBlock:e.bytes}}o(W4,"encodePayload");function XB(r,e=YB){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(XB,"pad");async function ZB(r){return(await Qa({value:r,codec:Yi,hasher:td})).cid}o(ZB,"encodeIdentityCID");function QB(r){if(r=Ye.asCID(r),r.code!==Sc)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==td.code)throw new Error("CID must use identity multihash");return Cb(r.multihash.digest)}o(QB,"decodeIdentityCID");async function J4(r,e){return XB((await ZB(r)).bytes,e)}o(J4,"prepareCleartext");function Y4(r){return QB(Ye.decodeFirst(r)[0])}o(Y4,"decodeCleartext");var X4=Symbol("abortable"),Zd=Symbol("aborted");function Z4(r,e){if(e.aborted)return Promise.reject(Zd);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Zd)}),Promise.race([r,n])}o(Z4,"abortable");var Q4=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 Qd="utils_abort_request";var ln;(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"})(ln||(ln={}));var e5={[ln.PARSE_ERROR]:"Parse error",[ln.INVALID_REQUEST]:"Invalid request",[ln.METHOD_NOT_FOUND]:"Method not found",[ln.INVALID_PARAMS]:"Invalid params",[ln.INTERNAL_ERROR]:"Internal error"};function eL(r){return-32e3>=r&&r>=-32099}o(eL,"isServerError");function e0(r){return e5[r.toString()]??(eL(r)?"Server error":"Application error")}o(e0,"getErrorMessage");var Mn=class extends Error{static fromObject(e){return new Mn(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,Mn.prototype),this.code=e,this.data=n,this.message=t??e0(e)}};o(Mn,"RPCError");function sl(r){let e=e5[r];return o(function(n){return new Mn(r,e,n)},"createError")}o(sl,"createErrorFactory");var tL=sl(ln.PARSE_ERROR),LW=sl(ln.INVALID_REQUEST),UW=sl(ln.METHOD_NOT_FOUND),FW=sl(ln.INVALID_PARAMS),$W=sl(ln.INTERNAL_ERROR);function rL(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(rL,"_checkPrivateRedeclaration");function nL(r,e){return e.get?e.get.call(r):e.value}o(nL,"_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 t5(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(t5,"_classExtractFieldDescriptor");function kb(r,e){var t=t5(r,e,"get");return nL(r,t)}o(kb,"_classPrivateFieldGet");function oL(r,e,t){rL(r,e),e.set(r,t)}o(oL,"_classPrivateFieldInit");function sL(r,e,t){var n=t5(r,e,"set");return iL(r,n,t),t}o(sL,"_classPrivateFieldSet");var al=new WeakMap,Mc=class{get connection(){return kb(this,al)}createID(){return Q4()}request(e,t=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Zd);let s=this.createID(),f=kb(this,al).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 Mn.fromObject(u.error);return u.result});return i==null?f:(i.addEventListener("abort",()=>{this.notify(Qd,{id:s})}),Z4(f,i))}async notify(e,t=void 0){await kb(this,al).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){oL(this,al,{writable:!0,value:void 0}),sL(this,al,e)}};o(Mc,"RPCClient");function r5(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:e0(e)}}}o(r5,"createErrorResponse");function aL(r,e,t){console.warn("Unhandled handler error",e,t)}o(aL,"fallbackOnHandlerError");function fL(r,e){console.warn("Unhandled invalid message",e)}o(fL,"fallbackOnInvalidMessage");function cL(r,e){console.warn("Unhandled notification",e)}o(cL,"fallbackOnNotification");function n5(r,e={}){let t=e.onHandlerError??aL,n=e.onInvalidMessage??fL,i=e.onNotification??cL,s={};function f(u,d){if(d.method===Qd){let v=d.params?.id;v!=null&&s[v]?.abort()}else i(u,d)}return o(f,"handleNotification"),o(async function(d,v){let x=v.id;if(v.jsonrpc!=="2.0"||v.method==null)return x==null?(n(d,v),null):r5(x,ln.INVALID_REQUEST);let E=r[v.method];if(E==null)return x==null?(f(d,v),null):r5(x,ln.METHOD_NOT_FOUND);try{let O;if(x!=null&&E[X4]){let I=new AbortController;s[x]=I,O=E(d,v.params,{signal:I.signal})}else O=E(d,v.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return x==null||s[x]?.signal.aborted?null:{jsonrpc:"2.0",id:x,result:R}}catch(O){if(x==null||s[x]?.signal.aborted)return t(d,v,O),null;let R;if(O instanceof Mn)R=O.toObject();else{t(d,v,O);let I=O.code??-32e3;R={code:I,message:O.message||e0(I)}}return{jsonrpc:"2.0",id:x,error:R}}finally{x!=null&&delete s[x]}},"handleRequest")}o(n5,"createHandler");Hi();var c8=Ut(f8(),1),en=Ut(ff(),1);var oU=`
657
657
  sign-in-with-ethereum =
658
658
  domain %s" wants you to sign in with your Ethereum account:" LF
659
659
  address LF
@@ -800,26 +800,26 @@ LF = %x0A
800
800
  DIGIT = %x30-39
801
801
  ; 0-9
802
802
  HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
803
- `,ul=class{constructor(e){let t=new f8.default(tU);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 en.default.parser;i.ast=new en.default.ast;let s=en.default.ids,f=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.domain=en.default.utils.charsToString(ne,V,H)),he},"domain");i.ast.callbacks.domain=f;let u=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.address=en.default.utils.charsToString(ne,V,H)),he},"address");i.ast.callbacks.address=u;let d=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.statement=en.default.utils.charsToString(ne,V,H)),he},"statement");i.ast.callbacks.statement=d;let v=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.uri||(z.uri=en.default.utils.charsToString(ne,V,H))),he},"uri");i.ast.callbacks.uri=v;let x=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.version=en.default.utils.charsToString(ne,V,H)),he},"version");i.ast.callbacks.version=x;let E=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.chainId=en.default.utils.charsToString(ne,V,H)),he},"chainId");i.ast.callbacks["chain-id"]=E;let O=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.nonce=en.default.utils.charsToString(ne,V,H)),he},"nonce");i.ast.callbacks.nonce=O;let R=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.issuedAt=en.default.utils.charsToString(ne,V,H)),he},"issuedAt");i.ast.callbacks["issued-at"]=R;let I=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.expirationTime=en.default.utils.charsToString(ne,V,H)),he},"expirationTime");i.ast.callbacks["expiration-time"]=I;let B=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.notBefore=en.default.utils.charsToString(ne,V,H)),he},"notBefore");i.ast.callbacks["not-before"]=B;let Y=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.requestId=en.default.utils.charsToString(ne,V,H)),he},"requestId");i.ast.callbacks["request-id"]=Y;let P=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.resources=en.default.utils.charsToString(ne,V,H).slice(3).split(`
804
- - `)),he},"resources");i.ast.callbacks.resources=P;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[X,ne]of Object.entries(ee))this[X]=ne}};o(ul,"ParsedMessage");function Vb(){return Vb=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},Vb.apply(this,arguments)}o(Vb,"_extends");var Gb={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}"}}}},rU={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}"}}}},Wb={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}"}}}},nU={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:Gb,1:Wb}}},iU={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:Gb,1:Wb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},ll={2:Gb,10:rU,19:{assetName:Wb,assetType:nU,assetId:iU}};function c8(r,e){return r.split(e.parameters.delimiter)}o(c8,"splitParams");function hl(r,e){var t=c8(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(hl,"getParams");function Nc(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Nc(n,t)}).join(e.parameters.delimiter)}o(Nc,"joinParams");function dl(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=c8(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(dl,"isValidId");var ta=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(!dl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(hl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();ta.spec=ll[2];var ra=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ta(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!dl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=hl(n,this.spec),s=i.namespace,f=i.reference,u=i.address,d=new ta({namespace:s,reference:f});return new r({chainId:d,address:u}).toJSON()},"parse"),r.format=o(function(n){var i=new ta(n.chainId),s=Vb({},i.toJSON(),{address:n.address});return Nc(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}();ra.spec=ll[10];var Jb=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(!dl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(hl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();Jb.spec=ll[19].assetName;var oU=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ta(t.chainId),this.assetName=new Jb(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!dl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(hl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();oU.spec=ll[19].assetType;var sU=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ta(t.chainId),this.assetName=new Jb(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!dl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(hl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();sU.spec=ll[19].assetId;var u8;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(u8||(u8={}));var ml;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(ml||(ml={}));var pl=class{static fromCacao(e){let t=ra.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 ta(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=ml.PERSONAL_SIGNATURE)),n}toMessage(e){return aU(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 ul(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(pl,"SiwxMessage");function l8(r,e){let t=`${r.domain} wants you to sign in with your ${e} account:`,n=`URI: ${r.uri}`,i=[t,r.address].join(`
803
+ `,ll=class{constructor(e){let t=new c8.default(oU);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 en.default.parser;i.ast=new en.default.ast;let s=en.default.ids,f=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.domain=en.default.utils.charsToString(ne,V,H)),he},"domain");i.ast.callbacks.domain=f;let u=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.address=en.default.utils.charsToString(ne,V,H)),he},"address");i.ast.callbacks.address=u;let d=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.statement=en.default.utils.charsToString(ne,V,H)),he},"statement");i.ast.callbacks.statement=d;let v=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.uri||(z.uri=en.default.utils.charsToString(ne,V,H))),he},"uri");i.ast.callbacks.uri=v;let x=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.version=en.default.utils.charsToString(ne,V,H)),he},"version");i.ast.callbacks.version=x;let E=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.chainId=en.default.utils.charsToString(ne,V,H)),he},"chainId");i.ast.callbacks["chain-id"]=E;let O=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.nonce=en.default.utils.charsToString(ne,V,H)),he},"nonce");i.ast.callbacks.nonce=O;let R=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.issuedAt=en.default.utils.charsToString(ne,V,H)),he},"issuedAt");i.ast.callbacks["issued-at"]=R;let I=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.expirationTime=en.default.utils.charsToString(ne,V,H)),he},"expirationTime");i.ast.callbacks["expiration-time"]=I;let B=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.notBefore=en.default.utils.charsToString(ne,V,H)),he},"notBefore");i.ast.callbacks["not-before"]=B;let Y=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.requestId=en.default.utils.charsToString(ne,V,H)),he},"requestId");i.ast.callbacks["request-id"]=Y;let P=o(function(X,ne,V,H,z){let he=s.SEM_OK;return X===s.SEM_PRE&&(z.resources=en.default.utils.charsToString(ne,V,H).slice(3).split(`
804
+ - `)),he},"resources");i.ast.callbacks.resources=P;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[X,ne]of Object.entries(ee))this[X]=ne}};o(ll,"ParsedMessage");function Wb(){return Wb=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},Wb.apply(this,arguments)}o(Wb,"_extends");var Jb={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}"}}}},sU={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}"}}}},Yb={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}"}}}},aU={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:Jb,1:Yb}}},fU={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:Jb,1:Yb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},hl={2:Jb,10:sU,19:{assetName:Yb,assetType:aU,assetId:fU}};function u8(r,e){return r.split(e.parameters.delimiter)}o(u8,"splitParams");function dl(r,e){var t=u8(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(dl,"getParams");function Nc(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Nc(n,t)}).join(e.parameters.delimiter)}o(Nc,"joinParams");function pl(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=u8(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(pl,"isValidId");var ta=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(!pl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(dl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();ta.spec=hl[2];var ra=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ta(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!pl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=dl(n,this.spec),s=i.namespace,f=i.reference,u=i.address,d=new ta({namespace:s,reference:f});return new r({chainId:d,address:u}).toJSON()},"parse"),r.format=o(function(n){var i=new ta(n.chainId),s=Wb({},i.toJSON(),{address:n.address});return Nc(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}();ra.spec=hl[10];var Xb=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(!pl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(dl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();Xb.spec=hl[19].assetName;var cU=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ta(t.chainId),this.assetName=new Xb(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!pl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(dl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();cU.spec=hl[19].assetType;var uU=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new ta(t.chainId),this.assetName=new Xb(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!pl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(dl(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Nc(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}();uU.spec=hl[19].assetId;var l8;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(l8||(l8={}));var bl;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(bl||(bl={}));var ml=class{static fromCacao(e){let t=ra.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 ta(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=bl.PERSONAL_SIGNATURE)),n}toMessage(e){return lU(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 ll(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(ml,"SiwxMessage");function h8(r,e){let t=`${r.domain} wants you to sign in with your ${e} account:`,n=`URI: ${r.uri}`,i=[t,r.address].join(`
805
805
  `),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 v=`Expiration Time: ${r.expirationTime}`;u.push(v)}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(v=>`- ${v}`)].join(`
806
806
  `));let d=u.join(`
807
807
  `);return r.statement&&(i=[i,r.statement].join(`
808
808
 
809
809
  `)),[i,d].join(`
810
810
 
811
- `)}o(l8,"asLegacyChainIdString");function aU(r,e){let t=`${r.domain} wants you to sign in with your ${e} account:`,n=`URI: ${r.uri}`,i=[t,r.address].join(`
811
+ `)}o(h8,"asLegacyChainIdString");function lU(r,e){let t=`${r.domain} wants you to sign in with your ${e} account:`,n=`URI: ${r.uri}`,i=[t,r.address].join(`
812
812
  `),s=`Version: ${r.version}`;r.nonce||(r.nonce=(Math.random()+1).toString(36).substring(4));let f=`Nonce: ${r.nonce}`,u=`Chain ID: ${r.chainId}`,d=[n,s,u,f];if(r.issuedAt&&Date.parse(r.issuedAt),r.issuedAt=r.issuedAt?r.issuedAt:new Date().toISOString(),d.push(`Issued At: ${r.issuedAt}`),r.expirationTime){let x=`Expiration Time: ${r.expirationTime}`;d.push(x)}r.notBefore&&d.push(`Not Before: ${r.notBefore}`),r.requestId&&d.push(`Request ID: ${r.requestId}`),r.resources&&r.resources.length>=1&&d.push(["Resources:",...r.resources.map(x=>`- ${x}`)].join(`
813
813
  `));let v=d.join(`
814
814
  `);return r.statement&&(i=[i,r.statement].join(`
815
815
 
816
816
  `)),[i,v].join(`
817
817
 
818
- `)}o(aU,"asString");var Pc=class extends pl{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case ml.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Pc,"SiweMessage");Pu();var fU=5*60,AJ=new Date("2022-09-20").valueOf(),bl;(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 $w({bytes:u,codec:Yi,hasher:Us})).value}o(s,"fromBlockBytes"),r.fromBlockBytes=s;async function f(u,d={}){Yb(u);let v=d.verifiers[u.s.t];if(!v)throw new Error("Unsupported CACAO signature type, register the needed verifier");return v(u,d)}o(f,"verify"),r.verify=f})(bl||(bl={}));var gl;(function(r){function e(t){return Qa({value:t,codec:Yi,hasher:Us})}o(e,"fromCacao"),r.fromCacao=e})(gl||(gl={}));function Yb(r){if(r.s===null||r.s===void 0)throw new Error("CACAO does not have a signature")}o(Yb,"assertSigned");function h8(r,e){let t=e.atTime?e.atTime.getTime():Date.now(),n=(e.clockSkewSecs??fU)*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(h8,"verifyTimeChecks");var d8="logger/5.8.0";var p8=!1,m8=!1,c0={debug:1,default:2,info:2,warning:3,error:4,off:5},b8=c0.default,Xb=null;function cU(){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(cU,"_checkNormalize");var g8=cU(),Zb;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Zb||(Zb={}));var Zi;(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"})(Zi||(Zi={}));var v8="0123456789abcdef",Mt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();c0[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(b8>c0[n])&&console.log.apply(console,t)}debug(...e){this._log(Mt.levels.DEBUG,e)}info(...e){this._log(Mt.levels.INFO,e)}warn(...e){this._log(Mt.levels.WARNING,e)}makeError(e,t,n){if(m8)return this.makeError("censored error",t,{});t||(t=Mt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(d=>{let v=n[d];try{if(v instanceof Uint8Array){let x="";for(let E=0;E<v.length;E++)x+=v8[v[E]>>4],x+=v8[v[E]&15];i.push(d+"=Uint8Array(0x"+x+")")}else i.push(d+"="+JSON.stringify(v))}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 Zi.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 Zi.CALL_EXCEPTION:case Zi.INSUFFICIENT_FUNDS:case Zi.MISSING_NEW:case Zi.NONCE_EXPIRED:case Zi.REPLACEMENT_UNDERPRICED:case Zi.TRANSACTION_REPLACED:case Zi.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,Mt.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"),g8&&this.throwError("platform missing String.prototype.normalize",Mt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:g8})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Mt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Mt.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,Mt.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Mt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",Mt.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",Mt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Mt.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Xb||(Xb=new Mt(d8)),Xb}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Mt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),p8){if(!e)return;this.globalLogger().throwError("error censorship permanent",Mt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}m8=!!e,p8=!!t}static setLogLevel(e){let t=c0[e.toLowerCase()];if(t==null){Mt.globalLogger().warn("invalid log level - "+e);return}b8=t}static from(e){return new Mt(e)}};o(Mt,"Logger");Mt.errors=Zi;Mt.levels=Zb;var y8="bytes/5.8.0";var xr=new Mt(y8);function w8(r){return!!r.toHexString}o(w8,"isHexable");function Bc(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Bc(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Bc,"addSlice");function _8(r){return Qi(r)&&!(r.length%2)||eg(r)}o(_8,"isBytesLike");function x8(r){return typeof r=="number"&&r==r&&r%1===0}o(x8,"isInteger");function eg(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!x8(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!x8(t)||t<0||t>=256)return!1}return!0}o(eg,"isBytes");function fr(r,e){if(e||(e={}),typeof r=="number"){xr.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),Bc(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),w8(r)&&(r=r.toHexString()),Qi(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":xr.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 Bc(new Uint8Array(n))}return eg(r)?Bc(new Uint8Array(r)):xr.throwArgumentError("invalid arrayify value","value",r)}o(fr,"arrayify");function tg(r){let e=r.map(i=>fr(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),Bc(n)}o(tg,"concat");function uU(r,e){r=fr(r),r.length>e&&xr.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Bc(t)}o(uU,"zeroPad");function Qi(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Qi,"isHexString");var Qb="0123456789abcdef";function tn(r,e){if(e||(e={}),typeof r=="number"){xr.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),w8(r))return r.toHexString();if(Qi(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":xr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(eg(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 xr.throwArgumentError("invalid hexlify value","value",r)}o(tn,"hexlify");function u0(r){if(typeof r!="string")r=tn(r);else if(!Qi(r)||r.length%2)return null;return(r.length-2)/2}o(u0,"hexDataLength");function l0(r,e,t){return typeof r!="string"?r=tn(r):(!Qi(r)||r.length%2)&&xr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(l0,"hexDataSlice");function na(r,e){for(typeof r!="string"?r=tn(r):Qi(r)||xr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&xr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(na,"hexZeroPad");function h0(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(_8(r)){let t=fr(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=tn(t.slice(0,32)),e.s=tn(t.slice(32,64))):t.length===65?(e.r=tn(t.slice(0,32)),e.s=tn(t.slice(32,64)),e.v=t[64]):xr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:xr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=tn(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=uU(fr(e._vs),32);e._vs=tn(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&xr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let f=tn(i);e.s==null?e.s=f:e.s!==f&&xr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?xr.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&&xr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Qi(e.r)?xr.throwArgumentError("signature missing or invalid r","signature",r):e.r=na(e.r,32),e.s==null||!Qi(e.s)?xr.throwArgumentError("signature missing or invalid s","signature",r):e.s=na(e.s,32);let t=fr(e.s);t[0]>=128&&xr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=tn(t);e._vs&&(Qi(e._vs)||xr.throwArgumentError("signature invalid _vs","signature",r),e._vs=na(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&xr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(h0,"splitSignature");var S8=Ut(ng());var A8="bignumber/5.8.0";var lU=S8.default.BN,BJ=new Mt(A8);function ig(r){return new lU(r,36).toString(16)}o(ig,"_base36To16");var M8=Ut(m1());function Lc(r){return"0x"+M8.default.keccak_256(fr(r))}o(Lc,"keccak256");var T8="address/5.8.0";var vl=new Mt(T8);function C8(r){Qi(r,20)||vl.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=fr(Lc(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(C8,"getChecksumAddress");var pU=9007199254740991;function mU(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(mU,"log10");var og={};for(let r=0;r<10;r++)og[String(r)]=String(r);for(let r=0;r<26;r++)og[String.fromCharCode(65+r)]=String(10+r);var k8=Math.floor(mU(pU));function bU(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>og[n]).join("");for(;e.length>=k8;){let n=e.substring(0,k8);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(bU,"ibanChecksum");function I8(r){let e=null;if(typeof r!="string"&&vl.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=C8(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&vl.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)!==bU(r)&&vl.throwArgumentError("bad icap checksum","address",r),e=ig(r.substring(4));e.length<40;)e="0"+e;e=C8("0x"+e)}else vl.throwArgumentError("invalid address","address",r);return e}o(I8,"getAddress");var D8="properties/5.8.0";var QJ=new Mt(D8);function Uc(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Uc,"defineReadOnly");var R8="strings/5.8.0";var O8=new Mt(R8),yl;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(yl||(yl={}));var cf;(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"})(cf||(cf={}));function gU(r,e,t,n,i){return O8.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(gU,"errorFunc");function N8(r,e,t,n,i){if(r===cf.BAD_PREFIX||r===cf.UNEXPECTED_CONTINUE){let s=0;for(let f=e+1;f<t.length&&t[f]>>6===2;f++)s++;return s}return r===cf.OVERRUN?t.length-e-1:0}o(N8,"ignoreFunc");function vU(r,e,t,n,i){return r===cf.OVERLONG?(n.push(i),0):(n.push(65533),N8(r,e,t,n,i))}o(vU,"replaceFunc");var yU=Object.freeze({error:gU,ignore:N8,replace:vU});function xl(r,e=yl.current){e!=yl.current&&(O8.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 fr(t)}o(xl,"toUtf8Bytes");var P8=`Ethereum Signed Message:
819
- `;function sg(r){return typeof r=="string"&&(r=xl(r)),Lc(tg([xl(P8),xl(String(r.length)),r]))}o(sg,"hashMessage");var vt=Ut(ng()),ko=Ut(zu());function Fc(r,e,t){return t={path:e,exports:{},require:function(n,i){return xU(n,i??t.path)}},r(t,t.exports),t.exports}o(Fc,"createCommonjsModule");function xU(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(xU,"commonjsRequire");var ug=L8;function L8(r,e){if(!r)throw new Error(e||"Assertion failed")}o(L8,"assert");L8.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var eo=Fc(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 v=0;v<f.length;v++)d[v]=f[v]|0;return d}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var v=0;v<f.length;v+=2)d.push(parseInt(f[v]+f[v+1],16))}else for(var v=0;v<f.length;v++){var x=f.charCodeAt(v),E=x>>8,O=x&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")}),Yn=Fc(function(r,e){"use strict";var t=e;t.assert=ug,t.toArray=eo.toArray,t.zero2=eo.zero2,t.toHex=eo.toHex,t.encode=eo.encode;function n(d,v,x){var E=new Array(Math.max(d.bitLength(),x)+1),O;for(O=0;O<E.length;O+=1)E[O]=0;var R=1<<v+1,I=d.clone();for(O=0;O<E.length;O++){var B,Y=I.andln(R-1);I.isOdd()?(Y>(R>>1)-1?B=(R>>1)-Y:B=Y,I.isubn(B)):B=0,E[O]=B,I.iushrn(1)}return E}o(n,"getNAF"),t.getNAF=n;function i(d,v){var x=[[],[]];d=d.clone(),v=v.clone();for(var E=0,O=0,R;d.cmpn(-E)>0||v.cmpn(-O)>0;){var I=d.andln(3)+E&3,B=v.andln(3)+O&3;I===3&&(I=-1),B===3&&(B=-1);var Y;(I&1)===0?Y=0:(R=d.andln(7)+E&7,(R===3||R===5)&&B===2?Y=-I:Y=I),x[0].push(Y);var P;(B&1)===0?P=0:(R=v.andln(7)+O&7,(R===3||R===5)&&I===2?P=-B:P=B),x[1].push(P),2*E===Y+1&&(E=1-E),2*O===P+1&&(O=1-O),d.iushrn(1),v.iushrn(1)}return x}o(i,"getJSF"),t.getJSF=i;function s(d,v,x){var E="_"+v;d.prototype[v]=o(function(){return this[E]!==void 0?this[E]:this[E]=x.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 vt.default(d,"hex","le")}o(u,"intFromLE"),t.intFromLE=u}),m0=Yn.getNAF,wU=Yn.getJSF,b0=Yn.assert;function oa(r,e){this.type=r,this.p=new vt.default(e.p,16),this.red=e.prime?vt.default.red(e.prime):vt.default.mont(this.p),this.zero=new vt.default(0).toRed(this.red),this.one=new vt.default(1).toRed(this.red),this.two=new vt.default(2).toRed(this.red),this.n=e.n&&new vt.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(oa,"BaseCurve");var lf=oa;oa.prototype.point=o(function(){throw new Error("Not implemented")},"point");oa.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");oa.prototype._fixedNafMul=o(function(e,t){b0(e.precomputed);var n=e._getDoubles(),i=m0(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 v=u+n.step-1;v>=u;v--)d=(d<<1)+i[v];f.push(d)}for(var x=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()));x=x.add(E)}return x.toP()},"_fixedNafMul");oa.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=m0(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var v=0;d>=0&&f[d]===0;d--)v++;if(d>=0&&v++,u=u.dblp(v),d<0)break;var x=f[d];b0(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(s[x-1>>1]):u=u.mixedAdd(s[-x-1>>1].neg()):x>0?u=u.add(s[x-1>>1]):u=u.add(s[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");oa.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,v=0,x,E,O;for(x=0;x<i;x++){O=t[x];var R=O._getNAFPoints(e);f[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var I=x-1,B=x;if(f[I]!==1||f[B]!==1){d[I]=m0(n[I],f[I],this._bitLength),d[B]=m0(n[B],f[B],this._bitLength),v=Math.max(d[I].length,v),v=Math.max(d[B].length,v);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=wU(n[I],n[B]);for(v=Math.max(J[0].length,v),d[I]=new Array(v),d[B]=new Array(v),E=0;E<v;E++){var ee=J[0][E]|0,X=J[1][E]|0;d[I][E]=P[(ee+1)*3+(X+1)],d[B][E]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var z=!0;for(E=0;E<i;E++)V[E]=d[E][x]|0,V[E]!==0&&(z=!1);if(!z)break;H++,x--}if(x>=0&&H++,ne=ne.dblp(H),x<0)break;for(E=0;E<i;E++){var he=V[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(x=0;x<i;x++)u[x]=null;return s?ne:ne.toP()},"_wnafMulAdd");function Ii(r,e){this.curve=r,this.type=e,this.precomputed=null}o(Ii,"BasePoint");oa.BasePoint=Ii;Ii.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");Ii.prototype.validate=o(function(){return this.curve.validate(this)},"validate");oa.prototype.decodePoint=o(function(e,t){e=Yn.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?b0(e[e.length-1]%2===0):e[0]===7&&b0(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");Ii.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");Ii.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");Ii.prototype.encode=o(function(e,t){return Yn.encode(this._encode(t),e)},"encode");Ii.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");Ii.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");Ii.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");Ii.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");Ii.prototype._getBeta=o(function(){return null},"_getBeta");Ii.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var lg=Fc(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")}),_U=Yn.assert;function Di(r){lf.call(this,"short",r),this.a=new vt.default(r.a,16).toRed(this.red),this.b=new vt.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(Di,"ShortCurve");lg(Di,lf);var EU=Di;Di.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 vt.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 vt.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],_U(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 vt.default(u.a,16),b:new vt.default(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");Di.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:vt.default.mont(e),n=new vt.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new vt.default(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");Di.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 vt.default(1),f=new vt.default(0),u=new vt.default(0),d=new vt.default(1),v,x,E,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var X=d.sub(ee.mul(f));if(!E&&P.cmp(t)<0)v=B.neg(),x=s,E=P.neg(),O=J;else if(E&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=X}R=P.neg(),I=J;var ne=E.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=v,I=x),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");Di.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),v=s.mul(n.b),x=f.mul(i.b),E=e.sub(u).sub(d),O=v.add(x).neg();return{k1:E,k2:O}},"_endoSplit");Di.prototype.pointFromX=o(function(e,t){e=new vt.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");Di.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");Di.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],v=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[f*2]=d,i[f*2+1]=v,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return x},"_endoWnafMulAdd");function Br(r,e,t,n){lf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new vt.default(e,16),this.y=new vt.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(Br,"Point");lg(Br,lf.BasePoint);Di.prototype.point=o(function(e,t,n){return new Br(this,e,t,n)},"point");Di.prototype.pointFromJSON=o(function(e,t){return Br.fromJSON(this,e,t)},"pointFromJSON");Br.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");Br.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");Br.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");Br.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");Br.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Br.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");Br.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");Br.prototype.getX=o(function(){return this.x.fromRed()},"getX");Br.prototype.getY=o(function(){return this.y.fromRed()},"getY");Br.prototype.mul=o(function(e){return e=new vt.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");Br.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");Br.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");Br.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");Br.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");Br.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 jr(r,e,t,n){lf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt.default(0)):(this.x=new vt.default(e,16),this.y=new vt.default(t,16),this.z=new vt.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(jr,"JPoint");lg(jr,lf.BasePoint);Di.prototype.jpoint=o(function(e,t,n){return new jr(this,e,t,n)},"jpoint");jr.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");jr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");jr.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),v=f.redSub(u);if(d.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=d.redSqr(),E=x.redMul(d),O=i.redMul(x),R=v.redSqr().redIAdd(E).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(f.redMul(E)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");jr.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 v=u.redSqr(),x=v.redMul(u),E=n.redMul(v),O=d.redSqr().redIAdd(x).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(x)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");jr.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,v=d.redSqr().redSqr(),x=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=x.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(v)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=x.redMul(d);t+1<e&&(v=v.redMul(R)),f=Y,d=ee,x=J}return this.curve.jpoint(f,x.redMul(s),d)},"dblp");jr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");jr.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),v=d.redSqr().redISub(u).redISub(u),x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),e=v,t=d.redMul(u.redISub(v)).redISub(x),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 B=E.redAdd(E).redIAdd(E),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");jr.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),v=d.redSqr().redISub(u).redISub(u);e=v;var x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),t=d.redMul(u.redISub(v)).redISub(x),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 B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");jr.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)),v=t.redAdd(t);v=v.redIAdd(v);var x=v.redMul(u),E=d.redSqr().redISub(x.redAdd(x)),O=x.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,B)},"_dbl");jr.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(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(v),E=t.redMul(x);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(x.redMul(v.redISub(x)).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");jr.prototype.mul=o(function(e,t){return e=new vt.default(e,t),this.curve._wnafMul(this,e)},"mul");jr.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");jr.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");jr.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");jr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var d0=Fc(function(r,e){"use strict";var t=e;t.base=lf,t.short=EU,t.mont=null,t.edwards=null}),p0=Fc(function(r,e){"use strict";var t=e,n=Yn.assert;function i(u){u.type==="short"?this.curve=new d0.short(u):u.type==="edwards"?this.curve=new d0.edwards(u):this.curve=new d0.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 v=new i(d);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:v}),v}})}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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function ia(r){if(!(this instanceof ia))return new ia(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=eo.toArray(r.entropy,r.entropyEnc||"hex"),t=eo.toArray(r.nonce,r.nonceEnc||"hex"),n=eo.toArray(r.pers,r.persEnc||"hex");ug(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ia,"HmacDRBG");var U8=ia;ia.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");ia.prototype._hmac=o(function(){return new ko.default.hmac(this.hash,this.K)},"hmac");ia.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");ia.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=eo.toArray(e,t),n=eo.toArray(n,i),ug(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");ia.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=eo.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++,eo.encode(f,t)},"generate");var cg=Yn.assert;function rn(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(rn,"KeyPair");var hg=rn;rn.fromPublic=o(function(e,t,n){return t instanceof rn?t:new rn(e,{pub:t,pubEnc:n})},"fromPublic");rn.fromPrivate=o(function(e,t,n){return t instanceof rn?t:new rn(e,{priv:t,privEnc:n})},"fromPrivate");rn.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");rn.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");rn.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");rn.prototype._importPrivate=o(function(e,t){this.priv=new vt.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");rn.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?cg(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&cg(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");rn.prototype.derive=o(function(e){return e.validate()||cg(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");rn.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");rn.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");rn.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var AU=Yn.assert;function g0(r,e){if(r instanceof g0)return r;this._importDER(r,e)||(AU(r.r&&r.s,"Signature without r or s"),this.r=new vt.default(r.r,16),this.s=new vt.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(g0,"Signature");var v0=g0;function SU(){this.place=0}o(SU,"Position");function ag(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(ag,"getLength");function B8(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(B8,"rmPadding");g0.prototype._importDER=o(function(e,t){e=Yn.toArray(e,t);var n=new SU;if(e[n.place++]!==48)return!1;var i=ag(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=ag(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=ag(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 vt.default(f),this.s=new vt.default(d),this.recoveryParam=null,!0},"_importDER");function fg(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(fg,"constructLength");g0.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=B8(t),n=B8(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];fg(i,t.length),i=i.concat(t),i.push(2),fg(i,n.length);var s=i.concat(n),f=[48];return fg(f,s.length),f=f.concat(s),Yn.encode(f,e)},"toDER");var MU=o(function(){throw new Error("unsupported")},"rand"),uf=Yn.assert;function ki(r){if(!(this instanceof ki))return new ki(r);typeof r=="string"&&(uf(Object.prototype.hasOwnProperty.call(p0,r),"Unknown curve "+r),r=p0[r]),r instanceof p0.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(ki,"EC");var TU=ki;ki.prototype.keyPair=o(function(e){return new hg(this,e)},"keyPair");ki.prototype.keyFromPrivate=o(function(e,t){return hg.fromPrivate(this,e,t)},"keyFromPrivate");ki.prototype.keyFromPublic=o(function(e,t){return hg.fromPublic(this,e,t)},"keyFromPublic");ki.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new U8({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||MU(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new vt.default(2));;){var s=new vt.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");ki.prototype._truncateToN=o(function(e,t,n){var i;if(vt.default.isBN(e)||typeof e=="number")e=new vt.default(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new vt.default(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new vt.default(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");ki.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!vt.default.isBN(e)){uf(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),uf(e.length>>>0===e.length);for(var s=0;s<e.length;s++)uf((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),uf(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);uf(new vt.default(d).eq(e),"Can not sign message");for(var v=new U8({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),x=this.n.sub(new vt.default(1)),E=0;;E++){var O=i.k?i.k(E):new vt.default(v.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(x)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new v0({r:B,s:Y,recoveryParam:P})}}}}}},"sign");ki.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new v0(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),v=d.mul(e).umod(this.n),x=d.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)},"verify");ki.prototype.recoverPubKey=function(r,e,t,n){uf((3&t)===t,"The recovery param is more than two bits"),e=new v0(e,n);var i=this.n,s=new vt.default(r),f=e.r,u=e.s,d=t&1,v=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var x=e.r.invm(i),E=i.sub(s).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(E,f,O)};ki.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new v0(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 CU=Fc(function(r,e){"use strict";var t=e;t.version="6.6.1",t.utils=Yn,t.rand=function(){throw new Error("unsupported")},t.curve=d0,t.curves=p0,t.ec=TU,t.eddsa=null}),F8=CU.ec;var $8="signing-key/5.8.0";var pg=new Mt($8),dg=null;function Io(){return dg||(dg=new F8("secp256k1")),dg}o(Io,"getCurve");var y0=class{constructor(e){Uc(this,"curve","secp256k1"),Uc(this,"privateKey",tn(e)),u0(this.privateKey)!==32&&pg.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Io().keyFromPrivate(fr(this.privateKey));Uc(this,"publicKey","0x"+t.getPublic(!1,"hex")),Uc(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Uc(this,"_isSigningKey",!0)}_addPoint(e){let t=Io().keyFromPublic(fr(this.publicKey)),n=Io().keyFromPublic(fr(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=fr(e);n.length!==32&&pg.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return h0({recoveryParam:i.recoveryParam,r:na("0x"+i.r.toString(16),32),s:na("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=Io().keyFromPublic(fr(mg(e)));return na("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(y0,"SigningKey");function q8(r,e){let t=h0(e),n={r:fr(t.r),s:fr(t.s)};return"0x"+Io().recoverPubKey(fr(r),n,t.recoveryParam).encode("hex",!1)}o(q8,"recoverPublicKey");function mg(r,e){let t=fr(r);if(t.length===32){let n=new y0(t);return e?"0x"+Io().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?tn(t):"0x"+Io().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+Io().keyFromPublic(t).getPublic(!0,"hex"):tn(t)}return pg.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(mg,"computePublicKey");var H8="transactions/5.8.0";var OY=new Mt(H8),z8;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(z8||(z8={}));function j8(r){let e=mg(r);return I8(l0(Lc(l0(e,1)),12))}o(j8,"computeAddress");function K8(r,e){return j8(q8(fr(r),e))}o(K8,"recoverAddress");var V8="wallet/5.8.0";var HY=new Mt(V8);function bg(r,e){return K8(sg(r),e)}o(bg,"verifyMessage");function G8(){return{eip191:async(r,e)=>{IU(r,e)}}}o(G8,"getEIP191Verifier");var kU=new Date("2022-09-20").valueOf();function IU(r,e){Yb(r),h8(r,e);let n=[bg(Pc.fromCacao(r).toMessage(),r.s.s).toLowerCase()];if(Date.parse(r.p.iat)<=kU){let s=bg(l8(Pc.fromCacao(r),"Ethereum"),r.s.s).toLowerCase();n.push(s)}let i=ra.parse(r.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(IU,"verifyEIP191Signature");nc();id();var W8=Ut(Ga(),1);nc();function J8(){return Dt((0,W8.randomBytes)(16),"base64")}o(J8,"randomString");var Y8="base64pad",X8="base64url";function Z8(r){return Dt(r,Y8)}o(Z8,"encodeBase64");function Q8(r){return Dt(r,X8)}o(Q8,"encodeBase64Url");function e_(r){return Ft(r,Y8)}o(e_,"decodeBase64");function x0(r){return JSON.parse(Dt(Ft(r,X8)))}o(x0,"base64urlToJSON");function t_(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(t_,"fromDagJWS");function r_(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(r_,"didWithTime");function n_(r){return r?Array.isArray(r)?r:[r]:[]}o(n_,"extractControllers");var DU={...G8()};function RU(r){return"registry"in r&&"cache"in r}o(RU,"isResolver");var hf=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 hf({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Mc(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=RU(e)?e:new ku(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=J8(),s=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:f}=await this.verifyJWS(s),u=x0(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 gl.fromCacao(this._capability),f=Ye.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 G4(e),s=Q8(n.bytes);Object.assign(t,{linkedBlock:Z8(i)});let f=await this.createJWS(s,t),u=Ye.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 gl.fromCacao(this._capability);return{jws:f,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:f,linkedBlock:i}}async verifyJWS(e,t={}){t=Object.assign({verifiers:DU},t),typeof e!="string"&&(e=t_(e));let n=x0(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!t.disableTimecheck){let v=i.didDocumentMetadata?.nextUpdate;if(v){let E=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,O=new Date(v).valueOf()+E;if(!(t.atTime&&t.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let x=i.didDocumentMetadata?.updated;if(x&&t.atTime&&t.atTime.getTime()<new Date(x).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 bl.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 v=r_(t.issuer,t.atTime),E=(await this.resolve(v)).didDocument?.controller,O=n_(E);if(t.capability?.s&&t.capability.p.aud===f&&O.includes(t.capability.p.iss))await bl.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||[];Nw(e,u);let d;try{d=x0(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,t,n={}){let i=await Lw(t,this._resolver);return Bw(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,t,n={}){let i=await W4(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 e_(n)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return J4(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 Mc(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(hf,"DID");function i_(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(i_,"toUint8Array");var Tg=Ut(wl(),1);Wh();var yg={};Xt(yg,{keyToDidDoc:()=>VU});function VU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:Dt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(VU,"keyToDidDoc");var xg={};Xt(xg,{keyToDidDoc:()=>WU});nc();var p_=Ut(Dd(),1);function GU(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${Dt(e,"base58btc")}`}o(GU,"encodeKey");function WU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=(0,p_.convertPublicKeyToX25519)(r),s=`${t}#${GU(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:Dt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:Dt(i,"base58btc")}]}}o(WU,"keyToDidDoc");var Ag={};Xt(Ag,{keyToDidDoc:()=>oF,pubKeyBytesToXY:()=>v_});var _0={};Xt(_0,{ECPointDecompress:()=>rF});function JU(r){return r>=0?r:-r}o(JU,"n");function YU(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,v=n-s*f;e=r,r=u,t=i,n=s,i=d,s=v}return{g:e,x:t,y:n}}o(YU,"r");function w0(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(w0,"e");function m_(r,e){let t=YU(w0(r,e),e);if(t.g!==1n)throw new RangeError(`${r.toString()} does not have inverse modulo ${e.toString()}`);return w0(t.x,e)}o(m_,"o");function XU(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 w0(i+u*m_(u,s)%n*r[f]%n,n)},0n)}o(XU,"i");function ZU(r){return r.map(e=>e[0]**(e[1]-1n)*(e[0]-1n)).reduce((e,t)=>t*e,1n)}o(ZU,"a");function sa(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=w0(r,t),e<0n)return m_(sa(r,JU(e),t,n),t);if(n!==void 0)return function(s,f,u,d){let v=d.map(O=>O[0]**O[1]),x=d.map(O=>ZU([O])),E=x.map((O,R)=>sa(s,f%O,v[R]));return XU(E,v,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(sa,"s");var wr={};Xt(wr,{pubKeyBytesToHex:()=>QU,publicKeyHexToUint8ArrayPointPair:()=>b_,publicKeyIntToUint8ArrayPointPair:()=>g_,publicKeyIntToXY:()=>tF,publicKeyToXY:()=>eF,testHexString:()=>_g,testUint8Array:()=>aa});Jh();function QU(r){if(!aa(r))throw new TypeError("input must be a Uint8Array");return Dt(r,"base16")}o(QU,"pubKeyBytesToHex");function eF(r){if(!_g(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=b_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(eF,"publicKeyToXY");function b_(r){if(!_g(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=Ft(e,"base16"),i=Ft(t,"base16");return{xOctet:n,yOctet:i}}o(b_,"publicKeyHexToUint8ArrayPointPair");function _g(r){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(r)!==null&&e.test(r)&&typeof r=="string")}o(_g,"testHexString");function aa(r){return r==null?!1:r.constructor===Uint8Array}o(aa,"testUint8Array");function tF(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=g_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(tF,"publicKeyIntToXY");function g_(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=Ft(e,"base10"),i=Ft(t,"base10");return{xOctet:n,yOctet:i}}o(g_,"publicKeyIntToUint8ArrayPointPair");function rF(r){if(!aa(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(Dt(f,"base10")),d=u**3n-u*3n+n,v=sa(d,i,t);return v%2n!==s&&(v=t-v),{x:u,y:v}}o(rF,"ECPointDecompress");var E0={};Xt(E0,{ECPointDecompress:()=>nF});function nF(r){if(!aa(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(Dt(f,"base10")),d=u**3n-u*3n+n,v=sa(d,i,t);return v%2n!==s&&(v=t-v),{x:u,y:v}}o(nF,"ECPointDecompress");var A0={};Xt(A0,{ECPointDecompress:()=>iF});function iF(r){if(!aa(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(Dt(f,"base10")),d=u**3n-u*3n+n,v=sa(d,i,t);return v%2n!==s&&(v=t-v),{x:u,y:v}}o(iF,"ECPointDecompress");function oF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=v_(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(oF,"keyToDidDoc");function v_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==64)return wr.publicKeyToXY(e);if(t==65&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ft(e,"base16"),i=_0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(v_,"pubKeyBytesToXY");var Sg={};Xt(Sg,{keyToDidDoc:()=>sF,pubKeyBytesToXY:()=>y_});function sF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=y_(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(sF,"keyToDidDoc");function y_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==96)return wr.publicKeyToXY(e);if(t==97&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ft(e,"base16"),i=E0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(y_,"pubKeyBytesToXY");var Mg={};Xt(Mg,{keyToDidDoc:()=>aF,pubKeyBytesToXY:()=>x_});function aF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=x_(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(aF,"keyToDidDoc");function x_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let t=Ft(e,"base16"),n=A0.ECPointDecompress(t);return wr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(x_,"pubKeyBytesToXY");var fF="application/did+ld+json",w_="application/did+json",cF={231:yg,237:xg,4608:Ag,4609:Sg,4610:Mg};function uF(){return{key:async(r,e,t,n)=>{let i=n.accept||w_,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let f=vi.decode(e.id),u=Tg.default.decode(f),d=f.slice(Tg.default.decode.bytes),v=await cF[u].keyToDidDoc(d,e.id);i===fF?(v["@context"]="https://w3id.org/did/v1",s.didDocument=v):i===w_?s.didDocument=v:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(f){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=f.toString()}return s}}}o(uF,"getResolver");var __={getResolver:uF};var S0=Ut(Dd(),1);var C_=Ut(A_(),1);var lF="base64pad";function S_(r){return JSON.parse((0,C_.default)(r))}o(S_,"toStableObject");function hF(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${Dt(e,"base58btc")}`}o(hF,"encodeDID");function M_(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(M_,"toGeneralJWS");var T_=o(async(r,e,t,n={})=>{let i=`${e}#${e.split(":")[2]}`,s=kw(t),f=S_(Object.assign(n,{kid:i,alg:"EdDSA"}));return Ow(typeof r=="string"?r:S_(r),s,f)},"sign"),dF={did_authenticate:async({did:r,secretKey:e},t)=>{let n=await T_({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return M_(n)},did_createJWS:async({did:r,secretKey:e},t)=>{if(t.did.split("#")[0]!==r)throw new Mn(4100,`Unknown DID: ${r}`);let i=await T_(t.payload,r,e,t.protected);return{jws:M_(i)}},did_decryptJWE:async({secretKey:r},e)=>{let t=Fw((0,S0.convertSecretKeyToX25519)(r));try{let n=await Pw(e.jwe,t);return{cleartext:Dt(n,lF)}}catch(n){throw new Mn(-32e3,n.message)}}},_l=class{constructor(e){let{secretKey:t,publicKey:n}=(0,S0.generateKeyPairFromSeed)(e),i=hF(n),s=r5(dF);this._handle=async f=>await s({did:i,secretKey:t},f)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(_l,"Ed25519Provider");var Cg={};Xt(Cg,{JsonPatchError:()=>br,_areEquals:()=>Sl,applyOperation:()=>df,applyPatch:()=>R0,applyReducer:()=>vF,deepClone:()=>bF,getValueByPointer:()=>I0,validate:()=>I_,validator:()=>D0});var pF=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)}}(),mF=Object.prototype.hasOwnProperty;function T0(r,e){return mF.call(r,e)}o(T0,"hasOwnProperty");function C0(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)T0(r,i)&&n.push(i);return n}o(C0,"_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 k0(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(k0,"isInteger");function Do(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(Do,"escapePathComponent");function El(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(El,"unescapePathComponent");function M0(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(M0(r[e]))return!0}else if(typeof r=="object"){for(var n=C0(r),i=n.length,s=0;s<i;s++)if(M0(r[n[s]]))return!0}}return!1}o(M0,"hasUndefined");function k_(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(`
820
- `)}o(k_,"patchErrorMessageFormatter");var Al=function(r){pF(e,r);function e(t,n,i,s,f){var u=this.constructor,d=r.call(this,k_(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=k_(t,{name:n,index:i,operation:s,tree:f}),d}return o(e,"PatchError"),e}(Error);var br=Al,bF=Kr,$c={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=I0(t,this.path);n&&(n=Kr(n));var i=df(t,{op:"remove",path:this.from}).removed;return df(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=I0(t,this.from);return df(t,{op:"add",path:this.path,value:Kr(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:Sl(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},gF={add:function(r,e,t){return k0(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:$c.move,copy:$c.copy,test:$c.test,_get:$c._get};function I0(r,e){if(e=="")return r;var t={op:"_get",path:e};return df(r,t),t.value}o(I0,"getValueByPointer");function df(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):D0(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=I0(r,e.from),e.op==="move"&&(f.removed=r),f;if(e.op==="test"){if(f.test=Sl(r,e.value),f.test===!1)throw new br("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 br("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("/"),v=r,x=1,E=d.length,O=void 0,R=void 0,I=void 0;for(typeof t=="function"?I=t:I=D0;;){if(R=d[x],R&&R.indexOf("~")!=-1&&(R=El(R)),i&&(R=="__proto__"||R=="prototype"&&x>0&&d[x-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&&(v[R]===void 0?O=d.slice(0,x).join("/"):x==E-1&&(O=e.path),O!==void 0&&I(e,0,r,O)),x++,Array.isArray(v)){if(R==="-")R=v.length;else{if(t&&!k0(R))throw new br("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);k0(R)&&(R=~~R)}if(x>=E){if(t&&e.op==="add"&&R>v.length)throw new br("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=gF[e.op].call(e,v,R,r);if(f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}}else if(x>=E){var f=$c[e.op].call(e,v,R,r);if(f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}if(v=v[R],t&&x<E&&(!v||typeof v!="object"))throw new br("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(df,"applyOperation");function R0(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new br("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]=df(r,e[f],t,!0,i,f),r=s[f].newDocument;return s.newDocument=r,s}o(R0,"applyPatch");function vF(r,e,t){var n=df(r,e);if(n.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(vF,"applyReducer");function D0(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new br("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if($c[r.op]){if(typeof r.path!="string")throw new br("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new br('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 br("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 br("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")&&M0(r.value))throw new br("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 br("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 br("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=I_([f],t);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new br("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new br("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(D0,"validator");function I_(r,e,t){try{if(!Array.isArray(r))throw new br("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)R0(Kr(e),Kr(r),t||!0);else{t=t||D0;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof br)return i;throw i}}o(I_,"validate");function Sl(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(!Sl(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],!Sl(r[f],e[f]))return!1;return!0}return r!==r&&e!==e}o(Sl,"_areEquals");var Rg={};Xt(Rg,{compare:()=>MF,generate:()=>kg,observe:()=>SF,unobserve:()=>AF});var Ig=new WeakMap,yF=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),xF=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function wF(r){return Ig.get(r)}o(wF,"getMirror");function _F(r,e){return r.observers.get(e)}o(_F,"getObserverFromMirror");function EF(r,e){r.observers.delete(e.callback)}o(EF,"removeObserverFromMirror");function AF(r,e){e.unobserve()}o(AF,"unobserve");function SF(r,e){var t=[],n,i=wF(r);if(!i)i=new yF(r),Ig.set(r,i);else{var s=_F(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(){kg(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(){kg(n),clearTimeout(n.next),EF(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 xF(e,n)),n}o(SF,"observe");function kg(r,e){e===void 0&&(e=!1);var t=Ig.get(r.object);Dg(t.value,r.object,r.patches,"",e),r.patches.length&&R0(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(kg,"generate");function Dg(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=C0(e),f=C0(r),u=!1,d=!1,v=f.length-1;v>=0;v--){var x=f[v],E=r[x];if(T0(e,x)&&!(e[x]===void 0&&E!==void 0&&Array.isArray(e)===!1)){var O=e[x];typeof E=="object"&&E!=null&&typeof O=="object"&&O!=null&&Array.isArray(E)===Array.isArray(O)?Dg(E,O,t,n+"/"+Do(x),i):E!==O&&(u=!0,i&&t.push({op:"test",path:n+"/"+Do(x),value:Kr(E)}),t.push({op:"replace",path:n+"/"+Do(x),value:Kr(O)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+Do(x),value:Kr(E)}),t.push({op:"remove",path:n+"/"+Do(x)}),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 v=0;v<s.length;v++){var x=s[v];!T0(r,x)&&e[x]!==void 0&&t.push({op:"add",path:n+"/"+Do(x),value:Kr(e[x])})}}}o(Dg,"_generate");function MF(r,e,t){t===void 0&&(t=!1);var n=[];return Dg(r,e,n,"",t),n}o(MF,"compare");var O0=Object.assign({},Cg,Rg,{JsonPatchError:Al,deepClone:Kr,escapePathComponent:Do,unescapePathComponent:El});var v9=Ut(Kc(),1);var y9=Ut(Ga(),1);var _r;(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={}));var pv=Ut(Kc(),1);Hi();ec();var vE={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function eq(r){let e=vE[r];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${r}`)}o(eq,"codeByName");function tq(r){let e=Object.entries(vE).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(tq,"nameByCode");var kn=class{};o(kn,"StreamType");kn.nameByCode=tq;kn.codeByName=eq;var ev=Ut(wl(),1);function Xn(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=yE(f.value,e,t,n);else if(f.get!=null)f.get=yE(f.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(Xn,"Memoize");var Gg=new Map;function yE(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)Gg.has(d)?Gg.get(d).push(u):Gg.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 v=`${d}__timestamp`,x=!1;if(t>0)if(!u.has(v))x=!0;else{let E=u.get(v);x=Date.now()-E>t}u.has(d)&&!x?f=u.get(d):(f=r.apply(this,s),u.set(d,f),t>0&&u.set(v,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(yE,"getNewFunction");Hi();ec();Pu();var Zg=Ut(wl(),1);function Vc(r){try{return r()}catch(e){return e}}o(Vc,"tryCatch");Hi();var Wg=Ut(wl(),1);Fa();function gf(r){let e=Wg.default.decode(r),t=Wg.default.decode.bytes,n=r.subarray(t);return[e,n,t]}o(gf,"readVarint");function rq(r){return r===0||r===1}o(rq,"isCidVersion");function Jg(r){let[e,t]=gf(r);if(!rq(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=gf(t),[,s,f]=gf(i),[u,,d]=gf(s),v=i.subarray(0,f+d+u),x=i.subarray(f+d+u);return[Ye.create(e,n,Zh(v)),x]}o(Jg,"readCid");Hi();ec();function vf(r,e="StreamRef"){let[t,n]=gf(r);if(t!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,s]=gf(n),f=Jg(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[v]=Jg(d);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(vf,"fromBytes");var nq=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Gc(r,e="StreamRef"){let t=nq.exec(r)||[],n=t[2];if(!n)throw new Error(`Malformed ${e} string: ${r}`);let i=qi.decode(n),s=vf(i),f=t[4];return f?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Yg(s.genesis,f)}:s}o(Gc,"fromString");function iq(r){try{return typeof r=="string"?Ye.parse(r):Ye.asCID(r)}catch{return null}}o(iq,"parseCID");function Yg(r,e=null){if(!e||e==="0")return null;let t=iq(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(Yg,"parseCommit");var kl=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},Ri=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},H0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${qi.encode(e)}: contains commit`)}};o(H0,"InvalidStreamIDBytesError");var z0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(z0,"InvalidStreamIDStringError");function _E(r){let e=vf(r,"StreamID");if(e.kind==="stream-id")return new it(e.type,e.genesis);throw new H0(r)}o(_E,"fromBytes");function oq(r){return Vc(()=>_E(r))}o(oq,"fromBytesNoThrow");function EE(r){let e=Gc(r,"StreamID");if(e.kind==="stream-id")return new it(e.type,e.genesis);throw new z0(r)}o(EE,"fromString");function sq(r){return Vc(()=>EE(r))}o(sq,"fromStringNoThrow");var wE=Symbol.for("@ceramicnetwork/streamid/StreamID"),it=class{constructor(e,t){if(this._tag=wE,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?kn.codeByName(e):e,this._cid=typeof t=="string"?Ye.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===wE}static async fromGenesis(e,t){let n=await Qa({value:t,codec:Yi,hasher:Us});return new it(e,n.cid)}get type(){return this._type}get typeName(){return kn.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=Zg.default.encode(206),t=Zg.default.encode(this.type);return Fi([e,t,this.cid.bytes])}get baseID(){return new it(this._type,this._cid)}equals(e){return it.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return qi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(it,"StreamID");it.fromBytes=_E;it.fromBytesNoThrow=oq;it.fromString=EE;it.fromStringNoThrow=sq;kl([Xn(),Ri("design:type",String),Ri("design:paramtypes",[])],it.prototype,"typeName",null);kl([Xn(),Ri("design:type",Uint8Array),Ri("design:paramtypes",[])],it.prototype,"bytes",null);kl([Xn(),Ri("design:type",it),Ri("design:paramtypes",[])],it.prototype,"baseID",null);kl([Xn(),Ri("design:type",Function),Ri("design:paramtypes",[]),Ri("design:returntype",String)],it.prototype,"toString",null);kl([Xn(),Ri("design:type",Function),Ri("design:paramtypes",[]),Ri("design:returntype",String)],it.prototype,"toUrl",null);var Jc=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},In=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},gs=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)},Wc,yf,Il,j0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${qi.encode(e)}: no commit information provided`)}};o(j0,"InvalidCommitIDBytesError");var K0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(K0,"InvalidCommitIDStringError");function SE(r){let e=vf(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new j0(r)}o(SE,"fromBytes");function aq(r){return Vc(()=>SE(r))}o(aq,"fromBytesNoThrow");function ME(r){let e=Gc(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new K0(r)}o(ME,"fromString");function fq(r){return Vc(()=>ME(r))}o(fq,"fromStringNoThrow");var AE=Symbol.for("@ceramicnetwork/streamid/CommitID");function cq(r,e){return new Pt(r.type,r.cid,e)}o(cq,"make");var Pt=class{constructor(e,t,n=null){if(this._tag=AE,Wc.set(this,void 0),yf.set(this,void 0),Il.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");Qg(this,Wc,typeof e=="string"?kn.codeByName(e):e,"f"),Qg(this,yf,typeof t=="string"?Ye.parse(t):t,"f"),Qg(this,Il,Yg(gs(this,yf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===AE}get baseID(){return new it(gs(this,Wc,"f"),gs(this,yf,"f"))}get type(){return gs(this,Wc,"f")}get typeName(){return kn.nameByCode(gs(this,Wc,"f"))}get cid(){return gs(this,yf,"f")}get commit(){return gs(this,Il,"f")||gs(this,yf,"f")}get bytes(){let e=ev.default.encode(206),t=ev.default.encode(this.type),n=gs(this,Il,"f")?.bytes||new Uint8Array([0]);return Fi([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 qi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Wc=new WeakMap,yf=new WeakMap,Il=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=SE;Pt.fromBytesNoThrow=aq;Pt.fromString=ME;Pt.fromStringNoThrow=fq;Pt.make=cq;Jc([Xn(),In("design:type",it),In("design:paramtypes",[])],Pt.prototype,"baseID",null);Jc([Xn(),In("design:type",String),In("design:paramtypes",[])],Pt.prototype,"typeName",null);Jc([Xn(),In("design:type",Ye),In("design:paramtypes",[])],Pt.prototype,"commit",null);Jc([Xn(),In("design:type",Uint8Array),In("design:paramtypes",[])],Pt.prototype,"bytes",null);Jc([Xn(),In("design:type",Function),In("design:paramtypes",[]),In("design:returntype",String)],Pt.prototype,"toString",null);Jc([Xn(),In("design:type",Function),In("design:paramtypes",[]),In("design:returntype",String)],Pt.prototype,"toUrl",null);ec();var hn;(function(r){function e(i){let s=vf(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new it(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${qi.encode(i)}`)}}o(e,"fromBytes"),r.fromBytes=e;function t(i){let s=Gc(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new it(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(t,"fromString"),r.fromString=t;function n(i){if(it.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})(hn||(hn={}));var tv=o(function(r,e){return tv=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])},tv(r,e)},"extendStatics");function nn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tv(r,e);function t(){this.constructor=r}o(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}o(nn,"__extends");function TE(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(x){try{v(n.next(x))}catch(E){f(E)}}o(u,"fulfilled");function d(x){try{v(n.throw(x))}catch(E){f(E)}}o(d,"rejected");function v(x){x.done?s(x.value):i(x.value).then(u,d)}o(v,"step"),v((n=n.apply(r,e||[])).next())})}o(TE,"__awaiter");function V0(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(v){return function(x){return d([v,x])}}function d(v){if(n)throw new TypeError("Generator is already executing.");for(;f&&(f=0,v[0]&&(t=0)),t;)try{if(n=1,i&&(s=v[0]&2?i.return:v[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,v[1])).done)return s;switch(i=0,s&&(v=[v[0]&2,s.value]),v[0]){case 0:case 1:s=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!s||v[1]>s[0]&&v[1]<s[3])){t.label=v[1];break}if(v[0]===6&&t.label<s[1]){t.label=s[1],s=v;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(v);break}s[2]&&t.ops.pop(),t.trys.pop();continue}v=e.call(r,t)}catch(x){v=[6,x],i=0}finally{n=s=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}o(V0,"__generator");function vs(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(vs,"__values");function Zn(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(Zn,"__read");function to(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(to,"__spreadArray");function xf(r){return this instanceof xf?(this.v=r,this):new xf(r)}o(xf,"__await");function CE(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(B){return new Promise(function(Y,P){s.push([R,B,Y,P])>1||d(R,B)})},I&&(i[R]=I(i[R])))}function d(R,I){try{v(n[R](I))}catch(B){O(s[0][3],B)}}function v(R){R.value instanceof xf?Promise.resolve(R.value.v).then(x,E):O(s[0][2],R)}function x(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(CE,"__asyncGenerator");function kE(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 vs=="function"?vs(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(v){s({value:v,done:u})},f)}}o(kE,"__asyncValues");function Tt(r){return typeof r=="function"}o(Tt,"isFunction");function Yc(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(Yc,"createErrorClass");var G0=Yc(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
818
+ `)}o(lU,"asString");var Pc=class extends ml{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case bl.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Pc,"SiweMessage");Bu();var hU=5*60,RJ=new Date("2022-09-20").valueOf(),gl;(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 qw({bytes:u,codec:Yi,hasher:Us})).value}o(s,"fromBlockBytes"),r.fromBlockBytes=s;async function f(u,d={}){Zb(u);let v=d.verifiers[u.s.t];if(!v)throw new Error("Unsupported CACAO signature type, register the needed verifier");return v(u,d)}o(f,"verify"),r.verify=f})(gl||(gl={}));var vl;(function(r){function e(t){return Qa({value:t,codec:Yi,hasher:Us})}o(e,"fromCacao"),r.fromCacao=e})(vl||(vl={}));function Zb(r){if(r.s===null||r.s===void 0)throw new Error("CACAO does not have a signature")}o(Zb,"assertSigned");function d8(r,e){let t=e.atTime?e.atTime.getTime():Date.now(),n=(e.clockSkewSecs??hU)*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(d8,"verifyTimeChecks");var p8="logger/5.8.0";var m8=!1,b8=!1,u0={debug:1,default:2,info:2,warning:3,error:4,off:5},g8=u0.default,Qb=null;function dU(){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(dU,"_checkNormalize");var v8=dU(),eg;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(eg||(eg={}));var Zi;(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"})(Zi||(Zi={}));var y8="0123456789abcdef",Mt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();u0[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(g8>u0[n])&&console.log.apply(console,t)}debug(...e){this._log(Mt.levels.DEBUG,e)}info(...e){this._log(Mt.levels.INFO,e)}warn(...e){this._log(Mt.levels.WARNING,e)}makeError(e,t,n){if(b8)return this.makeError("censored error",t,{});t||(t=Mt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(d=>{let v=n[d];try{if(v instanceof Uint8Array){let x="";for(let E=0;E<v.length;E++)x+=y8[v[E]>>4],x+=y8[v[E]&15];i.push(d+"=Uint8Array(0x"+x+")")}else i.push(d+"="+JSON.stringify(v))}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 Zi.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 Zi.CALL_EXCEPTION:case Zi.INSUFFICIENT_FUNDS:case Zi.MISSING_NEW:case Zi.NONCE_EXPIRED:case Zi.REPLACEMENT_UNDERPRICED:case Zi.TRANSACTION_REPLACED:case Zi.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,Mt.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"),v8&&this.throwError("platform missing String.prototype.normalize",Mt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:v8})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Mt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Mt.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,Mt.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Mt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",Mt.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",Mt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Mt.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Qb||(Qb=new Mt(p8)),Qb}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Mt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),m8){if(!e)return;this.globalLogger().throwError("error censorship permanent",Mt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}b8=!!e,m8=!!t}static setLogLevel(e){let t=u0[e.toLowerCase()];if(t==null){Mt.globalLogger().warn("invalid log level - "+e);return}g8=t}static from(e){return new Mt(e)}};o(Mt,"Logger");Mt.errors=Zi;Mt.levels=eg;var x8="bytes/5.8.0";var xr=new Mt(x8);function _8(r){return!!r.toHexString}o(_8,"isHexable");function Bc(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Bc(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Bc,"addSlice");function E8(r){return Qi(r)&&!(r.length%2)||rg(r)}o(E8,"isBytesLike");function w8(r){return typeof r=="number"&&r==r&&r%1===0}o(w8,"isInteger");function rg(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!w8(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!w8(t)||t<0||t>=256)return!1}return!0}o(rg,"isBytes");function fr(r,e){if(e||(e={}),typeof r=="number"){xr.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),Bc(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),_8(r)&&(r=r.toHexString()),Qi(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":xr.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 Bc(new Uint8Array(n))}return rg(r)?Bc(new Uint8Array(r)):xr.throwArgumentError("invalid arrayify value","value",r)}o(fr,"arrayify");function ng(r){let e=r.map(i=>fr(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),Bc(n)}o(ng,"concat");function pU(r,e){r=fr(r),r.length>e&&xr.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Bc(t)}o(pU,"zeroPad");function Qi(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Qi,"isHexString");var tg="0123456789abcdef";function tn(r,e){if(e||(e={}),typeof r=="number"){xr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=tg[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),_8(r))return r.toHexString();if(Qi(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":xr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(rg(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=tg[(i&240)>>4]+tg[i&15]}return t}return xr.throwArgumentError("invalid hexlify value","value",r)}o(tn,"hexlify");function l0(r){if(typeof r!="string")r=tn(r);else if(!Qi(r)||r.length%2)return null;return(r.length-2)/2}o(l0,"hexDataLength");function h0(r,e,t){return typeof r!="string"?r=tn(r):(!Qi(r)||r.length%2)&&xr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(h0,"hexDataSlice");function na(r,e){for(typeof r!="string"?r=tn(r):Qi(r)||xr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&xr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(na,"hexZeroPad");function d0(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(E8(r)){let t=fr(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=tn(t.slice(0,32)),e.s=tn(t.slice(32,64))):t.length===65?(e.r=tn(t.slice(0,32)),e.s=tn(t.slice(32,64)),e.v=t[64]):xr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:xr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=tn(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=pU(fr(e._vs),32);e._vs=tn(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&xr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let f=tn(i);e.s==null?e.s=f:e.s!==f&&xr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?xr.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&&xr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Qi(e.r)?xr.throwArgumentError("signature missing or invalid r","signature",r):e.r=na(e.r,32),e.s==null||!Qi(e.s)?xr.throwArgumentError("signature missing or invalid s","signature",r):e.s=na(e.s,32);let t=fr(e.s);t[0]>=128&&xr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=tn(t);e._vs&&(Qi(e._vs)||xr.throwArgumentError("signature invalid _vs","signature",r),e._vs=na(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&xr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(d0,"splitSignature");var M8=Ut(og());var S8="bignumber/5.8.0";var mU=M8.default.BN,jJ=new Mt(S8);function sg(r){return new mU(r,36).toString(16)}o(sg,"_base36To16");var T8=Ut(g1());function Lc(r){return"0x"+T8.default.keccak_256(fr(r))}o(Lc,"keccak256");var C8="address/5.8.0";var yl=new Mt(C8);function k8(r){Qi(r,20)||yl.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=fr(Lc(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(k8,"getChecksumAddress");var vU=9007199254740991;function yU(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(yU,"log10");var ag={};for(let r=0;r<10;r++)ag[String(r)]=String(r);for(let r=0;r<26;r++)ag[String.fromCharCode(65+r)]=String(10+r);var I8=Math.floor(yU(vU));function xU(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>ag[n]).join("");for(;e.length>=I8;){let n=e.substring(0,I8);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(xU,"ibanChecksum");function D8(r){let e=null;if(typeof r!="string"&&yl.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=k8(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&yl.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)!==xU(r)&&yl.throwArgumentError("bad icap checksum","address",r),e=sg(r.substring(4));e.length<40;)e="0"+e;e=k8("0x"+e)}else yl.throwArgumentError("invalid address","address",r);return e}o(D8,"getAddress");var R8="properties/5.8.0";var aY=new Mt(R8);function Uc(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Uc,"defineReadOnly");var O8="strings/5.8.0";var N8=new Mt(O8),xl;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(xl||(xl={}));var cf;(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"})(cf||(cf={}));function wU(r,e,t,n,i){return N8.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(wU,"errorFunc");function P8(r,e,t,n,i){if(r===cf.BAD_PREFIX||r===cf.UNEXPECTED_CONTINUE){let s=0;for(let f=e+1;f<t.length&&t[f]>>6===2;f++)s++;return s}return r===cf.OVERRUN?t.length-e-1:0}o(P8,"ignoreFunc");function _U(r,e,t,n,i){return r===cf.OVERLONG?(n.push(i),0):(n.push(65533),P8(r,e,t,n,i))}o(_U,"replaceFunc");var EU=Object.freeze({error:wU,ignore:P8,replace:_U});function wl(r,e=xl.current){e!=xl.current&&(N8.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 fr(t)}o(wl,"toUtf8Bytes");var B8=`Ethereum Signed Message:
819
+ `;function fg(r){return typeof r=="string"&&(r=wl(r)),Lc(ng([wl(B8),wl(String(r.length)),r]))}o(fg,"hashMessage");var vt=Ut(og()),ko=Ut(ju());function Fc(r,e,t){return t={path:e,exports:{},require:function(n,i){return AU(n,i??t.path)}},r(t,t.exports),t.exports}o(Fc,"createCommonjsModule");function AU(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(AU,"commonjsRequire");var hg=U8;function U8(r,e){if(!r)throw new Error(e||"Assertion failed")}o(U8,"assert");U8.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var eo=Fc(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 v=0;v<f.length;v++)d[v]=f[v]|0;return d}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var v=0;v<f.length;v+=2)d.push(parseInt(f[v]+f[v+1],16))}else for(var v=0;v<f.length;v++){var x=f.charCodeAt(v),E=x>>8,O=x&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")}),Yn=Fc(function(r,e){"use strict";var t=e;t.assert=hg,t.toArray=eo.toArray,t.zero2=eo.zero2,t.toHex=eo.toHex,t.encode=eo.encode;function n(d,v,x){var E=new Array(Math.max(d.bitLength(),x)+1),O;for(O=0;O<E.length;O+=1)E[O]=0;var R=1<<v+1,I=d.clone();for(O=0;O<E.length;O++){var B,Y=I.andln(R-1);I.isOdd()?(Y>(R>>1)-1?B=(R>>1)-Y:B=Y,I.isubn(B)):B=0,E[O]=B,I.iushrn(1)}return E}o(n,"getNAF"),t.getNAF=n;function i(d,v){var x=[[],[]];d=d.clone(),v=v.clone();for(var E=0,O=0,R;d.cmpn(-E)>0||v.cmpn(-O)>0;){var I=d.andln(3)+E&3,B=v.andln(3)+O&3;I===3&&(I=-1),B===3&&(B=-1);var Y;(I&1)===0?Y=0:(R=d.andln(7)+E&7,(R===3||R===5)&&B===2?Y=-I:Y=I),x[0].push(Y);var P;(B&1)===0?P=0:(R=v.andln(7)+O&7,(R===3||R===5)&&I===2?P=-B:P=B),x[1].push(P),2*E===Y+1&&(E=1-E),2*O===P+1&&(O=1-O),d.iushrn(1),v.iushrn(1)}return x}o(i,"getJSF"),t.getJSF=i;function s(d,v,x){var E="_"+v;d.prototype[v]=o(function(){return this[E]!==void 0?this[E]:this[E]=x.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 vt.default(d,"hex","le")}o(u,"intFromLE"),t.intFromLE=u}),b0=Yn.getNAF,SU=Yn.getJSF,g0=Yn.assert;function oa(r,e){this.type=r,this.p=new vt.default(e.p,16),this.red=e.prime?vt.default.red(e.prime):vt.default.mont(this.p),this.zero=new vt.default(0).toRed(this.red),this.one=new vt.default(1).toRed(this.red),this.two=new vt.default(2).toRed(this.red),this.n=e.n&&new vt.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(oa,"BaseCurve");var lf=oa;oa.prototype.point=o(function(){throw new Error("Not implemented")},"point");oa.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");oa.prototype._fixedNafMul=o(function(e,t){g0(e.precomputed);var n=e._getDoubles(),i=b0(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 v=u+n.step-1;v>=u;v--)d=(d<<1)+i[v];f.push(d)}for(var x=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()));x=x.add(E)}return x.toP()},"_fixedNafMul");oa.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=b0(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var v=0;d>=0&&f[d]===0;d--)v++;if(d>=0&&v++,u=u.dblp(v),d<0)break;var x=f[d];g0(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(s[x-1>>1]):u=u.mixedAdd(s[-x-1>>1].neg()):x>0?u=u.add(s[x-1>>1]):u=u.add(s[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");oa.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,v=0,x,E,O;for(x=0;x<i;x++){O=t[x];var R=O._getNAFPoints(e);f[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var I=x-1,B=x;if(f[I]!==1||f[B]!==1){d[I]=b0(n[I],f[I],this._bitLength),d[B]=b0(n[B],f[B],this._bitLength),v=Math.max(d[I].length,v),v=Math.max(d[B].length,v);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=SU(n[I],n[B]);for(v=Math.max(J[0].length,v),d[I]=new Array(v),d[B]=new Array(v),E=0;E<v;E++){var ee=J[0][E]|0,X=J[1][E]|0;d[I][E]=P[(ee+1)*3+(X+1)],d[B][E]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var z=!0;for(E=0;E<i;E++)V[E]=d[E][x]|0,V[E]!==0&&(z=!1);if(!z)break;H++,x--}if(x>=0&&H++,ne=ne.dblp(H),x<0)break;for(E=0;E<i;E++){var he=V[E];he!==0&&(he>0?O=u[E][he-1>>1]:he<0&&(O=u[E][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(x=0;x<i;x++)u[x]=null;return s?ne:ne.toP()},"_wnafMulAdd");function Ii(r,e){this.curve=r,this.type=e,this.precomputed=null}o(Ii,"BasePoint");oa.BasePoint=Ii;Ii.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");Ii.prototype.validate=o(function(){return this.curve.validate(this)},"validate");oa.prototype.decodePoint=o(function(e,t){e=Yn.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?g0(e[e.length-1]%2===0):e[0]===7&&g0(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");Ii.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");Ii.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");Ii.prototype.encode=o(function(e,t){return Yn.encode(this._encode(t),e)},"encode");Ii.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");Ii.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");Ii.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");Ii.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");Ii.prototype._getBeta=o(function(){return null},"_getBeta");Ii.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var dg=Fc(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")}),MU=Yn.assert;function Di(r){lf.call(this,"short",r),this.a=new vt.default(r.a,16).toRed(this.red),this.b=new vt.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(Di,"ShortCurve");dg(Di,lf);var TU=Di;Di.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 vt.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 vt.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],MU(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 vt.default(u.a,16),b:new vt.default(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");Di.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:vt.default.mont(e),n=new vt.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new vt.default(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");Di.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 vt.default(1),f=new vt.default(0),u=new vt.default(0),d=new vt.default(1),v,x,E,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var X=d.sub(ee.mul(f));if(!E&&P.cmp(t)<0)v=B.neg(),x=s,E=P.neg(),O=J;else if(E&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=X}R=P.neg(),I=J;var ne=E.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=v,I=x),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");Di.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),v=s.mul(n.b),x=f.mul(i.b),E=e.sub(u).sub(d),O=v.add(x).neg();return{k1:E,k2:O}},"_endoSplit");Di.prototype.pointFromX=o(function(e,t){e=new vt.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");Di.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");Di.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],v=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[f*2]=d,i[f*2+1]=v,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,s,f*2,n),E=0;E<f*2;E++)i[E]=null,s[E]=null;return x},"_endoWnafMulAdd");function Br(r,e,t,n){lf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new vt.default(e,16),this.y=new vt.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(Br,"Point");dg(Br,lf.BasePoint);Di.prototype.point=o(function(e,t,n){return new Br(this,e,t,n)},"point");Di.prototype.pointFromJSON=o(function(e,t){return Br.fromJSON(this,e,t)},"pointFromJSON");Br.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");Br.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");Br.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");Br.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");Br.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Br.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");Br.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");Br.prototype.getX=o(function(){return this.x.fromRed()},"getX");Br.prototype.getY=o(function(){return this.y.fromRed()},"getY");Br.prototype.mul=o(function(e){return e=new vt.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");Br.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");Br.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");Br.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");Br.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");Br.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 jr(r,e,t,n){lf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt.default(0)):(this.x=new vt.default(e,16),this.y=new vt.default(t,16),this.z=new vt.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(jr,"JPoint");dg(jr,lf.BasePoint);Di.prototype.jpoint=o(function(e,t,n){return new jr(this,e,t,n)},"jpoint");jr.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");jr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");jr.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),v=f.redSub(u);if(d.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=d.redSqr(),E=x.redMul(d),O=i.redMul(x),R=v.redSqr().redIAdd(E).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(f.redMul(E)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");jr.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 v=u.redSqr(),x=v.redMul(u),E=n.redMul(v),O=d.redSqr().redIAdd(x).redISub(E).redISub(E),R=d.redMul(E.redISub(O)).redISub(s.redMul(x)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");jr.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,v=d.redSqr().redSqr(),x=u.redAdd(u);for(t=0;t<e;t++){var E=f.redSqr(),O=x.redSqr(),R=O.redSqr(),I=E.redAdd(E).redIAdd(E).redIAdd(i.redMul(v)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=x.redMul(d);t+1<e&&(v=v.redMul(R)),f=Y,d=ee,x=J}return this.curve.jpoint(f,x.redMul(s),d)},"dblp");jr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");jr.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),v=d.redSqr().redISub(u).redISub(u),x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),e=v,t=d.redMul(u.redISub(v)).redISub(x),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 B=E.redAdd(E).redIAdd(E),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");jr.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),v=d.redSqr().redISub(u).redISub(u);e=v;var x=f.redIAdd(f);x=x.redIAdd(x),x=x.redIAdd(x),t=d.redMul(u.redISub(v)).redISub(x),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 B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(E);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");jr.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)),v=t.redAdd(t);v=v.redIAdd(v);var x=v.redMul(u),E=d.redSqr().redISub(x.redAdd(x)),O=x.redISub(E),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(E,I,B)},"_dbl");jr.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(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(v),E=t.redMul(x);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(x.redMul(v.redISub(x)).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");jr.prototype.mul=o(function(e,t){return e=new vt.default(e,t),this.curve._wnafMul(this,e)},"mul");jr.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");jr.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");jr.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");jr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var p0=Fc(function(r,e){"use strict";var t=e;t.base=lf,t.short=TU,t.mont=null,t.edwards=null}),m0=Fc(function(r,e){"use strict";var t=e,n=Yn.assert;function i(u){u.type==="short"?this.curve=new p0.short(u):u.type==="edwards"?this.curve=new p0.edwards(u):this.curve=new p0.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 v=new i(d);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:v}),v}})}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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function ia(r){if(!(this instanceof ia))return new ia(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=eo.toArray(r.entropy,r.entropyEnc||"hex"),t=eo.toArray(r.nonce,r.nonceEnc||"hex"),n=eo.toArray(r.pers,r.persEnc||"hex");hg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(ia,"HmacDRBG");var F8=ia;ia.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");ia.prototype._hmac=o(function(){return new ko.default.hmac(this.hash,this.K)},"hmac");ia.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");ia.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=eo.toArray(e,t),n=eo.toArray(n,i),hg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");ia.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=eo.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++,eo.encode(f,t)},"generate");var lg=Yn.assert;function rn(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(rn,"KeyPair");var pg=rn;rn.fromPublic=o(function(e,t,n){return t instanceof rn?t:new rn(e,{pub:t,pubEnc:n})},"fromPublic");rn.fromPrivate=o(function(e,t,n){return t instanceof rn?t:new rn(e,{priv:t,privEnc:n})},"fromPrivate");rn.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");rn.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");rn.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");rn.prototype._importPrivate=o(function(e,t){this.priv=new vt.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");rn.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?lg(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&lg(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");rn.prototype.derive=o(function(e){return e.validate()||lg(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");rn.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");rn.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");rn.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var CU=Yn.assert;function v0(r,e){if(r instanceof v0)return r;this._importDER(r,e)||(CU(r.r&&r.s,"Signature without r or s"),this.r=new vt.default(r.r,16),this.s=new vt.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(v0,"Signature");var y0=v0;function kU(){this.place=0}o(kU,"Position");function cg(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(cg,"getLength");function L8(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(L8,"rmPadding");v0.prototype._importDER=o(function(e,t){e=Yn.toArray(e,t);var n=new kU;if(e[n.place++]!==48)return!1;var i=cg(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=cg(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=cg(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 vt.default(f),this.s=new vt.default(d),this.recoveryParam=null,!0},"_importDER");function ug(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(ug,"constructLength");v0.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=L8(t),n=L8(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];ug(i,t.length),i=i.concat(t),i.push(2),ug(i,n.length);var s=i.concat(n),f=[48];return ug(f,s.length),f=f.concat(s),Yn.encode(f,e)},"toDER");var IU=o(function(){throw new Error("unsupported")},"rand"),uf=Yn.assert;function ki(r){if(!(this instanceof ki))return new ki(r);typeof r=="string"&&(uf(Object.prototype.hasOwnProperty.call(m0,r),"Unknown curve "+r),r=m0[r]),r instanceof m0.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(ki,"EC");var DU=ki;ki.prototype.keyPair=o(function(e){return new pg(this,e)},"keyPair");ki.prototype.keyFromPrivate=o(function(e,t){return pg.fromPrivate(this,e,t)},"keyFromPrivate");ki.prototype.keyFromPublic=o(function(e,t){return pg.fromPublic(this,e,t)},"keyFromPublic");ki.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new F8({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||IU(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new vt.default(2));;){var s=new vt.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");ki.prototype._truncateToN=o(function(e,t,n){var i;if(vt.default.isBN(e)||typeof e=="number")e=new vt.default(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new vt.default(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new vt.default(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");ki.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!vt.default.isBN(e)){uf(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),uf(e.length>>>0===e.length);for(var s=0;s<e.length;s++)uf((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),uf(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);uf(new vt.default(d).eq(e),"Can not sign message");for(var v=new F8({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),x=this.n.sub(new vt.default(1)),E=0;;E++){var O=i.k?i.k(E):new vt.default(v.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(x)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new y0({r:B,s:Y,recoveryParam:P})}}}}}},"sign");ki.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new y0(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),v=d.mul(e).umod(this.n),x=d.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(v,n.getPublic(),x),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)},"verify");ki.prototype.recoverPubKey=function(r,e,t,n){uf((3&t)===t,"The recovery param is more than two bits"),e=new y0(e,n);var i=this.n,s=new vt.default(r),f=e.r,u=e.s,d=t&1,v=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var x=e.r.invm(i),E=i.sub(s).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(E,f,O)};ki.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new y0(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 RU=Fc(function(r,e){"use strict";var t=e;t.version="6.6.1",t.utils=Yn,t.rand=function(){throw new Error("unsupported")},t.curve=p0,t.curves=m0,t.ec=DU,t.eddsa=null}),$8=RU.ec;var q8="signing-key/5.8.0";var bg=new Mt(q8),mg=null;function Io(){return mg||(mg=new $8("secp256k1")),mg}o(Io,"getCurve");var x0=class{constructor(e){Uc(this,"curve","secp256k1"),Uc(this,"privateKey",tn(e)),l0(this.privateKey)!==32&&bg.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Io().keyFromPrivate(fr(this.privateKey));Uc(this,"publicKey","0x"+t.getPublic(!1,"hex")),Uc(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Uc(this,"_isSigningKey",!0)}_addPoint(e){let t=Io().keyFromPublic(fr(this.publicKey)),n=Io().keyFromPublic(fr(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=fr(e);n.length!==32&&bg.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return d0({recoveryParam:i.recoveryParam,r:na("0x"+i.r.toString(16),32),s:na("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=Io().keyFromPublic(fr(gg(e)));return na("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(x0,"SigningKey");function H8(r,e){let t=d0(e),n={r:fr(t.r),s:fr(t.s)};return"0x"+Io().recoverPubKey(fr(r),n,t.recoveryParam).encode("hex",!1)}o(H8,"recoverPublicKey");function gg(r,e){let t=fr(r);if(t.length===32){let n=new x0(t);return e?"0x"+Io().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?tn(t):"0x"+Io().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+Io().keyFromPublic(t).getPublic(!0,"hex"):tn(t)}return bg.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(gg,"computePublicKey");var z8="transactions/5.8.0";var qY=new Mt(z8),j8;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(j8||(j8={}));function K8(r){let e=gg(r);return D8(h0(Lc(h0(e,1)),12))}o(K8,"computeAddress");function V8(r,e){return K8(H8(fr(r),e))}o(V8,"recoverAddress");var G8="wallet/5.8.0";var YY=new Mt(G8);function vg(r,e){return V8(fg(r),e)}o(vg,"verifyMessage");function W8(){return{eip191:async(r,e)=>{NU(r,e)}}}o(W8,"getEIP191Verifier");var OU=new Date("2022-09-20").valueOf();function NU(r,e){Zb(r),d8(r,e);let n=[vg(Pc.fromCacao(r).toMessage(),r.s.s).toLowerCase()];if(Date.parse(r.p.iat)<=OU){let s=vg(h8(Pc.fromCacao(r),"Ethereum"),r.s.s).toLowerCase();n.push(s)}let i=ra.parse(r.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(NU,"verifyEIP191Signature");nc();od();var J8=Ut(Ga(),1);nc();function Y8(){return Dt((0,J8.randomBytes)(16),"base64")}o(Y8,"randomString");var X8="base64pad",Z8="base64url";function Q8(r){return Dt(r,X8)}o(Q8,"encodeBase64");function e_(r){return Dt(r,Z8)}o(e_,"encodeBase64Url");function t_(r){return Ft(r,X8)}o(t_,"decodeBase64");function w0(r){return JSON.parse(Dt(Ft(r,Z8)))}o(w0,"base64urlToJSON");function r_(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(r_,"fromDagJWS");function n_(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(n_,"didWithTime");function i_(r){return r?Array.isArray(r)?r:[r]:[]}o(i_,"extractControllers");var PU={...W8()};function BU(r){return"registry"in r&&"cache"in r}o(BU,"isResolver");var hf=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 hf({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Mc(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=BU(e)?e:new Iu(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=Y8(),s=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:f}=await this.verifyJWS(s),u=w0(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 vl.fromCacao(this._capability),f=Ye.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 W4(e),s=e_(n.bytes);Object.assign(t,{linkedBlock:Q8(i)});let f=await this.createJWS(s,t),u=Ye.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 vl.fromCacao(this._capability);return{jws:f,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:f,linkedBlock:i}}async verifyJWS(e,t={}){t=Object.assign({verifiers:PU},t),typeof e!="string"&&(e=r_(e));let n=w0(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!t.disableTimecheck){let v=i.didDocumentMetadata?.nextUpdate;if(v){let E=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,O=new Date(v).valueOf()+E;if(!(t.atTime&&t.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let x=i.didDocumentMetadata?.updated;if(x&&t.atTime&&t.atTime.getTime()<new Date(x).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 gl.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 v=n_(t.issuer,t.atTime),E=(await this.resolve(v)).didDocument?.controller,O=i_(E);if(t.capability?.s&&t.capability.p.aud===f&&O.includes(t.capability.p.iss))await gl.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||[];Pw(e,u);let d;try{d=w0(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,t,n={}){let i=await Uw(t,this._resolver);return Lw(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,t,n={}){let i=await J4(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 t_(n)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return Y4(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 Mc(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(hf,"DID");function o_(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(o_,"toUint8Array");var kg=Ut(_l(),1);Jh();var wg={};Xt(wg,{keyToDidDoc:()=>YU});function YU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:Dt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(YU,"keyToDidDoc");var _g={};Xt(_g,{keyToDidDoc:()=>ZU});nc();var m_=Ut(Rd(),1);function XU(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${Dt(e,"base58btc")}`}o(XU,"encodeKey");function ZU(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=(0,m_.convertPublicKeyToX25519)(r),s=`${t}#${XU(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:Dt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:Dt(i,"base58btc")}]}}o(ZU,"keyToDidDoc");var Mg={};Xt(Mg,{keyToDidDoc:()=>cF,pubKeyBytesToXY:()=>y_});var E0={};Xt(E0,{ECPointDecompress:()=>sF});function QU(r){return r>=0?r:-r}o(QU,"n");function eF(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,v=n-s*f;e=r,r=u,t=i,n=s,i=d,s=v}return{g:e,x:t,y:n}}o(eF,"r");function _0(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(_0,"e");function b_(r,e){let t=eF(_0(r,e),e);if(t.g!==1n)throw new RangeError(`${r.toString()} does not have inverse modulo ${e.toString()}`);return _0(t.x,e)}o(b_,"o");function tF(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 _0(i+u*b_(u,s)%n*r[f]%n,n)},0n)}o(tF,"i");function rF(r){return r.map(e=>e[0]**(e[1]-1n)*(e[0]-1n)).reduce((e,t)=>t*e,1n)}o(rF,"a");function sa(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=_0(r,t),e<0n)return b_(sa(r,QU(e),t,n),t);if(n!==void 0)return function(s,f,u,d){let v=d.map(O=>O[0]**O[1]),x=d.map(O=>rF([O])),E=x.map((O,R)=>sa(s,f%O,v[R]));return tF(E,v,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(sa,"s");var wr={};Xt(wr,{pubKeyBytesToHex:()=>nF,publicKeyHexToUint8ArrayPointPair:()=>g_,publicKeyIntToUint8ArrayPointPair:()=>v_,publicKeyIntToXY:()=>oF,publicKeyToXY:()=>iF,testHexString:()=>Ag,testUint8Array:()=>aa});Yh();function nF(r){if(!aa(r))throw new TypeError("input must be a Uint8Array");return Dt(r,"base16")}o(nF,"pubKeyBytesToHex");function iF(r){if(!Ag(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=g_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(iF,"publicKeyToXY");function g_(r){if(!Ag(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=Ft(e,"base16"),i=Ft(t,"base16");return{xOctet:n,yOctet:i}}o(g_,"publicKeyHexToUint8ArrayPointPair");function Ag(r){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(r)!==null&&e.test(r)&&typeof r=="string")}o(Ag,"testHexString");function aa(r){return r==null?!1:r.constructor===Uint8Array}o(aa,"testUint8Array");function oF(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=v_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(oF,"publicKeyIntToXY");function v_(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=Ft(e,"base10"),i=Ft(t,"base10");return{xOctet:n,yOctet:i}}o(v_,"publicKeyIntToUint8ArrayPointPair");function sF(r){if(!aa(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(Dt(f,"base10")),d=u**3n-u*3n+n,v=sa(d,i,t);return v%2n!==s&&(v=t-v),{x:u,y:v}}o(sF,"ECPointDecompress");var A0={};Xt(A0,{ECPointDecompress:()=>aF});function aF(r){if(!aa(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(Dt(f,"base10")),d=u**3n-u*3n+n,v=sa(d,i,t);return v%2n!==s&&(v=t-v),{x:u,y:v}}o(aF,"ECPointDecompress");var S0={};Xt(S0,{ECPointDecompress:()=>fF});function fF(r){if(!aa(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(Dt(f,"base10")),d=u**3n-u*3n+n,v=sa(d,i,t);return v%2n!==s&&(v=t-v),{x:u,y:v}}o(fF,"ECPointDecompress");function cF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=y_(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(cF,"keyToDidDoc");function y_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==64)return wr.publicKeyToXY(e);if(t==65&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ft(e,"base16"),i=E0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(y_,"pubKeyBytesToXY");var Tg={};Xt(Tg,{keyToDidDoc:()=>uF,pubKeyBytesToXY:()=>x_});function uF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=x_(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(uF,"keyToDidDoc");function x_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==96)return wr.publicKeyToXY(e);if(t==97&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ft(e,"base16"),i=A0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(x_,"pubKeyBytesToXY");var Cg={};Xt(Cg,{keyToDidDoc:()=>lF,pubKeyBytesToXY:()=>w_});function lF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=w_(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(lF,"keyToDidDoc");function w_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let t=Ft(e,"base16"),n=S0.ECPointDecompress(t);return wr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(w_,"pubKeyBytesToXY");var hF="application/did+ld+json",__="application/did+json",dF={231:wg,237:_g,4608:Mg,4609:Tg,4610:Cg};function pF(){return{key:async(r,e,t,n)=>{let i=n.accept||__,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let f=vi.decode(e.id),u=kg.default.decode(f),d=f.slice(kg.default.decode.bytes),v=await dF[u].keyToDidDoc(d,e.id);i===hF?(v["@context"]="https://w3id.org/did/v1",s.didDocument=v):i===__?s.didDocument=v:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(f){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=f.toString()}return s}}}o(pF,"getResolver");var E_={getResolver:pF};var M0=Ut(Rd(),1);var k_=Ut(S_(),1);var mF="base64pad";function M_(r){return JSON.parse((0,k_.default)(r))}o(M_,"toStableObject");function bF(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${Dt(e,"base58btc")}`}o(bF,"encodeDID");function T_(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(T_,"toGeneralJWS");var C_=o(async(r,e,t,n={})=>{let i=`${e}#${e.split(":")[2]}`,s=Iw(t),f=M_(Object.assign(n,{kid:i,alg:"EdDSA"}));return Nw(typeof r=="string"?r:M_(r),s,f)},"sign"),gF={did_authenticate:async({did:r,secretKey:e},t)=>{let n=await C_({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return T_(n)},did_createJWS:async({did:r,secretKey:e},t)=>{if(t.did.split("#")[0]!==r)throw new Mn(4100,`Unknown DID: ${r}`);let i=await C_(t.payload,r,e,t.protected);return{jws:T_(i)}},did_decryptJWE:async({secretKey:r},e)=>{let t=$w((0,M0.convertSecretKeyToX25519)(r));try{let n=await Bw(e.jwe,t);return{cleartext:Dt(n,mF)}}catch(n){throw new Mn(-32e3,n.message)}}},El=class{constructor(e){let{secretKey:t,publicKey:n}=(0,M0.generateKeyPairFromSeed)(e),i=bF(n),s=n5(gF);this._handle=async f=>await s({did:i,secretKey:t},f)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(El,"Ed25519Provider");var Ig={};Xt(Ig,{JsonPatchError:()=>br,_areEquals:()=>Ml,applyOperation:()=>df,applyPatch:()=>O0,applyReducer:()=>_F,deepClone:()=>xF,getValueByPointer:()=>D0,validate:()=>D_,validator:()=>R0});var vF=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)}}(),yF=Object.prototype.hasOwnProperty;function C0(r,e){return yF.call(r,e)}o(C0,"hasOwnProperty");function k0(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)C0(r,i)&&n.push(i);return n}o(k0,"_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 I0(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(I0,"isInteger");function Do(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(Do,"escapePathComponent");function Al(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Al,"unescapePathComponent");function T0(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(T0(r[e]))return!0}else if(typeof r=="object"){for(var n=k0(r),i=n.length,s=0;s<i;s++)if(T0(r[n[s]]))return!0}}return!1}o(T0,"hasUndefined");function I_(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(`
820
+ `)}o(I_,"patchErrorMessageFormatter");var Sl=function(r){vF(e,r);function e(t,n,i,s,f){var u=this.constructor,d=r.call(this,I_(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=I_(t,{name:n,index:i,operation:s,tree:f}),d}return o(e,"PatchError"),e}(Error);var br=Sl,xF=Kr,$c={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=D0(t,this.path);n&&(n=Kr(n));var i=df(t,{op:"remove",path:this.from}).removed;return df(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=D0(t,this.from);return df(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}}},wF={add:function(r,e,t){return I0(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:$c.move,copy:$c.copy,test:$c.test,_get:$c._get};function D0(r,e){if(e=="")return r;var t={op:"_get",path:e};return df(r,t),t.value}o(D0,"getValueByPointer");function df(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):R0(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=D0(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 br("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 br("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("/"),v=r,x=1,E=d.length,O=void 0,R=void 0,I=void 0;for(typeof t=="function"?I=t:I=R0;;){if(R=d[x],R&&R.indexOf("~")!=-1&&(R=Al(R)),i&&(R=="__proto__"||R=="prototype"&&x>0&&d[x-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&&(v[R]===void 0?O=d.slice(0,x).join("/"):x==E-1&&(O=e.path),O!==void 0&&I(e,0,r,O)),x++,Array.isArray(v)){if(R==="-")R=v.length;else{if(t&&!I0(R))throw new br("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);I0(R)&&(R=~~R)}if(x>=E){if(t&&e.op==="add"&&R>v.length)throw new br("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=wF[e.op].call(e,v,R,r);if(f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}}else if(x>=E){var f=$c[e.op].call(e,v,R,r);if(f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}if(v=v[R],t&&x<E&&(!v||typeof v!="object"))throw new br("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(df,"applyOperation");function O0(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new br("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]=df(r,e[f],t,!0,i,f),r=s[f].newDocument;return s.newDocument=r,s}o(O0,"applyPatch");function _F(r,e,t){var n=df(r,e);if(n.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(_F,"applyReducer");function R0(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new br("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if($c[r.op]){if(typeof r.path!="string")throw new br("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new br('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 br("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 br("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")&&T0(r.value))throw new br("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 br("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 br("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=D_([f],t);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new br("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new br("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(R0,"validator");function D_(r,e,t){try{if(!Array.isArray(r))throw new br("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)O0(Kr(e),Kr(r),t||!0);else{t=t||R0;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof br)return i;throw i}}o(D_,"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 Ng={};Xt(Ng,{compare:()=>IF,generate:()=>Dg,observe:()=>kF,unobserve:()=>CF});var Rg=new WeakMap,EF=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),AF=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function SF(r){return Rg.get(r)}o(SF,"getMirror");function MF(r,e){return r.observers.get(e)}o(MF,"getObserverFromMirror");function TF(r,e){r.observers.delete(e.callback)}o(TF,"removeObserverFromMirror");function CF(r,e){e.unobserve()}o(CF,"unobserve");function kF(r,e){var t=[],n,i=SF(r);if(!i)i=new EF(r),Rg.set(r,i);else{var s=MF(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(){Dg(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(){Dg(n),clearTimeout(n.next),TF(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 AF(e,n)),n}o(kF,"observe");function Dg(r,e){e===void 0&&(e=!1);var t=Rg.get(r.object);Og(t.value,r.object,r.patches,"",e),r.patches.length&&O0(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(Dg,"generate");function Og(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=k0(e),f=k0(r),u=!1,d=!1,v=f.length-1;v>=0;v--){var x=f[v],E=r[x];if(C0(e,x)&&!(e[x]===void 0&&E!==void 0&&Array.isArray(e)===!1)){var O=e[x];typeof E=="object"&&E!=null&&typeof O=="object"&&O!=null&&Array.isArray(E)===Array.isArray(O)?Og(E,O,t,n+"/"+Do(x),i):E!==O&&(u=!0,i&&t.push({op:"test",path:n+"/"+Do(x),value:Kr(E)}),t.push({op:"replace",path:n+"/"+Do(x),value:Kr(O)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+Do(x),value:Kr(E)}),t.push({op:"remove",path:n+"/"+Do(x)}),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 v=0;v<s.length;v++){var x=s[v];!C0(r,x)&&e[x]!==void 0&&t.push({op:"add",path:n+"/"+Do(x),value:Kr(e[x])})}}}o(Og,"_generate");function IF(r,e,t){t===void 0&&(t=!1);var n=[];return Og(r,e,n,"",t),n}o(IF,"compare");var N0=Object.assign({},Ig,Ng,{JsonPatchError:Sl,deepClone:Kr,escapePathComponent:Do,unescapePathComponent:Al});var y9=Ut(Kc(),1);var x9=Ut(Ga(),1);var _r;(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={}));var bv=Ut(Kc(),1);Hi();ec();var yE={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function iq(r){let e=yE[r];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${r}`)}o(iq,"codeByName");function oq(r){let e=Object.entries(yE).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(oq,"nameByCode");var kn=class{};o(kn,"StreamType");kn.nameByCode=oq;kn.codeByName=iq;var rv=Ut(_l(),1);function Xn(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=xE(f.value,e,t,n);else if(f.get!=null)f.get=xE(f.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(Xn,"Memoize");var Jg=new Map;function xE(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)Jg.has(d)?Jg.get(d).push(u):Jg.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 v=`${d}__timestamp`,x=!1;if(t>0)if(!u.has(v))x=!0;else{let E=u.get(v);x=Date.now()-E>t}u.has(d)&&!x?f=u.get(d):(f=r.apply(this,s),u.set(d,f),t>0&&u.set(v,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(xE,"getNewFunction");Hi();ec();Bu();var ev=Ut(_l(),1);function Vc(r){try{return r()}catch(e){return e}}o(Vc,"tryCatch");Hi();var Yg=Ut(_l(),1);Fa();function gf(r){let e=Yg.default.decode(r),t=Yg.default.decode.bytes,n=r.subarray(t);return[e,n,t]}o(gf,"readVarint");function sq(r){return r===0||r===1}o(sq,"isCidVersion");function Xg(r){let[e,t]=gf(r);if(!sq(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=gf(t),[,s,f]=gf(i),[u,,d]=gf(s),v=i.subarray(0,f+d+u),x=i.subarray(f+d+u);return[Ye.create(e,n,Qh(v)),x]}o(Xg,"readCid");Hi();ec();function vf(r,e="StreamRef"){let[t,n]=gf(r);if(t!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,s]=gf(n),f=Xg(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[v]=Xg(d);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(vf,"fromBytes");var aq=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Gc(r,e="StreamRef"){let t=aq.exec(r)||[],n=t[2];if(!n)throw new Error(`Malformed ${e} string: ${r}`);let i=qi.decode(n),s=vf(i),f=t[4];return f?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Zg(s.genesis,f)}:s}o(Gc,"fromString");function fq(r){try{return typeof r=="string"?Ye.parse(r):Ye.asCID(r)}catch{return null}}o(fq,"parseCID");function Zg(r,e=null){if(!e||e==="0")return null;let t=fq(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(Zg,"parseCommit");var Il=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},Ri=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},z0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${qi.encode(e)}: contains commit`)}};o(z0,"InvalidStreamIDBytesError");var j0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(j0,"InvalidStreamIDStringError");function EE(r){let e=vf(r,"StreamID");if(e.kind==="stream-id")return new it(e.type,e.genesis);throw new z0(r)}o(EE,"fromBytes");function cq(r){return Vc(()=>EE(r))}o(cq,"fromBytesNoThrow");function AE(r){let e=Gc(r,"StreamID");if(e.kind==="stream-id")return new it(e.type,e.genesis);throw new j0(r)}o(AE,"fromString");function uq(r){return Vc(()=>AE(r))}o(uq,"fromStringNoThrow");var _E=Symbol.for("@ceramicnetwork/streamid/StreamID"),it=class{constructor(e,t){if(this._tag=_E,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?kn.codeByName(e):e,this._cid=typeof t=="string"?Ye.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===_E}static async fromGenesis(e,t){let n=await Qa({value:t,codec:Yi,hasher:Us});return new it(e,n.cid)}get type(){return this._type}get typeName(){return kn.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=ev.default.encode(206),t=ev.default.encode(this.type);return Fi([e,t,this.cid.bytes])}get baseID(){return new it(this._type,this._cid)}equals(e){return it.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return qi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(it,"StreamID");it.fromBytes=EE;it.fromBytesNoThrow=cq;it.fromString=AE;it.fromStringNoThrow=uq;Il([Xn(),Ri("design:type",String),Ri("design:paramtypes",[])],it.prototype,"typeName",null);Il([Xn(),Ri("design:type",Uint8Array),Ri("design:paramtypes",[])],it.prototype,"bytes",null);Il([Xn(),Ri("design:type",it),Ri("design:paramtypes",[])],it.prototype,"baseID",null);Il([Xn(),Ri("design:type",Function),Ri("design:paramtypes",[]),Ri("design:returntype",String)],it.prototype,"toString",null);Il([Xn(),Ri("design:type",Function),Ri("design:paramtypes",[]),Ri("design:returntype",String)],it.prototype,"toUrl",null);var Jc=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},In=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},tv=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},gs=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)},Wc,yf,Dl,K0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${qi.encode(e)}: no commit information provided`)}};o(K0,"InvalidCommitIDBytesError");var V0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(V0,"InvalidCommitIDStringError");function ME(r){let e=vf(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new K0(r)}o(ME,"fromBytes");function lq(r){return Vc(()=>ME(r))}o(lq,"fromBytesNoThrow");function TE(r){let e=Gc(r,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new V0(r)}o(TE,"fromString");function hq(r){return Vc(()=>TE(r))}o(hq,"fromStringNoThrow");var SE=Symbol.for("@ceramicnetwork/streamid/CommitID");function dq(r,e){return new Pt(r.type,r.cid,e)}o(dq,"make");var Pt=class{constructor(e,t,n=null){if(this._tag=SE,Wc.set(this,void 0),yf.set(this,void 0),Dl.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");tv(this,Wc,typeof e=="string"?kn.codeByName(e):e,"f"),tv(this,yf,typeof t=="string"?Ye.parse(t):t,"f"),tv(this,Dl,Zg(gs(this,yf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===SE}get baseID(){return new it(gs(this,Wc,"f"),gs(this,yf,"f"))}get type(){return gs(this,Wc,"f")}get typeName(){return kn.nameByCode(gs(this,Wc,"f"))}get cid(){return gs(this,yf,"f")}get commit(){return gs(this,Dl,"f")||gs(this,yf,"f")}get bytes(){let e=rv.default.encode(206),t=rv.default.encode(this.type),n=gs(this,Dl,"f")?.bytes||new Uint8Array([0]);return Fi([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 qi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Wc=new WeakMap,yf=new WeakMap,Dl=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=ME;Pt.fromBytesNoThrow=lq;Pt.fromString=TE;Pt.fromStringNoThrow=hq;Pt.make=dq;Jc([Xn(),In("design:type",it),In("design:paramtypes",[])],Pt.prototype,"baseID",null);Jc([Xn(),In("design:type",String),In("design:paramtypes",[])],Pt.prototype,"typeName",null);Jc([Xn(),In("design:type",Ye),In("design:paramtypes",[])],Pt.prototype,"commit",null);Jc([Xn(),In("design:type",Uint8Array),In("design:paramtypes",[])],Pt.prototype,"bytes",null);Jc([Xn(),In("design:type",Function),In("design:paramtypes",[]),In("design:returntype",String)],Pt.prototype,"toString",null);Jc([Xn(),In("design:type",Function),In("design:paramtypes",[]),In("design:returntype",String)],Pt.prototype,"toUrl",null);ec();var hn;(function(r){function e(i){let s=vf(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new it(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${qi.encode(i)}`)}}o(e,"fromBytes"),r.fromBytes=e;function t(i){let s=Gc(i);switch(s.kind){case"commit-id":return new Pt(s.type,s.genesis,s.commit);case"stream-id":return new it(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(t,"fromString"),r.fromString=t;function n(i){if(it.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})(hn||(hn={}));var nv=o(function(r,e){return nv=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])},nv(r,e)},"extendStatics");function nn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nv(r,e);function t(){this.constructor=r}o(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}o(nn,"__extends");function CE(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(x){try{v(n.next(x))}catch(E){f(E)}}o(u,"fulfilled");function d(x){try{v(n.throw(x))}catch(E){f(E)}}o(d,"rejected");function v(x){x.done?s(x.value):i(x.value).then(u,d)}o(v,"step"),v((n=n.apply(r,e||[])).next())})}o(CE,"__awaiter");function G0(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(v){return function(x){return d([v,x])}}function d(v){if(n)throw new TypeError("Generator is already executing.");for(;f&&(f=0,v[0]&&(t=0)),t;)try{if(n=1,i&&(s=v[0]&2?i.return:v[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,v[1])).done)return s;switch(i=0,s&&(v=[v[0]&2,s.value]),v[0]){case 0:case 1:s=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!s||v[1]>s[0]&&v[1]<s[3])){t.label=v[1];break}if(v[0]===6&&t.label<s[1]){t.label=s[1],s=v;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(v);break}s[2]&&t.ops.pop(),t.trys.pop();continue}v=e.call(r,t)}catch(x){v=[6,x],i=0}finally{n=s=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}o(G0,"__generator");function vs(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(vs,"__values");function Zn(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(Zn,"__read");function to(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(to,"__spreadArray");function xf(r){return this instanceof xf?(this.v=r,this):new xf(r)}o(xf,"__await");function kE(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(B){return new Promise(function(Y,P){s.push([R,B,Y,P])>1||d(R,B)})},I&&(i[R]=I(i[R])))}function d(R,I){try{v(n[R](I))}catch(B){O(s[0][3],B)}}function v(R){R.value instanceof xf?Promise.resolve(R.value.v).then(x,E):O(s[0][2],R)}function x(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(kE,"__asyncGenerator");function IE(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 vs=="function"?vs(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(v){s({value:v,done:u})},f)}}o(IE,"__asyncValues");function Tt(r){return typeof r=="function"}o(Tt,"isFunction");function Yc(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(Yc,"createErrorClass");var W0=Yc(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
821
821
  `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
822
- `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function wf(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(wf,"arrRemove");var ca=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=vs(f),d=u.next();!d.done;d=u.next()){var v=d.value;v.remove(this)}}catch(B){e={error:B}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else f.remove(this);var x=this.initialTeardown;if(Tt(x))try{x()}catch(B){s=B instanceof G0?B.errors:[B]}var E=this._finalizers;if(E){this._finalizers=null;try{for(var O=vs(E),R=O.next();!R.done;R=O.next()){var I=R.value;try{IE(I)}catch(B){s=s??[],B instanceof G0?s=to(to([],Zn(s)),Zn(B.errors)):s.push(B)}}}catch(B){n={error:B}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(s)throw new G0(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)IE(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)&&wf(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&wf(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var rv=ca.EMPTY;function W0(r){return r instanceof ca||r&&"closed"in r&&Tt(r.remove)&&Tt(r.add)&&Tt(r.unsubscribe)}o(W0,"isSubscription");function IE(r){Tt(r)?r():r.unsubscribe()}o(IE,"execFinalizer");var ro={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Xc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Xc.delegate;return i?.setTimeout?i.setTimeout.apply(i,to([r,e],Zn(t))):setTimeout.apply(void 0,to([r,e],Zn(t)))},clearTimeout:function(r){var e=Xc.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function J0(r){Xc.setTimeout(function(){var e=ro.onUnhandledError;if(e)e(r);else throw r})}o(J0,"reportUnhandledError");function nv(){}o(nv,"noop");var DE=function(){return iv("C",void 0,void 0)}();function RE(r){return iv("E",void 0,r)}o(RE,"errorNotification");function OE(r){return iv("N",r,void 0)}o(OE,"nextNotification");function iv(r,e,t){return{kind:r,value:e,error:t}}o(iv,"createNotification");var _f=null;function Zc(r){if(ro.useDeprecatedSynchronousErrorHandling){var e=!_f;if(e&&(_f={errorThrown:!1,error:null}),r(),e){var t=_f,n=t.errorThrown,i=t.error;if(_f=null,n)throw i}}else r()}o(Zc,"errorContext");function NE(r){ro.useDeprecatedSynchronousErrorHandling&&_f&&(_f.errorThrown=!0,_f.error=r)}o(NE,"captureError");var Dl=function(r){nn(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,W0(t)&&t.add(n)):n.destination=dq,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new X0(t,n,i)},e.prototype.next=function(t){this.isStopped?sv(OE(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?sv(RE(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?sv(DE,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}(ca);var uq=Function.prototype.bind;function ov(r,e){return uq.call(r,e)}o(ov,"bind");var lq=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){Y0(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Y0(n)}else Y0(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Y0(t)}},r}(),X0=function(r){nn(e,r);function e(t,n,i){var s=r.call(this)||this,f;if(Tt(t)||!t)f={next:t??void 0,error:n??void 0,complete:i??void 0};else{var u;s&&ro.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()},f={next:t.next&&ov(t.next,u),error:t.error&&ov(t.error,u),complete:t.complete&&ov(t.complete,u)}):f=t}return s.destination=new lq(f),s}return o(e,"SafeSubscriber"),e}(Dl);function Y0(r){ro.useDeprecatedSynchronousErrorHandling?NE(r):J0(r)}o(Y0,"handleUnhandledError");function hq(r){throw r}o(hq,"defaultErrorHandler");function sv(r,e){var t=ro.onStoppedNotification;t&&Xc.setTimeout(function(){return t(r,e)})}o(sv,"handleStoppedNotification");var dq={closed:!0,next:nv,error:hq,complete:nv};var Qc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function eu(r){return r}o(eu,"identity");function PE(r){return r.length===0?eu:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(PE,"pipeFromArray");var Yt=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=mq(e)?e:new X0(e,t,n);return Zc(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=BE(t),new t(function(i,s){var f=new X0({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[Qc]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return PE(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=BE(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 BE(r){var e;return(e=r??ro.Promise)!==null&&e!==void 0?e:Promise}o(BE,"getPromiseCtor");function pq(r){return r&&Tt(r.next)&&Tt(r.error)&&Tt(r.complete)}o(pq,"isObserver");function mq(r){return r&&r instanceof Dl||pq(r)&&W0(r)}o(mq,"isSubscriber");function bq(r){return Tt(r?.lift)}o(bq,"hasLift");function Lr(r){return function(e){if(bq(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(Lr,"operate");function Ur(r,e,t,n,i){return new gq(r,e,t,n,i)}o(Ur,"createOperatorSubscriber");var gq=function(r){nn(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(v){try{n(v)}catch(x){t.error(x)}}:r.prototype._next,d._error=s?function(v){try{s(v)}catch(x){t.error(x)}finally{this.unsubscribe()}}:r.prototype._error,d._complete=i?function(){try{i()}catch(v){t.error(v)}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}(Dl);var LE=Yc(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var av=function(r){nn(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 UE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new LE},e.prototype.next=function(t){var n=this;Zc(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var f=vs(n.currentObservers),u=f.next();!u.done;u=f.next()){var d=u.value;d.next(t)}}catch(v){i={error:v}}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;Zc(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;Zc(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?rv:(this.currentObservers=null,u.push(t),new ca(function(){n.currentObservers=null,wf(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 Yt;return t.source=this,t},e.create=function(t,n){return new UE(t,n)},e}(Yt);var UE=function(r){nn(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:rv},e}(av);var fv=function(r){nn(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}(av);var cv={now:function(){return(cv.delegate||Date).now()},delegate:void 0};var FE=function(r){nn(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}(ca);var Rl={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Rl.delegate;return i?.setInterval?i.setInterval.apply(i,to([r,e],Zn(t))):setInterval.apply(void 0,to([r,e],Zn(t)))},clearInterval:function(r){var e=Rl.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var $E=function(r){nn(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),Rl.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&&Rl.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,wf(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(FE);var uv=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=cv.now,r}();var qE=function(r){nn(e,r);function e(t,n){n===void 0&&(n=uv.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}(uv);var vq=new qE($E),HE=vq;var Z0=new Yt(function(r){return r.complete()});function Q0(r){return r&&Tt(r.schedule)}o(Q0,"isScheduler");function zE(r){return r[r.length-1]}o(zE,"last");function jE(r){return Q0(zE(r))?r.pop():void 0}o(jE,"popScheduler");function KE(r,e){return typeof zE(r)=="number"?r.pop():e}o(KE,"popNumber");var tu=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function ep(r){return Tt(r?.then)}o(ep,"isPromise");function tp(r){return Tt(r[Qc])}o(tp,"isInteropObservable");function rp(r){return Symbol.asyncIterator&&Tt(r?.[Symbol.asyncIterator])}o(rp,"isAsyncIterable");function np(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(np,"createInvalidObservableTypeError");function yq(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(yq,"getSymbolIterator");var ip=yq();function op(r){return Tt(r?.[ip])}o(op,"isIterable");function sp(r){return CE(this,arguments,o(function(){var t,n,i,s;return V0(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,xf(t.read())];case 3:return n=f.sent(),i=n.value,s=n.done,s?[4,xf(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,xf(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(sp,"readableStreamLikeToAsyncGenerator");function ap(r){return Tt(r?.getReader)}o(ap,"isReadableStreamLike");function on(r){if(r instanceof Yt)return r;if(r!=null){if(tp(r))return xq(r);if(tu(r))return wq(r);if(ep(r))return _q(r);if(rp(r))return VE(r);if(op(r))return Eq(r);if(ap(r))return Aq(r)}throw np(r)}o(on,"innerFrom");function xq(r){return new Yt(function(e){var t=r[Qc]();if(Tt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(xq,"fromInteropObservable");function wq(r){return new Yt(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(wq,"fromArrayLike");function _q(r){return new Yt(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,J0)})}o(_q,"fromPromise");function Eq(r){return new Yt(function(e){var t,n;try{for(var i=vs(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(Eq,"fromIterable");function VE(r){return new Yt(function(e){Sq(r,e).catch(function(t){return e.error(t)})})}o(VE,"fromAsyncIterable");function Aq(r){return VE(sp(r))}o(Aq,"fromReadableStreamLike");function Sq(r,e){var t,n,i,s;return TE(this,void 0,void 0,function(){var f,u;return V0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),t=kE(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(Sq,"process");function Oi(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(Oi,"executeSchedule");function fp(r,e){return e===void 0&&(e=0),Lr(function(t,n){t.subscribe(Ur(n,function(i){return Oi(n,r,function(){return n.next(i)},e)},function(){return Oi(n,r,function(){return n.complete()},e)},function(i){return Oi(n,r,function(){return n.error(i)},e)}))})}o(fp,"observeOn");function cp(r,e){return e===void 0&&(e=0),Lr(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(cp,"subscribeOn");function GE(r,e){return on(r).pipe(cp(e),fp(e))}o(GE,"scheduleObservable");function WE(r,e){return on(r).pipe(cp(e),fp(e))}o(WE,"schedulePromise");function JE(r,e){return new Yt(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(JE,"scheduleArray");function YE(r,e){return new Yt(function(t){var n;return Oi(t,e,function(){n=r[ip](),Oi(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 Tt(n?.return)&&n.return()}})}o(YE,"scheduleIterable");function up(r,e){if(!r)throw new Error("Iterable cannot be null");return new Yt(function(t){Oi(t,e,function(){var n=r[Symbol.asyncIterator]();Oi(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(up,"scheduleAsyncIterable");function XE(r,e){return up(sp(r),e)}o(XE,"scheduleReadableStreamLike");function ZE(r,e){if(r!=null){if(tp(r))return GE(r,e);if(tu(r))return JE(r,e);if(ep(r))return WE(r,e);if(rp(r))return up(r,e);if(op(r))return YE(r,e);if(ap(r))return XE(r,e)}throw np(r)}o(ZE,"scheduled");function QE(r,e){return e?ZE(r,e):on(r)}o(QE,"from");var lp=Yc(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function e9(r){return r instanceof Date&&!isNaN(r)}o(e9,"isValidDate");function hp(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){n.next(r.call(e,s,i++))}))})}o(hp,"map");var Mq=Array.isArray;function Tq(r,e){return Mq(e)?r.apply(void 0,to([],Zn(e))):r(e)}o(Tq,"callOrApply");function t9(r){return hp(function(e){return Tq(r,e)})}o(t9,"mapOneOrManyArgs");function r9(r,e,t,n,i,s,f,u){var d=[],v=0,x=0,E=!1,O=o(function(){E&&!d.length&&!v&&e.complete()},"checkComplete"),R=o(function(B){return v<n?I(B):d.push(B)},"outerNext"),I=o(function(B){s&&e.next(B),v++;var Y=!1;on(t(B,x++)).subscribe(Ur(e,function(P){i?.(P),s?R(P):e.next(P)},function(){Y=!0},void 0,function(){if(Y)try{v--;for(var P=o(function(){var J=d.shift();f?Oi(e,f,function(){return I(J)}):I(J)},"_loop_1");d.length&&v<n;)P();O()}catch(J){e.error(J)}}))},"doInnerSub");return r.subscribe(Ur(e,R,function(){E=!0,O()})),function(){u?.()}}o(r9,"mergeInternals");function Ol(r,e,t){return t===void 0&&(t=1/0),Tt(e)?Ol(function(n,i){return hp(function(s,f){return e(n,s,i,f)})(on(r(n,i)))},t):(typeof e=="number"&&(t=e),Lr(function(n,i){return r9(n,i,r,t)}))}o(Ol,"mergeMap");function n9(r){return r===void 0&&(r=1/0),Ol(eu,r)}o(n9,"mergeAll");var Cq=["addListener","removeListener"],kq=["addEventListener","removeEventListener"],Iq=["on","off"];function Nl(r,e,t,n){if(Tt(t)&&(n=t,t=void 0),n)return Nl(r,e,t).pipe(t9(n));var i=Zn(Oq(r)?kq.map(function(u){return function(d){return r[u](e,d,t)}}):Dq(r)?Cq.map(i9(r,e)):Rq(r)?Iq.map(i9(r,e)):[],2),s=i[0],f=i[1];if(!s&&tu(r))return Ol(function(u){return Nl(u,e,t)})(on(r));if(!s)throw new TypeError("Invalid event target");return new Yt(function(u){var d=o(function(){for(var v=[],x=0;x<arguments.length;x++)v[x]=arguments[x];return u.next(1<v.length?v:v[0])},"handler");return s(d),function(){return f(d)}})}o(Nl,"fromEvent");function i9(r,e){return function(t){return function(n){return r[t](e,n)}}}o(i9,"toCommonHandlerRegistry");function Dq(r){return Tt(r.addListener)&&Tt(r.removeListener)}o(Dq,"isNodeStyleEventEmitter");function Rq(r){return Tt(r.on)&&Tt(r.off)}o(Rq,"isJQueryStyleEventEmitter");function Oq(r){return Tt(r.addEventListener)&&Tt(r.removeEventListener)}o(Oq,"isEventTarget");function Pl(r,e,t){r===void 0&&(r=0),t===void 0&&(t=HE);var n=-1;return e!=null&&(Q0(e)?t=e:n=e),new Yt(function(i){var s=e9(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(Pl,"timer");function lv(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=jE(r),n=KE(r,1/0),i=r;return i.length?i.length===1?on(i[0]):n9(n)(QE(i,t)):Z0}o(lv,"merge");function o9(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(o9,"filter");function s9(r){return Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(s9,"defaultIfEmpty");function a9(r){return r<=0?function(){return Z0}:Lr(function(e,t){var n=0;e.subscribe(Ur(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(a9,"take");function f9(r){return r===void 0&&(r=Nq),Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(f9,"throwIfEmpty");function Nq(){return new lp}o(Nq,"defaultErrorFactory");function hv(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?o9(function(i,s){return r(i,s,n)}):eu,a9(1),t?s9(e):f9(function(){return new lp}))}}o(hv,"first");function dv(r,e){return Lr(function(t,n){var i=e??{},s=i.leading,f=s===void 0?!0:s,u=i.trailing,d=u===void 0?!1:u,v=!1,x=null,E=null,O=!1,R=o(function(){E?.unsubscribe(),E=null,d&&(Y(),O&&n.complete())},"endThrottling"),I=o(function(){E=null,O&&n.complete()},"cleanupThrottling"),B=o(function(P){return E=on(r(P)).subscribe(Ur(n,R,I))},"startThrottle"),Y=o(function(){if(v){v=!1;var P=x;x=null,n.next(P),!O&&B(P)}},"send");t.subscribe(Ur(n,function(P){v=!0,x=P,!(E&&!E.closed)&&(f?Y():B(P))},function(){O=!0,!(d&&v&&E&&!E.closed)&&n.complete()}))})}o(dv,"throttle");var c9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(c9||(c9={}));var Bl;(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"})(Bl||(Bl={}));var mv;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(mv||(mv={}));var ys=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(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,pv.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===mv.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,pv.default)(this.state$.value)}async sync(e={}){e={sync:_r.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(ys,"Stream");function ru(){return r=>{}}o(ru,"StreamStatic");var p9=Ut(l9(),1);function h9(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):(lv(...r.map(t=>Nl(t,"abort"))).pipe(hv()).subscribe(()=>{e.abort()}),e.signal)}o(h9,"mergeAbortSignals");var Ll=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=Pl(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}};o(Ll,"TimedAbortSignal");async function d9(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(d9,"abortable");var Pq=60*1e3*3;async function Vr(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let t=e.timeout||Pq,n=new Ll(t),i=e.signal?h9([e.signal,n.signal]):n.signal,s=await d9(i,f=>(0,p9.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(Vr,"fetchJson");var Ul=Ut(Kc(),1);Hi();function xs(r){let e=Ye.asCID(r);if(e)return e;if(typeof r=="string")return Ye.parse(r);if(r instanceof Uint8Array)return Ye.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(xs,"toCID");var m9=0,Qt=class{static streamIdFromState(e){return new it(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,Ul.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Dt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Dt(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(e)&&(t.link=t.link.toString()),Qt.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=Dt(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,Ul.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=xs(t.jws.link),t.linkedBlock=Ft(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ft(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(t)&&(t.link=xs(t.link)),Qt.isAnchorCommit(t)&&(t.proof=xs(t.proof)),t.id&&(t.id=xs(t.id)),t.prev&&(t.prev=xs(t.prev)),t.header?.model&&(t.header.model=Ft(t.header.model,"base64")),t)}static serializeState(e){let t=(0,Ul.default)(e);return t.log=t.log.map(n=>({...n,cid:n.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Bl[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!=m9&&(t.metadata.unique=Dt(t.metadata.unique,"base64")),t.doctype=kn.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,Ul.default)(e);return t.doctype&&(t.type=kn.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(n=>({...n,cid:xs(n.cid)})),t.anchorProof&&(t.anchorProof.txHash=xs(t.anchorProof.txHash),t.anchorProof.root=xs(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Bl[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=it.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=it.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=m9&&(t.metadata.unique=Ft(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Qt.serializeState(e))===JSON.stringify(Qt.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(Qt.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(Qt,"StreamUtils");var Fl=class extends fv{next(e){let t=this.value;Qt.statesEqual(t,e)||super.next(e)}};o(Fl,"StreamStateSubject");var Bq=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},Qn,bv={anchor:!0,publish:!0,pin:!0,sync:_r.PREFER_CACHE},Lq={sync:_r.PREFER_CACHE},b9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function gv(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=Dt((0,y9.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(gv,"headerFromMetadata");async function g9(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(g9,"getAuthenticatedDID");async function vv(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(vv,"throwReadOnlyError");var ei=Qn=o(class extends ys{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,v9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async create(e,t,n,i={}){i={...bv,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let s=i.asDID?{did:i.asDID}:e,f=await Qn.makeGenesis(s,t,n);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,f,i)}static async createFromGenesis(e,t,n={}){n={...bv,...n},t.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=t.data?await Qn._signDagJWS(e,t):t;return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async deterministic(e,t,n={}){if(n={...bv,...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 Qn.makeGenesis(e,null,t);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async load(e,t,n={}){n={...Lq,...n};let i=hn.from(t);if(i.type!=Qn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Qn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,t,n={}){n={...b9,...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={...b9,...t};let i={header:gv(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},s=await Qn._signDagJWS(this.api,i),f=await this.api.applyCommit(this.id,s,t);this.state$.next(f.state)}makeReadOnly(){this.update=vv,this.patch=vv,this.sync=vv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,t,n){let i=await this._makeRawCommit(t,n);return Qn._signDagJWS(e,i)}async _makeRawCommit(e,t){t||(t={});let n=gv(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=O0.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 g9(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=gv(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 rf(f),f}let s={data:t,header:i};return Qn._signDagJWS(e,s)}static async _signDagJWS(e,t){return(await g9(e)).createDagJWS(t)}},"TileDocument");ei.STREAM_TYPE_NAME="tile";ei.STREAM_TYPE_ID=0;ei=Qn=Bq([ru()],ei);var M9=Ut(_9(),1);function Gq(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(Gq,"_checkPrivateRedeclaration");function Wq(r,e){return e.get?e.get.call(r):e.value}o(Wq,"_classApplyDescriptorGet");function Jq(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(Jq,"_classApplyDescriptorSet");function S9(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(S9,"_classExtractFieldDescriptor");function _v(r,e){var t=S9(r,e,"get");return Wq(r,t)}o(_v,"_classPrivateFieldGet");function E9(r,e,t){Gq(r,e),e.set(r,t)}o(E9,"_classPrivateFieldInit");function A9(r,e,t){var n=S9(r,e,"set");return Jq(r,n,t),t}o(A9,"_classPrivateFieldSet");function Yq(r){return typeof r=="string"||Pt.isInstance(r)||it.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(Yq,"keyToQuery");function Ev(r){return typeof r=="string"?hn.from(r).toString():Pt.isInstance(r)||it.isInstance(r)?r.toString():r.streamId.toString()}o(Ev,"keyToString");async function Xq(r){let e=await ei.makeGenesis({},null,{...r,deterministic:!0}),t=await it.fromGenesis("tile",e);return{genesis:e,streamId:t}}o(Xq,"getDeterministicQuery");var Zq=o(()=>Promise.resolve([]),"tempBatchLoadFn"),mp=new WeakMap,Av=new WeakMap,$l=class extends M9.default{cache(e){if(!_v(this,Av))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,n){let i=await ei.create(_v(this,mp),e,t,n);return this.cache(i),i}async deterministic(e,t){let n=await Xq(e);try{return await super.load(n)}catch{let s=await ei.createFromGenesis(_v(this,mp),n.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,n,i){let s=Ev(e);this.clear(s);let f=await this.load({streamId:s});return await f.update(t,n,i),f}constructor(e){super(Zq,{cache:!0,cacheKeyFn:Ev,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),E9(this,mp,{writable:!0,value:void 0}),E9(this,Av,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(t.map(Yq),e.multiqueryTimeout);return t.map(i=>{let s=Ev(i),f=n[s];return f||new Error(`Failed to load stream: ${s}`)})},A9(this,mp,e.ceramic),A9(this,Av,!!e.cache)}};o($l,"TileLoader");function Sv(r){return typeof r=="string"?it.fromString(r):r}o(Sv,"typeStreamID");function T9(r,e){let t=new URL(r);for(let[n,i]of Object.entries(e))it.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(T9,"serializeObjectToSearchParams");function Mv(r){let e={};for(let[t,n]of Object.entries(r))it.isInstance(n)?e[t]=n.toString():e[t]=n;return e}o(Mv,"serializeObjectForHttpPost");var sn=class extends Yt{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=Pl(0,n).pipe(dv(()=>this._syncState(this.id,{sync:_r.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new Fl(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 sn._load(e,this._apiUrl,t);this.state$.next(Qt.deserializeState(n))}get id(){return new it(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 Vr(f,{method:"post",body:{type:t,genesis:Qt.serializeCommit(n),opts:i}});return new sn(Qt.deserializeState(u),e,s)}static async applyCommit(e,t,n,i,s){let f=new URL("./commits",e),{state:u}=await Vr(f,{method:"post",body:{streamId:t.toString(),commit:Qt.serializeCommit(n),opts:i}});return new sn(Qt.deserializeState(u),e,s)}static async _load(e,t,n){let i=T9(new URL(`./streams/${e}`,t),n),{state:s}=await Vr(i);return s}static async load(e,t,n,i){let s=await sn._load(e,t,i);return new sn(Qt.deserializeState(s),t,n)}static async loadStreamCommits(e,t){let n=new URL(`./commits/${e}`,t),{commits:i}=await Vr(n);return i.map(s=>({cid:s.cid,value:Qt.deserializeCommit(s.value)}))}complete(){this.state$.complete()}};o(sn,"Document");var Ef;(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"})(Ef||(Ef={}));var Tv=Ut(Kc(),1);var C9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(C9||(C9={}));var Cv;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(Cv||(Cv={}));var ql=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(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,Tv.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===Cv.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,Tv.default)(this.state$.value)}async sync(e={}){e={sync:Ef.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(ql,"Stream");function k9(){return r=>{}}o(k9,"StreamStatic");function I9(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new ra({address:e,chainId:t})}return new ra(r)}o(I9,"normalizeAccountId");var Qq="(?:%[0-9a-fA-F]{2})",D9=`(?:[a-zA-Z0-9._-]|${Qq})`,eH="([a-z0-9]+)",tH=`((?:${D9}*:)*(${D9}+))`,R9="[a-zA-Z0-9_.:%-]",rH=`;${R9}+=${R9}*`,nH=`((${rH})*)`,iH="(/[^#?]*)?",oH="([?][^#]*)?",sH="(#.*)?",aH=new RegExp(`^did:${eH}:${tH}${nH}${iH}${oH}${sH}$`);function O9(r){if(r===""||!r)return null;let e=r.match(aH);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(O9,"parse");var P9=Ut(Kc(),1);var fH=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},Af,kv=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),N9={anchor:!1,publish:!0,sync:Ef.PREFER_CACHE},Iv={anchor:!0,publish:!0},cH={sync:Ef.PREFER_CACHE},Sf=Af=o(class extends ql{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,P9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async fromAccount(e,t,n={}){n={...N9,...n};let i=I9(t),s=Af.makeGenesis(i);return Af.fromGenesis(e,s,n)}static async fromGenesis(e,t,n={}){return n={...N9,...n},e.createStreamFromGenesis(Af.STREAM_TYPE_ID,t,n)}async setDid(e,t,n={}){n={...Iv,...n};let i=typeof e=="string"?e.trim():e.id;if(O9(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={...Iv,...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={...Iv,...t};let n=await e.createLink("");return this.setDidProof(n,t)}static async load(e,t,n={}){n={...cH,...n};let i=hn.from(t);if(i.type!=Af.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Af.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=kv,this.setDid=kv,this.sync=kv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Sf.STREAM_TYPE_NAME="caip10-link";Sf.STREAM_TYPE_ID=1;Sf=Af=fH([k9()],Sf);Hi();Fa();var gA=Ut(mA(),1);var rz=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},Ro,nz={sync:_r.PREFER_CACHE};async function bA(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(bA,"_ensureAuthenticated");async function iz(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(iz,"throwReadOnlyError");var la=Ro=o(class extends ys{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Ro.MODEL}}static async create(e,t,n){Ro.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:_r.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Ro._makeGenesis(e,t,n);return await e.createStreamFromGenesis(Ro.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={...nz,...n};let i=hn.from(t);if(i.type!=Ro.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ro.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 Ro._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 bA(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:Ro.MODEL.bytes};return{data:t,header:i}}makeReadOnly(){this.sync=iz,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,t){return await bA(e),e.did.createDagJWS(t)}},"Model");la.STREAM_TYPE_NAME="model";la.STREAM_TYPE_ID=2;la.MODEL=function(){let r=rf("model-v1"),e=gA.default.encode(r,"identity"),t=es(Sc,e),n=Ye.createV1(Sc,t);return new it("UNLOADABLE",n)}();la=Ro=rz([ru()],la);var xA=Ut(Ga(),1);var oz=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},no,sz={anchor:!0,publish:!0,pin:!0,sync:_r.NEVER_SYNC,syncTimeoutSeconds:0},az={anchor:!1,publish:!1,pin:!0,sync:_r.PREFER_CACHE},fz={sync:_r.PREFER_CACHE},vA={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function yA(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(yA,"_ensureAuthenticated");async function Ov(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Ov,"throwReadOnlyError");var Tf=no=o(class extends ys{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={...sz,...i};let s=i.asDID?{did:i.asDID}:e,f=await no._makeGenesis(s,t,n);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,f,i)}static async single(e,t,n={}){n={...az,...n};let i=n.asDID?{did:n.asDID}:e;t={...t,deterministic:!0};let s=await no._makeGenesis(i,null,t);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,s,n)}static async load(e,t,n={}){n={...fz,...n};let i=hn.from(t);if(i.type!=no.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${no.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,t={}){t={...vA,...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={...vA,...t};let n={data:e,prev:this.tip,id:this.id.cid},i=await no._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}makeReadOnly(){this.replace=Ov,this.patch=Ov,this.sync=Ov,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return no._signDagJWS(e,n)}_makeRawCommit(e){return{data:O0.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?(rf(i),i):no._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 yA(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,xA.randomBytes)(12)),{data:t,header:s}}static async _signDagJWS(e,t){return await yA(e),e.did.createDagJWS(t)}},"ModelInstanceDocument");Tf.STREAM_TYPE_NAME="MID";Tf.STREAM_TYPE_ID=3;Tf=no=oz([ru()],Tf);var jl=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 Vr(i,{method:"post",body:n})}async rm(e,t){let n=new URL(`./pins/${e}`,this._apiUrl);await Vr(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 Vr(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(jl,"RemotePinApi");var Kl=class{constructor(e){this._fetchJson=Vr,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:Mv(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:Mv(e)});return{edges:t.edges.map(i=>({cursor:i.cursor,node:Qt.deserializeState(i.node)})),pageInfo:t.pageInfo}}};o(Kl,"RemoteIndexApi");var Vl=class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=Vr,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=>it.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(Vl,"RemoteAdminApi");var cz="/api/v0/",uz="http://localhost:7007",lz={syncInterval:5e3},hz={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},dz={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},wA={sync:_r.PREFER_CACHE},Gl=class{constructor(e=uz,t={}){this._config={...lz,...t},this._apiUrl=new URL(cz,e),this._streamCache=new Map,this.context={api:this},this.pin=new jl(this._apiUrl),this.index=new Kl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Vl(this._apiUrl,n),this._streamConstructors={[Sf.STREAM_TYPE_ID]:Sf,[la.STREAM_TYPE_ID]:la,[Tf.STREAM_TYPE_ID]:Tf,[ei.STREAM_TYPE_ID]:ei}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,n={}){n={...dz,...n};let i=await sn.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),s=this._streamCache.get(i.id.toString());return s?(Qt.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={...wA,...t};let n=hn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,t):(i=await sn.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 Vr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((f,u)=>{let[d,v]=u,x=Qt.deserializeState(v),E=new sn(x,this._apiUrl,this._config.syncInterval);return f[d]=this.buildStreamFromDocument(E),f},{})}loadStreamCommits(e){let t=Sv(e);return sn.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,n={}){n={...hz,...n};let i=Sv(e),s=await sn.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={...wA,...t};let{anchorStatus:n}=await Vr(`${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 sn(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 Vr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Gl,"CeramicClient");var Bt;(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})(Bt||(Bt={}));var Pv;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Pv||(Pv={}));var He=Bt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ha=o(r=>{switch(typeof r){case"undefined":return He.undefined;case"string":return He.string;case"number":return isNaN(r)?He.nan:He.number;case"boolean":return He.boolean;case"function":return He.function;case"bigint":return He.bigint;case"symbol":return He.symbol;case"object":return Array.isArray(r)?He.array:r===null?He.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?He.promise:typeof Map<"u"&&r instanceof Map?He.map:typeof Set<"u"&&r instanceof Set?He.set:typeof Date<"u"&&r instanceof Date?He.date:He.object;default:return He.unknown}},"getParsedType"),Oe=Bt.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"]),pz=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),an=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 v=f.path[d];d===f.path.length-1?(u[v]=u[v]||{_errors:[]},u[v]._errors.push(t(f))):u[v]=u[v]||{_errors:[]},u=u[v],d++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof an))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Bt.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(an,"ZodError");an.create=r=>new an(r);var uu=o((r,e)=>{let t;switch(r.code){case Oe.invalid_type:r.received===He.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Bt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${Bt.joinValues(r.keys,", ")}`;break;case Oe.invalid_union:t="Invalid input";break;case Oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Bt.joinValues(r.options)}`;break;case Oe.invalid_enum_value:t=`Invalid enum value. Expected ${Bt.joinValues(r.options)}, received '${r.received}'`;break;case Oe.invalid_arguments:t="Invalid function arguments";break;case Oe.invalid_return_type:t="Invalid function return type";break;case Oe.invalid_date:t="Invalid date";break;case Oe.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"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}"`:Bt.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Oe.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(Number(r.minimum))}`:t="Invalid input";break;case Oe.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==="bigint"?t=`BigInt 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(Number(r.maximum))}`:t="Invalid input";break;case Oe.custom:t="Invalid input";break;case Oe.invalid_intersection_types:t="Intersection results could not be merged";break;case Oe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,Bt.assertNever(r)}return{message:t}},"errorMap"),AA=uu;function mz(r){AA=r}o(mz,"setErrorMap");function xp(){return AA}o(xp,"getErrorMap");var wp=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],f={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let u="",d=n.filter(v=>!!v).slice().reverse();for(let v of d)u=v(f,{data:e,defaultError:u}).message;return{...i,path:s,message:u}},"makeIssue"),bz=[];function $e(r,e){let t=xp(),n=wp({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===uu?void 0:uu].filter(i=>!!i)});r.common.issues.push(n)}o($e,"addIssueToContext");var Tr=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 gt;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){let s=await i.key,f=await i.value;n.push({key:s,value:f})}return Tr.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 gt;s.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof f.value<"u"||i.alwaysSet)&&(n[s.value]=f.value)}return{status:e.value,value:n}}};o(Tr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),fu=o(r=>({status:"dirty",value:r}),"DIRTY"),dn=o(r=>({status:"valid",value:r}),"OK"),Bv=o(r=>r.status==="aborted","isAborted"),Lv=o(r=>r.status==="dirty","isDirty"),Yl=o(r=>r.status==="valid","isValid"),Xl=o(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function _p(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)}o(_p,"__classPrivateFieldGet");function SA(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}o(SA,"__classPrivateFieldSet");var Ge;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(Ge||(Ge={}));var Wl,Jl,ti=class{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(ti,"ParseInputLazyPath");var _A=o((r,e)=>{if(Yl(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new an(r.common.issues);return this._error=t,this._error}}},"handleResult");function Et(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)=>{var d,v;let{message:x}=r;return f.code==="invalid_enum_value"?{message:x??u.defaultError}:typeof u.data>"u"?{message:(d=x??n)!==null&&d!==void 0?d:u.defaultError}:f.code!=="invalid_type"?{message:u.defaultError}:{message:(v=x??t)!==null&&v!==void 0?v:u.defaultError}},"customMap"),description:i}}o(Et,"processCreateParams");var _t=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.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ha(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ha(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tr,ctx:{common:e.parent.common,data:e.data,parsedType:ha(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Xl(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:ha(e)},s=this._parseSync({data:e,path:i.path,parent:i});return _A(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:ha(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Xl(i)?i:Promise.resolve(i));return _A(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:Oe.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 On({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ni.create(this,this._def)}nullable(){return ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rn.create(this,this._def)}promise(){return Ss.create(this,this._def)}or(e){return ba.create([this,e],this._def)}and(e){return ga.create(this,e,this._def)}transform(e){return new On({...Et(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new _a({...Et(this._def),innerType:this,defaultValue:t,typeName:ot.ZodDefault})}brand(){return new cu({typeName:ot.ZodBranded,type:this,...Et(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ea({...Et(this._def),innerType:this,catchValue:t,typeName:ot.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Aa.create(this,e)}readonly(){return Sa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(_t,"ZodType");var gz=/^c[^\s-]{8,}$/i,vz=/^[0-9a-z]+$/,yz=/^[0-9A-HJKMNP-TV-Z]{26}$/,xz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wz=/^[a-z0-9_-]{21}$/i,_z=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ez=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Az="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Nv,Sz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Tz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Cz=new RegExp(`^${MA}$`);function TA(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}o(TA,"timeRegexSource");function kz(r){return new RegExp(`^${TA(r)}$`)}o(kz,"timeRegex");function CA(r){let e=`${MA}T${TA(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}o(CA,"datetimeRegex");function Iz(r,e){return!!((e==="v4"||!e)&&Sz.test(r)||(e==="v6"||!e)&&Mz.test(r))}o(Iz,"isValidIP");var Dn=class extends _t{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==He.string){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.string,received:s.parsedType}),gt}let n=new Tr,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.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),$e(i,{code:Oe.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?$e(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&$e(i,{code:Oe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ez.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"email",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Nv||(Nv=new RegExp(Az,"u")),Nv.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"emoji",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")xz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"uuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")wz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"nanoid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")gz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")vz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid2",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")yz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ulid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),$e(i,{validation:"url",code:Oe.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),$e(i,{validation:"regex",code:Oe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?CA(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Cz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?kz(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?_z.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"duration",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Iz(e.data,s.version)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ip",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Tz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"base64",code:Oe.invalid_string,message:s.message}),n.dirty()):Bt.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:Oe.invalid_string,...Ge.errToObj(n)})}_addCheck(e){return new Dn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!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,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Ge.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Ge.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ge.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ge.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ge.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ge.errToObj(t)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}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(Dn,"ZodString");Dn.create=r=>{var e;return new Dn({checks:[],typeName:ot.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Et(r)})};function Dz(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(Dz,"floatSafeRemainder");var io=class extends _t{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)!==He.number){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.number,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="int"?Bt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.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),$e(n,{code:Oe.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),$e(n,{code:Oe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Dz(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_finite,message:s.message}),i.dirty()):Bt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new io({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new io({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.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"||e.kind==="multipleOf"&&Bt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};o(io,"ZodNumber");io.create=r=>new io({checks:[],typeName:ot.ZodNumber,coerce:r?.coerce||!1,...Et(r)});var oo=class extends _t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==He.bigint){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.bigint,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Bt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new oo({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new oo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};o(oo,"ZodBigInt");oo.create=r=>{var e;return new oo({checks:[],typeName:ot.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Et(r)})};var da=class extends _t{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==He.boolean){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.boolean,received:n.parsedType}),gt}return dn(e.data)}};o(da,"ZodBoolean");da.create=r=>new da({typeName:ot.ZodBoolean,coerce:r?.coerce||!1,...Et(r)});var Oo=class extends _t{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==He.date){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.date,received:s.parsedType}),gt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_date}),gt}let n=new Tr,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.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),$e(i,{code:Oe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Bt.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Oo({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.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(Oo,"ZodDate");Oo.create=r=>new Oo({checks:[],coerce:r?.coerce||!1,typeName:ot.ZodDate,...Et(r)});var Cf=class extends _t{_parse(e){if(this._getType(e)!==He.symbol){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.symbol,received:n.parsedType}),gt}return dn(e.data)}};o(Cf,"ZodSymbol");Cf.create=r=>new Cf({typeName:ot.ZodSymbol,...Et(r)});var pa=class extends _t{_parse(e){if(this._getType(e)!==He.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.undefined,received:n.parsedType}),gt}return dn(e.data)}};o(pa,"ZodUndefined");pa.create=r=>new pa({typeName:ot.ZodUndefined,...Et(r)});var ma=class extends _t{_parse(e){if(this._getType(e)!==He.null){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.null,received:n.parsedType}),gt}return dn(e.data)}};o(ma,"ZodNull");ma.create=r=>new ma({typeName:ot.ZodNull,...Et(r)});var Es=class extends _t{constructor(){super(...arguments),this._any=!0}_parse(e){return dn(e.data)}};o(Es,"ZodAny");Es.create=r=>new Es({typeName:ot.ZodAny,...Et(r)});var No=class extends _t{constructor(){super(...arguments),this._unknown=!0}_parse(e){return dn(e.data)}};o(No,"ZodUnknown");No.create=r=>new No({typeName:ot.ZodUnknown,...Et(r)});var Ni=class extends _t{_parse(e){let t=this._getOrReturnCtx(e);return $e(t,{code:Oe.invalid_type,expected:He.never,received:t.parsedType}),gt}};o(Ni,"ZodNever");Ni.create=r=>new Ni({typeName:ot.ZodNever,...Et(r)});var kf=class extends _t{_parse(e){if(this._getType(e)!==He.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.void,received:n.parsedType}),gt}return dn(e.data)}};o(kf,"ZodVoid");kf.create=r=>new kf({typeName:ot.ZodVoid,...Et(r)});var Rn=class extends _t{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==He.array)return $e(t,{code:Oe.invalid_type,expected:He.array,received:t.parsedType}),gt;if(i.exactLength!==null){let f=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(f||u)&&($e(t,{code:f?Oe.too_big:Oe.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&&($e(t,{code:Oe.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&&($e(t,{code:Oe.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 ti(t,f,t.path,u)))).then(f=>Tr.mergeArray(n,f));let s=[...t.data].map((f,u)=>i.type._parseSync(new ti(t,f,t.path,u)));return Tr.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Rn({...this._def,minLength:{value:e,message:Ge.toString(t)}})}max(e,t){return new Rn({...this._def,maxLength:{value:e,message:Ge.toString(t)}})}length(e,t){return new Rn({...this._def,exactLength:{value:e,message:Ge.toString(t)}})}nonempty(e){return this.min(1,e)}};o(Rn,"ZodArray");Rn.create=(r,e)=>new Rn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...Et(e)});function au(r){if(r instanceof sr){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=ni.create(au(n))}return new sr({...r._def,shape:()=>e})}else return r instanceof Rn?new Rn({...r._def,type:au(r.element)}):r instanceof ni?ni.create(au(r.unwrap())):r instanceof ao?ao.create(au(r.unwrap())):r instanceof ri?ri.create(r.items.map(e=>au(e))):r}o(au,"deepPartialify");var sr=class extends _t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Bt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==He.object){let v=this._getOrReturnCtx(e);return $e(v,{code:Oe.invalid_type,expected:He.object,received:v.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:f}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ni&&this._def.unknownKeys==="strip"))for(let v in i.data)f.includes(v)||u.push(v);let d=[];for(let v of f){let x=s[v],E=i.data[v];d.push({key:{status:"valid",value:v},value:x._parse(new ti(i,E,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Ni){let v=this._def.unknownKeys;if(v==="passthrough")for(let x of u)d.push({key:{status:"valid",value:x},value:{status:"valid",value:i.data[x]}});else if(v==="strict")u.length>0&&($e(i,{code:Oe.unrecognized_keys,keys:u}),n.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let v=this._def.catchall;for(let x of u){let E=i.data[x];d.push({key:{status:"valid",value:x},value:v._parse(new ti(i,E,i.path,x)),alwaysSet:x in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let v=[];for(let x of d){let E=await x.key,O=await x.value;v.push({key:E,value:O,alwaysSet:x.alwaysSet})}return v}).then(v=>Tr.mergeObjectSync(n,v)):Tr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new sr({...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=Ge.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(e){return new sr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new sr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new sr({...this._def,catchall:e})}pick(e){let t={};return Bt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}omit(e){let t={};return Bt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}deepPartial(){return au(this)}partial(e){let t={};return Bt.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new sr({...this._def,shape:()=>t})}required(e){let t={};return Bt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ni;)s=s._def.innerType;t[n]=s}}),new sr({...this._def,shape:()=>t})}keyof(){return kA(Bt.objectKeys(this.shape))}};o(sr,"ZodObject");sr.create=(r,e)=>new sr({shape:()=>r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...Et(e)});sr.strictCreate=(r,e)=>new sr({shape:()=>r,unknownKeys:"strict",catchall:Ni.create(),typeName:ot.ZodObject,...Et(e)});sr.lazycreate=(r,e)=>new sr({shape:r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...Et(e)});var ba=class extends _t{_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 an(u.ctx.common.issues));return $e(t,{code:Oe.invalid_union,unionErrors:f}),gt}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 v={...t,common:{...t.common,issues:[]},parent:null},x=d._parseSync({data:t.data,path:t.path,parent:v});if(x.status==="valid")return x;x.status==="dirty"&&!s&&(s={result:x,ctx:v}),v.common.issues.length&&f.push(v.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let u=f.map(d=>new an(d));return $e(t,{code:Oe.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ba,"ZodUnion");ba.create=(r,e)=>new ba({options:r,typeName:ot.ZodUnion,...Et(e)});var _s=o(r=>r instanceof ya?_s(r.schema):r instanceof On?_s(r.innerType()):r instanceof xa?[r.value]:r instanceof so?r.options:r instanceof wa?Bt.objectValues(r.enum):r instanceof _a?_s(r._def.innerType):r instanceof pa?[void 0]:r instanceof ma?[null]:r instanceof ni?[void 0,..._s(r.unwrap())]:r instanceof ao?[null,..._s(r.unwrap())]:r instanceof cu||r instanceof Sa?_s(r.unwrap()):r instanceof Ea?_s(r._def.innerType):[],"getDiscriminator"),If=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.object)return $e(t,{code:Oe.invalid_type,expected:He.object,received:t.parsedType}),gt;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}):($e(t,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}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=_s(s.shape[e]);if(!f.length)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 If({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...Et(n)})}};o(If,"ZodDiscriminatedUnion");function Uv(r,e){let t=ha(r),n=ha(e);if(r===e)return{valid:!0,data:r};if(t===He.object&&n===He.object){let i=Bt.objectKeys(e),s=Bt.objectKeys(r).filter(u=>i.indexOf(u)!==-1),f={...r,...e};for(let u of s){let d=Uv(r[u],e[u]);if(!d.valid)return{valid:!1};f[u]=d.data}return{valid:!0,data:f}}else if(t===He.array&&n===He.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=Uv(f,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===He.date&&n===He.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(Uv,"mergeValues");var ga=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,f)=>{if(Bv(s)||Bv(f))return gt;let u=Uv(s.value,f.value);return u.valid?((Lv(s)||Lv(f))&&t.dirty(),{status:t.value,value:u.data}):($e(n,{code:Oe.invalid_intersection_types}),gt)},"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(ga,"ZodIntersection");ga.create=(r,e,t)=>new ga({left:r,right:e,typeName:ot.ZodIntersection,...Et(t)});var ri=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==He.array)return $e(n,{code:Oe.invalid_type,expected:He.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return $e(n,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&($e(n,{code:Oe.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 ti(n,f,n.path,u)):null}).filter(f=>!!f);return n.common.async?Promise.all(s).then(f=>Tr.mergeArray(t,f)):Tr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ri({...this._def,rest:e})}};o(ri,"ZodTuple");ri.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ri({items:r,typeName:ot.ZodTuple,rest:null,...Et(e)})};var va=class extends _t{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!==He.object)return $e(n,{code:Oe.invalid_type,expected:He.object,received:n.parsedType}),gt;let i=[],s=this._def.keyType,f=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new ti(n,u,n.path,u)),value:f._parse(new ti(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?Tr.mergeObjectAsync(t,i):Tr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _t?new va({keyType:e,valueType:t,typeName:ot.ZodRecord,...Et(n)}):new va({keyType:Dn.create(),valueType:e,typeName:ot.ZodRecord,...Et(t)})}};o(va,"ZodRecord");var Df=class extends _t{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!==He.map)return $e(n,{code:Oe.invalid_type,expected:He.map,received:n.parsedType}),gt;let i=this._def.keyType,s=this._def.valueType,f=[...n.data.entries()].map(([u,d],v)=>({key:i._parse(new ti(n,u,n.path,[v,"key"])),value:s._parse(new ti(n,d,n.path,[v,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of f){let v=await d.key,x=await d.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&t.dirty(),u.set(v.value,x.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let d of f){let v=d.key,x=d.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&t.dirty(),u.set(v.value,x.value)}return{status:t.value,value:u}}}};o(Df,"ZodMap");Df.create=(r,e,t)=>new Df({valueType:e,keyType:r,typeName:ot.ZodMap,...Et(t)});var Po=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==He.set)return $e(n,{code:Oe.invalid_type,expected:He.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&($e(n,{code:Oe.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&&($e(n,{code:Oe.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 v=new Set;for(let x of d){if(x.status==="aborted")return gt;x.status==="dirty"&&t.dirty(),v.add(x.value)}return{status:t.value,value:v}}o(f,"finalizeSet");let u=[...n.data.values()].map((d,v)=>s._parse(new ti(n,d,n.path,v)));return n.common.async?Promise.all(u).then(d=>f(d)):f(u)}min(e,t){return new Po({...this._def,minSize:{value:e,message:Ge.toString(t)}})}max(e,t){return new Po({...this._def,maxSize:{value:e,message:Ge.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Po,"ZodSet");Po.create=(r,e)=>new Po({valueType:r,minSize:null,maxSize:null,typeName:ot.ZodSet,...Et(e)});var As=class extends _t{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.function)return $e(t,{code:Oe.invalid_type,expected:He.function,received:t.parsedType}),gt;function n(u,d){return wp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xp(),uu].filter(v=>!!v),issueData:{code:Oe.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return wp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xp(),uu].filter(v=>!!v),issueData:{code:Oe.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},f=t.data;if(this._def.returns instanceof Ss){let u=this;return dn(async function(...d){let v=new an([]),x=await u._def.args.parseAsync(d,s).catch(R=>{throw v.addIssue(n(d,R)),v}),E=await Reflect.apply(f,this,x);return await u._def.returns._def.type.parseAsync(E,s).catch(R=>{throw v.addIssue(i(E,R)),v})})}else{let u=this;return dn(function(...d){let v=u._def.args.safeParse(d,s);if(!v.success)throw new an([n(d,v.error)]);let x=Reflect.apply(f,this,v.data),E=u._def.returns.safeParse(x,s);if(!E.success)throw new an([i(x,E.error)]);return E.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new As({...this._def,args:ri.create(e).rest(No.create())})}returns(e){return new As({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new As({args:e||ri.create([]).rest(No.create()),returns:t||No.create(),typeName:ot.ZodFunction,...Et(n)})}};o(As,"ZodFunction");var ya=class extends _t{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(ya,"ZodLazy");ya.create=(r,e)=>new ya({getter:r,typeName:ot.ZodLazy,...Et(e)});var xa=class extends _t{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return $e(t,{received:t.data,code:Oe.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(xa,"ZodLiteral");xa.create=(r,e)=>new xa({value:r,typeName:ot.ZodLiteral,...Et(e)});function kA(r,e){return new so({values:r,typeName:ot.ZodEnum,...Et(e)})}o(kA,"createZodEnum");var so=class extends _t{constructor(){super(...arguments),Wl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{expected:Bt.joinValues(n),received:t.parsedType,code:Oe.invalid_type}),gt}if(_p(this,Wl,"f")||SA(this,Wl,new Set(this._def.values),"f"),!_p(this,Wl,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{received:t.data,code:Oe.invalid_enum_value,options:n}),gt}return dn(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}extract(e,t=this._def){return so.create(e,{...this._def,...t})}exclude(e,t=this._def){return so.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};o(so,"ZodEnum");Wl=new WeakMap;so.create=kA;var wa=class extends _t{constructor(){super(...arguments),Jl.set(this,void 0)}_parse(e){let t=Bt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==He.string&&n.parsedType!==He.number){let i=Bt.objectValues(t);return $e(n,{expected:Bt.joinValues(i),received:n.parsedType,code:Oe.invalid_type}),gt}if(_p(this,Jl,"f")||SA(this,Jl,new Set(Bt.getValidEnumValues(this._def.values)),"f"),!_p(this,Jl,"f").has(e.data)){let i=Bt.objectValues(t);return $e(n,{received:n.data,code:Oe.invalid_enum_value,options:i}),gt}return dn(e.data)}get enum(){return this._def.values}};o(wa,"ZodNativeEnum");Jl=new WeakMap;wa.create=(r,e)=>new wa({values:r,typeName:ot.ZodNativeEnum,...Et(e)});var Ss=class extends _t{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.promise&&t.common.async===!1)return $e(t,{code:Oe.invalid_type,expected:He.promise,received:t.parsedType}),gt;let n=t.parsedType===He.promise?t.data:Promise.resolve(t.data);return dn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(Ss,"ZodPromise");Ss.create=(r,e)=>new Ss({type:r,typeName:ot.ZodPromise,...Et(e)});var On=class extends _t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:f=>{$e(n,f),f.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let f=i.transform(n.data,s);if(n.common.async)return Promise.resolve(f).then(async u=>{if(t.value==="aborted")return gt;let d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?gt:d.status==="dirty"||t.value==="dirty"?fu(d.value):d});{if(t.value==="aborted")return gt;let u=this._def.schema._parseSync({data:f,path:n.path,parent:n});return u.status==="aborted"?gt:u.status==="dirty"||t.value==="dirty"?fu(u.value):u}}if(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"?gt:(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"?gt:(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(!Yl(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=>Yl(f)?Promise.resolve(i.transform(f.value,s)).then(u=>({status:t.value,value:u})):f);Bt.assertNever(i)}};o(On,"ZodEffects");On.create=(r,e,t)=>new On({schema:r,typeName:ot.ZodEffects,effect:e,...Et(t)});On.createWithPreprocess=(r,e,t)=>new On({schema:e,effect:{type:"preprocess",transform:r},typeName:ot.ZodEffects,...Et(t)});var ni=class extends _t{_parse(e){return this._getType(e)===He.undefined?dn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ni,"ZodOptional");ni.create=(r,e)=>new ni({innerType:r,typeName:ot.ZodOptional,...Et(e)});var ao=class extends _t{_parse(e){return this._getType(e)===He.null?dn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ao,"ZodNullable");ao.create=(r,e)=>new ao({innerType:r,typeName:ot.ZodNullable,...Et(e)});var _a=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===He.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(_a,"ZodDefault");_a.create=(r,e)=>new _a({innerType:r,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Et(e)});var Ea=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Xl(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new an(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new an(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(Ea,"ZodCatch");Ea.create=(r,e)=>new Ea({innerType:r,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Et(e)});var Rf=class extends _t{_parse(e){if(this._getType(e)!==He.nan){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(Rf,"ZodNaN");Rf.create=r=>new Rf({typeName:ot.ZodNaN,...Et(r)});var Rz=Symbol("zod_brand"),cu=class extends _t{_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(cu,"ZodBranded");var Aa=class extends _t{_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"?gt:s.status==="dirty"?(t.dirty(),fu(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"?gt: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 Aa({in:e,out:t,typeName:ot.ZodPipeline})}};o(Aa,"ZodPipeline");var Sa=class extends _t{_parse(e){let t=this._def.innerType._parse(e),n=o(i=>(Yl(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return Xl(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};o(Sa,"ZodReadonly");Sa.create=(r,e)=>new Sa({innerType:r,typeName:ot.ZodReadonly,...Et(e)});function IA(r,e={},t){return r?Es.create().superRefine((n,i)=>{var s,f;if(!r(n)){let u=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(f=(s=u.fatal)!==null&&s!==void 0?s:t)!==null&&f!==void 0?f:!0,v=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...v,fatal:d})}}):Es.create()}o(IA,"custom");var Oz={object:sr.lazycreate},ot;(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",r.ZodReadonly="ZodReadonly"})(ot||(ot={}));var Nz=o((r,e={message:`Input not instance of ${r.name}`})=>IA(t=>t instanceof r,e),"instanceOfType"),DA=Dn.create,RA=io.create,Pz=Rf.create,Bz=oo.create,OA=da.create,Lz=Oo.create,Uz=Cf.create,Fz=pa.create,$z=ma.create,qz=Es.create,Hz=No.create,zz=Ni.create,jz=kf.create,Kz=Rn.create,Vz=sr.create,Gz=sr.strictCreate,Wz=ba.create,Jz=If.create,Yz=ga.create,Xz=ri.create,Zz=va.create,Qz=Df.create,ej=Po.create,tj=As.create,rj=ya.create,nj=xa.create,ij=so.create,oj=wa.create,sj=Ss.create,EA=On.create,aj=ni.create,fj=ao.create,cj=On.createWithPreprocess,uj=Aa.create,lj=o(()=>DA().optional(),"ostring"),hj=o(()=>RA().optional(),"onumber"),dj=o(()=>OA().optional(),"oboolean"),pj={string:r=>Dn.create({...r,coerce:!0}),number:r=>io.create({...r,coerce:!0}),boolean:r=>da.create({...r,coerce:!0}),bigint:r=>oo.create({...r,coerce:!0}),date:r=>Oo.create({...r,coerce:!0})},mj=gt,T=Object.freeze({__proto__:null,defaultErrorMap:uu,setErrorMap:mz,getErrorMap:xp,makeIssue:wp,EMPTY_PATH:bz,addIssueToContext:$e,ParseStatus:Tr,INVALID:gt,DIRTY:fu,OK:dn,isAborted:Bv,isDirty:Lv,isValid:Yl,isAsync:Xl,get util(){return Bt},get objectUtil(){return Pv},ZodParsedType:He,getParsedType:ha,ZodType:_t,datetimeRegex:CA,ZodString:Dn,ZodNumber:io,ZodBigInt:oo,ZodBoolean:da,ZodDate:Oo,ZodSymbol:Cf,ZodUndefined:pa,ZodNull:ma,ZodAny:Es,ZodUnknown:No,ZodNever:Ni,ZodVoid:kf,ZodArray:Rn,ZodObject:sr,ZodUnion:ba,ZodDiscriminatedUnion:If,ZodIntersection:ga,ZodTuple:ri,ZodRecord:va,ZodMap:Df,ZodSet:Po,ZodFunction:As,ZodLazy:ya,ZodLiteral:xa,ZodEnum:so,ZodNativeEnum:wa,ZodPromise:Ss,ZodEffects:On,ZodTransformer:On,ZodOptional:ni,ZodNullable:ao,ZodDefault:_a,ZodCatch:Ea,ZodNaN:Rf,BRAND:Rz,ZodBranded:cu,ZodPipeline:Aa,ZodReadonly:Sa,custom:IA,Schema:_t,ZodSchema:_t,late:Oz,get ZodFirstPartyTypeKind(){return ot},coerce:pj,any:qz,array:Kz,bigint:Bz,boolean:OA,date:Lz,discriminatedUnion:Jz,effect:EA,enum:ij,function:tj,instanceof:Nz,intersection:Yz,lazy:rj,literal:nj,map:Qz,nan:Pz,nativeEnum:oj,never:zz,null:$z,nullable:fj,number:RA,object:Vz,oboolean:dj,onumber:hj,optional:aj,ostring:lj,pipeline:uj,preprocess:cj,promise:sj,record:Zz,set:ej,strictObject:Gz,string:DA,symbol:Uz,transformer:EA,tuple:Xz,undefined:Fz,union:Wz,unknown:Hz,void:jz,NEVER:mj,ZodIssueCode:Oe,quotelessJson:pz,ZodError:an});var lu=Symbol("current"),Of=Symbol("previous");var Zl=o((r,{ref:e,refType:t,param:n,header:i,...s}={})=>({...s,...r}),"mergeOpenApi");function NA(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(s){let{zodOpenApi:f,...u}=this._def,d=new this.constructor({...u,zodOpenApi:{openapi:Zl(s,f?.openapi)}});return d._def.zodOpenApi[lu]=d,f&&(d._def.zodOpenApi[Of]=this),d};let e=r.ZodType.prototype.describe;r.ZodType.prototype.describe=function(...s){let f=e.apply(this,s),u=f._def;if(u.zodOpenApi){let d={...u.zodOpenApi};d.openapi=Zl({description:s[0]},d.openapi),d[Of]=this,d[lu]=f,u.zodOpenApi=d}else u.zodOpenApi={openapi:{description:s[0]},[lu]:f};return f};let t=r.ZodObject.prototype.extend;r.ZodObject.prototype.extend=function(...s){let f=t.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=Zl({},d.openapi),d[Of]=this,f._def.zodOpenApi=d}else f._def.zodOpenApi={[Of]:this};return f};let n=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...s){let f=n.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=Zl({},d.openapi),delete d[Of],delete d[lu],f._def.zodOpenApi=d}return f};let i=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...s){let f=i.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=Zl({},d.openapi),delete d[Of],delete d[lu],f._def.zodOpenApi=d}return f}}o(NA,"extendZodWithOpenApi");NA(T);var bj=Object.defineProperty,gj=o((r,e)=>bj(r,"name",{value:e,configurable:!0}),"__name"),Sp=T.array(T.string().or(T.record(T.any()))),Sie=T.object({type:T.string().optional(),narrative:T.string().optional()}),Mp=T.string().or(T.object({id:T.string(),type:T.string(),caption:T.string().optional()})),vj=T.object({type:T.string().min(1).or(T.string().array().nonempty()),latitude:T.number(),longitude:T.number()}),yj=T.object({type:T.string().min(1).or(T.string().array().nonempty()),addressCountry:T.string().optional(),addressCountryCode:T.string().optional(),addressRegion:T.string().optional(),addressLocality:T.string().optional(),streetAddress:T.string().optional(),postOfficeBoxNumber:T.string().optional(),postalCode:T.string().optional(),geo:vj.optional()}),xj=T.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(T.string()),HA=T.object({type:T.string().min(1).or(T.string().array().nonempty()),identifier:T.string(),identifierType:xj}),Ql=T.string().or(T.object({id:T.string().optional(),type:T.string().or(T.string().array().nonempty().optional()),name:T.string().optional(),url:T.string().optional(),phone:T.string().optional(),description:T.string().optional(),endorsement:T.any().array().optional(),image:Mp.optional(),email:T.string().email().optional(),address:yj.optional(),otherIdentifier:HA.array().optional(),official:T.string().optional(),parentOrg:T.any().optional(),familyName:T.string().optional(),givenName:T.string().optional(),additionalName:T.string().optional(),patronymicName:T.string().optional(),honorificPrefix:T.string().optional(),honorificSuffix:T.string().optional(),familyNamePrefix:T.string().optional(),dateOfBirth:T.string().optional()}).catchall(T.any())),Fv=T.object({id:T.string().optional()}).catchall(T.any()),Ep=T.object({type:T.string(),id:T.string()}).catchall(T.any()),PA=T.object({id:T.string(),type:T.string()}).catchall(T.any()),BA=T.object({id:T.string().optional(),type:T.string()}).catchall(T.any()),LA=T.object({type:T.string(),id:T.string().optional()}).catchall(T.any()),UA=T.object({type:T.string().or(T.string().array().nonempty()),id:T.string().optional()}).catchall(T.any()),Ap=T.object({"@context":Sp,id:T.string().optional(),type:T.string().array().nonempty(),issuer:Ql,credentialSubject:Fv.or(Fv.array()),refreshService:BA.or(BA.array()).optional(),credentialSchema:PA.or(PA.array()).optional(),issuanceDate:T.string().optional(),expirationDate:T.string().optional(),credentialStatus:Ep.or(Ep.array()).optional(),name:T.string().optional(),description:T.string().optional(),validFrom:T.string().optional(),validUntil:T.string().optional(),status:Ep.or(Ep.array()).optional(),termsOfUse:LA.or(LA.array()).optional(),evidence:UA.or(UA.array()).optional()}).catchall(T.any()),Bo=T.object({type:T.string(),created:T.string(),challenge:T.string().optional(),domain:T.string().optional(),nonce:T.string().optional(),proofPurpose:T.string(),verificationMethod:T.string(),jws:T.string().optional()}).catchall(T.any()),eh=Ap.extend({proof:Bo.or(Bo.array())}),wj=T.object({"@context":Sp,id:T.string().optional(),type:T.string().or(T.string().array().nonempty()),verifiableCredential:eh.or(eh.array()).optional(),holder:T.string().optional()}).catchall(T.any()),Hv=wj.extend({proof:Bo.or(Bo.array())}),zv=T.object({kty:T.string(),crv:T.string(),x:T.string(),y:T.string().optional(),n:T.string().optional(),d:T.string().optional()}),Cie=zv.omit({d:!0}).extend({d:T.string()}),_j=T.object({alg:T.string(),iv:T.string(),tag:T.string(),epk:zv.partial().optional(),kid:T.string().optional(),apv:T.string().optional(),apu:T.string().optional()}),Ej=T.object({header:_j,encrypted_key:T.string()}),Aj=T.object({protected:T.string(),iv:T.string(),ciphertext:T.string(),tag:T.string(),aad:T.string().optional(),recipients:Ej.array().optional()}),Nf=T.string().or(T.object({"@context":Sp.optional(),id:T.string(),type:T.string(),controller:T.string(),publicKeyJwk:zv.optional(),publicKeyBase58:T.string().optional(),blockChainAccountId:T.string().optional()}).catchall(T.any())),Sj=T.object({id:T.string(),type:T.string().or(T.string().array().nonempty()),serviceEndpoint:T.any().or(T.any().array().nonempty())}).catchall(T.any()),kie=T.object({"@context":Sp,id:T.string(),alsoKnownAs:T.string().optional(),controller:T.string().or(T.string().array().nonempty()).optional(),verificationMethod:Nf.array().optional(),authentication:Nf.array().optional(),assertionMethod:Nf.array().optional(),keyAgreement:Nf.array().optional(),capabilityInvocation:Nf.array().optional(),capabilityDelegation:Nf.array().optional(),publicKey:Nf.array().optional(),service:Sj.array().optional(),proof:Bo.or(Bo.array()).optional()}).catchall(T.any()),Mj=T.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(T.string()),Tp=T.object({type:T.string().array().nonempty(),targetCode:T.string().optional(),targetDescription:T.string().optional(),targetName:T.string(),targetFramework:T.string().optional(),targetType:Mj.optional(),targetUrl:T.string()}),Tj=T.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"]),Cj=Tj.or(T.string()),kj=T.object({id:T.string().optional(),narrative:T.string().optional()}).catchall(T.any()),Ij=T.object({id:T.string(),type:T.string().array().nonempty(),endorsementComment:T.string().optional()}),Dj=Ap.extend({credentialSubject:Ij,proof:Bo.or(Bo.array()).optional()}),Rj=T.object({id:T.string(),"@language":T.string().optional(),version:T.string().optional()}),Oj=T.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(T.string()),Nj=T.object({id:T.string(),type:T.string().array().nonempty(),alignment:Tp.array().optional(),description:T.string().optional(),level:T.string().optional(),name:T.string(),points:T.string().optional()}).catchall(T.any()),Pj=T.object({id:T.string(),type:T.string().array().nonempty(),alignment:Tp.array().optional(),allowedValue:T.string().array().optional(),name:T.string(),requiredLevel:T.string().optional(),requiredValue:T.string().optional(),resultType:Oj,rubricCriterionLevel:Nj.array().optional(),valueMax:T.string().optional(),valueMin:T.string().optional()}).catchall(T.any()),Bj=T.object({id:T.string().optional(),type:T.string().array().nonempty(),alignment:Tp.array().optional(),achievementType:Cj.optional(),creator:Ql.optional(),creditsAvailable:T.number().optional(),criteria:kj,description:T.string(),endorsement:Dj.array().optional(),fieldOfStudy:T.string().optional(),humanCode:T.string().optional(),image:Mp.optional(),"@language":T.string().optional(),name:T.string(),otherIdentifier:HA.array().optional(),related:Rj.array().optional(),resultDescription:Pj.array().optional(),specialization:T.string().optional(),tag:T.string().array().optional(),version:T.string().optional()}).catchall(T.any()),Lj=T.object({type:T.string(),hashed:T.boolean(),identityHash:T.string(),identityType:T.string(),salt:T.string().optional()}),Uj=T.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Fj=T.object({type:T.string().array().nonempty(),achievedLevel:T.string().optional(),alignment:Tp.array().optional(),resultDescription:T.string().optional(),status:Uj.optional(),value:T.string().optional()}).catchall(T.any()),FA=T.object({id:T.string().optional(),type:T.string().array().nonempty(),activityEndDate:T.string().optional(),activityStartDate:T.string().optional(),creditsEarned:T.number().optional(),achievement:Bj.optional(),identifier:Lj.array().optional(),image:Mp.optional(),licenseNumber:T.string().optional(),narrative:T.string().optional(),result:Fj.array().optional(),role:T.string().optional(),source:Ql.optional(),term:T.string().optional()}).catchall(T.any()),$j=T.object({id:T.string().optional(),type:T.string().or(T.string().array().nonempty()),narrative:T.string().optional(),name:T.string().optional(),description:T.string().optional(),genre:T.string().optional(),audience:T.string().optional()}).catchall(T.any()),qj=Ap.extend({name:T.string().optional(),description:T.string().optional(),image:Mp.optional(),credentialSubject:FA.or(FA.array()),endorsement:Ap.array().optional(),evidence:$j.array().optional()}),Die=qj.extend({proof:Bo.or(Bo.array())}),Oie=T.object({checks:T.string().array(),warnings:T.string().array(),errors:T.string().array()}),zA=T.enum(["Success","Failed","Error"]),Nie=zA.enum,Pie=T.object({check:T.string(),status:zA,message:T.string().optional(),details:T.string().optional()}),Bie=T.object({title:T.string().optional(),createdAt:T.string().optional(),issuer:Ql.optional(),issuee:Ql.optional(),credentialSubject:Fv.optional()}),Lie=T.object({id:T.string(),uri:T.string()}).catchall(T.any()),$ie=T.object({limit:T.number(),cursor:T.string().optional(),sort:T.string().optional()}),Nn=T.object({cursor:T.string().optional(),hasMore:T.boolean()}),jA=T.object({encryptedRecord:Aj,fields:T.string().array()}).catchall(T.any()),qie=Nn.extend({records:jA.array()}),Hj=jA.extend({id:T.string()}),Hie=Nn.extend({records:Hj.array()}),$A=gj(r=>{let e=r.match(/^\/(.*)\/([gimsuy]*)$/);if(!e)throw new Error("Invalid RegExp string format");return{pattern:e[1],flags:e[2]}},"parseRegexString"),zj=T.instanceof(RegExp).or(T.string().refine(r=>{try{return $A(r),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(r=>{let{pattern:e,flags:t}=$A(r);try{return new RegExp(e,t)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),Wt=T.string().or(T.object({$in:T.string().array()})).or(T.object({$regex:zj})),jj=T.object({backgroundColor:T.string().optional(),backgroundImage:T.string().optional(),fadeBackgroundImage:T.boolean().optional(),repeatBackgroundImage:T.boolean().optional(),fontColor:T.string().optional(),accentColor:T.string().optional(),accentFontColor:T.string().optional(),idBackgroundImage:T.string().optional(),fadeIdBackgroundImage:T.boolean().optional(),idBackgroundColor:T.string().optional(),repeatIdBackgroundImage:T.boolean().optional()}),Ma=T.object({profileId:T.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:T.string().default("").describe("Human-readable display name for the profile."),shortBio:T.string().default("").describe("Short bio for the profile."),bio:T.string().default("").describe("Longer bio for the profile."),did:T.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:T.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:T.string().optional().describe("Contact email address for the profile."),image:T.string().optional().describe("Profile image URL for the profile."),heroImage:T.string().optional().describe("Hero image URL for the profile."),websiteLink:T.string().optional().describe("Website link for the profile."),isServiceProfile:T.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:T.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:T.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:jj.optional().describe("Display settings for the profile."),role:T.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:T.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),Kie=T.object({profileId:Wt,displayName:Wt,shortBio:Wt,bio:Wt,email:Wt,websiteLink:Wt,isServiceProfile:T.boolean(),type:Wt}).partial(),Vie=Nn.extend({records:Ma.array()}),Gie=T.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),KA=T.object({id:T.string(),created:T.string(),displayName:T.string().default("").optional(),shortBio:T.string().default("").optional(),bio:T.string().default("").optional(),email:T.string().optional(),image:T.string().optional(),heroImage:T.string().optional()}),Wie=Nn.extend({records:KA.extend({did:T.string()}).array()}),Jie=T.object({id:Wt,displayName:Wt,shortBio:Wt,bio:Wt,email:Wt}).partial(),Yie=Nn.extend({records:T.object({profile:Ma,manager:KA.extend({did:T.string()}).optional()}).array()}),Xie=T.object({uri:T.string(),to:T.string(),from:T.string(),sent:T.string().datetime(),received:T.string().datetime().optional()}),VA=T.object({role:T.string(),canEdit:T.boolean(),canIssue:T.boolean(),canRevoke:T.boolean(),canManagePermissions:T.boolean(),canIssueChildren:T.string(),canCreateChildren:T.string(),canEditChildren:T.string(),canRevokeChildren:T.string(),canManageChildrenPermissions:T.string(),canManageChildrenProfiles:T.boolean().default(!1).optional(),canViewAnalytics:T.boolean()}),Kj=T.object({role:Wt,canEdit:T.boolean(),canIssue:T.boolean(),canRevoke:T.boolean(),canManagePermissions:T.boolean(),canIssueChildren:Wt,canCreateChildren:Wt,canEditChildren:Wt,canRevokeChildren:Wt,canManageChildrenPermissions:Wt,canManageChildrenProfiles:T.boolean(),canViewAnalytics:T.boolean()}).partial(),qA=T.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),Vj=T.discriminatedUnion("type",[T.object({type:T.literal(qA.Values.GRANT_PERMISSIONS),data:T.object({claimUri:T.string(),targetUri:T.string(),permissions:VA.partial()})}),T.object({type:T.literal(qA.Values.ADD_ADMIN),data:T.object({claimUri:T.string(),targetUri:T.string()})})]),Zie=T.object({type:Wt,data:T.object({claimUri:Wt,targetUri:Wt,permissions:Kj})}).deepPartial(),Gj=T.object({id:T.string(),createdAt:T.string(),updatedAt:T.string()}).and(Vj),Qie=Nn.extend({records:Gj.array()}),$v=T.enum(["DRAFT","LIVE"]),Wj=T.object({uri:T.string(),name:T.string().optional(),type:T.string().optional(),category:T.string().optional(),status:$v.optional(),autoConnectRecipients:T.boolean().optional(),meta:T.record(T.any()).optional(),claimPermissions:VA.optional()}),eoe=T.object({uri:Wt,name:Wt,type:Wt,category:Wt,meta:T.record(Wt),status:$v.or(T.object({$in:$v.array()})),autoConnectRecipients:T.boolean()}).partial(),toe=Nn.extend({records:Wj.array()}),Jj=T.object({to:Ma,from:T.string(),received:T.string().optional(),uri:T.string().optional()}),roe=Nn.extend({records:Jj.array()}),noe=T.object({endpoint:T.string(),name:T.string(),did:T.string().optional()}),ioe=T.object({ttlSeconds:T.number().optional(),totalUses:T.number().optional()}),Yj=T.object({endpoint:T.string()}),ooe=T.object({signingAuthority:Yj,relationship:T.object({name:T.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:T.string()})}),soe=T.object({boostUri:T.string(),signingAuthority:T.object({endpoint:T.string(),name:T.string()})}),Xj=T.enum(["live","stale","withdrawn"]),Zj=T.object({read:T.object({anonymize:T.boolean().optional(),credentials:T.object({categories:T.record(T.object({required:T.boolean()})).default({})}).default({}),personal:T.record(T.object({required:T.boolean()})).default({})}).default({}),write:T.object({credentials:T.object({categories:T.record(T.object({required:T.boolean()})).default({})}).default({}),personal:T.record(T.object({required:T.boolean()})).default({})}).default({})}),GA=T.object({contract:Zj,owner:Ma,name:T.string(),subtitle:T.string().optional(),description:T.string().optional(),reasonForAccessing:T.string().optional(),image:T.string().optional(),uri:T.string(),needsGuardianConsent:T.boolean().optional(),redirectUrl:T.string().optional(),frontDoorBoostUri:T.string().optional(),createdAt:T.string(),updatedAt:T.string(),expiresAt:T.string().optional(),autoBoosts:T.string().array().optional(),writers:T.array(Ma).optional()}),aoe=Nn.extend({records:GA.omit({owner:!0}).array()}),Qj=T.object({credentials:T.object({categories:T.record(T.string().array()).default({})}),personal:T.record(T.string()).default({}),date:T.string()}),foe=Nn.extend({records:Qj.array()}),eK=T.object({credentials:T.object({category:T.string(),uri:T.string()}).array(),personal:T.record(T.string()).default({}),date:T.string(),contractUri:T.string()}),coe=Nn.extend({records:eK.array()}),WA=T.object({sharing:T.boolean().optional(),shared:T.string().array().optional(),shareAll:T.boolean().optional(),shareUntil:T.string().optional()}),JA=T.object({read:T.object({anonymize:T.boolean().optional(),credentials:T.object({shareAll:T.boolean().optional(),sharing:T.boolean().optional(),categories:T.record(WA).default({})}).default({}),personal:T.record(T.string()).default({})}).default({}),write:T.object({credentials:T.object({categories:T.record(T.boolean()).default({})}).default({}),personal:T.record(T.boolean()).default({})}).default({}),deniedWriters:T.array(T.string()).optional()}),uoe=Nn.extend({records:T.object({expiresAt:T.string().optional(),oneTime:T.boolean().optional(),terms:JA,contract:GA,uri:T.string(),consenter:Ma,status:Xj}).array()}),loe=T.object({read:T.object({anonymize:T.boolean().optional(),credentials:T.object({categories:T.record(T.object({required:T.boolean().optional()})).optional()}).optional(),personal:T.record(T.object({required:T.boolean().optional()})).optional()}).optional(),write:T.object({credentials:T.object({categories:T.record(T.object({required:T.boolean().optional()})).optional()}).optional(),personal:T.record(T.object({required:T.boolean().optional()})).optional()}).optional()}),hoe=T.object({anonymize:T.boolean().optional(),credentials:T.object({categories:T.record(T.boolean()).optional()}).optional(),personal:T.record(T.boolean()).optional()}),doe=T.object({credentials:T.object({categories:T.record(T.boolean()).optional()}).optional(),personal:T.record(T.boolean()).optional(),id:Wt.optional()}),tK=T.object({read:T.object({anonymize:T.boolean().optional(),credentials:T.object({shareAll:T.boolean().optional(),sharing:T.boolean().optional(),categories:T.record(WA.optional()).optional()}).optional(),personal:T.record(T.string()).optional()}).optional(),write:T.object({credentials:T.object({categories:T.record(T.boolean()).optional()}).optional(),personal:T.record(T.boolean()).optional()}).optional()}),qv=T.enum(["consent","update","sync","withdraw","write"]),poe=T.object({terms:tK.optional(),action:qv.or(qv.array()).optional(),date:T.object({$gt:T.string()}).or(T.object({$lt:T.string()})).or(T.object({$eq:T.string()})).optional(),expiresAt:T.object({$gt:T.string()}).or(T.object({$lt:T.string()})).or(T.object({$eq:T.string()})).optional(),oneTime:T.boolean().optional()}),YA=T.object({expiresAt:T.string().optional(),oneTime:T.boolean().optional(),terms:JA.optional(),id:T.string(),action:qv,date:T.string(),uris:T.string().array().optional()}),moe=Nn.extend({records:YA.array()}),rK=T.object({credentialUri:T.string(),termsUri:T.string(),contractUri:T.string(),boostUri:T.string(),category:T.string().optional(),date:T.string()}),boe=Nn.extend({records:rK.array()}),nK=T.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),iK=T.object({title:T.string().optional(),body:T.string().optional()}),oK=T.object({vcUris:T.array(T.string()).optional(),vpUris:T.array(T.string()).optional(),transaction:YA.optional()}),goe=T.object({type:nK,to:Ma.partial().and(T.object({did:T.string()})),from:Ma.partial().and(T.object({did:T.string()})),message:iK.optional(),data:oK.optional(),sent:T.string().datetime().optional()}),sK="auth-grant:",voe=T.object({id:T.string(),name:T.string(),description:T.string().optional(),challenge:T.string().startsWith(sK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:T.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:T.string(),createdAt:T.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:T.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),yoe=T.object({id:T.string()}).catchall(T.any()),aK=T.enum(["active","revoked"]),xoe=T.object({id:Wt,name:Wt,description:Wt,status:aK}).partial();var Cp=o(r=>`lc:ceramic:${r}`,"streamIdToCeramicURI");var jv=T.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 XA={ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var kp=o(async(r,{ceramicEndpoint:e,defaultContentFamily:t}=XA)=>{let n=new Gl(e),i=o(async(R,I,B,Y)=>r.invoke.didResolver(R,Y),"learnCardResolver"),s={...__.getResolver(),web:i},f=new hf({resolver:s});n.did=f;let u=r.invoke.getKey(),d=new _l(i_(u));n.did.setProvider(d),await n.did.authenticate();let v=new $l({ceramic:n}),x=o(async(R,I={},B={},Y)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=t),"pin"in B||(B.pin=!0),Y?.encrypt){r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",Y);let J=Y?.recipients||[];Y?.controllersCanDecrypt&&(J=[...J,...I.controllers]),R=await n?.did?.createDagJWE(R,ZA.default.uniq(J))}return r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,B),(await ei.create(n,R,I,B)).id.toString()},"publishContentToCeramic"),E=o(async R=>{let I=(await v.load(R))?.content;if(r.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await f.decryptDagJWE(I)}catch(B){throw r.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",B),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await eh.or(Hv).parseAsync(R),Cp(await x(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,B)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...B?{recipients:B.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let B=await jv.spa(I);if(!B.success)return;let Y=B.data.split(":")[2];try{return await eh.or(Hv).parseAsync(await E(Y))}catch(P){R.debug?.(P);return}}},methods:{publishContentToCeramic:async(R,I,B)=>Cp(await x(I,{},{},B)),readContentFromCeramic:async(R,I)=>E(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var fK=kp;
822
+ `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function wf(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(wf,"arrRemove");var ca=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=vs(f),d=u.next();!d.done;d=u.next()){var v=d.value;v.remove(this)}}catch(B){e={error:B}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else f.remove(this);var x=this.initialTeardown;if(Tt(x))try{x()}catch(B){s=B instanceof W0?B.errors:[B]}var E=this._finalizers;if(E){this._finalizers=null;try{for(var O=vs(E),R=O.next();!R.done;R=O.next()){var I=R.value;try{DE(I)}catch(B){s=s??[],B instanceof W0?s=to(to([],Zn(s)),Zn(B.errors)):s.push(B)}}}catch(B){n={error:B}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(s)throw new W0(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)DE(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)&&wf(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&wf(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var iv=ca.EMPTY;function J0(r){return r instanceof ca||r&&"closed"in r&&Tt(r.remove)&&Tt(r.add)&&Tt(r.unsubscribe)}o(J0,"isSubscription");function DE(r){Tt(r)?r():r.unsubscribe()}o(DE,"execFinalizer");var ro={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Xc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Xc.delegate;return i?.setTimeout?i.setTimeout.apply(i,to([r,e],Zn(t))):setTimeout.apply(void 0,to([r,e],Zn(t)))},clearTimeout:function(r){var e=Xc.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function Y0(r){Xc.setTimeout(function(){var e=ro.onUnhandledError;if(e)e(r);else throw r})}o(Y0,"reportUnhandledError");function ov(){}o(ov,"noop");var RE=function(){return sv("C",void 0,void 0)}();function OE(r){return sv("E",void 0,r)}o(OE,"errorNotification");function NE(r){return sv("N",r,void 0)}o(NE,"nextNotification");function sv(r,e,t){return{kind:r,value:e,error:t}}o(sv,"createNotification");var _f=null;function Zc(r){if(ro.useDeprecatedSynchronousErrorHandling){var e=!_f;if(e&&(_f={errorThrown:!1,error:null}),r(),e){var t=_f,n=t.errorThrown,i=t.error;if(_f=null,n)throw i}}else r()}o(Zc,"errorContext");function PE(r){ro.useDeprecatedSynchronousErrorHandling&&_f&&(_f.errorThrown=!0,_f.error=r)}o(PE,"captureError");var Rl=function(r){nn(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,J0(t)&&t.add(n)):n.destination=gq,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Z0(t,n,i)},e.prototype.next=function(t){this.isStopped?fv(NE(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?fv(OE(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?fv(RE,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}(ca);var pq=Function.prototype.bind;function av(r,e){return pq.call(r,e)}o(av,"bind");var mq=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){X0(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){X0(n)}else X0(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){X0(t)}},r}(),Z0=function(r){nn(e,r);function e(t,n,i){var s=r.call(this)||this,f;if(Tt(t)||!t)f={next:t??void 0,error:n??void 0,complete:i??void 0};else{var u;s&&ro.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()},f={next:t.next&&av(t.next,u),error:t.error&&av(t.error,u),complete:t.complete&&av(t.complete,u)}):f=t}return s.destination=new mq(f),s}return o(e,"SafeSubscriber"),e}(Rl);function X0(r){ro.useDeprecatedSynchronousErrorHandling?PE(r):Y0(r)}o(X0,"handleUnhandledError");function bq(r){throw r}o(bq,"defaultErrorHandler");function fv(r,e){var t=ro.onStoppedNotification;t&&Xc.setTimeout(function(){return t(r,e)})}o(fv,"handleStoppedNotification");var gq={closed:!0,next:ov,error:bq,complete:ov};var Qc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function eu(r){return r}o(eu,"identity");function BE(r){return r.length===0?eu:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(BE,"pipeFromArray");var Yt=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=yq(e)?e:new Z0(e,t,n);return Zc(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=LE(t),new t(function(i,s){var f=new Z0({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[Qc]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return BE(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=LE(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 LE(r){var e;return(e=r??ro.Promise)!==null&&e!==void 0?e:Promise}o(LE,"getPromiseCtor");function vq(r){return r&&Tt(r.next)&&Tt(r.error)&&Tt(r.complete)}o(vq,"isObserver");function yq(r){return r&&r instanceof Rl||vq(r)&&J0(r)}o(yq,"isSubscriber");function xq(r){return Tt(r?.lift)}o(xq,"hasLift");function Lr(r){return function(e){if(xq(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(Lr,"operate");function Ur(r,e,t,n,i){return new wq(r,e,t,n,i)}o(Ur,"createOperatorSubscriber");var wq=function(r){nn(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(v){try{n(v)}catch(x){t.error(x)}}:r.prototype._next,d._error=s?function(v){try{s(v)}catch(x){t.error(x)}finally{this.unsubscribe()}}:r.prototype._error,d._complete=i?function(){try{i()}catch(v){t.error(v)}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}(Rl);var UE=Yc(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var cv=function(r){nn(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 FE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new UE},e.prototype.next=function(t){var n=this;Zc(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var f=vs(n.currentObservers),u=f.next();!u.done;u=f.next()){var d=u.value;d.next(t)}}catch(v){i={error:v}}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;Zc(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;Zc(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?iv:(this.currentObservers=null,u.push(t),new ca(function(){n.currentObservers=null,wf(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 Yt;return t.source=this,t},e.create=function(t,n){return new FE(t,n)},e}(Yt);var FE=function(r){nn(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:iv},e}(cv);var uv=function(r){nn(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}(cv);var lv={now:function(){return(lv.delegate||Date).now()},delegate:void 0};var $E=function(r){nn(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}(ca);var Ol={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Ol.delegate;return i?.setInterval?i.setInterval.apply(i,to([r,e],Zn(t))):setInterval.apply(void 0,to([r,e],Zn(t)))},clearInterval:function(r){var e=Ol.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var qE=function(r){nn(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),Ol.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&&Ol.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,wf(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}($E);var hv=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=lv.now,r}();var HE=function(r){nn(e,r);function e(t,n){n===void 0&&(n=hv.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}(hv);var _q=new HE(qE),zE=_q;var Q0=new Yt(function(r){return r.complete()});function ep(r){return r&&Tt(r.schedule)}o(ep,"isScheduler");function jE(r){return r[r.length-1]}o(jE,"last");function KE(r){return ep(jE(r))?r.pop():void 0}o(KE,"popScheduler");function VE(r,e){return typeof jE(r)=="number"?r.pop():e}o(VE,"popNumber");var tu=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function tp(r){return Tt(r?.then)}o(tp,"isPromise");function rp(r){return Tt(r[Qc])}o(rp,"isInteropObservable");function np(r){return Symbol.asyncIterator&&Tt(r?.[Symbol.asyncIterator])}o(np,"isAsyncIterable");function ip(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(ip,"createInvalidObservableTypeError");function Eq(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Eq,"getSymbolIterator");var op=Eq();function sp(r){return Tt(r?.[op])}o(sp,"isIterable");function ap(r){return kE(this,arguments,o(function(){var t,n,i,s;return G0(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,xf(t.read())];case 3:return n=f.sent(),i=n.value,s=n.done,s?[4,xf(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,xf(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(ap,"readableStreamLikeToAsyncGenerator");function fp(r){return Tt(r?.getReader)}o(fp,"isReadableStreamLike");function on(r){if(r instanceof Yt)return r;if(r!=null){if(rp(r))return Aq(r);if(tu(r))return Sq(r);if(tp(r))return Mq(r);if(np(r))return GE(r);if(sp(r))return Tq(r);if(fp(r))return Cq(r)}throw ip(r)}o(on,"innerFrom");function Aq(r){return new Yt(function(e){var t=r[Qc]();if(Tt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Aq,"fromInteropObservable");function Sq(r){return new Yt(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(Sq,"fromArrayLike");function Mq(r){return new Yt(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Y0)})}o(Mq,"fromPromise");function Tq(r){return new Yt(function(e){var t,n;try{for(var i=vs(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(Tq,"fromIterable");function GE(r){return new Yt(function(e){kq(r,e).catch(function(t){return e.error(t)})})}o(GE,"fromAsyncIterable");function Cq(r){return GE(ap(r))}o(Cq,"fromReadableStreamLike");function kq(r,e){var t,n,i,s;return CE(this,void 0,void 0,function(){var f,u;return G0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),t=IE(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(kq,"process");function Oi(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(Oi,"executeSchedule");function cp(r,e){return e===void 0&&(e=0),Lr(function(t,n){t.subscribe(Ur(n,function(i){return Oi(n,r,function(){return n.next(i)},e)},function(){return Oi(n,r,function(){return n.complete()},e)},function(i){return Oi(n,r,function(){return n.error(i)},e)}))})}o(cp,"observeOn");function up(r,e){return e===void 0&&(e=0),Lr(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(up,"subscribeOn");function WE(r,e){return on(r).pipe(up(e),cp(e))}o(WE,"scheduleObservable");function JE(r,e){return on(r).pipe(up(e),cp(e))}o(JE,"schedulePromise");function YE(r,e){return new Yt(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(YE,"scheduleArray");function XE(r,e){return new Yt(function(t){var n;return Oi(t,e,function(){n=r[op](),Oi(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 Tt(n?.return)&&n.return()}})}o(XE,"scheduleIterable");function lp(r,e){if(!r)throw new Error("Iterable cannot be null");return new Yt(function(t){Oi(t,e,function(){var n=r[Symbol.asyncIterator]();Oi(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(lp,"scheduleAsyncIterable");function ZE(r,e){return lp(ap(r),e)}o(ZE,"scheduleReadableStreamLike");function QE(r,e){if(r!=null){if(rp(r))return WE(r,e);if(tu(r))return YE(r,e);if(tp(r))return JE(r,e);if(np(r))return lp(r,e);if(sp(r))return XE(r,e);if(fp(r))return ZE(r,e)}throw ip(r)}o(QE,"scheduled");function e9(r,e){return e?QE(r,e):on(r)}o(e9,"from");var hp=Yc(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function t9(r){return r instanceof Date&&!isNaN(r)}o(t9,"isValidDate");function dp(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){n.next(r.call(e,s,i++))}))})}o(dp,"map");var Iq=Array.isArray;function Dq(r,e){return Iq(e)?r.apply(void 0,to([],Zn(e))):r(e)}o(Dq,"callOrApply");function r9(r){return dp(function(e){return Dq(r,e)})}o(r9,"mapOneOrManyArgs");function n9(r,e,t,n,i,s,f,u){var d=[],v=0,x=0,E=!1,O=o(function(){E&&!d.length&&!v&&e.complete()},"checkComplete"),R=o(function(B){return v<n?I(B):d.push(B)},"outerNext"),I=o(function(B){s&&e.next(B),v++;var Y=!1;on(t(B,x++)).subscribe(Ur(e,function(P){i?.(P),s?R(P):e.next(P)},function(){Y=!0},void 0,function(){if(Y)try{v--;for(var P=o(function(){var J=d.shift();f?Oi(e,f,function(){return I(J)}):I(J)},"_loop_1");d.length&&v<n;)P();O()}catch(J){e.error(J)}}))},"doInnerSub");return r.subscribe(Ur(e,R,function(){E=!0,O()})),function(){u?.()}}o(n9,"mergeInternals");function Nl(r,e,t){return t===void 0&&(t=1/0),Tt(e)?Nl(function(n,i){return dp(function(s,f){return e(n,s,i,f)})(on(r(n,i)))},t):(typeof e=="number"&&(t=e),Lr(function(n,i){return n9(n,i,r,t)}))}o(Nl,"mergeMap");function i9(r){return r===void 0&&(r=1/0),Nl(eu,r)}o(i9,"mergeAll");var Rq=["addListener","removeListener"],Oq=["addEventListener","removeEventListener"],Nq=["on","off"];function Pl(r,e,t,n){if(Tt(t)&&(n=t,t=void 0),n)return Pl(r,e,t).pipe(r9(n));var i=Zn(Lq(r)?Oq.map(function(u){return function(d){return r[u](e,d,t)}}):Pq(r)?Rq.map(o9(r,e)):Bq(r)?Nq.map(o9(r,e)):[],2),s=i[0],f=i[1];if(!s&&tu(r))return Nl(function(u){return Pl(u,e,t)})(on(r));if(!s)throw new TypeError("Invalid event target");return new Yt(function(u){var d=o(function(){for(var v=[],x=0;x<arguments.length;x++)v[x]=arguments[x];return u.next(1<v.length?v:v[0])},"handler");return s(d),function(){return f(d)}})}o(Pl,"fromEvent");function o9(r,e){return function(t){return function(n){return r[t](e,n)}}}o(o9,"toCommonHandlerRegistry");function Pq(r){return Tt(r.addListener)&&Tt(r.removeListener)}o(Pq,"isNodeStyleEventEmitter");function Bq(r){return Tt(r.on)&&Tt(r.off)}o(Bq,"isJQueryStyleEventEmitter");function Lq(r){return Tt(r.addEventListener)&&Tt(r.removeEventListener)}o(Lq,"isEventTarget");function Bl(r,e,t){r===void 0&&(r=0),t===void 0&&(t=zE);var n=-1;return e!=null&&(ep(e)?t=e:n=e),new Yt(function(i){var s=t9(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(Bl,"timer");function dv(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=KE(r),n=VE(r,1/0),i=r;return i.length?i.length===1?on(i[0]):i9(n)(e9(i,t)):Q0}o(dv,"merge");function s9(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(s9,"filter");function a9(r){return Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(a9,"defaultIfEmpty");function f9(r){return r<=0?function(){return Q0}:Lr(function(e,t){var n=0;e.subscribe(Ur(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(f9,"take");function c9(r){return r===void 0&&(r=Uq),Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(c9,"throwIfEmpty");function Uq(){return new hp}o(Uq,"defaultErrorFactory");function pv(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?s9(function(i,s){return r(i,s,n)}):eu,f9(1),t?a9(e):c9(function(){return new hp}))}}o(pv,"first");function mv(r,e){return Lr(function(t,n){var i=e??{},s=i.leading,f=s===void 0?!0:s,u=i.trailing,d=u===void 0?!1:u,v=!1,x=null,E=null,O=!1,R=o(function(){E?.unsubscribe(),E=null,d&&(Y(),O&&n.complete())},"endThrottling"),I=o(function(){E=null,O&&n.complete()},"cleanupThrottling"),B=o(function(P){return E=on(r(P)).subscribe(Ur(n,R,I))},"startThrottle"),Y=o(function(){if(v){v=!1;var P=x;x=null,n.next(P),!O&&B(P)}},"send");t.subscribe(Ur(n,function(P){v=!0,x=P,!(E&&!E.closed)&&(f?Y():B(P))},function(){O=!0,!(d&&v&&E&&!E.closed)&&n.complete()}))})}o(mv,"throttle");var u9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(u9||(u9={}));var Ll;(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"})(Ll||(Ll={}));var gv;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(gv||(gv={}));var ys=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(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,bv.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===gv.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,bv.default)(this.state$.value)}async sync(e={}){e={sync:_r.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(ys,"Stream");function ru(){return r=>{}}o(ru,"StreamStatic");var m9=Ut(h9(),1);function d9(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):(dv(...r.map(t=>Pl(t,"abort"))).pipe(pv()).subscribe(()=>{e.abort()}),e.signal)}o(d9,"mergeAbortSignals");var Ul=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=Bl(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}};o(Ul,"TimedAbortSignal");async function p9(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(p9,"abortable");var Fq=60*1e3*3;async function Vr(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let t=e.timeout||Fq,n=new Ul(t),i=e.signal?d9([e.signal,n.signal]):n.signal,s=await p9(i,f=>(0,m9.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(Vr,"fetchJson");var Fl=Ut(Kc(),1);Hi();function xs(r){let e=Ye.asCID(r);if(e)return e;if(typeof r=="string")return Ye.parse(r);if(r instanceof Uint8Array)return Ye.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(xs,"toCID");var b9=0,Qt=class{static streamIdFromState(e){return new it(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,Fl.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Dt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Dt(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(e)&&(t.link=t.link.toString()),Qt.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=Dt(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,Fl.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=xs(t.jws.link),t.linkedBlock=Ft(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ft(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(t)&&(t.link=xs(t.link)),Qt.isAnchorCommit(t)&&(t.proof=xs(t.proof)),t.id&&(t.id=xs(t.id)),t.prev&&(t.prev=xs(t.prev)),t.header?.model&&(t.header.model=Ft(t.header.model,"base64")),t)}static serializeState(e){let t=(0,Fl.default)(e);return t.log=t.log.map(n=>({...n,cid:n.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Ll[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!=b9&&(t.metadata.unique=Dt(t.metadata.unique,"base64")),t.doctype=kn.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,Fl.default)(e);return t.doctype&&(t.type=kn.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(n=>({...n,cid:xs(n.cid)})),t.anchorProof&&(t.anchorProof.txHash=xs(t.anchorProof.txHash),t.anchorProof.root=xs(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Ll[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=it.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=it.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=b9&&(t.metadata.unique=Ft(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Qt.serializeState(e))===JSON.stringify(Qt.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(Qt.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(Qt,"StreamUtils");var $l=class extends uv{next(e){let t=this.value;Qt.statesEqual(t,e)||super.next(e)}};o($l,"StreamStateSubject");var $q=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},Qn,vv={anchor:!0,publish:!0,pin:!0,sync:_r.PREFER_CACHE},qq={sync:_r.PREFER_CACHE},g9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function yv(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=Dt((0,x9.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(yv,"headerFromMetadata");async function v9(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(v9,"getAuthenticatedDID");async function xv(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(xv,"throwReadOnlyError");var ei=Qn=o(class extends ys{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,y9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async create(e,t,n,i={}){i={...vv,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let s=i.asDID?{did:i.asDID}:e,f=await Qn.makeGenesis(s,t,n);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,f,i)}static async createFromGenesis(e,t,n={}){n={...vv,...n},t.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=t.data?await Qn._signDagJWS(e,t):t;return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async deterministic(e,t,n={}){if(n={...vv,...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 Qn.makeGenesis(e,null,t);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async load(e,t,n={}){n={...qq,...n};let i=hn.from(t);if(i.type!=Qn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Qn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,t,n={}){n={...g9,...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={...g9,...t};let i={header:yv(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},s=await Qn._signDagJWS(this.api,i),f=await this.api.applyCommit(this.id,s,t);this.state$.next(f.state)}makeReadOnly(){this.update=xv,this.patch=xv,this.sync=xv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,t,n){let i=await this._makeRawCommit(t,n);return Qn._signDagJWS(e,i)}async _makeRawCommit(e,t){t||(t={});let n=yv(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=N0.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 v9(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=yv(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 rf(f),f}let s={data:t,header:i};return Qn._signDagJWS(e,s)}static async _signDagJWS(e,t){return(await v9(e)).createDagJWS(t)}},"TileDocument");ei.STREAM_TYPE_NAME="tile";ei.STREAM_TYPE_ID=0;ei=Qn=$q([ru()],ei);var T9=Ut(E9(),1);function Xq(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(Xq,"_checkPrivateRedeclaration");function Zq(r,e){return e.get?e.get.call(r):e.value}o(Zq,"_classApplyDescriptorGet");function Qq(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(Qq,"_classApplyDescriptorSet");function M9(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(M9,"_classExtractFieldDescriptor");function Av(r,e){var t=M9(r,e,"get");return Zq(r,t)}o(Av,"_classPrivateFieldGet");function A9(r,e,t){Xq(r,e),e.set(r,t)}o(A9,"_classPrivateFieldInit");function S9(r,e,t){var n=M9(r,e,"set");return Qq(r,n,t),t}o(S9,"_classPrivateFieldSet");function eH(r){return typeof r=="string"||Pt.isInstance(r)||it.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(eH,"keyToQuery");function Sv(r){return typeof r=="string"?hn.from(r).toString():Pt.isInstance(r)||it.isInstance(r)?r.toString():r.streamId.toString()}o(Sv,"keyToString");async function tH(r){let e=await ei.makeGenesis({},null,{...r,deterministic:!0}),t=await it.fromGenesis("tile",e);return{genesis:e,streamId:t}}o(tH,"getDeterministicQuery");var rH=o(()=>Promise.resolve([]),"tempBatchLoadFn"),bp=new WeakMap,Mv=new WeakMap,ql=class extends T9.default{cache(e){if(!Av(this,Mv))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,n){let i=await ei.create(Av(this,bp),e,t,n);return this.cache(i),i}async deterministic(e,t){let n=await tH(e);try{return await super.load(n)}catch{let s=await ei.createFromGenesis(Av(this,bp),n.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,n,i){let s=Sv(e);this.clear(s);let f=await this.load({streamId:s});return await f.update(t,n,i),f}constructor(e){super(rH,{cache:!0,cacheKeyFn:Sv,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),A9(this,bp,{writable:!0,value:void 0}),A9(this,Mv,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(t.map(eH),e.multiqueryTimeout);return t.map(i=>{let s=Sv(i),f=n[s];return f||new Error(`Failed to load stream: ${s}`)})},S9(this,bp,e.ceramic),S9(this,Mv,!!e.cache)}};o(ql,"TileLoader");function Tv(r){return typeof r=="string"?it.fromString(r):r}o(Tv,"typeStreamID");function C9(r,e){let t=new URL(r);for(let[n,i]of Object.entries(e))it.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(C9,"serializeObjectToSearchParams");function Cv(r){let e={};for(let[t,n]of Object.entries(r))it.isInstance(n)?e[t]=n.toString():e[t]=n;return e}o(Cv,"serializeObjectForHttpPost");var sn=class extends Yt{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=Bl(0,n).pipe(mv(()=>this._syncState(this.id,{sync:_r.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new $l(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 sn._load(e,this._apiUrl,t);this.state$.next(Qt.deserializeState(n))}get id(){return new it(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 Vr(f,{method:"post",body:{type:t,genesis:Qt.serializeCommit(n),opts:i}});return new sn(Qt.deserializeState(u),e,s)}static async applyCommit(e,t,n,i,s){let f=new URL("./commits",e),{state:u}=await Vr(f,{method:"post",body:{streamId:t.toString(),commit:Qt.serializeCommit(n),opts:i}});return new sn(Qt.deserializeState(u),e,s)}static async _load(e,t,n){let i=C9(new URL(`./streams/${e}`,t),n),{state:s}=await Vr(i);return s}static async load(e,t,n,i){let s=await sn._load(e,t,i);return new sn(Qt.deserializeState(s),t,n)}static async loadStreamCommits(e,t){let n=new URL(`./commits/${e}`,t),{commits:i}=await Vr(n);return i.map(s=>({cid:s.cid,value:Qt.deserializeCommit(s.value)}))}complete(){this.state$.complete()}};o(sn,"Document");var Ef;(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"})(Ef||(Ef={}));var kv=Ut(Kc(),1);var k9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(k9||(k9={}));var Iv;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(Iv||(Iv={}));var Hl=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(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,kv.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===Iv.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,kv.default)(this.state$.value)}async sync(e={}){e={sync:Ef.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(Hl,"Stream");function I9(){return r=>{}}o(I9,"StreamStatic");function D9(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new ra({address:e,chainId:t})}return new ra(r)}o(D9,"normalizeAccountId");var nH="(?:%[0-9a-fA-F]{2})",R9=`(?:[a-zA-Z0-9._-]|${nH})`,iH="([a-z0-9]+)",oH=`((?:${R9}*:)*(${R9}+))`,O9="[a-zA-Z0-9_.:%-]",sH=`;${O9}+=${O9}*`,aH=`((${sH})*)`,fH="(/[^#?]*)?",cH="([?][^#]*)?",uH="(#.*)?",lH=new RegExp(`^did:${iH}:${oH}${aH}${fH}${cH}${uH}$`);function N9(r){if(r===""||!r)return null;let e=r.match(lH);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(N9,"parse");var B9=Ut(Kc(),1);var hH=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},Af,Dv=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),P9={anchor:!1,publish:!0,sync:Ef.PREFER_CACHE},Rv={anchor:!0,publish:!0},dH={sync:Ef.PREFER_CACHE},Sf=Af=o(class extends Hl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,B9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async fromAccount(e,t,n={}){n={...P9,...n};let i=D9(t),s=Af.makeGenesis(i);return Af.fromGenesis(e,s,n)}static async fromGenesis(e,t,n={}){return n={...P9,...n},e.createStreamFromGenesis(Af.STREAM_TYPE_ID,t,n)}async setDid(e,t,n={}){n={...Rv,...n};let i=typeof e=="string"?e.trim():e.id;if(N9(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={...Rv,...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={...Rv,...t};let n=await e.createLink("");return this.setDidProof(n,t)}static async load(e,t,n={}){n={...dH,...n};let i=hn.from(t);if(i.type!=Af.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Af.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=Dv,this.setDid=Dv,this.sync=Dv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Sf.STREAM_TYPE_NAME="caip10-link";Sf.STREAM_TYPE_ID=1;Sf=Af=hH([I9()],Sf);Hi();Fa();var vA=Ut(bA(),1);var sz=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},Ro,az={sync:_r.PREFER_CACHE};async function gA(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(gA,"_ensureAuthenticated");async function fz(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(fz,"throwReadOnlyError");var la=Ro=o(class extends ys{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Ro.MODEL}}static async create(e,t,n){Ro.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:_r.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Ro._makeGenesis(e,t,n);return await e.createStreamFromGenesis(Ro.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={...az,...n};let i=hn.from(t);if(i.type!=Ro.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ro.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 Ro._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 gA(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:Ro.MODEL.bytes};return{data:t,header:i}}makeReadOnly(){this.sync=fz,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,t){return await gA(e),e.did.createDagJWS(t)}},"Model");la.STREAM_TYPE_NAME="model";la.STREAM_TYPE_ID=2;la.MODEL=function(){let r=rf("model-v1"),e=vA.default.encode(r,"identity"),t=es(Sc,e),n=Ye.createV1(Sc,t);return new it("UNLOADABLE",n)}();la=Ro=sz([ru()],la);var wA=Ut(Ga(),1);var cz=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},no,uz={anchor:!0,publish:!0,pin:!0,sync:_r.NEVER_SYNC,syncTimeoutSeconds:0},lz={anchor:!1,publish:!1,pin:!0,sync:_r.PREFER_CACHE},hz={sync:_r.PREFER_CACHE},yA={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function xA(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(xA,"_ensureAuthenticated");async function Pv(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Pv,"throwReadOnlyError");var Tf=no=o(class extends ys{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={...uz,...i};let s=i.asDID?{did:i.asDID}:e,f=await no._makeGenesis(s,t,n);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,f,i)}static async single(e,t,n={}){n={...lz,...n};let i=n.asDID?{did:n.asDID}:e;t={...t,deterministic:!0};let s=await no._makeGenesis(i,null,t);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,s,n)}static async load(e,t,n={}){n={...hz,...n};let i=hn.from(t);if(i.type!=no.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${no.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,t={}){t={...yA,...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={...yA,...t};let n={data:e,prev:this.tip,id:this.id.cid},i=await no._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}makeReadOnly(){this.replace=Pv,this.patch=Pv,this.sync=Pv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return no._signDagJWS(e,n)}_makeRawCommit(e){return{data:N0.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?(rf(i),i):no._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 xA(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,wA.randomBytes)(12)),{data:t,header:s}}static async _signDagJWS(e,t){return await xA(e),e.did.createDagJWS(t)}},"ModelInstanceDocument");Tf.STREAM_TYPE_NAME="MID";Tf.STREAM_TYPE_ID=3;Tf=no=cz([ru()],Tf);var Kl=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 Vr(i,{method:"post",body:n})}async rm(e,t){let n=new URL(`./pins/${e}`,this._apiUrl);await Vr(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 Vr(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(Kl,"RemotePinApi");var Vl=class{constructor(e){this._fetchJson=Vr,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:Cv(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:Cv(e)});return{edges:t.edges.map(i=>({cursor:i.cursor,node:Qt.deserializeState(i.node)})),pageInfo:t.pageInfo}}};o(Vl,"RemoteIndexApi");var Gl=class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=Vr,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=>it.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(Gl,"RemoteAdminApi");var dz="/api/v0/",pz="http://localhost:7007",mz={syncInterval:5e3},bz={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},gz={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},_A={sync:_r.PREFER_CACHE},Wl=class{constructor(e=pz,t={}){this._config={...mz,...t},this._apiUrl=new URL(dz,e),this._streamCache=new Map,this.context={api:this},this.pin=new Kl(this._apiUrl),this.index=new Vl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Gl(this._apiUrl,n),this._streamConstructors={[Sf.STREAM_TYPE_ID]:Sf,[la.STREAM_TYPE_ID]:la,[Tf.STREAM_TYPE_ID]:Tf,[ei.STREAM_TYPE_ID]:ei}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,n={}){n={...gz,...n};let i=await sn.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),s=this._streamCache.get(i.id.toString());return s?(Qt.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={..._A,...t};let n=hn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,t):(i=await sn.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 Vr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((f,u)=>{let[d,v]=u,x=Qt.deserializeState(v),E=new sn(x,this._apiUrl,this._config.syncInterval);return f[d]=this.buildStreamFromDocument(E),f},{})}loadStreamCommits(e){let t=Tv(e);return sn.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,n={}){n={...bz,...n};let i=Tv(e),s=await sn.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={..._A,...t};let{anchorStatus:n}=await Vr(`${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 sn(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 Vr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Wl,"CeramicClient");var Bt;(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})(Bt||(Bt={}));var Lv;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Lv||(Lv={}));var He=Bt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ha=o(r=>{switch(typeof r){case"undefined":return He.undefined;case"string":return He.string;case"number":return isNaN(r)?He.nan:He.number;case"boolean":return He.boolean;case"function":return He.function;case"bigint":return He.bigint;case"symbol":return He.symbol;case"object":return Array.isArray(r)?He.array:r===null?He.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?He.promise:typeof Map<"u"&&r instanceof Map?He.map:typeof Set<"u"&&r instanceof Set?He.set:typeof Date<"u"&&r instanceof Date?He.date:He.object;default:return He.unknown}},"getParsedType"),Oe=Bt.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"]),vz=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),an=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 v=f.path[d];d===f.path.length-1?(u[v]=u[v]||{_errors:[]},u[v]._errors.push(t(f))):u[v]=u[v]||{_errors:[]},u=u[v],d++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof an))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Bt.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(an,"ZodError");an.create=r=>new an(r);var uu=o((r,e)=>{let t;switch(r.code){case Oe.invalid_type:r.received===He.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Bt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${Bt.joinValues(r.keys,", ")}`;break;case Oe.invalid_union:t="Invalid input";break;case Oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Bt.joinValues(r.options)}`;break;case Oe.invalid_enum_value:t=`Invalid enum value. Expected ${Bt.joinValues(r.options)}, received '${r.received}'`;break;case Oe.invalid_arguments:t="Invalid function arguments";break;case Oe.invalid_return_type:t="Invalid function return type";break;case Oe.invalid_date:t="Invalid date";break;case Oe.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"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}"`:Bt.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Oe.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(Number(r.minimum))}`:t="Invalid input";break;case Oe.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==="bigint"?t=`BigInt 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(Number(r.maximum))}`:t="Invalid input";break;case Oe.custom:t="Invalid input";break;case Oe.invalid_intersection_types:t="Intersection results could not be merged";break;case Oe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,Bt.assertNever(r)}return{message:t}},"errorMap"),SA=uu;function yz(r){SA=r}o(yz,"setErrorMap");function wp(){return SA}o(wp,"getErrorMap");var _p=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],f={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let u="",d=n.filter(v=>!!v).slice().reverse();for(let v of d)u=v(f,{data:e,defaultError:u}).message;return{...i,path:s,message:u}},"makeIssue"),xz=[];function $e(r,e){let t=wp(),n=_p({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===uu?void 0:uu].filter(i=>!!i)});r.common.issues.push(n)}o($e,"addIssueToContext");var Tr=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 gt;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){let s=await i.key,f=await i.value;n.push({key:s,value:f})}return Tr.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 gt;s.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof f.value<"u"||i.alwaysSet)&&(n[s.value]=f.value)}return{status:e.value,value:n}}};o(Tr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),fu=o(r=>({status:"dirty",value:r}),"DIRTY"),dn=o(r=>({status:"valid",value:r}),"OK"),Uv=o(r=>r.status==="aborted","isAborted"),Fv=o(r=>r.status==="dirty","isDirty"),Xl=o(r=>r.status==="valid","isValid"),Zl=o(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Ep(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)}o(Ep,"__classPrivateFieldGet");function MA(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}o(MA,"__classPrivateFieldSet");var Ge;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(Ge||(Ge={}));var Jl,Yl,ti=class{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(ti,"ParseInputLazyPath");var EA=o((r,e)=>{if(Xl(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new an(r.common.issues);return this._error=t,this._error}}},"handleResult");function Et(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)=>{var d,v;let{message:x}=r;return f.code==="invalid_enum_value"?{message:x??u.defaultError}:typeof u.data>"u"?{message:(d=x??n)!==null&&d!==void 0?d:u.defaultError}:f.code!=="invalid_type"?{message:u.defaultError}:{message:(v=x??t)!==null&&v!==void 0?v:u.defaultError}},"customMap"),description:i}}o(Et,"processCreateParams");var _t=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.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ha(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ha(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tr,ctx:{common:e.parent.common,data:e.data,parsedType:ha(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Zl(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:ha(e)},s=this._parseSync({data:e,path:i.path,parent:i});return EA(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:ha(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Zl(i)?i:Promise.resolve(i));return EA(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:Oe.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 On({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ni.create(this,this._def)}nullable(){return ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rn.create(this,this._def)}promise(){return Ss.create(this,this._def)}or(e){return ba.create([this,e],this._def)}and(e){return ga.create(this,e,this._def)}transform(e){return new On({...Et(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new _a({...Et(this._def),innerType:this,defaultValue:t,typeName:ot.ZodDefault})}brand(){return new cu({typeName:ot.ZodBranded,type:this,...Et(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ea({...Et(this._def),innerType:this,catchValue:t,typeName:ot.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Aa.create(this,e)}readonly(){return Sa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(_t,"ZodType");var wz=/^c[^\s-]{8,}$/i,_z=/^[0-9a-z]+$/,Ez=/^[0-9A-HJKMNP-TV-Z]{26}$/,Az=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Sz=/^[a-z0-9_-]{21}$/i,Mz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Tz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Bv,kz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Iz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Dz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Rz=new RegExp(`^${TA}$`);function CA(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}o(CA,"timeRegexSource");function Oz(r){return new RegExp(`^${CA(r)}$`)}o(Oz,"timeRegex");function kA(r){let e=`${TA}T${CA(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}o(kA,"datetimeRegex");function Nz(r,e){return!!((e==="v4"||!e)&&kz.test(r)||(e==="v6"||!e)&&Iz.test(r))}o(Nz,"isValidIP");var Dn=class extends _t{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==He.string){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.string,received:s.parsedType}),gt}let n=new Tr,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.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),$e(i,{code:Oe.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?$e(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&$e(i,{code:Oe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Tz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"email",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Bv||(Bv=new RegExp(Cz,"u")),Bv.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"emoji",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Az.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"uuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Sz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"nanoid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")wz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")_z.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid2",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Ez.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ulid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),$e(i,{validation:"url",code:Oe.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),$e(i,{validation:"regex",code:Oe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?kA(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Rz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Oz(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Mz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"duration",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Nz(e.data,s.version)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ip",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Dz.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"base64",code:Oe.invalid_string,message:s.message}),n.dirty()):Bt.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:Oe.invalid_string,...Ge.errToObj(n)})}_addCheck(e){return new Dn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!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,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Ge.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Ge.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ge.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ge.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ge.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ge.errToObj(t)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}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(Dn,"ZodString");Dn.create=r=>{var e;return new Dn({checks:[],typeName:ot.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Et(r)})};function Pz(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(Pz,"floatSafeRemainder");var io=class extends _t{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)!==He.number){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.number,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="int"?Bt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.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),$e(n,{code:Oe.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),$e(n,{code:Oe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Pz(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_finite,message:s.message}),i.dirty()):Bt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new io({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new io({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.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"||e.kind==="multipleOf"&&Bt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};o(io,"ZodNumber");io.create=r=>new io({checks:[],typeName:ot.ZodNumber,coerce:r?.coerce||!1,...Et(r)});var oo=class extends _t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==He.bigint){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.bigint,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Bt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new oo({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new oo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};o(oo,"ZodBigInt");oo.create=r=>{var e;return new oo({checks:[],typeName:ot.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...Et(r)})};var da=class extends _t{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==He.boolean){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.boolean,received:n.parsedType}),gt}return dn(e.data)}};o(da,"ZodBoolean");da.create=r=>new da({typeName:ot.ZodBoolean,coerce:r?.coerce||!1,...Et(r)});var Oo=class extends _t{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==He.date){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:He.date,received:s.parsedType}),gt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_date}),gt}let n=new Tr,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.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),$e(i,{code:Oe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Bt.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Oo({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.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(Oo,"ZodDate");Oo.create=r=>new Oo({checks:[],coerce:r?.coerce||!1,typeName:ot.ZodDate,...Et(r)});var Cf=class extends _t{_parse(e){if(this._getType(e)!==He.symbol){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.symbol,received:n.parsedType}),gt}return dn(e.data)}};o(Cf,"ZodSymbol");Cf.create=r=>new Cf({typeName:ot.ZodSymbol,...Et(r)});var pa=class extends _t{_parse(e){if(this._getType(e)!==He.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.undefined,received:n.parsedType}),gt}return dn(e.data)}};o(pa,"ZodUndefined");pa.create=r=>new pa({typeName:ot.ZodUndefined,...Et(r)});var ma=class extends _t{_parse(e){if(this._getType(e)!==He.null){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.null,received:n.parsedType}),gt}return dn(e.data)}};o(ma,"ZodNull");ma.create=r=>new ma({typeName:ot.ZodNull,...Et(r)});var Es=class extends _t{constructor(){super(...arguments),this._any=!0}_parse(e){return dn(e.data)}};o(Es,"ZodAny");Es.create=r=>new Es({typeName:ot.ZodAny,...Et(r)});var No=class extends _t{constructor(){super(...arguments),this._unknown=!0}_parse(e){return dn(e.data)}};o(No,"ZodUnknown");No.create=r=>new No({typeName:ot.ZodUnknown,...Et(r)});var Ni=class extends _t{_parse(e){let t=this._getOrReturnCtx(e);return $e(t,{code:Oe.invalid_type,expected:He.never,received:t.parsedType}),gt}};o(Ni,"ZodNever");Ni.create=r=>new Ni({typeName:ot.ZodNever,...Et(r)});var kf=class extends _t{_parse(e){if(this._getType(e)!==He.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.void,received:n.parsedType}),gt}return dn(e.data)}};o(kf,"ZodVoid");kf.create=r=>new kf({typeName:ot.ZodVoid,...Et(r)});var Rn=class extends _t{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==He.array)return $e(t,{code:Oe.invalid_type,expected:He.array,received:t.parsedType}),gt;if(i.exactLength!==null){let f=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(f||u)&&($e(t,{code:f?Oe.too_big:Oe.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&&($e(t,{code:Oe.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&&($e(t,{code:Oe.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 ti(t,f,t.path,u)))).then(f=>Tr.mergeArray(n,f));let s=[...t.data].map((f,u)=>i.type._parseSync(new ti(t,f,t.path,u)));return Tr.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Rn({...this._def,minLength:{value:e,message:Ge.toString(t)}})}max(e,t){return new Rn({...this._def,maxLength:{value:e,message:Ge.toString(t)}})}length(e,t){return new Rn({...this._def,exactLength:{value:e,message:Ge.toString(t)}})}nonempty(e){return this.min(1,e)}};o(Rn,"ZodArray");Rn.create=(r,e)=>new Rn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...Et(e)});function au(r){if(r instanceof sr){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=ni.create(au(n))}return new sr({...r._def,shape:()=>e})}else return r instanceof Rn?new Rn({...r._def,type:au(r.element)}):r instanceof ni?ni.create(au(r.unwrap())):r instanceof ao?ao.create(au(r.unwrap())):r instanceof ri?ri.create(r.items.map(e=>au(e))):r}o(au,"deepPartialify");var sr=class extends _t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Bt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==He.object){let v=this._getOrReturnCtx(e);return $e(v,{code:Oe.invalid_type,expected:He.object,received:v.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:f}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ni&&this._def.unknownKeys==="strip"))for(let v in i.data)f.includes(v)||u.push(v);let d=[];for(let v of f){let x=s[v],E=i.data[v];d.push({key:{status:"valid",value:v},value:x._parse(new ti(i,E,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Ni){let v=this._def.unknownKeys;if(v==="passthrough")for(let x of u)d.push({key:{status:"valid",value:x},value:{status:"valid",value:i.data[x]}});else if(v==="strict")u.length>0&&($e(i,{code:Oe.unrecognized_keys,keys:u}),n.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let v=this._def.catchall;for(let x of u){let E=i.data[x];d.push({key:{status:"valid",value:x},value:v._parse(new ti(i,E,i.path,x)),alwaysSet:x in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let v=[];for(let x of d){let E=await x.key,O=await x.value;v.push({key:E,value:O,alwaysSet:x.alwaysSet})}return v}).then(v=>Tr.mergeObjectSync(n,v)):Tr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new sr({...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=Ge.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(e){return new sr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new sr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new sr({...this._def,catchall:e})}pick(e){let t={};return Bt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}omit(e){let t={};return Bt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}deepPartial(){return au(this)}partial(e){let t={};return Bt.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new sr({...this._def,shape:()=>t})}required(e){let t={};return Bt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ni;)s=s._def.innerType;t[n]=s}}),new sr({...this._def,shape:()=>t})}keyof(){return IA(Bt.objectKeys(this.shape))}};o(sr,"ZodObject");sr.create=(r,e)=>new sr({shape:()=>r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...Et(e)});sr.strictCreate=(r,e)=>new sr({shape:()=>r,unknownKeys:"strict",catchall:Ni.create(),typeName:ot.ZodObject,...Et(e)});sr.lazycreate=(r,e)=>new sr({shape:r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...Et(e)});var ba=class extends _t{_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 an(u.ctx.common.issues));return $e(t,{code:Oe.invalid_union,unionErrors:f}),gt}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 v={...t,common:{...t.common,issues:[]},parent:null},x=d._parseSync({data:t.data,path:t.path,parent:v});if(x.status==="valid")return x;x.status==="dirty"&&!s&&(s={result:x,ctx:v}),v.common.issues.length&&f.push(v.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let u=f.map(d=>new an(d));return $e(t,{code:Oe.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ba,"ZodUnion");ba.create=(r,e)=>new ba({options:r,typeName:ot.ZodUnion,...Et(e)});var _s=o(r=>r instanceof ya?_s(r.schema):r instanceof On?_s(r.innerType()):r instanceof xa?[r.value]:r instanceof so?r.options:r instanceof wa?Bt.objectValues(r.enum):r instanceof _a?_s(r._def.innerType):r instanceof pa?[void 0]:r instanceof ma?[null]:r instanceof ni?[void 0,..._s(r.unwrap())]:r instanceof ao?[null,..._s(r.unwrap())]:r instanceof cu||r instanceof Sa?_s(r.unwrap()):r instanceof Ea?_s(r._def.innerType):[],"getDiscriminator"),If=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.object)return $e(t,{code:Oe.invalid_type,expected:He.object,received:t.parsedType}),gt;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}):($e(t,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}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=_s(s.shape[e]);if(!f.length)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 If({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...Et(n)})}};o(If,"ZodDiscriminatedUnion");function $v(r,e){let t=ha(r),n=ha(e);if(r===e)return{valid:!0,data:r};if(t===He.object&&n===He.object){let i=Bt.objectKeys(e),s=Bt.objectKeys(r).filter(u=>i.indexOf(u)!==-1),f={...r,...e};for(let u of s){let d=$v(r[u],e[u]);if(!d.valid)return{valid:!1};f[u]=d.data}return{valid:!0,data:f}}else if(t===He.array&&n===He.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=$v(f,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===He.date&&n===He.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o($v,"mergeValues");var ga=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,f)=>{if(Uv(s)||Uv(f))return gt;let u=$v(s.value,f.value);return u.valid?((Fv(s)||Fv(f))&&t.dirty(),{status:t.value,value:u.data}):($e(n,{code:Oe.invalid_intersection_types}),gt)},"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(ga,"ZodIntersection");ga.create=(r,e,t)=>new ga({left:r,right:e,typeName:ot.ZodIntersection,...Et(t)});var ri=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==He.array)return $e(n,{code:Oe.invalid_type,expected:He.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return $e(n,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&($e(n,{code:Oe.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 ti(n,f,n.path,u)):null}).filter(f=>!!f);return n.common.async?Promise.all(s).then(f=>Tr.mergeArray(t,f)):Tr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ri({...this._def,rest:e})}};o(ri,"ZodTuple");ri.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ri({items:r,typeName:ot.ZodTuple,rest:null,...Et(e)})};var va=class extends _t{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!==He.object)return $e(n,{code:Oe.invalid_type,expected:He.object,received:n.parsedType}),gt;let i=[],s=this._def.keyType,f=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new ti(n,u,n.path,u)),value:f._parse(new ti(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?Tr.mergeObjectAsync(t,i):Tr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _t?new va({keyType:e,valueType:t,typeName:ot.ZodRecord,...Et(n)}):new va({keyType:Dn.create(),valueType:e,typeName:ot.ZodRecord,...Et(t)})}};o(va,"ZodRecord");var Df=class extends _t{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!==He.map)return $e(n,{code:Oe.invalid_type,expected:He.map,received:n.parsedType}),gt;let i=this._def.keyType,s=this._def.valueType,f=[...n.data.entries()].map(([u,d],v)=>({key:i._parse(new ti(n,u,n.path,[v,"key"])),value:s._parse(new ti(n,d,n.path,[v,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of f){let v=await d.key,x=await d.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&t.dirty(),u.set(v.value,x.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let d of f){let v=d.key,x=d.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&t.dirty(),u.set(v.value,x.value)}return{status:t.value,value:u}}}};o(Df,"ZodMap");Df.create=(r,e,t)=>new Df({valueType:e,keyType:r,typeName:ot.ZodMap,...Et(t)});var Po=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==He.set)return $e(n,{code:Oe.invalid_type,expected:He.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&($e(n,{code:Oe.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&&($e(n,{code:Oe.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 v=new Set;for(let x of d){if(x.status==="aborted")return gt;x.status==="dirty"&&t.dirty(),v.add(x.value)}return{status:t.value,value:v}}o(f,"finalizeSet");let u=[...n.data.values()].map((d,v)=>s._parse(new ti(n,d,n.path,v)));return n.common.async?Promise.all(u).then(d=>f(d)):f(u)}min(e,t){return new Po({...this._def,minSize:{value:e,message:Ge.toString(t)}})}max(e,t){return new Po({...this._def,maxSize:{value:e,message:Ge.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Po,"ZodSet");Po.create=(r,e)=>new Po({valueType:r,minSize:null,maxSize:null,typeName:ot.ZodSet,...Et(e)});var As=class extends _t{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.function)return $e(t,{code:Oe.invalid_type,expected:He.function,received:t.parsedType}),gt;function n(u,d){return _p({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wp(),uu].filter(v=>!!v),issueData:{code:Oe.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return _p({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wp(),uu].filter(v=>!!v),issueData:{code:Oe.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},f=t.data;if(this._def.returns instanceof Ss){let u=this;return dn(async function(...d){let v=new an([]),x=await u._def.args.parseAsync(d,s).catch(R=>{throw v.addIssue(n(d,R)),v}),E=await Reflect.apply(f,this,x);return await u._def.returns._def.type.parseAsync(E,s).catch(R=>{throw v.addIssue(i(E,R)),v})})}else{let u=this;return dn(function(...d){let v=u._def.args.safeParse(d,s);if(!v.success)throw new an([n(d,v.error)]);let x=Reflect.apply(f,this,v.data),E=u._def.returns.safeParse(x,s);if(!E.success)throw new an([i(x,E.error)]);return E.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new As({...this._def,args:ri.create(e).rest(No.create())})}returns(e){return new As({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new As({args:e||ri.create([]).rest(No.create()),returns:t||No.create(),typeName:ot.ZodFunction,...Et(n)})}};o(As,"ZodFunction");var ya=class extends _t{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(ya,"ZodLazy");ya.create=(r,e)=>new ya({getter:r,typeName:ot.ZodLazy,...Et(e)});var xa=class extends _t{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return $e(t,{received:t.data,code:Oe.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(xa,"ZodLiteral");xa.create=(r,e)=>new xa({value:r,typeName:ot.ZodLiteral,...Et(e)});function IA(r,e){return new so({values:r,typeName:ot.ZodEnum,...Et(e)})}o(IA,"createZodEnum");var so=class extends _t{constructor(){super(...arguments),Jl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{expected:Bt.joinValues(n),received:t.parsedType,code:Oe.invalid_type}),gt}if(Ep(this,Jl,"f")||MA(this,Jl,new Set(this._def.values),"f"),!Ep(this,Jl,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{received:t.data,code:Oe.invalid_enum_value,options:n}),gt}return dn(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}extract(e,t=this._def){return so.create(e,{...this._def,...t})}exclude(e,t=this._def){return so.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};o(so,"ZodEnum");Jl=new WeakMap;so.create=IA;var wa=class extends _t{constructor(){super(...arguments),Yl.set(this,void 0)}_parse(e){let t=Bt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==He.string&&n.parsedType!==He.number){let i=Bt.objectValues(t);return $e(n,{expected:Bt.joinValues(i),received:n.parsedType,code:Oe.invalid_type}),gt}if(Ep(this,Yl,"f")||MA(this,Yl,new Set(Bt.getValidEnumValues(this._def.values)),"f"),!Ep(this,Yl,"f").has(e.data)){let i=Bt.objectValues(t);return $e(n,{received:n.data,code:Oe.invalid_enum_value,options:i}),gt}return dn(e.data)}get enum(){return this._def.values}};o(wa,"ZodNativeEnum");Yl=new WeakMap;wa.create=(r,e)=>new wa({values:r,typeName:ot.ZodNativeEnum,...Et(e)});var Ss=class extends _t{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.promise&&t.common.async===!1)return $e(t,{code:Oe.invalid_type,expected:He.promise,received:t.parsedType}),gt;let n=t.parsedType===He.promise?t.data:Promise.resolve(t.data);return dn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(Ss,"ZodPromise");Ss.create=(r,e)=>new Ss({type:r,typeName:ot.ZodPromise,...Et(e)});var On=class extends _t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:f=>{$e(n,f),f.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let f=i.transform(n.data,s);if(n.common.async)return Promise.resolve(f).then(async u=>{if(t.value==="aborted")return gt;let d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?gt:d.status==="dirty"||t.value==="dirty"?fu(d.value):d});{if(t.value==="aborted")return gt;let u=this._def.schema._parseSync({data:f,path:n.path,parent:n});return u.status==="aborted"?gt:u.status==="dirty"||t.value==="dirty"?fu(u.value):u}}if(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"?gt:(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"?gt:(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(!Xl(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=>Xl(f)?Promise.resolve(i.transform(f.value,s)).then(u=>({status:t.value,value:u})):f);Bt.assertNever(i)}};o(On,"ZodEffects");On.create=(r,e,t)=>new On({schema:r,typeName:ot.ZodEffects,effect:e,...Et(t)});On.createWithPreprocess=(r,e,t)=>new On({schema:e,effect:{type:"preprocess",transform:r},typeName:ot.ZodEffects,...Et(t)});var ni=class extends _t{_parse(e){return this._getType(e)===He.undefined?dn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ni,"ZodOptional");ni.create=(r,e)=>new ni({innerType:r,typeName:ot.ZodOptional,...Et(e)});var ao=class extends _t{_parse(e){return this._getType(e)===He.null?dn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ao,"ZodNullable");ao.create=(r,e)=>new ao({innerType:r,typeName:ot.ZodNullable,...Et(e)});var _a=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===He.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(_a,"ZodDefault");_a.create=(r,e)=>new _a({innerType:r,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Et(e)});var Ea=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Zl(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new an(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new an(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(Ea,"ZodCatch");Ea.create=(r,e)=>new Ea({innerType:r,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Et(e)});var Rf=class extends _t{_parse(e){if(this._getType(e)!==He.nan){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:He.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(Rf,"ZodNaN");Rf.create=r=>new Rf({typeName:ot.ZodNaN,...Et(r)});var Bz=Symbol("zod_brand"),cu=class extends _t{_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(cu,"ZodBranded");var Aa=class extends _t{_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"?gt:s.status==="dirty"?(t.dirty(),fu(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"?gt: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 Aa({in:e,out:t,typeName:ot.ZodPipeline})}};o(Aa,"ZodPipeline");var Sa=class extends _t{_parse(e){let t=this._def.innerType._parse(e),n=o(i=>(Xl(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return Zl(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};o(Sa,"ZodReadonly");Sa.create=(r,e)=>new Sa({innerType:r,typeName:ot.ZodReadonly,...Et(e)});function DA(r,e={},t){return r?Es.create().superRefine((n,i)=>{var s,f;if(!r(n)){let u=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(f=(s=u.fatal)!==null&&s!==void 0?s:t)!==null&&f!==void 0?f:!0,v=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...v,fatal:d})}}):Es.create()}o(DA,"custom");var Lz={object:sr.lazycreate},ot;(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",r.ZodReadonly="ZodReadonly"})(ot||(ot={}));var Uz=o((r,e={message:`Input not instance of ${r.name}`})=>DA(t=>t instanceof r,e),"instanceOfType"),RA=Dn.create,OA=io.create,Fz=Rf.create,$z=oo.create,NA=da.create,qz=Oo.create,Hz=Cf.create,zz=pa.create,jz=ma.create,Kz=Es.create,Vz=No.create,Gz=Ni.create,Wz=kf.create,Jz=Rn.create,Yz=sr.create,Xz=sr.strictCreate,Zz=ba.create,Qz=If.create,ej=ga.create,tj=ri.create,rj=va.create,nj=Df.create,ij=Po.create,oj=As.create,sj=ya.create,aj=xa.create,fj=so.create,cj=wa.create,uj=Ss.create,AA=On.create,lj=ni.create,hj=ao.create,dj=On.createWithPreprocess,pj=Aa.create,mj=o(()=>RA().optional(),"ostring"),bj=o(()=>OA().optional(),"onumber"),gj=o(()=>NA().optional(),"oboolean"),vj={string:r=>Dn.create({...r,coerce:!0}),number:r=>io.create({...r,coerce:!0}),boolean:r=>da.create({...r,coerce:!0}),bigint:r=>oo.create({...r,coerce:!0}),date:r=>Oo.create({...r,coerce:!0})},yj=gt,A=Object.freeze({__proto__:null,defaultErrorMap:uu,setErrorMap:yz,getErrorMap:wp,makeIssue:_p,EMPTY_PATH:xz,addIssueToContext:$e,ParseStatus:Tr,INVALID:gt,DIRTY:fu,OK:dn,isAborted:Uv,isDirty:Fv,isValid:Xl,isAsync:Zl,get util(){return Bt},get objectUtil(){return Lv},ZodParsedType:He,getParsedType:ha,ZodType:_t,datetimeRegex:kA,ZodString:Dn,ZodNumber:io,ZodBigInt:oo,ZodBoolean:da,ZodDate:Oo,ZodSymbol:Cf,ZodUndefined:pa,ZodNull:ma,ZodAny:Es,ZodUnknown:No,ZodNever:Ni,ZodVoid:kf,ZodArray:Rn,ZodObject:sr,ZodUnion:ba,ZodDiscriminatedUnion:If,ZodIntersection:ga,ZodTuple:ri,ZodRecord:va,ZodMap:Df,ZodSet:Po,ZodFunction:As,ZodLazy:ya,ZodLiteral:xa,ZodEnum:so,ZodNativeEnum:wa,ZodPromise:Ss,ZodEffects:On,ZodTransformer:On,ZodOptional:ni,ZodNullable:ao,ZodDefault:_a,ZodCatch:Ea,ZodNaN:Rf,BRAND:Bz,ZodBranded:cu,ZodPipeline:Aa,ZodReadonly:Sa,custom:DA,Schema:_t,ZodSchema:_t,late:Lz,get ZodFirstPartyTypeKind(){return ot},coerce:vj,any:Kz,array:Jz,bigint:$z,boolean:NA,date:qz,discriminatedUnion:Qz,effect:AA,enum:fj,function:oj,instanceof:Uz,intersection:ej,lazy:sj,literal:aj,map:nj,nan:Fz,nativeEnum:cj,never:Gz,null:jz,nullable:hj,number:OA,object:Yz,oboolean:gj,onumber:bj,optional:lj,ostring:mj,pipeline:pj,preprocess:dj,promise:uj,record:rj,set:ij,strictObject:Xz,string:RA,symbol:Hz,transformer:AA,tuple:tj,undefined:zz,union:Zz,unknown:Vz,void:Wz,NEVER:yj,ZodIssueCode:Oe,quotelessJson:vz,ZodError:an});var lu=Symbol("current"),Of=Symbol("previous");var Ql=o((r,{ref:e,refType:t,param:n,header:i,...s}={})=>({...s,...r}),"mergeOpenApi");function PA(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(s){let{zodOpenApi:f,...u}=this._def,d=new this.constructor({...u,zodOpenApi:{openapi:Ql(s,f?.openapi)}});return d._def.zodOpenApi[lu]=d,f&&(d._def.zodOpenApi[Of]=this),d};let e=r.ZodType.prototype.describe;r.ZodType.prototype.describe=function(...s){let f=e.apply(this,s),u=f._def;if(u.zodOpenApi){let d={...u.zodOpenApi};d.openapi=Ql({description:s[0]},d.openapi),d[Of]=this,d[lu]=f,u.zodOpenApi=d}else u.zodOpenApi={openapi:{description:s[0]},[lu]:f};return f};let t=r.ZodObject.prototype.extend;r.ZodObject.prototype.extend=function(...s){let f=t.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=Ql({},d.openapi),d[Of]=this,f._def.zodOpenApi=d}else f._def.zodOpenApi={[Of]:this};return f};let n=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...s){let f=n.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=Ql({},d.openapi),delete d[Of],delete d[lu],f._def.zodOpenApi=d}return f};let i=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...s){let f=i.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=Ql({},d.openapi),delete d[Of],delete d[lu],f._def.zodOpenApi=d}return f}}o(PA,"extendZodWithOpenApi");PA(A);var xj=Object.defineProperty,wj=o((r,e)=>xj(r,"name",{value:e,configurable:!0}),"__name"),Sp=A.array(A.string().or(A.record(A.any()))),Oie=A.object({type:A.string().optional(),narrative:A.string().optional()}),Mp=A.string().or(A.object({id:A.string(),type:A.string(),caption:A.string().optional()})),_j=A.object({type:A.string().min(1).or(A.string().array().nonempty()),latitude:A.number(),longitude:A.number()}),Ej=A.object({type:A.string().min(1).or(A.string().array().nonempty()),addressCountry:A.string().optional(),addressCountryCode:A.string().optional(),addressRegion:A.string().optional(),addressLocality:A.string().optional(),streetAddress:A.string().optional(),postOfficeBoxNumber:A.string().optional(),postalCode:A.string().optional(),geo:_j.optional()}),Aj=A.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(A.string()),KA=A.object({type:A.string().min(1).or(A.string().array().nonempty()),identifier:A.string(),identifierType:Aj}),eh=A.string().or(A.object({id:A.string().optional(),type:A.string().or(A.string().array().nonempty().optional()),name:A.string().optional(),url:A.string().optional(),phone:A.string().optional(),description:A.string().optional(),endorsement:A.any().array().optional(),image:Mp.optional(),email:A.string().email().optional(),address:Ej.optional(),otherIdentifier:KA.array().optional(),official:A.string().optional(),parentOrg:A.any().optional(),familyName:A.string().optional(),givenName:A.string().optional(),additionalName:A.string().optional(),patronymicName:A.string().optional(),honorificPrefix:A.string().optional(),honorificSuffix:A.string().optional(),familyNamePrefix:A.string().optional(),dateOfBirth:A.string().optional()}).catchall(A.any())),qv=A.object({id:A.string().optional()}).catchall(A.any()),Ap=A.object({type:A.string(),id:A.string()}).catchall(A.any()),BA=A.object({id:A.string(),type:A.string()}).catchall(A.any()),LA=A.object({id:A.string().optional(),type:A.string()}).catchall(A.any()),UA=A.object({type:A.string(),id:A.string().optional()}).catchall(A.any()),FA=A.object({type:A.string().or(A.string().array().nonempty()),id:A.string().optional()}).catchall(A.any()),th=A.object({"@context":Sp,id:A.string().optional(),type:A.string().array().nonempty(),issuer:eh,credentialSubject:qv.or(qv.array()),refreshService:LA.or(LA.array()).optional(),credentialSchema:BA.or(BA.array()).optional(),issuanceDate:A.string().optional(),expirationDate:A.string().optional(),credentialStatus:Ap.or(Ap.array()).optional(),name:A.string().optional(),description:A.string().optional(),validFrom:A.string().optional(),validUntil:A.string().optional(),status:Ap.or(Ap.array()).optional(),termsOfUse:UA.or(UA.array()).optional(),evidence:FA.or(FA.array()).optional()}).catchall(A.any()),Bo=A.object({type:A.string(),created:A.string(),challenge:A.string().optional(),domain:A.string().optional(),nonce:A.string().optional(),proofPurpose:A.string(),verificationMethod:A.string(),jws:A.string().optional()}).catchall(A.any()),hu=th.extend({proof:Bo.or(Bo.array())}),Sj=A.object({"@context":Sp,id:A.string().optional(),type:A.string().or(A.string().array().nonempty()),verifiableCredential:hu.or(hu.array()).optional(),holder:A.string().optional()}).catchall(A.any()),Tp=Sj.extend({proof:Bo.or(Bo.array())}),jv=A.object({kty:A.string(),crv:A.string(),x:A.string(),y:A.string().optional(),n:A.string().optional(),d:A.string().optional()}),Bie=jv.omit({d:!0}).extend({d:A.string()}),Mj=A.object({alg:A.string(),iv:A.string(),tag:A.string(),epk:jv.partial().optional(),kid:A.string().optional(),apv:A.string().optional(),apu:A.string().optional()}),Tj=A.object({header:Mj,encrypted_key:A.string()}),Cj=A.object({protected:A.string(),iv:A.string(),ciphertext:A.string(),tag:A.string(),aad:A.string().optional(),recipients:Tj.array().optional()}),Nf=A.string().or(A.object({"@context":Sp.optional(),id:A.string(),type:A.string(),controller:A.string(),publicKeyJwk:jv.optional(),publicKeyBase58:A.string().optional(),blockChainAccountId:A.string().optional()}).catchall(A.any())),kj=A.object({id:A.string(),type:A.string().or(A.string().array().nonempty()),serviceEndpoint:A.any().or(A.any().array().nonempty())}).catchall(A.any()),Lie=A.object({"@context":Sp,id:A.string(),alsoKnownAs:A.string().optional(),controller:A.string().or(A.string().array().nonempty()).optional(),verificationMethod:Nf.array().optional(),authentication:Nf.array().optional(),assertionMethod:Nf.array().optional(),keyAgreement:Nf.array().optional(),capabilityInvocation:Nf.array().optional(),capabilityDelegation:Nf.array().optional(),publicKey:Nf.array().optional(),service:kj.array().optional(),proof:Bo.or(Bo.array()).optional()}).catchall(A.any()),Ij=A.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(A.string()),Cp=A.object({type:A.string().array().nonempty(),targetCode:A.string().optional(),targetDescription:A.string().optional(),targetName:A.string(),targetFramework:A.string().optional(),targetType:Ij.optional(),targetUrl:A.string()}),Dj=A.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"]),Rj=Dj.or(A.string()),Oj=A.object({id:A.string().optional(),narrative:A.string().optional()}).catchall(A.any()),Nj=A.object({id:A.string(),type:A.string().array().nonempty(),endorsementComment:A.string().optional()}),Pj=th.extend({credentialSubject:Nj,proof:Bo.or(Bo.array()).optional()}),Bj=A.object({id:A.string(),"@language":A.string().optional(),version:A.string().optional()}),Lj=A.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(A.string()),Uj=A.object({id:A.string(),type:A.string().array().nonempty(),alignment:Cp.array().optional(),description:A.string().optional(),level:A.string().optional(),name:A.string(),points:A.string().optional()}).catchall(A.any()),Fj=A.object({id:A.string(),type:A.string().array().nonempty(),alignment:Cp.array().optional(),allowedValue:A.string().array().optional(),name:A.string(),requiredLevel:A.string().optional(),requiredValue:A.string().optional(),resultType:Lj,rubricCriterionLevel:Uj.array().optional(),valueMax:A.string().optional(),valueMin:A.string().optional()}).catchall(A.any()),$j=A.object({id:A.string().optional(),type:A.string().array().nonempty(),alignment:Cp.array().optional(),achievementType:Rj.optional(),creator:eh.optional(),creditsAvailable:A.number().optional(),criteria:Oj,description:A.string(),endorsement:Pj.array().optional(),fieldOfStudy:A.string().optional(),humanCode:A.string().optional(),image:Mp.optional(),"@language":A.string().optional(),name:A.string(),otherIdentifier:KA.array().optional(),related:Bj.array().optional(),resultDescription:Fj.array().optional(),specialization:A.string().optional(),tag:A.string().array().optional(),version:A.string().optional()}).catchall(A.any()),qj=A.object({type:A.string(),hashed:A.boolean(),identityHash:A.string(),identityType:A.string(),salt:A.string().optional()}),Hj=A.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),zj=A.object({type:A.string().array().nonempty(),achievedLevel:A.string().optional(),alignment:Cp.array().optional(),resultDescription:A.string().optional(),status:Hj.optional(),value:A.string().optional()}).catchall(A.any()),$A=A.object({id:A.string().optional(),type:A.string().array().nonempty(),activityEndDate:A.string().optional(),activityStartDate:A.string().optional(),creditsEarned:A.number().optional(),achievement:$j.optional(),identifier:qj.array().optional(),image:Mp.optional(),licenseNumber:A.string().optional(),narrative:A.string().optional(),result:zj.array().optional(),role:A.string().optional(),source:eh.optional(),term:A.string().optional()}).catchall(A.any()),jj=A.object({id:A.string().optional(),type:A.string().or(A.string().array().nonempty()),narrative:A.string().optional(),name:A.string().optional(),description:A.string().optional(),genre:A.string().optional(),audience:A.string().optional()}).catchall(A.any()),Kj=th.extend({name:A.string().optional(),description:A.string().optional(),image:Mp.optional(),credentialSubject:$A.or($A.array()),endorsement:th.array().optional(),evidence:jj.array().optional()}),Fie=Kj.extend({proof:Bo.or(Bo.array())}),qie=A.object({checks:A.string().array(),warnings:A.string().array(),errors:A.string().array()}),VA=A.enum(["Success","Failed","Error"]),Hie=VA.enum,zie=A.object({check:A.string(),status:VA,message:A.string().optional(),details:A.string().optional()}),jie=A.object({title:A.string().optional(),createdAt:A.string().optional(),issuer:eh.optional(),issuee:eh.optional(),credentialSubject:qv.optional()}),Kie=A.object({id:A.string(),uri:A.string()}).catchall(A.any()),Wie=A.object({limit:A.number(),cursor:A.string().optional(),sort:A.string().optional()}),Nn=A.object({cursor:A.string().optional(),hasMore:A.boolean()}),GA=A.object({encryptedRecord:Cj,fields:A.string().array()}).catchall(A.any()),Jie=Nn.extend({records:GA.array()}),Vj=GA.extend({id:A.string()}),Yie=Nn.extend({records:Vj.array()}),qA=wj(r=>{let e=r.match(/^\/(.*)\/([gimsuy]*)$/);if(!e)throw new Error("Invalid RegExp string format");return{pattern:e[1],flags:e[2]}},"parseRegexString"),Gj=A.instanceof(RegExp).or(A.string().refine(r=>{try{return qA(r),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(r=>{let{pattern:e,flags:t}=qA(r);try{return new RegExp(e,t)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),Wt=A.string().or(A.object({$in:A.string().array()})).or(A.object({$regex:Gj})),Wj=A.object({backgroundColor:A.string().optional(),backgroundImage:A.string().optional(),fadeBackgroundImage:A.boolean().optional(),repeatBackgroundImage:A.boolean().optional(),fontColor:A.string().optional(),accentColor:A.string().optional(),accentFontColor:A.string().optional(),idBackgroundImage:A.string().optional(),fadeIdBackgroundImage:A.boolean().optional(),idBackgroundColor:A.string().optional(),repeatIdBackgroundImage:A.boolean().optional()}),Ma=A.object({profileId:A.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:A.string().default("").describe("Human-readable display name for the profile."),shortBio:A.string().default("").describe("Short bio for the profile."),bio:A.string().default("").describe("Longer bio for the profile."),did:A.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:A.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:A.string().optional().describe("Contact email address for the profile. (deprecated)"),image:A.string().optional().describe("Profile image URL for the profile."),heroImage:A.string().optional().describe("Hero image URL for the profile."),websiteLink:A.string().optional().describe("Website link for the profile."),isServiceProfile:A.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:A.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:A.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Wj.optional().describe("Display settings for the profile."),role:A.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:A.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),Qie=A.object({profileId:Wt,displayName:Wt,shortBio:Wt,bio:Wt,email:Wt,websiteLink:Wt,isServiceProfile:A.boolean(),type:Wt}).partial(),eoe=Nn.extend({records:Ma.array()}),toe=A.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),WA=A.object({id:A.string(),created:A.string(),displayName:A.string().default("").optional(),shortBio:A.string().default("").optional(),bio:A.string().default("").optional(),email:A.string().optional(),image:A.string().optional(),heroImage:A.string().optional()}),roe=Nn.extend({records:WA.extend({did:A.string()}).array()}),noe=A.object({id:Wt,displayName:Wt,shortBio:Wt,bio:Wt,email:Wt}).partial(),ioe=Nn.extend({records:A.object({profile:Ma,manager:WA.extend({did:A.string()}).optional()}).array()}),ooe=A.object({uri:A.string(),to:A.string(),from:A.string(),sent:A.string().datetime(),received:A.string().datetime().optional()}),JA=A.object({role:A.string(),canEdit:A.boolean(),canIssue:A.boolean(),canRevoke:A.boolean(),canManagePermissions:A.boolean(),canIssueChildren:A.string(),canCreateChildren:A.string(),canEditChildren:A.string(),canRevokeChildren:A.string(),canManageChildrenPermissions:A.string(),canManageChildrenProfiles:A.boolean().default(!1).optional(),canViewAnalytics:A.boolean()}),Jj=A.object({role:Wt,canEdit:A.boolean(),canIssue:A.boolean(),canRevoke:A.boolean(),canManagePermissions:A.boolean(),canIssueChildren:Wt,canCreateChildren:Wt,canEditChildren:Wt,canRevokeChildren:Wt,canManageChildrenPermissions:Wt,canManageChildrenProfiles:A.boolean(),canViewAnalytics:A.boolean()}).partial(),HA=A.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),Yj=A.discriminatedUnion("type",[A.object({type:A.literal(HA.Values.GRANT_PERMISSIONS),data:A.object({claimUri:A.string(),targetUri:A.string(),permissions:JA.partial()})}),A.object({type:A.literal(HA.Values.ADD_ADMIN),data:A.object({claimUri:A.string(),targetUri:A.string()})})]),soe=A.object({type:Wt,data:A.object({claimUri:Wt,targetUri:Wt,permissions:Jj})}).deepPartial(),Xj=A.object({id:A.string(),createdAt:A.string(),updatedAt:A.string()}).and(Yj),aoe=Nn.extend({records:Xj.array()}),Hv=A.enum(["DRAFT","LIVE"]),Zj=A.object({uri:A.string(),name:A.string().optional(),type:A.string().optional(),category:A.string().optional(),status:Hv.optional(),autoConnectRecipients:A.boolean().optional(),meta:A.record(A.any()).optional(),claimPermissions:JA.optional(),allowAnyoneToCreateChildren:A.boolean().optional()}),foe=A.object({uri:Wt,name:Wt,type:Wt,category:Wt,meta:A.record(Wt),status:Hv.or(A.object({$in:Hv.array()})),autoConnectRecipients:A.boolean()}).partial(),coe=Nn.extend({records:Zj.array()}),Qj=A.object({to:Ma,from:A.string(),received:A.string().optional(),uri:A.string().optional()}),uoe=Nn.extend({records:Qj.array()}),loe=A.object({endpoint:A.string(),name:A.string(),did:A.string().optional()}),hoe=A.object({ttlSeconds:A.number().optional(),totalUses:A.number().optional()}),eK=A.object({endpoint:A.string()}),doe=A.object({signingAuthority:eK,relationship:A.object({name:A.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:A.string(),isPrimary:A.boolean().optional()})}),poe=A.object({boostUri:A.string(),signingAuthority:A.object({endpoint:A.string(),name:A.string()})}),tK=A.enum(["live","stale","withdrawn"]),rK=A.object({read:A.object({anonymize:A.boolean().optional(),credentials:A.object({categories:A.record(A.object({required:A.boolean()})).default({})}).default({}),personal:A.record(A.object({required:A.boolean()})).default({})}).default({}),write:A.object({credentials:A.object({categories:A.record(A.object({required:A.boolean()})).default({})}).default({}),personal:A.record(A.object({required:A.boolean()})).default({})}).default({})}),YA=A.object({contract:rK,owner:Ma,name:A.string(),subtitle:A.string().optional(),description:A.string().optional(),reasonForAccessing:A.string().optional(),image:A.string().optional(),uri:A.string(),needsGuardianConsent:A.boolean().optional(),redirectUrl:A.string().optional(),frontDoorBoostUri:A.string().optional(),createdAt:A.string(),updatedAt:A.string(),expiresAt:A.string().optional(),autoBoosts:A.string().array().optional(),writers:A.array(Ma).optional()}),moe=Nn.extend({records:YA.omit({owner:!0}).array()}),nK=A.object({credentials:A.object({categories:A.record(A.string().array()).default({})}),personal:A.record(A.string()).default({}),date:A.string()}),boe=Nn.extend({records:nK.array()}),iK=A.object({credentials:A.object({category:A.string(),uri:A.string()}).array(),personal:A.record(A.string()).default({}),date:A.string(),contractUri:A.string()}),goe=Nn.extend({records:iK.array()}),XA=A.object({sharing:A.boolean().optional(),shared:A.string().array().optional(),shareAll:A.boolean().optional(),shareUntil:A.string().optional()}),ZA=A.object({read:A.object({anonymize:A.boolean().optional(),credentials:A.object({shareAll:A.boolean().optional(),sharing:A.boolean().optional(),categories:A.record(XA).default({})}).default({}),personal:A.record(A.string()).default({})}).default({}),write:A.object({credentials:A.object({categories:A.record(A.boolean()).default({})}).default({}),personal:A.record(A.boolean()).default({})}).default({}),deniedWriters:A.array(A.string()).optional()}),voe=Nn.extend({records:A.object({expiresAt:A.string().optional(),oneTime:A.boolean().optional(),terms:ZA,contract:YA,uri:A.string(),consenter:Ma,status:tK}).array()}),yoe=A.object({read:A.object({anonymize:A.boolean().optional(),credentials:A.object({categories:A.record(A.object({required:A.boolean().optional()})).optional()}).optional(),personal:A.record(A.object({required:A.boolean().optional()})).optional()}).optional(),write:A.object({credentials:A.object({categories:A.record(A.object({required:A.boolean().optional()})).optional()}).optional(),personal:A.record(A.object({required:A.boolean().optional()})).optional()}).optional()}),xoe=A.object({anonymize:A.boolean().optional(),credentials:A.object({categories:A.record(A.boolean()).optional()}).optional(),personal:A.record(A.boolean()).optional()}),woe=A.object({credentials:A.object({categories:A.record(A.boolean()).optional()}).optional(),personal:A.record(A.boolean()).optional(),id:Wt.optional()}),oK=A.object({read:A.object({anonymize:A.boolean().optional(),credentials:A.object({shareAll:A.boolean().optional(),sharing:A.boolean().optional(),categories:A.record(XA.optional()).optional()}).optional(),personal:A.record(A.string()).optional()}).optional(),write:A.object({credentials:A.object({categories:A.record(A.boolean()).optional()}).optional(),personal:A.record(A.boolean()).optional()}).optional()}),zv=A.enum(["consent","update","sync","withdraw","write"]),_oe=A.object({terms:oK.optional(),action:zv.or(zv.array()).optional(),date:A.object({$gt:A.string()}).or(A.object({$lt:A.string()})).or(A.object({$eq:A.string()})).optional(),expiresAt:A.object({$gt:A.string()}).or(A.object({$lt:A.string()})).or(A.object({$eq:A.string()})).optional(),oneTime:A.boolean().optional()}),QA=A.object({expiresAt:A.string().optional(),oneTime:A.boolean().optional(),terms:ZA.optional(),id:A.string(),action:zv,date:A.string(),uris:A.string().array().optional()}),Eoe=Nn.extend({records:QA.array()}),sK=A.object({credentialUri:A.string(),termsUri:A.string(),contractUri:A.string(),boostUri:A.string(),category:A.string().optional(),date:A.string()}),Aoe=Nn.extend({records:sK.array()}),aK=A.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED"]),fK=A.object({title:A.string().optional(),body:A.string().optional()}),cK=A.object({type:A.string(),value:A.string()}),kp=A.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),uK=A.object({issuanceId:A.string(),status:kp,recipient:A.object({contactMethod:cK.optional(),learnCardId:A.string().optional()}),timestamp:A.string().datetime().optional()}),lK=A.object({vcUris:A.array(A.string()).optional(),vpUris:A.array(A.string()).optional(),transaction:QA.optional(),inbox:uK.optional()}),Soe=A.object({type:aK,to:Ma.partial().and(A.object({did:A.string()})),from:Ma.partial().and(A.object({did:A.string()})),message:fK.optional(),data:lK.optional(),sent:A.string().datetime().optional(),webhookUrl:A.string().optional()}),hK="auth-grant:",Moe=A.object({id:A.string(),name:A.string(),description:A.string().optional(),challenge:A.string().startsWith(hK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:A.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:A.string(),createdAt:A.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:A.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Toe=A.object({id:A.string()}).catchall(A.any()),dK=A.enum(["active","revoked"]),Coe=A.object({id:Wt,name:Wt,description:Wt,status:dK}).partial(),zA=A.object({id:A.string(),isVerified:A.boolean(),verifiedAt:A.string().optional(),isPrimary:A.boolean(),createdAt:A.string()}),koe=A.discriminatedUnion("type",[A.object({type:A.literal("email"),value:A.string().email()}).merge(zA),A.object({type:A.literal("phone"),value:A.string()}).merge(zA)]),jA=A.object({isVerified:A.boolean().optional(),isPrimary:A.boolean().optional()}),Ioe=A.discriminatedUnion("type",[A.object({type:A.literal("email"),value:A.string().email()}).merge(jA),A.object({type:A.literal("phone"),value:A.string()}).merge(jA)]),e7=A.discriminatedUnion("type",[A.object({type:A.literal("email"),value:A.string().email()}),A.object({type:A.literal("phone"),value:A.string()})]),Doe=A.object({value:A.string(),type:A.enum(["email","phone"])}),Roe=A.object({token:A.string()}),Ooe=A.object({contactMethodId:A.string()}),pK=A.object({id:A.string(),credential:A.string(),isSigned:A.boolean(),currentStatus:kp,expiresAt:A.string(),createdAt:A.string(),issuerDid:A.string(),webhookUrl:A.string().optional(),"signingAuthority.endpoint":A.string().optional(),"signingAuthority.name":A.string().optional()}),Noe=A.object({hasMore:A.boolean(),records:A.array(pK),cursor:A.string().optional()}),Poe=A.object({currentStatus:kp,id:A.string(),isSigned:A.boolean(),issuerDid:A.string()}).partial(),mK=A.object({endpoint:A.string().url(),name:A.string()}),Boe=A.object({recipient:e7.describe("The recipient of the credential"),credential:hu.passthrough().or(Tp.passthrough()).or(th.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:A.object({signingAuthority:mK.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:A.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:A.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:A.object({suppress:A.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:A.object({id:A.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:A.object({issuer:A.object({name:A.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:A.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:A.object({name:A.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:A.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:A.object({name:A.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),Loe=A.object({issuanceId:A.string(),status:kp,recipient:e7,claimUrl:A.string().url().optional(),recipientDid:A.string().optional()}),Uoe=A.object({token:A.string(),contactMethodId:A.string(),createdAt:A.string(),expiresAt:A.string(),used:A.boolean()});var Ip=o(r=>`lc:ceramic:${r}`,"streamIdToCeramicURI");var Kv=A.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 t7={ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var Dp=o(async(r,{ceramicEndpoint:e,defaultContentFamily:t}=t7)=>{let n=new Wl(e),i=o(async(R,I,B,Y)=>r.invoke.didResolver(R,Y),"learnCardResolver"),s={...E_.getResolver(),web:i},f=new hf({resolver:s});n.did=f;let u=r.invoke.getKey(),d=new El(o_(u));n.did.setProvider(d),await n.did.authenticate();let v=new ql({ceramic:n}),x=o(async(R,I={},B={},Y)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=t),"pin"in B||(B.pin=!0),Y?.encrypt){r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",Y);let J=Y?.recipients||[];Y?.controllersCanDecrypt&&(J=[...J,...I.controllers]),R=await n?.did?.createDagJWE(R,r7.default.uniq(J))}return r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,B),(await ei.create(n,R,I,B)).id.toString()},"publishContentToCeramic"),E=o(async R=>{let I=(await v.load(R))?.content;if(r.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await f.decryptDagJWE(I)}catch(B){throw r.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",B),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await hu.or(Tp).parseAsync(R),Ip(await x(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,B)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...B?{recipients:B.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let B=await Kv.spa(I);if(!B.success)return;let Y=B.data.split(":")[2];try{return await hu.or(Tp).parseAsync(await E(Y))}catch(P){R.debug?.(P);return}}},methods:{publishContentToCeramic:async(R,I,B)=>Ip(await x(I,{},{},B)),readContentFromCeramic:async(R,I)=>E(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var bK=Dp;
823
823
  /*!
824
824
  * The buffer module from node.js, for the browser.
825
825
  *