@learncard/ceramic-plugin 1.0.0

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.
@@ -0,0 +1,844 @@
1
+ "use strict";var fI=Object.create;var ru=Object.defineProperty;var cI=Object.getOwnPropertyDescriptor;var uI=Object.getOwnPropertyNames;var lI=Object.getPrototypeOf,hI=Object.prototype.hasOwnProperty;var o=(t,e)=>ru(t,"name",{value:e,configurable:!0});var jt=(t,e)=>()=>(t&&(e=t(t=0)),e);var De=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var r in e)ru(t,r,{get:e[r],enumerable:!0})},Ay=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uI(e))!hI.call(t,i)&&i!==r&&ru(t,i,{get:()=>e[i],enumerable:!(n=cI(e,i))||n.enumerable});return t};var Pt=(t,e,r)=>(r=t!=null?fI(lI(t)):{},Ay(e||!t||!t.__esModule?ru(r,"default",{value:t,enumerable:!0}):r,t)),ph=t=>Ay(ru({},"__esModule",{value:!0}),t);var Sy=De((Of,nu)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",v=1,y=2,S=4,O=1,R=2,I=1,N=2,J=4,L=8,V=16,Z=32,Y=64,oe=128,K=256,q=512,j=30,le="...",T=800,h=16,x=1,b=2,l=3,m=1/0,_=9007199254740991,A=17976931348623157e292,E=0/0,g=4294967295,C=g-1,P=g>>>1,w=[["ary",oe],["bind",I],["bindKey",N],["curry",L],["curryRight",V],["flip",q],["partial",Z],["partialRight",Y],["rearg",K]],k="[object Arguments]",he="[object Array]",D="[object AsyncFunction]",Q="[object Boolean]",se="[object Date]",F="[object DOMException]",$="[object Error]",ee="[object Function]",ne="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",re="[object Object]",Se="[object Promise]",ce="[object Proxy]",ve="[object RegExp]",G="[object Set]",pe="[object String]",Ce="[object Symbol]",He="[object Undefined]",Ne="[object WeakMap]",Ve="[object WeakSet]",pr="[object ArrayBuffer]",ue="[object DataView]",ie="[object Float32Array]",U="[object Float64Array]",X="[object Int8Array]",me="[object Int16Array]",ye="[object Int32Array]",we="[object Uint8Array]",ke="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Ue="[object Uint32Array]",Oe=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Je=/&(?:amp|lt|gt|quot|#39);/g,Tn=/[&<>"']/g,nt=RegExp(Je.source),it=RegExp(Tn.source),Jn=/<%-([\s\S]+?)%>/g,ot=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,st=/^\w*$/,at=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cn=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(cn.source),Xe=/^\s+/,Xn=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,Zn=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,Qn=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,$t=/^0b[01]+$/i,Ft=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ln=/^(?:0|[1-9]\d*)$/,hn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr=/($^)/,dn=/['\n\r\u2028\u2029\\]/g,ei="\\ud800-\\udfff",So="\\u0300-\\u036f",Mo="\\ufe20-\\ufe2f",To="\\u20d0-\\u20ff",Zi=So+Mo+To,Qi="\\u2700-\\u27bf",eo="a-z\\xdf-\\xf6\\xf8-\\xff",Co="\\xac\\xb1\\xd7\\xf7",ko="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Io="\\u2000-\\u206f",Do=" \\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",bf="A-Z\\xc0-\\xd6\\xd8-\\xde",gf="\\ufe0e\\ufe0f",vf=Co+ko+Io+Do,rp="['\u2019]",f7="["+ei+"]",o2="["+vf+"]",Cl="["+Zi+"]",s2="\\d+",c7="["+Qi+"]",a2="["+eo+"]",f2="[^"+ei+vf+s2+Qi+eo+bf+"]",np="\\ud83c[\\udffb-\\udfff]",u7="(?:"+Cl+"|"+np+")",c2="[^"+ei+"]",ip="(?:\\ud83c[\\udde6-\\uddff]){2}",op="[\\ud800-\\udbff][\\udc00-\\udfff]",yf="["+bf+"]",u2="\\u200d",l2="(?:"+a2+"|"+f2+")",l7="(?:"+yf+"|"+f2+")",h2="(?:"+rp+"(?:d|ll|m|re|s|t|ve))?",d2="(?:"+rp+"(?:D|LL|M|RE|S|T|VE))?",p2=u7+"?",m2="["+gf+"]?",h7="(?:"+u2+"(?:"+[c2,ip,op].join("|")+")"+m2+p2+")*",d7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",p7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",b2=m2+p2+h7,m7="(?:"+[c7,ip,op].join("|")+")"+b2,b7="(?:"+[c2+Cl+"?",Cl,ip,op,f7].join("|")+")",g7=RegExp(rp,"g"),v7=RegExp(Cl,"g"),sp=RegExp(np+"(?="+np+")|"+b7+b2,"g"),y7=RegExp([yf+"?"+a2+"+"+h2+"(?="+[o2,yf,"$"].join("|")+")",l7+"+"+d2+"(?="+[o2,yf+l2,"$"].join("|")+")",yf+"?"+l2+"+"+h2,yf+"+"+d2,p7,d7,s2,m7].join("|"),"g"),x7=RegExp("["+u2+ei+Zi+gf+"]"),w7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_7=["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"],E7=-1,ir={};ir[ie]=ir[U]=ir[X]=ir[me]=ir[ye]=ir[we]=ir[ke]=ir[Dt]=ir[Ue]=!0,ir[k]=ir[he]=ir[pr]=ir[Q]=ir[ue]=ir[se]=ir[$]=ir[ee]=ir[ae]=ir[Ae]=ir[re]=ir[ve]=ir[G]=ir[pe]=ir[Ne]=!1;var er={};er[k]=er[he]=er[pr]=er[ue]=er[Q]=er[se]=er[ie]=er[U]=er[X]=er[me]=er[ye]=er[ae]=er[Ae]=er[re]=er[ve]=er[G]=er[pe]=er[Ce]=er[we]=er[ke]=er[Dt]=er[Ue]=!0,er[$]=er[ee]=er[Ne]=!1;var A7={\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"},S7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},T7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},C7=parseFloat,k7=parseInt,g2=typeof global=="object"&&global&&global.Object===Object&&global,I7=typeof self=="object"&&self&&self.Object===Object&&self,Er=g2||I7||Function("return this")(),ap=typeof Of=="object"&&Of&&!Of.nodeType&&Of,la=ap&&typeof nu=="object"&&nu&&!nu.nodeType&&nu,v2=la&&la.exports===ap,fp=v2&&g2.process,ti=function(){try{var de=la&&la.require&&la.require("util").types;return de||fp&&fp.binding&&fp.binding("util")}catch{}}(),y2=ti&&ti.isArrayBuffer,x2=ti&&ti.isDate,w2=ti&&ti.isMap,_2=ti&&ti.isRegExp,E2=ti&&ti.isSet,A2=ti&&ti.isTypedArray;function kn(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(kn,"apply");function D7(de,Ee,xe,qe){for(var bt=-1,qt=de==null?0:de.length;++bt<qt;){var xr=de[bt];Ee(qe,xr,xe(xr),de)}return qe}o(D7,"arrayAggregator");function ri(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe&&Ee(de[xe],xe,de)!==!1;);return de}o(ri,"arrayEach");function O7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(O7,"arrayEachRight");function S2(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe;)if(!Ee(de[xe],xe,de))return!1;return!0}o(S2,"arrayEvery");function ds(de,Ee){for(var xe=-1,qe=de==null?0:de.length,bt=0,qt=[];++xe<qe;){var xr=de[xe];Ee(xr,xe,de)&&(qt[bt++]=xr)}return qt}o(ds,"arrayFilter");function kl(de,Ee){var xe=de==null?0:de.length;return!!xe&&xf(de,Ee,0)>-1}o(kl,"arrayIncludes");function cp(de,Ee,xe){for(var qe=-1,bt=de==null?0:de.length;++qe<bt;)if(xe(Ee,de[qe]))return!0;return!1}o(cp,"arrayIncludesWith");function sr(de,Ee){for(var xe=-1,qe=de==null?0:de.length,bt=Array(qe);++xe<qe;)bt[xe]=Ee(de[xe],xe,de);return bt}o(sr,"arrayMap");function ps(de,Ee){for(var xe=-1,qe=Ee.length,bt=de.length;++xe<qe;)de[bt+xe]=Ee[xe];return de}o(ps,"arrayPush");function up(de,Ee,xe,qe){var bt=-1,qt=de==null?0:de.length;for(qe&&qt&&(xe=de[++bt]);++bt<qt;)xe=Ee(xe,de[bt],bt,de);return xe}o(up,"arrayReduce");function R7(de,Ee,xe,qe){var bt=de==null?0:de.length;for(qe&&bt&&(xe=de[--bt]);bt--;)xe=Ee(xe,de[bt],bt,de);return xe}o(R7,"arrayReduceRight");function lp(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe;)if(Ee(de[xe],xe,de))return!0;return!1}o(lp,"arraySome");var N7=hp("length");function P7(de){return de.split("")}o(P7,"asciiToArray");function L7(de){return de.match(lt)||[]}o(L7,"asciiWords");function M2(de,Ee,xe){var qe;return xe(de,function(bt,qt,xr){if(Ee(bt,qt,xr))return qe=qt,!1}),qe}o(M2,"baseFindKey");function Il(de,Ee,xe,qe){for(var bt=de.length,qt=xe+(qe?1:-1);qe?qt--:++qt<bt;)if(Ee(de[qt],qt,de))return qt;return-1}o(Il,"baseFindIndex");function xf(de,Ee,xe){return Ee===Ee?W7(de,Ee,xe):Il(de,T2,xe)}o(xf,"baseIndexOf");function B7(de,Ee,xe,qe){for(var bt=xe-1,qt=de.length;++bt<qt;)if(qe(de[bt],Ee))return bt;return-1}o(B7,"baseIndexOfWith");function T2(de){return de!==de}o(T2,"baseIsNaN");function C2(de,Ee){var xe=de==null?0:de.length;return xe?pp(de,Ee)/xe:E}o(C2,"baseMean");function hp(de){return function(Ee){return Ee==null?t:Ee[de]}}o(hp,"baseProperty");function dp(de){return function(Ee){return de==null?t:de[Ee]}}o(dp,"basePropertyOf");function k2(de,Ee,xe,qe,bt){return bt(de,function(qt,xr,Zt){xe=qe?(qe=!1,qt):Ee(xe,qt,xr,Zt)}),xe}o(k2,"baseReduce");function U7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(U7,"baseSortBy");function pp(de,Ee){for(var xe,qe=-1,bt=de.length;++qe<bt;){var qt=Ee(de[qe]);qt!==t&&(xe=xe===t?qt:xe+qt)}return xe}o(pp,"baseSum");function mp(de,Ee){for(var xe=-1,qe=Array(de);++xe<de;)qe[xe]=Ee(xe);return qe}o(mp,"baseTimes");function $7(de,Ee){return sr(Ee,function(xe){return[xe,de[xe]]})}o($7,"baseToPairs");function I2(de){return de&&de.slice(0,N2(de)+1).replace(Xe,"")}o(I2,"baseTrim");function In(de){return function(Ee){return de(Ee)}}o(In,"baseUnary");function bp(de,Ee){return sr(Ee,function(xe){return de[xe]})}o(bp,"baseValues");function qc(de,Ee){return de.has(Ee)}o(qc,"cacheHas");function D2(de,Ee){for(var xe=-1,qe=de.length;++xe<qe&&xf(Ee,de[xe],0)>-1;);return xe}o(D2,"charsStartIndex");function O2(de,Ee){for(var xe=de.length;xe--&&xf(Ee,de[xe],0)>-1;);return xe}o(O2,"charsEndIndex");function F7(de,Ee){for(var xe=de.length,qe=0;xe--;)de[xe]===Ee&&++qe;return qe}o(F7,"countHolders");var q7=dp(A7),H7=dp(S7);function z7(de){return"\\"+T7[de]}o(z7,"escapeStringChar");function K7(de,Ee){return de==null?t:de[Ee]}o(K7,"getValue");function wf(de){return x7.test(de)}o(wf,"hasUnicode");function j7(de){return w7.test(de)}o(j7,"hasUnicodeWord");function G7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(G7,"iteratorToArray");function gp(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe,bt){xe[++Ee]=[bt,qe]}),xe}o(gp,"mapToArray");function R2(de,Ee){return function(xe){return de(Ee(xe))}}o(R2,"overArg");function ms(de,Ee){for(var xe=-1,qe=de.length,bt=0,qt=[];++xe<qe;){var xr=de[xe];(xr===Ee||xr===d)&&(de[xe]=d,qt[bt++]=xe)}return qt}o(ms,"replaceHolders");function Dl(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=qe}),xe}o(Dl,"setToArray");function V7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=[qe,qe]}),xe}o(V7,"setToPairs");function W7(de,Ee,xe){for(var qe=xe-1,bt=de.length;++qe<bt;)if(de[qe]===Ee)return qe;return-1}o(W7,"strictIndexOf");function J7(de,Ee,xe){for(var qe=xe+1;qe--;)if(de[qe]===Ee)return qe;return qe}o(J7,"strictLastIndexOf");function _f(de){return wf(de)?X7(de):N7(de)}o(_f,"stringSize");function Ci(de){return wf(de)?Z7(de):P7(de)}o(Ci,"stringToArray");function N2(de){for(var Ee=de.length;Ee--&&Xn.test(de.charAt(Ee)););return Ee}o(N2,"trimmedEndIndex");var Y7=dp(M7);function X7(de){for(var Ee=sp.lastIndex=0;sp.test(de);)++Ee;return Ee}o(X7,"unicodeSize");function Z7(de){return de.match(sp)||[]}o(Z7,"unicodeToArray");function Q7(de){return de.match(y7)||[]}o(Q7,"unicodeWords");var eA=o(function de(Ee){Ee=Ee==null?Er:bs.defaults(Er.Object(),Ee,bs.pick(Er,_7));var xe=Ee.Array,qe=Ee.Date,bt=Ee.Error,qt=Ee.Function,xr=Ee.Math,Zt=Ee.Object,vp=Ee.RegExp,tA=Ee.String,ni=Ee.TypeError,Ol=xe.prototype,rA=qt.prototype,Ef=Zt.prototype,Rl=Ee["__core-js_shared__"],Nl=rA.toString,Vt=Ef.hasOwnProperty,nA=0,P2=function(){var s=/[^.]+$/.exec(Rl&&Rl.keys&&Rl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Pl=Ef.toString,iA=Nl.call(Zt),oA=Er._,sA=vp("^"+Nl.call(Vt).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ll=v2?Ee.Buffer:t,gs=Ee.Symbol,Bl=Ee.Uint8Array,L2=Ll?Ll.allocUnsafe:t,Ul=R2(Zt.getPrototypeOf,Zt),B2=Zt.create,U2=Ef.propertyIsEnumerable,$l=Ol.splice,$2=gs?gs.isConcatSpreadable:t,Hc=gs?gs.iterator:t,ha=gs?gs.toStringTag:t,Fl=function(){try{var s=ga(Zt,"defineProperty");return s({},"",{}),s}catch{}}(),aA=Ee.clearTimeout!==Er.clearTimeout&&Ee.clearTimeout,fA=qe&&qe.now!==Er.Date.now&&qe.now,cA=Ee.setTimeout!==Er.setTimeout&&Ee.setTimeout,ql=xr.ceil,Hl=xr.floor,yp=Zt.getOwnPropertySymbols,uA=Ll?Ll.isBuffer:t,F2=Ee.isFinite,lA=Ol.join,hA=R2(Zt.keys,Zt),wr=xr.max,Kr=xr.min,dA=qe.now,pA=Ee.parseInt,q2=xr.random,mA=Ol.reverse,xp=ga(Ee,"DataView"),zc=ga(Ee,"Map"),wp=ga(Ee,"Promise"),Af=ga(Ee,"Set"),Kc=ga(Ee,"WeakMap"),jc=ga(Zt,"create"),zl=Kc&&new Kc,Sf={},bA=va(xp),gA=va(zc),vA=va(wp),yA=va(Af),xA=va(Kc),Kl=gs?gs.prototype:t,Gc=Kl?Kl.valueOf:t,H2=Kl?Kl.toString:t;function H(s){if(fr(s)&&!vt(s)&&!(s instanceof Ot)){if(s instanceof ii)return s;if(Vt.call(s,"__wrapped__"))return zv(s)}return new ii(s)}o(H,"lodash");var Mf=function(){function s(){}return o(s,"object"),function(f){if(!ar(f))return{};if(B2)return B2(f);s.prototype=f;var p=new s;return s.prototype=t,p}}();function jl(){}o(jl,"baseLodash");function ii(s,f){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=t}o(ii,"LodashWrapper"),H.templateSettings={escape:Jn,evaluate:ot,interpolate:et,variable:"",imports:{_:H}},H.prototype=jl.prototype,H.prototype.constructor=H,ii.prototype=Mf(jl.prototype),ii.prototype.constructor=ii;function Ot(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}o(Ot,"LazyWrapper");function wA(){var s=new Ot(this.__wrapped__);return s.__actions__=pn(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=pn(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=pn(this.__views__),s}o(wA,"lazyClone");function _A(){if(this.__filtered__){var s=new Ot(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}o(_A,"lazyReverse");function EA(){var s=this.__wrapped__.value(),f=this.__dir__,p=vt(s),M=f<0,B=p?s.length:0,z=PS(0,B,this.__views__),te=z.start,fe=z.end,be=fe-te,Me=M?fe:te-1,Te=this.__iteratees__,Ie=Te.length,Le=0,ze=Kr(be,this.__takeCount__);if(!p||!M&&B==be&&ze==be)return hv(s,this.__actions__);var Ze=[];e:for(;be--&&Le<ze;){Me+=f;for(var Et=-1,Qe=s[Me];++Et<Ie;){var Ct=Te[Et],Rt=Ct.iteratee,Rn=Ct.type,sn=Rt(Qe);if(Rn==b)Qe=sn;else if(!sn){if(Rn==x)continue e;break e}}Ze[Le++]=Qe}return Ze}o(EA,"lazyValue"),Ot.prototype=Mf(jl.prototype),Ot.prototype.constructor=Ot;function da(s){var f=-1,p=s==null?0:s.length;for(this.clear();++f<p;){var M=s[f];this.set(M[0],M[1])}}o(da,"Hash");function AA(){this.__data__=jc?jc(null):{},this.size=0}o(AA,"hashClear");function SA(s){var f=this.has(s)&&delete this.__data__[s];return this.size-=f?1:0,f}o(SA,"hashDelete");function MA(s){var f=this.__data__;if(jc){var p=f[s];return p===c?t:p}return Vt.call(f,s)?f[s]:t}o(MA,"hashGet");function TA(s){var f=this.__data__;return jc?f[s]!==t:Vt.call(f,s)}o(TA,"hashHas");function CA(s,f){var p=this.__data__;return this.size+=this.has(s)?0:1,p[s]=jc&&f===t?c:f,this}o(CA,"hashSet"),da.prototype.clear=AA,da.prototype.delete=SA,da.prototype.get=MA,da.prototype.has=TA,da.prototype.set=CA;function Oo(s){var f=-1,p=s==null?0:s.length;for(this.clear();++f<p;){var M=s[f];this.set(M[0],M[1])}}o(Oo,"ListCache");function kA(){this.__data__=[],this.size=0}o(kA,"listCacheClear");function IA(s){var f=this.__data__,p=Gl(f,s);if(p<0)return!1;var M=f.length-1;return p==M?f.pop():$l.call(f,p,1),--this.size,!0}o(IA,"listCacheDelete");function DA(s){var f=this.__data__,p=Gl(f,s);return p<0?t:f[p][1]}o(DA,"listCacheGet");function OA(s){return Gl(this.__data__,s)>-1}o(OA,"listCacheHas");function RA(s,f){var p=this.__data__,M=Gl(p,s);return M<0?(++this.size,p.push([s,f])):p[M][1]=f,this}o(RA,"listCacheSet"),Oo.prototype.clear=kA,Oo.prototype.delete=IA,Oo.prototype.get=DA,Oo.prototype.has=OA,Oo.prototype.set=RA;function Ro(s){var f=-1,p=s==null?0:s.length;for(this.clear();++f<p;){var M=s[f];this.set(M[0],M[1])}}o(Ro,"MapCache");function NA(){this.size=0,this.__data__={hash:new da,map:new(zc||Oo),string:new da}}o(NA,"mapCacheClear");function PA(s){var f=ih(this,s).delete(s);return this.size-=f?1:0,f}o(PA,"mapCacheDelete");function LA(s){return ih(this,s).get(s)}o(LA,"mapCacheGet");function BA(s){return ih(this,s).has(s)}o(BA,"mapCacheHas");function UA(s,f){var p=ih(this,s),M=p.size;return p.set(s,f),this.size+=p.size==M?0:1,this}o(UA,"mapCacheSet"),Ro.prototype.clear=NA,Ro.prototype.delete=PA,Ro.prototype.get=LA,Ro.prototype.has=BA,Ro.prototype.set=UA;function pa(s){var f=-1,p=s==null?0:s.length;for(this.__data__=new Ro;++f<p;)this.add(s[f])}o(pa,"SetCache");function $A(s){return this.__data__.set(s,c),this}o($A,"setCacheAdd");function FA(s){return this.__data__.has(s)}o(FA,"setCacheHas"),pa.prototype.add=pa.prototype.push=$A,pa.prototype.has=FA;function ki(s){var f=this.__data__=new Oo(s);this.size=f.size}o(ki,"Stack");function qA(){this.__data__=new Oo,this.size=0}o(qA,"stackClear");function HA(s){var f=this.__data__,p=f.delete(s);return this.size=f.size,p}o(HA,"stackDelete");function zA(s){return this.__data__.get(s)}o(zA,"stackGet");function KA(s){return this.__data__.has(s)}o(KA,"stackHas");function jA(s,f){var p=this.__data__;if(p instanceof Oo){var M=p.__data__;if(!zc||M.length<r-1)return M.push([s,f]),this.size=++p.size,this;p=this.__data__=new Ro(M)}return p.set(s,f),this.size=p.size,this}o(jA,"stackSet"),ki.prototype.clear=qA,ki.prototype.delete=HA,ki.prototype.get=zA,ki.prototype.has=KA,ki.prototype.set=jA;function z2(s,f){var p=vt(s),M=!p&&ya(s),B=!p&&!M&&_s(s),z=!p&&!M&&!B&&If(s),te=p||M||B||z,fe=te?mp(s.length,tA):[],be=fe.length;for(var Me in s)(f||Vt.call(s,Me))&&!(te&&(Me=="length"||B&&(Me=="offset"||Me=="parent")||z&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||Bo(Me,be)))&&fe.push(Me);return fe}o(z2,"arrayLikeKeys");function K2(s){var f=s.length;return f?s[Op(0,f-1)]:t}o(K2,"arraySample");function GA(s,f){return oh(pn(s),ma(f,0,s.length))}o(GA,"arraySampleSize");function VA(s){return oh(pn(s))}o(VA,"arrayShuffle");function _p(s,f,p){(p!==t&&!Ii(s[f],p)||p===t&&!(f in s))&&No(s,f,p)}o(_p,"assignMergeValue");function Vc(s,f,p){var M=s[f];(!(Vt.call(s,f)&&Ii(M,p))||p===t&&!(f in s))&&No(s,f,p)}o(Vc,"assignValue");function Gl(s,f){for(var p=s.length;p--;)if(Ii(s[p][0],f))return p;return-1}o(Gl,"assocIndexOf");function WA(s,f,p,M){return vs(s,function(B,z,te){f(M,B,p(B),te)}),M}o(WA,"baseAggregator");function j2(s,f){return s&&ro(f,Ar(f),s)}o(j2,"baseAssign");function JA(s,f){return s&&ro(f,bn(f),s)}o(JA,"baseAssignIn");function No(s,f,p){f=="__proto__"&&Fl?Fl(s,f,{configurable:!0,enumerable:!0,value:p,writable:!0}):s[f]=p}o(No,"baseAssignValue");function Ep(s,f){for(var p=-1,M=f.length,B=xe(M),z=s==null;++p<M;)B[p]=z?t:nm(s,f[p]);return B}o(Ep,"baseAt");function ma(s,f,p){return s===s&&(p!==t&&(s=s<=p?s:p),f!==t&&(s=s>=f?s:f)),s}o(ma,"baseClamp");function oi(s,f,p,M,B,z){var te,fe=f&v,be=f&y,Me=f&S;if(p&&(te=B?p(s,M,B,z):p(s)),te!==t)return te;if(!ar(s))return s;var Te=vt(s);if(Te){if(te=BS(s),!fe)return pn(s,te)}else{var Ie=jr(s),Le=Ie==ee||Ie==ne;if(_s(s))return mv(s,fe);if(Ie==re||Ie==k||Le&&!B){if(te=be||Le?{}:Nv(s),!fe)return be?MS(s,JA(te,s)):SS(s,j2(te,s))}else{if(!er[Ie])return B?s:{};te=US(s,Ie,fe)}}z||(z=new ki);var ze=z.get(s);if(ze)return ze;z.set(s,te),cy(s)?s.forEach(function(Qe){te.add(oi(Qe,f,p,Qe,s,z))}):ay(s)&&s.forEach(function(Qe,Ct){te.set(Ct,oi(Qe,f,p,Ct,s,z))});var Ze=Me?be?zp:Hp:be?bn:Ar,Et=Te?t:Ze(s);return ri(Et||s,function(Qe,Ct){Et&&(Ct=Qe,Qe=s[Ct]),Vc(te,Ct,oi(Qe,f,p,Ct,s,z))}),te}o(oi,"baseClone");function YA(s){var f=Ar(s);return function(p){return G2(p,s,f)}}o(YA,"baseConforms");function G2(s,f,p){var M=p.length;if(s==null)return!M;for(s=Zt(s);M--;){var B=p[M],z=f[B],te=s[B];if(te===t&&!(B in s)||!z(te))return!1}return!0}o(G2,"baseConformsTo");function V2(s,f,p){if(typeof s!="function")throw new ni(i);return eu(function(){s.apply(t,p)},f)}o(V2,"baseDelay");function Wc(s,f,p,M){var B=-1,z=kl,te=!0,fe=s.length,be=[],Me=f.length;if(!fe)return be;p&&(f=sr(f,In(p))),M?(z=cp,te=!1):f.length>=r&&(z=qc,te=!1,f=new pa(f));e:for(;++B<fe;){var Te=s[B],Ie=p==null?Te:p(Te);if(Te=M||Te!==0?Te:0,te&&Ie===Ie){for(var Le=Me;Le--;)if(f[Le]===Ie)continue e;be.push(Te)}else z(f,Ie,M)||be.push(Te)}return be}o(Wc,"baseDifference");var vs=xv(to),W2=xv(Sp,!0);function XA(s,f){var p=!0;return vs(s,function(M,B,z){return p=!!f(M,B,z),p}),p}o(XA,"baseEvery");function Vl(s,f,p){for(var M=-1,B=s.length;++M<B;){var z=s[M],te=f(z);if(te!=null&&(fe===t?te===te&&!On(te):p(te,fe)))var fe=te,be=z}return be}o(Vl,"baseExtremum");function ZA(s,f,p,M){var B=s.length;for(p=wt(p),p<0&&(p=-p>B?0:B+p),M=M===t||M>B?B:wt(M),M<0&&(M+=B),M=p>M?0:ly(M);p<M;)s[p++]=f;return s}o(ZA,"baseFill");function J2(s,f){var p=[];return vs(s,function(M,B,z){f(M,B,z)&&p.push(M)}),p}o(J2,"baseFilter");function Pr(s,f,p,M,B){var z=-1,te=s.length;for(p||(p=FS),B||(B=[]);++z<te;){var fe=s[z];f>0&&p(fe)?f>1?Pr(fe,f-1,p,M,B):ps(B,fe):M||(B[B.length]=fe)}return B}o(Pr,"baseFlatten");var Ap=wv(),Y2=wv(!0);function to(s,f){return s&&Ap(s,f,Ar)}o(to,"baseForOwn");function Sp(s,f){return s&&Y2(s,f,Ar)}o(Sp,"baseForOwnRight");function Wl(s,f){return ds(f,function(p){return Uo(s[p])})}o(Wl,"baseFunctions");function ba(s,f){f=xs(f,s);for(var p=0,M=f.length;s!=null&&p<M;)s=s[no(f[p++])];return p&&p==M?s:t}o(ba,"baseGet");function X2(s,f,p){var M=f(s);return vt(s)?M:ps(M,p(s))}o(X2,"baseGetAllKeys");function nn(s){return s==null?s===t?He:ge:ha&&ha in Zt(s)?NS(s):VS(s)}o(nn,"baseGetTag");function Mp(s,f){return s>f}o(Mp,"baseGt");function QA(s,f){return s!=null&&Vt.call(s,f)}o(QA,"baseHas");function eS(s,f){return s!=null&&f in Zt(s)}o(eS,"baseHasIn");function tS(s,f,p){return s>=Kr(f,p)&&s<wr(f,p)}o(tS,"baseInRange");function Tp(s,f,p){for(var M=p?cp:kl,B=s[0].length,z=s.length,te=z,fe=xe(z),be=1/0,Me=[];te--;){var Te=s[te];te&&f&&(Te=sr(Te,In(f))),be=Kr(Te.length,be),fe[te]=!p&&(f||B>=120&&Te.length>=120)?new pa(te&&Te):t}Te=s[0];var Ie=-1,Le=fe[0];e:for(;++Ie<B&&Me.length<be;){var ze=Te[Ie],Ze=f?f(ze):ze;if(ze=p||ze!==0?ze:0,!(Le?qc(Le,Ze):M(Me,Ze,p))){for(te=z;--te;){var Et=fe[te];if(!(Et?qc(Et,Ze):M(s[te],Ze,p)))continue e}Le&&Le.push(Ze),Me.push(ze)}}return Me}o(Tp,"baseIntersection");function rS(s,f,p,M){return to(s,function(B,z,te){f(M,p(B),z,te)}),M}o(rS,"baseInverter");function Jc(s,f,p){f=xs(f,s),s=Uv(s,f);var M=s==null?s:s[no(ai(f))];return M==null?t:kn(M,s,p)}o(Jc,"baseInvoke");function Z2(s){return fr(s)&&nn(s)==k}o(Z2,"baseIsArguments");function nS(s){return fr(s)&&nn(s)==pr}o(nS,"baseIsArrayBuffer");function iS(s){return fr(s)&&nn(s)==se}o(iS,"baseIsDate");function Yc(s,f,p,M,B){return s===f?!0:s==null||f==null||!fr(s)&&!fr(f)?s!==s&&f!==f:oS(s,f,p,M,Yc,B)}o(Yc,"baseIsEqual");function oS(s,f,p,M,B,z){var te=vt(s),fe=vt(f),be=te?he:jr(s),Me=fe?he:jr(f);be=be==k?re:be,Me=Me==k?re:Me;var Te=be==re,Ie=Me==re,Le=be==Me;if(Le&&_s(s)){if(!_s(f))return!1;te=!0,Te=!1}if(Le&&!Te)return z||(z=new ki),te||If(s)?Dv(s,f,p,M,B,z):OS(s,f,be,p,M,B,z);if(!(p&O)){var ze=Te&&Vt.call(s,"__wrapped__"),Ze=Ie&&Vt.call(f,"__wrapped__");if(ze||Ze){var Et=ze?s.value():s,Qe=Ze?f.value():f;return z||(z=new ki),B(Et,Qe,p,M,z)}}return Le?(z||(z=new ki),RS(s,f,p,M,B,z)):!1}o(oS,"baseIsEqualDeep");function sS(s){return fr(s)&&jr(s)==ae}o(sS,"baseIsMap");function Cp(s,f,p,M){var B=p.length,z=B,te=!M;if(s==null)return!z;for(s=Zt(s);B--;){var fe=p[B];if(te&&fe[2]?fe[1]!==s[fe[0]]:!(fe[0]in s))return!1}for(;++B<z;){fe=p[B];var be=fe[0],Me=s[be],Te=fe[1];if(te&&fe[2]){if(Me===t&&!(be in s))return!1}else{var Ie=new ki;if(M)var Le=M(Me,Te,be,s,f,Ie);if(!(Le===t?Yc(Te,Me,O|R,M,Ie):Le))return!1}}return!0}o(Cp,"baseIsMatch");function Q2(s){if(!ar(s)||HS(s))return!1;var f=Uo(s)?sA:Ft;return f.test(va(s))}o(Q2,"baseIsNative");function aS(s){return fr(s)&&nn(s)==ve}o(aS,"baseIsRegExp");function fS(s){return fr(s)&&jr(s)==G}o(fS,"baseIsSet");function cS(s){return fr(s)&&lh(s.length)&&!!ir[nn(s)]}o(cS,"baseIsTypedArray");function ev(s){return typeof s=="function"?s:s==null?gn:typeof s=="object"?vt(s)?nv(s[0],s[1]):rv(s):_y(s)}o(ev,"baseIteratee");function kp(s){if(!Qc(s))return hA(s);var f=[];for(var p in Zt(s))Vt.call(s,p)&&p!="constructor"&&f.push(p);return f}o(kp,"baseKeys");function uS(s){if(!ar(s))return GS(s);var f=Qc(s),p=[];for(var M in s)M=="constructor"&&(f||!Vt.call(s,M))||p.push(M);return p}o(uS,"baseKeysIn");function Ip(s,f){return s<f}o(Ip,"baseLt");function tv(s,f){var p=-1,M=mn(s)?xe(s.length):[];return vs(s,function(B,z,te){M[++p]=f(B,z,te)}),M}o(tv,"baseMap");function rv(s){var f=jp(s);return f.length==1&&f[0][2]?Lv(f[0][0],f[0][1]):function(p){return p===s||Cp(p,s,f)}}o(rv,"baseMatches");function nv(s,f){return Vp(s)&&Pv(f)?Lv(no(s),f):function(p){var M=nm(p,s);return M===t&&M===f?im(p,s):Yc(f,M,O|R)}}o(nv,"baseMatchesProperty");function Jl(s,f,p,M,B){s!==f&&Ap(f,function(z,te){if(B||(B=new ki),ar(z))lS(s,f,te,p,Jl,M,B);else{var fe=M?M(Jp(s,te),z,te+"",s,f,B):t;fe===t&&(fe=z),_p(s,te,fe)}},bn)}o(Jl,"baseMerge");function lS(s,f,p,M,B,z,te){var fe=Jp(s,p),be=Jp(f,p),Me=te.get(be);if(Me){_p(s,p,Me);return}var Te=z?z(fe,be,p+"",s,f,te):t,Ie=Te===t;if(Ie){var Le=vt(be),ze=!Le&&_s(be),Ze=!Le&&!ze&&If(be);Te=be,Le||ze||Ze?vt(fe)?Te=fe:mr(fe)?Te=pn(fe):ze?(Ie=!1,Te=mv(be,!0)):Ze?(Ie=!1,Te=bv(be,!0)):Te=[]:tu(be)||ya(be)?(Te=fe,ya(fe)?Te=hy(fe):(!ar(fe)||Uo(fe))&&(Te=Nv(be))):Ie=!1}Ie&&(te.set(be,Te),B(Te,be,M,z,te),te.delete(be)),_p(s,p,Te)}o(lS,"baseMergeDeep");function iv(s,f){var p=s.length;if(!!p)return f+=f<0?p:0,Bo(f,p)?s[f]:t}o(iv,"baseNth");function ov(s,f,p){f.length?f=sr(f,function(z){return vt(z)?function(te){return ba(te,z.length===1?z[0]:z)}:z}):f=[gn];var M=-1;f=sr(f,In(Ye()));var B=tv(s,function(z,te,fe){var be=sr(f,function(Me){return Me(z)});return{criteria:be,index:++M,value:z}});return U7(B,function(z,te){return AS(z,te,p)})}o(ov,"baseOrderBy");function hS(s,f){return sv(s,f,function(p,M){return im(s,M)})}o(hS,"basePick");function sv(s,f,p){for(var M=-1,B=f.length,z={};++M<B;){var te=f[M],fe=ba(s,te);p(fe,te)&&Xc(z,xs(te,s),fe)}return z}o(sv,"basePickBy");function dS(s){return function(f){return ba(f,s)}}o(dS,"basePropertyDeep");function Dp(s,f,p,M){var B=M?B7:xf,z=-1,te=f.length,fe=s;for(s===f&&(f=pn(f)),p&&(fe=sr(s,In(p)));++z<te;)for(var be=0,Me=f[z],Te=p?p(Me):Me;(be=B(fe,Te,be,M))>-1;)fe!==s&&$l.call(fe,be,1),$l.call(s,be,1);return s}o(Dp,"basePullAll");function av(s,f){for(var p=s?f.length:0,M=p-1;p--;){var B=f[p];if(p==M||B!==z){var z=B;Bo(B)?$l.call(s,B,1):Pp(s,B)}}return s}o(av,"basePullAt");function Op(s,f){return s+Hl(q2()*(f-s+1))}o(Op,"baseRandom");function pS(s,f,p,M){for(var B=-1,z=wr(ql((f-s)/(p||1)),0),te=xe(z);z--;)te[M?z:++B]=s,s+=p;return te}o(pS,"baseRange");function Rp(s,f){var p="";if(!s||f<1||f>_)return p;do f%2&&(p+=s),f=Hl(f/2),f&&(s+=s);while(f);return p}o(Rp,"baseRepeat");function Mt(s,f){return Yp(Bv(s,f,gn),s+"")}o(Mt,"baseRest");function mS(s){return K2(Df(s))}o(mS,"baseSample");function bS(s,f){var p=Df(s);return oh(p,ma(f,0,p.length))}o(bS,"baseSampleSize");function Xc(s,f,p,M){if(!ar(s))return s;f=xs(f,s);for(var B=-1,z=f.length,te=z-1,fe=s;fe!=null&&++B<z;){var be=no(f[B]),Me=p;if(be==="__proto__"||be==="constructor"||be==="prototype")return s;if(B!=te){var Te=fe[be];Me=M?M(Te,be,fe):t,Me===t&&(Me=ar(Te)?Te:Bo(f[B+1])?[]:{})}Vc(fe,be,Me),fe=fe[be]}return s}o(Xc,"baseSet");var fv=zl?function(s,f){return zl.set(s,f),s}:gn,gS=Fl?function(s,f){return Fl(s,"toString",{configurable:!0,enumerable:!1,value:sm(f),writable:!0})}:gn;function vS(s){return oh(Df(s))}o(vS,"baseShuffle");function si(s,f,p){var M=-1,B=s.length;f<0&&(f=-f>B?0:B+f),p=p>B?B:p,p<0&&(p+=B),B=f>p?0:p-f>>>0,f>>>=0;for(var z=xe(B);++M<B;)z[M]=s[M+f];return z}o(si,"baseSlice");function yS(s,f){var p;return vs(s,function(M,B,z){return p=f(M,B,z),!p}),!!p}o(yS,"baseSome");function Yl(s,f,p){var M=0,B=s==null?M:s.length;if(typeof f=="number"&&f===f&&B<=P){for(;M<B;){var z=M+B>>>1,te=s[z];te!==null&&!On(te)&&(p?te<=f:te<f)?M=z+1:B=z}return B}return Np(s,f,gn,p)}o(Yl,"baseSortedIndex");function Np(s,f,p,M){var B=0,z=s==null?0:s.length;if(z===0)return 0;f=p(f);for(var te=f!==f,fe=f===null,be=On(f),Me=f===t;B<z;){var Te=Hl((B+z)/2),Ie=p(s[Te]),Le=Ie!==t,ze=Ie===null,Ze=Ie===Ie,Et=On(Ie);if(te)var Qe=M||Ze;else Me?Qe=Ze&&(M||Le):fe?Qe=Ze&&Le&&(M||!ze):be?Qe=Ze&&Le&&!ze&&(M||!Et):ze||Et?Qe=!1:Qe=M?Ie<=f:Ie<f;Qe?B=Te+1:z=Te}return Kr(z,C)}o(Np,"baseSortedIndexBy");function cv(s,f){for(var p=-1,M=s.length,B=0,z=[];++p<M;){var te=s[p],fe=f?f(te):te;if(!p||!Ii(fe,be)){var be=fe;z[B++]=te===0?0:te}}return z}o(cv,"baseSortedUniq");function uv(s){return typeof s=="number"?s:On(s)?E:+s}o(uv,"baseToNumber");function Dn(s){if(typeof s=="string")return s;if(vt(s))return sr(s,Dn)+"";if(On(s))return H2?H2.call(s):"";var f=s+"";return f=="0"&&1/s==-m?"-0":f}o(Dn,"baseToString");function ys(s,f,p){var M=-1,B=kl,z=s.length,te=!0,fe=[],be=fe;if(p)te=!1,B=cp;else if(z>=r){var Me=f?null:IS(s);if(Me)return Dl(Me);te=!1,B=qc,be=new pa}else be=f?[]:fe;e:for(;++M<z;){var Te=s[M],Ie=f?f(Te):Te;if(Te=p||Te!==0?Te:0,te&&Ie===Ie){for(var Le=be.length;Le--;)if(be[Le]===Ie)continue e;f&&be.push(Ie),fe.push(Te)}else B(be,Ie,p)||(be!==fe&&be.push(Ie),fe.push(Te))}return fe}o(ys,"baseUniq");function Pp(s,f){return f=xs(f,s),s=Uv(s,f),s==null||delete s[no(ai(f))]}o(Pp,"baseUnset");function lv(s,f,p,M){return Xc(s,f,p(ba(s,f)),M)}o(lv,"baseUpdate");function Xl(s,f,p,M){for(var B=s.length,z=M?B:-1;(M?z--:++z<B)&&f(s[z],z,s););return p?si(s,M?0:z,M?z+1:B):si(s,M?z+1:0,M?B:z)}o(Xl,"baseWhile");function hv(s,f){var p=s;return p instanceof Ot&&(p=p.value()),up(f,function(M,B){return B.func.apply(B.thisArg,ps([M],B.args))},p)}o(hv,"baseWrapperValue");function Lp(s,f,p){var M=s.length;if(M<2)return M?ys(s[0]):[];for(var B=-1,z=xe(M);++B<M;)for(var te=s[B],fe=-1;++fe<M;)fe!=B&&(z[B]=Wc(z[B]||te,s[fe],f,p));return ys(Pr(z,1),f,p)}o(Lp,"baseXor");function dv(s,f,p){for(var M=-1,B=s.length,z=f.length,te={};++M<B;){var fe=M<z?f[M]:t;p(te,s[M],fe)}return te}o(dv,"baseZipObject");function Bp(s){return mr(s)?s:[]}o(Bp,"castArrayLikeObject");function Up(s){return typeof s=="function"?s:gn}o(Up,"castFunction");function xs(s,f){return vt(s)?s:Vp(s,f)?[s]:Hv(Kt(s))}o(xs,"castPath");var xS=Mt;function ws(s,f,p){var M=s.length;return p=p===t?M:p,!f&&p>=M?s:si(s,f,p)}o(ws,"castSlice");var pv=aA||function(s){return Er.clearTimeout(s)};function mv(s,f){if(f)return s.slice();var p=s.length,M=L2?L2(p):new s.constructor(p);return s.copy(M),M}o(mv,"cloneBuffer");function $p(s){var f=new s.constructor(s.byteLength);return new Bl(f).set(new Bl(s)),f}o($p,"cloneArrayBuffer");function wS(s,f){var p=f?$p(s.buffer):s.buffer;return new s.constructor(p,s.byteOffset,s.byteLength)}o(wS,"cloneDataView");function _S(s){var f=new s.constructor(s.source,tt.exec(s));return f.lastIndex=s.lastIndex,f}o(_S,"cloneRegExp");function ES(s){return Gc?Zt(Gc.call(s)):{}}o(ES,"cloneSymbol");function bv(s,f){var p=f?$p(s.buffer):s.buffer;return new s.constructor(p,s.byteOffset,s.length)}o(bv,"cloneTypedArray");function gv(s,f){if(s!==f){var p=s!==t,M=s===null,B=s===s,z=On(s),te=f!==t,fe=f===null,be=f===f,Me=On(f);if(!fe&&!Me&&!z&&s>f||z&&te&&be&&!fe&&!Me||M&&te&&be||!p&&be||!B)return 1;if(!M&&!z&&!Me&&s<f||Me&&p&&B&&!M&&!z||fe&&p&&B||!te&&B||!be)return-1}return 0}o(gv,"compareAscending");function AS(s,f,p){for(var M=-1,B=s.criteria,z=f.criteria,te=B.length,fe=p.length;++M<te;){var be=gv(B[M],z[M]);if(be){if(M>=fe)return be;var Me=p[M];return be*(Me=="desc"?-1:1)}}return s.index-f.index}o(AS,"compareMultiple");function vv(s,f,p,M){for(var B=-1,z=s.length,te=p.length,fe=-1,be=f.length,Me=wr(z-te,0),Te=xe(be+Me),Ie=!M;++fe<be;)Te[fe]=f[fe];for(;++B<te;)(Ie||B<z)&&(Te[p[B]]=s[B]);for(;Me--;)Te[fe++]=s[B++];return Te}o(vv,"composeArgs");function yv(s,f,p,M){for(var B=-1,z=s.length,te=-1,fe=p.length,be=-1,Me=f.length,Te=wr(z-fe,0),Ie=xe(Te+Me),Le=!M;++B<Te;)Ie[B]=s[B];for(var ze=B;++be<Me;)Ie[ze+be]=f[be];for(;++te<fe;)(Le||B<z)&&(Ie[ze+p[te]]=s[B++]);return Ie}o(yv,"composeArgsRight");function pn(s,f){var p=-1,M=s.length;for(f||(f=xe(M));++p<M;)f[p]=s[p];return f}o(pn,"copyArray");function ro(s,f,p,M){var B=!p;p||(p={});for(var z=-1,te=f.length;++z<te;){var fe=f[z],be=M?M(p[fe],s[fe],fe,p,s):t;be===t&&(be=s[fe]),B?No(p,fe,be):Vc(p,fe,be)}return p}o(ro,"copyObject");function SS(s,f){return ro(s,Gp(s),f)}o(SS,"copySymbols");function MS(s,f){return ro(s,Ov(s),f)}o(MS,"copySymbolsIn");function Zl(s,f){return function(p,M){var B=vt(p)?D7:WA,z=f?f():{};return B(p,s,Ye(M,2),z)}}o(Zl,"createAggregator");function Tf(s){return Mt(function(f,p){var M=-1,B=p.length,z=B>1?p[B-1]:t,te=B>2?p[2]:t;for(z=s.length>3&&typeof z=="function"?(B--,z):t,te&&on(p[0],p[1],te)&&(z=B<3?t:z,B=1),f=Zt(f);++M<B;){var fe=p[M];fe&&s(f,fe,M,z)}return f})}o(Tf,"createAssigner");function xv(s,f){return function(p,M){if(p==null)return p;if(!mn(p))return s(p,M);for(var B=p.length,z=f?B:-1,te=Zt(p);(f?z--:++z<B)&&M(te[z],z,te)!==!1;);return p}}o(xv,"createBaseEach");function wv(s){return function(f,p,M){for(var B=-1,z=Zt(f),te=M(f),fe=te.length;fe--;){var be=te[s?fe:++B];if(p(z[be],be,z)===!1)break}return f}}o(wv,"createBaseFor");function TS(s,f,p){var M=f&I,B=Zc(s);function z(){var te=this&&this!==Er&&this instanceof z?B:s;return te.apply(M?p:this,arguments)}return o(z,"wrapper"),z}o(TS,"createBind");function _v(s){return function(f){f=Kt(f);var p=wf(f)?Ci(f):t,M=p?p[0]:f.charAt(0),B=p?ws(p,1).join(""):f.slice(1);return M[s]()+B}}o(_v,"createCaseFirst");function Cf(s){return function(f){return up(xy(yy(f).replace(g7,"")),s,"")}}o(Cf,"createCompounder");function Zc(s){return function(){var f=arguments;switch(f.length){case 0:return new s;case 1:return new s(f[0]);case 2:return new s(f[0],f[1]);case 3:return new s(f[0],f[1],f[2]);case 4:return new s(f[0],f[1],f[2],f[3]);case 5:return new s(f[0],f[1],f[2],f[3],f[4]);case 6:return new s(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new s(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var p=Mf(s.prototype),M=s.apply(p,f);return ar(M)?M:p}}o(Zc,"createCtor");function CS(s,f,p){var M=Zc(s);function B(){for(var z=arguments.length,te=xe(z),fe=z,be=kf(B);fe--;)te[fe]=arguments[fe];var Me=z<3&&te[0]!==be&&te[z-1]!==be?[]:ms(te,be);if(z-=Me.length,z<p)return Tv(s,f,Ql,B.placeholder,t,te,Me,t,t,p-z);var Te=this&&this!==Er&&this instanceof B?M:s;return kn(Te,this,te)}return o(B,"wrapper"),B}o(CS,"createCurry");function Ev(s){return function(f,p,M){var B=Zt(f);if(!mn(f)){var z=Ye(p,3);f=Ar(f),p=o(function(fe){return z(B[fe],fe,B)},"predicate")}var te=s(f,p,M);return te>-1?B[z?f[te]:te]:t}}o(Ev,"createFind");function Av(s){return Lo(function(f){var p=f.length,M=p,B=ii.prototype.thru;for(s&&f.reverse();M--;){var z=f[M];if(typeof z!="function")throw new ni(i);if(B&&!te&&nh(z)=="wrapper")var te=new ii([],!0)}for(M=te?M:p;++M<p;){z=f[M];var fe=nh(z),be=fe=="wrapper"?Kp(z):t;be&&Wp(be[0])&&be[1]==(oe|L|Z|K)&&!be[4].length&&be[9]==1?te=te[nh(be[0])].apply(te,be[3]):te=z.length==1&&Wp(z)?te[fe]():te.thru(z)}return function(){var Me=arguments,Te=Me[0];if(te&&Me.length==1&&vt(Te))return te.plant(Te).value();for(var Ie=0,Le=p?f[Ie].apply(this,Me):Te;++Ie<p;)Le=f[Ie].call(this,Le);return Le}})}o(Av,"createFlow");function Ql(s,f,p,M,B,z,te,fe,be,Me){var Te=f&oe,Ie=f&I,Le=f&N,ze=f&(L|V),Ze=f&q,Et=Le?t:Zc(s);function Qe(){for(var Ct=arguments.length,Rt=xe(Ct),Rn=Ct;Rn--;)Rt[Rn]=arguments[Rn];if(ze)var sn=kf(Qe),Nn=F7(Rt,sn);if(M&&(Rt=vv(Rt,M,B,ze)),z&&(Rt=yv(Rt,z,te,ze)),Ct-=Nn,ze&&Ct<Me){var br=ms(Rt,sn);return Tv(s,f,Ql,Qe.placeholder,p,Rt,br,fe,be,Me-Ct)}var Di=Ie?p:this,Fo=Le?Di[s]:s;return Ct=Rt.length,fe?Rt=WS(Rt,fe):Ze&&Ct>1&&Rt.reverse(),Te&&be<Ct&&(Rt.length=be),this&&this!==Er&&this instanceof Qe&&(Fo=Et||Zc(Fo)),Fo.apply(Di,Rt)}return o(Qe,"wrapper"),Qe}o(Ql,"createHybrid");function Sv(s,f){return function(p,M){return rS(p,s,f(M),{})}}o(Sv,"createInverter");function eh(s,f){return function(p,M){var B;if(p===t&&M===t)return f;if(p!==t&&(B=p),M!==t){if(B===t)return M;typeof p=="string"||typeof M=="string"?(p=Dn(p),M=Dn(M)):(p=uv(p),M=uv(M)),B=s(p,M)}return B}}o(eh,"createMathOperation");function Fp(s){return Lo(function(f){return f=sr(f,In(Ye())),Mt(function(p){var M=this;return s(f,function(B){return kn(B,M,p)})})})}o(Fp,"createOver");function th(s,f){f=f===t?" ":Dn(f);var p=f.length;if(p<2)return p?Rp(f,s):f;var M=Rp(f,ql(s/_f(f)));return wf(f)?ws(Ci(M),0,s).join(""):M.slice(0,s)}o(th,"createPadding");function kS(s,f,p,M){var B=f&I,z=Zc(s);function te(){for(var fe=-1,be=arguments.length,Me=-1,Te=M.length,Ie=xe(Te+be),Le=this&&this!==Er&&this instanceof te?z:s;++Me<Te;)Ie[Me]=M[Me];for(;be--;)Ie[Me++]=arguments[++fe];return kn(Le,B?p:this,Ie)}return o(te,"wrapper"),te}o(kS,"createPartial");function Mv(s){return function(f,p,M){return M&&typeof M!="number"&&on(f,p,M)&&(p=M=t),f=$o(f),p===t?(p=f,f=0):p=$o(p),M=M===t?f<p?1:-1:$o(M),pS(f,p,M,s)}}o(Mv,"createRange");function rh(s){return function(f,p){return typeof f=="string"&&typeof p=="string"||(f=fi(f),p=fi(p)),s(f,p)}}o(rh,"createRelationalOperation");function Tv(s,f,p,M,B,z,te,fe,be,Me){var Te=f&L,Ie=Te?te:t,Le=Te?t:te,ze=Te?z:t,Ze=Te?t:z;f|=Te?Z:Y,f&=~(Te?Y:Z),f&J||(f&=~(I|N));var Et=[s,f,B,ze,Ie,Ze,Le,fe,be,Me],Qe=p.apply(t,Et);return Wp(s)&&$v(Qe,Et),Qe.placeholder=M,Fv(Qe,s,f)}o(Tv,"createRecurry");function qp(s){var f=xr[s];return function(p,M){if(p=fi(p),M=M==null?0:Kr(wt(M),292),M&&F2(p)){var B=(Kt(p)+"e").split("e"),z=f(B[0]+"e"+(+B[1]+M));return B=(Kt(z)+"e").split("e"),+(B[0]+"e"+(+B[1]-M))}return f(p)}}o(qp,"createRound");var IS=Af&&1/Dl(new Af([,-0]))[1]==m?function(s){return new Af(s)}:cm;function Cv(s){return function(f){var p=jr(f);return p==ae?gp(f):p==G?V7(f):$7(f,s(f))}}o(Cv,"createToPairs");function Po(s,f,p,M,B,z,te,fe){var be=f&N;if(!be&&typeof s!="function")throw new ni(i);var Me=M?M.length:0;if(Me||(f&=~(Z|Y),M=B=t),te=te===t?te:wr(wt(te),0),fe=fe===t?fe:wt(fe),Me-=B?B.length:0,f&Y){var Te=M,Ie=B;M=B=t}var Le=be?t:Kp(s),ze=[s,f,p,M,B,Te,Ie,z,te,fe];if(Le&&jS(ze,Le),s=ze[0],f=ze[1],p=ze[2],M=ze[3],B=ze[4],fe=ze[9]=ze[9]===t?be?0:s.length:wr(ze[9]-Me,0),!fe&&f&(L|V)&&(f&=~(L|V)),!f||f==I)var Ze=TS(s,f,p);else f==L||f==V?Ze=CS(s,f,fe):(f==Z||f==(I|Z))&&!B.length?Ze=kS(s,f,p,M):Ze=Ql.apply(t,ze);var Et=Le?fv:$v;return Fv(Et(Ze,ze),s,f)}o(Po,"createWrap");function kv(s,f,p,M){return s===t||Ii(s,Ef[p])&&!Vt.call(M,p)?f:s}o(kv,"customDefaultsAssignIn");function Iv(s,f,p,M,B,z){return ar(s)&&ar(f)&&(z.set(f,s),Jl(s,f,t,Iv,z),z.delete(f)),s}o(Iv,"customDefaultsMerge");function DS(s){return tu(s)?t:s}o(DS,"customOmitClone");function Dv(s,f,p,M,B,z){var te=p&O,fe=s.length,be=f.length;if(fe!=be&&!(te&&be>fe))return!1;var Me=z.get(s),Te=z.get(f);if(Me&&Te)return Me==f&&Te==s;var Ie=-1,Le=!0,ze=p&R?new pa:t;for(z.set(s,f),z.set(f,s);++Ie<fe;){var Ze=s[Ie],Et=f[Ie];if(M)var Qe=te?M(Et,Ze,Ie,f,s,z):M(Ze,Et,Ie,s,f,z);if(Qe!==t){if(Qe)continue;Le=!1;break}if(ze){if(!lp(f,function(Ct,Rt){if(!qc(ze,Rt)&&(Ze===Ct||B(Ze,Ct,p,M,z)))return ze.push(Rt)})){Le=!1;break}}else if(!(Ze===Et||B(Ze,Et,p,M,z))){Le=!1;break}}return z.delete(s),z.delete(f),Le}o(Dv,"equalArrays");function OS(s,f,p,M,B,z,te){switch(p){case ue:if(s.byteLength!=f.byteLength||s.byteOffset!=f.byteOffset)return!1;s=s.buffer,f=f.buffer;case pr:return!(s.byteLength!=f.byteLength||!z(new Bl(s),new Bl(f)));case Q:case se:case Ae:return Ii(+s,+f);case $:return s.name==f.name&&s.message==f.message;case ve:case pe:return s==f+"";case ae:var fe=gp;case G:var be=M&O;if(fe||(fe=Dl),s.size!=f.size&&!be)return!1;var Me=te.get(s);if(Me)return Me==f;M|=R,te.set(s,f);var Te=Dv(fe(s),fe(f),M,B,z,te);return te.delete(s),Te;case Ce:if(Gc)return Gc.call(s)==Gc.call(f)}return!1}o(OS,"equalByTag");function RS(s,f,p,M,B,z){var te=p&O,fe=Hp(s),be=fe.length,Me=Hp(f),Te=Me.length;if(be!=Te&&!te)return!1;for(var Ie=be;Ie--;){var Le=fe[Ie];if(!(te?Le in f:Vt.call(f,Le)))return!1}var ze=z.get(s),Ze=z.get(f);if(ze&&Ze)return ze==f&&Ze==s;var Et=!0;z.set(s,f),z.set(f,s);for(var Qe=te;++Ie<be;){Le=fe[Ie];var Ct=s[Le],Rt=f[Le];if(M)var Rn=te?M(Rt,Ct,Le,f,s,z):M(Ct,Rt,Le,s,f,z);if(!(Rn===t?Ct===Rt||B(Ct,Rt,p,M,z):Rn)){Et=!1;break}Qe||(Qe=Le=="constructor")}if(Et&&!Qe){var sn=s.constructor,Nn=f.constructor;sn!=Nn&&"constructor"in s&&"constructor"in f&&!(typeof sn=="function"&&sn instanceof sn&&typeof Nn=="function"&&Nn instanceof Nn)&&(Et=!1)}return z.delete(s),z.delete(f),Et}o(RS,"equalObjects");function Lo(s){return Yp(Bv(s,t,Gv),s+"")}o(Lo,"flatRest");function Hp(s){return X2(s,Ar,Gp)}o(Hp,"getAllKeys");function zp(s){return X2(s,bn,Ov)}o(zp,"getAllKeysIn");var Kp=zl?function(s){return zl.get(s)}:cm;function nh(s){for(var f=s.name+"",p=Sf[f],M=Vt.call(Sf,f)?p.length:0;M--;){var B=p[M],z=B.func;if(z==null||z==s)return B.name}return f}o(nh,"getFuncName");function kf(s){var f=Vt.call(H,"placeholder")?H:s;return f.placeholder}o(kf,"getHolder");function Ye(){var s=H.iteratee||am;return s=s===am?ev:s,arguments.length?s(arguments[0],arguments[1]):s}o(Ye,"getIteratee");function ih(s,f){var p=s.__data__;return qS(f)?p[typeof f=="string"?"string":"hash"]:p.map}o(ih,"getMapData");function jp(s){for(var f=Ar(s),p=f.length;p--;){var M=f[p],B=s[M];f[p]=[M,B,Pv(B)]}return f}o(jp,"getMatchData");function ga(s,f){var p=K7(s,f);return Q2(p)?p:t}o(ga,"getNative");function NS(s){var f=Vt.call(s,ha),p=s[ha];try{s[ha]=t;var M=!0}catch{}var B=Pl.call(s);return M&&(f?s[ha]=p:delete s[ha]),B}o(NS,"getRawTag");var Gp=yp?function(s){return s==null?[]:(s=Zt(s),ds(yp(s),function(f){return U2.call(s,f)}))}:um,Ov=yp?function(s){for(var f=[];s;)ps(f,Gp(s)),s=Ul(s);return f}:um,jr=nn;(xp&&jr(new xp(new ArrayBuffer(1)))!=ue||zc&&jr(new zc)!=ae||wp&&jr(wp.resolve())!=Se||Af&&jr(new Af)!=G||Kc&&jr(new Kc)!=Ne)&&(jr=o(function(s){var f=nn(s),p=f==re?s.constructor:t,M=p?va(p):"";if(M)switch(M){case bA:return ue;case gA:return ae;case vA:return Se;case yA:return G;case xA:return Ne}return f},"getTag"));function PS(s,f,p){for(var M=-1,B=p.length;++M<B;){var z=p[M],te=z.size;switch(z.type){case"drop":s+=te;break;case"dropRight":f-=te;break;case"take":f=Kr(f,s+te);break;case"takeRight":s=wr(s,f-te);break}}return{start:s,end:f}}o(PS,"getView");function LS(s){var f=s.match(ut);return f?f[1].split(Zn):[]}o(LS,"getWrapDetails");function Rv(s,f,p){f=xs(f,s);for(var M=-1,B=f.length,z=!1;++M<B;){var te=no(f[M]);if(!(z=s!=null&&p(s,te)))break;s=s[te]}return z||++M!=B?z:(B=s==null?0:s.length,!!B&&lh(B)&&Bo(te,B)&&(vt(s)||ya(s)))}o(Rv,"hasPath");function BS(s){var f=s.length,p=new s.constructor(f);return f&&typeof s[0]=="string"&&Vt.call(s,"index")&&(p.index=s.index,p.input=s.input),p}o(BS,"initCloneArray");function Nv(s){return typeof s.constructor=="function"&&!Qc(s)?Mf(Ul(s)):{}}o(Nv,"initCloneObject");function US(s,f,p){var M=s.constructor;switch(f){case pr:return $p(s);case Q:case se:return new M(+s);case ue:return wS(s,p);case ie:case U:case X:case me:case ye:case we:case ke:case Dt:case Ue:return bv(s,p);case ae:return new M;case Ae:case pe:return new M(s);case ve:return _S(s);case G:return new M;case Ce:return ES(s)}}o(US,"initCloneByTag");function $S(s,f){var p=f.length;if(!p)return s;var M=p-1;return f[M]=(p>1?"& ":"")+f[M],f=f.join(p>2?", ":" "),s.replace(ct,`{
2
+ /* [wrapped with `+f+`] */
3
+ `)}o($S,"insertWrapDetails");function FS(s){return vt(s)||ya(s)||!!($2&&s&&s[$2])}o(FS,"isFlattenable");function Bo(s,f){var p=typeof s;return f=f??_,!!f&&(p=="number"||p!="symbol"&&ln.test(s))&&s>-1&&s%1==0&&s<f}o(Bo,"isIndex");function on(s,f,p){if(!ar(p))return!1;var M=typeof f;return(M=="number"?mn(p)&&Bo(f,p.length):M=="string"&&f in p)?Ii(p[f],s):!1}o(on,"isIterateeCall");function Vp(s,f){if(vt(s))return!1;var p=typeof s;return p=="number"||p=="symbol"||p=="boolean"||s==null||On(s)?!0:st.test(s)||!Yn.test(s)||f!=null&&s in Zt(f)}o(Vp,"isKey");function qS(s){var f=typeof s;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?s!=="__proto__":s===null}o(qS,"isKeyable");function Wp(s){var f=nh(s),p=H[f];if(typeof p!="function"||!(f in Ot.prototype))return!1;if(s===p)return!0;var M=Kp(p);return!!M&&s===M[0]}o(Wp,"isLaziable");function HS(s){return!!P2&&P2 in s}o(HS,"isMasked");var zS=Rl?Uo:lm;function Qc(s){var f=s&&s.constructor,p=typeof f=="function"&&f.prototype||Ef;return s===p}o(Qc,"isPrototype");function Pv(s){return s===s&&!ar(s)}o(Pv,"isStrictComparable");function Lv(s,f){return function(p){return p==null?!1:p[s]===f&&(f!==t||s in Zt(p))}}o(Lv,"matchesStrictComparable");function KS(s){var f=ch(s,function(M){return p.size===u&&p.clear(),M}),p=f.cache;return f}o(KS,"memoizeCapped");function jS(s,f){var p=s[1],M=f[1],B=p|M,z=B<(I|N|oe),te=M==oe&&p==L||M==oe&&p==K&&s[7].length<=f[8]||M==(oe|K)&&f[7].length<=f[8]&&p==L;if(!(z||te))return s;M&I&&(s[2]=f[2],B|=p&I?0:J);var fe=f[3];if(fe){var be=s[3];s[3]=be?vv(be,fe,f[4]):fe,s[4]=be?ms(s[3],d):f[4]}return fe=f[5],fe&&(be=s[5],s[5]=be?yv(be,fe,f[6]):fe,s[6]=be?ms(s[5],d):f[6]),fe=f[7],fe&&(s[7]=fe),M&oe&&(s[8]=s[8]==null?f[8]:Kr(s[8],f[8])),s[9]==null&&(s[9]=f[9]),s[0]=f[0],s[1]=B,s}o(jS,"mergeData");function GS(s){var f=[];if(s!=null)for(var p in Zt(s))f.push(p);return f}o(GS,"nativeKeysIn");function VS(s){return Pl.call(s)}o(VS,"objectToString");function Bv(s,f,p){return f=wr(f===t?s.length-1:f,0),function(){for(var M=arguments,B=-1,z=wr(M.length-f,0),te=xe(z);++B<z;)te[B]=M[f+B];B=-1;for(var fe=xe(f+1);++B<f;)fe[B]=M[B];return fe[f]=p(te),kn(s,this,fe)}}o(Bv,"overRest");function Uv(s,f){return f.length<2?s:ba(s,si(f,0,-1))}o(Uv,"parent");function WS(s,f){for(var p=s.length,M=Kr(f.length,p),B=pn(s);M--;){var z=f[M];s[M]=Bo(z,p)?B[z]:t}return s}o(WS,"reorder");function Jp(s,f){if(!(f==="constructor"&&typeof s[f]=="function")&&f!="__proto__")return s[f]}o(Jp,"safeGet");var $v=qv(fv),eu=cA||function(s,f){return Er.setTimeout(s,f)},Yp=qv(gS);function Fv(s,f,p){var M=f+"";return Yp(s,$S(M,JS(LS(M),p)))}o(Fv,"setWrapToString");function qv(s){var f=0,p=0;return function(){var M=dA(),B=h-(M-p);if(p=M,B>0){if(++f>=T)return arguments[0]}else f=0;return s.apply(t,arguments)}}o(qv,"shortOut");function oh(s,f){var p=-1,M=s.length,B=M-1;for(f=f===t?M:f;++p<f;){var z=Op(p,B),te=s[z];s[z]=s[p],s[p]=te}return s.length=f,s}o(oh,"shuffleSelf");var Hv=KS(function(s){var f=[];return s.charCodeAt(0)===46&&f.push(""),s.replace(at,function(p,M,B,z){f.push(B?z.replace(Qn,"$1"):M||p)}),f});function no(s){if(typeof s=="string"||On(s))return s;var f=s+"";return f=="0"&&1/s==-m?"-0":f}o(no,"toKey");function va(s){if(s!=null){try{return Nl.call(s)}catch{}try{return s+""}catch{}}return""}o(va,"toSource");function JS(s,f){return ri(w,function(p){var M="_."+p[0];f&p[1]&&!kl(s,M)&&s.push(M)}),s.sort()}o(JS,"updateWrapDetails");function zv(s){if(s instanceof Ot)return s.clone();var f=new ii(s.__wrapped__,s.__chain__);return f.__actions__=pn(s.__actions__),f.__index__=s.__index__,f.__values__=s.__values__,f}o(zv,"wrapperClone");function YS(s,f,p){(p?on(s,f,p):f===t)?f=1:f=wr(wt(f),0);var M=s==null?0:s.length;if(!M||f<1)return[];for(var B=0,z=0,te=xe(ql(M/f));B<M;)te[z++]=si(s,B,B+=f);return te}o(YS,"chunk");function XS(s){for(var f=-1,p=s==null?0:s.length,M=0,B=[];++f<p;){var z=s[f];z&&(B[M++]=z)}return B}o(XS,"compact");function ZS(){var s=arguments.length;if(!s)return[];for(var f=xe(s-1),p=arguments[0],M=s;M--;)f[M-1]=arguments[M];return ps(vt(p)?pn(p):[p],Pr(f,1))}o(ZS,"concat");var QS=Mt(function(s,f){return mr(s)?Wc(s,Pr(f,1,mr,!0)):[]}),eM=Mt(function(s,f){var p=ai(f);return mr(p)&&(p=t),mr(s)?Wc(s,Pr(f,1,mr,!0),Ye(p,2)):[]}),tM=Mt(function(s,f){var p=ai(f);return mr(p)&&(p=t),mr(s)?Wc(s,Pr(f,1,mr,!0),t,p):[]});function rM(s,f,p){var M=s==null?0:s.length;return M?(f=p||f===t?1:wt(f),si(s,f<0?0:f,M)):[]}o(rM,"drop");function nM(s,f,p){var M=s==null?0:s.length;return M?(f=p||f===t?1:wt(f),f=M-f,si(s,0,f<0?0:f)):[]}o(nM,"dropRight");function iM(s,f){return s&&s.length?Xl(s,Ye(f,3),!0,!0):[]}o(iM,"dropRightWhile");function oM(s,f){return s&&s.length?Xl(s,Ye(f,3),!0):[]}o(oM,"dropWhile");function sM(s,f,p,M){var B=s==null?0:s.length;return B?(p&&typeof p!="number"&&on(s,f,p)&&(p=0,M=B),ZA(s,f,p,M)):[]}o(sM,"fill");function Kv(s,f,p){var M=s==null?0:s.length;if(!M)return-1;var B=p==null?0:wt(p);return B<0&&(B=wr(M+B,0)),Il(s,Ye(f,3),B)}o(Kv,"findIndex");function jv(s,f,p){var M=s==null?0:s.length;if(!M)return-1;var B=M-1;return p!==t&&(B=wt(p),B=p<0?wr(M+B,0):Kr(B,M-1)),Il(s,Ye(f,3),B,!0)}o(jv,"findLastIndex");function Gv(s){var f=s==null?0:s.length;return f?Pr(s,1):[]}o(Gv,"flatten");function aM(s){var f=s==null?0:s.length;return f?Pr(s,m):[]}o(aM,"flattenDeep");function fM(s,f){var p=s==null?0:s.length;return p?(f=f===t?1:wt(f),Pr(s,f)):[]}o(fM,"flattenDepth");function cM(s){for(var f=-1,p=s==null?0:s.length,M={};++f<p;){var B=s[f];M[B[0]]=B[1]}return M}o(cM,"fromPairs");function Vv(s){return s&&s.length?s[0]:t}o(Vv,"head");function uM(s,f,p){var M=s==null?0:s.length;if(!M)return-1;var B=p==null?0:wt(p);return B<0&&(B=wr(M+B,0)),xf(s,f,B)}o(uM,"indexOf");function lM(s){var f=s==null?0:s.length;return f?si(s,0,-1):[]}o(lM,"initial");var hM=Mt(function(s){var f=sr(s,Bp);return f.length&&f[0]===s[0]?Tp(f):[]}),dM=Mt(function(s){var f=ai(s),p=sr(s,Bp);return f===ai(p)?f=t:p.pop(),p.length&&p[0]===s[0]?Tp(p,Ye(f,2)):[]}),pM=Mt(function(s){var f=ai(s),p=sr(s,Bp);return f=typeof f=="function"?f:t,f&&p.pop(),p.length&&p[0]===s[0]?Tp(p,t,f):[]});function mM(s,f){return s==null?"":lA.call(s,f)}o(mM,"join");function ai(s){var f=s==null?0:s.length;return f?s[f-1]:t}o(ai,"last");function bM(s,f,p){var M=s==null?0:s.length;if(!M)return-1;var B=M;return p!==t&&(B=wt(p),B=B<0?wr(M+B,0):Kr(B,M-1)),f===f?J7(s,f,B):Il(s,T2,B,!0)}o(bM,"lastIndexOf");function gM(s,f){return s&&s.length?iv(s,wt(f)):t}o(gM,"nth");var vM=Mt(Wv);function Wv(s,f){return s&&s.length&&f&&f.length?Dp(s,f):s}o(Wv,"pullAll");function yM(s,f,p){return s&&s.length&&f&&f.length?Dp(s,f,Ye(p,2)):s}o(yM,"pullAllBy");function xM(s,f,p){return s&&s.length&&f&&f.length?Dp(s,f,t,p):s}o(xM,"pullAllWith");var wM=Lo(function(s,f){var p=s==null?0:s.length,M=Ep(s,f);return av(s,sr(f,function(B){return Bo(B,p)?+B:B}).sort(gv)),M});function _M(s,f){var p=[];if(!(s&&s.length))return p;var M=-1,B=[],z=s.length;for(f=Ye(f,3);++M<z;){var te=s[M];f(te,M,s)&&(p.push(te),B.push(M))}return av(s,B),p}o(_M,"remove");function Xp(s){return s==null?s:mA.call(s)}o(Xp,"reverse");function EM(s,f,p){var M=s==null?0:s.length;return M?(p&&typeof p!="number"&&on(s,f,p)?(f=0,p=M):(f=f==null?0:wt(f),p=p===t?M:wt(p)),si(s,f,p)):[]}o(EM,"slice");function AM(s,f){return Yl(s,f)}o(AM,"sortedIndex");function SM(s,f,p){return Np(s,f,Ye(p,2))}o(SM,"sortedIndexBy");function MM(s,f){var p=s==null?0:s.length;if(p){var M=Yl(s,f);if(M<p&&Ii(s[M],f))return M}return-1}o(MM,"sortedIndexOf");function TM(s,f){return Yl(s,f,!0)}o(TM,"sortedLastIndex");function CM(s,f,p){return Np(s,f,Ye(p,2),!0)}o(CM,"sortedLastIndexBy");function kM(s,f){var p=s==null?0:s.length;if(p){var M=Yl(s,f,!0)-1;if(Ii(s[M],f))return M}return-1}o(kM,"sortedLastIndexOf");function IM(s){return s&&s.length?cv(s):[]}o(IM,"sortedUniq");function DM(s,f){return s&&s.length?cv(s,Ye(f,2)):[]}o(DM,"sortedUniqBy");function OM(s){var f=s==null?0:s.length;return f?si(s,1,f):[]}o(OM,"tail");function RM(s,f,p){return s&&s.length?(f=p||f===t?1:wt(f),si(s,0,f<0?0:f)):[]}o(RM,"take");function NM(s,f,p){var M=s==null?0:s.length;return M?(f=p||f===t?1:wt(f),f=M-f,si(s,f<0?0:f,M)):[]}o(NM,"takeRight");function PM(s,f){return s&&s.length?Xl(s,Ye(f,3),!1,!0):[]}o(PM,"takeRightWhile");function LM(s,f){return s&&s.length?Xl(s,Ye(f,3)):[]}o(LM,"takeWhile");var BM=Mt(function(s){return ys(Pr(s,1,mr,!0))}),UM=Mt(function(s){var f=ai(s);return mr(f)&&(f=t),ys(Pr(s,1,mr,!0),Ye(f,2))}),$M=Mt(function(s){var f=ai(s);return f=typeof f=="function"?f:t,ys(Pr(s,1,mr,!0),t,f)});function FM(s){return s&&s.length?ys(s):[]}o(FM,"uniq");function qM(s,f){return s&&s.length?ys(s,Ye(f,2)):[]}o(qM,"uniqBy");function HM(s,f){return f=typeof f=="function"?f:t,s&&s.length?ys(s,t,f):[]}o(HM,"uniqWith");function Zp(s){if(!(s&&s.length))return[];var f=0;return s=ds(s,function(p){if(mr(p))return f=wr(p.length,f),!0}),mp(f,function(p){return sr(s,hp(p))})}o(Zp,"unzip");function Jv(s,f){if(!(s&&s.length))return[];var p=Zp(s);return f==null?p:sr(p,function(M){return kn(f,t,M)})}o(Jv,"unzipWith");var zM=Mt(function(s,f){return mr(s)?Wc(s,f):[]}),KM=Mt(function(s){return Lp(ds(s,mr))}),jM=Mt(function(s){var f=ai(s);return mr(f)&&(f=t),Lp(ds(s,mr),Ye(f,2))}),GM=Mt(function(s){var f=ai(s);return f=typeof f=="function"?f:t,Lp(ds(s,mr),t,f)}),VM=Mt(Zp);function WM(s,f){return dv(s||[],f||[],Vc)}o(WM,"zipObject");function JM(s,f){return dv(s||[],f||[],Xc)}o(JM,"zipObjectDeep");var YM=Mt(function(s){var f=s.length,p=f>1?s[f-1]:t;return p=typeof p=="function"?(s.pop(),p):t,Jv(s,p)});function Yv(s){var f=H(s);return f.__chain__=!0,f}o(Yv,"chain");function XM(s,f){return f(s),s}o(XM,"tap");function sh(s,f){return f(s)}o(sh,"thru");var ZM=Lo(function(s){var f=s.length,p=f?s[0]:0,M=this.__wrapped__,B=o(function(z){return Ep(z,s)},"interceptor");return f>1||this.__actions__.length||!(M instanceof Ot)||!Bo(p)?this.thru(B):(M=M.slice(p,+p+(f?1:0)),M.__actions__.push({func:sh,args:[B],thisArg:t}),new ii(M,this.__chain__).thru(function(z){return f&&!z.length&&z.push(t),z}))});function QM(){return Yv(this)}o(QM,"wrapperChain");function eT(){return new ii(this.value(),this.__chain__)}o(eT,"wrapperCommit");function tT(){this.__values__===t&&(this.__values__=uy(this.value()));var s=this.__index__>=this.__values__.length,f=s?t:this.__values__[this.__index__++];return{done:s,value:f}}o(tT,"wrapperNext");function rT(){return this}o(rT,"wrapperToIterator");function nT(s){for(var f,p=this;p instanceof jl;){var M=zv(p);M.__index__=0,M.__values__=t,f?B.__wrapped__=M:f=M;var B=M;p=p.__wrapped__}return B.__wrapped__=s,f}o(nT,"wrapperPlant");function iT(){var s=this.__wrapped__;if(s instanceof Ot){var f=s;return this.__actions__.length&&(f=new Ot(this)),f=f.reverse(),f.__actions__.push({func:sh,args:[Xp],thisArg:t}),new ii(f,this.__chain__)}return this.thru(Xp)}o(iT,"wrapperReverse");function oT(){return hv(this.__wrapped__,this.__actions__)}o(oT,"wrapperValue");var sT=Zl(function(s,f,p){Vt.call(s,p)?++s[p]:No(s,p,1)});function aT(s,f,p){var M=vt(s)?S2:XA;return p&&on(s,f,p)&&(f=t),M(s,Ye(f,3))}o(aT,"every");function fT(s,f){var p=vt(s)?ds:J2;return p(s,Ye(f,3))}o(fT,"filter");var cT=Ev(Kv),uT=Ev(jv);function lT(s,f){return Pr(ah(s,f),1)}o(lT,"flatMap");function hT(s,f){return Pr(ah(s,f),m)}o(hT,"flatMapDeep");function dT(s,f,p){return p=p===t?1:wt(p),Pr(ah(s,f),p)}o(dT,"flatMapDepth");function Xv(s,f){var p=vt(s)?ri:vs;return p(s,Ye(f,3))}o(Xv,"forEach");function Zv(s,f){var p=vt(s)?O7:W2;return p(s,Ye(f,3))}o(Zv,"forEachRight");var pT=Zl(function(s,f,p){Vt.call(s,p)?s[p].push(f):No(s,p,[f])});function mT(s,f,p,M){s=mn(s)?s:Df(s),p=p&&!M?wt(p):0;var B=s.length;return p<0&&(p=wr(B+p,0)),hh(s)?p<=B&&s.indexOf(f,p)>-1:!!B&&xf(s,f,p)>-1}o(mT,"includes");var bT=Mt(function(s,f,p){var M=-1,B=typeof f=="function",z=mn(s)?xe(s.length):[];return vs(s,function(te){z[++M]=B?kn(f,te,p):Jc(te,f,p)}),z}),gT=Zl(function(s,f,p){No(s,p,f)});function ah(s,f){var p=vt(s)?sr:tv;return p(s,Ye(f,3))}o(ah,"map");function vT(s,f,p,M){return s==null?[]:(vt(f)||(f=f==null?[]:[f]),p=M?t:p,vt(p)||(p=p==null?[]:[p]),ov(s,f,p))}o(vT,"orderBy");var yT=Zl(function(s,f,p){s[p?0:1].push(f)},function(){return[[],[]]});function xT(s,f,p){var M=vt(s)?up:k2,B=arguments.length<3;return M(s,Ye(f,4),p,B,vs)}o(xT,"reduce");function wT(s,f,p){var M=vt(s)?R7:k2,B=arguments.length<3;return M(s,Ye(f,4),p,B,W2)}o(wT,"reduceRight");function _T(s,f){var p=vt(s)?ds:J2;return p(s,uh(Ye(f,3)))}o(_T,"reject");function ET(s){var f=vt(s)?K2:mS;return f(s)}o(ET,"sample");function AT(s,f,p){(p?on(s,f,p):f===t)?f=1:f=wt(f);var M=vt(s)?GA:bS;return M(s,f)}o(AT,"sampleSize");function ST(s){var f=vt(s)?VA:vS;return f(s)}o(ST,"shuffle");function MT(s){if(s==null)return 0;if(mn(s))return hh(s)?_f(s):s.length;var f=jr(s);return f==ae||f==G?s.size:kp(s).length}o(MT,"size");function TT(s,f,p){var M=vt(s)?lp:yS;return p&&on(s,f,p)&&(f=t),M(s,Ye(f,3))}o(TT,"some");var CT=Mt(function(s,f){if(s==null)return[];var p=f.length;return p>1&&on(s,f[0],f[1])?f=[]:p>2&&on(f[0],f[1],f[2])&&(f=[f[0]]),ov(s,Pr(f,1),[])}),fh=fA||function(){return Er.Date.now()};function kT(s,f){if(typeof f!="function")throw new ni(i);return s=wt(s),function(){if(--s<1)return f.apply(this,arguments)}}o(kT,"after");function Qv(s,f,p){return f=p?t:f,f=s&&f==null?s.length:f,Po(s,oe,t,t,t,t,f)}o(Qv,"ary");function ey(s,f){var p;if(typeof f!="function")throw new ni(i);return s=wt(s),function(){return--s>0&&(p=f.apply(this,arguments)),s<=1&&(f=t),p}}o(ey,"before");var Qp=Mt(function(s,f,p){var M=I;if(p.length){var B=ms(p,kf(Qp));M|=Z}return Po(s,M,f,p,B)}),ty=Mt(function(s,f,p){var M=I|N;if(p.length){var B=ms(p,kf(ty));M|=Z}return Po(f,M,s,p,B)});function ry(s,f,p){f=p?t:f;var M=Po(s,L,t,t,t,t,t,f);return M.placeholder=ry.placeholder,M}o(ry,"curry");function ny(s,f,p){f=p?t:f;var M=Po(s,V,t,t,t,t,t,f);return M.placeholder=ny.placeholder,M}o(ny,"curryRight");function iy(s,f,p){var M,B,z,te,fe,be,Me=0,Te=!1,Ie=!1,Le=!0;if(typeof s!="function")throw new ni(i);f=fi(f)||0,ar(p)&&(Te=!!p.leading,Ie="maxWait"in p,z=Ie?wr(fi(p.maxWait)||0,f):z,Le="trailing"in p?!!p.trailing:Le);function ze(br){var Di=M,Fo=B;return M=B=t,Me=br,te=s.apply(Fo,Di),te}o(ze,"invokeFunc");function Ze(br){return Me=br,fe=eu(Ct,f),Te?ze(br):te}o(Ze,"leadingEdge");function Et(br){var Di=br-be,Fo=br-Me,Ey=f-Di;return Ie?Kr(Ey,z-Fo):Ey}o(Et,"remainingWait");function Qe(br){var Di=br-be,Fo=br-Me;return be===t||Di>=f||Di<0||Ie&&Fo>=z}o(Qe,"shouldInvoke");function Ct(){var br=fh();if(Qe(br))return Rt(br);fe=eu(Ct,Et(br))}o(Ct,"timerExpired");function Rt(br){return fe=t,Le&&M?ze(br):(M=B=t,te)}o(Rt,"trailingEdge");function Rn(){fe!==t&&pv(fe),Me=0,M=be=B=fe=t}o(Rn,"cancel");function sn(){return fe===t?te:Rt(fh())}o(sn,"flush");function Nn(){var br=fh(),Di=Qe(br);if(M=arguments,B=this,be=br,Di){if(fe===t)return Ze(be);if(Ie)return pv(fe),fe=eu(Ct,f),ze(be)}return fe===t&&(fe=eu(Ct,f)),te}return o(Nn,"debounced"),Nn.cancel=Rn,Nn.flush=sn,Nn}o(iy,"debounce");var IT=Mt(function(s,f){return V2(s,1,f)}),DT=Mt(function(s,f,p){return V2(s,fi(f)||0,p)});function OT(s){return Po(s,q)}o(OT,"flip");function ch(s,f){if(typeof s!="function"||f!=null&&typeof f!="function")throw new ni(i);var p=o(function(){var M=arguments,B=f?f.apply(this,M):M[0],z=p.cache;if(z.has(B))return z.get(B);var te=s.apply(this,M);return p.cache=z.set(B,te)||z,te},"memoized");return p.cache=new(ch.Cache||Ro),p}o(ch,"memoize"),ch.Cache=Ro;function uh(s){if(typeof s!="function")throw new ni(i);return function(){var f=arguments;switch(f.length){case 0:return!s.call(this);case 1:return!s.call(this,f[0]);case 2:return!s.call(this,f[0],f[1]);case 3:return!s.call(this,f[0],f[1],f[2])}return!s.apply(this,f)}}o(uh,"negate");function RT(s){return ey(2,s)}o(RT,"once");var NT=xS(function(s,f){f=f.length==1&&vt(f[0])?sr(f[0],In(Ye())):sr(Pr(f,1),In(Ye()));var p=f.length;return Mt(function(M){for(var B=-1,z=Kr(M.length,p);++B<z;)M[B]=f[B].call(this,M[B]);return kn(s,this,M)})}),em=Mt(function(s,f){var p=ms(f,kf(em));return Po(s,Z,t,f,p)}),oy=Mt(function(s,f){var p=ms(f,kf(oy));return Po(s,Y,t,f,p)}),PT=Lo(function(s,f){return Po(s,K,t,t,t,f)});function LT(s,f){if(typeof s!="function")throw new ni(i);return f=f===t?f:wt(f),Mt(s,f)}o(LT,"rest");function BT(s,f){if(typeof s!="function")throw new ni(i);return f=f==null?0:wr(wt(f),0),Mt(function(p){var M=p[f],B=ws(p,0,f);return M&&ps(B,M),kn(s,this,B)})}o(BT,"spread");function UT(s,f,p){var M=!0,B=!0;if(typeof s!="function")throw new ni(i);return ar(p)&&(M="leading"in p?!!p.leading:M,B="trailing"in p?!!p.trailing:B),iy(s,f,{leading:M,maxWait:f,trailing:B})}o(UT,"throttle");function $T(s){return Qv(s,1)}o($T,"unary");function FT(s,f){return em(Up(f),s)}o(FT,"wrap");function qT(){if(!arguments.length)return[];var s=arguments[0];return vt(s)?s:[s]}o(qT,"castArray");function HT(s){return oi(s,S)}o(HT,"clone");function zT(s,f){return f=typeof f=="function"?f:t,oi(s,S,f)}o(zT,"cloneWith");function KT(s){return oi(s,v|S)}o(KT,"cloneDeep");function jT(s,f){return f=typeof f=="function"?f:t,oi(s,v|S,f)}o(jT,"cloneDeepWith");function GT(s,f){return f==null||G2(s,f,Ar(f))}o(GT,"conformsTo");function Ii(s,f){return s===f||s!==s&&f!==f}o(Ii,"eq");var VT=rh(Mp),WT=rh(function(s,f){return s>=f}),ya=Z2(function(){return arguments}())?Z2:function(s){return fr(s)&&Vt.call(s,"callee")&&!U2.call(s,"callee")},vt=xe.isArray,JT=y2?In(y2):nS;function mn(s){return s!=null&&lh(s.length)&&!Uo(s)}o(mn,"isArrayLike");function mr(s){return fr(s)&&mn(s)}o(mr,"isArrayLikeObject");function YT(s){return s===!0||s===!1||fr(s)&&nn(s)==Q}o(YT,"isBoolean");var _s=uA||lm,XT=x2?In(x2):iS;function ZT(s){return fr(s)&&s.nodeType===1&&!tu(s)}o(ZT,"isElement");function QT(s){if(s==null)return!0;if(mn(s)&&(vt(s)||typeof s=="string"||typeof s.splice=="function"||_s(s)||If(s)||ya(s)))return!s.length;var f=jr(s);if(f==ae||f==G)return!s.size;if(Qc(s))return!kp(s).length;for(var p in s)if(Vt.call(s,p))return!1;return!0}o(QT,"isEmpty");function eC(s,f){return Yc(s,f)}o(eC,"isEqual");function tC(s,f,p){p=typeof p=="function"?p:t;var M=p?p(s,f):t;return M===t?Yc(s,f,t,p):!!M}o(tC,"isEqualWith");function tm(s){if(!fr(s))return!1;var f=nn(s);return f==$||f==F||typeof s.message=="string"&&typeof s.name=="string"&&!tu(s)}o(tm,"isError");function rC(s){return typeof s=="number"&&F2(s)}o(rC,"isFinite");function Uo(s){if(!ar(s))return!1;var f=nn(s);return f==ee||f==ne||f==D||f==ce}o(Uo,"isFunction");function sy(s){return typeof s=="number"&&s==wt(s)}o(sy,"isInteger");function lh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=_}o(lh,"isLength");function ar(s){var f=typeof s;return s!=null&&(f=="object"||f=="function")}o(ar,"isObject");function fr(s){return s!=null&&typeof s=="object"}o(fr,"isObjectLike");var ay=w2?In(w2):sS;function nC(s,f){return s===f||Cp(s,f,jp(f))}o(nC,"isMatch");function iC(s,f,p){return p=typeof p=="function"?p:t,Cp(s,f,jp(f),p)}o(iC,"isMatchWith");function oC(s){return fy(s)&&s!=+s}o(oC,"isNaN");function sC(s){if(zS(s))throw new bt(n);return Q2(s)}o(sC,"isNative");function aC(s){return s===null}o(aC,"isNull");function fC(s){return s==null}o(fC,"isNil");function fy(s){return typeof s=="number"||fr(s)&&nn(s)==Ae}o(fy,"isNumber");function tu(s){if(!fr(s)||nn(s)!=re)return!1;var f=Ul(s);if(f===null)return!0;var p=Vt.call(f,"constructor")&&f.constructor;return typeof p=="function"&&p instanceof p&&Nl.call(p)==iA}o(tu,"isPlainObject");var rm=_2?In(_2):aS;function cC(s){return sy(s)&&s>=-_&&s<=_}o(cC,"isSafeInteger");var cy=E2?In(E2):fS;function hh(s){return typeof s=="string"||!vt(s)&&fr(s)&&nn(s)==pe}o(hh,"isString");function On(s){return typeof s=="symbol"||fr(s)&&nn(s)==Ce}o(On,"isSymbol");var If=A2?In(A2):cS;function uC(s){return s===t}o(uC,"isUndefined");function lC(s){return fr(s)&&jr(s)==Ne}o(lC,"isWeakMap");function hC(s){return fr(s)&&nn(s)==Ve}o(hC,"isWeakSet");var dC=rh(Ip),pC=rh(function(s,f){return s<=f});function uy(s){if(!s)return[];if(mn(s))return hh(s)?Ci(s):pn(s);if(Hc&&s[Hc])return G7(s[Hc]());var f=jr(s),p=f==ae?gp:f==G?Dl:Df;return p(s)}o(uy,"toArray");function $o(s){if(!s)return s===0?s:0;if(s=fi(s),s===m||s===-m){var f=s<0?-1:1;return f*A}return s===s?s:0}o($o,"toFinite");function wt(s){var f=$o(s),p=f%1;return f===f?p?f-p:f:0}o(wt,"toInteger");function ly(s){return s?ma(wt(s),0,g):0}o(ly,"toLength");function fi(s){if(typeof s=="number")return s;if(On(s))return E;if(ar(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=ar(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=I2(s);var p=$t.test(s);return p||un.test(s)?k7(s.slice(2),p?2:8):Cn.test(s)?E:+s}o(fi,"toNumber");function hy(s){return ro(s,bn(s))}o(hy,"toPlainObject");function mC(s){return s?ma(wt(s),-_,_):s===0?s:0}o(mC,"toSafeInteger");function Kt(s){return s==null?"":Dn(s)}o(Kt,"toString");var bC=Tf(function(s,f){if(Qc(f)||mn(f)){ro(f,Ar(f),s);return}for(var p in f)Vt.call(f,p)&&Vc(s,p,f[p])}),dy=Tf(function(s,f){ro(f,bn(f),s)}),dh=Tf(function(s,f,p,M){ro(f,bn(f),s,M)}),gC=Tf(function(s,f,p,M){ro(f,Ar(f),s,M)}),vC=Lo(Ep);function yC(s,f){var p=Mf(s);return f==null?p:j2(p,f)}o(yC,"create");var xC=Mt(function(s,f){s=Zt(s);var p=-1,M=f.length,B=M>2?f[2]:t;for(B&&on(f[0],f[1],B)&&(M=1);++p<M;)for(var z=f[p],te=bn(z),fe=-1,be=te.length;++fe<be;){var Me=te[fe],Te=s[Me];(Te===t||Ii(Te,Ef[Me])&&!Vt.call(s,Me))&&(s[Me]=z[Me])}return s}),wC=Mt(function(s){return s.push(t,Iv),kn(py,t,s)});function _C(s,f){return M2(s,Ye(f,3),to)}o(_C,"findKey");function EC(s,f){return M2(s,Ye(f,3),Sp)}o(EC,"findLastKey");function AC(s,f){return s==null?s:Ap(s,Ye(f,3),bn)}o(AC,"forIn");function SC(s,f){return s==null?s:Y2(s,Ye(f,3),bn)}o(SC,"forInRight");function MC(s,f){return s&&to(s,Ye(f,3))}o(MC,"forOwn");function TC(s,f){return s&&Sp(s,Ye(f,3))}o(TC,"forOwnRight");function CC(s){return s==null?[]:Wl(s,Ar(s))}o(CC,"functions");function kC(s){return s==null?[]:Wl(s,bn(s))}o(kC,"functionsIn");function nm(s,f,p){var M=s==null?t:ba(s,f);return M===t?p:M}o(nm,"get");function IC(s,f){return s!=null&&Rv(s,f,QA)}o(IC,"has");function im(s,f){return s!=null&&Rv(s,f,eS)}o(im,"hasIn");var DC=Sv(function(s,f,p){f!=null&&typeof f.toString!="function"&&(f=Pl.call(f)),s[f]=p},sm(gn)),OC=Sv(function(s,f,p){f!=null&&typeof f.toString!="function"&&(f=Pl.call(f)),Vt.call(s,f)?s[f].push(p):s[f]=[p]},Ye),RC=Mt(Jc);function Ar(s){return mn(s)?z2(s):kp(s)}o(Ar,"keys");function bn(s){return mn(s)?z2(s,!0):uS(s)}o(bn,"keysIn");function NC(s,f){var p={};return f=Ye(f,3),to(s,function(M,B,z){No(p,f(M,B,z),M)}),p}o(NC,"mapKeys");function PC(s,f){var p={};return f=Ye(f,3),to(s,function(M,B,z){No(p,B,f(M,B,z))}),p}o(PC,"mapValues");var LC=Tf(function(s,f,p){Jl(s,f,p)}),py=Tf(function(s,f,p,M){Jl(s,f,p,M)}),BC=Lo(function(s,f){var p={};if(s==null)return p;var M=!1;f=sr(f,function(z){return z=xs(z,s),M||(M=z.length>1),z}),ro(s,zp(s),p),M&&(p=oi(p,v|y|S,DS));for(var B=f.length;B--;)Pp(p,f[B]);return p});function UC(s,f){return my(s,uh(Ye(f)))}o(UC,"omitBy");var $C=Lo(function(s,f){return s==null?{}:hS(s,f)});function my(s,f){if(s==null)return{};var p=sr(zp(s),function(M){return[M]});return f=Ye(f),sv(s,p,function(M,B){return f(M,B[0])})}o(my,"pickBy");function FC(s,f,p){f=xs(f,s);var M=-1,B=f.length;for(B||(B=1,s=t);++M<B;){var z=s==null?t:s[no(f[M])];z===t&&(M=B,z=p),s=Uo(z)?z.call(s):z}return s}o(FC,"result");function qC(s,f,p){return s==null?s:Xc(s,f,p)}o(qC,"set");function HC(s,f,p,M){return M=typeof M=="function"?M:t,s==null?s:Xc(s,f,p,M)}o(HC,"setWith");var by=Cv(Ar),gy=Cv(bn);function zC(s,f,p){var M=vt(s),B=M||_s(s)||If(s);if(f=Ye(f,4),p==null){var z=s&&s.constructor;B?p=M?new z:[]:ar(s)?p=Uo(z)?Mf(Ul(s)):{}:p={}}return(B?ri:to)(s,function(te,fe,be){return f(p,te,fe,be)}),p}o(zC,"transform");function KC(s,f){return s==null?!0:Pp(s,f)}o(KC,"unset");function jC(s,f,p){return s==null?s:lv(s,f,Up(p))}o(jC,"update");function GC(s,f,p,M){return M=typeof M=="function"?M:t,s==null?s:lv(s,f,Up(p),M)}o(GC,"updateWith");function Df(s){return s==null?[]:bp(s,Ar(s))}o(Df,"values");function VC(s){return s==null?[]:bp(s,bn(s))}o(VC,"valuesIn");function WC(s,f,p){return p===t&&(p=f,f=t),p!==t&&(p=fi(p),p=p===p?p:0),f!==t&&(f=fi(f),f=f===f?f:0),ma(fi(s),f,p)}o(WC,"clamp");function JC(s,f,p){return f=$o(f),p===t?(p=f,f=0):p=$o(p),s=fi(s),tS(s,f,p)}o(JC,"inRange");function YC(s,f,p){if(p&&typeof p!="boolean"&&on(s,f,p)&&(f=p=t),p===t&&(typeof f=="boolean"?(p=f,f=t):typeof s=="boolean"&&(p=s,s=t)),s===t&&f===t?(s=0,f=1):(s=$o(s),f===t?(f=s,s=0):f=$o(f)),s>f){var M=s;s=f,f=M}if(p||s%1||f%1){var B=q2();return Kr(s+B*(f-s+C7("1e-"+((B+"").length-1))),f)}return Op(s,f)}o(YC,"random");var XC=Cf(function(s,f,p){return f=f.toLowerCase(),s+(p?vy(f):f)});function vy(s){return om(Kt(s).toLowerCase())}o(vy,"capitalize");function yy(s){return s=Kt(s),s&&s.replace(hn,q7).replace(v7,"")}o(yy,"deburr");function ZC(s,f,p){s=Kt(s),f=Dn(f);var M=s.length;p=p===t?M:ma(wt(p),0,M);var B=p;return p-=f.length,p>=0&&s.slice(p,B)==f}o(ZC,"endsWith");function QC(s){return s=Kt(s),s&&it.test(s)?s.replace(Tn,H7):s}o(QC,"escape");function ek(s){return s=Kt(s),s&&ft.test(s)?s.replace(cn,"\\$&"):s}o(ek,"escapeRegExp");var tk=Cf(function(s,f,p){return s+(p?"-":"")+f.toLowerCase()}),rk=Cf(function(s,f,p){return s+(p?" ":"")+f.toLowerCase()}),nk=_v("toLowerCase");function ik(s,f,p){s=Kt(s),f=wt(f);var M=f?_f(s):0;if(!f||M>=f)return s;var B=(f-M)/2;return th(Hl(B),p)+s+th(ql(B),p)}o(ik,"pad");function ok(s,f,p){s=Kt(s),f=wt(f);var M=f?_f(s):0;return f&&M<f?s+th(f-M,p):s}o(ok,"padEnd");function sk(s,f,p){s=Kt(s),f=wt(f);var M=f?_f(s):0;return f&&M<f?th(f-M,p)+s:s}o(sk,"padStart");function ak(s,f,p){return p||f==null?f=0:f&&(f=+f),pA(Kt(s).replace(Xe,""),f||0)}o(ak,"parseInt");function fk(s,f,p){return(p?on(s,f,p):f===t)?f=1:f=wt(f),Rp(Kt(s),f)}o(fk,"repeat");function ck(){var s=arguments,f=Kt(s[0]);return s.length<3?f:f.replace(s[1],s[2])}o(ck,"replace");var uk=Cf(function(s,f,p){return s+(p?"_":"")+f.toLowerCase()});function lk(s,f,p){return p&&typeof p!="number"&&on(s,f,p)&&(f=p=t),p=p===t?g:p>>>0,p?(s=Kt(s),s&&(typeof f=="string"||f!=null&&!rm(f))&&(f=Dn(f),!f&&wf(s))?ws(Ci(s),0,p):s.split(f,p)):[]}o(lk,"split");var hk=Cf(function(s,f,p){return s+(p?" ":"")+om(f)});function dk(s,f,p){return s=Kt(s),p=p==null?0:ma(wt(p),0,s.length),f=Dn(f),s.slice(p,p+f.length)==f}o(dk,"startsWith");function pk(s,f,p){var M=H.templateSettings;p&&on(s,f,p)&&(f=t),s=Kt(s),f=dh({},f,M,kv);var B=dh({},f.imports,M.imports,kv),z=Ar(B),te=bp(B,z),fe,be,Me=0,Te=f.interpolate||Nr,Ie="__p += '",Le=vp((f.escape||Nr).source+"|"+Te.source+"|"+(Te===et?dt:Nr).source+"|"+(f.evaluate||Nr).source+"|$","g"),ze="//# sourceURL="+(Vt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++E7+"]")+`
4
+ `;s.replace(Le,function(Qe,Ct,Rt,Rn,sn,Nn){return Rt||(Rt=Rn),Ie+=s.slice(Me,Nn).replace(dn,z7),Ct&&(fe=!0,Ie+=`' +
5
+ __e(`+Ct+`) +
6
+ '`),sn&&(be=!0,Ie+=`';
7
+ `+sn+`;
8
+ __p += '`),Rt&&(Ie+=`' +
9
+ ((__t = (`+Rt+`)) == null ? '' : __t) +
10
+ '`),Me=Nn+Qe.length,Qe}),Ie+=`';
11
+ `;var Ze=Vt.call(f,"variable")&&f.variable;if(!Ze)Ie=`with (obj) {
12
+ `+Ie+`
13
+ }
14
+ `;else if(ht.test(Ze))throw new bt(a);Ie=(be?Ie.replace(Oe,""):Ie).replace(Lt,"$1").replace(je,"$1;"),Ie="function("+(Ze||"obj")+`) {
15
+ `+(Ze?"":`obj || (obj = {});
16
+ `)+"var __t, __p = ''"+(fe?", __e = _.escape":"")+(be?`, __j = Array.prototype.join;
17
+ function print() { __p += __j.call(arguments, '') }
18
+ `:`;
19
+ `)+Ie+`return __p
20
+ }`;var Et=wy(function(){return qt(z,ze+"return "+Ie).apply(t,te)});if(Et.source=Ie,tm(Et))throw Et;return Et}o(pk,"template");function mk(s){return Kt(s).toLowerCase()}o(mk,"toLower");function bk(s){return Kt(s).toUpperCase()}o(bk,"toUpper");function gk(s,f,p){if(s=Kt(s),s&&(p||f===t))return I2(s);if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=Ci(f),z=D2(M,B),te=O2(M,B)+1;return ws(M,z,te).join("")}o(gk,"trim");function vk(s,f,p){if(s=Kt(s),s&&(p||f===t))return s.slice(0,N2(s)+1);if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=O2(M,Ci(f))+1;return ws(M,0,B).join("")}o(vk,"trimEnd");function yk(s,f,p){if(s=Kt(s),s&&(p||f===t))return s.replace(Xe,"");if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=D2(M,Ci(f));return ws(M,B).join("")}o(yk,"trimStart");function xk(s,f){var p=j,M=le;if(ar(f)){var B="separator"in f?f.separator:B;p="length"in f?wt(f.length):p,M="omission"in f?Dn(f.omission):M}s=Kt(s);var z=s.length;if(wf(s)){var te=Ci(s);z=te.length}if(p>=z)return s;var fe=p-_f(M);if(fe<1)return M;var be=te?ws(te,0,fe).join(""):s.slice(0,fe);if(B===t)return be+M;if(te&&(fe+=be.length-fe),rm(B)){if(s.slice(fe).search(B)){var Me,Te=be;for(B.global||(B=vp(B.source,Kt(tt.exec(B))+"g")),B.lastIndex=0;Me=B.exec(Te);)var Ie=Me.index;be=be.slice(0,Ie===t?fe:Ie)}}else if(s.indexOf(Dn(B),fe)!=fe){var Le=be.lastIndexOf(B);Le>-1&&(be=be.slice(0,Le))}return be+M}o(xk,"truncate");function wk(s){return s=Kt(s),s&&nt.test(s)?s.replace(Je,Y7):s}o(wk,"unescape");var _k=Cf(function(s,f,p){return s+(p?" ":"")+f.toUpperCase()}),om=_v("toUpperCase");function xy(s,f,p){return s=Kt(s),f=p?t:f,f===t?j7(s)?Q7(s):L7(s):s.match(f)||[]}o(xy,"words");var wy=Mt(function(s,f){try{return kn(s,t,f)}catch(p){return tm(p)?p:new bt(p)}}),Ek=Lo(function(s,f){return ri(f,function(p){p=no(p),No(s,p,Qp(s[p],s))}),s});function Ak(s){var f=s==null?0:s.length,p=Ye();return s=f?sr(s,function(M){if(typeof M[1]!="function")throw new ni(i);return[p(M[0]),M[1]]}):[],Mt(function(M){for(var B=-1;++B<f;){var z=s[B];if(kn(z[0],this,M))return kn(z[1],this,M)}})}o(Ak,"cond");function Sk(s){return YA(oi(s,v))}o(Sk,"conforms");function sm(s){return function(){return s}}o(sm,"constant");function Mk(s,f){return s==null||s!==s?f:s}o(Mk,"defaultTo");var Tk=Av(),Ck=Av(!0);function gn(s){return s}o(gn,"identity");function am(s){return ev(typeof s=="function"?s:oi(s,v))}o(am,"iteratee");function kk(s){return rv(oi(s,v))}o(kk,"matches");function Ik(s,f){return nv(s,oi(f,v))}o(Ik,"matchesProperty");var Dk=Mt(function(s,f){return function(p){return Jc(p,s,f)}}),Ok=Mt(function(s,f){return function(p){return Jc(s,p,f)}});function fm(s,f,p){var M=Ar(f),B=Wl(f,M);p==null&&!(ar(f)&&(B.length||!M.length))&&(p=f,f=s,s=this,B=Wl(f,Ar(f)));var z=!(ar(p)&&"chain"in p)||!!p.chain,te=Uo(s);return ri(B,function(fe){var be=f[fe];s[fe]=be,te&&(s.prototype[fe]=function(){var Me=this.__chain__;if(z||Me){var Te=s(this.__wrapped__),Ie=Te.__actions__=pn(this.__actions__);return Ie.push({func:be,args:arguments,thisArg:s}),Te.__chain__=Me,Te}return be.apply(s,ps([this.value()],arguments))})}),s}o(fm,"mixin");function Rk(){return Er._===this&&(Er._=oA),this}o(Rk,"noConflict");function cm(){}o(cm,"noop");function Nk(s){return s=wt(s),Mt(function(f){return iv(f,s)})}o(Nk,"nthArg");var Pk=Fp(sr),Lk=Fp(S2),Bk=Fp(lp);function _y(s){return Vp(s)?hp(no(s)):dS(s)}o(_y,"property");function Uk(s){return function(f){return s==null?t:ba(s,f)}}o(Uk,"propertyOf");var $k=Mv(),Fk=Mv(!0);function um(){return[]}o(um,"stubArray");function lm(){return!1}o(lm,"stubFalse");function qk(){return{}}o(qk,"stubObject");function Hk(){return""}o(Hk,"stubString");function zk(){return!0}o(zk,"stubTrue");function Kk(s,f){if(s=wt(s),s<1||s>_)return[];var p=g,M=Kr(s,g);f=Ye(f),s-=g;for(var B=mp(M,f);++p<s;)f(p);return B}o(Kk,"times");function jk(s){return vt(s)?sr(s,no):On(s)?[s]:pn(Hv(Kt(s)))}o(jk,"toPath");function Gk(s){var f=++nA;return Kt(s)+f}o(Gk,"uniqueId");var Vk=eh(function(s,f){return s+f},0),Wk=qp("ceil"),Jk=eh(function(s,f){return s/f},1),Yk=qp("floor");function Xk(s){return s&&s.length?Vl(s,gn,Mp):t}o(Xk,"max");function Zk(s,f){return s&&s.length?Vl(s,Ye(f,2),Mp):t}o(Zk,"maxBy");function Qk(s){return C2(s,gn)}o(Qk,"mean");function eI(s,f){return C2(s,Ye(f,2))}o(eI,"meanBy");function tI(s){return s&&s.length?Vl(s,gn,Ip):t}o(tI,"min");function rI(s,f){return s&&s.length?Vl(s,Ye(f,2),Ip):t}o(rI,"minBy");var nI=eh(function(s,f){return s*f},1),iI=qp("round"),oI=eh(function(s,f){return s-f},0);function sI(s){return s&&s.length?pp(s,gn):0}o(sI,"sum");function aI(s,f){return s&&s.length?pp(s,Ye(f,2)):0}return o(aI,"sumBy"),H.after=kT,H.ary=Qv,H.assign=bC,H.assignIn=dy,H.assignInWith=dh,H.assignWith=gC,H.at=vC,H.before=ey,H.bind=Qp,H.bindAll=Ek,H.bindKey=ty,H.castArray=qT,H.chain=Yv,H.chunk=YS,H.compact=XS,H.concat=ZS,H.cond=Ak,H.conforms=Sk,H.constant=sm,H.countBy=sT,H.create=yC,H.curry=ry,H.curryRight=ny,H.debounce=iy,H.defaults=xC,H.defaultsDeep=wC,H.defer=IT,H.delay=DT,H.difference=QS,H.differenceBy=eM,H.differenceWith=tM,H.drop=rM,H.dropRight=nM,H.dropRightWhile=iM,H.dropWhile=oM,H.fill=sM,H.filter=fT,H.flatMap=lT,H.flatMapDeep=hT,H.flatMapDepth=dT,H.flatten=Gv,H.flattenDeep=aM,H.flattenDepth=fM,H.flip=OT,H.flow=Tk,H.flowRight=Ck,H.fromPairs=cM,H.functions=CC,H.functionsIn=kC,H.groupBy=pT,H.initial=lM,H.intersection=hM,H.intersectionBy=dM,H.intersectionWith=pM,H.invert=DC,H.invertBy=OC,H.invokeMap=bT,H.iteratee=am,H.keyBy=gT,H.keys=Ar,H.keysIn=bn,H.map=ah,H.mapKeys=NC,H.mapValues=PC,H.matches=kk,H.matchesProperty=Ik,H.memoize=ch,H.merge=LC,H.mergeWith=py,H.method=Dk,H.methodOf=Ok,H.mixin=fm,H.negate=uh,H.nthArg=Nk,H.omit=BC,H.omitBy=UC,H.once=RT,H.orderBy=vT,H.over=Pk,H.overArgs=NT,H.overEvery=Lk,H.overSome=Bk,H.partial=em,H.partialRight=oy,H.partition=yT,H.pick=$C,H.pickBy=my,H.property=_y,H.propertyOf=Uk,H.pull=vM,H.pullAll=Wv,H.pullAllBy=yM,H.pullAllWith=xM,H.pullAt=wM,H.range=$k,H.rangeRight=Fk,H.rearg=PT,H.reject=_T,H.remove=_M,H.rest=LT,H.reverse=Xp,H.sampleSize=AT,H.set=qC,H.setWith=HC,H.shuffle=ST,H.slice=EM,H.sortBy=CT,H.sortedUniq=IM,H.sortedUniqBy=DM,H.split=lk,H.spread=BT,H.tail=OM,H.take=RM,H.takeRight=NM,H.takeRightWhile=PM,H.takeWhile=LM,H.tap=XM,H.throttle=UT,H.thru=sh,H.toArray=uy,H.toPairs=by,H.toPairsIn=gy,H.toPath=jk,H.toPlainObject=hy,H.transform=zC,H.unary=$T,H.union=BM,H.unionBy=UM,H.unionWith=$M,H.uniq=FM,H.uniqBy=qM,H.uniqWith=HM,H.unset=KC,H.unzip=Zp,H.unzipWith=Jv,H.update=jC,H.updateWith=GC,H.values=Df,H.valuesIn=VC,H.without=zM,H.words=xy,H.wrap=FT,H.xor=KM,H.xorBy=jM,H.xorWith=GM,H.zip=VM,H.zipObject=WM,H.zipObjectDeep=JM,H.zipWith=YM,H.entries=by,H.entriesIn=gy,H.extend=dy,H.extendWith=dh,fm(H,H),H.add=Vk,H.attempt=wy,H.camelCase=XC,H.capitalize=vy,H.ceil=Wk,H.clamp=WC,H.clone=HT,H.cloneDeep=KT,H.cloneDeepWith=jT,H.cloneWith=zT,H.conformsTo=GT,H.deburr=yy,H.defaultTo=Mk,H.divide=Jk,H.endsWith=ZC,H.eq=Ii,H.escape=QC,H.escapeRegExp=ek,H.every=aT,H.find=cT,H.findIndex=Kv,H.findKey=_C,H.findLast=uT,H.findLastIndex=jv,H.findLastKey=EC,H.floor=Yk,H.forEach=Xv,H.forEachRight=Zv,H.forIn=AC,H.forInRight=SC,H.forOwn=MC,H.forOwnRight=TC,H.get=nm,H.gt=VT,H.gte=WT,H.has=IC,H.hasIn=im,H.head=Vv,H.identity=gn,H.includes=mT,H.indexOf=uM,H.inRange=JC,H.invoke=RC,H.isArguments=ya,H.isArray=vt,H.isArrayBuffer=JT,H.isArrayLike=mn,H.isArrayLikeObject=mr,H.isBoolean=YT,H.isBuffer=_s,H.isDate=XT,H.isElement=ZT,H.isEmpty=QT,H.isEqual=eC,H.isEqualWith=tC,H.isError=tm,H.isFinite=rC,H.isFunction=Uo,H.isInteger=sy,H.isLength=lh,H.isMap=ay,H.isMatch=nC,H.isMatchWith=iC,H.isNaN=oC,H.isNative=sC,H.isNil=fC,H.isNull=aC,H.isNumber=fy,H.isObject=ar,H.isObjectLike=fr,H.isPlainObject=tu,H.isRegExp=rm,H.isSafeInteger=cC,H.isSet=cy,H.isString=hh,H.isSymbol=On,H.isTypedArray=If,H.isUndefined=uC,H.isWeakMap=lC,H.isWeakSet=hC,H.join=mM,H.kebabCase=tk,H.last=ai,H.lastIndexOf=bM,H.lowerCase=rk,H.lowerFirst=nk,H.lt=dC,H.lte=pC,H.max=Xk,H.maxBy=Zk,H.mean=Qk,H.meanBy=eI,H.min=tI,H.minBy=rI,H.stubArray=um,H.stubFalse=lm,H.stubObject=qk,H.stubString=Hk,H.stubTrue=zk,H.multiply=nI,H.nth=gM,H.noConflict=Rk,H.noop=cm,H.now=fh,H.pad=ik,H.padEnd=ok,H.padStart=sk,H.parseInt=ak,H.random=YC,H.reduce=xT,H.reduceRight=wT,H.repeat=fk,H.replace=ck,H.result=FC,H.round=iI,H.runInContext=de,H.sample=ET,H.size=MT,H.snakeCase=uk,H.some=TT,H.sortedIndex=AM,H.sortedIndexBy=SM,H.sortedIndexOf=MM,H.sortedLastIndex=TM,H.sortedLastIndexBy=CM,H.sortedLastIndexOf=kM,H.startCase=hk,H.startsWith=dk,H.subtract=oI,H.sum=sI,H.sumBy=aI,H.template=pk,H.times=Kk,H.toFinite=$o,H.toInteger=wt,H.toLength=ly,H.toLower=mk,H.toNumber=fi,H.toSafeInteger=mC,H.toString=Kt,H.toUpper=bk,H.trim=gk,H.trimEnd=vk,H.trimStart=yk,H.truncate=xk,H.unescape=wk,H.uniqueId=Gk,H.upperCase=_k,H.upperFirst=om,H.each=Xv,H.eachRight=Zv,H.first=Vv,fm(H,function(){var s={};return to(H,function(f,p){Vt.call(H.prototype,p)||(s[p]=f)}),s}(),{chain:!1}),H.VERSION=e,ri(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){H[s].placeholder=H}),ri(["drop","take"],function(s,f){Ot.prototype[s]=function(p){p=p===t?1:wr(wt(p),0);var M=this.__filtered__&&!f?new Ot(this):this.clone();return M.__filtered__?M.__takeCount__=Kr(p,M.__takeCount__):M.__views__.push({size:Kr(p,g),type:s+(M.__dir__<0?"Right":"")}),M},Ot.prototype[s+"Right"]=function(p){return this.reverse()[s](p).reverse()}}),ri(["filter","map","takeWhile"],function(s,f){var p=f+1,M=p==x||p==l;Ot.prototype[s]=function(B){var z=this.clone();return z.__iteratees__.push({iteratee:Ye(B,3),type:p}),z.__filtered__=z.__filtered__||M,z}}),ri(["head","last"],function(s,f){var p="take"+(f?"Right":"");Ot.prototype[s]=function(){return this[p](1).value()[0]}}),ri(["initial","tail"],function(s,f){var p="drop"+(f?"":"Right");Ot.prototype[s]=function(){return this.__filtered__?new Ot(this):this[p](1)}}),Ot.prototype.compact=function(){return this.filter(gn)},Ot.prototype.find=function(s){return this.filter(s).head()},Ot.prototype.findLast=function(s){return this.reverse().find(s)},Ot.prototype.invokeMap=Mt(function(s,f){return typeof s=="function"?new Ot(this):this.map(function(p){return Jc(p,s,f)})}),Ot.prototype.reject=function(s){return this.filter(uh(Ye(s)))},Ot.prototype.slice=function(s,f){s=wt(s);var p=this;return p.__filtered__&&(s>0||f<0)?new Ot(p):(s<0?p=p.takeRight(-s):s&&(p=p.drop(s)),f!==t&&(f=wt(f),p=f<0?p.dropRight(-f):p.take(f-s)),p)},Ot.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Ot.prototype.toArray=function(){return this.take(g)},to(Ot.prototype,function(s,f){var p=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),B=H[M?"take"+(f=="last"?"Right":""):f],z=M||/^find/.test(f);!B||(H.prototype[f]=function(){var te=this.__wrapped__,fe=M?[1]:arguments,be=te instanceof Ot,Me=fe[0],Te=be||vt(te),Ie=o(function(Ct){var Rt=B.apply(H,ps([Ct],fe));return M&&Le?Rt[0]:Rt},"interceptor");Te&&p&&typeof Me=="function"&&Me.length!=1&&(be=Te=!1);var Le=this.__chain__,ze=!!this.__actions__.length,Ze=z&&!Le,Et=be&&!ze;if(!z&&Te){te=Et?te:new Ot(this);var Qe=s.apply(te,fe);return Qe.__actions__.push({func:sh,args:[Ie],thisArg:t}),new ii(Qe,Le)}return Ze&&Et?s.apply(this,fe):(Qe=this.thru(Ie),Ze?M?Qe.value()[0]:Qe.value():Qe)})}),ri(["pop","push","shift","sort","splice","unshift"],function(s){var f=Ol[s],p=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",M=/^(?:pop|shift)$/.test(s);H.prototype[s]=function(){var B=arguments;if(M&&!this.__chain__){var z=this.value();return f.apply(vt(z)?z:[],B)}return this[p](function(te){return f.apply(vt(te)?te:[],B)})}}),to(Ot.prototype,function(s,f){var p=H[f];if(p){var M=p.name+"";Vt.call(Sf,M)||(Sf[M]=[]),Sf[M].push({name:f,func:p})}}),Sf[Ql(t,N).name]=[{name:"wrapper",func:t}],Ot.prototype.clone=wA,Ot.prototype.reverse=_A,Ot.prototype.value=EA,H.prototype.at=ZM,H.prototype.chain=QM,H.prototype.commit=eT,H.prototype.next=tT,H.prototype.plant=nT,H.prototype.reverse=iT,H.prototype.toJSON=H.prototype.valueOf=H.prototype.value=oT,H.prototype.first=H.prototype.head,Hc&&(H.prototype[Hc]=rT),H},"runInContext"),bs=eA();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Er._=bs,define(function(){return bs})):la?((la.exports=bs)._=bs,ap._=bs):Er._=bs}).call(Of)});function xa(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var ou=jt(()=>{o(xa,"asUint8Array")});function su(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?xa(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var bh=jt(()=>{ou();o(su,"allocUnsafe")});var Cy={};Jt(Cy,{concat:()=>Oi});function Oi(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));let r=su(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return xa(r)}var dm=jt(()=>{bh();ou();o(Oi,"concat")});function MI(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),c=a.charCodeAt(0);if(r[c]!==255)throw new TypeError(a+" is ambiguous");r[c]=i}var u=t.length,d=t.charAt(0),v=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function S(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var N=0,J=0,L=0,V=I.length;L!==V&&I[L]===0;)L++,N++;for(var Z=(V-L)*y+1>>>0,Y=new Uint8Array(Z);L!==V;){for(var oe=I[L],K=0,q=Z-1;(oe!==0||K<J)&&q!==-1;q--,K++)oe+=256*Y[q]>>>0,Y[q]=oe%u>>>0,oe=oe/u>>>0;if(oe!==0)throw new Error("Non-zero carry");J=K,L++}for(var j=Z-J;j!==Z&&Y[j]===0;)j++;for(var le=d.repeat(N);j<Z;++j)le+=t.charAt(Y[j]);return le}o(S,"encode");function O(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var N=0;if(I[N]!==" "){for(var J=0,L=0;I[N]===d;)J++,N++;for(var V=(I.length-N)*v+1>>>0,Z=new Uint8Array(V);I[N];){var Y=r[I.charCodeAt(N)];if(Y===255)return;for(var oe=0,K=V-1;(Y!==0||oe<L)&&K!==-1;K--,oe++)Y+=u*Z[K]>>>0,Z[K]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");L=oe,N++}if(I[N]!==" "){for(var q=V-L;q!==V&&Z[q]===0;)q++;for(var j=new Uint8Array(J+(V-q)),le=J;q!==V;)j[le++]=Z[q++];return j}}}o(O,"decodeUnsafe");function R(I){var N=O(I);if(N)return N;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:S,decodeUnsafe:O,decode:R}}var TI,CI,ky,Iy=jt(()=>{o(MI,"base");TI=MI,CI=TI,ky=CI});var _z,Dy,qo,Oy,Ry,Es=jt(()=>{_z=new Uint8Array(0),Dy=o((t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},"equals"),qo=o(t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),Oy=o(t=>new TextEncoder().encode(t),"fromString"),Ry=o(t=>new TextDecoder().decode(t),"toString")});var gh,vh,yh,Ny,xh,Rf,As,kI,II,cr,Ri=jt(()=>{Iy();Es();gh=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(gh,"Encoder");vh=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.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 Ny(this,e)}};o(vh,"Decoder");yh=class{constructor(e){this.decoders=e}or(e){return Ny(this,e)}decode(e){let r=e[0],n=this.decoders[r];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(yh,"ComposedDecoder");Ny=o((t,e)=>new yh({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),"or"),xh=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new gh(e,r,n),this.decoder=new vh(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(xh,"Codec");Rf=o(({name:t,prefix:e,encode:r,decode:n})=>new xh(t,e,r,n),"from"),As=o(({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=ky(r,e);return Rf({prefix:t,name:e,encode:n,decode:a=>qo(i(a))})},"baseX"),kI=o((t,e,r,n)=>{let i={};for(let y=0;y<e.length;++y)i[e[y]]=y;let a=t.length;for(;t[a-1]==="=";)--a;let c=new Uint8Array(a*r/8|0),u=0,d=0,v=0;for(let y=0;y<a;++y){let S=i[t[y]];if(S===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<r|S,u+=r,u>=8&&(u-=8,c[v++]=255&d>>u)}if(u>=r||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return c},"decode"),II=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let d=0;d<t.length;++d)for(u=u<<8|t[d],c+=8;c>r;)c-=r,a+=e[i&u>>c];if(c&&(a+=e[i&u<<r-c]),n)for(;a.length*r&7;)a+="=";return a},"encode"),cr=o(({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Rf({prefix:e,name:t,encode(i){return II(i,n,r)},decode(i){return kI(i,n,r,t)}}),"rfc4648")});var mm={};Jt(mm,{identity:()=>DI});var DI,Py=jt(()=>{Ri();Es();DI=Rf({prefix:"\0",name:"identity",encode:t=>Ry(t),decode:t=>Oy(t)})});var bm={};Jt(bm,{base2:()=>OI});var OI,Ly=jt(()=>{Ri();OI=cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var gm={};Jt(gm,{base8:()=>RI});var RI,By=jt(()=>{Ri();RI=cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var vm={};Jt(vm,{base10:()=>NI});var NI,Uy=jt(()=>{Ri();NI=As({prefix:"9",name:"base10",alphabet:"0123456789"})});var ym={};Jt(ym,{base16:()=>PI,base16upper:()=>LI});var PI,LI,$y=jt(()=>{Ri();PI=cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LI=cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var xm={};Jt(xm,{base32:()=>Nf,base32hex:()=>FI,base32hexpad:()=>HI,base32hexpadupper:()=>zI,base32hexupper:()=>qI,base32pad:()=>UI,base32padupper:()=>$I,base32upper:()=>BI,base32z:()=>KI});var Nf,BI,UI,$I,FI,qI,HI,zI,KI,wm=jt(()=>{Ri();Nf=cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),BI=cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),UI=cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$I=cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),FI=cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qI=cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),HI=cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),zI=cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),KI=cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var _m={};Jt(_m,{base36:()=>Ni,base36upper:()=>jI});var Ni,jI,Pf=jt(()=>{Ri();Ni=As({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),jI=As({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Em={};Jt(Em,{base58btc:()=>ci,base58flickr:()=>GI});var ci,GI,wh=jt(()=>{Ri();ci=As({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),GI=As({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Am={};Jt(Am,{base64:()=>VI,base64pad:()=>WI,base64url:()=>wa,base64urlpad:()=>JI});var VI,WI,wa,JI,_h=jt(()=>{Ri();VI=cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),WI=cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),wa=cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),JI=cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Sm={};Jt(Sm,{base256emoji:()=>eD});function ZI(t){return t.reduce((e,r)=>(e+=YI[r],e),"")}function QI(t){let e=[];for(let r of t){let n=XI[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Fy,YI,XI,eD,qy=jt(()=>{Ri();Fy=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}"),YI=Fy.reduce((t,e,r)=>(t[r]=e,t),[]),XI=Fy.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);o(ZI,"encode");o(QI,"decode");eD=Rf({prefix:"\u{1F680}",name:"base256emoji",encode:ZI,decode:QI})});function Ky(t,e,r){e=e||[],r=r||0;for(var n=r;t>=iD;)e[r++]=t&255|Hy,t/=128;for(;t&nD;)e[r++]=t&255|Hy,t>>>=7;return e[r]=t|0,Ky.bytes=r-n+1,e}function Mm(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Mm.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&zy)<<i:(c&zy)*Math.pow(2,i),i+=7}while(c>=sD);return Mm.bytes=a-n,r}var tD,Hy,rD,nD,iD,oD,sD,zy,aD,fD,cD,uD,lD,hD,dD,pD,mD,bD,gD,vD,au,jy=jt(()=>{tD=Ky,Hy=128,rD=127,nD=~rD,iD=Math.pow(2,31);o(Ky,"encode");oD=Mm,sD=128,zy=127;o(Mm,"read");aD=Math.pow(2,7),fD=Math.pow(2,14),cD=Math.pow(2,21),uD=Math.pow(2,28),lD=Math.pow(2,35),hD=Math.pow(2,42),dD=Math.pow(2,49),pD=Math.pow(2,56),mD=Math.pow(2,63),bD=o(function(t){return t<aD?1:t<fD?2:t<cD?3:t<uD?4:t<lD?5:t<hD?6:t<dD?7:t<pD?8:t<mD?9:10},"length"),gD={encode:tD,decode:oD,encodingLength:bD},vD=gD,au=vD});var fu,Lf,Bf,Ah=jt(()=>{jy();fu=o((t,e=0)=>[au.decode(t,e),au.decode.bytes],"decode"),Lf=o((t,e,r=0)=>(au.encode(t,e,r),e),"encodeTo"),Bf=o(t=>au.encodingLength(t),"encodingLength")});var Ho,Sh,Gy,_a,Ea=jt(()=>{Es();Ah();Ho=o((t,e)=>{let r=e.byteLength,n=Bf(t),i=n+Bf(r),a=new Uint8Array(i+r);return Lf(t,a,0),Lf(r,a,n),a.set(e,i),new _a(t,r,e,a)},"create"),Sh=o(t=>{let e=qo(t),[r,n]=fu(e),[i,a]=fu(e.subarray(n)),c=e.subarray(n+a);if(c.byteLength!==i)throw new Error("Incorrect length");return new _a(r,i,c,e)},"decode"),Gy=o((t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&Dy(t.bytes,e.bytes),"equals"),_a=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};o(_a,"Digest")});var Tm,Mh,Cm=jt(()=>{Ea();Tm=o(({name:t,code:e,encode:r})=>new Mh(t,e,r),"from"),Mh=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Ho(this.code,r):r.then(n=>Ho(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(Mh,"Hasher")});var km={};Jt(km,{sha256:()=>Ss,sha512:()=>yD});var Wy,Ss,yD,uu=jt(()=>{Cm();Wy=o(t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),"sha"),Ss=Tm({name:"sha2-256",code:18,encode:Wy("SHA-256")}),yD=Tm({name:"sha2-512",code:19,encode:Wy("SHA-512")})});var Im={};Jt(Im,{identity:()=>Th});var Jy,xD,Yy,wD,Th,Dm=jt(()=>{Es();Ea();Jy=0,xD="identity",Yy=qo,wD=o(t=>Ho(Jy,Yy(t)),"digest"),Th={code:Jy,name:xD,encode:Yy,digest:wD}});var Xy=jt(()=>{Es()});var zz,Kz,Zy=jt(()=>{zz=new TextEncoder,Kz=new TextDecoder});var We,AD,SD,MD,lu,TD,Qy,e3,Ch,kh,CD,kD,ID,Pi=jt(()=>{Ah();Ea();wh();wm();Es();We=class{constructor(e,r,n,i){this.code=r,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:kh,byteLength:kh,code:Ch,version:Ch,multihash:Ch,bytes:Ch,_baseCache:kh,asCID:kh})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==lu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==TD)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return We.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Ho(e,r);return We.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&&Gy(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return SD(r,i,e||ci.encoder);default:return MD(r,i,e||Nf.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 kD(/^0\.0/,ID),!!(e&&(e[e3]||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 We)return e;if(e!=null&&e.asCID===e){let{version:r,code:n,multihash:i,bytes:a}=e;return new We(r,n,i,a||Qy(r,n,i.bytes))}else if(e!=null&&e[e3]===!0){let{version:r,multihash:n,code:i}=e,a=Sh(n);return We.create(r,i,a)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==lu)throw new Error(`Version 0 CID must use dag-pb (code: ${lu}) block encoding`);return new We(e,r,n,n.bytes)}case 1:{let i=Qy(e,r,n.bytes);return new We(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return We.create(0,lu,e)}static createV1(e,r){return We.create(1,e,r)}static decode(e){let[r,n]=We.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=We.inspectBytes(e),n=r.size-r.multihashSize,i=qo(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),c=new _a(r.multihashCode,r.digestSize,a,i);return[r.version===0?We.createV0(c):We.createV1(r.codec,c),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=o(()=>{let[S,O]=fu(e.subarray(r));return r+=O,S},"next"),i=n(),a=lu;if(i===18?(i=0,r=0):i===1&&(a=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let c=r,u=n(),d=n(),v=r+d,y=v-c;return{version:i,codec:a,multihashCode:u,digestSize:d,multihashSize:y,size:v}}static parse(e,r){let[n,i]=AD(e,r),a=We.decode(i);return a._baseCache.set(n,e),a}};o(We,"CID");AD=o((t,e)=>{switch(t[0]){case"Q":{let r=e||ci;return[ci.prefix,r.decode(`${ci.prefix}${t}`)]}case ci.prefix:{let r=e||ci;return[ci.prefix,r.decode(t)]}case Nf.prefix:{let r=e||Nf;return[Nf.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},"parseCIDtoBytes"),SD=o((t,e,r)=>{let{prefix:n}=r;if(n!==ci.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i},"toStringV0"),MD=o((t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i},"toStringV1"),lu=112,TD=18,Qy=o((t,e,r)=>{let n=Bf(t),i=n+Bf(e),a=new Uint8Array(i+r.byteLength);return Lf(t,a,0),Lf(e,a,n),a.set(r,i),a},"encodeCID"),e3=Symbol.for("@ipld/js-cid/CID"),Ch={writable:!1,configurable:!1,enumerable:!0},kh={writable:!1,enumerable:!1,configurable:!1},CD="0.0.0-dev",kD=o((t,e)=>{if(t.test(CD))console.warn(e);else throw new Error(e)},"deprecate"),ID=`CID.isCID(v) is deprecated and will be removed in the next major release.
21
+ Following code pattern:
22
+
23
+ if (CID.isCID(value)) {
24
+ doSomethingWithCID(value)
25
+ }
26
+
27
+ Is replaced with:
28
+
29
+ const cid = CID.asCID(value)
30
+ if (cid) {
31
+ // Make sure to use cid instead of value
32
+ doSomethingWithCID(cid)
33
+ }
34
+ `});var Om=jt(()=>{Pi();Ah();Es();Cm();Ea()});var hu,Zz,Rm=jt(()=>{Py();Ly();By();Uy();$y();wm();Pf();wh();_h();qy();uu();Dm();Xy();Zy();Om();hu={...mm,...bm,...gm,...vm,...ym,...xm,..._m,...Em,...Am,...Sm},Zz={...km,...Im}});function r3(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var t3,Nm,DD,Ih,Pm=jt(()=>{Rm();bh();o(r3,"createCodec");t3=r3("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),Nm=r3("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=su(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),DD={utf8:t3,"utf-8":t3,hex:hu.base16,latin1:Nm,ascii:Nm,binary:Nm,...hu},Ih=DD});var n3={};Jt(n3,{fromString:()=>Bt});function Bt(t,e="utf8"){let r=Ih[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?xa(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var Dh=jt(()=>{Pm();ou();o(Bt,"fromString")});var i3={};Jt(i3,{toString:()=>kt});function kt(t,e="utf8"){let r=Ih[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Uf=jt(()=>{Pm();o(kt,"toString")});var o3=De(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});function OD(t,e){var r=t>>>16&65535,n=t&65535,i=e>>>16&65535,a=e&65535;return n*a+(r*a+n*i<<16>>>0)|0}o(OD,"imulShim");Pn.mul=Math.imul||OD;function RD(t,e){return t+e|0}o(RD,"add");Pn.add=RD;function ND(t,e){return t-e|0}o(ND,"sub");Pn.sub=ND;function PD(t,e){return t<<e|t>>>32-e}o(PD,"rotl");Pn.rotl=PD;function LD(t,e){return t<<32-e|t>>>e}o(LD,"rotr");Pn.rotr=LD;function BD(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}o(BD,"isIntegerShim");Pn.isInteger=Number.isInteger||BD;Pn.MAX_SAFE_INTEGER=9007199254740991;Pn.isSafeInteger=function(t){return Pn.isInteger(t)&&t>=-Pn.MAX_SAFE_INTEGER&&t<=Pn.MAX_SAFE_INTEGER}});var Aa=De(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});var s3=o3();function UD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}o(UD,"readInt16BE");Tt.readInt16BE=UD;function $D(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}o($D,"readUint16BE");Tt.readUint16BE=$D;function FD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}o(FD,"readInt16LE");Tt.readInt16LE=FD;function qD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}o(qD,"readUint16LE");Tt.readUint16LE=qD;function a3(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}o(a3,"writeUint16BE");Tt.writeUint16BE=a3;Tt.writeInt16BE=a3;function f3(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}o(f3,"writeUint16LE");Tt.writeUint16LE=f3;Tt.writeInt16LE=f3;function Lm(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}o(Lm,"readInt32BE");Tt.readInt32BE=Lm;function Bm(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}o(Bm,"readUint32BE");Tt.readUint32BE=Bm;function Um(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}o(Um,"readInt32LE");Tt.readInt32LE=Um;function $m(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}o($m,"readUint32LE");Tt.readUint32LE=$m;function Oh(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}o(Oh,"writeUint32BE");Tt.writeUint32BE=Oh;Tt.writeInt32BE=Oh;function Rh(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}o(Rh,"writeUint32LE");Tt.writeUint32LE=Rh;Tt.writeInt32LE=Rh;function HD(t,e){e===void 0&&(e=0);var r=Lm(t,e),n=Lm(t,e+4);return r*4294967296+n-(n>>31)*4294967296}o(HD,"readInt64BE");Tt.readInt64BE=HD;function zD(t,e){e===void 0&&(e=0);var r=Bm(t,e),n=Bm(t,e+4);return r*4294967296+n}o(zD,"readUint64BE");Tt.readUint64BE=zD;function KD(t,e){e===void 0&&(e=0);var r=Um(t,e),n=Um(t,e+4);return n*4294967296+r-(r>>31)*4294967296}o(KD,"readInt64LE");Tt.readInt64LE=KD;function jD(t,e){e===void 0&&(e=0);var r=$m(t,e),n=$m(t,e+4);return n*4294967296+r}o(jD,"readUint64LE");Tt.readUint64LE=jD;function c3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Oh(t/4294967296>>>0,e,r),Oh(t>>>0,e,r+4),e}o(c3,"writeUint64BE");Tt.writeUint64BE=c3;Tt.writeInt64BE=c3;function u3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Rh(t>>>0,e,r),Rh(t/4294967296>>>0,e,r+4),e}o(u3,"writeUint64LE");Tt.writeUint64LE=u3;Tt.writeInt64LE=u3;function GD(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}o(GD,"readUintBE");Tt.readUintBE=GD;function VD(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}o(VD,"readUintLE");Tt.readUintLE=VD;function WD(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!s3.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}o(WD,"writeUintBE");Tt.writeUintBE=WD;function JD(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!s3.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}o(JD,"writeUintLE");Tt.writeUintLE=JD;function YD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}o(YD,"readFloat32BE");Tt.readFloat32BE=YD;function XD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}o(XD,"readFloat32LE");Tt.readFloat32LE=XD;function ZD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}o(ZD,"readFloat64BE");Tt.readFloat64BE=ZD;function QD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}o(QD,"readFloat64LE");Tt.readFloat64LE=QD;function eO(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}o(eO,"writeFloat32BE");Tt.writeFloat32BE=eO;function tO(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}o(tO,"writeFloat32LE");Tt.writeFloat32LE=tO;function rO(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}o(rO,"writeFloat64BE");Tt.writeFloat64BE=rO;function nO(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}o(nO,"writeFloat64LE");Tt.writeFloat64LE=nO});var li=De(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});function iO(t){for(var e=0;e<t.length;e++)t[e]=0;return t}o(iO,"wipe");Fm.wipe=iO});var h3=De(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Ph=Aa(),Nh=li();Ms.DIGEST_LENGTH=32;Ms.BLOCK_SIZE=64;var l3=function(){function t(){this.digestLength=Ms.DIGEST_LENGTH,this.blockSize=Ms.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(t,"SHA256"),t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Nh.wipe(this._buffer),Nh.wipe(this._temp),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(qm(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=qm(this._temp,this._state,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,a=r<<3,c=r%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<c-8;u++)this._buffer[u]=0;Ph.writeUint32BE(i,this._buffer,c-8),Ph.writeUint32BE(a,this._buffer,c-4),qm(this._temp,this._state,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)Ph.writeUint32BE(this._state[u],e,u*4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.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},t.prototype.cleanSavedState=function(e){Nh.wipe(e.state),e.buffer&&Nh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Ms.SHA256=l3;var oO=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 qm(t,e,r,n,i){for(;i>=64;){for(var a=e[0],c=e[1],u=e[2],d=e[3],v=e[4],y=e[5],S=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;t[R]=Ph.readUint32BE(r,I)}for(var R=16;R<64;R++){var N=t[R-2],J=(N>>>17|N<<32-17)^(N>>>19|N<<32-19)^N>>>10;N=t[R-15];var L=(N>>>7|N<<32-7)^(N>>>18|N<<32-18)^N>>>3;t[R]=(J+t[R-7]|0)+(L+t[R-16]|0)}for(var R=0;R<64;R++){var J=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&y^~v&S)|0)+(O+(oO[R]+t[R]|0)|0)|0,L=((a>>>2|a<<32-2)^(a>>>13|a<<32-13)^(a>>>22|a<<32-22))+(a&c^a&u^c&u)|0;O=S,S=y,y=v,v=d+J|0,d=u,u=c,c=a,a=J+L|0}e[0]+=a,e[1]+=c,e[2]+=u,e[3]+=d,e[4]+=v,e[5]+=y,e[6]+=S,e[7]+=O,n+=64,i-=64}return n}o(qm,"hashBlocks");function sO(t){var e=new l3;e.update(t);var r=e.digest();return e.clean(),r}o(sO,"hash");Ms.hash=sO});var Hm=De((_K,Lh)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=global:i&&(n=self);var c=!n.JS_SHA3_NO_COMMON_JS&&typeof Lh=="object"&&Lh.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],S=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],N=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],J=[224,256,384,512],L=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],Z={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),d&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var Y=o(function(D,Q,se){return function(F){return new w(D,Q,D).update(F)[se]()}},"createOutputMethod"),oe=o(function(D,Q,se){return function(F,$){return new w(D,Q,$).update(F)[se]()}},"createShakeOutputMethod"),K=o(function(D,Q,se){return function(F,$,ee,ne){return l["cshake"+D].update(F,$,ee,ne)[se]()}},"createCshakeOutputMethod"),q=o(function(D,Q,se){return function(F,$,ee,ne){return l["kmac"+D].update(F,$,ee,ne)[se]()}},"createKmacOutputMethod"),j=o(function(D,Q,se,F){for(var $=0;$<V.length;++$){var ee=V[$];D[ee]=Q(se,F,ee)}return D},"createOutputMethods"),le=o(function(D,Q){var se=Y(D,Q,"hex");return se.create=function(){return new w(D,Q,D)},se.update=function(F){return se.create().update(F)},j(se,Y,D,Q)},"createMethod"),T=o(function(D,Q){var se=oe(D,Q,"hex");return se.create=function(F){return new w(D,Q,F)},se.update=function(F,$){return se.create($).update(F)},j(se,oe,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=Z[D],F=K(D,Q,"hex");return F.create=function($,ee,ne){return!ee&&!ne?l["shake"+D].create($):new w(D,Q,$).bytepad([ee,ne],se)},F.update=function($,ee,ne,ae){return F.create(ee,ne,ae).update($)},j(F,K,D,Q)},"createCshakeMethod"),x=o(function(D,Q){var se=Z[D],F=q(D,Q,"hex");return F.create=function($,ee,ne){return new k(D,Q,ee).bytepad(["KMAC",ne],se).bytepad([$],se)},F.update=function($,ee,ne,ae){return F.create($,ne,ae).update(ee)},j(F,q,D,Q)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:J,createMethod:le},{name:"sha3",padding:R,bits:J,createMethod:le},{name:"shake",padding:y,bits:L,createMethod:T},{name:"cshake",padding:S,bits:L,createMethod:h},{name:"kmac",padding:S,bits:L,createMethod:x}],l={},m=[],_=0;_<b.length;++_)for(var A=b[_],E=A.bits,g=0;g<E.length;++g){var C=A.name+"_"+E[g];if(m.push(C),l[C]=A.createMethod(E[g],A.padding),A.name!=="sha3"){var P=A.name+E[g];m.push(P),l[P]=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 F=0;F<50;++F)this.s[F]=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(t);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(t)}else throw new Error(t);Q=!0}for(var F=this.blocks,$=this.byteCount,ee=D.length,ne=this.blockCount,ae=0,Ae=this.s,ge,re;ae<ee;){if(this.reset)for(this.reset=!1,F[0]=this.block,ge=1;ge<ne+1;++ge)F[ge]=0;if(Q)for(ge=this.start;ae<ee&&ge<$;++ae)F[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<ee&&ge<$;++ae)re=D.charCodeAt(ae),re<128?F[ge>>2]|=re<<I[ge++&3]:re<2048?(F[ge>>2]|=(192|re>>6)<<I[ge++&3],F[ge>>2]|=(128|re&63)<<I[ge++&3]):re<55296||re>=57344?(F[ge>>2]|=(224|re>>12)<<I[ge++&3],F[ge>>2]|=(128|re>>6&63)<<I[ge++&3],F[ge>>2]|=(128|re&63)<<I[ge++&3]):(re=65536+((re&1023)<<10|D.charCodeAt(++ae)&1023),F[ge>>2]|=(240|re>>18)<<I[ge++&3],F[ge>>2]|=(128|re>>12&63)<<I[ge++&3],F[ge>>2]|=(128|re>>6&63)<<I[ge++&3],F[ge>>2]|=(128|re&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=$){for(this.start=ge-$,this.block=F[ne],ge=0;ge<ne;++ge)Ae[ge]^=F[ge];he(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(D,Q){var se=D&255,F=1,$=[se];for(D=D>>8,se=D&255;se>0;)$.unshift(se),D=D>>8,se=D&255,++F;return Q?$.push(F):$.unshift(F),this.update($),$.length},w.prototype.encodeString=function(D){var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(t);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(t)}else throw new Error(t);Q=!0}var F=0,$=D.length;if(Q)F=$;else for(var ee=0;ee<D.length;++ee){var ne=D.charCodeAt(ee);ne<128?F+=1:ne<2048?F+=2:ne<55296||ne>=57344?F+=3:(ne=65536+((ne&1023)<<10|D.charCodeAt(++ee)&1023),F+=4)}return F+=this.encode(F*8),this.update(D),F},w.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),F=0;F<D.length;++F)se+=this.encodeString(D[F]);var $=Q-se%Q,ee=[];return ee.length=$,this.update(ee),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,F=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)F[Q]^=D[Q];he(F)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,F=this.extraBytes,$=0,ee=0,ne="",ae;ee<se;){for($=0;$<D&&ee<se;++$,++ee)ae=Q[$],ne+=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];ee%D===0&&(he(Q),$=0)}return F&&(ae=Q[$],ne+=v[ae>>4&15]+v[ae&15],F>1&&(ne+=v[ae>>12&15]+v[ae>>8&15]),F>2&&(ne+=v[ae>>20&15]+v[ae>>16&15])),ne},w.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,F=this.extraBytes,$=0,ee=0,ne=this.outputBits>>3,ae;F?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(ne);for(var Ae=new Uint32Array(ae);ee<se;){for($=0;$<D&&ee<se;++$,++ee)Ae[ee]=Q[$];ee%D===0&&he(Q)}return F&&(Ae[$]=Q[$],ae=ae.slice(0,ne)),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,F=this.extraBytes,$=0,ee=0,ne=[],ae,Ae;ee<se;){for($=0;$<D&&ee<se;++$,++ee)ae=ee<<2,Ae=Q[$],ne[ae]=Ae&255,ne[ae+1]=Ae>>8&255,ne[ae+2]=Ae>>16&255,ne[ae+3]=Ae>>24&255;ee%D===0&&he(Q)}return F&&(ae=ee<<2,Ae=Q[$],ne[ae]=Ae&255,F>1&&(ne[ae+1]=Ae>>8&255),F>2&&(ne[ae+2]=Ae>>16&255)),ne};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 he=o(function(D){var Q,se,F,$,ee,ne,ae,Ae,ge,re,Se,ce,ve,G,pe,Ce,He,Ne,Ve,pr,ue,ie,U,X,me,ye,we,ke,Dt,Ue,Oe,Lt,je,Je,Tn,nt,it,Jn,ot,et,Yn,st,at,cn,ft,Xe,Xn,ct,ut,Zn,lt,ht,Qn,dt,tt,Cn,$t,Ft,un,ln,hn,Nr,dn;for(F=0;F<48;F+=2)$=D[0]^D[10]^D[20]^D[30]^D[40],ee=D[1]^D[11]^D[21]^D[31]^D[41],ne=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],re=D[6]^D[16]^D[26]^D[36]^D[46],Se=D[7]^D[17]^D[27]^D[37]^D[47],ce=D[8]^D[18]^D[28]^D[38]^D[48],ve=D[9]^D[19]^D[29]^D[39]^D[49],Q=ce^(ne<<1|ae>>>31),se=ve^(ae<<1|ne>>>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=$^(Ae<<1|ge>>>31),se=ee^(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=ne^(re<<1|Se>>>31),se=ae^(Se<<1|re>>>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^(ce<<1|ve>>>31),se=ge^(ve<<1|ce>>>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=re^($<<1|ee>>>31),se=Se^(ee<<1|$>>>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,G=D[0],pe=D[1],Xe=D[11]<<4|D[10]>>>28,Xn=D[10]<<4|D[11]>>>28,ke=D[20]<<3|D[21]>>>29,Dt=D[21]<<3|D[20]>>>29,ln=D[31]<<9|D[30]>>>23,hn=D[30]<<9|D[31]>>>23,st=D[40]<<18|D[41]>>>14,at=D[41]<<18|D[40]>>>14,Je=D[2]<<1|D[3]>>>31,Tn=D[3]<<1|D[2]>>>31,Ce=D[13]<<12|D[12]>>>20,He=D[12]<<12|D[13]>>>20,ct=D[22]<<10|D[23]>>>22,ut=D[23]<<10|D[22]>>>22,Ue=D[33]<<13|D[32]>>>19,Oe=D[32]<<13|D[33]>>>19,Nr=D[42]<<2|D[43]>>>30,dn=D[43]<<2|D[42]>>>30,dt=D[5]<<30|D[4]>>>2,tt=D[4]<<30|D[5]>>>2,nt=D[14]<<6|D[15]>>>26,it=D[15]<<6|D[14]>>>26,Ne=D[25]<<11|D[24]>>>21,Ve=D[24]<<11|D[25]>>>21,Zn=D[34]<<15|D[35]>>>17,lt=D[35]<<15|D[34]>>>17,Lt=D[45]<<29|D[44]>>>3,je=D[44]<<29|D[45]>>>3,X=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Cn=D[17]<<23|D[16]>>>9,$t=D[16]<<23|D[17]>>>9,Jn=D[26]<<25|D[27]>>>7,ot=D[27]<<25|D[26]>>>7,pr=D[36]<<21|D[37]>>>11,ue=D[37]<<21|D[36]>>>11,ht=D[47]<<24|D[46]>>>8,Qn=D[46]<<24|D[47]>>>8,cn=D[8]<<27|D[9]>>>5,ft=D[9]<<27|D[8]>>>5,ye=D[18]<<20|D[19]>>>12,we=D[19]<<20|D[18]>>>12,Ft=D[29]<<7|D[28]>>>25,un=D[28]<<7|D[29]>>>25,et=D[38]<<8|D[39]>>>24,Yn=D[39]<<8|D[38]>>>24,ie=D[48]<<14|D[49]>>>18,U=D[49]<<14|D[48]>>>18,D[0]=G^~Ce&Ne,D[1]=pe^~He&Ve,D[10]=X^~ye&ke,D[11]=me^~we&Dt,D[20]=Je^~nt&Jn,D[21]=Tn^~it&ot,D[30]=cn^~Xe&ct,D[31]=ft^~Xn&ut,D[40]=dt^~Cn&Ft,D[41]=tt^~$t&un,D[2]=Ce^~Ne&pr,D[3]=He^~Ve&ue,D[12]=ye^~ke&Ue,D[13]=we^~Dt&Oe,D[22]=nt^~Jn&et,D[23]=it^~ot&Yn,D[32]=Xe^~ct&Zn,D[33]=Xn^~ut&lt,D[42]=Cn^~Ft&ln,D[43]=$t^~un&hn,D[4]=Ne^~pr&ie,D[5]=Ve^~ue&U,D[14]=ke^~Ue&Lt,D[15]=Dt^~Oe&je,D[24]=Jn^~et&st,D[25]=ot^~Yn&at,D[34]=ct^~Zn&ht,D[35]=ut^~lt&Qn,D[44]=Ft^~ln&Nr,D[45]=un^~hn&dn,D[6]=pr^~ie&G,D[7]=ue^~U&pe,D[16]=Ue^~Lt&X,D[17]=Oe^~je&me,D[26]=et^~st&Je,D[27]=Yn^~at&Tn,D[36]=Zn^~ht&cn,D[37]=lt^~Qn&ft,D[46]=ln^~Nr&dt,D[47]=hn^~dn&tt,D[8]=ie^~G&Ce,D[9]=U^~pe&He,D[18]=Lt^~X&ye,D[19]=je^~me&we,D[28]=st^~Je&nt,D[29]=at^~Tn&it,D[38]=ht^~cn&Xe,D[39]=Qn^~ft&Xn,D[48]=Nr^~dt&Cn,D[49]=dn^~tt&$t,D[0]^=N[F],D[1]^=N[F+1]},"f");if(c)Lh.exports=l;else{for(_=0;_<m.length;++_)n[m[_]]=l[m[_]];u&&define(function(){return l})}})()});var d3=De((EK,aO)=>{aO.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var zm=De(()=>{});var io=De((p3,Km)=>{(function(t,e){"use strict";function r(T,h){if(!T)throw new Error(h||"Assertion failed")}o(r,"assert");function n(T,h){T.super_=h;var x=o(function(){},"TempCtor");x.prototype=h.prototype,T.prototype=new x,T.prototype.constructor=T}o(n,"inherits");function i(T,h,x){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((h==="le"||h==="be")&&(x=h,h=10),this._init(T||0,h||10,x||"be"))}o(i,"BN"),typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=zm().Buffer}catch{}i.isBN=o(function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},"isBN"),i.max=o(function(h,x){return h.cmp(x)>0?h:x},"max"),i.min=o(function(h,x){return h.cmp(x)<0?h:x},"min"),i.prototype._init=o(function(h,x,b){if(typeof h=="number")return this._initNumber(h,x,b);if(typeof h=="object")return this._initArray(h,x,b);x==="hex"&&(x=16),r(x===(x|0)&&x>=2&&x<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(x===16?this._parseHex(h,l,b):(this._parseBase(h,x,l),b==="le"&&this._initArray(this.toArray(),x,b)))},"init"),i.prototype._initNumber=o(function(h,x,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),x,b)},"_initNumber"),i.prototype._initArray=o(function(h,x,b){if(r(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,_,A=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]|=_<<A&67108863,this.words[m+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=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]|=_<<A&67108863,this.words[m+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,m++);return this.strip()},"_initArray");function c(T,h){var x=T.charCodeAt(h);return x>=65&&x<=70?x-55:x>=97&&x<=102?x-87:x-48&15}o(c,"parseHex4Bits");function u(T,h,x){var b=c(T,x);return x-1>=h&&(b|=c(T,x-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,x,b){this.length=Math.ceil((h.length-x)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m=0,_=0,A;if(b==="be")for(l=h.length-1;l>=x;l-=2)A=u(h,x,l)<<m,this.words[_]|=A&67108863,m>=18?(m-=18,_+=1,this.words[_]|=A>>>26):m+=8;else{var E=h.length-x;for(l=E%2===0?x+1:x;l<h.length;l+=2)A=u(h,x,l)<<m,this.words[_]|=A&67108863,m>=18?(m-=18,_+=1,this.words[_]|=A>>>26):m+=8}this.strip()},"_parseHex");function d(T,h,x,b){for(var l=0,m=Math.min(T.length,x),_=h;_<m;_++){var A=T.charCodeAt(_)-48;l*=b,A>=49?l+=A-49+10:A>=17?l+=A-17+10:l+=A}return l}o(d,"parseBase"),i.prototype._parseBase=o(function(h,x,b){this.words=[0],this.length=1;for(var l=0,m=1;m<=67108863;m*=x)l++;l--,m=m/x|0;for(var _=h.length-b,A=_%l,E=Math.min(_,_-A)+b,g=0,C=b;C<E;C+=l)g=d(h,C,C+l,x),this.imuln(m),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(A!==0){var P=1;for(g=d(h,C,h.length,x),C=0;C<A;C++)P*=x;this.imuln(P),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var x=0;x<this.length;x++)h.words[x]=this.words[x];h.length=this.length,h.negative=this.negative,h.red=this.red},"copy"),i.prototype.clone=o(function(){var h=new i(null);return this.copy(h),h},"clone"),i.prototype._expand=o(function(h){for(;this.length<h;)this.words[this.length++]=0;return this},"_expand"),i.prototype.strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),i.prototype.inspect=o(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect");var 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"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=o(function(h,x){h=h||10,x=x|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,m=0,_=0;_<this.length;_++){var A=this.words[_],E=((A<<l|m)&16777215).toString(16);m=A>>>24-l&16777215,m!==0||_!==this.length-1?b=v[6-E.length]+E+b:b=E+b,l+=2,l>=26&&(l-=26,_--)}for(m!==0&&(b=m.toString(16)+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],C=S[h];b="";var P=this.clone();for(P.negative=0;!P.isZero();){var w=P.modn(C).toString(h);P=P.idivn(C),P.isZero()?b=w+b:b=v[g-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!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&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(h,x){return r(typeof a<"u"),this.toArrayLike(a,h,x)},"toBuffer"),i.prototype.toArray=o(function(h,x){return this.toArrayLike(Array,h,x)},"toArray"),i.prototype.toArrayLike=o(function(h,x,b){var l=this.byteLength(),m=b||Math.max(1,l);r(l<=m,"byte array longer than desired length"),r(m>0,"Requested array length <= 0"),this.strip();var _=x==="le",A=new h(m),E,g,C=this.clone();if(_){for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[g]=E;for(;g<m;g++)A[g]=0}else{for(g=0;g<m-l;g++)A[g]=0;for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[m-g-1]=E}return A},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var x=h,b=0;return x>=4096&&(b+=13,x>>>=13),x>=64&&(b+=7,x>>>=7),x>=8&&(b+=4,x>>>=4),x>=2&&(b+=2,x>>>=2),b+x},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var x=h,b=0;return(x&8191)===0&&(b+=13,x>>>=13),(x&127)===0&&(b+=7,x>>>=7),(x&15)===0&&(b+=4,x>>>=4),(x&3)===0&&(b+=2,x>>>=2),(x&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],x=this._countBits(h);return(this.length-1)*26+x},"bitLength");function O(T){for(var h=new Array(T.bitLength()),x=0;x<h.length;x++){var b=x/26|0,l=x%26;h[x]=(T.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,x=0;x<this.length;x++){var b=this._zeroBits(this.words[x]);if(h+=b,b!==26)break}return h},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]|h.words[x];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return r((this.negative|h.negative)===0),this.iuor(h)},"ior"),i.prototype.or=o(function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},"or"),i.prototype.uor=o(function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(h){var x;this.length>h.length?x=h:x=this;for(var b=0;b<x.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=x.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return r((this.negative|h.negative)===0),this.iuand(h)},"iand"),i.prototype.and=o(function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},"and"),i.prototype.uand=o(function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(h){var x,b;this.length>h.length?(x=this,b=h):(x=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=x.words[l]^b.words[l];if(this!==x)for(;l<x.length;l++)this.words[l]=x.words[l];return this.length=x.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return r((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){r(typeof h=="number"&&h>=0);var x=Math.ceil(h/26)|0,b=h%26;this._expand(x),b>0&&x--;for(var l=0;l<x;l++)this.words[l]=~this.words[l]&67108863;return b>0&&(this.words[l]=~this.words[l]&67108863>>26-b),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,x){r(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),x?this.words[b]=this.words[b]|1<<l:this.words[b]=this.words[b]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var x;if(this.negative!==0&&h.negative===0)return this.negative=0,x=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,x=this.isub(h),h.negative=1,x._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var m=0,_=0;_<l.length;_++)x=(b.words[_]|0)+(l.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;for(;m!==0&&_<b.length;_++)x=(b.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;if(this.length=b.length,m!==0)this.words[this.length]=m,this.length++;else if(b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this},"iadd"),i.prototype.add=o(function(h){var x;return h.negative!==0&&this.negative===0?(h.negative=0,x=this.sub(h),h.negative^=1,x):h.negative===0&&this.negative!==0?(this.negative=0,x=h.sub(this),this.negative=1,x):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},"add"),i.prototype.isub=o(function(h){if(h.negative!==0){h.negative=0;var x=this.iadd(h);return h.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,m;b>0?(l=this,m=h):(l=h,m=this);for(var _=0,A=0;A<m.length;A++)x=(l.words[A]|0)-(m.words[A]|0)+_,_=x>>26,this.words[A]=x&67108863;for(;_!==0&&A<l.length;A++)x=(l.words[A]|0)+_,_=x>>26,this.words[A]=x&67108863;if(_===0&&A<l.length&&l!==this)for(;A<l.length;A++)this.words[A]=l.words[A];return this.length=Math.max(this.length,A),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(T,h,x){x.negative=h.negative^T.negative;var b=T.length+h.length|0;x.length=b,b=b-1|0;var l=T.words[0]|0,m=h.words[0]|0,_=l*m,A=_&67108863,E=_/67108864|0;x.words[0]=A;for(var g=1;g<b;g++){for(var C=E>>>26,P=E&67108863,w=Math.min(g,h.length-1),k=Math.max(0,g-T.length+1);k<=w;k++){var he=g-k|0;l=T.words[he]|0,m=h.words[k]|0,_=l*m+P,C+=_/67108864|0,P=_&67108863}x.words[g]=P|0,E=C|0}return E!==0?x.words[g]=E|0:x.length--,x.strip()}o(R,"smallMulTo");var I=o(function(h,x,b){var l=h.words,m=x.words,_=b.words,A=0,E,g,C,P=l[0]|0,w=P&8191,k=P>>>13,he=l[1]|0,D=he&8191,Q=he>>>13,se=l[2]|0,F=se&8191,$=se>>>13,ee=l[3]|0,ne=ee&8191,ae=ee>>>13,Ae=l[4]|0,ge=Ae&8191,re=Ae>>>13,Se=l[5]|0,ce=Se&8191,ve=Se>>>13,G=l[6]|0,pe=G&8191,Ce=G>>>13,He=l[7]|0,Ne=He&8191,Ve=He>>>13,pr=l[8]|0,ue=pr&8191,ie=pr>>>13,U=l[9]|0,X=U&8191,me=U>>>13,ye=m[0]|0,we=ye&8191,ke=ye>>>13,Dt=m[1]|0,Ue=Dt&8191,Oe=Dt>>>13,Lt=m[2]|0,je=Lt&8191,Je=Lt>>>13,Tn=m[3]|0,nt=Tn&8191,it=Tn>>>13,Jn=m[4]|0,ot=Jn&8191,et=Jn>>>13,Yn=m[5]|0,st=Yn&8191,at=Yn>>>13,cn=m[6]|0,ft=cn&8191,Xe=cn>>>13,Xn=m[7]|0,ct=Xn&8191,ut=Xn>>>13,Zn=m[8]|0,lt=Zn&8191,ht=Zn>>>13,Qn=m[9]|0,dt=Qn&8191,tt=Qn>>>13;b.negative=h.negative^x.negative,b.length=19,E=Math.imul(w,we),g=Math.imul(w,ke),g=g+Math.imul(k,we)|0,C=Math.imul(k,ke);var Cn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,E=Math.imul(D,we),g=Math.imul(D,ke),g=g+Math.imul(Q,we)|0,C=Math.imul(Q,ke),E=E+Math.imul(w,Ue)|0,g=g+Math.imul(w,Oe)|0,g=g+Math.imul(k,Ue)|0,C=C+Math.imul(k,Oe)|0;var $t=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+($t>>>26)|0,$t&=67108863,E=Math.imul(F,we),g=Math.imul(F,ke),g=g+Math.imul($,we)|0,C=Math.imul($,ke),E=E+Math.imul(D,Ue)|0,g=g+Math.imul(D,Oe)|0,g=g+Math.imul(Q,Ue)|0,C=C+Math.imul(Q,Oe)|0,E=E+Math.imul(w,je)|0,g=g+Math.imul(w,Je)|0,g=g+Math.imul(k,je)|0,C=C+Math.imul(k,Je)|0;var Ft=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,E=Math.imul(ne,we),g=Math.imul(ne,ke),g=g+Math.imul(ae,we)|0,C=Math.imul(ae,ke),E=E+Math.imul(F,Ue)|0,g=g+Math.imul(F,Oe)|0,g=g+Math.imul($,Ue)|0,C=C+Math.imul($,Oe)|0,E=E+Math.imul(D,je)|0,g=g+Math.imul(D,Je)|0,g=g+Math.imul(Q,je)|0,C=C+Math.imul(Q,Je)|0,E=E+Math.imul(w,nt)|0,g=g+Math.imul(w,it)|0,g=g+Math.imul(k,nt)|0,C=C+Math.imul(k,it)|0;var un=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(un>>>26)|0,un&=67108863,E=Math.imul(ge,we),g=Math.imul(ge,ke),g=g+Math.imul(re,we)|0,C=Math.imul(re,ke),E=E+Math.imul(ne,Ue)|0,g=g+Math.imul(ne,Oe)|0,g=g+Math.imul(ae,Ue)|0,C=C+Math.imul(ae,Oe)|0,E=E+Math.imul(F,je)|0,g=g+Math.imul(F,Je)|0,g=g+Math.imul($,je)|0,C=C+Math.imul($,Je)|0,E=E+Math.imul(D,nt)|0,g=g+Math.imul(D,it)|0,g=g+Math.imul(Q,nt)|0,C=C+Math.imul(Q,it)|0,E=E+Math.imul(w,ot)|0,g=g+Math.imul(w,et)|0,g=g+Math.imul(k,ot)|0,C=C+Math.imul(k,et)|0;var ln=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ln>>>26)|0,ln&=67108863,E=Math.imul(ce,we),g=Math.imul(ce,ke),g=g+Math.imul(ve,we)|0,C=Math.imul(ve,ke),E=E+Math.imul(ge,Ue)|0,g=g+Math.imul(ge,Oe)|0,g=g+Math.imul(re,Ue)|0,C=C+Math.imul(re,Oe)|0,E=E+Math.imul(ne,je)|0,g=g+Math.imul(ne,Je)|0,g=g+Math.imul(ae,je)|0,C=C+Math.imul(ae,Je)|0,E=E+Math.imul(F,nt)|0,g=g+Math.imul(F,it)|0,g=g+Math.imul($,nt)|0,C=C+Math.imul($,it)|0,E=E+Math.imul(D,ot)|0,g=g+Math.imul(D,et)|0,g=g+Math.imul(Q,ot)|0,C=C+Math.imul(Q,et)|0,E=E+Math.imul(w,st)|0,g=g+Math.imul(w,at)|0,g=g+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var hn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(hn>>>26)|0,hn&=67108863,E=Math.imul(pe,we),g=Math.imul(pe,ke),g=g+Math.imul(Ce,we)|0,C=Math.imul(Ce,ke),E=E+Math.imul(ce,Ue)|0,g=g+Math.imul(ce,Oe)|0,g=g+Math.imul(ve,Ue)|0,C=C+Math.imul(ve,Oe)|0,E=E+Math.imul(ge,je)|0,g=g+Math.imul(ge,Je)|0,g=g+Math.imul(re,je)|0,C=C+Math.imul(re,Je)|0,E=E+Math.imul(ne,nt)|0,g=g+Math.imul(ne,it)|0,g=g+Math.imul(ae,nt)|0,C=C+Math.imul(ae,it)|0,E=E+Math.imul(F,ot)|0,g=g+Math.imul(F,et)|0,g=g+Math.imul($,ot)|0,C=C+Math.imul($,et)|0,E=E+Math.imul(D,st)|0,g=g+Math.imul(D,at)|0,g=g+Math.imul(Q,st)|0,C=C+Math.imul(Q,at)|0,E=E+Math.imul(w,ft)|0,g=g+Math.imul(w,Xe)|0,g=g+Math.imul(k,ft)|0,C=C+Math.imul(k,Xe)|0;var Nr=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,E=Math.imul(Ne,we),g=Math.imul(Ne,ke),g=g+Math.imul(Ve,we)|0,C=Math.imul(Ve,ke),E=E+Math.imul(pe,Ue)|0,g=g+Math.imul(pe,Oe)|0,g=g+Math.imul(Ce,Ue)|0,C=C+Math.imul(Ce,Oe)|0,E=E+Math.imul(ce,je)|0,g=g+Math.imul(ce,Je)|0,g=g+Math.imul(ve,je)|0,C=C+Math.imul(ve,Je)|0,E=E+Math.imul(ge,nt)|0,g=g+Math.imul(ge,it)|0,g=g+Math.imul(re,nt)|0,C=C+Math.imul(re,it)|0,E=E+Math.imul(ne,ot)|0,g=g+Math.imul(ne,et)|0,g=g+Math.imul(ae,ot)|0,C=C+Math.imul(ae,et)|0,E=E+Math.imul(F,st)|0,g=g+Math.imul(F,at)|0,g=g+Math.imul($,st)|0,C=C+Math.imul($,at)|0,E=E+Math.imul(D,ft)|0,g=g+Math.imul(D,Xe)|0,g=g+Math.imul(Q,ft)|0,C=C+Math.imul(Q,Xe)|0,E=E+Math.imul(w,ct)|0,g=g+Math.imul(w,ut)|0,g=g+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var dn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(dn>>>26)|0,dn&=67108863,E=Math.imul(ue,we),g=Math.imul(ue,ke),g=g+Math.imul(ie,we)|0,C=Math.imul(ie,ke),E=E+Math.imul(Ne,Ue)|0,g=g+Math.imul(Ne,Oe)|0,g=g+Math.imul(Ve,Ue)|0,C=C+Math.imul(Ve,Oe)|0,E=E+Math.imul(pe,je)|0,g=g+Math.imul(pe,Je)|0,g=g+Math.imul(Ce,je)|0,C=C+Math.imul(Ce,Je)|0,E=E+Math.imul(ce,nt)|0,g=g+Math.imul(ce,it)|0,g=g+Math.imul(ve,nt)|0,C=C+Math.imul(ve,it)|0,E=E+Math.imul(ge,ot)|0,g=g+Math.imul(ge,et)|0,g=g+Math.imul(re,ot)|0,C=C+Math.imul(re,et)|0,E=E+Math.imul(ne,st)|0,g=g+Math.imul(ne,at)|0,g=g+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,E=E+Math.imul(F,ft)|0,g=g+Math.imul(F,Xe)|0,g=g+Math.imul($,ft)|0,C=C+Math.imul($,Xe)|0,E=E+Math.imul(D,ct)|0,g=g+Math.imul(D,ut)|0,g=g+Math.imul(Q,ct)|0,C=C+Math.imul(Q,ut)|0,E=E+Math.imul(w,lt)|0,g=g+Math.imul(w,ht)|0,g=g+Math.imul(k,lt)|0,C=C+Math.imul(k,ht)|0;var ei=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ei>>>26)|0,ei&=67108863,E=Math.imul(X,we),g=Math.imul(X,ke),g=g+Math.imul(me,we)|0,C=Math.imul(me,ke),E=E+Math.imul(ue,Ue)|0,g=g+Math.imul(ue,Oe)|0,g=g+Math.imul(ie,Ue)|0,C=C+Math.imul(ie,Oe)|0,E=E+Math.imul(Ne,je)|0,g=g+Math.imul(Ne,Je)|0,g=g+Math.imul(Ve,je)|0,C=C+Math.imul(Ve,Je)|0,E=E+Math.imul(pe,nt)|0,g=g+Math.imul(pe,it)|0,g=g+Math.imul(Ce,nt)|0,C=C+Math.imul(Ce,it)|0,E=E+Math.imul(ce,ot)|0,g=g+Math.imul(ce,et)|0,g=g+Math.imul(ve,ot)|0,C=C+Math.imul(ve,et)|0,E=E+Math.imul(ge,st)|0,g=g+Math.imul(ge,at)|0,g=g+Math.imul(re,st)|0,C=C+Math.imul(re,at)|0,E=E+Math.imul(ne,ft)|0,g=g+Math.imul(ne,Xe)|0,g=g+Math.imul(ae,ft)|0,C=C+Math.imul(ae,Xe)|0,E=E+Math.imul(F,ct)|0,g=g+Math.imul(F,ut)|0,g=g+Math.imul($,ct)|0,C=C+Math.imul($,ut)|0,E=E+Math.imul(D,lt)|0,g=g+Math.imul(D,ht)|0,g=g+Math.imul(Q,lt)|0,C=C+Math.imul(Q,ht)|0,E=E+Math.imul(w,dt)|0,g=g+Math.imul(w,tt)|0,g=g+Math.imul(k,dt)|0,C=C+Math.imul(k,tt)|0;var So=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(So>>>26)|0,So&=67108863,E=Math.imul(X,Ue),g=Math.imul(X,Oe),g=g+Math.imul(me,Ue)|0,C=Math.imul(me,Oe),E=E+Math.imul(ue,je)|0,g=g+Math.imul(ue,Je)|0,g=g+Math.imul(ie,je)|0,C=C+Math.imul(ie,Je)|0,E=E+Math.imul(Ne,nt)|0,g=g+Math.imul(Ne,it)|0,g=g+Math.imul(Ve,nt)|0,C=C+Math.imul(Ve,it)|0,E=E+Math.imul(pe,ot)|0,g=g+Math.imul(pe,et)|0,g=g+Math.imul(Ce,ot)|0,C=C+Math.imul(Ce,et)|0,E=E+Math.imul(ce,st)|0,g=g+Math.imul(ce,at)|0,g=g+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,E=E+Math.imul(ge,ft)|0,g=g+Math.imul(ge,Xe)|0,g=g+Math.imul(re,ft)|0,C=C+Math.imul(re,Xe)|0,E=E+Math.imul(ne,ct)|0,g=g+Math.imul(ne,ut)|0,g=g+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,E=E+Math.imul(F,lt)|0,g=g+Math.imul(F,ht)|0,g=g+Math.imul($,lt)|0,C=C+Math.imul($,ht)|0,E=E+Math.imul(D,dt)|0,g=g+Math.imul(D,tt)|0,g=g+Math.imul(Q,dt)|0,C=C+Math.imul(Q,tt)|0;var Mo=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,E=Math.imul(X,je),g=Math.imul(X,Je),g=g+Math.imul(me,je)|0,C=Math.imul(me,Je),E=E+Math.imul(ue,nt)|0,g=g+Math.imul(ue,it)|0,g=g+Math.imul(ie,nt)|0,C=C+Math.imul(ie,it)|0,E=E+Math.imul(Ne,ot)|0,g=g+Math.imul(Ne,et)|0,g=g+Math.imul(Ve,ot)|0,C=C+Math.imul(Ve,et)|0,E=E+Math.imul(pe,st)|0,g=g+Math.imul(pe,at)|0,g=g+Math.imul(Ce,st)|0,C=C+Math.imul(Ce,at)|0,E=E+Math.imul(ce,ft)|0,g=g+Math.imul(ce,Xe)|0,g=g+Math.imul(ve,ft)|0,C=C+Math.imul(ve,Xe)|0,E=E+Math.imul(ge,ct)|0,g=g+Math.imul(ge,ut)|0,g=g+Math.imul(re,ct)|0,C=C+Math.imul(re,ut)|0,E=E+Math.imul(ne,lt)|0,g=g+Math.imul(ne,ht)|0,g=g+Math.imul(ae,lt)|0,C=C+Math.imul(ae,ht)|0,E=E+Math.imul(F,dt)|0,g=g+Math.imul(F,tt)|0,g=g+Math.imul($,dt)|0,C=C+Math.imul($,tt)|0;var To=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(To>>>26)|0,To&=67108863,E=Math.imul(X,nt),g=Math.imul(X,it),g=g+Math.imul(me,nt)|0,C=Math.imul(me,it),E=E+Math.imul(ue,ot)|0,g=g+Math.imul(ue,et)|0,g=g+Math.imul(ie,ot)|0,C=C+Math.imul(ie,et)|0,E=E+Math.imul(Ne,st)|0,g=g+Math.imul(Ne,at)|0,g=g+Math.imul(Ve,st)|0,C=C+Math.imul(Ve,at)|0,E=E+Math.imul(pe,ft)|0,g=g+Math.imul(pe,Xe)|0,g=g+Math.imul(Ce,ft)|0,C=C+Math.imul(Ce,Xe)|0,E=E+Math.imul(ce,ct)|0,g=g+Math.imul(ce,ut)|0,g=g+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,E=E+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ht)|0,g=g+Math.imul(re,lt)|0,C=C+Math.imul(re,ht)|0,E=E+Math.imul(ne,dt)|0,g=g+Math.imul(ne,tt)|0,g=g+Math.imul(ae,dt)|0,C=C+Math.imul(ae,tt)|0;var Zi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,E=Math.imul(X,ot),g=Math.imul(X,et),g=g+Math.imul(me,ot)|0,C=Math.imul(me,et),E=E+Math.imul(ue,st)|0,g=g+Math.imul(ue,at)|0,g=g+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,E=E+Math.imul(Ne,ft)|0,g=g+Math.imul(Ne,Xe)|0,g=g+Math.imul(Ve,ft)|0,C=C+Math.imul(Ve,Xe)|0,E=E+Math.imul(pe,ct)|0,g=g+Math.imul(pe,ut)|0,g=g+Math.imul(Ce,ct)|0,C=C+Math.imul(Ce,ut)|0,E=E+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ht)|0,g=g+Math.imul(ve,lt)|0,C=C+Math.imul(ve,ht)|0,E=E+Math.imul(ge,dt)|0,g=g+Math.imul(ge,tt)|0,g=g+Math.imul(re,dt)|0,C=C+Math.imul(re,tt)|0;var Qi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,E=Math.imul(X,st),g=Math.imul(X,at),g=g+Math.imul(me,st)|0,C=Math.imul(me,at),E=E+Math.imul(ue,ft)|0,g=g+Math.imul(ue,Xe)|0,g=g+Math.imul(ie,ft)|0,C=C+Math.imul(ie,Xe)|0,E=E+Math.imul(Ne,ct)|0,g=g+Math.imul(Ne,ut)|0,g=g+Math.imul(Ve,ct)|0,C=C+Math.imul(Ve,ut)|0,E=E+Math.imul(pe,lt)|0,g=g+Math.imul(pe,ht)|0,g=g+Math.imul(Ce,lt)|0,C=C+Math.imul(Ce,ht)|0,E=E+Math.imul(ce,dt)|0,g=g+Math.imul(ce,tt)|0,g=g+Math.imul(ve,dt)|0,C=C+Math.imul(ve,tt)|0;var eo=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(eo>>>26)|0,eo&=67108863,E=Math.imul(X,ft),g=Math.imul(X,Xe),g=g+Math.imul(me,ft)|0,C=Math.imul(me,Xe),E=E+Math.imul(ue,ct)|0,g=g+Math.imul(ue,ut)|0,g=g+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,E=E+Math.imul(Ne,lt)|0,g=g+Math.imul(Ne,ht)|0,g=g+Math.imul(Ve,lt)|0,C=C+Math.imul(Ve,ht)|0,E=E+Math.imul(pe,dt)|0,g=g+Math.imul(pe,tt)|0,g=g+Math.imul(Ce,dt)|0,C=C+Math.imul(Ce,tt)|0;var Co=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Co>>>26)|0,Co&=67108863,E=Math.imul(X,ct),g=Math.imul(X,ut),g=g+Math.imul(me,ct)|0,C=Math.imul(me,ut),E=E+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ht)|0,g=g+Math.imul(ie,lt)|0,C=C+Math.imul(ie,ht)|0,E=E+Math.imul(Ne,dt)|0,g=g+Math.imul(Ne,tt)|0,g=g+Math.imul(Ve,dt)|0,C=C+Math.imul(Ve,tt)|0;var ko=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ko>>>26)|0,ko&=67108863,E=Math.imul(X,lt),g=Math.imul(X,ht),g=g+Math.imul(me,lt)|0,C=Math.imul(me,ht),E=E+Math.imul(ue,dt)|0,g=g+Math.imul(ue,tt)|0,g=g+Math.imul(ie,dt)|0,C=C+Math.imul(ie,tt)|0;var Io=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Io>>>26)|0,Io&=67108863,E=Math.imul(X,dt),g=Math.imul(X,tt),g=g+Math.imul(me,dt)|0,C=Math.imul(me,tt);var Do=(A+E|0)+((g&8191)<<13)|0;return A=(C+(g>>>13)|0)+(Do>>>26)|0,Do&=67108863,_[0]=Cn,_[1]=$t,_[2]=Ft,_[3]=un,_[4]=ln,_[5]=hn,_[6]=Nr,_[7]=dn,_[8]=ei,_[9]=So,_[10]=Mo,_[11]=To,_[12]=Zi,_[13]=Qi,_[14]=eo,_[15]=Co,_[16]=ko,_[17]=Io,_[18]=Do,A!==0&&(_[19]=A,b.length++),b},"comb10MulTo");Math.imul||(I=R);function N(T,h,x){x.negative=h.negative^T.negative,x.length=T.length+h.length;for(var b=0,l=0,m=0;m<x.length-1;m++){var _=l;l=0;for(var A=b&67108863,E=Math.min(m,h.length-1),g=Math.max(0,m-T.length+1);g<=E;g++){var C=m-g,P=T.words[C]|0,w=h.words[g]|0,k=P*w,he=k&67108863;_=_+(k/67108864|0)|0,he=he+A|0,A=he&67108863,_=_+(he>>>26)|0,l+=_>>>26,_&=67108863}x.words[m]=A,b=_,_=l}return b!==0?x.words[m]=b:x.length--,x.strip()}o(N,"bigMulTo");function J(T,h,x){var b=new L;return b.mulp(T,h,x)}o(J,"jumboMulTo"),i.prototype.mulTo=o(function(h,x){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=I(this,h,x):l<63?b=R(this,h,x):l<1024?b=N(this,h,x):b=J(this,h,x),b},"mulTo");function L(T,h){this.x=T,this.y=h}o(L,"FFTM"),L.prototype.makeRBT=o(function(h){for(var x=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)x[l]=this.revBin(l,b,h);return x},"makeRBT"),L.prototype.revBin=o(function(h,x,b){if(h===0||h===b-1)return h;for(var l=0,m=0;m<x;m++)l|=(h&1)<<x-m-1,h>>=1;return l},"revBin"),L.prototype.permute=o(function(h,x,b,l,m,_){for(var A=0;A<_;A++)l[A]=x[h[A]],m[A]=b[h[A]]},"permute"),L.prototype.transform=o(function(h,x,b,l,m,_){this.permute(_,h,x,b,l,m);for(var A=1;A<m;A<<=1)for(var E=A<<1,g=Math.cos(2*Math.PI/E),C=Math.sin(2*Math.PI/E),P=0;P<m;P+=E)for(var w=g,k=C,he=0;he<A;he++){var D=b[P+he],Q=l[P+he],se=b[P+he+A],F=l[P+he+A],$=w*se-k*F;F=w*F+k*se,se=$,b[P+he]=D+se,l[P+he]=Q+F,b[P+he+A]=D-se,l[P+he+A]=Q-F,he!==E&&($=g*w-C*k,k=g*k+C*w,w=$)}},"transform"),L.prototype.guessLen13b=o(function(h,x){var b=Math.max(x,h)|1,l=b&1,m=0;for(b=b/2|0;b;b=b>>>1)m++;return 1<<m+1+l},"guessLen13b"),L.prototype.conjugate=o(function(h,x,b){if(!(b<=1))for(var l=0;l<b/2;l++){var m=h[l];h[l]=h[b-l-1],h[b-l-1]=m,m=x[l],x[l]=-x[b-l-1],x[b-l-1]=-m}},"conjugate"),L.prototype.normalize13b=o(function(h,x){for(var b=0,l=0;l<x/2;l++){var m=Math.round(h[2*l+1]/x)*8192+Math.round(h[2*l]/x)+b;h[l]=m&67108863,m<67108864?b=0:b=m/67108864|0}return h},"normalize13b"),L.prototype.convert13b=o(function(h,x,b,l){for(var m=0,_=0;_<x;_++)m=m+(h[_]|0),b[2*_]=m&8191,m=m>>>13,b[2*_+1]=m&8191,m=m>>>13;for(_=2*x;_<l;++_)b[_]=0;r(m===0),r((m&-8192)===0)},"convert13b"),L.prototype.stub=o(function(h){for(var x=new Array(h),b=0;b<h;b++)x[b]=0;return x},"stub"),L.prototype.mulp=o(function(h,x,b){var l=2*this.guessLen13b(h.length,x.length),m=this.makeRBT(l),_=this.stub(l),A=new Array(l),E=new Array(l),g=new Array(l),C=new Array(l),P=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,A,l),this.convert13b(x.words,x.length,C,l),this.transform(A,_,E,g,l,m),this.transform(C,_,P,w,l,m);for(var he=0;he<l;he++){var D=E[he]*P[he]-g[he]*w[he];g[he]=E[he]*w[he]+g[he]*P[he],E[he]=D}return this.conjugate(E,g,l),this.transform(E,g,k,_,l,m),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^x.negative,b.length=h.length+x.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),this.mulTo(h,x)},"mul"),i.prototype.mulf=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),J(this,h,x)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){r(typeof h=="number"),r(h<67108864);for(var x=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,m=(l&67108863)+(x&67108863);x>>=26,x+=l/67108864|0,x+=m>>>26,this.words[b]=m&67108863}return x!==0&&(this.words[b]=x,this.length++),this},"imuln"),i.prototype.muln=o(function(h){return this.clone().imuln(h)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(h){var x=O(h);if(x.length===0)return new i(1);for(var b=this,l=0;l<x.length&&x[l]===0;l++,b=b.sqr());if(++l<x.length)for(var m=b.sqr();l<x.length;l++,m=m.sqr())x[l]!==0&&(b=b.mul(m));return b},"pow"),i.prototype.iushln=o(function(h){r(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=67108863>>>26-x<<26-x,m;if(x!==0){var _=0;for(m=0;m<this.length;m++){var A=this.words[m]&l,E=(this.words[m]|0)-A<<x;this.words[m]=E|_,_=A>>>26-x}_&&(this.words[m]=_,this.length++)}if(b!==0){for(m=this.length-1;m>=0;m--)this.words[m+b]=this.words[m];for(m=0;m<b;m++)this.words[m]=0;this.length+=b}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return r(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,x,b){r(typeof h=="number"&&h>=0);var l;x?l=(x-x%26)/26:l=0;var m=h%26,_=Math.min((h-m)/26,this.length),A=67108863^67108863>>>m<<m,E=b;if(l-=_,l=Math.max(0,l),E){for(var g=0;g<_;g++)E.words[g]=this.words[g];E.length=_}if(_!==0)if(this.length>_)for(this.length-=_,g=0;g<this.length;g++)this.words[g]=this.words[g+_];else this.words[0]=0,this.length=1;var C=0;for(g=this.length-1;g>=0&&(C!==0||g>=l);g--){var P=this.words[g]|0;this.words[g]=C<<26-m|P>>>m,C=P&A}return E&&C!==0&&(E.words[E.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,x,b){return r(this.negative===0),this.iushrn(h,x,b)},"ishrn"),i.prototype.shln=o(function(h){return this.clone().ishln(h)},"shln"),i.prototype.ushln=o(function(h){return this.clone().iushln(h)},"ushln"),i.prototype.shrn=o(function(h){return this.clone().ishrn(h)},"shrn"),i.prototype.ushrn=o(function(h){return this.clone().iushrn(h)},"ushrn"),i.prototype.testn=o(function(h){r(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return!1;var m=this.words[b];return!!(m&l)},"testn"),i.prototype.imaskn=o(function(h){r(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(x!==0&&b++,this.length=Math.min(b,this.length),x!==0){var l=67108863^67108863>>>x<<x;this.words[this.length-1]&=l}return this.strip()},"imaskn"),i.prototype.maskn=o(function(h){return this.clone().imaskn(h)},"maskn"),i.prototype.iaddn=o(function(h){return r(typeof h=="number"),r(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},"iaddn"),i.prototype._iaddn=o(function(h){this.words[0]+=h;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},"_iaddn"),i.prototype.isubn=o(function(h){if(r(typeof h=="number"),r(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(h){return this.clone().iaddn(h)},"addn"),i.prototype.subn=o(function(h){return this.clone().isubn(h)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(h,x,b){var l=h.length+b,m;this._expand(l);var _,A=0;for(m=0;m<h.length;m++){_=(this.words[m+b]|0)+A;var E=(h.words[m]|0)*x;_-=E&67108863,A=(_>>26)-(E/67108864|0),this.words[m+b]=_&67108863}for(;m<this.length-b;m++)_=(this.words[m+b]|0)+A,A=_>>26,this.words[m+b]=_&67108863;if(A===0)return this.strip();for(r(A===-1),A=0,m=0;m<this.length;m++)_=-(this.words[m]|0)+A,A=_>>26,this.words[m]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,x){var b=this.length-h.length,l=this.clone(),m=h,_=m.words[m.length-1]|0,A=this._countBits(_);b=26-A,b!==0&&(m=m.ushln(b),l.iushln(b),_=m.words[m.length-1]|0);var E=l.length-m.length,g;if(x!=="mod"){g=new i(null),g.length=E+1,g.words=new Array(g.length);for(var C=0;C<g.length;C++)g.words[C]=0}var P=l.clone()._ishlnsubmul(m,1,E);P.negative===0&&(l=P,g&&(g.words[E]=1));for(var w=E-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);g&&(g.words[w]=k)}return g&&g.strip(),l.strip(),x!=="div"&&b!==0&&l.iushrn(b),{div:g||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,x,b){if(r(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,m,_;return this.negative!==0&&h.negative===0?(_=this.neg().divmod(h,x),x!=="mod"&&(l=_.div.neg()),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.iadd(h)),{div:l,mod:m}):this.negative===0&&h.negative!==0?(_=this.divmod(h.neg(),x),x!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),x),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.isub(h)),{div:_.div,mod:m}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?x==="div"?{div:this.divn(h.words[0]),mod:null}:x==="mod"?{div:null,mod:new i(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modn(h.words[0]))}:this._wordDiv(h,x)},"divmod"),i.prototype.div=o(function(h){return this.divmod(h,"div",!1).div},"div"),i.prototype.mod=o(function(h){return this.divmod(h,"mod",!1).mod},"mod"),i.prototype.umod=o(function(h){return this.divmod(h,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(h){var x=this.divmod(h);if(x.mod.isZero())return x.div;var b=x.div.negative!==0?x.mod.isub(h):x.mod,l=h.ushrn(1),m=h.andln(1),_=b.cmp(l);return _<0||m===1&&_===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){r(h<=67108863);for(var x=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(x*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){r(h<=67108863);for(var x=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+x*67108864;this.words[b]=l/h|0,x=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){r(h.negative===0),r(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=new i(0),A=new i(1),E=0;x.isEven()&&b.isEven();)x.iushrn(1),b.iushrn(1),++E;for(var g=b.clone(),C=x.clone();!x.isZero();){for(var P=0,w=1;(x.words[0]&w)===0&&P<26;++P,w<<=1);if(P>0)for(x.iushrn(P);P-- >0;)(l.isOdd()||m.isOdd())&&(l.iadd(g),m.isub(C)),l.iushrn(1),m.iushrn(1);for(var k=0,he=1;(b.words[0]&he)===0&&k<26;++k,he<<=1);if(k>0)for(b.iushrn(k);k-- >0;)(_.isOdd()||A.isOdd())&&(_.iadd(g),A.isub(C)),_.iushrn(1),A.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(_),m.isub(A)):(b.isub(x),_.isub(l),A.isub(m))}return{a:_,b:A,gcd:b.iushln(E)}},"egcd"),i.prototype._invmp=o(function(h){r(h.negative===0),r(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=b.clone();x.cmpn(1)>0&&b.cmpn(1)>0;){for(var A=0,E=1;(x.words[0]&E)===0&&A<26;++A,E<<=1);if(A>0)for(x.iushrn(A);A-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var g=0,C=1;(b.words[0]&C)===0&&g<26;++g,C<<=1);if(g>0)for(b.iushrn(g);g-- >0;)m.isOdd()&&m.iadd(_),m.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(m)):(b.isub(x),m.isub(l))}var P;return x.cmpn(1)===0?P=l:P=m,P.cmpn(0)<0&&P.iadd(h),P},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var x=this.clone(),b=h.clone();x.negative=0,b.negative=0;for(var l=0;x.isEven()&&b.isEven();l++)x.iushrn(1),b.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;b.isEven();)b.iushrn(1);var m=x.cmp(b);if(m<0){var _=x;x=b,b=_}else if(m===0||b.cmpn(1)===0)break;x.isub(b)}while(!0);return b.iushln(l)},"gcd"),i.prototype.invm=o(function(h){return this.egcd(h).a.umod(h)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(h){return this.words[0]&h},"andln"),i.prototype.bincn=o(function(h){r(typeof h=="number");var x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var m=l,_=b;m!==0&&_<this.length;_++){var A=this.words[_]|0;A+=m,m=A>>>26,A&=67108863,this.words[_]=A}return m!==0&&(this.words[_]=m,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(h){var x=h<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this.strip();var b;if(this.length>1)b=1;else{x&&(h=-h),r(h<=67108863,"Number is too big");var l=this.words[0]|0;b=l===h?0:l<h?-1:1}return this.negative!==0?-b|0:b},"cmpn"),i.prototype.cmp=o(function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var x=this.ucmp(h);return this.negative!==0?-x|0:x},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var x=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,m=h.words[b]|0;if(l!==m){l<m?x=-1:l>m&&(x=1);break}}return x},"ucmp"),i.prototype.gtn=o(function(h){return this.cmpn(h)===1},"gtn"),i.prototype.gt=o(function(h){return this.cmp(h)===1},"gt"),i.prototype.gten=o(function(h){return this.cmpn(h)>=0},"gten"),i.prototype.gte=o(function(h){return this.cmp(h)>=0},"gte"),i.prototype.ltn=o(function(h){return this.cmpn(h)===-1},"ltn"),i.prototype.lt=o(function(h){return this.cmp(h)===-1},"lt"),i.prototype.lten=o(function(h){return this.cmpn(h)<=0},"lten"),i.prototype.lte=o(function(h){return this.cmp(h)<=0},"lte"),i.prototype.eqn=o(function(h){return this.cmpn(h)===0},"eqn"),i.prototype.eq=o(function(h){return this.cmp(h)===0},"eq"),i.red=o(function(h){return new j(h)},"red"),i.prototype.toRed=o(function(h){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"toRed"),i.prototype.fromRed=o(function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return r(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 r(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 r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(h){return r(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var V={k256:null,p224:null,p192:null,p25519:null};function Z(T,h){this.name=T,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(Z,"MPrime"),Z.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),Z.prototype.ireduce=o(function(h){var x=h,b;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),b=x.bitLength();while(b>this.n);var l=b<this.n?-1:x.ucmp(this.p);return l===0?(x.words[0]=0,x.length=1):l>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},"ireduce"),Z.prototype.split=o(function(h,x){h.iushrn(this.n,0,x)},"split"),Z.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Y(){Z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Y,"K256"),n(Y,Z),Y.prototype.split=o(function(h,x){for(var b=4194303,l=Math.min(h.length,9),m=0;m<l;m++)x.words[m]=h.words[m];if(x.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(x.words[x.length++]=_&b,m=10;m<h.length;m++){var A=h.words[m]|0;h.words[m-10]=(A&b)<<4|_>>>22,_=A}_>>>=22,h.words[m-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},"split"),Y.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var x=0,b=0;b<h.length;b++){var l=h.words[b]|0;x+=l*977,h.words[b]=x&67108863,x=l*64+(x/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function oe(){Z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(oe,"P224"),n(oe,Z);function K(){Z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(K,"P192"),n(K,Z);function q(){Z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(q,"P25519"),n(q,Z),q.prototype.imulK=o(function(h){for(var x=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+x,m=l&67108863;l>>>=26,h.words[b]=m,x=l}return x!==0&&(h.words[h.length++]=x),h},"imulK"),i._prime=o(function(h){if(V[h])return V[h];var x;if(h==="k256")x=new Y;else if(h==="p224")x=new oe;else if(h==="p192")x=new K;else if(h==="p25519")x=new q;else throw new Error("Unknown prime "+h);return V[h]=x,x},"prime");function j(T){if(typeof T=="string"){var h=i._prime(T);this.m=h.p,this.prime=h}else r(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}o(j,"Red"),j.prototype._verify1=o(function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},"_verify1"),j.prototype._verify2=o(function(h,x){r((h.negative|x.negative)===0,"red works only with positives"),r(h.red&&h.red===x.red,"red works only with red numbers")},"_verify2"),j.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),j.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),j.prototype.add=o(function(h,x){this._verify2(h,x);var b=h.add(x);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),j.prototype.iadd=o(function(h,x){this._verify2(h,x);var b=h.iadd(x);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),j.prototype.sub=o(function(h,x){this._verify2(h,x);var b=h.sub(x);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),j.prototype.isub=o(function(h,x){this._verify2(h,x);var b=h.isub(x);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),j.prototype.shl=o(function(h,x){return this._verify1(h),this.imod(h.ushln(x))},"shl"),j.prototype.imul=o(function(h,x){return this._verify2(h,x),this.imod(h.imul(x))},"imul"),j.prototype.mul=o(function(h,x){return this._verify2(h,x),this.imod(h.mul(x))},"mul"),j.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),j.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),j.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var x=this.m.andln(3);if(r(x%2===1),x===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var l=this.m.subn(1),m=0;!l.isZero()&&l.andln(1)===0;)m++,l.iushrn(1);r(!l.isZero());var _=new i(1).toRed(this),A=_.redNeg(),E=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new i(2*g*g).toRed(this);this.pow(g,E).cmp(A)!==0;)g.redIAdd(A);for(var C=this.pow(g,l),P=this.pow(h,l.addn(1).iushrn(1)),w=this.pow(h,l),k=m;w.cmp(_)!==0;){for(var he=w,D=0;he.cmp(_)!==0;D++)he=he.redSqr();r(D<k);var Q=this.pow(C,new i(1).iushln(k-D-1));P=P.redMul(Q),C=Q.redSqr(),w=w.redMul(C),k=D}return P},"sqrt"),j.prototype.invm=o(function(h){var x=h._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},"invm"),j.prototype.pow=o(function(h,x){if(x.isZero())return new i(1).toRed(this);if(x.cmpn(1)===0)return h.clone();var b=4,l=new Array(1<<b);l[0]=new i(1).toRed(this),l[1]=h;for(var m=2;m<l.length;m++)l[m]=this.mul(l[m-1],h);var _=l[0],A=0,E=0,g=x.bitLength()%26;for(g===0&&(g=26),m=x.length-1;m>=0;m--){for(var C=x.words[m],P=g-1;P>=0;P--){var w=C>>P&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&A===0){E=0;continue}A<<=1,A|=w,E++,!(E!==b&&(m!==0||P!==0))&&(_=this.mul(_,l[A]),E=0,A=0)}g=26}return _},"pow"),j.prototype.convertTo=o(function(h){var x=h.umod(this.m);return x===h?x.clone():x},"convertTo"),j.prototype.convertFrom=o(function(h){var x=h.clone();return x.red=null,x},"convertFrom"),i.mont=o(function(h){return new le(h)},"mont");function le(T){j.call(this,T),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(le,"Mont"),n(le,j),le.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),le.prototype.convertFrom=o(function(h){var x=this.imod(h.mul(this.rinv));return x.red=null,x},"convertFrom"),le.prototype.imul=o(function(h,x){if(h.isZero()||x.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"imul"),le.prototype.mul=o(function(h,x){if(h.isZero()||x.isZero())return new i(0)._forceRed(this);var b=h.mul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"mul"),le.prototype.invm=o(function(h){var x=this.imod(h._invmp(this.m).mul(this.r2));return x._forceRed(this)},"invm")})(typeof Km>"u"||Km,p3)});var Ts=De((MK,b3)=>{b3.exports=m3;function m3(t,e){if(!t)throw new Error(e||"Assertion failed")}o(m3,"assert");m3.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual")});var jm=De(y3=>{"use strict";var Bh=y3;function fO(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t!="string"){for(var n=0;n<t.length;n++)r[n]=t[n]|0;return r}if(e==="hex"){t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),a=i>>8,c=i&255;a?r.push(a,c):r.push(c)}return r}o(fO,"toArray");Bh.toArray=fO;function g3(t){return t.length===1?"0"+t:t}o(g3,"zero2");Bh.zero2=g3;function v3(t){for(var e="",r=0;r<t.length;r++)e+=g3(t[r].toString(16));return e}o(v3,"toHex");Bh.toHex=v3;Bh.encode=o(function(e,r){return r==="hex"?v3(e):e},"encode")});var Ln=De(x3=>{"use strict";var Li=x3,cO=io(),uO=Ts(),Uh=jm();Li.assert=uO;Li.toArray=Uh.toArray;Li.zero2=Uh.zero2;Li.toHex=Uh.toHex;Li.encode=Uh.encode;function lO(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,a=t.clone(),c=0;c<n.length;c++){var u,d=a.andln(i-1);a.isOdd()?(d>(i>>1)-1?u=(i>>1)-d:u=d,a.isubn(u)):u=0,n[c]=u,a.iushrn(1)}return n}o(lO,"getNAF");Li.getNAF=lO;function hO(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0,a;t.cmpn(-n)>0||e.cmpn(-i)>0;){var c=t.andln(3)+n&3,u=e.andln(3)+i&3;c===3&&(c=-1),u===3&&(u=-1);var d;(c&1)===0?d=0:(a=t.andln(7)+n&7,(a===3||a===5)&&u===2?d=-c:d=c),r[0].push(d);var v;(u&1)===0?v=0:(a=e.andln(7)+i&7,(a===3||a===5)&&c===2?v=-u:v=u),r[1].push(v),2*n===d+1&&(n=1-n),2*i===v+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}o(hO,"getJSF");Li.getJSF=hO;function dO(t,e,r){var n="_"+e;t.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)},"cachedProperty")}o(dO,"cachedProperty");Li.cachedProperty=dO;function pO(t){return typeof t=="string"?Li.toArray(t,"hex"):t}o(pO,"parseBytes");Li.parseBytes=pO;function mO(t){return new cO(t,"hex","le")}o(mO,"intFromLE");Li.intFromLE=mO});var Jm=De((kK,Wm)=>{var Gm;Wm.exports=o(function(e){return Gm||(Gm=new Cs(null)),Gm.generate(e)},"rand");function Cs(t){this.rand=t}o(Cs,"Rand");Wm.exports.Rand=Cs;Cs.prototype.generate=o(function(e){return this._rand(e)},"generate");Cs.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n<r.length;n++)r[n]=this.rand.getByte();return r},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Cs.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Cs.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r},"_rand"):typeof window=="object"&&(Cs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(Vm=require("crypto"),typeof Vm.randomBytes!="function")throw new Error("Not supported");Cs.prototype._rand=o(function(e){return Vm.randomBytes(e)},"_rand")}catch{}var Vm});var pu=De((IK,w3)=>{"use strict";var Sa=io(),du=Ln(),$h=du.getNAF,bO=du.getJSF,Fh=du.assert;function ks(t,e){this.type=t,this.p=new Sa(e.p,16),this.red=e.prime?Sa.red(e.prime):Sa.mont(this.p),this.zero=new Sa(0).toRed(this.red),this.one=new Sa(1).toRed(this.red),this.two=new Sa(2).toRed(this.red),this.n=e.n&&new Sa(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(ks,"BaseCurve");w3.exports=ks;ks.prototype.point=o(function(){throw new Error("Not implemented")},"point");ks.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");ks.prototype._fixedNafMul=o(function(e,r){Fh(e.precomputed);var n=e._getDoubles(),i=$h(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],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];c.push(d)}for(var y=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)d=c[u],d===O?S=S.mixedAdd(n.points[u]):d===-O&&(S=S.mixedAdd(n.points[u].neg()));y=y.add(S)}return y.toP()},"_fixedNafMul");ks.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=$h(r,n,this._bitLength),u=this.jpoint(null,null,null),d=c.length-1;d>=0;d--){for(var v=0;d>=0&&c[d]===0;d--)v++;if(d>=0&&v++,u=u.dblp(v),d<0)break;var y=c[d];Fh(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(a[y-1>>1]):u=u.mixedAdd(a[-y-1>>1].neg()):y>0?u=u.add(a[y-1>>1]):u=u.add(a[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");ks.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,d=this._wnafT3,v=0,y,S,O;for(y=0;y<i;y++){O=r[y];var R=O._getNAFPoints(e);c[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,N=y;if(c[I]!==1||c[N]!==1){d[I]=$h(n[I],c[I],this._bitLength),d[N]=$h(n[N],c[N],this._bitLength),v=Math.max(d[I].length,v),v=Math.max(d[N].length,v);continue}var J=[r[I],null,null,r[N]];r[I].y.cmp(r[N].y)===0?(J[1]=r[I].add(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg())):r[I].y.cmp(r[N].y.redNeg())===0?(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].add(r[N].neg())):(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],V=bO(n[I],n[N]);for(v=Math.max(V[0].length,v),d[I]=new Array(v),d[N]=new Array(v),S=0;S<v;S++){var Z=V[0][S]|0,Y=V[1][S]|0;d[I][S]=L[(Z+1)*3+(Y+1)],d[N][S]=0,u[I]=J}}var oe=this.jpoint(null,null,null),K=this._wnafT4;for(y=v;y>=0;y--){for(var q=0;y>=0;){var j=!0;for(S=0;S<i;S++)K[S]=d[S][y]|0,K[S]!==0&&(j=!1);if(!j)break;q++,y--}if(y>=0&&q++,oe=oe.dblp(q),y<0)break;for(S=0;S<i;S++){var le=K[S];le!==0&&(le>0?O=u[S][le-1>>1]:le<0&&(O=u[S][-le-1>>1].neg()),O.type==="affine"?oe=oe.mixedAdd(O):oe=oe.add(O))}}for(y=0;y<i;y++)u[y]=null;return a?oe:oe.toP()},"_wnafMulAdd");function hi(t,e){this.curve=t,this.type=e,this.precomputed=null}o(hi,"BasePoint");ks.BasePoint=hi;hi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");hi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");ks.prototype.decodePoint=o(function(e,r){e=du.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Fh(e[e.length-1]%2===0):e[0]===7&&Fh(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");hi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");hi.prototype._encode=o(function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode");hi.prototype.encode=o(function(e,r){return du.encode(this._encode(r),e)},"encode");hi.prototype.precompute=o(function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},"precompute");hi.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},"_hasDoubles");hi.prototype._getDoubles=o(function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=e){for(var c=0;c<e;c++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");hi.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:e,points:r}},"_getNAFPoints");hi.prototype._getBeta=o(function(){return null},"_getBeta");hi.prototype.dblp=o(function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r},"dblp")});var mu=De((DK,Ym)=>{typeof Object.create=="function"?Ym.exports=o(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Ym.exports=o(function(e,r){if(r){e.super_=r;var n=o(function(){},"TempCtor");n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var E3=De((OK,_3)=>{"use strict";var gO=Ln(),ur=io(),Xm=mu(),$f=pu(),vO=gO.assert;function di(t){$f.call(this,"short",t),this.a=new ur(t.a,16).toRed(this.red),this.b=new ur(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(di,"ShortCurve");Xm(di,$f);_3.exports=di;di.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ur(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new ur(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],vO(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new ur(u.a,16),b:new ur(u.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism");di.prototype._getEndoRoots=o(function(e){var r=e===this.p?this.red:ur.mont(e),n=new ur(2).toRed(r).redInvm(),i=n.redNeg(),a=new ur(3).toRed(r).redNeg().redSqrt().redMul(n),c=i.redAdd(a).fromRed(),u=i.redSub(a).fromRed();return[c,u]},"_getEndoRoots");di.prototype._getEndoBasis=o(function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),a=new ur(1),c=new ur(0),u=new ur(0),d=new ur(1),v,y,S,O,R,I,N,J=0,L,V;n.cmpn(0)!==0;){var Z=i.div(n);L=i.sub(Z.mul(n)),V=u.sub(Z.mul(a));var Y=d.sub(Z.mul(c));if(!S&&L.cmp(r)<0)v=N.neg(),y=a,S=L.neg(),O=V;else if(S&&++J===2)break;N=L,i=n,n=L,u=a,a=V,d=c,c=Y}R=L.neg(),I=V;var oe=S.sqr().add(O.sqr()),K=R.sqr().add(I.sqr());return K.cmp(oe)>=0&&(R=v,I=y),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:S,b:O},{a:R,b:I}]},"_getEndoBasis");di.prototype._endoSplit=o(function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),c=n.b.neg().mul(e).divRound(this.n),u=a.mul(n.a),d=c.mul(i.a),v=a.mul(n.b),y=c.mul(i.b),S=e.sub(u).sub(d),O=v.add(y).neg();return{k1:S,k2:O}},"_endoSplit");di.prototype.pointFromX=o(function(e,r){e=new ur(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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");di.prototype.validate=o(function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},"validate");di.prototype._endoWnafMulAdd=o(function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var u=this._endoSplit(r[c]),d=e[c],v=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=d,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return y},"_endoWnafMulAdd");function Sr(t,e,r,n){$f.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ur(e,16),this.y=new ur(r,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(Sr,"Point");Xm(Sr,$f.BasePoint);di.prototype.point=o(function(e,r,n){return new Sr(this,e,r,n)},"point");di.prototype.pointFromJSON=o(function(e,r){return Sr.fromJSON(this,e,r)},"pointFromJSON");Sr.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(a){return n.point(a.x.redMul(n.endo.beta),a.y)},"endoMul");e.beta=r,r.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 r}},"_getBeta");Sr.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");Sr.fromJSON=o(function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function a(u){return e.point(u[0],u[1],n)}o(a,"obj2point");var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(a))}},i},"fromJSON");Sr.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");Sr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Sr.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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Sr.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),c=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,u)},"dbl");Sr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Sr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Sr.prototype.mul=o(function(e){return e=new ur(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");Sr.prototype.mulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},"mulAdd");Sr.prototype.jmulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)},"jmulAdd");Sr.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");Sr.prototype.neg=o(function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(a){return a.neg()},"negate");r.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 r},"neg");Sr.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 Lr(t,e,r,n){$f.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ur(0)):(this.x=new ur(e,16),this.y=new ur(r,16),this.z=new ur(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(Lr,"JPoint");Xm(Lr,$f.BasePoint);di.prototype.jpoint=o(function(e,r,n){return new Lr(this,e,r,n)},"jpoint");Lr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)},"toP");Lr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Lr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(a),v=c.redSub(u);if(d.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),S=y.redMul(d),O=i.redMul(y),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(c.redMul(S)),N=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,N)},"add");Lr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,c=e.y.redMul(r).redMul(this.z),u=n.redSub(i),d=a.redSub(c);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),y=v.redMul(u),S=n.redMul(v),O=d.redSqr().redIAdd(y).redISub(S).redISub(S),R=d.redMul(S.redISub(O)).redISub(a.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");Lr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,c=this.x,u=this.y,d=this.z,v=d.redSqr().redSqr(),y=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=y.redSqr(),R=O.redSqr(),I=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),N=c.redMul(O),J=I.redSqr().redISub(N.redAdd(N)),L=N.redISub(J),V=I.redMul(L);V=V.redIAdd(V).redISub(R);var Z=y.redMul(d);r+1<e&&(v=v.redMul(R)),c=J,d=Z,y=V}return this.curve.jpoint(c,y.redMul(a),d)},"dblp");Lr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Lr.prototype._zeroDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),v=d.redSqr().redISub(u).redISub(u),y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),e=v,r=d.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(S).redISub(R);I=I.redIAdd(I);var N=S.redAdd(S).redIAdd(S),J=N.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=J.redISub(I).redISub(I),r=N.redMul(I.redISub(e)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)},"_zeroDbl");Lr.prototype._threeDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);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 y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),r=d.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(S).redMul(this.x.redAdd(S));I=I.redAdd(I).redIAdd(I);var N=R.redIAdd(R);N=N.redIAdd(N);var J=N.redAdd(N);e=I.redSqr().redISub(J),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(S);var L=O.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),r=I.redMul(N.redISub(e)).redISub(L)}return this.curve.jpoint(e,r,n)},"_threeDbl");Lr.prototype._dbl=o(function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),c=r.redSqr(),u=n.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var y=v.redMul(u),S=d.redSqr().redISub(y.redAdd(y)),O=y.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),N=n.redAdd(n).redMul(i);return this.curve.jpoint(S,I,N)},"_dbl");Lr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(c);var d=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var y=a.redIAdd(u).redSqr().redISub(c).redISub(d).redISub(v),S=r.redMul(y);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(d).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(v.redISub(y)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");Lr.prototype.mul=o(function(e,r){return e=new ur(e,r),this.curve._wnafMul(this,e)},"mul");Lr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Lr.prototype.eqXToP=o(function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},"eqXToP");Lr.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");Lr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var M3=De((RK,S3)=>{"use strict";var Ff=io(),A3=mu(),qh=pu(),yO=Ln();function qf(t){qh.call(this,"mont",t),this.a=new Ff(t.a,16).toRed(this.red),this.b=new Ff(t.b,16).toRed(this.red),this.i4=new Ff(4).toRed(this.red).redInvm(),this.two=new Ff(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(qf,"MontCurve");A3(qf,qh);S3.exports=qf;qf.prototype.validate=o(function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0},"validate");function Mr(t,e,r){qh.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Ff(e,16),this.z=new Ff(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(Mr,"Point");A3(Mr,qh.BasePoint);qf.prototype.decodePoint=o(function(e,r){return this.point(yO.toArray(e,r),1)},"decodePoint");qf.prototype.point=o(function(e,r){return new Mr(this,e,r)},"point");qf.prototype.pointFromJSON=o(function(e){return Mr.fromJSON(this,e)},"pointFromJSON");Mr.prototype.precompute=o(function(){},"precompute");Mr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Mr.fromJSON=o(function(e,r){return new Mr(e,r[0],r[1]||e.one)},"fromJSON");Mr.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");Mr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Mr.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),c=r.redMul(i),u=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(c,u)},"dbl");Mr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Mr.prototype.diffAdd=o(function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z),u=c.redMul(n),d=a.redMul(i),v=r.z.redMul(u.redAdd(d).redSqr()),y=r.x.redMul(u.redISub(d).redSqr());return this.curve.point(v,y)},"diffAdd");Mr.prototype.mul=o(function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,c=[];r.cmpn(0)!==0;r.iushrn(1))c.push(r.andln(1));for(var u=c.length-1;u>=0;u--)c[u]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i},"mul");Mr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Mr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Mr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Mr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Mr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var k3=De((NK,C3)=>{"use strict";var xO=Ln(),zo=io(),T3=mu(),Hh=pu(),wO=xO.assert;function oo(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Hh.call(this,"edwards",t),this.a=new zo(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new zo(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new zo(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),wO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}o(oo,"EdwardsCurve");T3(oo,Hh);C3.exports=oo;oo.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");oo.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");oo.prototype.jpoint=o(function(e,r,n,i){return this.point(e,r,n,i)},"jpoint");oo.prototype.pointFromX=o(function(e,r){e=new zo(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),c=i.redMul(a.redInvm()),u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(r&&!d||!r&&d)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");oo.prototype.pointFromY=o(function(e,r){e=new zo(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),c=i.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)},"pointFromY");oo.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0},"validate");function tr(t,e,r,n,i){Hh.BasePoint.call(this,t,"projective"),e===null&&r===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 zo(e,16),this.y=new zo(r,16),this.z=n?new zo(n,16):this.curve.one,this.t=i&&new zo(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(tr,"Point");T3(tr,Hh.BasePoint);oo.prototype.pointFromJSON=o(function(e){return tr.fromJSON(this,e)},"pointFromJSON");oo.prototype.point=o(function(e,r,n,i){return new tr(this,e,r,n,i)},"point");tr.fromJSON=o(function(e,r){return new tr(e,r[0],r[1],r[2])},"fromJSON");tr.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");tr.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");tr.prototype._extDbl=o(function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),c=i.redAdd(r),u=c.redSub(n),d=i.redSub(r),v=a.redMul(u),y=c.redMul(d),S=a.redMul(d),O=u.redMul(c);return this.curve.point(v,y,O,S)},"_extDbl");tr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,c,u,d,v;if(this.curve.twisted){u=this.curve._mulA(r);var y=u.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(y.redSub(this.curve.two)),a=y.redMul(u.redSub(n)),c=y.redSqr().redSub(y).redSub(y)):(d=this.z.redSqr(),v=y.redSub(d).redISub(d),i=e.redSub(r).redISub(n).redMul(v),a=y.redMul(u.redSub(n)),c=y.redMul(v))}else u=r.redAdd(n),d=this.curve._mulC(this.z).redSqr(),v=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(v),a=this.curve._mulC(u).redMul(r.redISub(n)),c=u.redMul(v);return this.curve.point(i,a,c)},"_projDbl");tr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");tr.prototype._extAdd=o(function(e){var r=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),a=this.z.redMul(e.z.redAdd(e.z)),c=n.redSub(r),u=a.redSub(i),d=a.redAdd(i),v=n.redAdd(r),y=c.redMul(u),S=d.redMul(v),O=c.redMul(v),R=u.redMul(d);return this.curve.point(y,S,R,O)},"_extAdd");tr.prototype._projAdd=o(function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(i).redMul(a),u=n.redSub(c),d=n.redAdd(c),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),y=r.redMul(u).redMul(v),S,O;return this.curve.twisted?(S=r.redMul(d).redMul(a.redSub(this.curve._mulA(i))),O=u.redMul(d)):(S=r.redMul(d).redMul(a.redSub(i)),O=this.curve._mulC(u).redMul(d)),this.curve.point(y,S,O)},"_projAdd");tr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");tr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");tr.prototype.mulAdd=o(function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)},"mulAdd");tr.prototype.jmulAdd=o(function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)},"jmulAdd");tr.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");tr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");tr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");tr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");tr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");tr.prototype.eqXToP=o(function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===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(r.redIAdd(i),this.x.cmp(r)===0)return!0}},"eqXToP");tr.prototype.toP=tr.prototype.normalize;tr.prototype.mixedAdd=tr.prototype.add});var Zm=De(I3=>{"use strict";var zh=I3;zh.base=pu();zh.short=E3();zh.mont=M3();zh.edwards=k3()});var Bi=De(Qt=>{"use strict";var _O=Ts(),EO=mu();Qt.inherits=EO;function AO(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}o(AO,"isSurrogatePair");function SO(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=a&63|128):AO(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}o(SO,"toArray");Qt.toArray=SO;function MO(t){for(var e="",r=0;r<t.length;r++)e+=O3(t[r].toString(16));return e}o(MO,"toHex");Qt.toHex=MO;function D3(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}o(D3,"htonl");Qt.htonl=D3;function TO(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=D3(i)),r+=R3(i.toString(16))}return r}o(TO,"toHex32");Qt.toHex32=TO;function O3(t){return t.length===1?"0"+t:t}o(O3,"zero2");Qt.zero2=O3;function R3(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}o(R3,"zero8");Qt.zero8=R3;function CO(t,e,r,n){var i=r-e;_O(i%4===0);for(var a=new Array(i/4),c=0,u=e;c<a.length;c++,u+=4){var d;n==="big"?d=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:d=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],a[c]=d>>>0}return a}o(CO,"join32");Qt.join32=CO;function kO(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var a=t[n];e==="big"?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}o(kO,"split32");Qt.split32=kO;function IO(t,e){return t>>>e|t<<32-e}o(IO,"rotr32");Qt.rotr32=IO;function DO(t,e){return t<<e|t>>>32-e}o(DO,"rotl32");Qt.rotl32=DO;function OO(t,e){return t+e>>>0}o(OO,"sum32");Qt.sum32=OO;function RO(t,e,r){return t+e+r>>>0}o(RO,"sum32_3");Qt.sum32_3=RO;function NO(t,e,r,n){return t+e+r+n>>>0}o(NO,"sum32_4");Qt.sum32_4=NO;function PO(t,e,r,n,i){return t+e+r+n+i>>>0}o(PO,"sum32_5");Qt.sum32_5=PO;function LO(t,e,r,n){var i=t[e],a=t[e+1],c=n+a>>>0,u=(c<n?1:0)+r+i;t[e]=u>>>0,t[e+1]=c}o(LO,"sum64");Qt.sum64=LO;function BO(t,e,r,n){var i=e+n>>>0,a=(i<e?1:0)+t+r;return a>>>0}o(BO,"sum64_hi");Qt.sum64_hi=BO;function UO(t,e,r,n){var i=e+n;return i>>>0}o(UO,"sum64_lo");Qt.sum64_lo=UO;function $O(t,e,r,n,i,a,c,u){var d=0,v=e;v=v+n>>>0,d+=v<e?1:0,v=v+a>>>0,d+=v<a?1:0,v=v+u>>>0,d+=v<u?1:0;var y=t+r+i+c+d;return y>>>0}o($O,"sum64_4_hi");Qt.sum64_4_hi=$O;function FO(t,e,r,n,i,a,c,u){var d=e+n+a+u;return d>>>0}o(FO,"sum64_4_lo");Qt.sum64_4_lo=FO;function qO(t,e,r,n,i,a,c,u,d,v){var y=0,S=e;S=S+n>>>0,y+=S<e?1:0,S=S+a>>>0,y+=S<a?1:0,S=S+u>>>0,y+=S<u?1:0,S=S+v>>>0,y+=S<v?1:0;var O=t+r+i+c+d+y;return O>>>0}o(qO,"sum64_5_hi");Qt.sum64_5_hi=qO;function HO(t,e,r,n,i,a,c,u,d,v){var y=e+n+a+u+v;return y>>>0}o(HO,"sum64_5_lo");Qt.sum64_5_lo=HO;function zO(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}o(zO,"rotr64_hi");Qt.rotr64_hi=zO;function KO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(KO,"rotr64_lo");Qt.rotr64_lo=KO;function jO(t,e,r){return t>>>r}o(jO,"shr64_hi");Qt.shr64_hi=jO;function GO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(GO,"shr64_lo");Qt.shr64_lo=GO});var Hf=De(P3=>{"use strict";var N3=Bi(),VO=Ts();function Kh(){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(Kh,"BlockHash");P3.BlockHash=Kh;Kh.prototype.update=o(function(e,r){if(e=N3.toArray(e,r),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=N3.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");Kh.prototype.digest=o(function(e){return this.update(this._pad()),VO(this.pending===null),this._digest(e)},"digest");Kh.prototype._pad=o(function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var a=1;a<n;a++)i[a]=0;if(e<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)i[a++]=0;i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=e>>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,c=8;c<this.padLength;c++)i[a++]=0;return i},"pad")});var Qm=De(Ko=>{"use strict";var WO=Bi(),so=WO.rotr32;function JO(t,e,r,n){if(t===0)return L3(e,r,n);if(t===1||t===3)return U3(e,r,n);if(t===2)return B3(e,r,n)}o(JO,"ft_1");Ko.ft_1=JO;function L3(t,e,r){return t&e^~t&r}o(L3,"ch32");Ko.ch32=L3;function B3(t,e,r){return t&e^t&r^e&r}o(B3,"maj32");Ko.maj32=B3;function U3(t,e,r){return t^e^r}o(U3,"p32");Ko.p32=U3;function YO(t){return so(t,2)^so(t,13)^so(t,22)}o(YO,"s0_256");Ko.s0_256=YO;function XO(t){return so(t,6)^so(t,11)^so(t,25)}o(XO,"s1_256");Ko.s1_256=XO;function ZO(t){return so(t,7)^so(t,18)^t>>>3}o(ZO,"g0_256");Ko.g0_256=ZO;function QO(t){return so(t,17)^so(t,19)^t>>>10}o(QO,"g1_256");Ko.g1_256=QO});var q3=De(($K,F3)=>{"use strict";var zf=Bi(),eR=Hf(),tR=Qm(),e1=zf.rotl32,bu=zf.sum32,rR=zf.sum32_5,nR=tR.ft_1,$3=eR.BlockHash,iR=[1518500249,1859775393,2400959708,3395469782];function ao(){if(!(this instanceof ao))return new ao;$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(ao,"SHA1");zf.inherits(ao,$3);F3.exports=ao;ao.blockSize=512;ao.outSize=160;ao.hmacStrength=80;ao.padLength=64;ao.prototype._update=o(function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=e1(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var a=this.h[0],c=this.h[1],u=this.h[2],d=this.h[3],v=this.h[4];for(i=0;i<n.length;i++){var y=~~(i/20),S=rR(e1(a,5),nR(y,c,u,d),v,n[i],iR[y]);v=d,d=u,u=e1(c,30),c=a,a=S}this.h[0]=bu(this.h[0],a),this.h[1]=bu(this.h[1],c),this.h[2]=bu(this.h[2],u),this.h[3]=bu(this.h[3],d),this.h[4]=bu(this.h[4],v)},"_update");ao.prototype._digest=o(function(e){return e==="hex"?zf.toHex32(this.h,"big"):zf.split32(this.h,"big")},"digest")});var t1=De((FK,z3)=>{"use strict";var Kf=Bi(),oR=Hf(),jf=Qm(),sR=Ts(),Ui=Kf.sum32,aR=Kf.sum32_4,fR=Kf.sum32_5,cR=jf.ch32,uR=jf.maj32,lR=jf.s0_256,hR=jf.s1_256,dR=jf.g0_256,pR=jf.g1_256,H3=oR.BlockHash,mR=[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 fo(){if(!(this instanceof fo))return new fo;H3.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=mR,this.W=new Array(64)}o(fo,"SHA256");Kf.inherits(fo,H3);z3.exports=fo;fo.blockSize=512;fo.outSize=256;fo.hmacStrength=192;fo.padLength=64;fo.prototype._update=o(function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=aR(pR(n[i-2]),n[i-7],dR(n[i-15]),n[i-16]);var a=this.h[0],c=this.h[1],u=this.h[2],d=this.h[3],v=this.h[4],y=this.h[5],S=this.h[6],O=this.h[7];for(sR(this.k.length===n.length),i=0;i<n.length;i++){var R=fR(O,hR(v),cR(v,y,S),this.k[i],n[i]),I=Ui(lR(a),uR(a,c,u));O=S,S=y,y=v,v=Ui(d,R),d=u,u=c,c=a,a=Ui(R,I)}this.h[0]=Ui(this.h[0],a),this.h[1]=Ui(this.h[1],c),this.h[2]=Ui(this.h[2],u),this.h[3]=Ui(this.h[3],d),this.h[4]=Ui(this.h[4],v),this.h[5]=Ui(this.h[5],y),this.h[6]=Ui(this.h[6],S),this.h[7]=Ui(this.h[7],O)},"_update");fo.prototype._digest=o(function(e){return e==="hex"?Kf.toHex32(this.h,"big"):Kf.split32(this.h,"big")},"digest")});var G3=De((qK,j3)=>{"use strict";var r1=Bi(),K3=t1();function jo(){if(!(this instanceof jo))return new jo;K3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(jo,"SHA224");r1.inherits(jo,K3);j3.exports=jo;jo.blockSize=512;jo.outSize=224;jo.hmacStrength=192;jo.padLength=64;jo.prototype._digest=o(function(e){return e==="hex"?r1.toHex32(this.h.slice(0,7),"big"):r1.split32(this.h.slice(0,7),"big")},"digest")});var o1=De((HK,Y3)=>{"use strict";var vn=Bi(),bR=Hf(),gR=Ts(),co=vn.rotr64_hi,uo=vn.rotr64_lo,V3=vn.shr64_hi,W3=vn.shr64_lo,Is=vn.sum64,n1=vn.sum64_hi,i1=vn.sum64_lo,vR=vn.sum64_4_hi,yR=vn.sum64_4_lo,xR=vn.sum64_5_hi,wR=vn.sum64_5_lo,J3=bR.BlockHash,_R=[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 $i(){if(!(this instanceof $i))return new $i;J3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=_R,this.W=new Array(160)}o($i,"SHA512");vn.inherits($i,J3);Y3.exports=$i;$i.blockSize=1024;$i.outSize=512;$i.hmacStrength=192;$i.padLength=128;$i.prototype._prepareBlock=o(function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var a=RR(n[i-4],n[i-3]),c=NR(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],v=DR(n[i-30],n[i-29]),y=OR(n[i-30],n[i-29]),S=n[i-32],O=n[i-31];n[i]=vR(a,c,u,d,v,y,S,O),n[i+1]=yR(a,c,u,d,v,y,S,O)}},"_prepareBlock");$i.prototype._update=o(function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],a=this.h[1],c=this.h[2],u=this.h[3],d=this.h[4],v=this.h[5],y=this.h[6],S=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],N=this.h[11],J=this.h[12],L=this.h[13],V=this.h[14],Z=this.h[15];gR(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var oe=V,K=Z,q=kR(O,R),j=IR(O,R),le=ER(O,R,I,N,J,L),T=AR(O,R,I,N,J,L),h=this.k[Y],x=this.k[Y+1],b=n[Y],l=n[Y+1],m=xR(oe,K,q,j,le,T,h,x,b,l),_=wR(oe,K,q,j,le,T,h,x,b,l);oe=TR(i,a),K=CR(i,a),q=SR(i,a,c,u,d,v),j=MR(i,a,c,u,d,v);var A=n1(oe,K,q,j),E=i1(oe,K,q,j);V=J,Z=L,J=I,L=N,I=O,N=R,O=n1(y,S,m,_),R=i1(S,S,m,_),y=d,S=v,d=c,v=u,c=i,u=a,i=n1(m,_,A,E),a=i1(m,_,A,E)}Is(this.h,0,i,a),Is(this.h,2,c,u),Is(this.h,4,d,v),Is(this.h,6,y,S),Is(this.h,8,O,R),Is(this.h,10,I,N),Is(this.h,12,J,L),Is(this.h,14,V,Z)},"_update");$i.prototype._digest=o(function(e){return e==="hex"?vn.toHex32(this.h,"big"):vn.split32(this.h,"big")},"digest");function ER(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}o(ER,"ch64_hi");function AR(t,e,r,n,i,a){var c=e&n^~e&a;return c<0&&(c+=4294967296),c}o(AR,"ch64_lo");function SR(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}o(SR,"maj64_hi");function MR(t,e,r,n,i,a){var c=e&n^e&a^n&a;return c<0&&(c+=4294967296),c}o(MR,"maj64_lo");function TR(t,e){var r=co(t,e,28),n=co(e,t,2),i=co(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(TR,"s0_512_hi");function CR(t,e){var r=uo(t,e,28),n=uo(e,t,2),i=uo(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(CR,"s0_512_lo");function kR(t,e){var r=co(t,e,14),n=co(t,e,18),i=co(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}o(kR,"s1_512_hi");function IR(t,e){var r=uo(t,e,14),n=uo(t,e,18),i=uo(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}o(IR,"s1_512_lo");function DR(t,e){var r=co(t,e,1),n=co(t,e,8),i=V3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(DR,"g0_512_hi");function OR(t,e){var r=uo(t,e,1),n=uo(t,e,8),i=W3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(OR,"g0_512_lo");function RR(t,e){var r=co(t,e,19),n=co(e,t,29),i=V3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(RR,"g1_512_hi");function NR(t,e){var r=uo(t,e,19),n=uo(e,t,29),i=W3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(NR,"g1_512_lo")});var Q3=De((zK,Z3)=>{"use strict";var s1=Bi(),X3=o1();function Go(){if(!(this instanceof Go))return new Go;X3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(Go,"SHA384");s1.inherits(Go,X3);Z3.exports=Go;Go.blockSize=1024;Go.outSize=384;Go.hmacStrength=192;Go.padLength=128;Go.prototype._digest=o(function(e){return e==="hex"?s1.toHex32(this.h.slice(0,12),"big"):s1.split32(this.h.slice(0,12),"big")},"digest")});var e6=De(Gf=>{"use strict";Gf.sha1=q3();Gf.sha224=G3();Gf.sha256=t1();Gf.sha384=Q3();Gf.sha512=o1()});var s6=De(o6=>{"use strict";var Ma=Bi(),PR=Hf(),jh=Ma.rotl32,t6=Ma.sum32,gu=Ma.sum32_3,r6=Ma.sum32_4,i6=PR.BlockHash;function lo(){if(!(this instanceof lo))return new lo;i6.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(lo,"RIPEMD160");Ma.inherits(lo,i6);o6.ripemd160=lo;lo.blockSize=512;lo.outSize=160;lo.hmacStrength=192;lo.padLength=64;lo.prototype._update=o(function(e,r){for(var n=this.h[0],i=this.h[1],a=this.h[2],c=this.h[3],u=this.h[4],d=n,v=i,y=a,S=c,O=u,R=0;R<80;R++){var I=t6(jh(r6(n,n6(R,i,a,c),e[UR[R]+r],LR(R)),FR[R]),u);n=u,u=c,c=jh(a,10),a=i,i=I,I=t6(jh(r6(d,n6(79-R,v,y,S),e[$R[R]+r],BR(R)),qR[R]),O),d=O,O=S,S=jh(y,10),y=v,v=I}I=gu(this.h[1],a,S),this.h[1]=gu(this.h[2],c,O),this.h[2]=gu(this.h[3],u,d),this.h[3]=gu(this.h[4],n,v),this.h[4]=gu(this.h[0],i,y),this.h[0]=I},"update");lo.prototype._digest=o(function(e){return e==="hex"?Ma.toHex32(this.h,"little"):Ma.split32(this.h,"little")},"digest");function n6(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}o(n6,"f");function LR(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}o(LR,"K");function BR(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}o(BR,"Kh");var UR=[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],$R=[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],FR=[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],qR=[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 f6=De((GK,a6)=>{"use strict";var HR=Bi(),zR=Ts();function Vf(t,e,r){if(!(this instanceof Vf))return new Vf(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(HR.toArray(e,r))}o(Vf,"Hmac");a6.exports=Vf;Vf.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),zR(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},"init");Vf.prototype.update=o(function(e,r){return this.inner.update(e,r),this},"update");Vf.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var vu=De(c6=>{var Br=c6;Br.utils=Bi();Br.common=Hf();Br.sha=e6();Br.ripemd=s6();Br.hmac=f6();Br.sha1=Br.sha.sha1;Br.sha256=Br.sha.sha256;Br.sha224=Br.sha.sha224;Br.sha384=Br.sha.sha384;Br.sha512=Br.sha.sha512;Br.ripemd160=Br.ripemd.ripemd160});var l6=De((WK,u6)=>{u6.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 Gh=De(p6=>{"use strict";var f1=p6,Ds=vu(),a1=Zm(),KR=Ln(),h6=KR.assert;function d6(t){t.type==="short"?this.curve=new a1.short(t):t.type==="edwards"?this.curve=new a1.edwards(t):this.curve=new a1.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,h6(this.g.validate(),"Invalid curve"),h6(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(d6,"PresetCurve");f1.PresetCurve=d6;function Os(t,e){Object.defineProperty(f1,t,{configurable:!0,enumerable:!0,get:function(){var r=new d6(e);return Object.defineProperty(f1,t,{configurable:!0,enumerable:!0,value:r}),r}})}o(Os,"defineCurve");Os("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:Ds.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Os("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:Ds.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Os("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:Ds.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Os("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:Ds.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"]});Os("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:Ds.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"]});Os("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ds.sha256,gRed:!1,g:["9"]});Os("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:Ds.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c1;try{c1=l6()}catch{c1=void 0}Os("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:Ds.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c1]})});var g6=De((YK,b6)=>{"use strict";var jR=vu(),Ta=jm(),m6=Ts();function Rs(t){if(!(this instanceof Rs))return new Rs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Ta.toArray(t.entropy,t.entropyEnc||"hex"),r=Ta.toArray(t.nonce,t.nonceEnc||"hex"),n=Ta.toArray(t.pers,t.persEnc||"hex");m6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(Rs,"HmacDRBG");b6.exports=Rs;Rs.prototype._init=o(function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");Rs.prototype._hmac=o(function(){return new jR.hmac(this.hash,this.K)},"hmac");Rs.prototype._update=o(function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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");Rs.prototype.reseed=o(function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Ta.toArray(e,r),n=Ta.toArray(n,i),m6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Rs.prototype.generate=o(function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Ta.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(n),this._reseed++,Ta.encode(c,r)},"generate")});var y6=De((XK,v6)=>{"use strict";var GR=io(),VR=Ln(),u1=VR.assert;function Gr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(Gr,"KeyPair");v6.exports=Gr;Gr.fromPublic=o(function(e,r,n){return r instanceof Gr?r:new Gr(e,{pub:r,pubEnc:n})},"fromPublic");Gr.fromPrivate=o(function(e,r,n){return r instanceof Gr?r:new Gr(e,{priv:r,privEnc:n})},"fromPrivate");Gr.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");Gr.prototype.getPublic=o(function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},"getPublic");Gr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Gr.prototype._importPrivate=o(function(e,r){this.priv=new GR(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Gr.prototype._importPublic=o(function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?u1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&u1(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,r)},"_importPublic");Gr.prototype.derive=o(function(e){return e.validate()||u1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Gr.prototype.sign=o(function(e,r,n){return this.ec.sign(e,this,r,n)},"sign");Gr.prototype.verify=o(function(e,r){return this.ec.verify(e,r,this)},"verify");Gr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var _6=De((ZK,w6)=>{"use strict";var Vh=io(),d1=Ln(),WR=d1.assert;function Wh(t,e){if(t instanceof Wh)return t;this._importDER(t,e)||(WR(t.r&&t.s,"Signature without r or s"),this.r=new Vh(t.r,16),this.s=new Vh(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Wh,"Signature");w6.exports=Wh;function JR(){this.place=0}o(JR,"Position");function l1(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,c=e.place;a<n;a++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}o(l1,"getLength");function x6(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}o(x6,"rmPadding");Wh.prototype._importDER=o(function(e,r){e=d1.toArray(e,r);var n=new JR;if(e[n.place++]!==48)return!1;var i=l1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=l1(e,n);if(a===!1)return!1;var c=e.slice(n.place,a+n.place);if(n.place+=a,e[n.place++]!==2)return!1;var u=l1(e,n);if(u===!1||e.length!==u+n.place)return!1;var d=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new Vh(c),this.s=new Vh(d),this.recoveryParam=null,!0},"_importDER");function h1(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}o(h1,"constructLength");Wh.prototype.toDER=o(function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=x6(r),n=x6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];h1(i,r.length),i=i.concat(r),i.push(2),h1(i,n.length);var a=i.concat(n),c=[48];return h1(c,a.length),c=c.concat(a),d1.encode(c,e)},"toDER")});var M6=De((QK,S6)=>{"use strict";var Ca=io(),E6=g6(),YR=Ln(),p1=Gh(),XR=Jm(),A6=YR.assert,m1=y6(),Jh=_6();function pi(t){if(!(this instanceof pi))return new pi(t);typeof t=="string"&&(A6(Object.prototype.hasOwnProperty.call(p1,t),"Unknown curve "+t),t=p1[t]),t instanceof p1.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}o(pi,"EC");S6.exports=pi;pi.prototype.keyPair=o(function(e){return new m1(this,e)},"keyPair");pi.prototype.keyFromPrivate=o(function(e,r){return m1.fromPrivate(this,e,r)},"keyFromPrivate");pi.prototype.keyFromPublic=o(function(e,r){return m1.fromPublic(this,e,r)},"keyFromPublic");pi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new E6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||XR(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ca(2));;){var a=new Ca(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},"genKeyPair");pi.prototype._truncateToN=o(function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");pi.prototype.sign=o(function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Ca(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),d=new E6({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new Ca(1)),y=0;;y++){var S=i.k?i.k(y):new Ca(d.generate(this.n.byteLength()));if(S=this._truncateToN(S,!0),!(S.cmpn(1)<=0||S.cmp(v)>=0)){var O=this.g.mul(S);if(!O.isInfinity()){var R=O.getX(),I=R.umod(this.n);if(I.cmpn(0)!==0){var N=S.invm(this.n).mul(I.mul(r.getPrivate()).iadd(e));if(N=N.umod(this.n),N.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),J^=1),new Jh({r:I,s:N,recoveryParam:J})}}}}}},"sign");pi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new Ca(e,16)),n=this.keyFromPublic(n,i),r=new Jh(r,"hex");var a=r.r,c=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),d=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),v),y.isInfinity()?!1:y.eqXToP(a)):(y=this.g.mulAdd(d,n.getPublic(),v),y.isInfinity()?!1:y.getX().umod(this.n).cmp(a)===0)},"verify");pi.prototype.recoverPubKey=function(t,e,r,n){A6((3&r)===r,"The recovery param is more than two bits"),e=new Jh(e,n);var i=this.n,a=new Ca(t),c=e.r,u=e.s,d=r&1,v=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?c=this.curve.pointFromX(c.add(this.curve.n),d):c=this.curve.pointFromX(c,d);var y=e.r.invm(i),S=i.sub(a).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(S,c,O)};pi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Jh(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var I6=De((ej,k6)=>{"use strict";var yu=Ln(),C6=yu.assert,T6=yu.parseBytes,Wf=yu.cachedProperty;function Tr(t,e){this.eddsa=t,this._secret=T6(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=T6(e.pub)}o(Tr,"KeyPair");Tr.fromPublic=o(function(e,r){return r instanceof Tr?r:new Tr(e,{pub:r})},"fromPublic");Tr.fromSecret=o(function(e,r){return r instanceof Tr?r:new Tr(e,{secret:r})},"fromSecret");Tr.prototype.secret=o(function(){return this._secret},"secret");Wf(Tr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));Wf(Tr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));Wf(Tr,"privBytes",o(function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));Wf(Tr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));Wf(Tr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));Wf(Tr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Tr.prototype.sign=o(function(e){return C6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Tr.prototype.verify=o(function(e,r){return this.eddsa.verify(e,r,this)},"verify");Tr.prototype.getSecret=o(function(e){return C6(this._secret,"KeyPair is public only"),yu.encode(this.secret(),e)},"getSecret");Tr.prototype.getPublic=o(function(e){return yu.encode(this.pubBytes(),e)},"getPublic");k6.exports=Tr});var O6=De((tj,D6)=>{"use strict";var ZR=io(),Yh=Ln(),QR=Yh.assert,Xh=Yh.cachedProperty,eN=Yh.parseBytes;function ka(t,e){this.eddsa=t,typeof e!="object"&&(e=eN(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),QR(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof ZR&&(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");Xh(ka,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));Xh(ka,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));Xh(ka,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));Xh(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 Yh.encode(this.toBytes(),"hex").toUpperCase()},"toHex");D6.exports=ka});var B6=De((rj,L6)=>{"use strict";var tN=vu(),rN=Gh(),Jf=Ln(),nN=Jf.assert,N6=Jf.parseBytes,P6=I6(),R6=O6();function yn(t){if(nN(t==="ed25519","only tested with ed25519 so far"),!(this instanceof yn))return new yn(t);t=rN[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=tN.sha512}o(yn,"EDDSA");L6.exports=yn;yn.prototype.sign=o(function(e,r){e=N6(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),c=this.encodePoint(a),u=this.hashInt(c,n.pubBytes(),e).mul(n.priv()),d=i.add(u).umod(this.curve.n);return this.makeSignature({R:a,S:d,Rencoded:c})},"sign");yn.prototype.verify=o(function(e,r,n){e=N6(e),r=this.makeSignature(r);var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),c=this.g.mul(r.S()),u=r.R().add(i.pub().mul(a));return u.eq(c)},"verify");yn.prototype.hashInt=o(function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return Jf.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");yn.prototype.keyFromPublic=o(function(e){return P6.fromPublic(this,e)},"keyFromPublic");yn.prototype.keyFromSecret=o(function(e){return P6.fromSecret(this,e)},"keyFromSecret");yn.prototype.makeSignature=o(function(e){return e instanceof R6?e:new R6(this,e)},"makeSignature");yn.prototype.encodePoint=o(function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},"encodePoint");yn.prototype.decodePoint=o(function(e){e=Jf.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,a=Jf.intFromLE(n);return this.curve.pointFromY(a,i)},"decodePoint");yn.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");yn.prototype.decodeInt=o(function(e){return Jf.intFromLE(e)},"decodeInt");yn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var $6=De(U6=>{"use strict";var Ia=U6;Ia.version=d3().version;Ia.utils=Ln();Ia.rand=Jm();Ia.curve=Zm();Ia.curves=Gh();Ia.ec=M6();Ia.eddsa=B6()});var q6=De(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.BrowserRandomSource=void 0;var F6=65536,Zh=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 r=new Uint8Array(e);for(let n=0;n<r.length;n+=F6)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,F6)));return r}};o(Zh,"BrowserRandomSource");Qh.BrowserRandomSource=Zh});var H6=De(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.NodeRandomSource=void 0;var iN=li(),ed=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 r=this._crypto.randomBytes(e);if(r.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]=r[i];return(0,iN.wipe)(r),n}};o(ed,"NodeRandomSource");td.NodeRandomSource=ed});var z6=De(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.SystemRandomSource=void 0;var oN=q6(),sN=H6(),rd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new oN.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new sN.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(rd,"SystemRandomSource");nd.SystemRandomSource=rd});var Da=De(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.randomStringForEntropy=Vr.randomString=Vr.randomUint32=Vr.randomBytes=Vr.defaultRandomSource=void 0;var aN=z6(),fN=Aa(),K6=li();Vr.defaultRandomSource=new aN.SystemRandomSource;function b1(t,e=Vr.defaultRandomSource){return e.randomBytes(t)}o(b1,"randomBytes");Vr.randomBytes=b1;function cN(t=Vr.defaultRandomSource){let e=b1(4,t),r=(0,fN.readUint32LE)(e);return(0,K6.wipe)(e),r}o(cN,"randomUint32");Vr.randomUint32=cN;var j6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function G6(t,e=j6,r=Vr.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,a=256-256%i;for(;t>0;){let c=b1(Math.ceil(t*256/a),r);for(let u=0;u<c.length&&t>0;u++){let d=c[u];d<a&&(n+=e.charAt(d%i),t--)}(0,K6.wipe)(c)}return n}o(G6,"randomString");Vr.randomString=G6;function uN(t,e=j6,r=Vr.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return G6(n,e,r)}o(uN,"randomStringForEntropy");Vr.randomStringForEntropy=uN});var J6=De(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var Xf=Aa(),Yf=li();Vo.DIGEST_LENGTH=64;Vo.BLOCK_SIZE=128;var W6=function(){function t(){this.digestLength=Vo.DIGEST_LENGTH,this.blockSize=Vo.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(t,"SHA512"),t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Yf.wipe(this._buffer),Yf.wipe(this._tempHi),Yf.wipe(this._tempLo),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<Vo.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(g1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=g1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,a=r<<3,c=r%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<c-8;u++)this._buffer[u]=0;Xf.writeUint32BE(i,this._buffer,c-8),Xf.writeUint32BE(a,this._buffer,c-4),g1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)Xf.writeUint32BE(this._stateHi[u],e,u*8),Xf.writeUint32BE(this._stateLo[u],e,u*8+4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.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},t.prototype.cleanSavedState=function(e){Yf.wipe(e.stateHi),Yf.wipe(e.stateLo),e.buffer&&Yf.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Vo.SHA512=W6;var V6=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function g1(t,e,r,n,i,a,c){for(var u=r[0],d=r[1],v=r[2],y=r[3],S=r[4],O=r[5],R=r[6],I=r[7],N=n[0],J=n[1],L=n[2],V=n[3],Z=n[4],Y=n[5],oe=n[6],K=n[7],q,j,le,T,h,x,b,l;c>=128;){for(var m=0;m<16;m++){var _=8*m+a;t[m]=Xf.readUint32BE(i,_),e[m]=Xf.readUint32BE(i,_+4)}for(var m=0;m<80;m++){var A=u,E=d,g=v,C=y,P=S,w=O,k=R,he=I,D=N,Q=J,se=L,F=V,$=Z,ee=Y,ne=oe,ae=K;if(q=I,j=K,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=(S>>>14|Z<<32-14)^(S>>>18|Z<<32-18)^(Z>>>41-32|S<<32-(41-32)),j=(Z>>>14|S<<32-14)^(Z>>>18|S<<32-18)^(S>>>41-32|Z<<32-(41-32)),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=S&O^~S&R,j=Z&Y^~Z&oe,h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=V6[m*2],j=V6[m*2+1],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=t[m%16],j=e[m%16],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,le=b&65535|l<<16,T=h&65535|x<<16,q=le,j=T,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=(u>>>28|N<<32-28)^(N>>>34-32|u<<32-(34-32))^(N>>>39-32|u<<32-(39-32)),j=(N>>>28|u<<32-28)^(u>>>34-32|N<<32-(34-32))^(u>>>39-32|N<<32-(39-32)),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=u&d^u&v^d&v,j=N&J^N&L^J&L,h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,he=b&65535|l<<16,ae=h&65535|x<<16,q=C,j=F,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=le,j=T,h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,C=b&65535|l<<16,F=h&65535|x<<16,d=A,v=E,y=g,S=C,O=P,R=w,I=k,u=he,J=D,L=Q,V=se,Z=F,Y=$,oe=ee,K=ne,N=ae,m%16===15)for(var _=0;_<16;_++)q=t[_],j=e[_],h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=t[(_+9)%16],j=e[(_+9)%16],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,le=t[(_+1)%16],T=e[(_+1)%16],q=(le>>>1|T<<32-1)^(le>>>8|T<<32-8)^le>>>7,j=(T>>>1|le<<32-1)^(T>>>8|le<<32-8)^(T>>>7|le<<32-7),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,le=t[(_+14)%16],T=e[(_+14)%16],q=(le>>>19|T<<32-19)^(T>>>61-32|le<<32-(61-32))^le>>>6,j=(T>>>19|le<<32-19)^(le>>>61-32|T<<32-(61-32))^(T>>>6|le<<32-6),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[_]=b&65535|l<<16,e[_]=h&65535|x<<16}q=u,j=N,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[0],j=n[0],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[0]=u=b&65535|l<<16,n[0]=N=h&65535|x<<16,q=d,j=J,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[1],j=n[1],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[1]=d=b&65535|l<<16,n[1]=J=h&65535|x<<16,q=v,j=L,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[2],j=n[2],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[2]=v=b&65535|l<<16,n[2]=L=h&65535|x<<16,q=y,j=V,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[3],j=n[3],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[3]=y=b&65535|l<<16,n[3]=V=h&65535|x<<16,q=S,j=Z,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[4],j=n[4],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[4]=S=b&65535|l<<16,n[4]=Z=h&65535|x<<16,q=O,j=Y,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[5],j=n[5],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[5]=O=b&65535|l<<16,n[5]=Y=h&65535|x<<16,q=R,j=oe,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[6],j=n[6],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[6]=R=b&65535|l<<16,n[6]=oe=h&65535|x<<16,q=I,j=K,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[7],j=n[7],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[7]=I=b&65535|l<<16,n[7]=K=h&65535|x<<16,a+=128,c-=128}return a}o(g1,"hashBlocks");function lN(t){var e=new W6;e.update(t);var r=e.digest();return e.clean(),r}o(lN,"hash");Vo.hash=lN});var id=De(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 hN=Da(),xu=J6(),ex=li();Gt.SIGNATURE_LENGTH=64;Gt.PUBLIC_KEY_LENGTH=32;Gt.SECRET_KEY_LENGTH=64;Gt.SEED_LENGTH=32;function Ge(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}o(Ge,"gf");var dN=new Uint8Array(32);dN[0]=9;var x1=Ge(),Zf=Ge([1]),pN=Ge([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),mN=Ge([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Y6=Ge([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),X6=Ge([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),bN=Ge([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ns(t,e){for(let r=0;r<16;r++)t[r]=e[r]|0}o(Ns,"set25519");function v1(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}o(v1,"car25519");function tx(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let a=n&(t[i]^e[i]);t[i]^=a,e[i]^=a}}o(tx,"sel25519");function wu(t,e){let r=Ge(),n=Ge();for(let i=0;i<16;i++)n[i]=e[i];v1(n),v1(n),v1(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let a=r[15]>>16&1;r[14]&=65535,tx(n,r,1-a)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}o(wu,"pack25519");function rx(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}o(rx,"verify32");function Z6(t,e){let r=new Uint8Array(32),n=new Uint8Array(32);return wu(r,t),wu(n,e),rx(r,n)}o(Z6,"neq25519");function nx(t){let e=new Uint8Array(32);return wu(e,t),e[0]&1}o(nx,"par25519");function gN(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(gN,"unpack25519");function Oa(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(Oa,"add");function Na(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(Na,"sub");function Yt(t,e,r){let n,i,a=0,c=0,u=0,d=0,v=0,y=0,S=0,O=0,R=0,I=0,N=0,J=0,L=0,V=0,Z=0,Y=0,oe=0,K=0,q=0,j=0,le=0,T=0,h=0,x=0,b=0,l=0,m=0,_=0,A=0,E=0,g=0,C=r[0],P=r[1],w=r[2],k=r[3],he=r[4],D=r[5],Q=r[6],se=r[7],F=r[8],$=r[9],ee=r[10],ne=r[11],ae=r[12],Ae=r[13],ge=r[14],re=r[15];n=e[0],a+=n*C,c+=n*P,u+=n*w,d+=n*k,v+=n*he,y+=n*D,S+=n*Q,O+=n*se,R+=n*F,I+=n*$,N+=n*ee,J+=n*ne,L+=n*ae,V+=n*Ae,Z+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*P,d+=n*w,v+=n*k,y+=n*he,S+=n*D,O+=n*Q,R+=n*se,I+=n*F,N+=n*$,J+=n*ee,L+=n*ne,V+=n*ae,Z+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,d+=n*P,v+=n*w,y+=n*k,S+=n*he,O+=n*D,R+=n*Q,I+=n*se,N+=n*F,J+=n*$,L+=n*ee,V+=n*ne,Z+=n*ae,Y+=n*Ae,oe+=n*ge,K+=n*re,n=e[3],d+=n*C,v+=n*P,y+=n*w,S+=n*k,O+=n*he,R+=n*D,I+=n*Q,N+=n*se,J+=n*F,L+=n*$,V+=n*ee,Z+=n*ne,Y+=n*ae,oe+=n*Ae,K+=n*ge,q+=n*re,n=e[4],v+=n*C,y+=n*P,S+=n*w,O+=n*k,R+=n*he,I+=n*D,N+=n*Q,J+=n*se,L+=n*F,V+=n*$,Z+=n*ee,Y+=n*ne,oe+=n*ae,K+=n*Ae,q+=n*ge,j+=n*re,n=e[5],y+=n*C,S+=n*P,O+=n*w,R+=n*k,I+=n*he,N+=n*D,J+=n*Q,L+=n*se,V+=n*F,Z+=n*$,Y+=n*ee,oe+=n*ne,K+=n*ae,q+=n*Ae,j+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*P,R+=n*w,I+=n*k,N+=n*he,J+=n*D,L+=n*Q,V+=n*se,Z+=n*F,Y+=n*$,oe+=n*ee,K+=n*ne,q+=n*ae,j+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*P,I+=n*w,N+=n*k,J+=n*he,L+=n*D,V+=n*Q,Z+=n*se,Y+=n*F,oe+=n*$,K+=n*ee,q+=n*ne,j+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,I+=n*P,N+=n*w,J+=n*k,L+=n*he,V+=n*D,Z+=n*Q,Y+=n*se,oe+=n*F,K+=n*$,q+=n*ee,j+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,x+=n*re,n=e[9],I+=n*C,N+=n*P,J+=n*w,L+=n*k,V+=n*he,Z+=n*D,Y+=n*Q,oe+=n*se,K+=n*F,q+=n*$,j+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,x+=n*ge,b+=n*re,n=e[10],N+=n*C,J+=n*P,L+=n*w,V+=n*k,Z+=n*he,Y+=n*D,oe+=n*Q,K+=n*se,q+=n*F,j+=n*$,le+=n*ee,T+=n*ne,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,L+=n*P,V+=n*w,Z+=n*k,Y+=n*he,oe+=n*D,K+=n*Q,q+=n*se,j+=n*F,le+=n*$,T+=n*ee,h+=n*ne,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*re,n=e[12],L+=n*C,V+=n*P,Z+=n*w,Y+=n*k,oe+=n*he,K+=n*D,q+=n*Q,j+=n*se,le+=n*F,T+=n*$,h+=n*ee,x+=n*ne,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*re,n=e[13],V+=n*C,Z+=n*P,Y+=n*w,oe+=n*k,K+=n*he,q+=n*D,j+=n*Q,le+=n*se,T+=n*F,h+=n*$,x+=n*ee,b+=n*ne,l+=n*ae,m+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Z+=n*C,Y+=n*P,oe+=n*w,K+=n*k,q+=n*he,j+=n*D,le+=n*Q,T+=n*se,h+=n*F,x+=n*$,b+=n*ee,l+=n*ne,m+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*P,K+=n*w,q+=n*k,j+=n*he,le+=n*D,T+=n*Q,h+=n*se,x+=n*F,b+=n*$,l+=n*ee,m+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*K,u+=38*q,d+=38*j,v+=38*le,y+=38*T,S+=38*h,O+=38*x,R+=38*b,I+=38*l,N+=38*m,J+=38*_,L+=38*A,V+=38*E,Z+=38*g,i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=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=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=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=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),t[0]=a,t[1]=c,t[2]=u,t[3]=d,t[4]=v,t[5]=y,t[6]=S,t[7]=O,t[8]=R,t[9]=I,t[10]=N,t[11]=J,t[12]=L,t[13]=V,t[14]=Z,t[15]=Y}o(Yt,"mul");function Ra(t,e){Yt(t,e,e)}o(Ra,"square");function ix(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)Ra(r,r),n!==2&&n!==4&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(ix,"inv25519");function vN(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)Ra(r,r),n!==1&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(vN,"pow2523");function w1(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),d=Ge(),v=Ge(),y=Ge();Na(r,t[1],t[0]),Na(y,e[1],e[0]),Yt(r,r,y),Oa(n,t[0],t[1]),Oa(y,e[0],e[1]),Yt(n,n,y),Yt(i,t[3],e[3]),Yt(i,i,mN),Yt(a,t[2],e[2]),Oa(a,a,a),Na(c,n,r),Na(u,a,i),Oa(d,a,i),Oa(v,n,r),Yt(t[0],c,u),Yt(t[1],v,d),Yt(t[2],d,u),Yt(t[3],c,v)}o(w1,"edadd");function Q6(t,e,r){for(let n=0;n<4;n++)tx(t[n],e[n],r)}o(Q6,"cswap");function E1(t,e){let r=Ge(),n=Ge(),i=Ge();ix(i,e[2]),Yt(r,e[0],i),Yt(n,e[1],i),wu(t,n),t[31]^=nx(r)<<7}o(E1,"pack");function ox(t,e,r){Ns(t[0],x1),Ns(t[1],Zf),Ns(t[2],Zf),Ns(t[3],x1);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(n&7)&1;Q6(t,e,i),w1(e,t),w1(t,t),Q6(t,e,i)}}o(ox,"scalarmult");function A1(t,e){let r=[Ge(),Ge(),Ge(),Ge()];Ns(r[0],Y6),Ns(r[1],X6),Ns(r[2],Zf),Yt(r[3],Y6,X6),ox(t,r,e)}o(A1,"scalarbase");function sx(t){if(t.length!==Gt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Gt.SEED_LENGTH} bytes`);let e=(0,xu.hash)(t);e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(32),n=[Ge(),Ge(),Ge(),Ge()];A1(n,e),E1(r,n);let i=new Uint8Array(64);return i.set(t),i.set(r,32),{publicKey:r,secretKey:i}}o(sx,"generateKeyPairFromSeed");Gt.generateKeyPairFromSeed=sx;function yN(t){let e=(0,hN.randomBytes)(32,t),r=sx(e);return(0,ex.wipe)(e),r}o(yN,"generateKeyPair");Gt.generateKeyPair=yN;function xN(t){if(t.length!==Gt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Gt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(t.subarray(32))}o(xN,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=xN;var y1=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 ax(t,e){let r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)e[i]+=r-16*e[n]*y1[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=r*256;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*y1[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*y1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=e[n]&255}o(ax,"modL");function _1(t){let e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let r=0;r<64;r++)t[r]=0;ax(t,e)}o(_1,"reduce");function wN(t,e){let r=new Float64Array(64),n=[Ge(),Ge(),Ge(),Ge()],i=(0,xu.hash)(t.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let a=new Uint8Array(64);a.set(i.subarray(32),32);let c=new xu.SHA512;c.update(a.subarray(32)),c.update(e);let u=c.digest();c.clean(),_1(u),A1(n,u),E1(a,n),c.reset(),c.update(a.subarray(0,32)),c.update(t.subarray(32)),c.update(e);let d=c.digest();_1(d);for(let v=0;v<32;v++)r[v]=u[v];for(let v=0;v<32;v++)for(let y=0;y<32;y++)r[v+y]+=d[v]*i[y];return ax(a.subarray(32),r),a}o(wN,"sign");Gt.sign=wN;function fx(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),d=Ge();return Ns(t[2],Zf),gN(t[1],e),Ra(i,t[1]),Yt(a,i,pN),Na(i,i,t[2]),Oa(a,t[2],a),Ra(c,a),Ra(u,c),Yt(d,u,c),Yt(r,d,i),Yt(r,r,a),vN(r,r),Yt(r,r,i),Yt(r,r,a),Yt(r,r,a),Yt(t[0],r,a),Ra(n,t[0]),Yt(n,n,a),Z6(n,i)&&Yt(t[0],t[0],bN),Ra(n,t[0]),Yt(n,n,a),Z6(n,i)?-1:(nx(t[0])===e[31]>>7&&Na(t[0],x1,t[0]),Yt(t[3],t[0],t[1]),0)}o(fx,"unpackneg");function _N(t,e,r){let n=new Uint8Array(32),i=[Ge(),Ge(),Ge(),Ge()],a=[Ge(),Ge(),Ge(),Ge()];if(r.length!==Gt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Gt.SIGNATURE_LENGTH} bytes`);if(fx(a,t))return!1;let c=new xu.SHA512;c.update(r.subarray(0,32)),c.update(t),c.update(e);let u=c.digest();return _1(u),ox(i,a,u),A1(a,r.subarray(32)),w1(i,a),E1(n,i),!rx(r,n)}o(_N,"verify");Gt.verify=_N;function EN(t){let e=[Ge(),Ge(),Ge(),Ge()];if(fx(e,t))throw new Error("Ed25519: invalid public key");let r=Ge(),n=Ge(),i=e[1];Oa(r,Zf,i),Na(n,Zf,i),ix(n,n),Yt(r,r,n);let a=new Uint8Array(32);return wu(a,r),a}o(EN,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=EN;function AN(t){let e=(0,xu.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(e.subarray(0,32));return(0,ex.wipe)(e),r}o(AN,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=AN});var ux=De((uj,cx)=>{"use strict";cx.exports=o(function t(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((r,n,i)=>{let a=i===0?"":",",c=n===void 0||typeof n=="symbol"?null:n;return r+a+t(c)},"")+"]":"{"+Object.keys(e).sort().reduce((r,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return r;let a=r.length===0?"":",";return r+a+t(n)+":"+t(e[n])},"")+"}"},"serialize")});var px=De(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.sharedKey=lr.generateKeyPair=lr.generateKeyPairFromSeed=lr.scalarMultBase=lr.scalarMult=lr.SHARED_KEY_LENGTH=lr.SECRET_KEY_LENGTH=lr.PUBLIC_KEY_LENGTH=void 0;var SN=Da(),MN=li();lr.PUBLIC_KEY_LENGTH=32;lr.SECRET_KEY_LENGTH=32;lr.SHARED_KEY_LENGTH=32;function ho(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}o(ho,"gf");var lx=new Uint8Array(32);lx[0]=9;var TN=ho([56129,1]);function S1(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}o(S1,"car25519");function _u(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let a=n&(t[i]^e[i]);t[i]^=a,e[i]^=a}}o(_u,"sel25519");function CN(t,e){let r=ho(),n=ho();for(let i=0;i<16;i++)n[i]=e[i];S1(n),S1(n),S1(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let a=r[15]>>16&1;r[14]&=65535,_u(n,r,1-a)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}o(CN,"pack25519");function kN(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(kN,"unpack25519");function od(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(od,"add");function sd(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(sd,"sub");function Wo(t,e,r){let n,i,a=0,c=0,u=0,d=0,v=0,y=0,S=0,O=0,R=0,I=0,N=0,J=0,L=0,V=0,Z=0,Y=0,oe=0,K=0,q=0,j=0,le=0,T=0,h=0,x=0,b=0,l=0,m=0,_=0,A=0,E=0,g=0,C=r[0],P=r[1],w=r[2],k=r[3],he=r[4],D=r[5],Q=r[6],se=r[7],F=r[8],$=r[9],ee=r[10],ne=r[11],ae=r[12],Ae=r[13],ge=r[14],re=r[15];n=e[0],a+=n*C,c+=n*P,u+=n*w,d+=n*k,v+=n*he,y+=n*D,S+=n*Q,O+=n*se,R+=n*F,I+=n*$,N+=n*ee,J+=n*ne,L+=n*ae,V+=n*Ae,Z+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*P,d+=n*w,v+=n*k,y+=n*he,S+=n*D,O+=n*Q,R+=n*se,I+=n*F,N+=n*$,J+=n*ee,L+=n*ne,V+=n*ae,Z+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,d+=n*P,v+=n*w,y+=n*k,S+=n*he,O+=n*D,R+=n*Q,I+=n*se,N+=n*F,J+=n*$,L+=n*ee,V+=n*ne,Z+=n*ae,Y+=n*Ae,oe+=n*ge,K+=n*re,n=e[3],d+=n*C,v+=n*P,y+=n*w,S+=n*k,O+=n*he,R+=n*D,I+=n*Q,N+=n*se,J+=n*F,L+=n*$,V+=n*ee,Z+=n*ne,Y+=n*ae,oe+=n*Ae,K+=n*ge,q+=n*re,n=e[4],v+=n*C,y+=n*P,S+=n*w,O+=n*k,R+=n*he,I+=n*D,N+=n*Q,J+=n*se,L+=n*F,V+=n*$,Z+=n*ee,Y+=n*ne,oe+=n*ae,K+=n*Ae,q+=n*ge,j+=n*re,n=e[5],y+=n*C,S+=n*P,O+=n*w,R+=n*k,I+=n*he,N+=n*D,J+=n*Q,L+=n*se,V+=n*F,Z+=n*$,Y+=n*ee,oe+=n*ne,K+=n*ae,q+=n*Ae,j+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*P,R+=n*w,I+=n*k,N+=n*he,J+=n*D,L+=n*Q,V+=n*se,Z+=n*F,Y+=n*$,oe+=n*ee,K+=n*ne,q+=n*ae,j+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*P,I+=n*w,N+=n*k,J+=n*he,L+=n*D,V+=n*Q,Z+=n*se,Y+=n*F,oe+=n*$,K+=n*ee,q+=n*ne,j+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,I+=n*P,N+=n*w,J+=n*k,L+=n*he,V+=n*D,Z+=n*Q,Y+=n*se,oe+=n*F,K+=n*$,q+=n*ee,j+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,x+=n*re,n=e[9],I+=n*C,N+=n*P,J+=n*w,L+=n*k,V+=n*he,Z+=n*D,Y+=n*Q,oe+=n*se,K+=n*F,q+=n*$,j+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,x+=n*ge,b+=n*re,n=e[10],N+=n*C,J+=n*P,L+=n*w,V+=n*k,Z+=n*he,Y+=n*D,oe+=n*Q,K+=n*se,q+=n*F,j+=n*$,le+=n*ee,T+=n*ne,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,L+=n*P,V+=n*w,Z+=n*k,Y+=n*he,oe+=n*D,K+=n*Q,q+=n*se,j+=n*F,le+=n*$,T+=n*ee,h+=n*ne,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*re,n=e[12],L+=n*C,V+=n*P,Z+=n*w,Y+=n*k,oe+=n*he,K+=n*D,q+=n*Q,j+=n*se,le+=n*F,T+=n*$,h+=n*ee,x+=n*ne,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*re,n=e[13],V+=n*C,Z+=n*P,Y+=n*w,oe+=n*k,K+=n*he,q+=n*D,j+=n*Q,le+=n*se,T+=n*F,h+=n*$,x+=n*ee,b+=n*ne,l+=n*ae,m+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Z+=n*C,Y+=n*P,oe+=n*w,K+=n*k,q+=n*he,j+=n*D,le+=n*Q,T+=n*se,h+=n*F,x+=n*$,b+=n*ee,l+=n*ne,m+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*P,K+=n*w,q+=n*k,j+=n*he,le+=n*D,T+=n*Q,h+=n*se,x+=n*F,b+=n*$,l+=n*ee,m+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*K,u+=38*q,d+=38*j,v+=38*le,y+=38*T,S+=38*h,O+=38*x,R+=38*b,I+=38*l,N+=38*m,J+=38*_,L+=38*A,V+=38*E,Z+=38*g,i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=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=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=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=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),t[0]=a,t[1]=c,t[2]=u,t[3]=d,t[4]=v,t[5]=y,t[6]=S,t[7]=O,t[8]=R,t[9]=I,t[10]=N,t[11]=J,t[12]=L,t[13]=V,t[14]=Z,t[15]=Y}o(Wo,"mul");function Eu(t,e){Wo(t,e,e)}o(Eu,"square");function IN(t,e){let r=ho();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)Eu(r,r),n!==2&&n!==4&&Wo(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}o(IN,"inv25519");function M1(t,e){let r=new Uint8Array(32),n=new Float64Array(80),i=ho(),a=ho(),c=ho(),u=ho(),d=ho(),v=ho();for(let R=0;R<31;R++)r[R]=t[R];r[31]=t[31]&127|64,r[0]&=248,kN(n,e);for(let R=0;R<16;R++)a[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let I=r[R>>>3]>>>(R&7)&1;_u(i,a,I),_u(c,u,I),od(d,i,c),sd(i,i,c),od(c,a,u),sd(a,a,u),Eu(u,d),Eu(v,i),Wo(i,c,i),Wo(c,a,d),od(d,i,c),sd(i,i,c),Eu(a,i),sd(c,u,v),Wo(i,c,TN),od(i,i,u),Wo(c,c,i),Wo(i,u,v),Wo(u,a,n),Eu(a,d),_u(i,a,I),_u(c,u,I)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=c[R],n[R+48]=a[R],n[R+64]=u[R];let y=n.subarray(32),S=n.subarray(16);IN(y,y),Wo(S,S,y);let O=new Uint8Array(32);return CN(O,S),O}o(M1,"scalarMult");lr.scalarMult=M1;function hx(t){return M1(t,lx)}o(hx,"scalarMultBase");lr.scalarMultBase=hx;function dx(t){if(t.length!==lr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${lr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(t);return{publicKey:hx(e),secretKey:e}}o(dx,"generateKeyPairFromSeed");lr.generateKeyPairFromSeed=dx;function DN(t){let e=(0,SN.randomBytes)(32,t),r=dx(e);return(0,MN.wipe)(e),r}o(DN,"generateKeyPair");lr.generateKeyPair=DN;function ON(t,e,r=!1){if(t.length!==lr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==lr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=M1(t,e);if(r){let i=0;for(let a=0;a<n.length;a++)i|=n[a];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(ON,"sharedKey");lr.sharedKey=ON});var C1=De(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Wr=Aa(),T1=li(),RN=20;function NN(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,c=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],y=r[15]<<24|r[14]<<16|r[13]<<8|r[12],S=r[19]<<24|r[18]<<16|r[17]<<8|r[16],O=r[23]<<24|r[22]<<16|r[21]<<8|r[20],R=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],N=e[3]<<24|e[2]<<16|e[1]<<8|e[0],J=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],V=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Z=n,Y=i,oe=a,K=c,q=u,j=d,le=v,T=y,h=S,x=O,b=R,l=I,m=N,_=J,A=L,E=V,g=0;g<RN;g+=2)Z=Z+q|0,m^=Z,m=m>>>32-16|m<<16,h=h+m|0,q^=h,q=q>>>32-12|q<<12,Y=Y+j|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,j^=x,j=j>>>32-12|j<<12,oe=oe+le|0,A^=oe,A=A>>>32-16|A<<16,b=b+A|0,le^=b,le=le>>>32-12|le<<12,K=K+T|0,E^=K,E=E>>>32-16|E<<16,l=l+E|0,T^=l,T=T>>>32-12|T<<12,oe=oe+le|0,A^=oe,A=A>>>32-8|A<<8,b=b+A|0,le^=b,le=le>>>32-7|le<<7,K=K+T|0,E^=K,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+j|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,j^=x,j=j>>>32-7|j<<7,Z=Z+q|0,m^=Z,m=m>>>32-8|m<<8,h=h+m|0,q^=h,q=q>>>32-7|q<<7,Z=Z+j|0,E^=Z,E=E>>>32-16|E<<16,b=b+E|0,j^=b,j=j>>>32-12|j<<12,Y=Y+le|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|0,le^=l,le=le>>>32-12|le<<12,oe=oe+T|0,_^=oe,_=_>>>32-16|_<<16,h=h+_|0,T^=h,T=T>>>32-12|T<<12,K=K+q|0,A^=K,A=A>>>32-16|A<<16,x=x+A|0,q^=x,q=q>>>32-12|q<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,K=K+q|0,A^=K,A=A>>>32-8|A<<8,x=x+A|0,q^=x,q=q>>>32-7|q<<7,Y=Y+le|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,le^=l,le=le>>>32-7|le<<7,Z=Z+j|0,E^=Z,E=E>>>32-8|E<<8,b=b+E|0,j^=b,j=j>>>32-7|j<<7;Wr.writeUint32LE(Z+n|0,t,0),Wr.writeUint32LE(Y+i|0,t,4),Wr.writeUint32LE(oe+a|0,t,8),Wr.writeUint32LE(K+c|0,t,12),Wr.writeUint32LE(q+u|0,t,16),Wr.writeUint32LE(j+d|0,t,20),Wr.writeUint32LE(le+v|0,t,24),Wr.writeUint32LE(T+y|0,t,28),Wr.writeUint32LE(h+S|0,t,32),Wr.writeUint32LE(x+O|0,t,36),Wr.writeUint32LE(b+R|0,t,40),Wr.writeUint32LE(l+I|0,t,44),Wr.writeUint32LE(m+N|0,t,48),Wr.writeUint32LE(_+J|0,t,52),Wr.writeUint32LE(A+L|0,t,56),Wr.writeUint32LE(E+V|0,t,60)}o(NN,"core");function mx(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),d=0;d<r.length;d+=64){NN(u,a,t);for(var v=d;v<d+64&&v<r.length;v++)n[v]=r[v]^u[v-d];LN(a,0,c)}return T1.wipe(u),i===0&&T1.wipe(a),n}o(mx,"streamXOR");ad.streamXOR=mx;function PN(t,e,r,n){return n===void 0&&(n=0),T1.wipe(r),mx(t,e,r,r,n)}o(PN,"stream");ad.stream=PN;function LN(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(LN,"incrementCounter")});var yx=De(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});var Ps=Aa(),bx=li(),BN=C1(),UN=20;function gx(t,e,r,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=vx(t,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var c=BN.streamXOR(i,a,r,n);return bx.wipe(i),c}o(gx,"streamXOR");Au.streamXOR=gx;function $N(t,e,r){return bx.wipe(r),gx(t,e,r,r)}o($N,"stream");Au.stream=$N;function vx(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,c=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],y=t[15]<<24|t[14]<<16|t[13]<<8|t[12],S=t[19]<<24|t[18]<<16|t[17]<<8|t[16],O=t[23]<<24|t[22]<<16|t[21]<<8|t[20],R=t[27]<<24|t[26]<<16|t[25]<<8|t[24],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],N=e[3]<<24|e[2]<<16|e[1]<<8|e[0],J=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],V=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Z=n,Y=i,oe=a,K=c,q=u,j=d,le=v,T=y,h=S,x=O,b=R,l=I,m=N,_=J,A=L,E=V,g=0;g<UN;g+=2)Z=Z+q|0,m^=Z,m=m>>>32-16|m<<16,h=h+m|0,q^=h,q=q>>>32-12|q<<12,Y=Y+j|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,j^=x,j=j>>>32-12|j<<12,oe=oe+le|0,A^=oe,A=A>>>32-16|A<<16,b=b+A|0,le^=b,le=le>>>32-12|le<<12,K=K+T|0,E^=K,E=E>>>32-16|E<<16,l=l+E|0,T^=l,T=T>>>32-12|T<<12,oe=oe+le|0,A^=oe,A=A>>>32-8|A<<8,b=b+A|0,le^=b,le=le>>>32-7|le<<7,K=K+T|0,E^=K,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+j|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,j^=x,j=j>>>32-7|j<<7,Z=Z+q|0,m^=Z,m=m>>>32-8|m<<8,h=h+m|0,q^=h,q=q>>>32-7|q<<7,Z=Z+j|0,E^=Z,E=E>>>32-16|E<<16,b=b+E|0,j^=b,j=j>>>32-12|j<<12,Y=Y+le|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|0,le^=l,le=le>>>32-12|le<<12,oe=oe+T|0,_^=oe,_=_>>>32-16|_<<16,h=h+_|0,T^=h,T=T>>>32-12|T<<12,K=K+q|0,A^=K,A=A>>>32-16|A<<16,x=x+A|0,q^=x,q=q>>>32-12|q<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,K=K+q|0,A^=K,A=A>>>32-8|A<<8,x=x+A|0,q^=x,q=q>>>32-7|q<<7,Y=Y+le|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,le^=l,le=le>>>32-7|le<<7,Z=Z+j|0,E^=Z,E=E>>>32-8|E<<8,b=b+E|0,j^=b,j=j>>>32-7|j<<7;return Ps.writeUint32LE(Z,r,0),Ps.writeUint32LE(Y,r,4),Ps.writeUint32LE(oe,r,8),Ps.writeUint32LE(K,r,12),Ps.writeUint32LE(m,r,16),Ps.writeUint32LE(_,r,20),Ps.writeUint32LE(A,r,24),Ps.writeUint32LE(E,r,28),r}o(vx,"hchacha");Au.hchacha=vx});var k1=De(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});function FN(t,e,r){return~(t-1)&e|t-1&r}o(FN,"select");Qf.select=FN;function qN(t,e){return(t|0)-(e|0)-1>>>31&1}o(qN,"lessOrEqual");Qf.lessOrEqual=qN;function xx(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}o(xx,"compare");Qf.compare=xx;function HN(t,e){return t.length===0||e.length===0?!1:xx(t,e)!==0}o(HN,"equal");Qf.equal=HN});var _x=De(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var zN=k1(),fd=li();Jo.DIGEST_LENGTH=16;var wx=function(){function t(e){this.digestLength=Jo.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 r=e[0]|e[1]<<8;this._r[0]=r&8191;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var a=e[6]|e[7]<<8;this._r[3]=(i>>>7|a<<9)&8191;var c=e[8]|e[9]<<8;this._r[4]=(a>>>4|c<<12)&255,this._r[5]=c>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(c>>>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(t,"Poly1305"),t.prototype._blocks=function(e,r,n){for(var i=this._fin?0:2048,a=this._h[0],c=this._h[1],u=this._h[2],d=this._h[3],v=this._h[4],y=this._h[5],S=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],N=this._r[0],J=this._r[1],L=this._r[2],V=this._r[3],Z=this._r[4],Y=this._r[5],oe=this._r[6],K=this._r[7],q=this._r[8],j=this._r[9];n>=16;){var le=e[r+0]|e[r+1]<<8;a+=le&8191;var T=e[r+2]|e[r+3]<<8;c+=(le>>>13|T<<3)&8191;var h=e[r+4]|e[r+5]<<8;u+=(T>>>10|h<<6)&8191;var x=e[r+6]|e[r+7]<<8;d+=(h>>>7|x<<9)&8191;var b=e[r+8]|e[r+9]<<8;v+=(x>>>4|b<<12)&8191,y+=b>>>1&8191;var l=e[r+10]|e[r+11]<<8;S+=(b>>>14|l<<2)&8191;var m=e[r+12]|e[r+13]<<8;O+=(l>>>11|m<<5)&8191;var _=e[r+14]|e[r+15]<<8;R+=(m>>>8|_<<8)&8191,I+=_>>>5|i;var A=0,E=A;E+=a*N,E+=c*(5*j),E+=u*(5*q),E+=d*(5*K),E+=v*(5*oe),A=E>>>13,E&=8191,E+=y*(5*Y),E+=S*(5*Z),E+=O*(5*V),E+=R*(5*L),E+=I*(5*J),A+=E>>>13,E&=8191;var g=A;g+=a*J,g+=c*N,g+=u*(5*j),g+=d*(5*q),g+=v*(5*K),A=g>>>13,g&=8191,g+=y*(5*oe),g+=S*(5*Y),g+=O*(5*Z),g+=R*(5*V),g+=I*(5*L),A+=g>>>13,g&=8191;var C=A;C+=a*L,C+=c*J,C+=u*N,C+=d*(5*j),C+=v*(5*q),A=C>>>13,C&=8191,C+=y*(5*K),C+=S*(5*oe),C+=O*(5*Y),C+=R*(5*Z),C+=I*(5*V),A+=C>>>13,C&=8191;var P=A;P+=a*V,P+=c*L,P+=u*J,P+=d*N,P+=v*(5*j),A=P>>>13,P&=8191,P+=y*(5*q),P+=S*(5*K),P+=O*(5*oe),P+=R*(5*Y),P+=I*(5*Z),A+=P>>>13,P&=8191;var w=A;w+=a*Z,w+=c*V,w+=u*L,w+=d*J,w+=v*N,A=w>>>13,w&=8191,w+=y*(5*j),w+=S*(5*q),w+=O*(5*K),w+=R*(5*oe),w+=I*(5*Y),A+=w>>>13,w&=8191;var k=A;k+=a*Y,k+=c*Z,k+=u*V,k+=d*L,k+=v*J,A=k>>>13,k&=8191,k+=y*N,k+=S*(5*j),k+=O*(5*q),k+=R*(5*K),k+=I*(5*oe),A+=k>>>13,k&=8191;var he=A;he+=a*oe,he+=c*Y,he+=u*Z,he+=d*V,he+=v*L,A=he>>>13,he&=8191,he+=y*J,he+=S*N,he+=O*(5*j),he+=R*(5*q),he+=I*(5*K),A+=he>>>13,he&=8191;var D=A;D+=a*K,D+=c*oe,D+=u*Y,D+=d*Z,D+=v*V,A=D>>>13,D&=8191,D+=y*L,D+=S*J,D+=O*N,D+=R*(5*j),D+=I*(5*q),A+=D>>>13,D&=8191;var Q=A;Q+=a*q,Q+=c*K,Q+=u*oe,Q+=d*Y,Q+=v*Z,A=Q>>>13,Q&=8191,Q+=y*V,Q+=S*L,Q+=O*J,Q+=R*N,Q+=I*(5*j),A+=Q>>>13,Q&=8191;var se=A;se+=a*j,se+=c*q,se+=u*K,se+=d*oe,se+=v*Y,A=se>>>13,se&=8191,se+=y*Z,se+=S*V,se+=O*L,se+=R*J,se+=I*N,A+=se>>>13,se&=8191,A=(A<<2)+A|0,A=A+E|0,E=A&8191,A=A>>>13,g+=A,a=E,c=g,u=C,d=P,v=w,y=k,S=he,O=D,R=Q,I=se,r+=16,n-=16}this._h[0]=a,this._h[1]=c,this._h[2]=u,this._h[3]=d,this._h[4]=v,this._h[5]=y,this._h[6]=S,this._h[7]=O,this._h[8]=R,this._h[9]=I},t.prototype.finish=function(e,r){r===void 0&&(r=0);var n=new Uint16Array(10),i,a,c,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,a=(i^1)-1,u=0;u<10;u++)n[u]&=a;for(a=~a,u=0;u<10;u++)this._h[u]=this._h[u]&a|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,c=this._h[0]+this._pad[0],this._h[0]=c&65535,u=1;u<8;u++)c=(this._h[u]+this._pad[u]|0)+(c>>>16)|0,this._h[u]=c&65535;return e[r+0]=this._h[0]>>>0,e[r+1]=this._h[0]>>>8,e[r+2]=this._h[1]>>>0,e[r+3]=this._h[1]>>>8,e[r+4]=this._h[2]>>>0,e[r+5]=this._h[2]>>>8,e[r+6]=this._h[3]>>>0,e[r+7]=this._h[3]>>>8,e[r+8]=this._h[4]>>>0,e[r+9]=this._h[4]>>>8,e[r+10]=this._h[5]>>>0,e[r+11]=this._h[5]>>>8,e[r+12]=this._h[6]>>>0,e[r+13]=this._h[6]>>>8,e[r+14]=this._h[7]>>>0,e[r+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var r=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var a=0;a<i;a++)this._buffer[this._leftover+a]=e[r+a];if(n-=i,r+=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,r,i),r+=i,n-=i),n){for(var a=0;a<n;a++)this._buffer[this._leftover+a]=e[r+a];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return fd.wipe(this._buffer),fd.wipe(this._r),fd.wipe(this._h),fd.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();Jo.Poly1305=wx;function KN(t,e){var r=new wx(t);r.update(e);var n=r.digest();return r.clean(),n}o(KN,"oneTimeAuth");Jo.oneTimeAuth=KN;function jN(t,e){return t.length!==Jo.DIGEST_LENGTH||e.length!==Jo.DIGEST_LENGTH?!1:zN.equal(t,e)}o(jN,"equal");Jo.equal=jN});var Sx=De(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var cd=C1(),GN=_x(),Su=li(),Ex=Aa(),VN=k1();Yo.KEY_LENGTH=32;Yo.NONCE_LENGTH=12;Yo.TAG_LENGTH=16;var Ax=new Uint8Array(16),WN=function(){function t(e){if(this.nonceLength=Yo.NONCE_LENGTH,this.tagLength=Yo.TAG_LENGTH,e.length!==Yo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(t,"ChaCha20Poly1305"),t.prototype.seal=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);cd.stream(this._key,a,c,4);var u=r.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 cd.streamXOR(this._key,a,r,d,4),this._authenticate(d.subarray(d.length-this.tagLength,d.length),c,d.subarray(0,d.length-this.tagLength),n),Su.wipe(a),d},t.prototype.open=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);cd.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,r.subarray(0,r.length-this.tagLength),n),!VN.equal(u,r.subarray(r.length-this.tagLength,r.length)))return null;var d=r.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 cd.streamXOR(this._key,a,r.subarray(0,r.length-this.tagLength),v,4),Su.wipe(a),v},t.prototype.clean=function(){return Su.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var a=new GN.Poly1305(r);i&&(a.update(i),i.length%16>0&&a.update(Ax.subarray(i.length%16))),a.update(n),n.length%16>0&&a.update(Ax.subarray(n.length%16));var c=new Uint8Array(8);i&&Ex.writeUint64LE(i.length,c),a.update(c),Ex.writeUint64LE(n.length,c),a.update(c);for(var u=a.digest(),d=0;d<u.length;d++)e[d]=u[d];a.clean(),Su.wipe(u),Su.wipe(c)},t}();Yo.ChaCha20Poly1305=WN});var Cx=De(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});var Mx=yx(),Tx=Sx(),Mu=li();Xo.KEY_LENGTH=32;Xo.NONCE_LENGTH=24;Xo.TAG_LENGTH=16;var JN=function(){function t(e){if(this.nonceLength=Xo.NONCE_LENGTH,this.tagLength=Xo.TAG_LENGTH,e.length!==Xo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(t,"XChaCha20Poly1305"),t.prototype.seal=function(e,r,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var a=Mx.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new Tx.ChaCha20Poly1305(a),d=u.seal(c,r,n,i);return Mu.wipe(a),Mu.wipe(c),u.clean(),d},t.prototype.open=function(e,r,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=Mx.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new Tx.ChaCha20Poly1305(a),d=u.open(c,r,n,i);return Mu.wipe(a),Mu.wipe(c),u.clean(),d},t.prototype.clean=function(){return Mu.wipe(this._key),this},t}();Xo.XChaCha20Poly1305=JN});var zi=De((jG,g4)=>{g4.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 Lu=De((GG,v4)=>{v4.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 w4=De($r=>{var y4=$r,Td=4294967292,Cd=4294967293,tb=4294967294,x4=4294967295,Be=[0,1,3,7,15,31,63,127,255,511,1023],$s=["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"],mL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),qn=[];mL.forEach(t=>{qn.push(t.charCodeAt(0))});$r.utf8={encode(t){let e=[];return t.forEach(r=>{if(r>=0&&r<=127)e.push(r);else if(r<=2047)e.push(192+(r>>6&Be[5])),e.push(128+(r&Be[6]));else if(r<55296||r>57343&&r<=65535)e.push(224+(r>>12&Be[4])),e.push(128+(r>>6&Be[6])),e.push(128+(r&Be[6]));else if(r>=65536&&r<=1114111){let n=r>>16&Be[5];e.push(240+(n>>2)),e.push(128+((n&Be[2])<<4)+(r>>12&Be[4])),e.push(128+(r>>6&Be[6])),e.push(128+(r&Be[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${r}`)}),Buffer.from(e)},decode(t,e){function r(I,N){if((N&192)!==128)return Cd;let J=((I&Be[5])<<6)+(N&Be[6]);return J<128?Td:J}o(r,"bytes2");function n(I,N,J){if((J&192)!==128||(N&192)!==128)return Cd;let L=((I&Be[4])<<12)+((N&Be[6])<<6)+(J&Be[6]);return L<2048?Td:L>=55296&&L<=57343?tb:L}o(n,"bytes3");function i(I,N,J,L){if((L&192)!==128||(J&192)!==128||(N&192)!==128)return Cd;let V=(((I&Be[3])<<2)+(N>>4&Be[2])<<16)+((N&Be[4])<<12)+((J&Be[6])<<6)+(L&Be[6]);return V<65536?Td:V>1114111?tb:V}o(i,"bytes4");let a,c,u,d,v,y,S=t.length,O=e?3:0,R=[];for(;O<S;){c=t[O],a=x4;let I=!0;for(;I;){if(c>=0&&c<=127){a=c,y=1;break}if(u=O+1,u<S&&c>=194&&c<=223){a=r(c,t[u]),y=2;break}if(d=O+2,d<S&&c>=224&&c<=239){a=n(c,t[u],t[d]),y=3;break}if(v=O+3,v<S&&c>=240&&c<=244){a=i(c,t[u],t[d],t[v]),y=4;break}break}if(a>1114111){let N=`byte[${O}]`;throw a===x4?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${N}`):a===Cd?new RangeError(`utf8.decode: illegal trailing byte found at: ${N}`):a===tb?new RangeError(`utf8.decode: code point out of range found at: ${N}`):a===Td?new RangeError(`utf8.decode: non-shortest form found at: ${N}`):new RangeError(`utf8.decode: unrecognized error found at: ${N}`)}R.push(a),O+=y}return R}};$r.utf16be={encode(t){let e=[],r,n,i;for(let a=0;a<t.length;a+=1)if(r=t[a],r>=0&&r<=55295||r>=57344&&r<=65535)e.push(r>>8&Be[8]),e.push(r&Be[8]);else if(r>=65536&&r<=1114111)i=r-65536,n=55296+(i>>10),i=56320+(i&Be[10]),e.push(n>>8&Be[8]),e.push(n&Be[8]),e.push(i>>8&Be[8]),e.push(i&Be[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${a}]: ${r}`);return Buffer.from(e)},decode(t,e){if(t.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${t.length}`);let r=[],n=t.length,i=e?2:0,a=0,c,u,d,v,y,S;for(;i<n;){for(;;){if(d=i+1,d<n){if(y=(t[i]<<8)+t[d],y<55296||y>57343){c=y,u=2;break}if(v=i+3,v<n&&(S=(t[i+2]<<8)+t[v],y<=56319&&S>=56320&&S<=57343)){c=65536+(y-55296<<10)+(S-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}r[a++]=c,i+=u}return r}};$r.utf16le={encode(t){let e=[],r,n,i;for(let a=0;a<t.length;a+=1)if(r=t[a],r>=0&&r<=55295||r>=57344&&r<=65535)e.push(r&Be[8]),e.push(r>>8&Be[8]);else if(r>=65536&&r<=1114111)i=r-65536,n=55296+(i>>10),i=56320+(i&Be[10]),e.push(n&Be[8]),e.push(n>>8&Be[8]),e.push(i&Be[8]),e.push(i>>8&Be[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${a}]: ${r}`);return Buffer.from(e)},decode(t,e){if(t.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${t.length}`);let r=[],n=t.length,i=e?2:0,a=0,c,u,d,v,y,S;for(;i<n;){for(;;){if(d=i+1,d<n){if(y=(t[d]<<8)+t[i],y<55296||y>57343){c=y,u=2;break}if(v=i+3,v<n&&(S=(t[v]<<8)+t[i+2],y<=56319&&S>=56320&&S<=57343)){c=65536+(y-55296<<10)+(S-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}r[a++]=c,i+=u}return r}};$r.utf32be={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${r/4}]: ${n}`);e[r++]=n>>24&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t,e){if(t.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${t.length}`);let r=[],n=e?4:0;for(;n<t.length;n+=4){let i=(t[n]<<24)+(t[n+1]<<16)+(t[n+2]<<8)+t[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);r.push(i)}return r}};$r.utf32le={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${n}`);e[r++]=n&Be[8],e[r++]=n>>8&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>24&Be[8]}),e},decode(t,e){if(t.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${t.length}`);let r=[],n=e?4:0;for(;n<t.length;n+=4){let i=(t[n+3]<<24)+(t[n+2]<<16)+(t[n+1]<<8)+t[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);r.push(i)}return r}};$r.uint7={encode(t){let e=Buffer.alloc(t.length);for(let r=0;r<t.length;r+=1){if(t[r]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${r}]: ${t[r]}`);e[r]=t[r]}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=1){if(t[r]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${r}]: ${t[r]}`);e[r]=t[r]}return e}};$r.uint8={encode(t){let e=Buffer.alloc(t.length);for(let r=0;r<t.length;r+=1){if(t[r]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${r}]: ${t[r]}`);e[r]=t[r]}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=1)e[r]=t[r];return e}};$r.uint16be={encode(t){let e=Buffer.alloc(t.length*2),r=0;return t.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${r/2}]: ${n}`);e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t){if(t.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=2)e.push((t[r]<<8)+t[r+1]);return e}};$r.uint16le={encode(t){let e=Buffer.alloc(t.length*2),r=0;return t.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${r/2}]: ${n}`);e[r++]=n&Be[8],e[r++]=n>>8&Be[8]}),e},decode(t){if(t.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=2)e.push((t[r+1]<<8)+t[r]);return e}};$r.uint32be={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{e[r++]=n>>24&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t){if(t.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=4)e.push((t[r]<<24)+(t[r+1]<<16)+(t[r+2]<<8)+t[r+3]);return e}};$r.uint32le={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{e[r++]=n&Be[8],e[r++]=n>>8&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>24&Be[8]}),e},decode(t){if(t.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=4)e.push((t[r+3]<<24)+(t[r+2]<<16)+(t[r+1]<<8)+t[r]);return e}};$r.string={encode(t){return y4.utf16le.encode(t).toString("utf16le")},decode(t){return y4.utf16le.decode(Buffer.from(t,"utf16le"),0)}};$r.escaped={encode(t){let e=[];for(let r=0;r<t.length;r+=1){let n=t[r];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${$s[n]}`;else if(n>=127&&n<=255)i+=`\`x${$s[n]}`;else if(n>=256&&n<=65535)i+=`\`u${$s[n>>8&Be[8]]}${$s[n&Be[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let c=n>>24&Be[8];c>0&&(i+=$s[c]),i+=`${$s[n>>16&Be[8]]+$s[n>>8&Be[8]]+$s[n&Be[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(c=>{e.push(c)})}}return Buffer.from(e)},decode(t){function e(S){return S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102}o(e,"isHex");function r(S,O,R){let I={char:null,nexti:S+2,error:!0};if(S+1<O&&e(R[S])&&e(R[S+1])){let N=String.fromCodePoint(R[S],R[S+1]);I.char=parseInt(N,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(r,"getx");function n(S,O,R){let I={char:null,nexti:S+4,error:!0};if(S+3<O&&e(R[S])&&e(R[S+1])&&e(R[S+2])&&e(R[S+3])){let N=String.fromCodePoint(R[S],R[S+1],R[S+2],R[S+3]);I.char=parseInt(N,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(n,"getu");function i(S,O,R){let I={char:null,nexti:S+4,error:!0},N="";for(;S<O&&e(R[S]);)N+=String.fromCodePoint(R[S]),S+=1;return I.char=parseInt(N,16),R[S]===125&&!Number.isNaN(I.char)&&(I.error=!1),I.nexti=S+1,I}o(i,"getU");let a=[],c=t.length,u,d,v,y=0;for(;y<c;){for(;;){if(v=!0,t[y]!==96){a.push(t[y]),y+=1,v=!1;break}if(u=y+1,u>=c)break;if(t[u]===96){a.push(96),y+=2,v=!1;break}if(t[u]===120){if(d=r(u+1,c,t),d.error)break;a.push(d.char),y=d.nexti,v=!1;break}if(t[u]===117){if(t[u+1]===123){if(d=i(u+2,c,t),d.error)break;a.push(d.char),y=d.nexti,v=!1;break}if(d=n(u+1,c,t),d.error)break;a.push(d.char),y=d.nexti,v=!1;break}break}if(v)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${y}]`)}return a}};var Bu=13,vi=10;$r.lineEnds={crlf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Bu:r+1<t.length&&t[r+1]===vi?r+=2:r+=1,e.push(Bu),e.push(vi);break;case vi:e.push(Bu),e.push(vi),r+=1;break;default:e.push(t[r]),r+=1;break}return e.length>0&&e[e.length-1]!==vi&&(e.push(Bu),e.push(vi)),e},lf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Bu:r+1<t.length&&t[r+1]===vi?r+=2:r+=1,e.push(vi);break;case vi:e.push(vi),r+=1;break;default:e.push(t[r]),r+=1;break}return e.length>0&&e[e.length-1]!==vi&&e.push(vi),e}};$r.base64={encode(t){if(t.length===0)return Buffer.alloc(0);let e,r,n,i=t.length%3;i=i>0?3-i:0;let a=(t.length+i)/3,c=Buffer.alloc(a*4);i>0&&(a-=1),e=0,r=0;for(let u=0;u<a;u+=1)n=t[e++]<<16,n+=t[e++]<<8,n+=t[e++],c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[n>>6&Be[6]],c[r++]=qn[n&Be[6]];if(i===0)return c;if(i===1)return n=t[e++]<<16,n+=t[e]<<8,c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[n>>6&Be[6]],c[r]=qn[64],c;if(i===2)return n=t[e]<<16,c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[64],c[r]=qn[64],c},decode(t){function e(y){let S=[],O=0;for(let R=0;R<y.length;R+=1){let I=y[R],N=!0;for(;N&&!(I===32||I===9||I===10||I===13);){if(I>=65&&I<=90){S.push(I-65);break}if(I>=97&&I<=122){S.push(I-71);break}if(I>=48&&I<=57){S.push(I+4);break}if(I===43){S.push(62);break}if(I===47){S.push(63);break}if(I===61){S.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${I}`)}}if(S.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${S.length}`);switch(O){case 0:break;case 1:if(S[S.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(S[S.length-1]!==64||S[S.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:Buffer.from(S)}}if(o(e,"validate"),t.length===0)return Buffer.alloc(0);let r=e(t),{tail:n}=r,i=r.buf,a,c,u,d=i.length/4,v=Buffer.alloc(d*3-n);n>0&&(d-=1),c=0,a=0;for(let y=0;y<d;y+=1)u=i[a++]<<18,u+=i[a++]<<12,u+=i[a++]<<6,u+=i[a++],v[c++]=u>>16&Be[8],v[c++]=u>>8&Be[8],v[c++]=u&Be[8];return n===1&&(u=i[a++]<<18,u+=i[a++]<<12,u+=i[a]<<6,v[c++]=u>>16&Be[8],v[c]=u>>8&Be[8]),n===2&&(u=i[a++]<<18,u+=i[a++]<<12,v[c]=u>>16&Be[8]),v},toString(t){if(t.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${t.length}`);let e="",r=0;function n(a,c,u,d){switch(r){case 76:e+=`\r
35
+ ${a}${c}${u}${d}`,r=4;break;case 75:e+=`${a}\r
36
+ ${c}${u}${d}`,r=3;break;case 74:e+=`${a+c}\r
37
+ ${u}${d}`,r=2;break;case 73:e+=`${a+c+u}\r
38
+ ${d}`,r=1;break;default:e+=a+c+u+d,r+=4;break}}o(n,"buildLine");function i(a){return a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a===43||a===47||a===61}o(i,"validate");for(let a=0;a<t.length;a+=4){for(let c=a;c<a+4;c+=1)if(!i(t[c]))throw new RangeError(`base64.toString: buf[${c}]: ${t[c]} : not valid base64 character code`);n(String.fromCharCode(t[a]),String.fromCharCode(t[a+1]),String.fromCharCode(t[a+2]),String.fromCharCode(t[a+3]))}return e}}});var ob=De($u=>{var _4=$u,Ht=w4(),Uu="UTF8",nb="UTF16",mo="UTF16BE",Qo="UTF16LE",ib="UTF32",bo="UTF32BE",es="UTF32LE",fc="UINT7",E4="ASCII",A4="BINARY",cc="UINT8",S4="UINT16",kd="UINT16LE",uc="UINT16BE",M4="UINT32",Id="UINT32LE",lc="UINT32BE",Dd="ESCAPED",Fs="STRING",bL=o(function(e){e.type=Uu;let r=e.data;e.bom=0,r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191&&(e.bom=3)},"bom8"),gL=o(function(e){let r=e.data;switch(e.bom=0,e.type){case nb:e.type=mo,r.length>=2&&(r[0]===254&&r[1]===255?e.bom=2:r[0]===255&&r[1]===254&&(e.type=Qo,e.bom=2));break;case mo:if(e.type=mo,r.length>=2){if(r[0]===254&&r[1]===255)e.bom=2;else if(r[0]===255&&r[1]===254)throw new TypeError(`src type: "${mo}" specified but BOM is for "${Qo}"`)}break;case Qo:if(e.type=Qo,r.length>=0){if(r[0]===254&&r[1]===255)throw new TypeError(`src type: "${Qo}" specified but BOM is for "${mo}"`);r[0]===255&&r[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),vL=o(function(e){let r=e.data;switch(e.bom=0,e.type){case ib:e.type=bo,r.length>=4&&(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255&&(e.bom=4),r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0&&(e.type=es,e.bom=4));break;case bo:if(e.type=bo,r.length>=4&&(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255&&(e.bom=4),r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0))throw new TypeError(`src type: ${bo} specified but BOM is for ${es}"`);break;case es:if(e.type=es,r.length>=4){if(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255)throw new TypeError(`src type: "${es}" specified but BOM is for "${bo}"`);r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),yL=o(function(e,r){function n(a){let c={type:"",base64:!1},d=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(a);return d&&(d[2]&&(c.type=d[2].toUpperCase()),d[1]&&(c.base64=!0)),c}if(o(n,"getType"),typeof e!="string"||e==="")throw new TypeError(`type: "${e}" not recognized`);let i=n(e.toUpperCase());if(i.base64){if(i.type===Fs)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${Fs}`);if(Buffer.isBuffer(r))i.data=Ht.base64.decode(r);else if(typeof r=="string"){let a=Buffer.from(r,"ascii");i.data=Ht.base64.decode(a)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof r}`)}else i.data=r;switch(i.type){case Uu:bL(i);break;case nb:case mo:case Qo:gL(i);break;case ib:case bo:case es:vL(i);break;case S4:i.type=uc;break;case M4:i.type=lc;break;case E4:i.type=fc;break;case A4:i.type=cc;break;case fc:case cc:case kd:case uc:case Id:case lc:case Fs:case Dd:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===Fs){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),xL=o(function(e,r){function n(a){let c,u,d={crlf:!1,lf:!1,base64:!1,type:""},v=!0;for(;v;){if(u=a,c=a.slice(0,5),c==="CRLF:"){d.crlf=!0,u=a.slice(5);break}if(c=a.slice(0,3),c==="LF:"){d.lf=!0,u=a.slice(3);break}break}return c=u.split(":"),c.length===1?d.type=c[0]:c.length===2&&c[1]==="BASE64"&&(d.base64=!0,d.type=c[0]),d}if(o(n,"getType"),!Array.isArray(r))throw new TypeError(`dst chars: not array: "${typeof r}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case Uu:case mo:case Qo:case bo:case es:case fc:case cc:case kd:case uc:case Id:case lc:case Dd:break;case Fs:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${Fs}`);break;case E4:i.type=fc;break;case A4:i.type=cc;break;case nb:i.type=mo;break;case ib:i.type=bo;break;case S4:i.type=uc;break;case M4:i.type=lc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),rb=o(function(e,r){switch(e){case Uu:return Ht.utf8.encode(r);case mo:return Ht.utf16be.encode(r);case Qo:return Ht.utf16le.encode(r);case bo:return Ht.utf32be.encode(r);case es:return Ht.utf32le.encode(r);case fc:return Ht.uint7.encode(r);case cc:return Ht.uint8.encode(r);case uc:return Ht.uint16be.encode(r);case kd:return Ht.uint16le.encode(r);case lc:return Ht.uint32be.encode(r);case Id:return Ht.uint32le.encode(r);case Fs:return Ht.string.encode(r);case Dd:return Ht.escaped.encode(r);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),wL=o(function(e){switch(e.type){case Uu:return Ht.utf8.decode(e.data,e.bom);case Qo:return Ht.utf16le.decode(e.data,e.bom);case mo:return Ht.utf16be.decode(e.data,e.bom);case bo:return Ht.utf32be.decode(e.data,e.bom);case es:return Ht.utf32le.decode(e.data,e.bom);case fc:return Ht.uint7.decode(e.data);case cc:return Ht.uint8.decode(e.data);case uc:return Ht.uint16be.decode(e.data);case kd:return Ht.uint16le.decode(e.data);case lc:return Ht.uint32be.decode(e.data);case Id:return Ht.uint32le.decode(e.data);case Fs:return Ht.string.decode(e.data);case Dd:return Ht.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");$u.decode=o(function(e,r){let n=yL(e,r);return wL(n)},"exportsDecode");$u.encode=o(function(e,r){let n,i,a=xL(e,r);return a.crlf?(n=Ht.lineEnds.crlf(r),i=rb(a.type,n)):a.lf?(n=Ht.lineEnds.lf(r),i=rb(a.type,n)):i=rb(a.type,r),a.base64&&(i=Ht.base64.encode(i)),i},"exportsEncode");$u.convert=o(function(e,r,n){return _4.encode(n,_4.decode(e,r))},"convert")});var sb=De((JG,T4)=>{T4.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
39
+ .apg-mono {
40
+ font-family: monospace;
41
+ }
42
+ .apg-active {
43
+ font-weight: bold;
44
+ color: #000000;
45
+ }
46
+ .apg-match {
47
+ font-weight: bold;
48
+ color: #264BFF;
49
+ }
50
+ .apg-empty {
51
+ font-weight: bold;
52
+ color: #0fbd0f;
53
+ }
54
+ .apg-nomatch {
55
+ font-weight: bold;
56
+ color: #FF4000;
57
+ }
58
+ .apg-lh-match {
59
+ font-weight: bold;
60
+ color: #1A97BA;
61
+ }
62
+ .apg-lb-match {
63
+ font-weight: bold;
64
+ color: #5F1687;
65
+ }
66
+ .apg-remainder {
67
+ font-weight: bold;
68
+ color: #999999;
69
+ }
70
+ .apg-ctrl-char {
71
+ font-weight: bolder;
72
+ font-style: italic;
73
+ font-size: 0.6em;
74
+ }
75
+ .apg-line-end {
76
+ font-weight: bold;
77
+ color: #000000;
78
+ }
79
+ .apg-error {
80
+ font-weight: bold;
81
+ color: #FF4000;
82
+ }
83
+ .apg-phrase {
84
+ color: #000000;
85
+ background-color: #8caae6;
86
+ }
87
+ .apg-empty-phrase {
88
+ color: #0fbd0f;
89
+ }
90
+ table.apg-state {
91
+ font-family: monospace;
92
+ margin-top: 5px;
93
+ font-size: 11px;
94
+ line-height: 130%;
95
+ text-align: left;
96
+ border: 1px solid black;
97
+ border-collapse: collapse;
98
+ }
99
+ table.apg-state th,
100
+ table.apg-state td {
101
+ text-align: left;
102
+ border: 1px solid black;
103
+ border-collapse: collapse;
104
+ }
105
+ table.apg-state th:nth-last-child(2),
106
+ table.apg-state td:nth-last-child(2) {
107
+ text-align: right;
108
+ }
109
+ table.apg-state caption {
110
+ font-size: 125%;
111
+ line-height: 130%;
112
+ font-weight: bold;
113
+ text-align: left;
114
+ }
115
+ table.apg-stats {
116
+ font-family: monospace;
117
+ margin-top: 5px;
118
+ font-size: 11px;
119
+ line-height: 130%;
120
+ text-align: right;
121
+ border: 1px solid black;
122
+ border-collapse: collapse;
123
+ }
124
+ table.apg-stats th,
125
+ table.apg-stats td {
126
+ text-align: right;
127
+ border: 1px solid black;
128
+ border-collapse: collapse;
129
+ }
130
+ table.apg-stats caption {
131
+ font-size: 125%;
132
+ line-height: 130%;
133
+ font-weight: bold;
134
+ text-align: left;
135
+ }
136
+ table.apg-trace {
137
+ font-family: monospace;
138
+ margin-top: 5px;
139
+ font-size: 11px;
140
+ line-height: 130%;
141
+ text-align: right;
142
+ border: 1px solid black;
143
+ border-collapse: collapse;
144
+ }
145
+ table.apg-trace caption {
146
+ font-size: 125%;
147
+ line-height: 130%;
148
+ font-weight: bold;
149
+ text-align: left;
150
+ }
151
+ table.apg-trace th,
152
+ table.apg-trace td {
153
+ text-align: right;
154
+ border: 1px solid black;
155
+ border-collapse: collapse;
156
+ }
157
+ table.apg-trace th:last-child,
158
+ table.apg-trace th:nth-last-child(2),
159
+ table.apg-trace td:last-child,
160
+ table.apg-trace td:nth-last-child(2) {
161
+ text-align: left;
162
+ }
163
+ table.apg-grammar {
164
+ font-family: monospace;
165
+ margin-top: 5px;
166
+ font-size: 11px;
167
+ line-height: 130%;
168
+ text-align: right;
169
+ border: 1px solid black;
170
+ border-collapse: collapse;
171
+ }
172
+ table.apg-grammar caption {
173
+ font-size: 125%;
174
+ line-height: 130%;
175
+ font-weight: bold;
176
+ text-align: left;
177
+ }
178
+ table.apg-grammar th,
179
+ table.apg-grammar td {
180
+ text-align: right;
181
+ border: 1px solid black;
182
+ border-collapse: collapse;
183
+ }
184
+ table.apg-grammar th:last-child,
185
+ table.apg-grammar td:last-child {
186
+ text-align: left;
187
+ }
188
+ table.apg-rules {
189
+ font-family: monospace;
190
+ margin-top: 5px;
191
+ font-size: 11px;
192
+ line-height: 130%;
193
+ text-align: right;
194
+ border: 1px solid black;
195
+ border-collapse: collapse;
196
+ }
197
+ table.apg-rules caption {
198
+ font-size: 125%;
199
+ line-height: 130%;
200
+ font-weight: bold;
201
+ text-align: left;
202
+ }
203
+ table.apg-rules th,
204
+ table.apg-rules td {
205
+ text-align: right;
206
+ border: 1px solid black;
207
+ border-collapse: collapse;
208
+ }
209
+ table.apg-rules a {
210
+ color: #003399 !important;
211
+ }
212
+ table.apg-rules a:hover {
213
+ color: #8caae6 !important;
214
+ }
215
+ table.apg-attrs {
216
+ font-family: monospace;
217
+ margin-top: 5px;
218
+ font-size: 11px;
219
+ line-height: 130%;
220
+ text-align: center;
221
+ border: 1px solid black;
222
+ border-collapse: collapse;
223
+ }
224
+ table.apg-attrs caption {
225
+ font-size: 125%;
226
+ line-height: 130%;
227
+ font-weight: bold;
228
+ text-align: left;
229
+ }
230
+ table.apg-attrs th,
231
+ table.apg-attrs td {
232
+ text-align: center;
233
+ border: 1px solid black;
234
+ border-collapse: collapse;
235
+ }
236
+ table.apg-attrs th:nth-child(1),
237
+ table.apg-attrs th:nth-child(2),
238
+ table.apg-attrs th:nth-child(3) {
239
+ text-align: right;
240
+ }
241
+ table.apg-attrs td:nth-child(1),
242
+ table.apg-attrs td:nth-child(2),
243
+ table.apg-attrs td:nth-child(3) {
244
+ text-align: right;
245
+ }
246
+ table.apg-attrs a {
247
+ color: #003399 !important;
248
+ }
249
+ table.apg-attrs a:hover {
250
+ color: #8caae6 !important;
251
+ }
252
+ `},"emittcss")});var Ha=De(kr=>{var _n=Lu(),ab=ob(),_L=sb(),hr=zi(),qs="utilities.js: ",ts=kr,qa=o(function(t,e,r){let n,i=e,a=!0;for(;a;){if(t<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=t;break}if(i>=t){i=t,n=t;break}if(typeof r!="number"){n=t;break}if(n=i+r,n>t){n=t;break}break}return{beg:i,end:n}},"getBounds");kr.htmlToPage=function(t,e){let r;if(typeof t!="string")throw new Error(`${qs}htmlToPage: input HTML is not a string`);typeof e!="string"?r="htmlToPage":r=e;let n="";return n+=`<!DOCTYPE html>
253
+ `,n+=`<html lang="en">
254
+ `,n+=`<head>
255
+ `,n+=`<meta charset="utf-8">
256
+ `,n+=`<title>${r}</title>
257
+ `,n+=`<style>
258
+ `,n+=_L(),n+=`</style>
259
+ `,n+=`</head>
260
+ <body>
261
+ `,n+=`<p>${new Date}</p>
262
+ `,n+=t,n+=`</body>
263
+ </html>
264
+ `,n};kr.parserResultToHtml=function(t,e){let r=null;typeof e=="string"&&e!==""&&(r=e);let n,i;t.success===!0?n=`<span class="${_n.CLASS_MATCH}">true</span>`:n=`<span class="${_n.CLASS_NOMATCH}">false</span>`,t.state===hr.EMPTY?i=`<span class="${_n.CLASS_EMPTY}">EMPTY</span>`:t.state===hr.MATCH?i=`<span class="${_n.CLASS_MATCH}">MATCH</span>`:t.state===hr.NOMATCH?i=`<span class="${_n.CLASS_NOMATCH}">NOMATCH</span>`:i=`<span class="${_n.CLASS_NOMATCH}">unrecognized</span>`;let a="";return a+=`<table class="${_n.CLASS_STATE}">
265
+ `,r&&(a+=`<caption>${r}</caption>
266
+ `),a+=`<tr><th>state item</th><th>value</th><th>description</th></tr>
267
+ `,a+=`<tr><td>parser success</td><td>${n}</td>
268
+ `,a+=`<td><span class="${_n.CLASS_MATCH}">true</span> if the parse succeeded,
269
+ `,a+=` <span class="${_n.CLASS_NOMATCH}">false</span> otherwise`,a+=`<br><i>NOTE: for success, entire string must be matched</i></td></tr>
270
+ `,a+=`<tr><td>parser state</td><td>${i}</td>
271
+ `,a+=`<td><span class="${_n.CLASS_EMPTY}">EMPTY</span>, `,a+=`<span class="${_n.CLASS_MATCH}">MATCH</span> or
272
+ `,a+=`<span class="${_n.CLASS_NOMATCH}">NOMATCH</span></td></tr>
273
+ `,a+=`<tr><td>string length</td><td>${t.length}</td><td>length of the input (sub)string</td></tr>
274
+ `,a+=`<tr><td>matched length</td><td>${t.matched}</td><td>number of input string characters matched</td></tr>
275
+ `,a+=`<tr><td>max matched</td><td>${t.maxMatched}</td><td>maximum number of input string characters matched</td></tr>
276
+ `,a+=`<tr><td>max tree depth</td><td>${t.maxTreeDepth}</td><td>maximum depth of the parse tree reached</td></tr>
277
+ `,a+=`<tr><td>node hits</td><td>${t.nodeHits}</td><td>number of parse tree node hits (opcode function calls)</td></tr>
278
+ `,a+=`<tr><td>input length</td><td>${t.inputLength}</td><td>length of full input string</td></tr>
279
+ `,a+=`<tr><td>sub-string begin</td><td>${t.subBegin}</td><td>sub-string first character index</td></tr>
280
+ `,a+=`<tr><td>sub-string end</td><td>${t.subEnd}</td><td>sub-string end-of-string index</td></tr>
281
+ `,a+=`<tr><td>sub-string length</td><td>${t.subLength}</td><td>sub-string length</td></tr>
282
+ `,a+=`</table>
283
+ `,a};kr.charsToString=function(t,e,r){let n,i;if(typeof e=="number"){if(e>=t.length)return"";n=e<0?0:e}else n=0;if(typeof r=="number"){if(r<=0)return"";i=r>t.length-n?t.length:n+r}else i=t.length;return n<i?ab.encode("UTF16LE",t.slice(n,i)).toString("utf16le"):""};kr.stringToChars=function(t){return ab.decode("STRING",t)};kr.opcodeToString=function(t){let e="unknown";switch(t){case hr.ALT:e="ALT";break;case hr.CAT:e="CAT";break;case hr.RNM:e="RNM";break;case hr.UDT:e="UDT";break;case hr.AND:e="AND";break;case hr.NOT:e="NOT";break;case hr.REP:e="REP";break;case hr.TRG:e="TRG";break;case hr.TBS:e="TBS";break;case hr.TLS:e="TLS";break;case hr.BKR:e="BKR";break;case hr.BKA:e="BKA";break;case hr.BKN:e="BKN";break;case hr.ABG:e="ABG";break;case hr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};kr.stateToString=function(t){let e="unknown";switch(t){case hr.ACTIVE:e="ACTIVE";break;case hr.MATCH:e="MATCH";break;case hr.EMPTY:e="EMPTY";break;case hr.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};kr.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"];kr.charToHex=function(t){let e=t.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};kr.charsToDec=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToDec: input must be an array of integers`);let i=qa(t.length,e,r);if(i.end>i.beg){n+=t[i.beg];for(let a=i.beg+1;a<i.end;a+=1)n+=`,${t[a]}`}return n};kr.charsToHex=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToHex: input must be an array of integers`);let i=qa(t.length,e,r);if(i.end>i.beg){n+=`\\x${ts.charToHex(t[i.beg])}`;for(let a=i.beg+1;a<i.end;a+=1)n+=`,\\x${ts.charToHex(t[a])}`}return n};kr.charsToHtmlEntities=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToHex: input must be an array of integers`);let i=qa(t.length,e,r);if(i.end>i.beg)for(let a=i.beg;a<i.end;a+=1)n+=`&#x${t[a].toString(16)};`;return n};function EL(t){return!(t>=55296&&t<=57343||t>1114111)}o(EL,"isUnicode");kr.charsToUnicode=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToUnicode: input must be an array of integers`);let i=qa(t.length,e,r);if(i.end>i.beg)for(let a=i.beg;a<i.end;a+=1)EL(t[a])?n+=`&#${t[a]};`:n+=` U+${ts.charToHex(t[a])}`;return n};kr.charsToJsUnicode=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToJsUnicode: input must be an array of integers`);let i=qa(t.length,e,r);if(i.end>i.beg){n+=`\\u${ts.charToHex(t[i.beg])}`;for(let a=i.beg+1;a<i.end;a+=1)n+=`,\\u${ts.charToHex(t[a])}`}return n};kr.charsToAscii=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToAscii: input must be an array of integers`);let i=qa(t.length,e,r);for(let a=i.beg;a<i.end;a+=1){let c=t[a];c>=32&&c<=126?n+=String.fromCharCode(c):n+=`\\x${ts.charToHex(c)}`}return n};kr.charsToAsciiHtml=function(t,e,r){if(!Array.isArray(t))throw new Error(`${qs}charsToAsciiHtml: input must be an array of integers`);let n="",i,a=qa(t.length,e,r);for(let c=a.beg;c<a.end;c+=1)i=t[c],i<32||i===127?n+=`<span class="${_n.CLASS_CTRLCHAR}">${ts.asciiChars[i]}</span>`:i>127?n+=`<span class="${_n.CLASS_CTRLCHAR}">U+${ts.charToHex(i)}</span>`:n+=ts.asciiChars[i];return n};kr.stringToAsciiHtml=function(t){let e=ab.decode("STRING",t);return this.charsToAsciiHtml(e)}});var k4=De((XG,C4)=>{C4.exports=o(function(){let e=zi(),r=Ha(),n="ast.js: ",i=this,a=null,c=null,u=null,d=0,v=[],y=[],S=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(N,J,L){S.length=0,O.length=0,v.length=0,d=0,a=N,c=J,u=L;let V,Z=[];for(V=0;V<a.length;V+=1)Z.push(a[V].lower);for(V=0;V<c.length;V+=1)Z.push(c[V].lower);for(d=a.length+c.length,V=0;V<d;V+=1)v[V]=!1,y[V]=null;for(let Y in i.callbacks){let oe=Y.toLowerCase();if(V=Z.indexOf(oe),V<0)throw new Error(`${n}init: node '${Y}' not a rule or udt name`);typeof i.callbacks[Y]=="function"&&(v[V]=!0,y[V]=i.callbacks[Y]),i.callbacks[Y]===!0&&(v[V]=!0)}},"init"),this.ruleDefined=o(function(N){return v[N]!==!1},"ruleDefined"),this.udtDefined=o(function(N){return v[a.length+N]!==!1},"udtDefined"),this.down=o(function(N,J){let L=O.length;return S.push(L),O.push({name:J,thisIndex:L,thatIndex:null,state:e.SEM_PRE,callbackIndex:N,phraseIndex:null,phraseLength:null,stack:S.length}),L},"down"),this.up=o(function(N,J,L,V){let Z=O.length,Y=S.pop();return O.push({name:J,thisIndex:Z,thatIndex:Y,state:e.SEM_POST,callbackIndex:N,phraseIndex:L,phraseLength:V,stack:S.length}),O[Y].thatIndex=Z,O[Y].phraseIndex=L,O[Y].phraseLength=V,Z},"up"),this.translate=o(function(N){let J,L,V;for(let Z=0;Z<O.length;Z+=1)V=O[Z],L=y[V.callbackIndex],V.state===e.SEM_PRE?L!==null&&(J=L(e.SEM_PRE,u,V.phraseIndex,V.phraseLength,N),J===e.SEM_SKIP&&(Z=V.thatIndex)):L!==null&&L(e.SEM_POST,u,V.phraseIndex,V.phraseLength,N)},"translate"),this.setLength=o(function(N){O.length=N,N>0?S.length=O[N-1].stack:S.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let N="";for(let J=0;J<I;J+=1)N+=" ";return N}o(R,"indent"),this.toXml=o(function(N){let J=r.charsToDec,L="decimal integer character codes";if(typeof N=="string"&&N.length>=3){let Y=N.slice(0,3).toLowerCase();Y==="asc"?(J=r.charsToAscii,L="ASCII for printing characters, hex for non-printing"):Y==="hex"?(J=r.charsToHex,L="hexadecimal integer character codes"):Y==="uni"&&(J=r.charsToUnicode,L="Unicode UTF-32 integer character codes")}let V="",Z=0;return V+=`<?xml version="1.0" encoding="utf-8"?>
284
+ `,V+=`<root nodes="${O.length/2}" characters="${u.length}">
285
+ `,V+=`<!-- input string, ${L} -->
286
+ `,V+=R(Z+2),V+=J(u),V+=`
287
+ `,O.forEach(Y=>{Y.state===e.SEM_PRE?(Z+=1,V+=R(Z),V+=`<node name="${Y.name}" index="${Y.phraseIndex}" length="${Y.phraseLength}">
288
+ `,V+=R(Z+2),V+=J(u,Y.phraseIndex,Y.phraseLength),V+=`
289
+ `):(V+=R(Z),V+=`</node><!-- name="${Y.name}" -->
290
+ `,Z-=1)}),V+=`</root>
291
+ `,V},"toSml"),this.phrases=o(function(){let N={},J,L;for(J=0;J<O.length;J+=1)L=O[J],L.state===e.SEM_PRE&&(Array.isArray(N[L.name])||(N[L.name]=[]),N[L.name].push({index:L.phraseIndex,length:L.phraseLength}));return N},"phrases")},"exportsAst")});var fb=De((ZG,I4)=>{I4.exports=o(function(){let e="circular-buffer.js: ",r=-1,n=0;this.init=o(function(a){if(typeof a!="number"||a<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(a),r=-1},"init"),this.increment=o(function(){return r+=1,(r+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return r+1},"items"),this.getListIndex=o(function(a){return r===-1||a<0||a>r||r-a>=n?-1:(a+n)%n},"getListIndex"),this.forEach=o(function(a){if(r!==-1){if(r<n){for(let c=0;c<=r;c+=1)a(c,c);return}for(let c=r-n+1;c<=r;c+=1){let u=(c+n)%n;a(u,c)}}},"forEach")},"exportsCircularBuffer")});var O4=De((QG,D4)=>{D4.exports=o(function(){let e=zi(),r=Ha(),n="parser.js: ",i=this,a;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let c=null,u=null,d,v,y,S,O=0,R=0,I=0,N=null,J=null,L=null,V=null,Z=null,Y=0,oe=1/0,K=1/0,q=o(function(ie,U,X){let me=`${n}evaluateRule(): `;if(ie>=L.length)throw new Error(`${me}rule index: ${ie} out of range`);if(U>=y)throw new Error(`${me}phrase index: ${U} out of range`);let{length:ye}=c;c.push({type:e.RNM,index:ie}),a(ye,U,X),c.pop()},"evaluateRule"),j=o(function(ue,ie,U){let X=`${n}evaluateUdt(): `;if(ue>=V.length)throw new Error(`${X}udt index: ${ue} out of range`);if(ie>=y)throw new Error(`${X}phrase index: ${ie} out of range`);let{length:me}=c;c.push({type:e.UDT,empty:V[ue].empty,index:ue}),a(me,ie,U),c.pop()},"evaluateUdt"),le=o(function(){O=0,R=0,I=0,Y=0,S=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],L=null,V=null,u=null,d=0,v=0,y=0,N=null,J=null,Z=null,c=null},"clear"),T=o(function(){let ue=[],ie=o(function(){let X={};L.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),V.length>0&&V.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),ue.push(X)},"init"),U=o(function(){let X=ue[ue.length-1],me={};for(let ye in X)me[ye]=X[ye];return me},"copy");this.push=o(function(){ue.push(U())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=ue.length-1),ye<1||ye>ue.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return ue.length=ye,ue[ue.length-1]},"pop"),this.length=o(function(){return ue.length},"length"),this.savePhrase=o(function(me,ye,we){ue[ue.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(X){return ue[ue.length-1][X]},ie()},"backRef"),h=o(function(){let ie=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=S[S.length-1],this.uFrame=new T,this.pFrame=new T,this.evaluateRule=q,this.evaluateUdt=j,this.refresh=o(function(){ie.state=e.ACTIVE,ie.phraseLength=0,ie.lookAround=S[S.length-1]},"refresh")},"systemData"),x=o(function(){return S[S.length-1]},"lookAroundValue"),b=o(function(){return S.length>1},"inLookAround"),l=o(function(){return S[S.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),m=o(function(){let ue=`${n}initializeAst(): `,ie=!0;for(;ie;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${ue}ast object not recognized`);break}i.ast!==null&&i.ast.init(L,V,u)},"initializeAst"),_=o(function(){let ue=`${n}initializeTrace(): `,ie=!0;for(;ie;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${ue}trace object not recognized`);break}i.trace!==null&&i.trace.init(L,V,u)},"initializeTrace"),A=o(function(){let ue=`${n}initializeStats(): `,ie=!0;for(;ie;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${ue}stats object not recognized`);break}i.stats!==null&&i.stats.init(L,V)},"initializeStats"),E=o(function(ue){let ie=`${n}initializeGrammar(): `;if(!ue)throw new Error(`${ie}grammar object undefined`);if(ue.grammarObject!=="grammarObject")throw new Error(`${ie}bad grammar object`);L=ue.rules,V=ue.udts},"initializeGrammar"),g=o(function(ue){let ie=`${n}initializeStartRule(): `,U=null;if(typeof ue=="number"){if(ue>=L.length)throw new Error(`${ie}start rule index too large: max: ${L.length}: index: ${ue}`);U=ue}else if(typeof ue=="string"){let X=ue.toLowerCase();for(let me=0;me<L.length;me+=1)if(X===L[me].lower){U=L[me].index;break}if(U===null)throw new Error(`${ie}start rule name '${ue}' not recognized`)}else throw new Error(`${ie}type of start rule '${typeof ue}' not recognized`);return U},"initializeStartRule"),C=o(function(ie,U,X){let me=`${n}initializeInputChars(): `,ye=ie,we=U,ke=X;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=r.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 ke!="number")ke=ye.length-we;else if(ke=Math.floor(ke),ke<0||ke>ye.length-we)throw new Error(`${me}input length out of range: ${ke}`);u=ye,d=we,v=ke,y=d+v},"initializeInputChars"),P=o(function(){let ue=`${n}initializeCallbacks(): `,ie;for(N=[],J=[],ie=0;ie<L.length;ie+=1)N[ie]=null;for(ie=0;ie<V.length;ie+=1)J[ie]=null;let U,X=[];for(ie=0;ie<L.length;ie+=1)X.push(L[ie].lower);for(ie=0;ie<V.length;ie+=1)X.push(V[ie].lower);for(let me in i.callbacks){if(ie=X.indexOf(me.toLowerCase()),ie<0)throw new Error(`${ue}syntax callback '${me}' not a rule or udt name`);if(U=i.callbacks[me],U||(U=null),typeof U=="function"||U===null)ie<L.length?N[ie]=U:J[ie-L.length]=U;else throw new Error(`${ue}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(ie=0;ie<V.length;ie+=1)if(J[ie]===null)throw new Error(`${ue}all UDT callbacks must be defined. UDT callback[${V[ie].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(ue){if(typeof ue!="number")throw new Error(`parser: max tree depth must be integer > 0: ${ue}`);if(oe=Math.floor(ue),oe<=0)throw new Error(`parser: max tree depth must be integer > 0: ${ue}`)},this.setMaxNodeHits=function(ue){if(typeof ue!="number")throw new Error(`parser: max node hits must be integer > 0: ${ue}`);if(K=Math.floor(ue),K<=0)throw new Error(`parser: max node hits must be integer > 0: ${ue}`)};let w=o(function(ue,ie,U){let X,me=`${n}parse(): `;E(ue);let ye=g(ie);P(),_(),A(),m();let we=new h;switch(U!=null&&(Z=U),c=[{type:e.RNM,index:ye}],a(0,d,we),c=null,we.state){case e.ACTIVE:throw new Error(`${me}final state should never be 'ACTIVE'`);case e.NOMATCH:X=!1;break;case e.EMPTY:case e.MATCH:we.phraseLength===v?X=!0:X=!1;break;default:throw new Error("unrecognized state")}return{success:X,state:we.state,length:v,matched:we.phraseLength,maxMatched:Y,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:y,subLength:v}},"privateParse");this.parseSubstring=o(function(ie,U,X,me,ye,we){return le(),C(X,me,ye),w(ie,U,we)},"parseSubstring"),this.parse=o(function(ie,U,X,me){return le(),C(X,0,X.length),w(ie,U,me)},"parse");let k=o(function(ue,ie,U){let X=c[ue];for(let me=0;me<X.children.length&&(a(X.children[me],ie,U),U.state===e.NOMATCH);me+=1);},"opALT"),he=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue],Dt=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=ie,we=0;for(let Oe=0;Oe<ke.children.length;Oe+=1)if(a(ke.children[Oe],ye,U),U.state===e.NOMATCH){X=!1;break}else ye+=U.phraseLength,we+=U.phraseLength;X?(U.state=we===0?e.EMPTY:e.MATCH,U.phraseLength=we):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(Dt),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCAT"),D=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let Dt=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=y||(a(ue+1,me,U),U.state===e.NOMATCH)||U.state===e.EMPTY||(we+=1,ye+=U.phraseLength,me+=U.phraseLength,we===ke.max)););U.state===e.EMPTY||we>=ke.min?(U.state=ye===0?e.EMPTY:e.MATCH,U.phraseLength=ye):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(Dt),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREP"),Q=o(function(ue,ie,U,X){if(ie.phraseLength>U){let me=`${n}opRNM(${ue.name}): callback function error: `;throw me+=`sysData.phraseLength: ${ie.phraseLength}`,me+=` must be <= remaining chars: ${U}`,new Error(me)}switch(ie.state){case e.ACTIVE:if(X!==!0)throw new Error(`${n}opRNM(${ue.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:ie.phraseLength=0;break;case e.MATCH:ie.phraseLength===0&&(ie.state=e.EMPTY);break;case e.NOMATCH:ie.phraseLength=0;break;default:throw new Error(`${n}opRNM(${ue.name}): callback function return error. Unrecognized return state: ${ie.state}`)}},"validateRnmCallbackResult"),se=o(function(ue,ie,U){let X,me,ye,we,ke,Dt,Ue=c[ue],Oe=L[Ue.index],Lt=N[Oe.index],je=!b();if(je&&(me=i.ast&&i.ast.ruleDefined(Ue.index),me&&(X=i.ast.getLength(),i.ast.down(Ue.index,L[Ue.index].name)),we=U.uFrame.length(),ke=U.pFrame.length(),U.uFrame.push(),U.pFrame.push(),Dt=U.pFrame,U.pFrame=new T),Lt===null)ye=c,c=Oe.opcodes,a(0,ie,U),c=ye;else{let Je=y-ie;U.ruleIndex=Oe.index,Lt(U,u,ie,Z),Q(Oe,U,Je,!0),U.state===e.ACTIVE&&(ye=c,c=Oe.opcodes,a(0,ie,U),c=ye,U.ruleIndex=Oe.index,Lt(U,u,ie,Z),Q(Oe,U,Je,!1))}je&&(me&&(U.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Ue.index,Oe.name,ie,U.phraseLength)),U.pFrame=Dt,U.state===e.NOMATCH?(U.uFrame.pop(we),U.pFrame.pop(ke)):Oe.isBkr&&(U.pFrame.savePhrase(Oe.lower,ie,U.phraseLength),U.uFrame.savePhrase(Oe.lower,ie,U.phraseLength)))},"opRNM"),F=o(function(ue,ie,U){if(ie.phraseLength>U){let X=`${n}opUDT(${ue.name}): callback function error: `;throw X+=`sysData.phraseLength: ${ie.phraseLength}`,X+=` must be <= remaining chars: ${U}`,new Error(X)}switch(ie.state){case e.ACTIVE:throw new Error(`${n}opUDT(${ue.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(ue.empty===!1)throw new Error(`${n}opUDT(${ue.name}): callback function return error. May not return EMPTY.`);ie.phraseLength=0;break;case e.MATCH:if(ie.phraseLength===0){if(ue.empty===!1)throw new Error(`${n}opUDT(${ue.name}): callback function return error. May not return EMPTY.`);ie.state=e.EMPTY}break;case e.NOMATCH:ie.phraseLength=0;break;default:throw new Error(`${n}opUDT(${ue.name}): callback function return error. Unrecognized return state: ${ie.state}`)}},"validateUdtCallbackResult"),$=o(function(ue,ie,U){let X,me,ye,we,ke,Dt,Ue=c[ue],Oe=V[Ue.index];U.UdtIndex=Oe.index;let Lt=!b();Lt&&(ye=i.ast&&i.ast.udtDefined(Ue.index),ye&&(me=L.length+Ue.index,X=i.ast.getLength(),i.ast.down(me,Oe.name)),we=U.uFrame.length(),ke=U.pFrame.length(),U.uFrame.push(),U.pFrame.push(),Dt=U.pFrame,U.pFrame=new T);let je=y-ie;J[Ue.index](U,u,ie,Z),F(Oe,U,je),Lt&&(ye&&(U.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Oe.name,ie,U.phraseLength)),U.pFrame=Dt,U.state===e.NOMATCH?(U.uFrame.pop(we),U.pFrame.pop(ke)):Oe.isBkr&&(U.pFrame.savePhrase(Oe.lower,ie,U.phraseLength),U.uFrame.savePhrase(Oe.lower,ie,U.phraseLength)))},"opUDT"),ee=o(function(ue,ie,U){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:y,charsLength:v}),y=u.length,v=u.length-d,a(ue+1,ie,U);let X=S.pop();switch(y=X.charsEnd,v=X.charsLength,U.phraseLength=0,U.state){case e.EMPTY:U.state=e.EMPTY;break;case e.MATCH:U.state=e.EMPTY;break;case e.NOMATCH:U.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${U.state}`)}},"opAND"),ne=o(function(ue,ie,U){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:y,charsLength:v}),y=u.length,v=u.length-d,a(ue+1,ie,U);let X=S.pop();switch(y=X.charsEnd,v=X.charsLength,U.phraseLength=0,U.state){case e.EMPTY:case e.MATCH:U.state=e.NOMATCH;break;case e.NOMATCH:U.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${U.state}`)}},"opNOT"),ae=o(function(ue,ie,U){let X=c[ue];U.state=e.NOMATCH,ie<y&&X.min<=u[ie]&&u[ie]<=X.max&&(U.state=e.MATCH,U.phraseLength=1)},"opTRG"),Ae=o(function(ue,ie,U){let X,me=c[ue],ye=me.string.length;if(U.state=e.NOMATCH,ie+ye<=y){for(X=0;X<ye;X+=1)if(u[ie+X]!==me.string[X])return;U.state=e.MATCH,U.phraseLength=ye}},"opTBS"),ge=o(function(ue,ie,U){let X,me,ye=c[ue];U.state=e.NOMATCH;let we=ye.string.length;if(we===0){U.state=e.EMPTY;return}if(ie+we<=y){for(X=0;X<we;X+=1)if(me=u[ie+X],me>=65&&me<=90&&(me+=32),me!==ye.string[X])return;U.state=e.MATCH,U.phraseLength=we}},"opTLS"),re=o(function(ue,ie,U){U.state=e.NOMATCH,U.phraseLength=0,U.state=ie===0?e.EMPTY:e.NOMATCH},"opABG"),Se=o(function(ue,ie,U){U.state=e.NOMATCH,U.phraseLength=0,U.state=ie===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ce=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];U.state=e.NOMATCH,ke.index<L.length?we=L[ke.index].lower:we=V[ke.index-L.length].lower;let Dt=ke.bkrMode===e.BKR_MODE_PM?U.pFrame.getPhrase(we):U.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(Dt===null)return;let Oe=Dt.phraseIndex,Lt=Dt.phraseLength;if(Lt===0){U.state=e.EMPTY;return}if(ie+Lt<=y){if(Ue){for(X=0;X<Lt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;U.state=e.MATCH,U.phraseLength=Lt}else for(X=0;X<Lt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me!==ye)return;U.state=e.MATCH,U.phraseLength=Lt}},"opBKR"),ve=o(function(ue,ie,U){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,U),S.pop(),U.phraseLength=0,U.state){case e.EMPTY:U.state=e.EMPTY;break;case e.MATCH:U.state=e.EMPTY;break;case e.NOMATCH:U.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${U.state}`)}},"opBKA"),G=o(function(ue,ie,U){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,U),S.pop(),U.phraseLength=0,U.state){case e.EMPTY:case e.MATCH:U.state=e.NOMATCH;break;case e.NOMATCH:U.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${U.state}`)}},"opBKN"),pe=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue],Dt=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=ie,we=0;for(let Oe=ke.children.length-1;Oe>=0;Oe-=1)if(a(ke.children[Oe],ye,U),ye-=U.phraseLength,we+=U.phraseLength,U.state===e.NOMATCH){X=!1;break}X?(U.state=we===0?e.EMPTY:e.MATCH,U.phraseLength=we):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(Dt),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCATBehind"),Ce=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let Dt=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(a(ue+1,me,U),U.state===e.NOMATCH)||U.state===e.EMPTY||(we+=1,ye+=U.phraseLength,me-=U.phraseLength,we===ke.max)););U.state===e.EMPTY||we>=ke.min?(U.state=ye===0?e.EMPTY:e.MATCH,U.phraseLength=ye):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(Dt),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREPBehind"),He=o(function(ue,ie,U){let X=c[ue];if(U.state=e.NOMATCH,U.phraseLength=0,ie>0){let me=u[ie-1];X.min<=me&&me<=X.max&&(U.state=e.MATCH,U.phraseLength=1)}},"opTRGBehind"),Ne=o(function(ue,ie,U){let X,me=c[ue];U.state=e.NOMATCH;let ye=me.string.length,we=ie-ye;if(we>=0){for(X=0;X<ye;X+=1)if(u[we+X]!==me.string[X])return;U.state=e.MATCH,U.phraseLength=ye}},"opTBSBehind"),Ve=o(function(ue,ie,U){let X,me=c[ue];U.state=e.NOMATCH;let ye=me.string.length;if(ye===0){U.state=e.EMPTY;return}let we=ie-ye;if(we>=0){for(let ke=0;ke<ye;ke+=1)if(X=u[we+ke],X>=65&&X<=90&&(X+=32),X!==me.string[ke])return;U.state=e.MATCH,U.phraseLength=ye}},"opTLSBehind"),pr=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];U.state=e.NOMATCH,U.phraseLength=0,ke.index<L.length?we=L[ke.index].lower:we=V[ke.index-L.length].lower;let Dt=ke.bkrMode===e.BKR_MODE_PM?U.pFrame.getPhrase(we):U.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(Dt===null)return;let Oe=Dt.phraseIndex,Lt=Dt.phraseLength;if(Lt===0){U.state=e.EMPTY,U.phraseLength=0;return}let je=ie-Lt;if(je>=0){if(Ue){for(X=0;X<Lt;X+=1)if(me=u[je+X],ye=u[Oe+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;U.state=e.MATCH,U.phraseLength=Lt}else for(X=0;X<Lt;X+=1)if(me=u[je+X],ye=u[Oe+X],me!==ye)return;U.state=e.MATCH,U.phraseLength=Lt}},"opBKRBehind");a=o(function(ie,U,X){let me=!0,ye=c[ie];if(I+=1,I>K)throw new Error(`parser: maximum number of node hits exceeded: ${K}`);if(O+=1,O>R&&(R=O,R>oe))throw new Error(`parser: maximum parse tree depth exceeded: ${oe}`);if(X.refresh(),i.trace!==null){let we=x();i.trace.down(ye,X.state,U,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(ie,U,X);break;case e.CAT:pe(ie,U,X);break;case e.REP:Ce(ie,U,X);break;case e.RNM:se(ie,U,X);break;case e.UDT:$(ie,U,X);break;case e.AND:ee(ie,U,X);break;case e.NOT:ne(ie,U,X);break;case e.TRG:He(ie,U,X);break;case e.TBS:Ne(ie,U,X);break;case e.TLS:Ve(ie,U,X);break;case e.BKR:pr(ie,U,X);break;case e.BKA:ve(ie,U,X);break;case e.BKN:G(ie,U,X);break;case e.ABG:re(ie,U,X);break;case e.AEN:Se(ie,U,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(ie,U,X);break;case e.CAT:he(ie,U,X);break;case e.REP:D(ie,U,X);break;case e.RNM:se(ie,U,X);break;case e.UDT:$(ie,U,X);break;case e.AND:ee(ie,U,X);break;case e.NOT:ne(ie,U,X);break;case e.TRG:ae(ie,U,X);break;case e.TBS:Ae(ie,U,X);break;case e.TLS:ge(ie,U,X);break;case e.BKR:ce(ie,U,X);break;case e.BKA:ve(ie,U,X);break;case e.BKN:G(ie,U,X);break;case e.ABG:re(ie,U,X);break;case e.AEN:Se(ie,U,X);break;default:me=!1;break}if(!b()&&U+X.phraseLength>Y&&(Y=U+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=x();i.trace.up(ye,X.state,U,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var N4=De((eV,R4)=>{R4.exports=o(function(){let e=zi(),r=Ha(),n=Lu(),i="stats.js: ",a=[],c=[],u=[],d,v=[],y=[];this.statsObject="statsObject";let S="stats",O=o(function(K,q){return K.lower<q.lower?-1:K.lower>q.lower?1:0},"sortAlpha"),R=o(function(K,q){return K.total<q.total?1:K.total>q.total?-1:O(K,q)},"sortHits"),I=o(function(K,q){return K.index<q.index?-1:K.index>q.index?1:0},"sortIndex"),N=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),J=o(function(){u.length=0,d=new N,u[e.ALT]=new N,u[e.CAT]=new N,u[e.REP]=new N,u[e.RNM]=new N,u[e.TRG]=new N,u[e.TBS]=new N,u[e.TLS]=new N,u[e.UDT]=new N,u[e.AND]=new N,u[e.NOT]=new N,u[e.BKR]=new N,u[e.BKA]=new N,u[e.BKN]=new N,u[e.ABG]=new N,u[e.AEN]=new N,v.length=0;for(let K=0;K<a.length;K+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:a[K].name,lower:a[K].lower,index:a[K].index});if(c.length>0){y.length=0;for(let K=0;K<c.length;K+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:c[K].name,lower:c[K].lower,index:c[K].index})}},"clear"),L=o(function(K,q){switch(K.total+=1,q){case e.EMPTY:K.empty+=1;break;case e.MATCH:K.match+=1;break;case e.NOMATCH:K.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${q}`)}},"incStat"),V=o(function(K,q){let j="";return j+="<tr>",j+=`<td class="${n.CLASS_ACTIVE}">${K}</td>`,j+=`<td class="${n.CLASS_EMPTY}">${q.empty}</td>`,j+=`<td class="${n.CLASS_MATCH}">${q.match}</td>`,j+=`<td class="${n.CLASS_NOMATCH}">${q.nomatch}</td>`,j+=`<td class="${n.CLASS_ACTIVE}">${q.total}</td>`,j+=`</tr>
292
+ `,j},"displayRow"),Z=o(function(){let K="";return K+=V("ALT",u[e.ALT]),K+=V("CAT",u[e.CAT]),K+=V("REP",u[e.REP]),K+=V("RNM",u[e.RNM]),K+=V("TRG",u[e.TRG]),K+=V("TBS",u[e.TBS]),K+=V("TLS",u[e.TLS]),K+=V("UDT",u[e.UDT]),K+=V("AND",u[e.AND]),K+=V("NOT",u[e.NOT]),K+=V("BKR",u[e.BKR]),K+=V("BKA",u[e.BKA]),K+=V("BKN",u[e.BKN]),K+=V("ABG",u[e.ABG]),K+=V("AEN",u[e.AEN]),K+=V("totals",d),K},"displayOpsOnly"),Y=o(function(){let K="";K+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
293
+ `,K+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
294
+ `;for(let q=0;q<a.length;q+=1)v[q].total>0&&(K+="<tr>",K+=`<td class="${n.CLASS_ACTIVE}">${v[q].name}</td>`,K+=`<td class="${n.CLASS_EMPTY}">${v[q].empty}</td>`,K+=`<td class="${n.CLASS_MATCH}">${v[q].match}</td>`,K+=`<td class="${n.CLASS_NOMATCH}">${v[q].nomatch}</td>`,K+=`<td class="${n.CLASS_ACTIVE}">${v[q].total}</td>`,K+=`</tr>
295
+ `);if(c.length>0){K+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
296
+ `,K+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
297
+ `;for(let q=0;q<c.length;q+=1)y[q].total>0&&(K+="<tr>",K+=`<td class="${n.CLASS_ACTIVE}">${y[q].name}</td>`,K+=`<td class="${n.CLASS_EMPTY}">${y[q].empty}</td>`,K+=`<td class="${n.CLASS_MATCH}">${y[q].match}</td>`,K+=`<td class="${n.CLASS_NOMATCH}">${y[q].nomatch}</td>`,K+=`<td class="${n.CLASS_ACTIVE}">${y[q].total}</td>`,K+=`</tr>
298
+ `)}return K},"displayRules");this.validate=o(function(K){let q=!1;return typeof K=="string"&&S===K&&(q=!0),q},"validate"),this.init=o(function(K,q){a=K,c=q,J()},"init"),this.collect=o(function(K,q){L(d,q.state,q.phraseLength),L(u[K.type],q.state,q.phraseLength),K.type===e.RNM&&L(v[K.index],q.state,q.phraseLength),K.type===e.UDT&&L(y[K.index],q.state,q.phraseLength)},"collect"),this.toHtml=o(function(K,q){let j="";j+=`<table class="${n.CLASS_STATS}">
299
+ `,typeof q=="string"&&(j+=`<caption>${q}</caption>
300
+ `),j+=`<tr><th class="${n.CLASS_ACTIVE}">ops</th>
301
+ `,j+=`<th class="${n.CLASS_EMPTY}">EMPTY</th>
302
+ `,j+=`<th class="${n.CLASS_MATCH}">MATCH</th>
303
+ `,j+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
304
+ `,j+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
305
+ `;let le=!0;for(;le;){if(K===void 0){j+=Z();break}if(K===null){j+=Z();break}if(K==="ops"){j+=Z();break}if(K==="index"){v.sort(I),y.length>0&&y.sort(I),j+=Z(),j+=Y();break}if(K==="hits"){v.sort(R),y.length>0&&y.sort(I),j+=Z(),j+=Y();break}if(K==="alpha"){v.sort(O),y.length>0&&y.sort(O),j+=Z(),j+=Y();break}break}return j+=`</table>
306
+ `,j},"toHtml"),this.toHtmlPage=o(function(K,q,j){return r.htmlToPage(this.toHtml(K,q),j)},"toHtmlPage")},"statsFunc")});var L4=De((tV,P4)=>{P4.exports=o(function(){let e=Ha(),r=Lu(),n=new(fb()),i=zi(),a="trace.js: ",c=this,u=16,d=10,v=8,y=32,S=80,O=5,R=[],I=5e3,N=-1,J=0,L=0,V=[],Z=null,Y=null,oe=null,K=[],q=[],j=`<span class="${r.CLASS_LINEEND}">&bull;</span>`,le=`<span class="${r.CLASS_LINEEND}">&hellip;</span>`,T=`<span class="${r.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let F=o(function(ee){K[i.ALT]=ee,K[i.CAT]=ee,K[i.REP]=ee,K[i.TLS]=ee,K[i.TBS]=ee,K[i.TRG]=ee,K[i.AND]=ee,K[i.NOT]=ee,K[i.BKR]=ee,K[i.BKA]=ee,K[i.BKN]=ee,K[i.ABG]=ee,K[i.AEN]=ee},"setOperators"),$=0;for(let ee in c.filter.operators)$+=1;if($===0){F(!1);return}for(let ee in c.filter.operators){let ne=ee.toUpperCase();if(ne==="<ALL>"){F(!0);return}if(ne==="<NONE>"){F(!1);return}}F(!1);for(let ee in c.filter.operators){let ne=ee.toUpperCase();if(ne==="ALT")K[i.ALT]=c.filter.operators[ee]===!0;else if(ne==="CAT")K[i.CAT]=c.filter.operators[ee]===!0;else if(ne==="REP")K[i.REP]=c.filter.operators[ee]===!0;else if(ne==="AND")K[i.AND]=c.filter.operators[ee]===!0;else if(ne==="NOT")K[i.NOT]=c.filter.operators[ee]===!0;else if(ne==="TLS")K[i.TLS]=c.filter.operators[ee]===!0;else if(ne==="TBS")K[i.TBS]=c.filter.operators[ee]===!0;else if(ne==="TRG")K[i.TRG]=c.filter.operators[ee]===!0;else if(ne==="BKR")K[i.BKR]=c.filter.operators[ee]===!0;else if(ne==="BKA")K[i.BKA]=c.filter.operators[ee]===!0;else if(ne==="BKN")K[i.BKN]=c.filter.operators[ee]===!0;else if(ne==="ABG")K[i.ABG]=c.filter.operators[ee]===!0;else if(ne==="AEN")K[i.AEN]=c.filter.operators[ee]===!0;else throw new Error(`${a}initOpratorFilter: '${ee}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),x=o(function(){let F=o(function(ae){K[i.RNM]=ae,K[i.UDT]=ae;let Ae=Y.length+oe.length;q.length=0;for(let ge=0;ge<Ae;ge+=1)q.push(ae)},"setRules"),$,ee,ne=[];for(ee=0;ee<Y.length;ee+=1)ne.push(Y[ee].lower);for(ee=0;ee<oe.length;ee+=1)ne.push(oe[ee].lower);q.length=0,$=0;for(let ae in c.filter.rules)$+=1;if($===0){F(!0);return}for(let ae in c.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){F(!0);return}if(Ae==="<none>"){F(!1);return}}F(!1),K[i.RNM]=!0,K[i.UDT]=!0;for(let ae in c.filter.rules){let Ae=ae.toLowerCase();if(ee=ne.indexOf(Ae),ee<0)throw new Error(`${a}initRuleFilter: '${ae}' not a valid rule or udt name`);q[ee]=c.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(F,$){if(N=-1,typeof F=="number"&&F>0)I=Math.ceil(F);else{I=0;return}typeof $=="number"&&(N=Math.floor($),N<0&&(N=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return N},this.init=function(F,$,ee){R.length=0,V.length=0,J=0,L=0,Z=ee,Y=F,oe=$,h(),x(),n.init(I)};let b=o(function(F){let $=!1;return F.type===i.RNM?K[F.type]&&q[F.index]?$=!0:$=!1:F.type===i.UDT?K[F.type]&&q[Y.length+F.index]?$=!0:$=!1:$=K[F.type],$},"filterOps"),l=o(function(F){return N===-1||F<=N},"filterRecords");this.down=function(F,$,ee,ne,ae,Ae){l(J)&&b(F)&&(V.push(J),R[n.increment()]={dirUp:!1,depth:L,thisLine:J,thatLine:void 0,opcode:F,state:$,phraseIndex:ee,phraseLength:ne,lookAnchor:ae,lookAround:Ae},J+=1,L+=1)},this.up=function(F,$,ee,ne,ae,Ae){if(l(J)&&b(F)){let ge=J,re=V.pop(),Se=n.getListIndex(re);Se!==-1&&(R[Se].thatLine=ge),L-=1,R[n.increment()]={dirUp:!0,depth:L,thisLine:ge,thatLine:re,opcode:F,state:$,phraseIndex:ee,phraseLength:ne,lookAnchor:ae,lookAround:Ae},J+=1}};let m=o(function(){function F(U,X){let me,ye,we;if(X)switch(U.op={id:X.type,name:e.opcodeToString(X.type)},U.opData=void 0,X.type){case i.RNM:U.opData=Y[X.index].name;break;case i.UDT:U.opData=oe[X.index].name;break;case i.BKR:X.index<Y.length?me=Y[X.index].name:me=oe[X.index-Y.length].name,ye=X.bkrCase===i.BKR_MODE_CI?"%i":"%s",we=X.bkrMode===i.BKR_MODE_UM?"%u":"%p",U.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:U.opData=[];for(let ke=0;ke<X.string.length;ke+=1)U.opData.push(X.string[ke]);break;case i.TBS:U.opData=[];for(let ke=0;ke<X.string.length;ke+=1)U.opData.push(X.string[ke]);break;case i.TRG:U.opData=[X.min,X.max];break;case i.REP:U.opData=[X.min,X.max];break;default:throw new Error("unrecognized opcode")}else U.op={id:void 0,name:void 0},U.opData=void 0}o(F,"nodeOpcode");function $(U,X,me){return U===i.MATCH?{index:X,length:me}:U===i.NOMATCH?{index:X,length:0}:U===i.EMPTY?{index:X,length:0}:null}o($,"nodePhrase");let ee=-1;function ne(U,X,me){let ye={id:ee++,branch:-1,parent:U,up:!1,down:!1,depth:me,children:[]};return X?(ye.down=!0,ye.state={id:X.state,name:e.stateToString(X.state)},ye.phrase=null,F(ye,X.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=$(),F(ye,void 0)),ye}o(ne,"nodeDown");function ae(U,X){X&&(U.up=!0,U.state={id:X.state,name:e.stateToString(X.state)},U.phrase=$(X.state,X.phraseIndex,X.phraseLength),U.down||F(U,X.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,re=1;function Se(U){if(ge+=1,U.branch=re,ge>L&&(L=ge),U.children.length===0)Ae+=1;else for(let X=0;X<U.children.length;X+=1)X>0&&(re+=1),U.children[X].leftMost=!1,U.children[X].rightMost=!1,U.leftMost&&(U.children[X].leftMost=X===0),U.rightMost&&(U.children[X].rightMost=X===U.children.length-1),Se(U.children[X]);ge-=1}o(Se,"walk");function ce(U,X){let me,ye={};if(ye.id=U.id,ye.branch=U.branch,ye.leftMost=U.leftMost,ye.rightMost=U.rightMost,me=U.state.name?U.state.name:"ACTIVE",ye.state={id:U.state.id,name:me},me=U.op.name?U.op.name:"?",ye.op={id:U.op.id,name:me},typeof U.opData=="string")ye.opData=U.opData;else if(Array.isArray(U.opData)){ye.opData=[];for(let we=0;we<U.opData.length;we+=1)ye.opData[we]=U.opData[we]}else ye.opData=void 0;U.phrase?ye.phrase={index:U.phrase.index,length:U.phrase.length}:ye.phrase=null,ye.depth=U.depth,ye.children=[];for(let we=0;we<U.children.length;we+=1){let ke=we!==U.children.length-1;ye.children[we]=ce(U.children[we],X,ke)}return ye}o(ce,"display");let ve=[],G,pe,Ce,He,Ne=!0,Ve=ne(null,null,-1);for(ve.push(Ve),pe=Ve,n.forEach(U=>{if(He=R[U],Ne&&(Ne=!1,He.depth>0)){let X=He.dirUp?He.depth+1:He.depth;for(let me=0;me<X;me+=1)Ce=pe,pe=ne(pe,null,me),ve.push(pe),Ce.children.push(pe)}He.dirUp?(pe=ve.pop(),ae(pe,He),pe=ve[ve.length-1]):(Ce=pe,pe=ne(pe,He,He.depth),ve.push(pe),Ce.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(Ve.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?");G=Ve.children[0];let pr=G;for(;G&&!G.down&&!G.up;)pr=G,G=G.children[0];G=pr,G.leftMost=!0,G.rightMost=!0,Se(G),G.branch=0;let ue={};ue.string=[];for(let U=0;U<Z.length;U+=1)ue.string[U]=Z[U];ue.rules=[];for(let U=0;U<Y.length;U+=1)ue.rules[U]=Y[U].name;ue.udts=[];for(let U=0;U<oe.length;U+=1)ue.udts[U]=oe[U].name;ue.id={},ue.id.ALT={id:i.ALT,name:"ALT"},ue.id.CAT={id:i.CAT,name:"CAT"},ue.id.REP={id:i.REP,name:"REP"},ue.id.RNM={id:i.RNM,name:"RNM"},ue.id.TLS={id:i.TLS,name:"TLS"},ue.id.TBS={id:i.TBS,name:"TBS"},ue.id.TRG={id:i.TRG,name:"TRG"},ue.id.UDT={id:i.UDT,name:"UDT"},ue.id.AND={id:i.AND,name:"AND"},ue.id.NOT={id:i.NOT,name:"NOT"},ue.id.BKR={id:i.BKR,name:"BKR"},ue.id.BKA={id:i.BKA,name:"BKA"},ue.id.BKN={id:i.BKN,name:"BKN"},ue.id.ABG={id:i.ABG,name:"ABG"},ue.id.AEN={id:i.AEN,name:"AEN"},ue.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},ue.id.MATCH={id:i.MATCH,name:"MATCH"},ue.id.EMPTY={id:i.EMPTY,name:"EMPTY"},ue.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},ue.treeDepth=L,ue.leafNodes=Ae;let ie;return G.down?G.up?ie="none":ie="right":G.up?ie="left":ie="both",ue.branchesIncomplete=ie,ue.tree=ce(G,G.depth,!1),ue},"toTreeObj");this.toTree=function(F){let $=m();return F?JSON.stringify($):$},this.toHtmlPage=function(F,$,ee){return e.htmlToPage(this.toHtml(F,$),ee)};let _=o(function(F,$){let ee;switch(F){case u:ee="hexadecimal";break;case d:ee="decimal";break;case v:ee="ASCII";break;case y:ee="UNICODE";break;default:throw new Error(`${a}htmlHeader: unrecognized mode: ${F}`)}let ne="";return ne+=`<p>display mode: ${ee}</p>
307
+ `,ne+=`<table class="${r.CLASS_TRACE}">
308
+ `,typeof $=="string"&&(ne+=`<caption>${$}</caption>`),ne},"htmlHeader"),A=o(function(){let F="";return F+=`</table>
309
+ `,F+=`<p class="${r.CLASS_MONOSPACE}">legend:<br>
310
+ `,F+=`(a)&nbsp;-&nbsp;line number<br>
311
+ `,F+=`(b)&nbsp;-&nbsp;matching line number<br>
312
+ `,F+=`(c)&nbsp;-&nbsp;phrase offset<br>
313
+ `,F+=`(d)&nbsp;-&nbsp;phrase length<br>
314
+ `,F+=`(e)&nbsp;-&nbsp;tree depth<br>
315
+ `,F+=`(f)&nbsp;-&nbsp;operator state<br>
316
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_ACTIVE}">&darr;</span>&nbsp;&nbsp;phrase opened<br>
317
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_MATCH}">&uarr;M</span> phrase matched<br>
318
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_EMPTY}">&uarr;E</span> empty phrase matched<br>
319
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_NOMATCH}">&uarr;N</span> phrase not matched<br>
320
+ `,F+=`operator&nbsp;-&nbsp;ALT, CAT, REP, RNM, TRG, TLS, TBS<sup>&dagger;</sup>, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN<sup>&Dagger;</sup><br>
321
+ `,F+=`phrase&nbsp;&nbsp;&nbsp;-&nbsp;up to ${S} characters of the phrase being matched<br>
322
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_MATCH}">matched characters</span><br>
323
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_LOOKAHEAD}">matched characters in look ahead mode</span><br>
324
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_LOOKBEHIND}">matched characters in look behind mode</span><br>
325
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_REMAINDER}">remainder characters(not yet examined by parser)</span><br>
326
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<span class="${r.CLASS_CTRLCHAR}">control characters, TAB, LF, CR, etc. (ASCII mode only)</span><br>
327
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;${T} empty string<br>
328
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;${j} end of input string<br>
329
+ `,F+=`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;${le} input string display truncated<br>
330
+ `,F+=`</p>
331
+ `,F+=`<p class="${r.CLASS_MONOSPACE}">
332
+ `,F+=`<sup>&dagger;</sup>original ABNF operators:<br>
333
+ `,F+=`ALT - alternation<br>
334
+ `,F+=`CAT - concatenation<br>
335
+ `,F+=`REP - repetition<br>
336
+ `,F+=`RNM - rule name<br>
337
+ `,F+=`TRG - terminal range<br>
338
+ `,F+=`TLS - terminal literal string (case insensitive)<br>
339
+ `,F+=`TBS - terminal binary string (case sensitive)<br>
340
+ `,F+=`<br>
341
+ `,F+=`<sup>&Dagger;</sup>super set SABNF operators:<br>
342
+ `,F+=`UDT - user-defined terminal<br>
343
+ `,F+=`AND - positive look ahead<br>
344
+ `,F+=`NOT - negative look ahead<br>
345
+ `,F+=`BKA - positive look behind<br>
346
+ `,F+=`BKN - negative look behind<br>
347
+ `,F+=`BKR - back reference<br>
348
+ `,F+=`ABG - anchor - begin of input string<br>
349
+ `,F+=`AEN - anchor - end of input string<br>
350
+ `,F+=`</p>
351
+ `,F},"htmlFooter");this.indent=function(F){let $="";for(let ee=0;ee<F;ee+=1)$+=".";return $};let E=o(function(F,$){let ee="";if($.type===i.TRG)if(F===u||F===y){let ne=$.min.toString(16).toUpperCase();ne.length%2!==0&&(ne=`0${ne}`),ee+=F===u?"%x":"U+",ee+=ne,ne=$.max.toString(16).toUpperCase(),ne.length%2!==0&&(ne=`0${ne}`),ee+=`&ndash;${ne}`}else ee=`%d${$.min.toString(10)}&ndash;${$.max.toString(10)}`;return ee},"displayTrg"),g=o(function(F,$){let ee="";if($.type===i.REP)if(F===u){let ne=$.min.toString(16).toUpperCase();ne.length%2!==0&&(ne=`0${ne}`),ee=`x${ne}`,$.max<1/0?(ne=$.max.toString(16).toUpperCase(),ne.length%2!==0&&(ne=`0${ne}`)):ne="inf",ee+=`&ndash;${ne}`}else $.max<1/0?ee=`${$.min.toString(10)}&ndash;${$.max.toString(10)}`:ee=`${$.min.toString(10)}&ndash;inf`;return ee},"displayRep"),C=o(function(F,$){let ee="";if($.type===i.TBS){let ne=Math.min($.string.length,O*2);if(F===u||F===y){ee+=F===u?"%x":"U+";for(let ae=0;ae<ne;ae+=1){let Ae;ae>0&&(ee+="."),Ae=$.string[ae].toString(16).toUpperCase(),Ae.length%2!==0&&(Ae=`0${Ae}`),ee+=Ae}}else{ee="%d";for(let ae=0;ae<ne;ae+=1)ae>0&&(ee+="."),ee+=$.string[ae].toString(10)}ne<$.string.length&&(ee+=le)}return ee},"displayTbs"),P=o(function(F,$){let ee="";if($.type===i.TLS){let ne=Math.min($.string.length,O);if(F===u||F===d){let ae,Ae,ge;F===u?(ee="%x",ge=16):(ee="%d",ge=10);for(let re=0;re<ne;re+=1)re>0&&(ee+="."),Ae=$.string[re],Ae>=97&&Ae<=122?(ae=Ae-32,ee+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):Ae>=65&&Ae<=90?(ae=Ae,Ae+=32,ee+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):ee+=Ae.toString(ge).toUpperCase();ne<$.string.length&&(ee+=le)}else{ee='"';for(let ae=0;ae<ne;ae+=1)ee+=e.asciiChars[$.string[ae]];ne<$.string.length&&(ee+=le),ee+='"'}}return ee},"displayTls"),w=o(function(F,$,ee,ne,ae){if(ne===0)return"";let Ae="",ge=ae?",":"";switch(F){case u:Ae=ge+e.charsToHex($,ee,ne);break;case d:if(ae)return`,${e.charsToDec($,ee,ne)}`;Ae=ge+e.charsToDec($,ee,ne);break;case y:Ae=e.charsToUnicode($,ee,ne);break;case v:default:Ae=e.charsToAsciiHtml($,ee,ne);break}return Ae},"subPhrase"),k=o(function(F,$,ee,ne,ae,Ae){let ge="",re,Se,ce,ve,G=j,pe=`<span class="${r.CLASS_LOOKBEHIND}">`,Ce=`<span class="${r.CLASS_REMAINDER}">`,He="</span>",Ne=!1;switch(ee){case i.EMPTY:ge+=T;case i.NOMATCH:case i.MATCH:case i.ACTIVE:re=ne-ae,Se=Ae-re,ce=Ae,ve=$.length-ce;break;default:throw new Error("unrecognized state")}return G=j,Se>S?(Se=S,G=le,ve=0):Se+ve>S&&(G=le,ve=S-Se),Se>0&&(ge+=pe,ge+=w(F,$,re,Se,Ne),ge+=He,Ne=!0),ve>0&&(ge+=Ce,ge+=w(F,$,ce,ve,Ne),ge+=He),ge+G},"displayBehind"),he=o(function(F,$,ee,ne,ae,Ae){let ge="",re,Se,ce,ve,G=j,pe=`<span class="${r.CLASS_REMAINDER}">`,Ce="</span>",He=!1;switch(ee){case i.EMPTY:ge+=T;case i.NOMATCH:case i.ACTIVE:re=ne,Se=0,ce=ne,ve=$.length-ce;break;case i.MATCH:re=ne,Se=ae,ce=ne+Se,ve=$.length-ce;break;default:throw new Error("unrecognized state")}return G=j,Se>S?(Se=S,G=le,ve=0):Se+ve>S&&(G=le,ve=S-Se),Se>0&&(ge+=Ae,ge+=w(F,$,re,Se,He),ge+=Ce,He=!0),ve>0&&(ge+=pe,ge+=w(F,$,ce,ve,He),ge+=Ce),ge+G},"displayForward"),D=o(function(F,$,ee,ne,ae){let Ae=`<span class="${r.CLASS_LOOKAHEAD}">`;return he(F,$,ee,ne,ae,Ae)},"displayAhead"),Q=o(function(F,$,ee,ne,ae){let Ae=`<span class="${r.CLASS_MATCH}">`;return he(F,$,ee,ne,ae,Ae)},"displayNone"),se=o(function(F){if(Y===null)return"";let $="",ee,ne,ae,Ae,ge,re;return $+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",$+=`<th>operator</th><th>phrase</th></tr>
352
+ `,n.forEach(Se=>{let ce=R[Se];switch(ee=ce.thisLine,ne=ce.thatLine!==void 0?ce.thatLine:"--",ae=!1,Ae=!1,ge=!1,ce.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,re=ce.lookAnchor),(ce.opcode.type===i.AND||ce.opcode.type===i.NOT)&&(ae=!0,ge=!0,re=ce.phraseIndex),ce.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,re=ce.lookAnchor),(ce.opcode.type===i.BKA||ce.opcode.type===i.BKN)&&(Ae=!0,ge=!0,re=ce.phraseIndex),$+="<tr>",$+=`<td>${ee}</td><td>${ne}</td>`,$+=`<td>${ce.phraseIndex}</td>`,$+=`<td>${ce.phraseLength}</td>`,$+=`<td>${ce.depth}</td>`,$+="<td>",ce.state){case i.ACTIVE:$+=`<span class="${r.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:$+=`<span class="${r.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:$+=`<span class="${r.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:$+=`<span class="${r.CLASS_EMPTY}">&uarr;E</span>`;break;default:$+=`<span class="${r.CLASS_ACTIVE}">--</span>`;break}if($+="</td>",$+="<td>",$+=c.indent(ce.depth),ae?$+=`<span class="${r.CLASS_LOOKAHEAD}">`:Ae&&($+=`<span class="${r.CLASS_LOOKBEHIND}">`),$+=e.opcodeToString(ce.opcode.type),ce.opcode.type===i.RNM&&($+=`(${Y[ce.opcode.index].name}) `),ce.opcode.type===i.BKR){let ve=ce.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",G=ce.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";$+=`(\\${ve}${G}${Y[ce.opcode.index].name}) `}ce.opcode.type===i.UDT&&($+=`(${oe[ce.opcode.index].name}) `),ce.opcode.type===i.TRG&&($+=`(${E(F,ce.opcode)}) `),ce.opcode.type===i.TBS&&($+=`(${C(F,ce.opcode)}) `),ce.opcode.type===i.TLS&&($+=`(${P(F,ce.opcode)}) `),ce.opcode.type===i.REP&&($+=`(${g(F,ce.opcode)}) `),ge&&($+="</span>"),$+="</td>",$+="<td>",Ae?$+=k(F,Z,ce.state,ce.phraseIndex,ce.phraseLength,re):ae?$+=D(F,Z,ce.state,ce.phraseIndex,ce.phraseLength):$+=Q(F,Z,ce.state,ce.phraseIndex,ce.phraseLength),$+=`</td></tr>
353
+ `}),$+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",$+=`<th>operator</th><th>phrase</th></tr>
354
+ `,$+=`</table>
355
+ `,$},"htmlTable");this.toHtml=function(F,$){let ee=v;if(typeof F=="string"&&F.length>=3){let ae=F.toLowerCase().slice(0,3);ae==="hex"?ee=u:ae==="dec"?ee=d:ae==="uni"&&(ee=y)}let ne="";return ne+=_(ee,$),ne+=se(ee),ne+=A(),ne}},"exportTrace")});var za=De((rV,B4)=>{B4.exports={ast:k4(),circular:fb(),ids:zi(),parser:O4(),stats:N4(),trace:L4(),utils:Ha(),emitcss:sb(),style:Lu()}});var $4=De((nV,U4)=>{U4.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 r="";return r+=`file = *line [last-line]
356
+ `,r+=`line = line-text end
357
+ `,r+=`line-text = *(valid/invalid)
358
+ `,r+=`last-line = 1*(valid/invalid)
359
+ `,r+=`valid = %d32-126 / %d9
360
+ `,r+=`invalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff
361
+ `,r+=`end = CRLF / LF / CR
362
+ `,r+=`CRLF = %d13.10
363
+ `,r+=`LF = %d10
364
+ `,r+=`CR = %d13
365
+ `,r},"toString")},"grammar")});var q4=De(F4=>{var Jr=zi(),AL=Ha();function SL(t,e,r,n,i){return t===Jr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:r,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),Jr.SEM_OK}o(SL,"semLine");function ML(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.textLength=n),Jr.SEM_OK}o(ML,"semLineText");function TL(t,e,r,n,i){return t===Jr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:r,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:r+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:r,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),Jr.SEM_OK}o(TL,"semLastLine");function CL(t,e,r,n,i){return t===Jr.SEM_PRE&&i.errors.push({line:i.lineNo,char:r,msg:`invalid character found '\\x${AL.charToHex(e[r])}'`}),Jr.SEM_OK}o(CL,"semInvalid");function kL(t,e,r,n,i){return t===Jr.SEM_POST&&(i.lineNo+=1),Jr.SEM_OK}o(kL,"semEnd");function IL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:r,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),Jr.SEM_OK}o(IL,"semLF");function DL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:r,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),Jr.SEM_OK}o(DL,"semCR");function OL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CRLF"),Jr.SEM_OK}o(OL,"semCRLF");var rs=[];rs.line=SL;rs["line-text"]=ML;rs["last-line"]=TL;rs.invalid=CL;rs.end=kL;rs.lf=IL;rs.cr=DL;rs.crlf=OL;F4.callbacks=rs});var z4=De((oV,H4)=>{H4.exports=o(function(e,r,n,i){let a="scanner.js: ",c=za(),u=new($4()),{callbacks:d}=q4(),v=[],y=new c.parser;if(y.ast=new c.ast,y.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${a}trace argument is not a trace object`);y.trace=i}if(y.parse(u,"file",e).success!==!0){r.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:v,lineNo:0,errors:r,strict:!!n};return y.ast.translate(O),v},"exfn")});var j4=De((sV,K4)=>{K4.exports=o(function(){let e="syntax-callbacks.js: ",r=za(),n=r.ids,i,a=o(function(P,w,k,he){switch(P.state){case n.ACTIVE:he.altStack=[],he.repCount=0;break;case n.EMPTY:he.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:he.ruleCount===0&&he.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"),c=o(function(C,P,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,P,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,P,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,P,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"),y=o(function(C,P,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"),S=o(function(C,P,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,P,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."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(C,P,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."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),I=o(function(C,P,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."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),N=o(function(C,P,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."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),J=o(function(C,P,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let he=r.utils.charsToString(P,w,C.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${he}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),L=o(function(C,P,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let he=r.utils.charsToString(P,w,C.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`UDT operator found(${he}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),V=o(function(C,P,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"),Z=o(function(C,P,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"),Y=o(function(C,P,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"),oe=o(function(C,P,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"),K=o(function(C,P,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"),q=o(function(C,P,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"),j=o(function(C,P,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"),le=o(function(C,P,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"),T=o(function(C,P,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,P,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"),x=o(function(C,P,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,P,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,P,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,P,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,P,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"),A=o(function(C,P,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 he=P[w]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Line end '${he}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),E=o(function(C,P,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"),g=o(function(C,P,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=y,this.callbacks.basicelementerr=_,this.callbacks.clsclose=j,this.callbacks.clsopen=K,this.callbacks.clsstring=q,this.callbacks.definedaserror=v,this.callbacks.file=a,this.callbacks.groupclose=b,this.callbacks.groupopen=x,this.callbacks.lineenderror=E,this.callbacks.lineend=A,this.callbacks.notop=S,this.callbacks.optionclose=m,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=le,this.callbacks.prosvalstring=T,this.callbacks.repetition=g,this.callbacks.rule=c,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=Y,this.callbacks.tlsclose=oe,this.callbacks.tlsopen=V,this.callbacks.tlsstring=Z,this.callbacks.udtop=L,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=J,this.callbacks.abgop=I,this.callbacks.aenop=N},"exfn")});var V4=De((aV,G4)=>{G4.exports=o(function(){let e=za(),r=e.ids,n=o(function(){this.names=[],this.add=o(function(ce){let ve=-1;return this.get(ce)===-1&&(ve={name:ce,lower:ce.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ce){let ve=-1,G=ce.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===G){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1)G=10*G+Se[pe]-48;return G},"decnum"),a=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1)G=2*G+Se[pe]-48;return G},"binnum"),c=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1){let Ce=Se[pe];if(Ce>=48&&Ce<=57)Ce-=48;else if(Ce>=65&&Ce<=70)Ce-=55;else if(Ce>=97&&Ce<=102)Ce-=87;else throw new Error("hexnum out of range");G=16*G+Ce}return G},"hexnum");function u(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)G.ruleNames=new n,G.udtNames=new n,G.rules=[],G.udts=[],G.rulesLineMap=[],G.opcodes=[],G.altStack=[],G.topStack=null,G.topRule=null;else if(re===r.SEM_POST){let Ce;G.rules.forEach(He=>{He.isBkr=!1,He.opcodes.forEach(Ne=>{Ne.type===r.RNM&&(Ce=G.ruleNames.get(Ne.index.name),Ce===-1?(G.errors.push({line:G.findLine(G.lines,Ne.index.phraseIndex,G.charsLength),char:Ne.index.phraseIndex,msg:`Rule name '${Ne.index.name}' used but not defined.`}),Ne.index=-1):Ne.index=Ce.index)})}),G.udts.forEach(He=>{He.isBkr=!1}),G.rules.forEach(He=>{He.opcodes.forEach(Ne=>{Ne.type===r.BKR&&(He.hasBkr=!0,Ce=G.ruleNames.get(Ne.index.name),Ce!==-1?(G.rules[Ce.index].isBkr=!0,Ne.index=Ce.index):(Ce=G.udtNames.get(Ne.index.name),Ce!==-1?(G.udts[Ce.index].isBkr=!0,Ne.index=G.rules.length+Ce.index):(G.errors.push({line:G.findLine(G.lines,Ne.index.phraseIndex,G.charsLength),char:Ne.index.phraseIndex,msg:`Back reference name '${Ne.index.name}' refers to undefined rule or unamed UDT.`}),Ne.index=-1)))})})}return pe}o(u,"semFile");function d(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.altStack.length=0,G.topStack=null,G.rulesLineMap.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce})),pe}o(d,"semRule");function v(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)G.ruleName="",G.definedas="";else if(re===r.SEM_POST){let Ce;G.definedas==="="?(Ce=G.ruleNames.add(G.ruleName),Ce===-1?(G.definedas=null,G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`Rule name '${G.ruleName}' previously defined.`})):(G.topRule={name:Ce.name,lower:Ce.lower,opcodes:[],index:Ce.index},G.rules.push(G.topRule),G.opcodes=G.topRule.opcodes)):(Ce=G.ruleNames.get(G.ruleName),Ce===-1?(G.definedas=null,G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`Rule name '${G.ruleName}' for incremental alternate not previously defined.`})):(G.topRule=G.rules[Ce.index],G.opcodes=G.topRule.opcodes))}return pe}o(v,"semRuleLookup");function y(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)for(;;){if(G.definedas===null){pe=r.SEM_SKIP;break}if(G.topStack===null){if(G.definedas==="="){G.topStack={alt:{type:r.ALT,children:[]},cat:null},G.altStack.push(G.topStack),G.opcodes.push(G.topStack.alt);break}G.topStack={alt:G.opcodes[0],cat:null},G.altStack.push(G.topStack);break}G.topStack={alt:{type:r.ALT,children:[]},cat:null},G.altStack.push(G.topStack),G.opcodes.push(G.topStack.alt);break}else re===r.SEM_POST&&(G.altStack.pop(),G.altStack.length>0?G.topStack=G.altStack[G.altStack.length-1]:G.topStack=null);return pe}o(y,"semAlternation");function S(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.topStack.alt.children.push(G.opcodes.length),G.topStack.cat={type:r.CAT,children:[]},G.opcodes.push(G.topStack.cat)):re===r.SEM_POST&&(G.topStack.cat=null),pe}o(S,"semConcatenation");function O(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&G.topStack.cat.children.push(G.opcodes.length),pe}o(O,"semRepetition");function R(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.REP,min:0,max:1,char:ce}),pe}o(R,"semOptionOpen");function I(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.ruleName=e.utils.charsToString(Se,ce,ve)),pe}o(I,"semRuleName");function N(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.definedas="="),pe}o(N,"semDefined");function J(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.definedas="=/"),pe}o(J,"semIncAlt");function L(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.min=0,G.max=1/0,G.topRep={type:r.REP,min:0,max:1/0},G.opcodes.push(G.topRep)):re===r.SEM_POST&&(G.min>G.max&&G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`repetition min cannot be greater than max: min: ${G.min}: max: ${G.max}`}),G.topRep.min=G.min,G.topRep.max=G.max),pe}o(L,"semRepOp");function V(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=i(Se,ce,ve)),pe}o(V,"semRepMin");function Z(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve)),pe}o(Z,"semRepMax");function Y(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve),G.min=G.max),pe}o(Y,"semRepMinMax");function oe(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.AND}),pe}o(oe,"semAndOp");function K(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.NOT}),pe}o(K,"semNotOp");function q(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.RNM,index:{phraseIndex:ce,name:e.utils.charsToString(Se,ce,ve)}}),pe}o(q,"semRnmOp");function j(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.ABG}),pe}o(j,"semAbgOp");function le(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.AEN}),pe}o(le,"semAenOp");function T(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.BKA}),pe}o(T,"semBkaOp");function h(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.BKN}),pe}o(h,"semBknOp");function x(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.ci=!0,G.cs=!1,G.um=!0,G.pm=!1):re===r.SEM_POST&&G.opcodes.push({type:r.BKR,bkrCase:G.cs===!0?r.BKR_MODE_CS:r.BKR_MODE_CI,bkrMode:G.pm===!0?r.BKR_MODE_PM:r.BKR_MODE_UM,index:{phraseIndex:G.bkrname.phraseIndex,name:e.utils.charsToString(Se,G.bkrname.phraseIndex,G.bkrname.phraseLength)}}),pe}o(x,"semBkrOp");function b(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.ci=!0),pe}o(b,"semBkrCi");function l(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.cs=!0),pe}o(l,"semBkrCs");function m(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.um=!0),pe}o(m,"semBkrUm");function _(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.pm=!0),pe}o(_,"semBkrPm");function A(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.bkrname={phraseIndex:ce,phraseLength:ve}),pe}o(A,"semBkrName");function E(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=G.udtNames.add(Ce);if(He===-1){if(He=G.udtNames.get(Ce),He===-1)throw new Error("semUdtEmpty: name look up error")}else G.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!0});G.opcodes.push({type:r.UDT,empty:!0,index:He.index})}return pe}o(E,"semUdtEmpty");function g(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=G.udtNames.add(Ce);if(He===-1){if(He=G.udtNames.get(Ce),He===-1)throw new Error("semUdtNonEmpty: name look up error")}else G.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!1});G.opcodes.push({type:r.UDT,empty:!1,index:He.index,syntax:null,semantic:null})}return pe}o(g,"semUdtNonEmpty");function C(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.tlscase=!0),pe}o(C,"semTlsOp");function P(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&ve>0&&(Se[ce+1]===83||Se[ce+1]===115)&&(G.tlscase=!1),pe}o(P,"semTlsCase");function w(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST)if(G.tlscase){let Ce=Se.slice(ce,ce+ve);for(let He=0;He<Ce.length;He+=1)Ce[He]>=65&&Ce[He]<=90&&(Ce[He]+=32);G.opcodes.push({type:r.TLS,string:Ce})}else G.opcodes.push({type:r.TBS,string:Se.slice(ce,ce+ve)});return pe}o(w,"semTlsString");function k(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(ve<=2?G.opcodes.push({type:r.TLS,string:[]}):G.opcodes.push({type:r.TBS,string:Se.slice(ce+1,ce+ve-1)})),pe}o(k,"semClsOp");function he(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?G.tbsstr=[]:re===r.SEM_POST&&G.opcodes.push({type:r.TBS,string:G.tbsstr}),pe}o(he,"semTbsOp");function D(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.min=0,G.max=0):re===r.SEM_POST&&(G.min>G.max&&G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${G.min}: max: ${G.max}`}),G.opcodes.push({type:r.TRG,min:G.min,max:G.max})),pe}o(D,"semTrgOp");function Q(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=i(Se,ce,ve)),pe}o(Q,"semDmin");function se(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve)),pe}o(se,"semDmax");function F(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=a(Se,ce,ve)),pe}o(F,"semBmin");function $(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=a(Se,ce,ve)),pe}o($,"semBmax");function ee(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=c(Se,ce,ve)),pe}o(ee,"semXmin");function ne(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=c(Se,ce,ve)),pe}o(ne,"semXmax");function ae(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(i(Se,ce,ve)),pe}o(ae,"semDstring");function Ae(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(a(Se,ce,ve)),pe}o(Ae,"semBstring");function ge(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(c(Se,ce,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=j,this.callbacks.aenop=le,this.callbacks.alternation=y,this.callbacks.andop=oe,this.callbacks.bmax=$,this.callbacks.bmin=F,this.callbacks.bkaop=T,this.callbacks.bknop=h,this.callbacks.bkrop=x,this.callbacks["bkr-name"]=A,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=S,this.callbacks.defined=N,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=J,this.callbacks.notop=K,this.callbacks.optionopen=R,this.callbacks["rep-max"]=Z,this.callbacks["rep-min"]=V,this.callbacks["rep-min-max"]=Y,this.callbacks.repetition=O,this.callbacks.repop=L,this.callbacks.rnmop=q,this.callbacks.rule=d,this.callbacks.rulelookup=v,this.callbacks.rulename=I,this.callbacks.tbsop=he,this.callbacks.tlscase=P,this.callbacks.tlsstring=w,this.callbacks.tlsop=C,this.callbacks.trgop=D,this.callbacks["udt-empty"]=E,this.callbacks["udt-non-empty"]=g,this.callbacks.xmax=ne,this.callbacks.xmin=ee,this.callbacks.xstring=ge},"exfn")});var J4=De((fV,W4)=>{W4.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 r="";return r+=`;
366
+ `,r+=`; ABNF for JavaScript APG 2.0 SABNF
367
+ `,r+=`; RFC 5234 with some restrictions and additions.
368
+ `,r+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
369
+ `,r+=`; - accepts %s"string" as a case-sensitive string
370
+ `,r+=`; - accepts %i"string" as a case-insensitive string
371
+ `,r+=`; - accepts "string" as a case-insensitive string
372
+ `,r+=`;
373
+ `,r+=`; Some restrictions:
374
+ `,r+=`; 1. Rules must begin at first character of each line.
375
+ `,r+=`; Indentations on first rule and rules thereafter are not allowed.
376
+ `,r+=`; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.
377
+ `,r+=`; 3. Prose values, i.e. <prose value>, are accepted as valid grammar syntax.
378
+ `,r+=`; However, a working parser cannot be generated from them.
379
+ `,r+=`;
380
+ `,r+=`; Super set (SABNF) additions:
381
+ `,r+=`; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.
382
+ `,r+=`; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found
383
+ `,r+=`; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found
384
+ `,r+=`; e.g. &%d13 or &rule or !(A / B)
385
+ `,r+=`; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.
386
+ `,r+=`; 'name' is alpha followed by alpha/num/hyphen just like a rule name.
387
+ `,r+=`; u_name may be used as an element but no rule definition is given.
388
+ `,r+=`; e.g. rule = A / u_myUdt
389
+ `,r+=`; A = "a"
390
+ `,r+=`; would be a valid grammar.
391
+ `,r+=`; 3. Case-sensitive, single-quoted strings are accepted.
392
+ `,r+=`; e.g. 'abc' would be equivalent to %d97.98.99
393
+ `,r+=`; (kept for backward compatibility, but superseded by %s"abc")
394
+ `,r+=`; New 12/26/2015
395
+ `,r+=`; 4. Look-behind operators are accepted as element prefixes.
396
+ `,r+=`; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found
397
+ `,r+=`; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found
398
+ `,r+=`; e.g. &&%d13 or &&rule or !!(A / B)
399
+ `,r+=`; 5. Back reference operators, i.e. \\rulename, are accepted.
400
+ `,r+=`; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts
401
+ `,r+=`; to match is a phrase previously matched by the rule 'rulename'.
402
+ `,r+=`; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.
403
+ `,r+=`; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.
404
+ `,r+=`; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.
405
+ `,r+=`; Back reference modifiers can be used to specify case and mode.
406
+ `,r+=`; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA
407
+ `,r+=`; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.
408
+ `,r+=`; Modifiers %u and %p determine universal mode and parent frame mode, respectively.
409
+ `,r+=`; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA.
410
+ `,r+=`; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.
411
+ `,r+=`; Returns EMPTY or NOMATCH. Never consumes any characters.
412
+ `,r+=`; 8. String end anchor, AEN(%$) matches the end of the input string location.
413
+ `,r+=`; Returns EMPTY or NOMATCH. Never consumes any characters.
414
+ `,r+=`;
415
+ `,r+=`File = *(BlankLine / Rule / RuleError)
416
+ `,r+=`BlankLine = *(%d32/%d9) [comment] LineEnd
417
+ `,r+=`Rule = RuleLookup owsp Alternation ((owsp LineEnd)
418
+ `,r+=` / (LineEndError LineEnd))
419
+ `,r+=`RuleLookup = RuleNameTest owsp DefinedAsTest
420
+ `,r+=`RuleNameTest = RuleName/RuleNameError
421
+ `,r+=`RuleName = alphanum
422
+ `,r+=`RuleNameError = 1*(%d33-60/%d62-126)
423
+ `,r+=`DefinedAsTest = DefinedAs / DefinedAsError
424
+ `,r+=`DefinedAsError = 1*2%d33-126
425
+ `,r+=`DefinedAs = IncAlt / Defined
426
+ `,r+=`Defined = %d61
427
+ `,r+=`IncAlt = %d61.47
428
+ `,r+=`RuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd
429
+ `,r+=`LineEndError = 1*(%d32-126 / %d9 / LineContinue)
430
+ `,r+=`Alternation = Concatenation *(owsp AltOp Concatenation)
431
+ `,r+=`Concatenation = Repetition *(CatOp Repetition)
432
+ `,r+=`Repetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)
433
+ `,r+=`Modifier = (Predicate [RepOp])
434
+ `,r+=` / RepOp
435
+ `,r+=`Predicate = BkaOp
436
+ `,r+=` / BknOp
437
+ `,r+=` / AndOp
438
+ `,r+=` / NotOp
439
+ `,r+=`BasicElement = UdtOp
440
+ `,r+=` / RnmOp
441
+ `,r+=` / TrgOp
442
+ `,r+=` / TbsOp
443
+ `,r+=` / TlsOp
444
+ `,r+=` / ClsOp
445
+ `,r+=` / BkrOp
446
+ `,r+=` / AbgOp
447
+ `,r+=` / AenOp
448
+ `,r+=` / ProsVal
449
+ `,r+=`BasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)
450
+ `,r+=`Group = GroupOpen Alternation (GroupClose / GroupError)
451
+ `,r+=`GroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr
452
+ `,r+=`GroupOpen = %d40 owsp
453
+ `,r+=`GroupClose = owsp %d41
454
+ `,r+=`Option = OptionOpen Alternation (OptionClose / OptionError)
455
+ `,r+=`OptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr
456
+ `,r+=`OptionOpen = %d91 owsp
457
+ `,r+=`OptionClose = owsp %d93
458
+ `,r+=`RnmOp = alphanum
459
+ `,r+=`BkrOp = %d92 [bkrModifier] bkr-name
460
+ `,r+=`bkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])
461
+ `,r+=`cs = '%s'
462
+ `,r+=`ci = '%i'
463
+ `,r+=`um = '%u'
464
+ `,r+=`pm = '%p'
465
+ `,r+=`bkr-name = uname / ename / rname
466
+ `,r+=`rname = alphanum
467
+ `,r+=`uname = %d117.95 alphanum
468
+ `,r+=`ename = %d101.95 alphanum
469
+ `,r+=`UdtOp = udt-empty
470
+ `,r+=` / udt-non-empty
471
+ `,r+=`udt-non-empty = %d117.95 alphanum
472
+ `,r+=`udt-empty = %d101.95 alphanum
473
+ `,r+=`RepOp = (rep-min StarOp rep-max)
474
+ `,r+=` / (rep-min StarOp)
475
+ `,r+=` / (StarOp rep-max)
476
+ `,r+=` / StarOp
477
+ `,r+=` / rep-min-max
478
+ `,r+=`AltOp = %d47 owsp
479
+ `,r+=`CatOp = wsp
480
+ `,r+=`StarOp = %d42
481
+ `,r+=`AndOp = %d38
482
+ `,r+=`NotOp = %d33
483
+ `,r+=`BkaOp = %d38.38
484
+ `,r+=`BknOp = %d33.33
485
+ `,r+=`AbgOp = %d37.94
486
+ `,r+=`AenOp = %d37.36
487
+ `,r+=`TrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))
488
+ `,r+=`TbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))
489
+ `,r+=`TlsOp = TlsCase TlsOpen TlsString TlsClose
490
+ `,r+=`TlsCase = ["%i" / "%s"]
491
+ `,r+=`TlsOpen = %d34
492
+ `,r+=`TlsClose = %d34
493
+ `,r+=`TlsString = *(%d32-33/%d35-126/StringTab)
494
+ `,r+=`StringTab = %d9
495
+ `,r+=`ClsOp = ClsOpen ClsString ClsClose
496
+ `,r+=`ClsOpen = %d39
497
+ `,r+=`ClsClose = %d39
498
+ `,r+=`ClsString = *(%d32-38/%d40-126/StringTab)
499
+ `,r+=`ProsVal = ProsValOpen ProsValString ProsValClose
500
+ `,r+=`ProsValOpen = %d60
501
+ `,r+=`ProsValString = *(%d32-61/%d63-126/StringTab)
502
+ `,r+=`ProsValClose = %d62
503
+ `,r+=`rep-min = rep-num
504
+ `,r+=`rep-min-max = rep-num
505
+ `,r+=`rep-max = rep-num
506
+ `,r+=`rep-num = 1*(%d48-57)
507
+ `,r+=`dString = dnum
508
+ `,r+=`xString = xnum
509
+ `,r+=`bString = bnum
510
+ `,r+=`Dec = (%d68/%d100)
511
+ `,r+=`Hex = (%d88/%d120)
512
+ `,r+=`Bin = (%d66/%d98)
513
+ `,r+=`dmin = dnum
514
+ `,r+=`dmax = dnum
515
+ `,r+=`bmin = bnum
516
+ `,r+=`bmax = bnum
517
+ `,r+=`xmin = xnum
518
+ `,r+=`xmax = xnum
519
+ `,r+=`dnum = 1*(%d48-57)
520
+ `,r+=`bnum = 1*%d48-49
521
+ `,r+=`xnum = 1*(%d48-57 / %d65-70 / %d97-102)
522
+ `,r+=`;
523
+ `,r+=`; Basics
524
+ `,r+=`alphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)
525
+ `,r+=`owsp = *space
526
+ `,r+=`wsp = 1*space
527
+ `,r+=`space = %d32
528
+ `,r+=` / %d9
529
+ `,r+=` / comment
530
+ `,r+=` / LineContinue
531
+ `,r+=`comment = %d59 *(%d32-126 / %d9)
532
+ `,r+=`LineEnd = %d13.10
533
+ `,r+=` / %d10
534
+ `,r+=` / %d13
535
+ `,r+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
536
+ `,r},"toString")},"grammar")});var X4=De((cV,Y4)=>{Y4.exports=o(function(){let e="parser: ",r=za(),n=r.ids,i=new(j4()),a=new(V4()),c=new(J4()),u=new r.parser;u.ast=new r.ast,u.callbacks=i.callbacks,u.ast.callbacks=a.callbacks;let d=o(function(O,R,I){if(R<0||R>=I)return-1;for(let N=0;N<O.length;N+=1)if(R>=O[N].beginChar&&R<O[N].beginChar+O[N].length)return N;return-1},"findLine"),v=o(function(O,R){let I=-1;if(R<O.length){for(let N=R;N<O.length;N+=1)if(O[N]!==null){I=O[N];break}}return I},"translateIndex"),y=o(function(O){O.forEach(R=>{let I=[],N=[],J=0;R.opcodes.forEach(L=>{L.type===n.ALT&&L.children.length===1||L.type===n.CAT&&L.children.length===1||L.type===n.REP&&L.min===1&&L.max===1?N.push(null):(N.push(J),I.push(L),J+=1)}),N.push(J),I.forEach(L=>{if(L.type===n.ALT||L.type===n.CAT)for(let V=0;V<L.children.length;V+=1)L.children[V]=v(N,L.children[V])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,N,J){if(J){if(J.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=J}let L={};L.errors=I,L.strict=!!N,L.lines=R,L.findLine=d,L.charsLength=O.length,L.ruleCount=0,u.parse(c,"file",O,L).success||I.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(O,R,I){let N={};return N.errors=I,N.lines=R,N.findLine=d,N.charsLength=O.length,u.ast.translate(N),I.length?null:(y(N.rules),{rules:N.rules,udts:N.udts,lineMap:N.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,N,J){let L="",V,Z,Y,oe=0,K=1/0,q=0,j=[],le=[],T=0,h=0,x=0,b=0,l=0,m=0,_=0,A=0,E=0,g=0,C=0,P=0,w=0,k=0,he=0;I.forEach(se=>{j.push(se.lower),oe+=se.opcodes.length,se.opcodes.forEach(F=>{switch(F.type){case n.ALT:T+=1;break;case n.CAT:h+=1;break;case n.RNM:x+=1;break;case n.UDT:b+=1;break;case n.REP:l+=1;break;case n.AND:m+=1;break;case n.NOT:_+=1;break;case n.BKA:P+=1;break;case n.BKN:w+=1;break;case n.BKR:C+=1;break;case n.ABG:k+=1;break;case n.AEN:he+=1;break;case n.TLS:for(A+=1,V=0;V<F.string.length;V+=1)F.string[V]<K&&(K=F.string[V]),F.string[V]>q&&(q=F.string[V]);break;case n.TBS:for(E+=1,V=0;V<F.string.length;V+=1)F.string[V]<K&&(K=F.string[V]),F.string[V]>q&&(q=F.string[V]);break;case n.TRG:g+=1,F.min<K&&(K=F.min),F.max>q&&(q=F.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),j.sort(),N.length>0&&(N.forEach(se=>{le.push(se.lower)}),le.sort());let D="module.exports";J&&typeof J=="string"&&(D=`let ${J}`),L+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
537
+ `,L+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
538
+ `,L+=`//
539
+ `,L+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
540
+ `,L+=`${D} = function grammar(){
541
+ `,L+=" // ```\n",L+=` // SUMMARY
542
+ `,L+=` // rules = ${I.length}
543
+ `,L+=` // udts = ${N.length}
544
+ `,L+=` // opcodes = ${oe}
545
+ `,L+=` // --- ABNF original opcodes
546
+ `,L+=` // ALT = ${T}
547
+ `,L+=` // CAT = ${h}
548
+ `,L+=` // REP = ${l}
549
+ `,L+=` // RNM = ${x}
550
+ `,L+=` // TLS = ${A}
551
+ `,L+=` // TBS = ${E}
552
+ `,L+=` // TRG = ${g}
553
+ `,L+=` // --- SABNF superset opcodes
554
+ `,L+=` // UDT = ${b}
555
+ `,L+=` // AND = ${m}
556
+ `,L+=` // NOT = ${_}
557
+ `,L+=` // BKA = ${P}
558
+ `,L+=` // BKN = ${w}
559
+ `,L+=` // BKR = ${C}
560
+ `,L+=` // ABG = ${k}
561
+ `,L+=` // AEN = ${he}
562
+ `,L+=" // characters = [",A+E+g===0?L+=" none defined ]":L+=`${K} - ${q}]`,b>0&&(L+=" + user defined"),L+=`
563
+ `,L+=" // ```\n",L+=` /* OBJECT IDENTIFIER (for internal parser use) */
564
+ `,L+=` this.grammarObject = 'grammarObject';
565
+ `,L+=`
566
+ `,L+=` /* RULES */
567
+ `,L+=` this.rules = [];
568
+ `,I.forEach((se,F)=>{let $=" this.rules[";$+=F,$+="] = {name: '",$+=se.name,$+="', lower: '",$+=se.lower,$+="', index: ",$+=se.index,$+=", isBkr: ",$+=se.isBkr,$+=`};
569
+ `,L+=$}),L+=`
570
+ `,L+=` /* UDTS */
571
+ `,L+=` this.udts = [];
572
+ `,N.length>0&&N.forEach((se,F)=>{let $=" this.udts[";$+=F,$+="] = {name: '",$+=se.name,$+="', lower: '",$+=se.lower,$+="', index: ",$+=se.index,$+=", empty: ",$+=se.empty,$+=", isBkr: ",$+=se.isBkr,$+=`};
573
+ `,L+=$}),L+=`
574
+ `,L+=` /* OPCODES */
575
+ `,I.forEach((se,F)=>{F>0&&(L+=`
576
+ `),L+=` /* ${se.name} */
577
+ `,L+=` this.rules[${F}].opcodes = [];
578
+ `,se.opcodes.forEach(($,ee)=>{let ne;switch($.type){case n.ALT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, children: [${$.children.toString()}]};// ALT
579
+ `;break;case n.CAT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, children: [${$.children.toString()}]};// CAT
580
+ `;break;case n.RNM:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, index: ${$.index}};// RNM(${I[$.index].name})
581
+ `;break;case n.BKR:$.index>=I.length?(Z=N[$.index-I.length].name,Y=N[$.index-I.length].lower):(Z=I[$.index].name,Y=I[$.index].lower),ne="%i",$.bkrCase===n.BKR_MODE_CS&&(ne="%s"),$.bkrMode===n.BKR_MODE_UM?ne+="%u":ne+="%p",Z=ne+Z,L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, index: ${$.index}, lower: '${Y}', bkrCase: ${$.bkrCase}, bkrMode: ${$.bkrMode}};// BKR(\\${Z})
582
+ `;break;case n.UDT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, empty: ${$.empty}, index: ${$.index}};// UDT(${N[$.index].name})
583
+ `;break;case n.REP:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, min: ${$.min}, max: ${$.max}};// REP
584
+ `;break;case n.AND:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// AND
585
+ `;break;case n.NOT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// NOT
586
+ `;break;case n.ABG:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// ABG(%^)
587
+ `;break;case n.AEN:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// AEN(%$)
588
+ `;break;case n.BKA:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// BKA
589
+ `;break;case n.BKN:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// BKN
590
+ `;break;case n.TLS:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, string: [${$.string.toString()}]};// TLS
591
+ `;break;case n.TBS:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, string: [${$.string.toString()}]};// TBS
592
+ `;break;case n.TRG:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, min: ${$.min}, max: ${$.max}};// TRG
593
+ `;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),L+=`
594
+ `,L+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",L+=` this.toString = function toString(){
595
+ `,L+=` let str = "";
596
+ `;let Q;return R.forEach(se=>{let F=se.beginChar+se.length;Q="",L+=' str += "';for(let $=se.beginChar;$<F;$+=1){switch(O[$]){case 9:Q=" ";break;case 10:Q="\\n";break;case 13:Q="\\r";break;case 34:Q='\\"';break;case 92:Q="\\\\";break;default:Q=String.fromCharCode(O[$]);break}L+=Q}L+=`";
597
+ `}),L+=` return str;
598
+ `,L+=` }
599
+ `,L+=`}
600
+ `,L},"generateSource"),this.generateObject=o(function(O,R,I){let N={},J=[],L=[],V=O.slice(0);return N.grammarObject="grammarObject",R.forEach(Z=>{J.push(Z.lower)}),J.sort(),I.length>0&&(I.forEach(Z=>{L.push(Z.lower)}),L.sort()),N.callbacks=[],J.forEach(Z=>{N.callbacks[Z]=!1}),I.length>0&&L.forEach(Z=>{N.callbacks[Z]=!1}),N.rules=R,N.udts=I,N.toString=o(function(){return V},"toStringFunc"),N},"generateObject")},"exportParser")});var Q4=De((uV,Z4)=>{Z4.exports=o(function(){let e=zi(),r="rule-attributes.js",n=null;function i(T){return T.left||T.nested||T.right||T.cyclic?!1:T.empty}o(i,"isEmptyOnly");function a(T){return!!(T.left||T.nested||T.right||T.cyclic)}o(a,"isRecursive");function c(T,h){let x=0,b=0,l=0;for(x=0;x<h;x+=1)if(T[x].nested)return!0;for(x=0;x<h;x+=1)if(T[x].right&&!T[x].leaf){for(b=x+1;b<h;b+=1)if(!i(T[b]))return!0}for(x=h-1;x>=0;x-=1)if(T[x].left&&!T[x].leaf){for(b=x-1;b>=0;b-=1)if(!i(T[b]))return!0}for(x=0;x<h;x+=1)if(!T[x].empty&&!a(T[x])){for(b=x+1;b<h;b+=1)if(a(T[b])){for(l=b+1;l<h;l+=1)if(!T[l].empty&&!a(T[l]))return!0}}return!1}o(c,"isCatNested");function u(T,h){for(let x=0;x<h;x+=1)if(!T[x].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(T,h){for(let x=0;x<h;x+=1){if(T[x].left)return!0;if(!T[x].empty)return!1}return!1}o(d,"isCatLeft");function v(T,h){for(let x=h-1;x>=0;x-=1){if(T[x].right)return!0;if(!T[x].empty)return!1}return!1}o(v,"isCatRight");function y(T,h){for(let x=0;x<h;x+=1)if(!T[x].empty)return!1;return!0}o(y,"isCatEmpty");function S(T,h){for(let x=0;x<h;x+=1)if(!T[x].finite)return!1;return!0}o(S,"isCatFinite");function O(T,h,x,b){let l=0,m=h[x],_=m.children.length,A=[];for(l=0;l<_;l+=1)A.push(T.attrGen());for(l=0;l<_;l+=1)N(T,h,m.children[l],A[l]);b.left=d(A,_),b.right=v(A,_),b.nested=c(A,_),b.empty=y(A,_),b.finite=S(A,_),b.cyclic=u(A,_)}o(O,"cat");function R(T,h,x,b){let l=0,m=h[x],_=m.children.length,A=[];for(l=0;l<_;l+=1)A.push(T.attrGen());for(l=0;l<_;l+=1)N(T,h,m.children[l],A[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)A[l].left&&(b.left=!0),A[l].nested&&(b.nested=!0),A[l].right&&(b.right=!0),A[l].empty&&(b.empty=!0),A[l].finite&&(b.finite=!0),A[l].cyclic&&(b.cyclic=!0)}o(R,"alt");function I(T,h,x,b){let l=h[x];l.index>=T.ruleCount?(b.empty=T.udts[l.index-T.ruleCount].empty,b.finite=!0):(J(T,l.index,b),b.left=!1,b.nested=!1,b.right=!1,b.cyclic=!1)}o(I,"bkr");function N(T,h,x,b){T.attrInit(b);let l=h[x];switch(l.type){case e.ALT:R(T,h,x,b);break;case e.CAT:O(T,h,x,b);break;case e.REP:N(T,h,x+1,b),l.min===0&&(b.empty=!0,b.finite=!0);break;case e.RNM:J(T,h[x].index,b);break;case e.BKR:I(T,h,x,b);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:N(T,h,x+1,b),b.empty=!0;break;case e.TLS:b.empty=!h[x].string.length,b.finite=!0,b.cyclic=!1;break;case e.TBS:case e.TRG:b.empty=!1,b.finite=!0,b.cyclic=!1;break;case e.UDT:b.empty=l.empty,b.finite=!0,b.cyclic=!1;break;case e.ABG:case e.AEN:b.empty=!0,b.finite=!0,b.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${l}`)}}o(N,"opEval");function J(T,h,x){let b=T.attrsWorking[h];b.isComplete?T.attrCopy(x,b):b.isOpen?h===T.startRule?h===T.startRule&&(x.left=!0,x.right=!0,x.cyclic=!0,x.leaf=!0):x.finite=!0:(b.isOpen=!0,N(T,b.rule.opcodes,0,x),b.left=x.left,b.right=x.right,b.nested=x.nested,b.empty=x.empty,b.finite=x.finite,b.cyclic=x.cyclic,b.leaf=!1,b.isOpen=!1,b.isComplete=!0)}o(J,"ruleAttrsEval");let L=o(T=>{n=T;let h=0,x=0,b=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(x=0;x<n.ruleCount;x+=1)n.attrInit(n.attrsWorking[x]);n.startRule=h,J(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"),V=o(T=>T?"t":"f","truth"),Z=o(T=>T?"e":"f","tError"),Y=o(T=>T?"t":"e","fError"),oe=o((T,h,x,b)=>{let l=`${T}:${h}:`;return l+=`${Z(x.left)} `,l+=`${V(x.nested)} `,l+=`${V(x.right)} `,l+=`${Z(x.cyclic)} `,l+=`${Y(x.finite)} `,l+=`${V(x.empty)}:`,l+=`${n.typeToString(b.recursiveType)}:`,l+=b.recursiveType===e.ATTR_MR?b.groupNumber:"-",l+=`:${x.rule.name}
601
+ `,l},"showAttr"),K=o(()=>{let T=`LEGEND - t=true, f=false, e=error
602
+ `;return T+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
603
+ `,T},"showLegend"),q=o(()=>{let T=null,h=null,x="";if(x+=`RULE ATTRIBUTES WITH ERRORS
604
+ `,x+=K(),n.attrsErrorCount)for(let b=0;b<n.attrsErrorCount;b+=1)T=n.attrsErrors[b],h=n.ruleDeps[T.rule.index],x+=oe(b,T.rule.index,T,h);else x+=`<none>
605
+ `;return x},"showAttributeErrors"),j=o(T=>{let h=0,x=0,b=null,l=null,m="",{ruleIndexes:_}=n;for(T===97?_=n.ruleAlphaIndexes:T===116&&(_=n.ruleTypeIndexes),h=0;h<n.ruleCount;h+=1)x=_[h],b=n.attrs[x],l=n.ruleDeps[x],m+=oe(h,x,b,l);return m},"show");return{ruleAttributes:L,showAttributes:o((T="index")=>{if(!n.attributesComplete)throw new Error(`${r}:showAttributes: attributes not available`);let h="",x=`RULE ATTRIBUTES
606
+ `;return T.charCodeAt(0)===97?(h+=`alphabetical by rule name
607
+ `,h+=x,h+=K(),h+=j(97)):T.charCodeAt(0)===116?(h+=`ordered by rule type
608
+ `,h+=x,h+=K(),h+=j(116)):(h+=`ordered by rule index
609
+ `,h+=x,h+=K(),h+=j()),h},"showAttributes"),showAttributeErrors:q}},"exportRuleAttributes")()});var t5=De((lV,e5)=>{e5.exports=(()=>{let t=zi(),e=null,r=o((c,u,d,v)=>{let y=0,S=0,O=u[d];v[d]=!0;let R=O.rule.opcodes;for(y=0;y<R.length;y+=1){let I=R[y];if(I.type===t.RNM)for(O.refersTo[I.index]=!0,v[I.index]||r(c,u,I.index,v),S=0;S<c;S+=1)u[I.index].refersTo[S]&&(O.refersTo[S]=!0);else I.type===t.UDT?O.refersToUdt[I.index]=!0:I.type===t.BKR&&(I.index<c?(O.refersTo[I.index]=!0,v[I.index]||r(c,u,I.index,v)):O.refersToUdt[c-I.index]=!0)}},"scan"),n=o(c=>{e=c;let u=0,d=0,v=0,y=null,S=null,O=!1;e.dependenciesComplete=!1;let R=e.falseArray(e.ruleCount);for(u=0;u<e.ruleCount;u+=1)e.falsifyArray(R),r(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=t.ATTR_N,e.ruleDeps[u].refersTo[u]&&(e.ruleDeps[u].recursiveType=t.ATTR_R);for(v=-1,u=0;u<e.ruleCount;u+=1)if(y=e.ruleDeps[u],y.recursiveType===t.ATTR_R)for(O=!0,d=0;d<e.ruleCount;d+=1)u!==d&&(S=e.ruleDeps[d],S.recursiveType===t.ATTR_R&&y.refersTo[d]&&S.refersTo[u]&&(O&&(v+=1,y.recursiveType=t.ATTR_MR,y.groupNumber=v,O=!1),S.recursiveType=t.ATTR_MR,S.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((c=null)=>{let u=0,d=0,v=0,y=0,S=e.ruleCount-1,O=e.udtCount-1,R=100,I="",N="",J="=> ",L="<= ",V=!1,Z=null,{ruleIndexes:Y}=e,{udtIndexes:oe}=e;for(c===97?(Y=e.ruleAlphaIndexes,oe=e.udtAlphaIndexes):c===116&&(Y=e.ruleTypeIndexes,oe=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(Z=e.ruleDeps[Y[u]],N=`${Y[u]}:${e.typeToString(Z.recursiveType)}:`,e.isMutuallyRecursive&&(N+=Z.groupNumber>-1?Z.groupNumber:"-",N+=":"),N+=" ",I+=`${N+e.rules[Y[u]].name}
610
+ `,V=!0,v=0,y=I.length,I+=N,d=0;d<e.ruleCount;d+=1)Z.refersTo[Y[d]]&&(V?(I+=J,V=!1,I+=e.ruleDeps[Y[d]].rule.name):I+=`, ${e.ruleDeps[Y[d]].rule.name}`,v+=1),I.length-y>R&&d!==S&&(I+=`
611
+ ${N}${J}`,y=I.length);if(e.udtCount)for(d=0;d<e.udtCount;d+=1)Z.refersToUdt[oe[d]]&&(V?(I+=J,V=!1,I+=e.udts[oe[d]].name):I+=`, ${e.udts[oe[d]].name}`,v+=1),I.length-y>R&&d!==O&&(I+=`
612
+ ${N}${J}`,y=I.length);for(v===0&&(I+=`=> <none>
613
+ `),V===!1&&(I+=`
614
+ `),V=!0,v=0,y=I.length,I+=N,d=0;d<e.ruleCount;d+=1)Z.referencedBy[Y[d]]&&(V?(I+=L,V=!1,I+=e.ruleDeps[Y[d]].rule.name):I+=`, ${e.ruleDeps[Y[d]].rule.name}`,v+=1),I.length-y>R&&d!==S&&(I+=`
615
+ ${N}${J}`,y=I.length);v===0&&(I+=`<= <none>
616
+ `),V===!1&&(I+=`
617
+ `),I+=`
618
+ `}return I},"show");return{ruleDependencies:n,showRuleDependencies:o((c="index")=>{let u=`RULE DEPENDENCIES(index:type:[group number:])
619
+ `;return u+=`=> refers to rule names
620
+ `,u+=`<= referenced by rule names
621
+ `,e.dependenciesComplete&&(c.charCodeAt(0)===97?(u+=`alphabetical by rule name
622
+ `,u+=i(97)):c.charCodeAt(0)===116?(u+=`ordered by rule type
623
+ `,u+=i(116)):(u+=`ordered by rule index
624
+ `,u+=i(null))),u},"showRuleDependencies")}})()});var n5=De((hV,r5)=>{r5.exports=o(function(){let e=zi(),{ruleAttributes:r,showAttributes:n,showAttributeErrors:i}=Q4(),{ruleDependencies:a,showRuleDependencies:c}=t5();class u{constructor(y,S){this.rules=y,this.udts=S,this.ruleCount=y.length,this.udtCount=S.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let O=0;O<this.ruleCount;O+=1)this.attrs.push(this.attrGen(this.rules[O])),this.attrsWorking.push(this.attrGen(this.rules[O])),this.ruleDeps.push(this.rdGen(y[O],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(y){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:y}}attrInit(y){y.left=!1,y.nested=!1,y.right=!1,y.empty=!1,y.finite=!1,y.cyclic=!1,y.leaf=!1,y.isOpen=!1,y.isComplete=!1}attrCopy(y,S){y.left=S.left,y.nested=S.nested,y.right=S.right,y.empty=S.empty,y.finite=S.finite,y.cyclic=S.cyclic,y.leaf=S.leaf,y.isOpen=S.isOpen,y.isComplete=S.isComplete,y.rule=S.rule}rdGen(y,S,O){return{rule:y,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(S),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(S)}}typeToString(y){switch(y){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(y){let S=[];if(y>0)for(let O=0;O<y;O+=1)S.push(!1);return S}falsifyArray(y){for(let S=0;S<y.length;S+=1)y[S]=!1}indexArray(y){let S=[];if(y>0)for(let O=0;O<y;O+=1)S.push(O);return S}compRulesAlpha(y,S){return this.rules[y].lower<this.rules[S].lower?-1:this.rules[y].lower>this.rules[S].lower?1:0}compUdtsAlpha(y,S){return this.udts[y].lower<this.udts[S].lower?-1:this.udts[y].lower>this.udts[S].lower?1:0}compRulesType(y,S){return this.ruleDeps[y].recursiveType<this.ruleDeps[S].recursiveType?-1:this.ruleDeps[y].recursiveType>this.ruleDeps[S].recursiveType?1:0}compRulesGroup(y,S){if(this.ruleDeps[y].recursiveType===e.ATTR_MR&&this.ruleDeps[S].recursiveType===e.ATTR_MR){if(this.ruleDeps[y].groupNumber<this.ruleDeps[S].groupNumber)return-1;if(this.ruleDeps[y].groupNumber>this.ruleDeps[S].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(y=[],S=[],O=[],R=[]){let I=new u(y,S);return a(I),r(I),I.attrsErrorCount&&R.push({line:0,char:0,msg:`${I.attrsErrorCount} attribute errors`}),I.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:c}},"exportAttributes")()});var o5=De((dV,i5)=>{i5.exports=o(function(){let e="show-rules.js";return o(function(i=[],a=[],c="index"){let u="showRules",d=[],v=[],y=[],S=[],O=i,R=a,I=i.length,N=a.length,J="RULE/UDT NAMES",L;function V(Y,oe){return O[Y].lower<O[oe].lower?-1:O[Y].lower>O[oe].lower?1:0}o(V,"compRulesAlpha");function Z(Y,oe){return R[Y].lower<R[oe].lower?-1:R[Y].lower>R[oe].lower?1:0}if(o(Z,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${u}: rules arg must be array with length > 0`);if(!Array.isArray(a))throw new Error(`${e}:${u}: udts arg must be array`);for(L=0;L<I;L+=1)y.push(L);if(d=y.slice(0),d.sort(V),N){for(L=0;L<N;L+=1)S.push(L);v=S.slice(0),v.sort(Z)}if(c.charCodeAt(0)===97){for(J+=` - alphabetical by rule/UDT name
625
+ `,L=0;L<I;L+=1)J+=`${L}: ${d[L]}: ${O[d[L]].name}
626
+ `;if(N)for(L=0;L<N;L+=1)J+=`${L}: ${v[L]}: ${R[v[L]].name}
627
+ `}else{for(J+=` - ordered by rule/UDT index
628
+ `,L=0;L<I;L+=1)J+=`${L}: ${O[L].name}
629
+ `;if(N)for(L=0;L<N;L+=1)J+=`${L}: ${R[L].name}
630
+ `}return J},"showRules")},"exfn")()});var a5=De((pV,s5)=>{s5.exports=o(function(e){let r="api.js: ",n=this,i=za(),a=ob(),c=z4(),u=new(X4()),{attributes:d,showAttributes:v,showAttributeErrors:y,showRuleDependencies:S}=n5(),O=o5(),R=o(function(T,h,x){let _=`<span class="${i.style.CLASS_CTRLCHAR}">`,A="</span>",E=`<span class="${i.style.CLASS_NOMATCH}">`,g="</span>",C,P="",w=!0;for(;w&&!(!Array.isArray(T)||T.length===0);){if(typeof h!="number")throw new Error("abnfToHtml: beg must be type number");if(h>=T.length)break;typeof x!="number"||h+x>=T.length?C=T.length:C=h+x;let k=0;for(let he=h;he<C;he+=1){let D=T[he];if(D>=32&&D<=126)switch(k===1?(P+=A,k=0):k===2&&(P+=g,k=0),D){case 32:P+="&nbsp;";break;case 60:P+="&lt;";break;case 62:P+="&gt;";break;case 38:P+="&amp;";break;case 34:P+="&quot;";break;case 39:P+="&#039;";break;case 92:P+="&#092;";break;default:P+=String.fromCharCode(D);break}else D===9||D===10||D===13?(k===0?(P+=_,k=1):k===2&&(P+=g+_,k=1),D===9&&(P+="TAB"),D===10&&(P+="LF"),D===13&&(P+="CR")):(k===0?(P+=E,k=2):k===1&&(P+=A+E,k=2),P+=`\\x${i.utils.charToHex(D)}`)}k===2&&(P+=g),k===1&&(P+=A);break}return P},"abnfToHtml"),I=o(function(T,h,x){let b="";for(let l=h;l<h+x;l+=1){let m=T[l];if(m>=32&&m<=126)b+=String.fromCharCode(m);else switch(m){case 9:b+="\\t";break;case 10:b+="\\n";break;case 13:b+="\\r";break;default:b+="\\unknown";break}}return b},"abnfToAscii"),N=o(function(T){let h="Annotated Input Grammar";return T.forEach(x=>{h+=`
631
+ `,h+=`line no: ${x.lineNo}`,h+=` : char index: ${x.beginChar}`,h+=` : length: ${x.length}`,h+=` : abnf: ${I(n.chars,x.beginChar,x.length)}`}),h+=`
632
+ `,h},"linesToAscii"),J=o(function(T){let h="";return h+=`<table class="${i.style.CLASS_GRAMMAR}">
633
+ `,h+=`<caption>Annotated Input Grammar</caption>
634
+ `,h+="<tr>",h+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",h+=`</tr>
635
+ `,T.forEach(b=>{h+="<tr>",h+=`<td>${b.lineNo}`,h+=`</td><td>${b.beginChar}`,h+=`</td><td>${b.length}`,h+=`</td><td>${R(n.chars,b.beginChar,b.length)}`,h+="</td>",h+=`</tr>
636
+ `}),h+=`</table>
637
+ `,h},"linesToHtml"),L=o(function(T,h,x,b){let[l]=i,m="",_=`<span class="${l.CLASS_NOMATCH}">&raquo;</span>`;return m+=`<p><table class="${l.CLASS_GRAMMAR}">
638
+ `,b&&typeof b=="string"&&(m+=`<caption>${b}</caption>
639
+ `),m+=`<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>
640
+ `,T.forEach(A=>{let E,g,C,P,w,k="",he="";h.length===0?(w=_,g=0):(E=h[A.line],C=E.beginChar,A.char>C&&(k=R(x,C,A.char-C)),C=A.char,P=E.beginChar+E.length,C<P&&(he=R(x,C,P-C)),w=k+_+he,g=A.char-E.beginChar,m+="<tr>",m+=`<td>${A.line}</td><td>${E.beginChar}</td><td>${g}</td><td>${w}</td>`,m+=`</tr>
641
+ `,m+="<tr>",m+=`<td colspan="3"></td><td>&uarr;:&nbsp;${i.utils.stringToAsciiHtml(A.msg)}</td>`,m+=`</tr>
642
+ `)}),m+=`</table></p>
643
+ `,m},"errorsToHtml"),V=o(function(T,h,x){let b,l,m,_;return b="",T.forEach(A=>{l=h[A.line],b+=`${l.lineNo}: `,b+=`${l.beginChar}: `,b+=`${A.char-l.beginChar}: `,m=l.beginChar,_=A.char-l.beginChar,b+=I(x,m,_),b+=" >> ",m=A.char,_=l.beginChar+l.length-A.char,b+=I(x,m,_),b+=`
644
+ `,b+=`${l.lineNo}: `,b+=`${l.beginChar}: `,b+=`${A.char-l.beginChar}: `,b+="error: ",b+=A.msg,b+=`
645
+ `}),b},"errorsToAscii"),Z=!1,Y=!1,oe=!1,K=!1,q=0,j;if(this.errors=[],Buffer.isBuffer(e))this.chars=a.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=a.decode("STRING",e);else throw new Error(`${r}input source is not a string, byte Buffer or character array`);this.sabnf=a.encode("STRING",this.chars),this.scan=o(function(T,h){this.lines=c(this.chars,this.errors,T,h),Z=!0},"scan"),this.parse=o(function(T,h){if(!Z)throw new Error(`${r}grammar not scanned`);u.syntax(this.chars,this.lines,this.errors,T,h),Y=!0},"parse"),this.translate=o(function(){if(!Y)throw new Error(`${r}grammar not scanned and parsed`);let T=u.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=T.rules,this.udts=T.udts,j=T.lineMap,oe=!0)},"translate"),this.attributes=o(function(){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return q=d(this.rules,this.udts,j,this.errors),K=!0,q},"attrs"),this.generate=o(function(T){if(this.lines=c(this.chars,this.errors,T),this.errors.length||(u.syntax(this.chars,this.lines,this.errors,T),this.errors.length))return;let h=u.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=h.rules,this.udts=h.udts,j=h.lineMap,q=d(this.rules,this.udts,j,this.errors),K=!0)},"generate"),this.displayRules=o(function(T="index"){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return O(this.rules,this.udts,T)},"displayRules"),this.displayRuleDependencies=o(function(T="index"){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return S(T)},"displayRuleDependencies"),this.displayAttributes=o(function(T="index"){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return q&&y(T),v(T)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return y()},"displayAttributeErrors"),this.toSource=o(function(T){if(!K)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(q)throw new Error(`${r}can't generate parser source - attributes have ${q} errors`);return u.generateSource(this.chars,this.lines,this.rules,this.udts,T)},"toSource"),this.toObject=o(function(){if(!K)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(q)throw new Error(`${r}can't generate parser source - attributes have ${q} errors`);return u.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return V(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(T){return L(this.errors,this.lines,this.chars,T)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return N(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return J(this.lines)},"linesToHtmlFunc")},"api")});var xb=De((E5,yb)=>{(function(t,e){"use strict";function r(b,l){if(!b)throw new Error(l||"Assertion failed")}o(r,"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 t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=zm().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),r(m===(m|0)&&m>=2&&m<=36),l=l.toString().replace(/\s+/g,"");var A=0;l[0]==="-"&&(A++,this.negative=1),A<l.length&&(m===16?this._parseHex(l,A,_):(this._parseBase(l,m,A),_==="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):(r(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(r(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 A=0;A<this.length;A++)this.words[A]=0;var E,g,C=0;if(_==="be")for(A=l.length-1,E=0;A>=0;A-=3)g=l[A]|l[A-1]<<8|l[A-2]<<16,this.words[E]|=g<<C&67108863,this.words[E+1]=g>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);else if(_==="le")for(A=0,E=0;A<l.length;A+=3)g=l[A]|l[A+1]<<8|l[A+2]<<16,this.words[E]|=g<<C&67108863,this.words[E+1]=g>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);return this._strip()},"_initArray");function c(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;r(!1,"Invalid character in "+b)}o(c,"parseHex4Bits");function u(b,l,m){var _=c(b,m);return m-1>=l&&(_|=c(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 A=0;A<this.length;A++)this.words[A]=0;var E=0,g=0,C;if(_==="be")for(A=l.length-1;A>=m;A-=2)C=u(l,m,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8;else{var P=l.length-m;for(A=P%2===0?m+1:m;A<l.length;A+=2)C=u(l,m,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8}this._strip()},"_parseHex");function d(b,l,m,_){for(var A=0,E=0,g=Math.min(b.length,m),C=l;C<g;C++){var P=b.charCodeAt(C)-48;A*=_,P>=49?E=P-49+10:P>=17?E=P-17+10:E=P,r(P>=0&&E<_,"Invalid character"),A+=E}return A}o(d,"parseBase"),i.prototype._parseBase=o(function(l,m,_){this.words=[0],this.length=1;for(var A=0,E=1;E<=67108863;E*=m)A++;A--,E=E/m|0;for(var g=l.length-_,C=g%A,P=Math.min(g,g-C)+_,w=0,k=_;k<P;k+=A)w=d(l,k,k+A,m),this.imuln(E),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(C!==0){var he=1;for(w=d(l,k,l.length,m),k=0;k<C;k++)he*=m;this.imuln(he),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")]=y}catch{i.prototype.inspect=y}else i.prototype.inspect=y;function y(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(y,"inspect");var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],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 A=0,E=0,g=0;g<this.length;g++){var C=this.words[g],P=((C<<A|E)&16777215).toString(16);E=C>>>24-A&16777215,A+=2,A>=26&&(A-=26,g--),E!==0||g!==this.length-1?_=S[6-P.length]+P+_:_=P+_}for(E!==0&&(_=E.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 he=this.clone();for(he.negative=0;!he.isZero();){var D=he.modrn(k).toString(l);he=he.idivn(k),he.isZero()?_=D+_:_=S[w-D.length]+D+_}for(this.isZero()&&(_="0"+_);_.length%m!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}r(!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&&r(!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"),a&&(i.prototype.toBuffer=o(function(l,m){return this.toArrayLike(a,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 A=this.byteLength(),E=_||Math.max(1,A);r(A<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0");var g=I(l,E),C=m==="le"?"LE":"BE";return this["_toArrayLike"+C](g,A),g},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,m){for(var _=0,A=0,E=0,g=0;E<this.length;E++){var C=this.words[E]<<g|A;l[_++]=C&255,_<l.length&&(l[_++]=C>>8&255),_<l.length&&(l[_++]=C>>16&255),g===6?(_<l.length&&(l[_++]=C>>24&255),A=0,g=0):(A=C>>>24,g+=2)}if(_<l.length)for(l[_++]=A;_<l.length;)l[_++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,m){for(var _=l.length-1,A=0,E=0,g=0;E<this.length;E++){var C=this.words[E]<<g|A;l[_--]=C&255,_>=0&&(l[_--]=C>>8&255),_>=0&&(l[_--]=C>>16&255),g===6?(_>=0&&(l[_--]=C>>24&255),A=0,g=0):(A=C>>>24,g+=2)}if(_>=0)for(l[_--]=A;_>=0;)l[_--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var m=l,_=0;return m>=4096&&(_+=13,m>>>=13),m>=64&&(_+=7,m>>>=7),m>=8&&(_+=4,m>>>=4),m>=2&&(_+=2,m>>>=2),_+m},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var m=l,_=0;return(m&8191)===0&&(_+=13,m>>>=13),(m&127)===0&&(_+=7,m>>>=7),(m&15)===0&&(_+=4,m>>>=4),(m&3)===0&&(_+=2,m>>>=2),(m&1)===0&&_++,_},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],m=this._countBits(l);return(this.length-1)*26+m},"bitLength");function N(b){for(var l=new Array(b.bitLength()),m=0;m<l.length;m++){var _=m/26|0,A=m%26;l[m]=b.words[_]>>>A&1}return l}o(N,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,m=0;m<this.length;m++){var _=this._zeroBits(this.words[m]);if(l+=_,_!==26)break}return l},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var m=0;m<l.length;m++)this.words[m]=this.words[m]|l.words[m];return this._strip()},"iuor"),i.prototype.ior=o(function(l){return r((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 r((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 A=0;A<_.length;A++)this.words[A]=m.words[A]^_.words[A];if(this!==m)for(;A<m.length;A++)this.words[A]=m.words[A];return this.length=m.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(l){return r((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){r(typeof l=="number"&&l>=0);var m=Math.ceil(l/26)|0,_=l%26;this._expand(m),_>0&&m--;for(var A=0;A<m;A++)this.words[A]=~this.words[A]&67108863;return _>0&&(this.words[A]=~this.words[A]&67108863>>26-_),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,m){r(typeof l=="number"&&l>=0);var _=l/26|0,A=l%26;return this._expand(_+1),m?this.words[_]=this.words[_]|1<<A:this.words[_]=this.words[_]&~(1<<A),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 _,A;this.length>l.length?(_=this,A=l):(_=l,A=this);for(var E=0,g=0;g<A.length;g++)m=(_.words[g]|0)+(A.words[g]|0)+E,this.words[g]=m&67108863,E=m>>>26;for(;E!==0&&g<_.length;g++)m=(_.words[g]|0)+E,this.words[g]=m&67108863,E=m>>>26;if(this.length=_.length,E!==0)this.words[this.length]=E,this.length++;else if(_!==this)for(;g<_.length;g++)this.words[g]=_.words[g];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 A,E;_>0?(A=this,E=l):(A=l,E=this);for(var g=0,C=0;C<E.length;C++)m=(A.words[C]|0)-(E.words[C]|0)+g,g=m>>26,this.words[C]=m&67108863;for(;g!==0&&C<A.length;C++)m=(A.words[C]|0)+g,g=m>>26,this.words[C]=m&67108863;if(g===0&&C<A.length&&A!==this)for(;C<A.length;C++)this.words[C]=A.words[C];return this.length=Math.max(this.length,C),A!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function J(b,l,m){m.negative=l.negative^b.negative;var _=b.length+l.length|0;m.length=_,_=_-1|0;var A=b.words[0]|0,E=l.words[0]|0,g=A*E,C=g&67108863,P=g/67108864|0;m.words[0]=C;for(var w=1;w<_;w++){for(var k=P>>>26,he=P&67108863,D=Math.min(w,l.length-1),Q=Math.max(0,w-b.length+1);Q<=D;Q++){var se=w-Q|0;A=b.words[se]|0,E=l.words[Q]|0,g=A*E+he,k+=g/67108864|0,he=g&67108863}m.words[w]=he|0,P=k|0}return P!==0?m.words[w]=P|0:m.length--,m._strip()}o(J,"smallMulTo");var L=o(function(l,m,_){var A=l.words,E=m.words,g=_.words,C=0,P,w,k,he=A[0]|0,D=he&8191,Q=he>>>13,se=A[1]|0,F=se&8191,$=se>>>13,ee=A[2]|0,ne=ee&8191,ae=ee>>>13,Ae=A[3]|0,ge=Ae&8191,re=Ae>>>13,Se=A[4]|0,ce=Se&8191,ve=Se>>>13,G=A[5]|0,pe=G&8191,Ce=G>>>13,He=A[6]|0,Ne=He&8191,Ve=He>>>13,pr=A[7]|0,ue=pr&8191,ie=pr>>>13,U=A[8]|0,X=U&8191,me=U>>>13,ye=A[9]|0,we=ye&8191,ke=ye>>>13,Dt=E[0]|0,Ue=Dt&8191,Oe=Dt>>>13,Lt=E[1]|0,je=Lt&8191,Je=Lt>>>13,Tn=E[2]|0,nt=Tn&8191,it=Tn>>>13,Jn=E[3]|0,ot=Jn&8191,et=Jn>>>13,Yn=E[4]|0,st=Yn&8191,at=Yn>>>13,cn=E[5]|0,ft=cn&8191,Xe=cn>>>13,Xn=E[6]|0,ct=Xn&8191,ut=Xn>>>13,Zn=E[7]|0,lt=Zn&8191,ht=Zn>>>13,Qn=E[8]|0,dt=Qn&8191,tt=Qn>>>13,Cn=E[9]|0,$t=Cn&8191,Ft=Cn>>>13;_.negative=l.negative^m.negative,_.length=19,P=Math.imul(D,Ue),w=Math.imul(D,Oe),w=w+Math.imul(Q,Ue)|0,k=Math.imul(Q,Oe);var un=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(un>>>26)|0,un&=67108863,P=Math.imul(F,Ue),w=Math.imul(F,Oe),w=w+Math.imul($,Ue)|0,k=Math.imul($,Oe),P=P+Math.imul(D,je)|0,w=w+Math.imul(D,Je)|0,w=w+Math.imul(Q,je)|0,k=k+Math.imul(Q,Je)|0;var ln=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ln>>>26)|0,ln&=67108863,P=Math.imul(ne,Ue),w=Math.imul(ne,Oe),w=w+Math.imul(ae,Ue)|0,k=Math.imul(ae,Oe),P=P+Math.imul(F,je)|0,w=w+Math.imul(F,Je)|0,w=w+Math.imul($,je)|0,k=k+Math.imul($,Je)|0,P=P+Math.imul(D,nt)|0,w=w+Math.imul(D,it)|0,w=w+Math.imul(Q,nt)|0,k=k+Math.imul(Q,it)|0;var hn=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(hn>>>26)|0,hn&=67108863,P=Math.imul(ge,Ue),w=Math.imul(ge,Oe),w=w+Math.imul(re,Ue)|0,k=Math.imul(re,Oe),P=P+Math.imul(ne,je)|0,w=w+Math.imul(ne,Je)|0,w=w+Math.imul(ae,je)|0,k=k+Math.imul(ae,Je)|0,P=P+Math.imul(F,nt)|0,w=w+Math.imul(F,it)|0,w=w+Math.imul($,nt)|0,k=k+Math.imul($,it)|0,P=P+Math.imul(D,ot)|0,w=w+Math.imul(D,et)|0,w=w+Math.imul(Q,ot)|0,k=k+Math.imul(Q,et)|0;var Nr=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,P=Math.imul(ce,Ue),w=Math.imul(ce,Oe),w=w+Math.imul(ve,Ue)|0,k=Math.imul(ve,Oe),P=P+Math.imul(ge,je)|0,w=w+Math.imul(ge,Je)|0,w=w+Math.imul(re,je)|0,k=k+Math.imul(re,Je)|0,P=P+Math.imul(ne,nt)|0,w=w+Math.imul(ne,it)|0,w=w+Math.imul(ae,nt)|0,k=k+Math.imul(ae,it)|0,P=P+Math.imul(F,ot)|0,w=w+Math.imul(F,et)|0,w=w+Math.imul($,ot)|0,k=k+Math.imul($,et)|0,P=P+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 dn=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,P=Math.imul(pe,Ue),w=Math.imul(pe,Oe),w=w+Math.imul(Ce,Ue)|0,k=Math.imul(Ce,Oe),P=P+Math.imul(ce,je)|0,w=w+Math.imul(ce,Je)|0,w=w+Math.imul(ve,je)|0,k=k+Math.imul(ve,Je)|0,P=P+Math.imul(ge,nt)|0,w=w+Math.imul(ge,it)|0,w=w+Math.imul(re,nt)|0,k=k+Math.imul(re,it)|0,P=P+Math.imul(ne,ot)|0,w=w+Math.imul(ne,et)|0,w=w+Math.imul(ae,ot)|0,k=k+Math.imul(ae,et)|0,P=P+Math.imul(F,st)|0,w=w+Math.imul(F,at)|0,w=w+Math.imul($,st)|0,k=k+Math.imul($,at)|0,P=P+Math.imul(D,ft)|0,w=w+Math.imul(D,Xe)|0,w=w+Math.imul(Q,ft)|0,k=k+Math.imul(Q,Xe)|0;var ei=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ei>>>26)|0,ei&=67108863,P=Math.imul(Ne,Ue),w=Math.imul(Ne,Oe),w=w+Math.imul(Ve,Ue)|0,k=Math.imul(Ve,Oe),P=P+Math.imul(pe,je)|0,w=w+Math.imul(pe,Je)|0,w=w+Math.imul(Ce,je)|0,k=k+Math.imul(Ce,Je)|0,P=P+Math.imul(ce,nt)|0,w=w+Math.imul(ce,it)|0,w=w+Math.imul(ve,nt)|0,k=k+Math.imul(ve,it)|0,P=P+Math.imul(ge,ot)|0,w=w+Math.imul(ge,et)|0,w=w+Math.imul(re,ot)|0,k=k+Math.imul(re,et)|0,P=P+Math.imul(ne,st)|0,w=w+Math.imul(ne,at)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,P=P+Math.imul(F,ft)|0,w=w+Math.imul(F,Xe)|0,w=w+Math.imul($,ft)|0,k=k+Math.imul($,Xe)|0,P=P+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 So=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(So>>>26)|0,So&=67108863,P=Math.imul(ue,Ue),w=Math.imul(ue,Oe),w=w+Math.imul(ie,Ue)|0,k=Math.imul(ie,Oe),P=P+Math.imul(Ne,je)|0,w=w+Math.imul(Ne,Je)|0,w=w+Math.imul(Ve,je)|0,k=k+Math.imul(Ve,Je)|0,P=P+Math.imul(pe,nt)|0,w=w+Math.imul(pe,it)|0,w=w+Math.imul(Ce,nt)|0,k=k+Math.imul(Ce,it)|0,P=P+Math.imul(ce,ot)|0,w=w+Math.imul(ce,et)|0,w=w+Math.imul(ve,ot)|0,k=k+Math.imul(ve,et)|0,P=P+Math.imul(ge,st)|0,w=w+Math.imul(ge,at)|0,w=w+Math.imul(re,st)|0,k=k+Math.imul(re,at)|0,P=P+Math.imul(ne,ft)|0,w=w+Math.imul(ne,Xe)|0,w=w+Math.imul(ae,ft)|0,k=k+Math.imul(ae,Xe)|0,P=P+Math.imul(F,ct)|0,w=w+Math.imul(F,ut)|0,w=w+Math.imul($,ct)|0,k=k+Math.imul($,ut)|0,P=P+Math.imul(D,lt)|0,w=w+Math.imul(D,ht)|0,w=w+Math.imul(Q,lt)|0,k=k+Math.imul(Q,ht)|0;var Mo=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,P=Math.imul(X,Ue),w=Math.imul(X,Oe),w=w+Math.imul(me,Ue)|0,k=Math.imul(me,Oe),P=P+Math.imul(ue,je)|0,w=w+Math.imul(ue,Je)|0,w=w+Math.imul(ie,je)|0,k=k+Math.imul(ie,Je)|0,P=P+Math.imul(Ne,nt)|0,w=w+Math.imul(Ne,it)|0,w=w+Math.imul(Ve,nt)|0,k=k+Math.imul(Ve,it)|0,P=P+Math.imul(pe,ot)|0,w=w+Math.imul(pe,et)|0,w=w+Math.imul(Ce,ot)|0,k=k+Math.imul(Ce,et)|0,P=P+Math.imul(ce,st)|0,w=w+Math.imul(ce,at)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,P=P+Math.imul(ge,ft)|0,w=w+Math.imul(ge,Xe)|0,w=w+Math.imul(re,ft)|0,k=k+Math.imul(re,Xe)|0,P=P+Math.imul(ne,ct)|0,w=w+Math.imul(ne,ut)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,P=P+Math.imul(F,lt)|0,w=w+Math.imul(F,ht)|0,w=w+Math.imul($,lt)|0,k=k+Math.imul($,ht)|0,P=P+Math.imul(D,dt)|0,w=w+Math.imul(D,tt)|0,w=w+Math.imul(Q,dt)|0,k=k+Math.imul(Q,tt)|0;var To=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(To>>>26)|0,To&=67108863,P=Math.imul(we,Ue),w=Math.imul(we,Oe),w=w+Math.imul(ke,Ue)|0,k=Math.imul(ke,Oe),P=P+Math.imul(X,je)|0,w=w+Math.imul(X,Je)|0,w=w+Math.imul(me,je)|0,k=k+Math.imul(me,Je)|0,P=P+Math.imul(ue,nt)|0,w=w+Math.imul(ue,it)|0,w=w+Math.imul(ie,nt)|0,k=k+Math.imul(ie,it)|0,P=P+Math.imul(Ne,ot)|0,w=w+Math.imul(Ne,et)|0,w=w+Math.imul(Ve,ot)|0,k=k+Math.imul(Ve,et)|0,P=P+Math.imul(pe,st)|0,w=w+Math.imul(pe,at)|0,w=w+Math.imul(Ce,st)|0,k=k+Math.imul(Ce,at)|0,P=P+Math.imul(ce,ft)|0,w=w+Math.imul(ce,Xe)|0,w=w+Math.imul(ve,ft)|0,k=k+Math.imul(ve,Xe)|0,P=P+Math.imul(ge,ct)|0,w=w+Math.imul(ge,ut)|0,w=w+Math.imul(re,ct)|0,k=k+Math.imul(re,ut)|0,P=P+Math.imul(ne,lt)|0,w=w+Math.imul(ne,ht)|0,w=w+Math.imul(ae,lt)|0,k=k+Math.imul(ae,ht)|0,P=P+Math.imul(F,dt)|0,w=w+Math.imul(F,tt)|0,w=w+Math.imul($,dt)|0,k=k+Math.imul($,tt)|0,P=P+Math.imul(D,$t)|0,w=w+Math.imul(D,Ft)|0,w=w+Math.imul(Q,$t)|0,k=k+Math.imul(Q,Ft)|0;var Zi=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,P=Math.imul(we,je),w=Math.imul(we,Je),w=w+Math.imul(ke,je)|0,k=Math.imul(ke,Je),P=P+Math.imul(X,nt)|0,w=w+Math.imul(X,it)|0,w=w+Math.imul(me,nt)|0,k=k+Math.imul(me,it)|0,P=P+Math.imul(ue,ot)|0,w=w+Math.imul(ue,et)|0,w=w+Math.imul(ie,ot)|0,k=k+Math.imul(ie,et)|0,P=P+Math.imul(Ne,st)|0,w=w+Math.imul(Ne,at)|0,w=w+Math.imul(Ve,st)|0,k=k+Math.imul(Ve,at)|0,P=P+Math.imul(pe,ft)|0,w=w+Math.imul(pe,Xe)|0,w=w+Math.imul(Ce,ft)|0,k=k+Math.imul(Ce,Xe)|0,P=P+Math.imul(ce,ct)|0,w=w+Math.imul(ce,ut)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,P=P+Math.imul(ge,lt)|0,w=w+Math.imul(ge,ht)|0,w=w+Math.imul(re,lt)|0,k=k+Math.imul(re,ht)|0,P=P+Math.imul(ne,dt)|0,w=w+Math.imul(ne,tt)|0,w=w+Math.imul(ae,dt)|0,k=k+Math.imul(ae,tt)|0,P=P+Math.imul(F,$t)|0,w=w+Math.imul(F,Ft)|0,w=w+Math.imul($,$t)|0,k=k+Math.imul($,Ft)|0;var Qi=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,P=Math.imul(we,nt),w=Math.imul(we,it),w=w+Math.imul(ke,nt)|0,k=Math.imul(ke,it),P=P+Math.imul(X,ot)|0,w=w+Math.imul(X,et)|0,w=w+Math.imul(me,ot)|0,k=k+Math.imul(me,et)|0,P=P+Math.imul(ue,st)|0,w=w+Math.imul(ue,at)|0,w=w+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,P=P+Math.imul(Ne,ft)|0,w=w+Math.imul(Ne,Xe)|0,w=w+Math.imul(Ve,ft)|0,k=k+Math.imul(Ve,Xe)|0,P=P+Math.imul(pe,ct)|0,w=w+Math.imul(pe,ut)|0,w=w+Math.imul(Ce,ct)|0,k=k+Math.imul(Ce,ut)|0,P=P+Math.imul(ce,lt)|0,w=w+Math.imul(ce,ht)|0,w=w+Math.imul(ve,lt)|0,k=k+Math.imul(ve,ht)|0,P=P+Math.imul(ge,dt)|0,w=w+Math.imul(ge,tt)|0,w=w+Math.imul(re,dt)|0,k=k+Math.imul(re,tt)|0,P=P+Math.imul(ne,$t)|0,w=w+Math.imul(ne,Ft)|0,w=w+Math.imul(ae,$t)|0,k=k+Math.imul(ae,Ft)|0;var eo=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(eo>>>26)|0,eo&=67108863,P=Math.imul(we,ot),w=Math.imul(we,et),w=w+Math.imul(ke,ot)|0,k=Math.imul(ke,et),P=P+Math.imul(X,st)|0,w=w+Math.imul(X,at)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,P=P+Math.imul(ue,ft)|0,w=w+Math.imul(ue,Xe)|0,w=w+Math.imul(ie,ft)|0,k=k+Math.imul(ie,Xe)|0,P=P+Math.imul(Ne,ct)|0,w=w+Math.imul(Ne,ut)|0,w=w+Math.imul(Ve,ct)|0,k=k+Math.imul(Ve,ut)|0,P=P+Math.imul(pe,lt)|0,w=w+Math.imul(pe,ht)|0,w=w+Math.imul(Ce,lt)|0,k=k+Math.imul(Ce,ht)|0,P=P+Math.imul(ce,dt)|0,w=w+Math.imul(ce,tt)|0,w=w+Math.imul(ve,dt)|0,k=k+Math.imul(ve,tt)|0,P=P+Math.imul(ge,$t)|0,w=w+Math.imul(ge,Ft)|0,w=w+Math.imul(re,$t)|0,k=k+Math.imul(re,Ft)|0;var Co=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Co>>>26)|0,Co&=67108863,P=Math.imul(we,st),w=Math.imul(we,at),w=w+Math.imul(ke,st)|0,k=Math.imul(ke,at),P=P+Math.imul(X,ft)|0,w=w+Math.imul(X,Xe)|0,w=w+Math.imul(me,ft)|0,k=k+Math.imul(me,Xe)|0,P=P+Math.imul(ue,ct)|0,w=w+Math.imul(ue,ut)|0,w=w+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,P=P+Math.imul(Ne,lt)|0,w=w+Math.imul(Ne,ht)|0,w=w+Math.imul(Ve,lt)|0,k=k+Math.imul(Ve,ht)|0,P=P+Math.imul(pe,dt)|0,w=w+Math.imul(pe,tt)|0,w=w+Math.imul(Ce,dt)|0,k=k+Math.imul(Ce,tt)|0,P=P+Math.imul(ce,$t)|0,w=w+Math.imul(ce,Ft)|0,w=w+Math.imul(ve,$t)|0,k=k+Math.imul(ve,Ft)|0;var ko=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ko>>>26)|0,ko&=67108863,P=Math.imul(we,ft),w=Math.imul(we,Xe),w=w+Math.imul(ke,ft)|0,k=Math.imul(ke,Xe),P=P+Math.imul(X,ct)|0,w=w+Math.imul(X,ut)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,P=P+Math.imul(ue,lt)|0,w=w+Math.imul(ue,ht)|0,w=w+Math.imul(ie,lt)|0,k=k+Math.imul(ie,ht)|0,P=P+Math.imul(Ne,dt)|0,w=w+Math.imul(Ne,tt)|0,w=w+Math.imul(Ve,dt)|0,k=k+Math.imul(Ve,tt)|0,P=P+Math.imul(pe,$t)|0,w=w+Math.imul(pe,Ft)|0,w=w+Math.imul(Ce,$t)|0,k=k+Math.imul(Ce,Ft)|0;var Io=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Io>>>26)|0,Io&=67108863,P=Math.imul(we,ct),w=Math.imul(we,ut),w=w+Math.imul(ke,ct)|0,k=Math.imul(ke,ut),P=P+Math.imul(X,lt)|0,w=w+Math.imul(X,ht)|0,w=w+Math.imul(me,lt)|0,k=k+Math.imul(me,ht)|0,P=P+Math.imul(ue,dt)|0,w=w+Math.imul(ue,tt)|0,w=w+Math.imul(ie,dt)|0,k=k+Math.imul(ie,tt)|0,P=P+Math.imul(Ne,$t)|0,w=w+Math.imul(Ne,Ft)|0,w=w+Math.imul(Ve,$t)|0,k=k+Math.imul(Ve,Ft)|0;var Do=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Do>>>26)|0,Do&=67108863,P=Math.imul(we,lt),w=Math.imul(we,ht),w=w+Math.imul(ke,lt)|0,k=Math.imul(ke,ht),P=P+Math.imul(X,dt)|0,w=w+Math.imul(X,tt)|0,w=w+Math.imul(me,dt)|0,k=k+Math.imul(me,tt)|0,P=P+Math.imul(ue,$t)|0,w=w+Math.imul(ue,Ft)|0,w=w+Math.imul(ie,$t)|0,k=k+Math.imul(ie,Ft)|0;var bf=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(bf>>>26)|0,bf&=67108863,P=Math.imul(we,dt),w=Math.imul(we,tt),w=w+Math.imul(ke,dt)|0,k=Math.imul(ke,tt),P=P+Math.imul(X,$t)|0,w=w+Math.imul(X,Ft)|0,w=w+Math.imul(me,$t)|0,k=k+Math.imul(me,Ft)|0;var gf=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(gf>>>26)|0,gf&=67108863,P=Math.imul(we,$t),w=Math.imul(we,Ft),w=w+Math.imul(ke,$t)|0,k=Math.imul(ke,Ft);var vf=(C+P|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(vf>>>26)|0,vf&=67108863,g[0]=un,g[1]=ln,g[2]=hn,g[3]=Nr,g[4]=dn,g[5]=ei,g[6]=So,g[7]=Mo,g[8]=To,g[9]=Zi,g[10]=Qi,g[11]=eo,g[12]=Co,g[13]=ko,g[14]=Io,g[15]=Do,g[16]=bf,g[17]=gf,g[18]=vf,C!==0&&(g[19]=C,_.length++),_},"comb10MulTo");Math.imul||(L=J);function V(b,l,m){m.negative=l.negative^b.negative,m.length=b.length+l.length;for(var _=0,A=0,E=0;E<m.length-1;E++){var g=A;A=0;for(var C=_&67108863,P=Math.min(E,l.length-1),w=Math.max(0,E-b.length+1);w<=P;w++){var k=E-w,he=b.words[k]|0,D=l.words[w]|0,Q=he*D,se=Q&67108863;g=g+(Q/67108864|0)|0,se=se+C|0,C=se&67108863,g=g+(se>>>26)|0,A+=g>>>26,g&=67108863}m.words[E]=C,_=g,g=A}return _!==0?m.words[E]=_:m.length--,m._strip()}o(V,"bigMulTo");function Z(b,l,m){return V(b,l,m)}o(Z,"jumboMulTo"),i.prototype.mulTo=o(function(l,m){var _,A=this.length+l.length;return this.length===10&&l.length===10?_=L(this,l,m):A<63?_=J(this,l,m):A<1024?_=V(this,l,m):_=Z(this,l,m),_},"mulTo");function Y(b,l){this.x=b,this.y=l}o(Y,"FFTM"),Y.prototype.makeRBT=o(function(l){for(var m=new Array(l),_=i.prototype._countBits(l)-1,A=0;A<l;A++)m[A]=this.revBin(A,_,l);return m},"makeRBT"),Y.prototype.revBin=o(function(l,m,_){if(l===0||l===_-1)return l;for(var A=0,E=0;E<m;E++)A|=(l&1)<<m-E-1,l>>=1;return A},"revBin"),Y.prototype.permute=o(function(l,m,_,A,E,g){for(var C=0;C<g;C++)A[C]=m[l[C]],E[C]=_[l[C]]},"permute"),Y.prototype.transform=o(function(l,m,_,A,E,g){this.permute(g,l,m,_,A,E);for(var C=1;C<E;C<<=1)for(var P=C<<1,w=Math.cos(2*Math.PI/P),k=Math.sin(2*Math.PI/P),he=0;he<E;he+=P)for(var D=w,Q=k,se=0;se<C;se++){var F=_[he+se],$=A[he+se],ee=_[he+se+C],ne=A[he+se+C],ae=D*ee-Q*ne;ne=D*ne+Q*ee,ee=ae,_[he+se]=F+ee,A[he+se]=$+ne,_[he+se+C]=F-ee,A[he+se+C]=$-ne,se!==P&&(ae=w*D-k*Q,Q=w*Q+k*D,D=ae)}},"transform"),Y.prototype.guessLen13b=o(function(l,m){var _=Math.max(m,l)|1,A=_&1,E=0;for(_=_/2|0;_;_=_>>>1)E++;return 1<<E+1+A},"guessLen13b"),Y.prototype.conjugate=o(function(l,m,_){if(!(_<=1))for(var A=0;A<_/2;A++){var E=l[A];l[A]=l[_-A-1],l[_-A-1]=E,E=m[A],m[A]=-m[_-A-1],m[_-A-1]=-E}},"conjugate"),Y.prototype.normalize13b=o(function(l,m){for(var _=0,A=0;A<m/2;A++){var E=Math.round(l[2*A+1]/m)*8192+Math.round(l[2*A]/m)+_;l[A]=E&67108863,E<67108864?_=0:_=E/67108864|0}return l},"normalize13b"),Y.prototype.convert13b=o(function(l,m,_,A){for(var E=0,g=0;g<m;g++)E=E+(l[g]|0),_[2*g]=E&8191,E=E>>>13,_[2*g+1]=E&8191,E=E>>>13;for(g=2*m;g<A;++g)_[g]=0;r(E===0),r((E&-8192)===0)},"convert13b"),Y.prototype.stub=o(function(l){for(var m=new Array(l),_=0;_<l;_++)m[_]=0;return m},"stub"),Y.prototype.mulp=o(function(l,m,_){var A=2*this.guessLen13b(l.length,m.length),E=this.makeRBT(A),g=this.stub(A),C=new Array(A),P=new Array(A),w=new Array(A),k=new Array(A),he=new Array(A),D=new Array(A),Q=_.words;Q.length=A,this.convert13b(l.words,l.length,C,A),this.convert13b(m.words,m.length,k,A),this.transform(C,g,P,w,A,E),this.transform(k,g,he,D,A,E);for(var se=0;se<A;se++){var F=P[se]*he[se]-w[se]*D[se];w[se]=P[se]*D[se]+w[se]*he[se],P[se]=F}return this.conjugate(P,w,A),this.transform(P,w,Q,g,A,E),this.conjugate(Q,g,A),this.normalize13b(Q,A),_.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),Z(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),r(typeof l=="number"),r(l<67108864);for(var _=0,A=0;A<this.length;A++){var E=(this.words[A]|0)*l,g=(E&67108863)+(_&67108863);_>>=26,_+=E/67108864|0,_+=g>>>26,this.words[A]=g&67108863}return _!==0&&(this.words[A]=_,this.length++),m?this.ineg():this},"imuln"),i.prototype.muln=o(function(l){return this.clone().imuln(l)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(l){var m=N(l);if(m.length===0)return new i(1);for(var _=this,A=0;A<m.length&&m[A]===0;A++,_=_.sqr());if(++A<m.length)for(var E=_.sqr();A<m.length;A++,E=E.sqr())m[A]!==0&&(_=_.mul(E));return _},"pow"),i.prototype.iushln=o(function(l){r(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26,A=67108863>>>26-m<<26-m,E;if(m!==0){var g=0;for(E=0;E<this.length;E++){var C=this.words[E]&A,P=(this.words[E]|0)-C<<m;this.words[E]=P|g,g=C>>>26-m}g&&(this.words[E]=g,this.length++)}if(_!==0){for(E=this.length-1;E>=0;E--)this.words[E+_]=this.words[E];for(E=0;E<_;E++)this.words[E]=0;this.length+=_}return this._strip()},"iushln"),i.prototype.ishln=o(function(l){return r(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,m,_){r(typeof l=="number"&&l>=0);var A;m?A=(m-m%26)/26:A=0;var E=l%26,g=Math.min((l-E)/26,this.length),C=67108863^67108863>>>E<<E,P=_;if(A-=g,A=Math.max(0,A),P){for(var w=0;w<g;w++)P.words[w]=this.words[w];P.length=g}if(g!==0)if(this.length>g)for(this.length-=g,w=0;w<this.length;w++)this.words[w]=this.words[w+g];else this.words[0]=0,this.length=1;var k=0;for(w=this.length-1;w>=0&&(k!==0||w>=A);w--){var he=this.words[w]|0;this.words[w]=k<<26-E|he>>>E,k=he&C}return P&&k!==0&&(P.words[P.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(l,m,_){return r(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){r(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26,A=1<<m;if(this.length<=_)return!1;var E=this.words[_];return!!(E&A)},"testn"),i.prototype.imaskn=o(function(l){r(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26;if(r(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 A=67108863^67108863>>>m<<m;this.words[this.length-1]&=A}return this._strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return r(typeof l=="number"),r(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(r(typeof l=="number"),r(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 A=l.length+_,E;this._expand(A);var g,C=0;for(E=0;E<l.length;E++){g=(this.words[E+_]|0)+C;var P=(l.words[E]|0)*m;g-=P&67108863,C=(g>>26)-(P/67108864|0),this.words[E+_]=g&67108863}for(;E<this.length-_;E++)g=(this.words[E+_]|0)+C,C=g>>26,this.words[E+_]=g&67108863;if(C===0)return this._strip();for(r(C===-1),C=0,E=0;E<this.length;E++)g=-(this.words[E]|0)+C,C=g>>26,this.words[E]=g&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,m){var _=this.length-l.length,A=this.clone(),E=l,g=E.words[E.length-1]|0,C=this._countBits(g);_=26-C,_!==0&&(E=E.ushln(_),A.iushln(_),g=E.words[E.length-1]|0);var P=A.length-E.length,w;if(m!=="mod"){w=new i(null),w.length=P+1,w.words=new Array(w.length);for(var k=0;k<w.length;k++)w.words[k]=0}var he=A.clone()._ishlnsubmul(E,1,P);he.negative===0&&(A=he,w&&(w.words[P]=1));for(var D=P-1;D>=0;D--){var Q=(A.words[E.length+D]|0)*67108864+(A.words[E.length+D-1]|0);for(Q=Math.min(Q/g|0,67108863),A._ishlnsubmul(E,Q,D);A.negative!==0;)Q--,A.negative=0,A._ishlnsubmul(E,1,D),A.isZero()||(A.negative^=1);w&&(w.words[D]=Q)}return w&&w._strip(),A._strip(),m!=="div"&&_!==0&&A.iushrn(_),{div:w||null,mod:A}},"_wordDiv"),i.prototype.divmod=o(function(l,m,_){if(r(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var A,E,g;return this.negative!==0&&l.negative===0?(g=this.neg().divmod(l,m),m!=="mod"&&(A=g.div.neg()),m!=="div"&&(E=g.mod.neg(),_&&E.negative!==0&&E.iadd(l)),{div:A,mod:E}):this.negative===0&&l.negative!==0?(g=this.divmod(l.neg(),m),m!=="mod"&&(A=g.div.neg()),{div:A,mod:g.mod}):(this.negative&l.negative)!==0?(g=this.neg().divmod(l.neg(),m),m!=="div"&&(E=g.mod.neg(),_&&E.negative!==0&&E.isub(l)),{div:g.div,mod:E}):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,A=l.ushrn(1),E=l.andln(1),g=_.cmp(A);return g<0||E===1&&g===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),r(l<=67108863);for(var _=(1<<26)%l,A=0,E=this.length-1;E>=0;E--)A=(_*A+(this.words[E]|0))%l;return m?-A:A},"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),r(l<=67108863);for(var _=0,A=this.length-1;A>=0;A--){var E=(this.words[A]|0)+_*67108864;this.words[A]=E/l|0,_=E%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){r(l.negative===0),r(!l.isZero());var m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var A=new i(1),E=new i(0),g=new i(0),C=new i(1),P=0;m.isEven()&&_.isEven();)m.iushrn(1),_.iushrn(1),++P;for(var w=_.clone(),k=m.clone();!m.isZero();){for(var he=0,D=1;(m.words[0]&D)===0&&he<26;++he,D<<=1);if(he>0)for(m.iushrn(he);he-- >0;)(A.isOdd()||E.isOdd())&&(A.iadd(w),E.isub(k)),A.iushrn(1),E.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;)(g.isOdd()||C.isOdd())&&(g.iadd(w),C.isub(k)),g.iushrn(1),C.iushrn(1);m.cmp(_)>=0?(m.isub(_),A.isub(g),E.isub(C)):(_.isub(m),g.isub(A),C.isub(E))}return{a:g,b:C,gcd:_.iushln(P)}},"egcd"),i.prototype._invmp=o(function(l){r(l.negative===0),r(!l.isZero());var m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var A=new i(1),E=new i(0),g=_.clone();m.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,P=1;(m.words[0]&P)===0&&C<26;++C,P<<=1);if(C>0)for(m.iushrn(C);C-- >0;)A.isOdd()&&A.iadd(g),A.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;)E.isOdd()&&E.iadd(g),E.iushrn(1);m.cmp(_)>=0?(m.isub(_),A.isub(E)):(_.isub(m),E.isub(A))}var he;return m.cmpn(1)===0?he=A:he=E,he.cmpn(0)<0&&he.iadd(l),he},"_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 A=0;m.isEven()&&_.isEven();A++)m.iushrn(1),_.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;_.isEven();)_.iushrn(1);var E=m.cmp(_);if(E<0){var g=m;m=_,_=g}else if(E===0||_.cmpn(1)===0)break;m.isub(_)}while(!0);return _.iushln(A)},"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){r(typeof l=="number");var m=l%26,_=(l-m)/26,A=1<<m;if(this.length<=_)return this._expand(_+1),this.words[_]|=A,this;for(var E=A,g=_;E!==0&&g<this.length;g++){var C=this.words[g]|0;C+=E,E=C>>>26,C&=67108863,this.words[g]=C}return E!==0&&(this.words[g]=E,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),r(l<=67108863,"Number is too big");var A=this.words[0]|0;_=A===l?0:A<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 A=this.words[_]|0,E=l.words[_]|0;if(A!==E){A<E?m=-1:A>E&&(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 r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return r(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 r(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 r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return r(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var oe={k256:null,p224:null,p192:null,p25519:null};function K(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(K,"MPrime"),K.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),K.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 A=_<this.n?-1:m.ucmp(this.p);return A===0?(m.words[0]=0,m.length=1):A>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),K.prototype.split=o(function(l,m){l.iushrn(this.n,0,m)},"split"),K.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function q(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(q,"K256"),n(q,K),q.prototype.split=o(function(l,m){for(var _=4194303,A=Math.min(l.length,9),E=0;E<A;E++)m.words[E]=l.words[E];if(m.length=A,l.length<=9){l.words[0]=0,l.length=1;return}var g=l.words[9];for(m.words[m.length++]=g&_,E=10;E<l.length;E++){var C=l.words[E]|0;l.words[E-10]=(C&_)<<4|g>>>22,g=C}g>>>=22,l.words[E-10]=g,g===0&&l.length>10?l.length-=10:l.length-=9},"split"),q.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 A=l.words[_]|0;m+=A*977,l.words[_]=m&67108863,m=A*64+(m/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function j(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(j,"P224"),n(j,K);function le(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,"P192"),n(le,K);function T(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(T,"P25519"),n(T,K),T.prototype.imulK=o(function(l){for(var m=0,_=0;_<l.length;_++){var A=(l.words[_]|0)*19+m,E=A&67108863;A>>>=26,l.words[_]=E,m=A}return m!==0&&(l.words[l.length++]=m),l},"imulK"),i._prime=o(function(l){if(oe[l])return oe[l];var m;if(l==="k256")m=new q;else if(l==="p224")m=new j;else if(l==="p192")m=new le;else if(l==="p25519")m=new T;else throw new Error("Unknown prime "+l);return oe[l]=m,m},"prime");function h(b){if(typeof b=="string"){var l=i._prime(b);this.m=l.p,this.prime=l}else r(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){r(l.negative===0,"red works only with positives"),r(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,m){r((l.negative|m.negative)===0,"red works only with positives"),r(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(r(m%2===1),m===3){var _=this.m.add(new i(1)).iushrn(2);return this.pow(l,_)}for(var A=this.m.subn(1),E=0;!A.isZero()&&A.andln(1)===0;)E++,A.iushrn(1);r(!A.isZero());var g=new i(1).toRed(this),C=g.redNeg(),P=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,P).cmp(C)!==0;)w.redIAdd(C);for(var k=this.pow(w,A),he=this.pow(l,A.addn(1).iushrn(1)),D=this.pow(l,A),Q=E;D.cmp(g)!==0;){for(var se=D,F=0;se.cmp(g)!==0;F++)se=se.redSqr();r(F<Q);var $=this.pow(k,new i(1).iushln(Q-F-1));he=he.redMul($),k=$.redSqr(),D=D.redMul(k),Q=F}return he},"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,A=new Array(1<<_);A[0]=new i(1).toRed(this),A[1]=l;for(var E=2;E<A.length;E++)A[E]=this.mul(A[E-1],l);var g=A[0],C=0,P=0,w=m.bitLength()%26;for(w===0&&(w=26),E=m.length-1;E>=0;E--){for(var k=m.words[E],he=w-1;he>=0;he--){var D=k>>he&1;if(g!==A[0]&&(g=this.sqr(g)),D===0&&C===0){P=0;continue}C<<=1,C|=D,P++,!(P!==_&&(E!==0||he!==0))&&(g=this.mul(g,A[C]),P=0,C=0)}w=26}return g},"pow"),h.prototype.convertTo=o(function(l){var m=l.umod(this.m);return m===l?m.clone():m},"convertTo"),h.prototype.convertFrom=o(function(l){var m=l.clone();return m.red=null,m},"convertFrom"),i.mont=o(function(l){return new x(l)},"mont");function x(b){h.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}o(x,"Mont"),n(x,h),x.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),x.prototype.convertFrom=o(function(l){var m=this.imod(l.mul(this.rinv));return m.red=null,m},"convertFrom"),x.prototype.imul=o(function(l,m){if(l.isZero()||m.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(m),A=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=_.isub(A).iushrn(this.shift),g=E;return E.cmp(this.m)>=0?g=E.isub(this.m):E.cmpn(0)<0&&(g=E.iadd(this.m)),g._forceRed(this)},"imul"),x.prototype.mul=o(function(l,m){if(l.isZero()||m.isZero())return new i(0)._forceRed(this);var _=l.mul(m),A=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=_.isub(A).iushrn(this.shift),g=E;return E.cmp(this.m)>=0?g=E.isub(this.m):E.cmpn(0)<0&&(g=E.iadd(this.m)),g._forceRed(this)},"mul"),x.prototype.invm=o(function(l){var m=this.imod(l._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm")})(typeof yb>"u"||yb,E5)});var f8=De((cJ,a8)=>{a8.exports=Nb;var s8=128,lB=127,hB=~lB,dB=Math.pow(2,31);function Nb(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw Nb.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=dB;)e[r++]=t&255|s8,t/=128;for(;t&hB;)e[r++]=t&255|s8,t>>>=7;return e[r]=t|0,Nb.bytes=r-n+1,e}o(Nb,"encode")});var l8=De((uJ,u8)=>{u8.exports=Pb;var pB=128,c8=127;function Pb(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u||i>49)throw Pb.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&c8)<<i:(c&c8)*Math.pow(2,i),i+=7}while(c>=pB);return Pb.bytes=a-n,r}o(Pb,"read")});var d8=De((lJ,h8)=>{var mB=Math.pow(2,7),bB=Math.pow(2,14),gB=Math.pow(2,21),vB=Math.pow(2,28),yB=Math.pow(2,35),xB=Math.pow(2,42),wB=Math.pow(2,49),_B=Math.pow(2,56),EB=Math.pow(2,63);h8.exports=function(t){return t<mB?1:t<bB?2:t<gB?3:t<vB?4:t<yB?5:t<xB?6:t<wB?7:t<_B?8:t<EB?9:10}});var Xu=De((hJ,p8)=>{p8.exports={encode:f8(),decode:l8(),encodingLength:d8()}});var A8=De((gJ,E8)=>{"use strict";E8.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(a){return function(c){return function(u,d){var v={key:u,value:c[u]},y={key:d,value:c[d]};return a(v,y)}}}(e.cmp),i=[];return o(function a(c){if(c&&c.toJSON&&typeof c.toJSON=="function"&&(c=c.toJSON()),c!==void 0){if(typeof c=="number")return isFinite(c)?""+c:"null";if(typeof c!="object")return JSON.stringify(c);var u,d;if(Array.isArray(c)){for(d="[",u=0;u<c.length;u++)u&&(d+=","),d+=a(c[u])||"null";return d+"]"}if(c===null)return"null";if(i.indexOf(c)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var v=i.push(c)-1,y=Object.keys(c).sort(n&&n(c));for(d="",u=0;u<y.length;u++){var S=y[u],O=a(c[S]);!O||(d&&(d+=","),d+=JSON.stringify(S)+":"+O)}return i.splice(v,1),"{"+d+"}"}},"stringify")(t)}});var Ec=De((rl,yc)=>{var iU=200,H8="__lodash_hash_undefined__",z8=9007199254740991,ig="[object Arguments]",oU="[object Array]",K8="[object Boolean]",j8="[object Date]",sU="[object Error]",og="[object Function]",G8="[object GeneratorFunction]",r0="[object Map]",V8="[object Number]",sg="[object Object]",D8="[object Promise]",W8="[object RegExp]",n0="[object Set]",J8="[object String]",Y8="[object Symbol]",Zb="[object WeakMap]",X8="[object ArrayBuffer]",i0="[object DataView]",Z8="[object Float32Array]",Q8="[object Float64Array]",e_="[object Int8Array]",t_="[object Int16Array]",r_="[object Int32Array]",n_="[object Uint8Array]",i_="[object Uint8ClampedArray]",o_="[object Uint16Array]",s_="[object Uint32Array]",aU=/[\\^$.*+?()[\]{}|]/g,fU=/\w*$/,cU=/^\[object .+?Constructor\]$/,uU=/^(?:0|[1-9]\d*)$/,rr={};rr[ig]=rr[oU]=rr[X8]=rr[i0]=rr[K8]=rr[j8]=rr[Z8]=rr[Q8]=rr[e_]=rr[t_]=rr[r_]=rr[r0]=rr[V8]=rr[sg]=rr[W8]=rr[n0]=rr[J8]=rr[Y8]=rr[n_]=rr[i_]=rr[o_]=rr[s_]=!0;rr[sU]=rr[og]=rr[Zb]=!1;var lU=typeof global=="object"&&global&&global.Object===Object&&global,hU=typeof self=="object"&&self&&self.Object===Object&&self,ns=lU||hU||Function("return this")(),a_=typeof rl=="object"&&rl&&!rl.nodeType&&rl,O8=a_&&typeof yc=="object"&&yc&&!yc.nodeType&&yc,dU=O8&&O8.exports===a_;function pU(t,e){return t.set(e[0],e[1]),t}o(pU,"addMapEntry");function mU(t,e){return t.add(e),t}o(mU,"addSetEntry");function bU(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}o(bU,"arrayEach");function gU(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}o(gU,"arrayPush");function f_(t,e,r,n){var i=-1,a=t?t.length:0;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}o(f_,"arrayReduce");function vU(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(vU,"baseTimes");function yU(t,e){return t?.[e]}o(yU,"getValue");function c_(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}o(c_,"isHostObject");function R8(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}o(R8,"mapToArray");function ag(t,e){return function(r){return t(e(r))}}o(ag,"overArg");function N8(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}o(N8,"setToArray");var xU=Array.prototype,wU=Function.prototype,o0=Object.prototype,Xb=ns["__core-js_shared__"],P8=function(){var t=/[^.]+$/.exec(Xb&&Xb.keys&&Xb.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),u_=wU.toString,Ws=o0.hasOwnProperty,s0=o0.toString,_U=RegExp("^"+u_.call(Ws).replace(aU,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L8=dU?ns.Buffer:void 0,B8=ns.Symbol,U8=ns.Uint8Array,EU=ag(Object.getPrototypeOf,Object),AU=Object.create,SU=o0.propertyIsEnumerable,MU=xU.splice,$8=Object.getOwnPropertySymbols,TU=L8?L8.isBuffer:void 0,CU=ag(Object.keys,Object),Qb=_c(ns,"DataView"),nl=_c(ns,"Map"),eg=_c(ns,"Promise"),tg=_c(ns,"Set"),rg=_c(ns,"WeakMap"),il=_c(Object,"create"),kU=Xa(Qb),IU=Xa(nl),DU=Xa(eg),OU=Xa(tg),RU=Xa(rg),F8=B8?B8.prototype:void 0,q8=F8?F8.valueOf:void 0;function Ya(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Ya,"Hash");function NU(){this.__data__=il?il(null):{}}o(NU,"hashClear");function PU(t){return this.has(t)&&delete this.__data__[t]}o(PU,"hashDelete");function LU(t){var e=this.__data__;if(il){var r=e[t];return r===H8?void 0:r}return Ws.call(e,t)?e[t]:void 0}o(LU,"hashGet");function BU(t){var e=this.__data__;return il?e[t]!==void 0:Ws.call(e,t)}o(BU,"hashHas");function UU(t,e){var r=this.__data__;return r[t]=il&&e===void 0?H8:e,this}o(UU,"hashSet");Ya.prototype.clear=NU;Ya.prototype.delete=PU;Ya.prototype.get=LU;Ya.prototype.has=BU;Ya.prototype.set=UU;function is(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(is,"ListCache");function $U(){this.__data__=[]}o($U,"listCacheClear");function FU(t){var e=this.__data__,r=a0(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():MU.call(e,r,1),!0}o(FU,"listCacheDelete");function qU(t){var e=this.__data__,r=a0(e,t);return r<0?void 0:e[r][1]}o(qU,"listCacheGet");function HU(t){return a0(this.__data__,t)>-1}o(HU,"listCacheHas");function zU(t,e){var r=this.__data__,n=a0(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}o(zU,"listCacheSet");is.prototype.clear=$U;is.prototype.delete=FU;is.prototype.get=qU;is.prototype.has=HU;is.prototype.set=zU;function xc(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(xc,"MapCache");function KU(){this.__data__={hash:new Ya,map:new(nl||is),string:new Ya}}o(KU,"mapCacheClear");function jU(t){return f0(this,t).delete(t)}o(jU,"mapCacheDelete");function GU(t){return f0(this,t).get(t)}o(GU,"mapCacheGet");function VU(t){return f0(this,t).has(t)}o(VU,"mapCacheHas");function WU(t,e){return f0(this,t).set(t,e),this}o(WU,"mapCacheSet");xc.prototype.clear=KU;xc.prototype.delete=jU;xc.prototype.get=GU;xc.prototype.has=VU;xc.prototype.set=WU;function wc(t){this.__data__=new is(t)}o(wc,"Stack");function JU(){this.__data__=new is}o(JU,"stackClear");function YU(t){return this.__data__.delete(t)}o(YU,"stackDelete");function XU(t){return this.__data__.get(t)}o(XU,"stackGet");function ZU(t){return this.__data__.has(t)}o(ZU,"stackHas");function QU(t,e){var r=this.__data__;if(r instanceof is){var n=r.__data__;if(!nl||n.length<iU-1)return n.push([t,e]),this;r=this.__data__=new xc(n)}return r.set(t,e),this}o(QU,"stackSet");wc.prototype.clear=JU;wc.prototype.delete=YU;wc.prototype.get=XU;wc.prototype.has=ZU;wc.prototype.set=QU;function e$(t,e){var r=cg(t)||A$(t)?vU(t.length,String):[],n=r.length,i=!!n;for(var a in t)(e||Ws.call(t,a))&&!(i&&(a=="length"||x$(a,n)))&&r.push(a);return r}o(e$,"arrayLikeKeys");function l_(t,e,r){var n=t[e];(!(Ws.call(t,e)&&m_(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}o(l_,"assignValue");function a0(t,e){for(var r=t.length;r--;)if(m_(t[r][0],e))return r;return-1}o(a0,"assocIndexOf");function t$(t,e){return t&&h_(e,ug(e),t)}o(t$,"baseAssign");function ng(t,e,r,n,i,a,c){var u;if(n&&(u=a?n(t,i,a,c):n(t)),u!==void 0)return u;if(!c0(t))return t;var d=cg(t);if(d){if(u=g$(t),!e)return p$(t,u)}else{var v=Ja(t),y=v==og||v==G8;if(M$(t))return a$(t,e);if(v==sg||v==ig||y&&!a){if(c_(t))return a?t:{};if(u=v$(y?{}:t),!e)return m$(t,t$(u,t))}else{if(!rr[v])return a?t:{};u=y$(t,v,ng,e)}}c||(c=new wc);var S=c.get(t);if(S)return S;if(c.set(t,u),!d)var O=r?b$(t):ug(t);return bU(O||t,function(R,I){O&&(I=R,R=t[I]),l_(u,I,ng(R,e,r,n,I,t,c))}),u}o(ng,"baseClone");function r$(t){return c0(t)?AU(t):{}}o(r$,"baseCreate");function n$(t,e,r){var n=e(t);return cg(t)?n:gU(n,r(t))}o(n$,"baseGetAllKeys");function i$(t){return s0.call(t)}o(i$,"baseGetTag");function o$(t){if(!c0(t)||_$(t))return!1;var e=g_(t)||c_(t)?_U:cU;return e.test(Xa(t))}o(o$,"baseIsNative");function s$(t){if(!p_(t))return CU(t);var e=[];for(var r in Object(t))Ws.call(t,r)&&r!="constructor"&&e.push(r);return e}o(s$,"baseKeys");function a$(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}o(a$,"cloneBuffer");function fg(t){var e=new t.constructor(t.byteLength);return new U8(e).set(new U8(t)),e}o(fg,"cloneArrayBuffer");function f$(t,e){var r=e?fg(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}o(f$,"cloneDataView");function c$(t,e,r){var n=e?r(R8(t),!0):R8(t);return f_(n,pU,new t.constructor)}o(c$,"cloneMap");function u$(t){var e=new t.constructor(t.source,fU.exec(t));return e.lastIndex=t.lastIndex,e}o(u$,"cloneRegExp");function l$(t,e,r){var n=e?r(N8(t),!0):N8(t);return f_(n,mU,new t.constructor)}o(l$,"cloneSet");function h$(t){return q8?Object(q8.call(t)):{}}o(h$,"cloneSymbol");function d$(t,e){var r=e?fg(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o(d$,"cloneTypedArray");function p$(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(p$,"copyArray");function h_(t,e,r,n){r||(r={});for(var i=-1,a=e.length;++i<a;){var c=e[i],u=n?n(r[c],t[c],c,r,t):void 0;l_(r,c,u===void 0?t[c]:u)}return r}o(h_,"copyObject");function m$(t,e){return h_(t,d_(t),e)}o(m$,"copySymbols");function b$(t){return n$(t,ug,d_)}o(b$,"getAllKeys");function f0(t,e){var r=t.__data__;return w$(e)?r[typeof e=="string"?"string":"hash"]:r.map}o(f0,"getMapData");function _c(t,e){var r=yU(t,e);return o$(r)?r:void 0}o(_c,"getNative");var d_=$8?ag($8,Object):k$,Ja=i$;(Qb&&Ja(new Qb(new ArrayBuffer(1)))!=i0||nl&&Ja(new nl)!=r0||eg&&Ja(eg.resolve())!=D8||tg&&Ja(new tg)!=n0||rg&&Ja(new rg)!=Zb)&&(Ja=o(function(t){var e=s0.call(t),r=e==sg?t.constructor:void 0,n=r?Xa(r):void 0;if(n)switch(n){case kU:return i0;case IU:return r0;case DU:return D8;case OU:return n0;case RU:return Zb}return e},"getTag"));function g$(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&Ws.call(t,"index")&&(r.index=t.index,r.input=t.input),r}o(g$,"initCloneArray");function v$(t){return typeof t.constructor=="function"&&!p_(t)?r$(EU(t)):{}}o(v$,"initCloneObject");function y$(t,e,r,n){var i=t.constructor;switch(e){case X8:return fg(t);case K8:case j8:return new i(+t);case i0:return f$(t,n);case Z8:case Q8:case e_:case t_:case r_:case n_:case i_:case o_:case s_:return d$(t,n);case r0:return c$(t,n,r);case V8:case J8:return new i(t);case W8:return u$(t);case n0:return l$(t,n,r);case Y8:return h$(t)}}o(y$,"initCloneByTag");function x$(t,e){return e=e??z8,!!e&&(typeof t=="number"||uU.test(t))&&t>-1&&t%1==0&&t<e}o(x$,"isIndex");function w$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}o(w$,"isKeyable");function _$(t){return!!P8&&P8 in t}o(_$,"isMasked");function p_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||o0;return t===r}o(p_,"isPrototype");function Xa(t){if(t!=null){try{return u_.call(t)}catch{}try{return t+""}catch{}}return""}o(Xa,"toSource");function E$(t){return ng(t,!0,!0)}o(E$,"cloneDeep");function m_(t,e){return t===e||t!==t&&e!==e}o(m_,"eq");function A$(t){return S$(t)&&Ws.call(t,"callee")&&(!SU.call(t,"callee")||s0.call(t)==ig)}o(A$,"isArguments");var cg=Array.isArray;function b_(t){return t!=null&&T$(t.length)&&!g_(t)}o(b_,"isArrayLike");function S$(t){return C$(t)&&b_(t)}o(S$,"isArrayLikeObject");var M$=TU||I$;function g_(t){var e=c0(t)?s0.call(t):"";return e==og||e==G8}o(g_,"isFunction");function T$(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=z8}o(T$,"isLength");function c0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}o(c0,"isObject");function C$(t){return!!t&&typeof t=="object"}o(C$,"isObjectLike");function ug(t){return b_(t)?e$(t):s$(t)}o(ug,"keys");function k$(){return[]}o(k$,"stubArray");function I$(){return!1}o(I$,"stubFalse");yc.exports=E$});var Z_=De((lY,b0)=>{var T_,C_,k_,I_,D_,O_,R_,N_,P_,L_,B_,U_,$_,p0,yg,F_,q_,H_,Cc,z_,K_,j_,G_,V_,W_,J_,Y_,X_,m0;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof b0=="object"&&typeof b0.exports=="object"?t(r(e,r(b0.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,c){return n[a]=i?i(a,c):c}}o(r,"createExporter")})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])};T_=o(function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function a(){this.constructor=n}o(a,"__"),n.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)},"__extends"),C_=Object.assign||function(n){for(var i,a=1,c=arguments.length;a<c;a++){i=arguments[a];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(n[u]=i[u])}return n},k_=o(function(n,i){var a={};for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0&&(a[c]=n[c]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,c=Object.getOwnPropertySymbols(n);u<c.length;u++)i.indexOf(c[u])<0&&Object.prototype.propertyIsEnumerable.call(n,c[u])&&(a[c[u]]=n[c[u]]);return a},"__rest"),I_=o(function(n,i,a,c){var u=arguments.length,d=u<3?i:c===null?c=Object.getOwnPropertyDescriptor(i,a):c,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,i,a,c);else for(var y=n.length-1;y>=0;y--)(v=n[y])&&(d=(u<3?v(d):u>3?v(i,a,d):v(i,a))||d);return u>3&&d&&Object.defineProperty(i,a,d),d},"__decorate"),D_=o(function(n,i){return function(a,c){i(a,c,n)}},"__param"),O_=o(function(n,i,a,c,u,d){function v(Y){if(Y!==void 0&&typeof Y!="function")throw new TypeError("Function expected");return Y}o(v,"accept");for(var y=c.kind,S=y==="getter"?"get":y==="setter"?"set":"value",O=!i&&n?c.static?n:n.prototype:null,R=i||(O?Object.getOwnPropertyDescriptor(O,c.name):{}),I,N=!1,J=a.length-1;J>=0;J--){var L={};for(var V in c)L[V]=V==="access"?{}:c[V];for(var V in c.access)L.access[V]=c.access[V];L.addInitializer=function(Y){if(N)throw new TypeError("Cannot add initializers after decoration has completed");d.push(v(Y||null))};var Z=(0,a[J])(y==="accessor"?{get:R.get,set:R.set}:R[S],L);if(y==="accessor"){if(Z===void 0)continue;if(Z===null||typeof Z!="object")throw new TypeError("Object expected");(I=v(Z.get))&&(R.get=I),(I=v(Z.set))&&(R.set=I),(I=v(Z.init))&&u.push(I)}else(I=v(Z))&&(y==="field"?u.push(I):R[S]=I)}O&&Object.defineProperty(O,c.name,R),N=!0},"__esDecorate"),R_=o(function(n,i,a){for(var c=arguments.length>2,u=0;u<i.length;u++)a=c?i[u].call(n,a):i[u].call(n);return c?a:void 0},"__runInitializers"),N_=o(function(n){return typeof n=="symbol"?n:"".concat(n)},"__propKey"),P_=o(function(n,i,a){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:a?"".concat(a," ",i):i})},"__setFunctionName"),L_=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),B_=o(function(n,i,a,c){function u(d){return d instanceof a?d:new a(function(v){v(d)})}return o(u,"adopt"),new(a||(a=Promise))(function(d,v){function y(R){try{O(c.next(R))}catch(I){v(I)}}o(y,"fulfilled");function S(R){try{O(c.throw(R))}catch(I){v(I)}}o(S,"rejected");function O(R){R.done?d(R.value):u(R.value).then(y,S)}o(O,"step"),O((c=c.apply(n,i||[])).next())})},"__awaiter"),U_=o(function(n,i){var a={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},c,u,d,v;return v={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function y(O){return function(R){return S([O,R])}}function S(O){if(c)throw new TypeError("Generator is already executing.");for(;v&&(v=0,O[0]&&(a=0)),a;)try{if(c=1,u&&(d=O[0]&2?u.return:O[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,O[1])).done)return d;switch(u=0,d&&(O=[O[0]&2,d.value]),O[0]){case 0:case 1:d=O;break;case 4:return a.label++,{value:O[1],done:!1};case 5:a.label++,u=O[1],O=[0];continue;case 7:O=a.ops.pop(),a.trys.pop();continue;default:if(d=a.trys,!(d=d.length>0&&d[d.length-1])&&(O[0]===6||O[0]===2)){a=0;continue}if(O[0]===3&&(!d||O[1]>d[0]&&O[1]<d[3])){a.label=O[1];break}if(O[0]===6&&a.label<d[1]){a.label=d[1],d=O;break}if(d&&a.label<d[2]){a.label=d[2],a.ops.push(O);break}d[2]&&a.ops.pop(),a.trys.pop();continue}O=i.call(n,a)}catch(R){O=[6,R],u=0}finally{c=d=0}if(O[0]&5)throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}},"__generator"),$_=o(function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&m0(i,n,a)},"__exportStar"),m0=Object.create?function(n,i,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(i,a);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,c,u)}:function(n,i,a,c){c===void 0&&(c=a),n[c]=i[a]},p0=o(function(n){var i=typeof Symbol=="function"&&Symbol.iterator,a=i&&n[i],c=0;if(a)return a.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&c>=n.length&&(n=void 0),{value:n&&n[c++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),yg=o(function(n,i){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var c=a.call(n),u,d=[],v;try{for(;(i===void 0||i-- >0)&&!(u=c.next()).done;)d.push(u.value)}catch(y){v={error:y}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(v)throw v.error}}return d},"__read"),F_=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(yg(arguments[i]));return n},"__spread"),q_=o(function(){for(var n=0,i=0,a=arguments.length;i<a;i++)n+=arguments[i].length;for(var c=Array(n),u=0,i=0;i<a;i++)for(var d=arguments[i],v=0,y=d.length;v<y;v++,u++)c[u]=d[v];return c},"__spreadArrays"),H_=o(function(n,i,a){if(a||arguments.length===2)for(var c=0,u=i.length,d;c<u;c++)(d||!(c in i))&&(d||(d=Array.prototype.slice.call(i,0,c)),d[c]=i[c]);return n.concat(d||Array.prototype.slice.call(i))},"__spreadArray"),Cc=o(function(n){return this instanceof Cc?(this.v=n,this):new Cc(n)},"__await"),z_=o(function(n,i,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=a.apply(n,i||[]),u,d=[];return u={},v("next"),v("throw"),v("return"),u[Symbol.asyncIterator]=function(){return this},u;function v(N){c[N]&&(u[N]=function(J){return new Promise(function(L,V){d.push([N,J,L,V])>1||y(N,J)})})}function y(N,J){try{S(c[N](J))}catch(L){I(d[0][3],L)}}function S(N){N.value instanceof Cc?Promise.resolve(N.value.v).then(O,R):I(d[0][2],N)}function O(N){y("next",N)}function R(N){y("throw",N)}function I(N,J){N(J),d.shift(),d.length&&y(d[0][0],d[0][1])}},"__asyncGenerator"),K_=o(function(n){var i,a;return i={},c("next"),c("throw",function(u){throw u}),c("return"),i[Symbol.iterator]=function(){return this},i;function c(u,d){i[u]=n[u]?function(v){return(a=!a)?{value:Cc(n[u](v)),done:!1}:d?d(v):v}:d}},"__asyncDelegator"),j_=o(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],a;return i?i.call(n):(n=typeof p0=="function"?p0(n):n[Symbol.iterator](),a={},c("next"),c("throw"),c("return"),a[Symbol.asyncIterator]=function(){return this},a);function c(d){a[d]=n[d]&&function(v){return new Promise(function(y,S){v=n[d](v),u(y,S,v.done,v.value)})}}function u(d,v,y,S){Promise.resolve(S).then(function(O){d({value:O,done:y})},v)}},"__asyncValues"),G_=o(function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},"__makeTemplateObject");var r=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};V_=o(function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&m0(i,n,a);return r(i,n),i},"__importStar"),W_=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),J_=o(function(n,i,a,c){if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?c:a==="a"?c.call(n):c?c.value:i.get(n)},"__classPrivateFieldGet"),Y_=o(function(n,i,a,c,u){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!u:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?u.call(n,a):u?u.value=a:i.set(n,a),a},"__classPrivateFieldSet"),X_=o(function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},"__classPrivateFieldIn"),t("__extends",T_),t("__assign",C_),t("__rest",k_),t("__decorate",I_),t("__param",D_),t("__esDecorate",O_),t("__runInitializers",R_),t("__propKey",N_),t("__setFunctionName",P_),t("__metadata",L_),t("__awaiter",B_),t("__generator",U_),t("__exportStar",$_),t("__createBinding",m0),t("__values",p0),t("__read",yg),t("__spread",F_),t("__spreadArrays",q_),t("__spreadArray",H_),t("__await",Cc),t("__asyncGenerator",z_),t("__asyncDelegator",K_),t("__asyncValues",j_),t("__makeTemplateObject",G_),t("__importStar",V_),t("__importDefault",W_),t("__classPrivateFieldGet",J_),t("__classPrivateFieldSet",Y_),t("__classPrivateFieldIn",X_)})});var $E=De((as,UE)=>{var BE=typeof self<"u"?self:as,$0=function(){function t(){this.fetch=!1,this.DOMException=BE.DOMException}return o(t,"F"),t.prototype=BE,new t}();(function(t){var e=function(r){var n={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function i(T){return T&&DataView.prototype.isPrototypeOf(T)}if(o(i,"isDataView"),n.arrayBuffer)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(T){return T&&a.indexOf(Object.prototype.toString.call(T))>-1};function u(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(T))throw new TypeError("Invalid character in header field name");return T.toLowerCase()}o(u,"normalizeName");function d(T){return typeof T!="string"&&(T=String(T)),T}o(d,"normalizeValue");function v(T){var h={next:function(){var x=T.shift();return{done:x===void 0,value:x}}};return n.iterable&&(h[Symbol.iterator]=function(){return h}),h}o(v,"iteratorFor");function y(T){this.map={},T instanceof y?T.forEach(function(h,x){this.append(x,h)},this):Array.isArray(T)?T.forEach(function(h){this.append(h[0],h[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(h){this.append(h,T[h])},this)}o(y,"Headers"),y.prototype.append=function(T,h){T=u(T),h=d(h);var x=this.map[T];this.map[T]=x?x+", "+h:h},y.prototype.delete=function(T){delete this.map[u(T)]},y.prototype.get=function(T){return T=u(T),this.has(T)?this.map[T]:null},y.prototype.has=function(T){return this.map.hasOwnProperty(u(T))},y.prototype.set=function(T,h){this.map[u(T)]=d(h)},y.prototype.forEach=function(T,h){for(var x in this.map)this.map.hasOwnProperty(x)&&T.call(h,this.map[x],x,this)},y.prototype.keys=function(){var T=[];return this.forEach(function(h,x){T.push(x)}),v(T)},y.prototype.values=function(){var T=[];return this.forEach(function(h){T.push(h)}),v(T)},y.prototype.entries=function(){var T=[];return this.forEach(function(h,x){T.push([x,h])}),v(T)},n.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function S(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}o(S,"consumed");function O(T){return new Promise(function(h,x){T.onload=function(){h(T.result)},T.onerror=function(){x(T.error)}})}o(O,"fileReaderReady");function R(T){var h=new FileReader,x=O(h);return h.readAsArrayBuffer(T),x}o(R,"readBlobAsArrayBuffer");function I(T){var h=new FileReader,x=O(h);return h.readAsText(T),x}o(I,"readBlobAsText");function N(T){for(var h=new Uint8Array(T),x=new Array(h.length),b=0;b<h.length;b++)x[b]=String.fromCharCode(h[b]);return x.join("")}o(N,"readArrayBufferAsText");function J(T){if(T.slice)return T.slice(0);var h=new Uint8Array(T.byteLength);return h.set(new Uint8Array(T)),h.buffer}o(J,"bufferClone");function L(){return this.bodyUsed=!1,this._initBody=function(T){this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:n.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:n.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():n.arrayBuffer&&n.blob&&i(T)?(this._bodyArrayBuffer=J(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||c(T))?this._bodyArrayBuffer=J(T):this._bodyText=T=Object.prototype.toString.call(T):this._bodyText="",this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var T=S(this);if(T)return T;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?S(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(R)}),this.text=function(){var T=S(this);if(T)return T;if(this._bodyBlob)return I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(N(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(oe)}),this.json=function(){return this.text().then(JSON.parse)},this}o(L,"Body");var V=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Z(T){var h=T.toUpperCase();return V.indexOf(h)>-1?h:T}o(Z,"normalizeMethod");function Y(T,h){h=h||{};var x=h.body;if(T instanceof Y){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,h.headers||(this.headers=new y(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!x&&T._bodyInit!=null&&(x=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new y(h.headers)),this.method=Z(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}o(Y,"Request"),Y.prototype.clone=function(){return new Y(this,{body:this._bodyInit})};function oe(T){var h=new FormData;return T.trim().split("&").forEach(function(x){if(x){var b=x.split("="),l=b.shift().replace(/\+/g," "),m=b.join("=").replace(/\+/g," ");h.append(decodeURIComponent(l),decodeURIComponent(m))}}),h}o(oe,"decode");function K(T){var h=new y,x=T.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(b){var l=b.split(":"),m=l.shift().trim();if(m){var _=l.join(":").trim();h.append(m,_)}}),h}o(K,"parseHeaders"),L.call(Y.prototype);function q(T,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new y(h.headers),this.url=h.url||"",this._initBody(T)}o(q,"Response"),L.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},q.error=function(){var T=new q(null,{status:0,statusText:""});return T.type="error",T};var j=[301,302,303,307,308];q.redirect=function(T,h){if(j.indexOf(h)===-1)throw new RangeError("Invalid status code");return new q(null,{status:h,headers:{location:T}})},r.DOMException=t.DOMException;try{new r.DOMException}catch{r.DOMException=function(h,x){this.message=h,this.name=x;var b=Error(h);this.stack=b.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function le(T,h){return new Promise(function(x,b){var l=new Y(T,h);if(l.signal&&l.signal.aborted)return b(new r.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function _(){m.abort()}o(_,"abortXhr"),m.onload=function(){var A={status:m.status,statusText:m.statusText,headers:K(m.getAllResponseHeaders()||"")};A.url="responseURL"in m?m.responseURL:A.headers.get("X-Request-URL");var E="response"in m?m.response:m.responseText;x(new q(E,A))},m.onerror=function(){b(new TypeError("Network request failed"))},m.ontimeout=function(){b(new TypeError("Network request failed"))},m.onabort=function(){b(new r.DOMException("Aborted","AbortError"))},m.open(l.method,l.url,!0),l.credentials==="include"?m.withCredentials=!0:l.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&n.blob&&(m.responseType="blob"),l.headers.forEach(function(A,E){m.setRequestHeader(E,A)}),l.signal&&(l.signal.addEventListener("abort",_),m.onreadystatechange=function(){m.readyState===4&&l.signal.removeEventListener("abort",_)}),m.send(typeof l._bodyInit>"u"?null:l._bodyInit)})}return o(le,"fetch"),le.polyfill=!0,t.fetch||(t.fetch=le,t.Headers=y,t.Request=Y,t.Response=q),r.Headers=y,r.Request=Y,r.Response=q,r.fetch=le,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})($0);$0.fetch.ponyfill=!0;delete $0.fetch.polyfill;var Lc=$0;as=Lc.fetch;as.default=Lc.fetch;as.fetch=Lc.fetch;as.Headers=Lc.Headers;as.Request=Lc.Request;as.Response=Lc.Response;UE.exports=as});var YE=De((wte,JE)=>{"use strict";var bF=function(){function t(r,n){if(typeof r!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+r+"."));this._batchLoadFn=r,this._maxBatchSize=xF(n),this._batchScheduleFn=wF(n),this._cacheKeyFn=_F(n),this._cacheMap=EF(n),this._batch=null,this.name=AF(n)}o(t,"DataLoader");var e=t.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=vF(this),a=this._cacheMap,c=this._cacheKeyFn(n);if(a){var u=a.get(c);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(y){d.push(function(){y(u)})})}}i.keys.push(n);var v=new Promise(function(y,S){i.callbacks.push({resolve:y,reject:S})});return a&&a.set(c,v),v},"load"),e.loadMany=o(function(n){if(!WE(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],a=0;a<n.length;a++)i.push(this.load(n[a]).catch(function(c){return c}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var a=this._cacheKeyFn(n);i.delete(a)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var a=this._cacheMap;if(a){var c=this._cacheKeyFn(n);if(a.get(c)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),a.set(c,u)}}return this},"prime"),t}(),gF=typeof process=="object"&&typeof process.nextTick=="function"?function(t){Bg||(Bg=Promise.resolve()),Bg.then(function(){process.nextTick(t)})}:typeof setImmediate=="function"?function(t){setImmediate(t)}:function(t){setTimeout(t)},Bg;function vF(t){var e=t._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<t._maxBatchSize)return e;var r={hasDispatched:!1,keys:[],callbacks:[]};return t._batch=r,t._batchScheduleFn(function(){yF(t,r)}),r}o(vF,"getCurrentBatch");function yF(t,e){if(e.hasDispatched=!0,e.keys.length===0){$g(e);return}var r;try{r=t._batchLoadFn(e.keys)}catch(n){return Ug(t,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(!r||typeof r.then!="function")return Ug(t,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(r)+".")));r.then(function(n){if(!WE(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."+(`
646
+
647
+ Keys:
648
+ `+String(e.keys))+(`
649
+
650
+ Values:
651
+ `+String(n)));$g(e);for(var i=0;i<e.callbacks.length;i++){var a=n[i];a instanceof Error?e.callbacks[i].reject(a):e.callbacks[i].resolve(a)}}).catch(function(n){Ug(t,e,n)})}o(yF,"dispatchBatch");function Ug(t,e,r){$g(e);for(var n=0;n<e.keys.length;n++)t.clear(e.keys[n]),e.callbacks[n].reject(r)}o(Ug,"failedDispatch");function $g(t){if(t.cacheHits)for(var e=0;e<t.cacheHits.length;e++)t.cacheHits[e]()}o($g,"resolveCacheHits");function xF(t){var e=!t||t.batch!==!1;if(!e)return 1;var r=t&&t.maxBatchSize;if(r===void 0)return 1/0;if(typeof r!="number"||r<1)throw new TypeError("maxBatchSize must be a positive number: "+r);return r}o(xF,"getValidMaxBatchSize");function wF(t){var e=t&&t.batchScheduleFn;if(e===void 0)return gF;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(wF,"getValidBatchScheduleFn");function _F(t){var e=t&&t.cacheKeyFn;if(e===void 0)return function(r){return r};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(_F,"getValidCacheKeyFn");function EF(t){var e=!t||t.cache!==!1;if(!e)return null;var r=t&&t.cacheMap;if(r===void 0)return new Map;if(r!==null){var n=["get","set","delete","clear"],i=n.filter(function(a){return r&&typeof r[a]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return r}o(EF,"getValidCacheMap");function AF(t){return t&&t.name?t.name:null}o(AF,"getValidName");function WE(t){return typeof t=="object"&&t!==null&&typeof t.length=="number"&&(t.length===0||t.length>0&&Object.prototype.hasOwnProperty.call(t,t.length-1))}o(WE,"isArrayLike");JE.exports=bF});var c9=De((Vte,f9)=>{"use strict";function RF(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),a=i.charCodeAt(0);if(e[a]!==255)throw new TypeError(i+" is ambiguous");e[a]=n}var c=t.length,u=t.charAt(0),d=Math.log(c)/Math.log(256),v=Math.log(256)/Math.log(c);function y(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var I=0,N=0,J=0,L=R.length;J!==L&&R[J]===0;)J++,I++;for(var V=(L-J)*v+1>>>0,Z=new Uint8Array(V);J!==L;){for(var Y=R[J],oe=0,K=V-1;(Y!==0||oe<N)&&K!==-1;K--,oe++)Y+=256*Z[K]>>>0,Z[K]=Y%c>>>0,Y=Y/c>>>0;if(Y!==0)throw new Error("Non-zero carry");N=oe,J++}for(var q=V-N;q!==V&&Z[q]===0;)q++;for(var j=u.repeat(I);q<V;++q)j+=t.charAt(Z[q]);return j}o(y,"encode");function S(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var I=0;if(R[I]!==" "){for(var N=0,J=0;R[I]===u;)N++,I++;for(var L=(R.length-I)*d+1>>>0,V=new Uint8Array(L);R[I];){var Z=e[R.charCodeAt(I)];if(Z===255)return;for(var Y=0,oe=L-1;(Z!==0||Y<J)&&oe!==-1;oe--,Y++)Z+=c*V[oe]>>>0,V[oe]=Z%256>>>0,Z=Z/256>>>0;if(Z!==0)throw new Error("Non-zero carry");J=Y,I++}if(R[I]!==" "){for(var K=L-J;K!==L&&V[K]===0;)K++;for(var q=new Uint8Array(N+(L-K)),j=N;K!==L;)q[j++]=V[K++];return q}}}o(S,"decodeUnsafe");function O(R){var I=S(R);if(I)return I;throw new Error("Non-base"+c+" character")}return o(O,"decode"),{encode:y,decodeUnsafe:S,decode:O}}o(RF,"base");f9.exports=RF});var q0=De((Wte,u9)=>{"use strict";var NF=new TextDecoder,PF=o(t=>NF.decode(t),"decodeText"),LF=new TextEncoder,BF=o(t=>LF.encode(t),"encodeText");function UF(t,e){let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(UF,"concat");u9.exports={decodeText:PF,encodeText:BF,concat:UF}});var h9=De((Jte,l9)=>{"use strict";var{encodeText:$F}=q0(),H0=class{constructor(e,r,n,i){this.name=e,this.code=r,this.codeBuf=$F(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let r of e)if(this.alphabet&&this.alphabet.indexOf(r)<0)throw new Error(`invalid character '${r}' in '${e}'`);return this.codec.decode(e)}};o(H0,"Base");l9.exports=H0});var p9=De((Yte,d9)=>{"use strict";var FF=o((t,e,r)=>{let n={};for(let v=0;v<e.length;++v)n[e[v]]=v;let i=t.length;for(;t[i-1]==="=";)--i;let a=new Uint8Array(i*r/8|0),c=0,u=0,d=0;for(let v=0;v<i;++v){let y=n[t[v]];if(y===void 0)throw new SyntaxError("Invalid character "+t[v]);u=u<<r|y,c+=r,c>=8&&(c-=8,a[d++]=255&u>>c)}if(c>=r||255&u<<8-c)throw new SyntaxError("Unexpected end of data");return a},"decode"),qF=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let d=0;d<t.length;++d)for(u=u<<8|t[d],c+=8;c>r;)c-=r,a+=e[i&u>>c];if(c&&(a+=e[i&u<<r-c]),n)for(;a.length*r&7;)a+="=";return a},"encode"),HF=o(t=>e=>({encode(r){return qF(r,e,t)},decode(r){return FF(r,e,t)}}),"rfc4648");d9.exports={rfc4648:HF}});var v9=De((Xte,g9)=>{"use strict";var vl=c9(),zF=h9(),{rfc4648:zr}=p9(),{decodeText:KF,encodeText:jF}=q0(),GF=o(()=>({encode:KF,decode:jF}),"identity"),m9=[["identity","\0",GF,""],["base2","0",zr(1),"01"],["base8","7",zr(3),"01234567"],["base10","9",vl,"0123456789"],["base16","f",zr(4),"0123456789abcdef"],["base16upper","F",zr(4),"0123456789ABCDEF"],["base32hex","v",zr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",zr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",zr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",zr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",zr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",zr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",zr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",zr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",zr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",vl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",vl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",vl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",vl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],b9=m9.reduce((t,e)=>(t[e[0]]=new zF(e[0],e[1],e[2],e[3]),t),{}),VF=m9.reduce((t,e)=>(t[e[1]]=b9[e[0]],t),{});g9.exports={names:b9,codes:VF}});var w9=De((cs,x9)=>{"use strict";var Bc=v9(),{encodeText:WF,decodeText:z0,concat:y9}=q0();function JF(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=ff(t);return QF(r,e),y9([n,e],n.length+e.length)}o(JF,"multibase");function YF(t,e){let r=ff(t),n=WF(r.encode(e));return y9([r.codeBuf,n],r.codeBuf.length+n.length)}o(YF,"encode");function XF(t){t instanceof Uint8Array&&(t=z0(t));let e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),ff(t[0]).decode(t.substring(1))}o(XF,"decode");function ZF(t){if(t instanceof Uint8Array&&(t=z0(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return ff(t[0]).name}catch{return!1}}o(ZF,"isEncoded");function QF(t,e){ff(t).decode(z0(e))}o(QF,"validEncode");function ff(t){if(Object.prototype.hasOwnProperty.call(Bc.names,t))return Bc.names[t];if(Object.prototype.hasOwnProperty.call(Bc.codes,t))return Bc.codes[t];throw new Error(`Unsupported encoding: ${t}`)}o(ff,"encoding");function eq(t){return t instanceof Uint8Array&&(t=z0(t)),ff(t[0])}o(eq,"encodingFromData");cs=x9.exports=JF;cs.encode=YF;cs.decode=XF;cs.isEncoded=ZF;cs.encoding=ff;cs.encodingFromData=eq;var tq=Object.freeze(Bc.names),rq=Object.freeze(Bc.codes);cs.names=tq;cs.codes=rq});var S9=De((Zte,A9)=>{A9.exports=E9;var _9=128,nq=127,iq=~nq,oq=Math.pow(2,31);function E9(t,e,r){e=e||[],r=r||0;for(var n=r;t>=oq;)e[r++]=t&255|_9,t/=128;for(;t&iq;)e[r++]=t&255|_9,t>>>=7;return e[r]=t|0,E9.bytes=r-n+1,e}o(E9,"encode")});var C9=De((Qte,T9)=>{T9.exports=Jg;var sq=128,M9=127;function Jg(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Jg.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&M9)<<i:(c&M9)*Math.pow(2,i),i+=7}while(c>=sq);return Jg.bytes=a-n,r}o(Jg,"read")});var I9=De((ere,k9)=>{var aq=Math.pow(2,7),fq=Math.pow(2,14),cq=Math.pow(2,21),uq=Math.pow(2,28),lq=Math.pow(2,35),hq=Math.pow(2,42),dq=Math.pow(2,49),pq=Math.pow(2,56),mq=Math.pow(2,63);k9.exports=function(t){return t<aq?1:t<fq?2:t<cq?3:t<uq?4:t<lq?5:t<hq?6:t<dq?7:t<pq?8:t<mq?9:10}});var O9=De((tre,D9)=>{D9.exports={encode:S9(),decode:C9(),encodingLength:I9()}});var N9=De((rre,R9)=>{"use strict";var bq=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});R9.exports={names:bq}});var q9=De((nre,F9)=>{"use strict";var P9=w9(),Uc=O9(),{names:yl}=N9(),{toString:K0}=(Uf(),ph(i3)),{fromString:gq}=(Dh(),ph(n3)),{concat:vq}=(dm(),ph(Cy)),$c={};for(let t in yl){let e=t;$c[yl[e]]=e}Object.freeze($c);function yq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return K0(t,"base16")}o(yq,"toHexString");function xq(t){return gq(t,"base16")}o(xq,"fromHexString");function wq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return K0(P9.encode("base58btc",t)).slice(1)}o(wq,"toB58String");function _q(t){let e=t instanceof Uint8Array?K0(t):t;return P9.decode("z"+e)}o(_q,"fromB58String");function L9(t){if(!(t instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Uc.decode(t);if(!U9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);t=t.slice(Uc.decode.bytes);let r=Uc.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(Uc.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${K0(t,"base16")}`);return{code:e,name:$c[e],length:r,digest:t}}o(L9,"decode");function Eq(t,e,r){if(!t||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=B9(e);if(!(t instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(r==null&&(r=t.length),r&&t.length!==r)throw new Error("digest length should be equal to specified length.");let i=Uc.encode(n),a=Uc.encode(r);return vq([i,a,t],i.length+a.length+t.length)}o(Eq,"encode");function B9(t){let e=t;if(typeof t=="string"){if(yl[t]===void 0)throw new Error(`Unrecognized hash function named: ${t}`);e=yl[t]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if($c[e]===void 0&&!Yg(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(B9,"coerceCode");function Yg(t){return t>0&&t<16}o(Yg,"isAppCode");function U9(t){return!!(Yg(t)||$c[t])}o(U9,"isValidCode");function $9(t){L9(t)}o($9,"validate");function Aq(t){return $9(t),t.subarray(0,2)}o(Aq,"prefix");F9.exports={names:yl,codes:$c,toHexString:yq,fromHexString:xq,toB58String:wq,fromB58String:_q,decode:L9,encode:Eq,coerceCode:B9,isAppCode:Yg,validate:$9,prefix:Aq,isValidCode:U9}});var lz={};Jt(lz,{CeramicURIValidator:()=>i2,default:()=>uz,getCeramicPlugin:()=>tp,streamIdToCeramicURI:()=>ep});module.exports=ph(lz);var a7=Pt(Sy());function dI(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}o(dI,"_catch");function pI(){let t=new Map;return function(e,r){try{let i=function(c){if(n)return c;let u=t.get(e.didUrl);return u!==void 0?u:Promise.resolve(r()).then(function(d){var v;return((v=d.didResolutionMetadata)==null?void 0:v.error)!=="notFound"&&t.set(e.didUrl,d),d})};o(i,"_temp2");let n,a=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(r()).then(function(c){return n=1,c})}();return Promise.resolve(a&&a.then?a.then(i):i(a))}catch(n){return Promise.reject(n)}}}o(pI,"inMemoryCache");function mI(t,e){return e()}o(mI,"noCache");var bI="(?:%[0-9a-fA-F]{2})",My=`(?:[a-zA-Z0-9._-]|${bI})`,gI="([a-z0-9]+)",vI=`((?:${My}*:)*(${My}+))`,Ty="[a-zA-Z0-9_.:%-]",yI=`;${Ty}+=${Ty}*`,xI=`((${yI})*)`,wI="(/[^#?]*)?",_I="([?][^#]*)?",EI="(#.*)?",AI=new RegExp(`^did:${gI}:${vI}${xI}${wI}${_I}${EI}$`);function hm(t){if(t===""||!t)return null;let e=t.match(AI);if(e){let r={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:t};if(e[4]){let n=e[4].slice(1).split(";");r.params={};for(let i of n){let a=i.split("=");r.params[a[0]]=a[1]}}return e[6]&&(r.path=e[6]),e[7]&&(r.query=e[7].slice(1)),e[8]&&(r.fragment=e[8].slice(1)),r}return null}o(hm,"parse");var mh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function SI(t){return function(e,r,n){try{return Promise.resolve(dI(function(){return Promise.resolve(t(e,r,n)).then(function(i){return{...mh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...mh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(SI,"wrapLegacyResolver");var iu=class{constructor(e={},r={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=r.cache===!0?pI():r.cache||mI,r.legacyResolvers&&Object.keys(r.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=SI(r.legacyResolvers[n]))})}resolve(e,r={}){try{let n=this,i=hm(e);if(i===null)return Promise.resolve({...mh,didResolutionMetadata:{error:"invalidDid"}});let a=n.registry[i.method];return a?Promise.resolve(n.cache(i,()=>a(i.did,i,n,r))):Promise.resolve({...mh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(iu,"Resolver");dm();Dh();Uf();bh();ou();Rm();var N1=Pt(h3()),Lx=Pt(Hm()),P1=Pt($6()),ld=Pt(id()),Bx=Pt(ux()),Tu=Pt(px()),L1=Pt(Cx()),B1=Pt(Da());function mi(t){return kt(t,"base64url")}o(mi,"bytesToBase64url");function xn(t){let e=t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Bt(e,"base64url")}o(xn,"base64ToBytes");function U1(t){return Bt(t,"base58btc")}o(U1,"base58ToBytes");function D1(t){let e=t.startsWith("0x")?t.substring(2):t;return Bt(e.toLowerCase(),"base16")}o(D1,"hexToBytes");function O1(t){return mi(Bt(t))}o(O1,"encodeBase64url");function Ux(t){return kt(xn(t))}o(Ux,"decodeBase64url");function Pa(t){return kt(t,"base16")}o(Pa,"bytesToHex");function $x(t){return Bt(t)}o($x,"stringToBytes");function YN({r:t,s:e,recoveryParam:r},n){let i=new Uint8Array(n?65:64);if(i.set(Bt(t,"base16"),0),i.set(Bt(e,"base16"),32),n){if(typeof r>"u")throw new Error("Signer did not return a recoveryParam");i[64]=r}return mi(i)}o(YN,"toJose");function XN(t){let e=xn(t);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let r=Pa(e.slice(0,32)),n=Pa(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r,s:n,recoveryParam:i}}o(XN,"fromJose");function Fx(t,e){return Oi([xn(t),xn(e)])}o(Fx,"toSealed");var ZN=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,QN=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,eP=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function tP(t){if(typeof t=="string"){if(ZN.test(t))return D1(t);if(QN.test(t))return U1(t);if(eP.test(t))return xn(t);throw TypeError("bad_key: Invalid private key format")}else{if(t instanceof Uint8Array)return t;throw TypeError("bad_key: Invalid private key format")}}o(tP,"parseKey");function qx(t){let e=typeof t=="string"?Bt(t):t;return(0,N1.hash)(e)}o(qx,"sha256");function rP(t){return new Uint8Array(Lx.keccak_256.arrayBuffer(t))}o(rP,"keccak");function nP(t){let e=Bt(t.slice(2),"base16");return`0x${kt(rP(e).slice(-20),"base16")}`}o(nP,"toEthereumAddress");function R1(t,e=new Uint8Array(4)){let r=Bt(t.toString(),"base10");return e.set(r,4-r.length),e}o(R1,"writeUint32BE");var I1=o(t=>Oi([R1(t.length),t]),"lengthAndInput");function Hx(t,e,r,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let a=Oi([I1(Bt(r)),I1(typeof n>"u"?new Uint8Array(0):n),I1(typeof i>"u"?new Uint8Array(0):i),R1(e)]);return(0,N1.hash)(Oi([R1(1),t,a]))}o(Hx,"concatKDF");var yj=new P1.ec("secp256k1");function zx(t){let e=tP(t);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(r){try{let n=typeof r=="string"?$x(r):r,i=(0,ld.sign)(e,n);return Promise.resolve(mi(i))}catch(n){return Promise.reject(n)}}}o(zx,"EdDSASigner");function Kx(t){return typeof t=="object"&&"r"in t&&"s"in t}o(Kx,"instanceOfEcdsaSignature");function kx(t){return o(function(r,n){try{return Promise.resolve(n(r)).then(function(i){if(Kx(i))return YN(i,t);if(t&&typeof XN(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(kx,"ES256KSignerAlg");function Ix(){return o(function(e,r){try{return Promise.resolve(r(e)).then(function(n){if(Kx(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(Ix,"Ed25519SignerAlg");var iP={ES256K:kx(),"ES256K-R":kx(!0),Ed25519:Ix(),EdDSA:Ix()};function oP(t){let e=iP[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(oP,"SignerAlg");var $1=new P1.ec("secp256k1");function ud(t,e=!1){let r=xn(t);if(r.length!==(e?65:64))throw new Error("wrong signature length");let n=Pa(r.slice(0,32)),i=Pa(r.slice(32,64)),a={r:n,s:i};return e&&(a.recoveryParam=r[64]),a}o(ud,"toSignatureObject");function F1(t){if(t.publicKeyBase58)return U1(t.publicKeyBase58);if(t.publicKeyBase64)return xn(t.publicKeyBase64);if(t.publicKeyHex)return D1(t.publicKeyHex);if(t.publicKeyJwk&&t.publicKeyJwk.crv==="secp256k1"&&t.publicKeyJwk.x&&t.publicKeyJwk.y)return D1($1.keyFromPublic({x:Pa(xn(t.publicKeyJwk.x)),y:Pa(xn(t.publicKeyJwk.y))}).getPublic("hex"));if(t.publicKeyMultibase){let{base16:e,base58btc:r,base64:n,base64url:i}=hu;return e.decoder.or(r.decoder.or(n.decoder.or(i.decoder))).decode(t.publicKeyMultibase)}return new Uint8Array}o(F1,"extractPublicKeyBytes");function sP(t,e,r){let n=qx(t),i=ud(e),a=r.filter(({ethereumAddress:d,blockchainAccountId:v})=>typeof d>"u"&&typeof v>"u"),c=r.filter(({ethereumAddress:d,blockchainAccountId:v})=>typeof d<"u"||typeof v!==void 0),u=a.find(d=>{try{let v=F1(d);return $1.keyFromPublic(v).verify(n,i)}catch{return!1}});if(!u&&c.length>0&&(u=jx(t,e,c)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(sP,"verifyES256K");function jx(t,e,r){let n;if(e.length>86)n=[ud(e,!0)];else{let c=ud(e,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let i=o(c=>{let u=qx(t),d=$1.recoverPubKey(u,c,c.recoveryParam),v=d.encode("hex"),y=d.encode("hex",!0),S=nP(v);return r.find(R=>{var I,N,J;let L=Pa(F1(R));return L===v||L===y||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===S||((N=R.blockchainAccountId)==null||(J=N.split("@eip155"))==null?void 0:J[0].toLowerCase())===S})},"checkSignatureAgainstSigner"),a=n.map(i).filter(c=>typeof c<"u");if(a.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return a[0]}o(jx,"verifyRecoverableES256K");function Dx(t,e,r){let n=$x(t),i=xn(e),a=r.find(c=>(0,ld.verify)(F1(c),n,i));if(!a)throw new Error("invalid_signature: Signature invalid for JWT");return a}o(Dx,"verifyEd25519");var aP={ES256K:sP,"ES256K-R":jx,Ed25519:Dx,EdDSA:Dx};function Gx(t){let e=aP[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(Gx,"VerifierAlgorithm");Gx.toSignatureObject=ud;var Vx=o(function(t,e,r={},n={}){try{r.alg||(r.alg=fP);let i=typeof t=="string"?t:Ox(t,n.canonicalize),a=[Ox(r,n.canonicalize),i].join("."),c=oP(r.alg);return Promise.resolve(c(a,e)).then(function(u){return[a,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var fP="ES256K";function Ox(t,e=!1){return O1(e?(0,Bx.default)(t):JSON.stringify(t))}o(Ox,"encodeSection");function cP(t){let e=t.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Ux(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(cP,"decodeJWS");function uP({header:t,data:e,signature:r},n){return Array.isArray(n)||(n=[n]),Gx(t.alg)(e,r,n)}o(uP,"verifyJWSDecoded");function Wx(t,e){let r=cP(t);return uP(r,e)}o(Wx,"verifyJWS");function lP(t,e,r){for(var n;;){var i=t();if(Ls(i)&&(i=i.v),!i)return a;if(i.then){n=0;break}var a=r();if(a&&a.then)if(Ls(a))a=a.s;else{n=1;break}if(e){var c=e();if(c&&c.then&&!Ls(c)){n=2;break}}}var u=new La,d=_r.bind(null,u,2);return(n===0?i.then(y):n===1?a.then(v):c.then(S)).then(void 0,d),u;function v(O){a=O;do{if(e&&(c=e(),c&&c.then&&!Ls(c))){c.then(S).then(void 0,d);return}if(i=t(),!i||Ls(i)&&!i.v){_r(u,1,a);return}if(i.then){i.then(y).then(void 0,d);return}a=r(),Ls(a)&&(a=a.v)}while(!a||!a.then);a.then(v).then(void 0,d)}o(v,"_resumeAfterBody");function y(O){O?(a=r(),a&&a.then?a.then(v).then(void 0,d):v(a)):_r(u,1,a)}o(y,"_resumeAfterTest");function S(){(i=t())?i.then?i.then(y).then(void 0,d):y(i):_r(u,1,a)}o(S,"_resumeAfterUpdate")}o(lP,"_for");var Jx=o(function(t,e){try{let n=function(v){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let r;pP(t);let i=JSON.parse(Ux(t.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let a=Fx(t.ciphertext,t.tag),c=new Uint8Array(Buffer.from(t.aad?`${t.protected}.${t.aad}`:t.protected)),u=null,d=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(a,xn(t.iv),c)).then(function(v){u=v}):function(){if(!t.recipients||t.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let v=0;return lP(function(){return!u&&v<t.recipients.length},function(){return v++},function(){let y=t.recipients[v];Object.assign(y.header,i);let S=function(){if(y.header.alg===e.alg)return Promise.resolve(e.decrypt(a,xn(t.iv),c,y)).then(function(O){u=O})}();if(S&&S.then)return S.then(function(){})})}}()}();return Promise.resolve(d&&d.then?d.then(n):n(d))}catch(r){return Promise.reject(r)}},"decryptJWE"),Rx=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function _r(t,e,r){if(!t.s){if(r instanceof La)if(r.s)e&1&&(e=r.s),r=r.v;else{r.o=_r.bind(null,t,e);return}if(r&&r.then){r.then(_r.bind(null,t,e),_r.bind(null,t,2));return}t.s=e,t.v=r;let n=t.o;n&&n(t)}}o(_r,"_settle");var La=function(){function t(){}return o(t,"_Pact"),t.prototype.then=function(e,r){let n=new t,i=this.s;if(i){let a=i&1?e:r;if(a){try{_r(n,1,a(this.v))}catch(c){_r(n,2,c)}return n}else return this}return this.o=function(a){try{let c=a.v;a.s&1?_r(n,1,e?e(c):c):r?_r(n,1,r(c)):_r(n,2,c)}catch(c){_r(n,2,c)}},n},t}();function Ls(t){return t instanceof La&&t.s&1}o(Ls,"_isSettledPact");function hP(t,e,r){var n=-1,i,a;function c(u){try{for(;++n<t.length&&(!r||!r());)if(u=e(n),u&&u.then)if(Ls(u))u=u.v;else{u.then(c,a||(a=_r.bind(null,i=new La,2)));return}i?_r(i,1,u):i=u}catch(d){_r(i||(i=new La),2,d)}}return o(c,"_cycle"),c(),i}o(hP,"_forTo");function dP(t,e,r){if(typeof t[Rx]=="function"){let y=function(S){try{for(;!(i=n.next()).done&&(!r||!r());)if(S=e(i.value),S&&S.then)if(Ls(S))S=S.v;else{S.then(y,c||(c=_r.bind(null,a=new La,2)));return}a?_r(a,1,S):a=S}catch(O){_r(a||(a=new La),2,O)}};o(y,"_cycle");var n=t[Rx](),i,a,c;if(y(),n.return){var u=o(function(S){try{i.done||n.return()}catch{}return S},"_fixup");if(a&&a.then)return a.then(u,function(S){throw u(S)});u()}return a}if(!("length"in t))throw new TypeError("Object is not iterable");for(var d=[],v=0;v<t.length;v++)d.push(t[v]);return hP(d,function(y){return e(d[y])},r)}o(dP,"_forOf");function pP(t){if(!(t.protected&&t.iv&&t.ciphertext&&t.tag))throw new Error("bad_jwe: missing properties");t.recipients&&t.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(pP,"validateJWE");function Nx({ciphertext:t,tag:e,iv:r,protectedHeader:n,recipient:i},a){let c={protected:n,iv:mi(r),ciphertext:mi(t),tag:mi(e)};return a&&(c.aad=mi(a)),i&&(c.recipients=[i]),c}o(Nx,"encodeJWE");var Yx=o(function(t,e,r={},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(t,r,n)).then(function(i){return Nx(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 a,c,u=dP(e,function(d){let v=function(){return a?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(a)).then(function(y){if(y){var S,O;(S=c)==null||(O=S.recipients)==null||O.push(y)}}):Promise.resolve(d.encrypt(t,r,n)).then(function(y){a=y.cek,c=Nx(y,n)})}();if(v&&v.then)return v.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return c}):c)}}catch(i){return Promise.reject(i)}},"createJWE");var Xx=o(function(t,e){try{let r=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:a,didDocument:c}){var u;if(a!=null&&a.error||c==null)throw new Error(`resolver_error: Could not resolve ${i}: ${a.error}, ${a.message}`);if(!c.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let v=((u=c.keyAgreement)==null?void 0:u.map(y=>typeof y=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(S=>S.id===y):y).filter(y=>typeof y<"u")).filter(y=>y.type==="X25519KeyAgreementKey2019"&&Boolean(y.publicKeyBase58));if(!v.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return v.map(y=>bP(U1(y.publicKeyBase58),y.id))})}catch(a){return Promise.reject(a)}},"encryptersForDID"),n=t.map(i=>r(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(r){return Promise.reject(r)}},"resolveX25519Encrypters");function Zx(t){let e=new L1.XChaCha20Poly1305(t);return(r,n)=>{let i=(0,B1.randomBytes)(e.nonceLength),a=e.seal(i,r,n);return{ciphertext:a.subarray(0,a.length-e.tagLength),tag:a.subarray(a.length-e.tagLength),iv:i}}}o(Zx,"xc20pEncrypter");function mP(t){let e=o(function(a,c={},u){try{let d=O1(JSON.stringify(Object.assign({alg:i},c,{enc:n}))),v=new Uint8Array(Buffer.from(u?`${d}.${mi(u)}`:d));return Promise.resolve({...r(a,v),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),r=Zx(t),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(mP,"xc20pDirEncrypter");function Px(t){let e=o(function(n,i,a){try{return Promise.resolve(r.open(i,n,a))}catch(c){return Promise.reject(c)}},"decrypt"),r=new L1.XChaCha20Poly1305(t);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Px,"xc20pDirDecrypter");function bP(t,e){let r=o(function(u,d={},v){try{Object.assign(d,{alg:void 0});let y=(0,B1.randomBytes)(32);return Promise.resolve(mP(y).encrypt(u,d,v)).then(function(S){return Promise.resolve(n(y)).then(function(O){return{...S,recipient:O,cek:y}})})}catch(y){return Promise.reject(y)}},"encrypt"),n=o(function(u){try{let d=(0,Tu.generateKeyPair)(),v=(0,Tu.sharedKey)(d.secretKey,t),y=Hx(v,a,i),S=Zx(y)(u),O={encrypted_key:mi(S.ciphertext),header:{alg:i,iv:mi(S.iv),tag:mi(S.tag),epk:{kty:"OKP",crv:c,x:mi(d.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(d){return Promise.reject(d)}},"encryptCek"),i="ECDH-ES+XC20PKW",a=256,c="X25519";return{alg:i,enc:"XC20P",encrypt:r,encryptCek:n}}o(bP,"x25519Encrypter");function gP(t){if(!(t&&t.epk&&t.iv&&t.tag))throw new Error("bad_jwe: malformed header")}o(gP,"validateHeader");function Qx(t){let e=o(function(a,c,u,d){try{let S=function(){let N=Hx(R,n,r),J=Fx(d.encrypted_key,d.header.tag);return Promise.resolve(Px(N).decrypt(J,xn(d.header.iv))).then(function(L){return L===null?null:Px(L).decrypt(a,c,u)})};o(S,"_temp4");var v,y;if(gP((v=d)==null?void 0:v.header),d=d,((y=d.header.epk)==null?void 0:y.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=xn(d.header.epk.x),R,I=function(){if(t instanceof Uint8Array)R=(0,Tu.sharedKey)(t,O);else return Promise.resolve(t(O)).then(function(N){R=N})}();return Promise.resolve(I&&I.then?I.then(S):S(I))}catch(S){return Promise.reject(S)}},"decrypt"),r="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:r,enc:"XC20P",decrypt:e}}o(Qx,"x25519Decrypter");Om();var hd=o(({enumerable:t=!0,configurable:e=!1}={})=>({enumerable:t,configurable:e,writable:!1}),"readonly"),q1=o(function*(t,e){if(t!=null&&!(t instanceof Uint8Array))for(let[r,n]of Object.entries(t)){let i=[...e,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[a,c]of n.entries()){let u=[...i,a],d=We.asCID(c);d?yield[u.join("/"),d]:typeof c=="object"&&(yield*q1(c,u))}else{let a=We.asCID(n);a?yield[i.join("/"),a]:yield*q1(n,i)}}},"links"),H1=o(function*(t,e){if(t!=null)for(let[r,n]of Object.entries(t)){let i=[...e,r];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!We.asCID(n))if(Array.isArray(n))for(let[a,c]of n.entries()){let u=[...i,a];yield u.join("/"),typeof c=="object"&&!We.asCID(c)&&(yield*H1(c,u))}else yield*H1(n,i)}},"tree"),vP=o((t,e)=>{let r=t;for(let[n,i]of e.entries()){if(r=r[i],r==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let a=We.asCID(r);if(a)return{value:a,remaining:e.slice(n+1).join("/")}}return{value:r}},"get"),Cu=class{constructor({cid:e,bytes:r,value:n}){if(!e||!r||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:hd(),bytes:hd(),value:hd(),asBlock:hd()})}links(){return q1(this.value,[])}tree(){return H1(this.value,[])}get(e="/"){return vP(this.value,e.split("/").filter(Boolean))}};o(Cu,"Block");var Ba=o(async({value:t,codec:e,hasher:r})=>{if(typeof t>"u")throw new Error('Missing required argument "value"');if(!e||!r)throw new Error("Missing required argument: codec or hasher");let n=e.encode(t),i=await r.digest(n),a=We.create(1,e.code,i);return new Cu({value:t,bytes:n,cid:a})},"encode"),ew=o(async({bytes:t,codec:e,hasher:r})=>{if(!t)throw new Error('Missing required argument "bytes"');if(!e||!r)throw new Error("Missing required argument: codec or hasher");let n=e.decode(t),i=await r.digest(t),a=We.create(1,e.code,i);return new Cu({value:n,bytes:t,cid:a})},"decode");Pi();uu();Dm();_h();var Hi={};Jt(Hi,{code:()=>sc,decode:()=>Q1,encode:()=>Fa,name:()=>eL});var yP=["string","number","bigint","symbol"],xP=["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 tw(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(yP.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(wP(t))return"Buffer";let r=_P(t);return r||"Object"}o(tw,"is");function wP(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}o(wP,"isBuffer");function _P(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(xP.includes(e))return e}o(_P,"getObjectType");var _e=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};o(_e,"Type");_e.uint=new _e(0,"uint",!0);_e.negint=new _e(1,"negint",!0);_e.bytes=new _e(2,"bytes",!0);_e.string=new _e(3,"string",!0);_e.array=new _e(4,"array",!1);_e.map=new _e(5,"map",!1);_e.tag=new _e(6,"tag",!1);_e.float=new _e(7,"float",!0);_e.false=new _e(7,"false",!0);_e.true=new _e(7,"true",!0);_e.null=new _e(7,"null",!0);_e.undefined=new _e(7,"undefined",!0);_e.break=new _e(7,"break",!0);var $e=class{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o($e,"Token");var ec=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",EP=new TextDecoder,AP=new TextEncoder;function dd(t){return ec&&globalThis.Buffer.isBuffer(t)}o(dd,"isBuffer");function K1(t){return t instanceof Uint8Array?dd(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}o(K1,"asU8A");var ow=ec?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):nw(t,e,r):(t,e,r)=>r-e>64?EP.decode(t.subarray(e,r)):nw(t,e,r),sw=ec?t=>t.length>64?globalThis.Buffer.from(t):rw(t):t=>t.length>64?AP.encode(t):rw(t),po=o(t=>Uint8Array.from(t),"fromArray"),tc=ec?(t,e,r)=>dd(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),aw=ec?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),K1(globalThis.Buffer.concat(t,e))):(t,e)=>{let r=new Uint8Array(e),n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},fw=ec?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function cw(t,e){if(dd(t)&&dd(e))return t.compare(e);for(let r=0;r<t.length;r++)if(t[r]!==e[r])return t[r]<e[r]?-1:1;return 0}o(cw,"compare");function rw(t,e=1/0){let r,n=t.length,i=null,a=[];for(let c=0;c<n;++c){if(r=t.charCodeAt(c),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(c+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}o(rw,"utf8ToBytes");function nw(t,e,r){let n=[];for(;e<r;){let i=t[e],a=null,c=i>239?4:i>223?3:i>191?2:1;if(e+c<=r){let u,d,v,y;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[e+1],(u&192)===128&&(y=(i&31)<<6|u&63,y>127&&(a=y));break;case 3:u=t[e+1],d=t[e+2],(u&192)===128&&(d&192)===128&&(y=(i&15)<<12|(u&63)<<6|d&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:u=t[e+1],d=t[e+2],v=t[e+3],(u&192)===128&&(d&192)===128&&(v&192)===128&&(y=(i&15)<<18|(u&63)<<12|(d&63)<<6|v&63,y>65535&&y<1114112&&(a=y))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),e+=c}return SP(n)}o(nw,"utf8Slice");var iw=4096;function SP(t){let e=t.length;if(e<=iw)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=iw));return r}o(SP,"decodeCodePointsArray");var MP=256,rc=class{constructor(e=MP){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 r=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(e,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(r=fw(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=tc(n,0,this.cursor)}else r=aw(this.chunks,this.cursor);return e&&this.reset(),r}};o(rc,"Bl");var mt="CBOR decode error:",j1="CBOR encode error:",ku=[];ku[23]=1;ku[24]=2;ku[25]=3;ku[26]=5;ku[27]=9;function Zo(t,e,r){if(t.length-e<r)throw new Error(`${mt} not enough data for type`)}o(Zo,"assertEnoughData");var Cr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Bn(t,e,r){Zo(t,e,1);let n=t[e];if(r.strict===!0&&n<Cr[0])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Bn,"readUint8");function Un(t,e,r){Zo(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<Cr[1])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Un,"readUint16");function $n(t,e,r){Zo(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<Cr[2])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o($n,"readUint32");function Fn(t,e,r){Zo(t,e,8);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3],i=t[e+4]*16777216+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7],a=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&a<Cr[3])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);if(a<=Number.MAX_SAFE_INTEGER)return Number(a);if(r.allowBigInt===!0)return a;throw new Error(`${mt} integers outside of the safe integer range are not supported`)}o(Fn,"readUint64");function uw(t,e,r,n){return new $e(_e.uint,Bn(t,e+1,n),2)}o(uw,"decodeUint8");function lw(t,e,r,n){return new $e(_e.uint,Un(t,e+1,n),3)}o(lw,"decodeUint16");function hw(t,e,r,n){return new $e(_e.uint,$n(t,e+1,n),5)}o(hw,"decodeUint32");function dw(t,e,r,n){return new $e(_e.uint,Fn(t,e+1,n),9)}o(dw,"decodeUint64");function bi(t,e){return Ur(t,0,e.value)}o(bi,"encodeUint");function Ur(t,e,r){if(r<Cr[0]){let n=Number(r);t.push([e|n])}else if(r<Cr[1]){let n=Number(r);t.push([e|24,n])}else if(r<Cr[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<Cr[3]){let n=Number(r);t.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Cr[4]){let i=[e|27,0,0,0,0,0,0,0],a=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=c&255,c=c>>8,i[3]=c&255,c=c>>8,i[2]=c&255,c=c>>8,i[1]=c&255,t.push(i)}else throw new Error(`${mt} encountered BigInt larger than allowable range`)}}o(Ur,"encodeUintValue");bi.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");Ur.encodedSize=o(function(e){return e<Cr[0]?1:e<Cr[1]?2:e<Cr[2]?3:e<Cr[3]?5:9},"encodedSize");bi.compareTokens=o(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function pw(t,e,r,n){return new $e(_e.negint,-1-Bn(t,e+1,n),2)}o(pw,"decodeNegint8");function mw(t,e,r,n){return new $e(_e.negint,-1-Un(t,e+1,n),3)}o(mw,"decodeNegint16");function bw(t,e,r,n){return new $e(_e.negint,-1-$n(t,e+1,n),5)}o(bw,"decodeNegint32");var G1=BigInt(-1),gw=BigInt(1);function vw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i!="bigint"){let a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new $e(_e.negint,a,9)}if(n.allowBigInt!==!0)throw new Error(`${mt} integers outside of the safe integer range are not supported`);return new $e(_e.negint,G1-BigInt(i),9)}o(vw,"decodeNegint64");function pd(t,e){let r=e.value,n=typeof r=="bigint"?r*G1-gw:r*-1-1;Ur(t,e.type.majorEncoded,n)}o(pd,"encodeNegint");pd.encodedSize=o(function(e){let r=e.value,n=typeof r=="bigint"?r*G1-gw:r*-1-1;return n<Cr[0]?1:n<Cr[1]?2:n<Cr[2]?3:n<Cr[3]?5:9},"encodedSize");pd.compareTokens=o(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Iu(t,e,r,n){Zo(t,e,r+n);let i=tc(t,e+r,e+r+n);return new $e(_e.bytes,i,r+n)}o(Iu,"toToken");function yw(t,e,r,n){return Iu(t,e,1,r)}o(yw,"decodeBytesCompact");function xw(t,e,r,n){return Iu(t,e,2,Bn(t,e+1,n))}o(xw,"decodeBytes8");function ww(t,e,r,n){return Iu(t,e,3,Un(t,e+1,n))}o(ww,"decodeBytes16");function _w(t,e,r,n){return Iu(t,e,5,$n(t,e+1,n))}o(_w,"decodeBytes32");function Ew(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer bytes lengths not supported`);return Iu(t,e,9,i)}o(Ew,"decodeBytes64");function md(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===_e.string?sw(t.value):t.value),t.encodedBytes}o(md,"tokenBytes");function nc(t,e){let r=md(e);Ur(t,e.type.majorEncoded,r.length),t.push(r)}o(nc,"encodeBytes");nc.encodedSize=o(function(e){let r=md(e);return Ur.encodedSize(r.length)+r.length},"encodedSize");nc.compareTokens=o(function(e,r){return CP(md(e),md(r))},"compareTokens");function CP(t,e){return t.length<e.length?-1:t.length>e.length?1:cw(t,e)}o(CP,"compareBytes");function Du(t,e,r,n,i){let a=r+n;Zo(t,e,a);let c=new $e(_e.string,ow(t,e+r,e+a),a);return i.retainStringBytes===!0&&(c.byteValue=tc(t,e+r,e+a)),c}o(Du,"toToken");function Aw(t,e,r,n){return Du(t,e,1,r,n)}o(Aw,"decodeStringCompact");function Sw(t,e,r,n){return Du(t,e,2,Bn(t,e+1,n),n)}o(Sw,"decodeString8");function Mw(t,e,r,n){return Du(t,e,3,Un(t,e+1,n),n)}o(Mw,"decodeString16");function Tw(t,e,r,n){return Du(t,e,5,$n(t,e+1,n),n)}o(Tw,"decodeString32");function Cw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer string lengths not supported`);return Du(t,e,9,i,n)}o(Cw,"decodeString64");var kw=nc;function ic(t,e,r,n){return new $e(_e.array,n,r)}o(ic,"toToken");function Iw(t,e,r,n){return ic(t,e,1,r)}o(Iw,"decodeArrayCompact");function Dw(t,e,r,n){return ic(t,e,2,Bn(t,e+1,n))}o(Dw,"decodeArray8");function Ow(t,e,r,n){return ic(t,e,3,Un(t,e+1,n))}o(Ow,"decodeArray16");function Rw(t,e,r,n){return ic(t,e,5,$n(t,e+1,n))}o(Rw,"decodeArray32");function Nw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer array lengths not supported`);return ic(t,e,9,i)}o(Nw,"decodeArray64");function Pw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return ic(t,e,1,1/0)}o(Pw,"decodeArrayIndefinite");function bd(t,e){Ur(t,_e.array.majorEncoded,e.value)}o(bd,"encodeArray");bd.compareTokens=bi.compareTokens;bd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function oc(t,e,r,n){return new $e(_e.map,n,r)}o(oc,"toToken");function Lw(t,e,r,n){return oc(t,e,1,r)}o(Lw,"decodeMapCompact");function Bw(t,e,r,n){return oc(t,e,2,Bn(t,e+1,n))}o(Bw,"decodeMap8");function Uw(t,e,r,n){return oc(t,e,3,Un(t,e+1,n))}o(Uw,"decodeMap16");function $w(t,e,r,n){return oc(t,e,5,$n(t,e+1,n))}o($w,"decodeMap32");function Fw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer map lengths not supported`);return oc(t,e,9,i)}o(Fw,"decodeMap64");function qw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return oc(t,e,1,1/0)}o(qw,"decodeMapIndefinite");function gd(t,e){Ur(t,_e.map.majorEncoded,e.value)}o(gd,"encodeMap");gd.compareTokens=bi.compareTokens;gd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function Hw(t,e,r,n){return new $e(_e.tag,r,1)}o(Hw,"decodeTagCompact");function zw(t,e,r,n){return new $e(_e.tag,Bn(t,e+1,n),2)}o(zw,"decodeTag8");function Kw(t,e,r,n){return new $e(_e.tag,Un(t,e+1,n),3)}o(Kw,"decodeTag16");function jw(t,e,r,n){return new $e(_e.tag,$n(t,e+1,n),5)}o(jw,"decodeTag32");function Gw(t,e,r,n){return new $e(_e.tag,Fn(t,e+1,n),9)}o(Gw,"decodeTag64");function vd(t,e){Ur(t,_e.tag.majorEncoded,e.value)}o(vd,"encodeTag");vd.compareTokens=bi.compareTokens;vd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");var NP=20,PP=21,LP=22,BP=23;function Vw(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${mt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new $e(_e.null,null,1):new $e(_e.undefined,void 0,1)}o(Vw,"decodeUndefined");function Ww(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return new $e(_e.break,void 0,1)}o(Ww,"decodeBreak");function V1(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${mt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${mt} Infinity values are not supported`)}return new $e(_e.float,t,e)}o(V1,"createToken");function Jw(t,e,r,n){return V1(W1(t,e+1),3,n)}o(Jw,"decodeFloat16");function Yw(t,e,r,n){return V1(J1(t,e+1),5,n)}o(Yw,"decodeFloat32");function Xw(t,e,r,n){return V1(t4(t,e+1),9,n)}o(Xw,"decodeFloat64");function yd(t,e,r){let n=e.value;if(n===!1)t.push([_e.float.majorEncoded|NP]);else if(n===!0)t.push([_e.float.majorEncoded|PP]);else if(n===null)t.push([_e.float.majorEncoded|LP]);else if(n===void 0)t.push([_e.float.majorEncoded|BP]);else{let i,a=!1;(!r||r.float64!==!0)&&(Qw(n),i=W1(Fi,1),n===i||Number.isNaN(n)?(Fi[0]=249,t.push(Fi.slice(0,3)),a=!0):(e4(n),i=J1(Fi,1),n===i&&(Fi[0]=250,t.push(Fi.slice(0,5)),a=!0))),a||(UP(n),i=t4(Fi,1),Fi[0]=251,t.push(Fi.slice(0,9)))}}o(yd,"encodeFloat");yd.encodedSize=o(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Qw(n);let i=W1(Fi,1);if(n===i||Number.isNaN(n))return 3;if(e4(n),i=J1(Fi,1),n===i)return 5}return 9},"encodedSize");var Zw=new ArrayBuffer(9),gi=new DataView(Zw,1),Fi=new Uint8Array(Zw,0);function Qw(t){if(t===1/0)gi.setUint16(0,31744,!1);else if(t===-1/0)gi.setUint16(0,64512,!1);else if(Number.isNaN(t))gi.setUint16(0,32256,!1);else{gi.setFloat32(0,t);let e=gi.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)gi.setUint16(0,31744,!1);else if(r===0)gi.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?gi.setUint16(0,0):i<-14?gi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):gi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(Qw,"encodeFloat16");function W1(t,e){if(t.length-e<2)throw new Error(`${mt} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,a;return n===0?a=i*2**-24:n!==31?a=(i+1024)*2**(n-25):a=i===0?1/0:NaN,r&32768?-a:a}o(W1,"readFloat16");function e4(t){gi.setFloat32(0,t,!1)}o(e4,"encodeFloat32");function J1(t,e){if(t.length-e<4)throw new Error(`${mt} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}o(J1,"readFloat32");function UP(t){gi.setFloat64(0,t,!1)}o(UP,"encodeFloat64");function t4(t,e){if(t.length-e<8)throw new Error(`${mt} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}o(t4,"readFloat64");yd.compareTokens=bi.compareTokens;function Ut(t,e,r){throw new Error(`${mt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}o(Ut,"invalidMinor");function xd(t){return()=>{throw new Error(`${mt} ${t}`)}}o(xd,"errorer");var Pe=[];for(let t=0;t<=23;t++)Pe[t]=Ut;Pe[24]=uw;Pe[25]=lw;Pe[26]=hw;Pe[27]=dw;Pe[28]=Ut;Pe[29]=Ut;Pe[30]=Ut;Pe[31]=Ut;for(let t=32;t<=55;t++)Pe[t]=Ut;Pe[56]=pw;Pe[57]=mw;Pe[58]=bw;Pe[59]=vw;Pe[60]=Ut;Pe[61]=Ut;Pe[62]=Ut;Pe[63]=Ut;for(let t=64;t<=87;t++)Pe[t]=yw;Pe[88]=xw;Pe[89]=ww;Pe[90]=_w;Pe[91]=Ew;Pe[92]=Ut;Pe[93]=Ut;Pe[94]=Ut;Pe[95]=xd("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Pe[t]=Aw;Pe[120]=Sw;Pe[121]=Mw;Pe[122]=Tw;Pe[123]=Cw;Pe[124]=Ut;Pe[125]=Ut;Pe[126]=Ut;Pe[127]=xd("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Pe[t]=Iw;Pe[152]=Dw;Pe[153]=Ow;Pe[154]=Rw;Pe[155]=Nw;Pe[156]=Ut;Pe[157]=Ut;Pe[158]=Ut;Pe[159]=Pw;for(let t=160;t<=183;t++)Pe[t]=Lw;Pe[184]=Bw;Pe[185]=Uw;Pe[186]=$w;Pe[187]=Fw;Pe[188]=Ut;Pe[189]=Ut;Pe[190]=Ut;Pe[191]=qw;for(let t=192;t<=215;t++)Pe[t]=Hw;Pe[216]=zw;Pe[217]=Kw;Pe[218]=jw;Pe[219]=Gw;Pe[220]=Ut;Pe[221]=Ut;Pe[222]=Ut;Pe[223]=Ut;for(let t=224;t<=243;t++)Pe[t]=xd("simple values are not supported");Pe[244]=Ut;Pe[245]=Ut;Pe[246]=Ut;Pe[247]=Vw;Pe[248]=xd("simple values are not supported");Pe[249]=Jw;Pe[250]=Yw;Pe[251]=Xw;Pe[252]=Ut;Pe[253]=Ut;Pe[254]=Ut;Pe[255]=Ww;var qi=[];for(let t=0;t<24;t++)qi[t]=new $e(_e.uint,t,1);for(let t=-1;t>=-24;t--)qi[31-t]=new $e(_e.negint,t,1);qi[64]=new $e(_e.bytes,new Uint8Array(0),1);qi[96]=new $e(_e.string,"",1);qi[128]=new $e(_e.array,0,1);qi[160]=new $e(_e.map,0,1);qi[244]=new $e(_e.false,!1,1);qi[245]=new $e(_e.true,!0,1);qi[246]=new $e(_e.null,null,1);function r4(t){switch(t.type){case _e.false:return po([244]);case _e.true:return po([245]);case _e.null:return po([246]);case _e.bytes:return t.value.length?void 0:po([64]);case _e.string:return t.value===""?po([96]):void 0;case _e.array:return t.value===0?po([128]):void 0;case _e.map:return t.value===0?po([160]):void 0;case _e.uint:return t.value<24?po([Number(t.value)]):void 0;case _e.negint:if(t.value>=-24)return po([31-Number(t.value)])}}o(r4,"quickEncodeToken");var FP={float64:!1,mapSorter:zP,quickEncodeToken:r4};function qP(){let t=[];return t[_e.uint.major]=bi,t[_e.negint.major]=pd,t[_e.bytes.major]=nc,t[_e.string.major]=kw,t[_e.array.major]=bd,t[_e.map.major]=gd,t[_e.tag.major]=vd,t[_e.float.major]=yd,t}o(qP,"makeCborEncoders");var n4=qP(),Y1=new rc,$a=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${j1} object contains circular references`);return new $a(r,e)}};o($a,"Ref");var Bs={null:new $e(_e.null,null),undefined:new $e(_e.undefined,void 0),true:new $e(_e.true,!0),false:new $e(_e.false,!1),emptyArray:new $e(_e.array,0),emptyMap:new $e(_e.map,0)},Us={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new $e(_e.float,t):t>=0?new $e(_e.uint,t):new $e(_e.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new $e(_e.uint,t):new $e(_e.negint,t)},Uint8Array(t,e,r,n){return new $e(_e.bytes,t)},string(t,e,r,n){return new $e(_e.string,t)},boolean(t,e,r,n){return t?Bs.true:Bs.false},null(t,e,r,n){return Bs.null},undefined(t,e,r,n){return Bs.undefined},ArrayBuffer(t,e,r,n){return new $e(_e.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new $e(_e.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Bs.emptyArray,new $e(_e.break)]:Bs.emptyArray;n=$a.createCheck(n,t);let i=[],a=0;for(let c of t)i[a++]=wd(c,r,n);return r.addBreakTokens?[new $e(_e.array,t.length),i,new $e(_e.break)]:[new $e(_e.array,t.length),i]},Object(t,e,r,n){let i=e!=="Object",a=i?t.keys():Object.keys(t),c=i?t.size:a.length;if(!c)return r.addBreakTokens===!0?[Bs.emptyMap,new $e(_e.break)]:Bs.emptyMap;n=$a.createCheck(n,t);let u=[],d=0;for(let v of a)u[d++]=[wd(v,r,n),wd(i?t.get(v):t[v],r,n)];return HP(u,r),r.addBreakTokens?[new $e(_e.map,c),u,new $e(_e.break)]:[new $e(_e.map,c),u]}};Us.Map=Us.Object;Us.Buffer=Us.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Us[`${t}Array`]=Us.DataView;function wd(t,e={},r){let n=tw(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Us[n];if(typeof i=="function"){let c=i(t,n,e,r);if(c!=null)return c}let a=Us[n];if(!a)throw new Error(`${j1} unsupported type: ${n}`);return a(t,n,e,r)}o(wd,"objectToTokens");function HP(t,e){e.mapSorter&&t.sort(e.mapSorter)}o(HP,"sortMapEntries");function zP(t,e){let r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);let i=r.type.major,a=n4[i].compareTokens(r,n);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}o(zP,"mapSorter");function i4(t,e,r,n){if(Array.isArray(e))for(let i of e)i4(t,i,r,n);else r[e.type.major](t,e,n)}o(i4,"tokensToEncoded");function KP(t,e,r){let n=wd(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let a=e[n.type.major];if(a.encodedSize){let c=a.encodedSize(n,r),u=new rc(c);if(a(u,n,r),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return K1(u.chunks[0])}}return Y1.reset(),i4(Y1,n,e,r),Y1.toBytes(!0)}o(KP,"encodeCustom");function X1(t,e){return e=Object.assign({},FP,e),KP(t,n4,e)}o(X1,"encode");var jP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},_d=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=qi[e];if(r===void 0){let n=Pe[e];if(!n)throw new Error(`${mt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}};o(_d,"Tokeniser");var Ou=Symbol.for("DONE"),Ed=Symbol.for("BREAK");function GP(t,e,r){let n=[];for(let i=0;i<t.value;i++){let a=Ru(e,r);if(a===Ed){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed array`)}if(a===Ou)throw new Error(`${mt} found array but not enough entries (got ${i}, expected ${t.value})`);n[i]=a}return n}o(GP,"tokenToArray");function VP(t,e,r){let n=r.useMaps===!0,i=n?void 0:{},a=n?new Map:void 0;for(let c=0;c<t.value;c++){let u=Ru(e,r);if(u===Ed){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed map`)}if(u===Ou)throw new Error(`${mt} found map but not enough entries (got ${c} [no key], expected ${t.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${mt} non-string keys not supported (got ${typeof u})`);if(r.rejectDuplicateMapKeys===!0&&(n&&a.has(u)||!n&&u in i))throw new Error(`${mt} found repeat map key "${u}"`);let d=Ru(e,r);if(d===Ou)throw new Error(`${mt} found map but not enough entries (got ${c} [no value], expected ${t.value})`);n?a.set(u,d):i[u]=d}return n?a:i}o(VP,"tokenToMap");function Ru(t,e){if(t.done())return Ou;let r=t.next();if(r.type===_e.break)return Ed;if(r.type.terminal)return r.value;if(r.type===_e.array)return GP(r,t,e);if(r.type===_e.map)return VP(r,t,e);if(r.type===_e.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=Ru(t,e);return e.tags[r.value](n)}throw new Error(`${mt} tag not supported (${r.value})`)}throw new Error("unsupported")}o(Ru,"tokensToObject");function Z1(t,e){if(!(t instanceof Uint8Array))throw new Error(`${mt} data to decode must be a Uint8Array`);e=Object.assign({},jP,e);let r=e.tokenizer||new _d(t,e),n=Ru(r,e);if(n===Ou)throw new Error(`${mt} did not find any content to decode`);if(n===Ed)throw new Error(`${mt} got unexpected break`);if(!r.done())throw new Error(`${mt} too many terminals, data makes no sense`);return n}o(Z1,"decode");Pi();var o4=42;function JP(t){if(t.asCID!==t)return null;let e=We.asCID(t);if(!e)return null;let r=new Uint8Array(e.bytes.byteLength+1);return r.set(e.bytes,1),[new $e(_e.tag,o4),new $e(_e.bytes,r)]}o(JP,"cidEncoder");function YP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(YP,"undefinedEncoder");function XP(t){if(Number.isNaN(t))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(t===1/0||t===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(XP,"numberEncoder");var ZP={float64:!0,typeEncoders:{Object:JP,undefined:YP,number:XP}};function QP(t){if(t[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return We.decode(t.subarray(1))}o(QP,"cidDecoder");var s4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};s4.tags[o4]=QP;var eL="dag-cbor",sc=113,Fa=o(t=>X1(t,ZP),"encode"),Q1=o(t=>Z1(t,s4),"decode");var tL=24;async function a4(t){let e=await Ba({value:t,codec:Hi,hasher:Ss});return{cid:e.cid,linkedBlock:e.bytes}}o(a4,"encodePayload");function rL(t,e=tL){let r=(e-t.length%e)%e,n=new Uint8Array(t.length+r);return n.set(t,0),n}o(rL,"pad");async function nL(t){return(await Ba({value:t,codec:Hi,hasher:Th})).cid}o(nL,"encodeIdentityCID");function iL(t){if(t=We.asCID(t),t.code!==sc)throw new Error("CID codec must be dag-cbor");if(t.multihash.code!==Th.code)throw new Error("CID must use identity multihash");return Q1(t.multihash.digest)}o(iL,"decodeIdentityCID");async function f4(t,e){return rL((await nL(t)).bytes,e)}o(f4,"prepareCleartext");function c4(t){return iL(We.decodeFirst(t)[0])}o(c4,"decodeCleartext");var u4=Symbol("abortable"),Ad=Symbol("aborted");function l4(t,e){if(e.aborted)return Promise.reject(Ad);let r,n=new Promise((i,a)=>{r=a});return e.addEventListener("abort",()=>{r(Ad)}),Promise.race([t,n])}o(l4,"abortable");var h4=o((t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),""),"nanoid");var Sd="utils_abort_request";var an;(function(t){t[t.PARSE_ERROR=-32700]="PARSE_ERROR",t[t.INVALID_REQUEST=-32600]="INVALID_REQUEST",t[t.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",t[t.INVALID_PARAMS=-32602]="INVALID_PARAMS",t[t.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(an||(an={}));var d4={[an.PARSE_ERROR]:"Parse error",[an.INVALID_REQUEST]:"Invalid request",[an.METHOD_NOT_FOUND]:"Method not found",[an.INVALID_PARAMS]:"Invalid params",[an.INTERNAL_ERROR]:"Internal error"};function oL(t){return-32e3>=t&&t>=-32099}o(oL,"isServerError");function Md(t){return d4[t.toString()]??(oL(t)?"Server error":"Application error")}o(Md,"getErrorMessage");var wn=class extends Error{static fromObject(e){return new wn(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,r,n){super(),Object.setPrototypeOf(this,wn.prototype),this.code=e,this.data=n,this.message=r??Md(e)}};o(wn,"RPCError");function Nu(t){let e=d4[t];return o(function(n){return new wn(t,e,n)},"createError")}o(Nu,"createErrorFactory");var sL=Nu(an.PARSE_ERROR),DG=Nu(an.INVALID_REQUEST),OG=Nu(an.METHOD_NOT_FOUND),RG=Nu(an.INVALID_PARAMS),NG=Nu(an.INTERNAL_ERROR);function aL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(aL,"_checkPrivateRedeclaration");function fL(t,e){return e.get?e.get.call(t):e.value}o(fL,"_classApplyDescriptorGet");function cL(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}o(cL,"_classApplyDescriptorSet");function p4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(p4,"_classExtractFieldDescriptor");function eb(t,e){var r=p4(t,e,"get");return fL(t,r)}o(eb,"_classPrivateFieldGet");function uL(t,e,r){aL(t,e),e.set(t,r)}o(uL,"_classPrivateFieldInit");function lL(t,e,r){var n=p4(t,e,"set");return cL(t,n,r),r}o(lL,"_classPrivateFieldSet");var Pu=new WeakMap,ac=class{get connection(){return eb(this,Pu)}createID(){return h4()}request(e,r=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Ad);let a=this.createID(),c=eb(this,Pu).send({jsonrpc:"2.0",id:a,method:e,params:r}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw wn.fromObject(u.error);return u.result});return i==null?c:(i.addEventListener("abort",()=>{this.notify(Sd,{id:a})}),l4(c,i))}async notify(e,r=void 0){await eb(this,Pu).send({jsonrpc:"2.0",method:e,params:r})}constructor(e){uL(this,Pu,{writable:!0,value:void 0}),lL(this,Pu,e)}};o(ac,"RPCClient");function m4(t,e){return{jsonrpc:"2.0",id:t,error:{code:e,message:Md(e)}}}o(m4,"createErrorResponse");function hL(t,e,r){console.warn("Unhandled handler error",e,r)}o(hL,"fallbackOnHandlerError");function dL(t,e){console.warn("Unhandled invalid message",e)}o(dL,"fallbackOnInvalidMessage");function pL(t,e){console.warn("Unhandled notification",e)}o(pL,"fallbackOnNotification");function b4(t,e={}){let r=e.onHandlerError??hL,n=e.onInvalidMessage??dL,i=e.onNotification??pL,a={};function c(u,d){if(d.method===Sd){let v=d.params?.id;v!=null&&a[v]?.abort()}else i(u,d)}return o(c,"handleNotification"),o(async function(d,v){let y=v.id;if(v.jsonrpc!=="2.0"||v.method==null)return y==null?(n(d,v),null):m4(y,an.INVALID_REQUEST);let S=t[v.method];if(S==null)return y==null?(c(d,v),null):m4(y,an.METHOD_NOT_FOUND);try{let O;if(y!=null&&S[u4]){let I=new AbortController;a[y]=I,O=S(d,v.params,{signal:I.signal})}else O=S(d,v.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return y==null||a[y]?.signal.aborted?null:{jsonrpc:"2.0",id:y,result:R}}catch(O){if(y==null||a[y]?.signal.aborted)return r(d,v,O),null;let R;if(O instanceof wn)R=O.toObject();else{r(d,v,O);let I=O.code??-32e3;R={code:I,message:O.message||Md(I)}}return{jsonrpc:"2.0",id:y,error:R}}finally{y!=null&&delete a[y]}},"handleRequest")}o(b4,"createHandler");Pi();var f5=Pt(a5(),1),Yr=Pt(za(),1);var RL=`
652
+ sign-in-with-ethereum =
653
+ domain %s" wants you to sign in with your Ethereum account:" LF
654
+ address LF
655
+ LF
656
+ [ statement LF ]
657
+ LF
658
+ %s"URI: " URI LF
659
+ %s"Version: " version LF
660
+ %s"Chain ID: " chain-id LF
661
+ %s"Nonce: " nonce LF
662
+ %s"Issued At: " issued-at
663
+ [ LF %s"Expiration Time: " expiration-time ]
664
+ [ LF %s"Not Before: " not-before ]
665
+ [ LF %s"Request ID: " request-id ]
666
+ [ LF %s"Resources:"
667
+ resources ]
668
+
669
+ domain = dnsauthority
670
+
671
+ address = "0x" 40*40HEXDIG
672
+ ; Must also conform to captilization
673
+ ; checksum encoding specified in EIP-55
674
+ ; where applicable (EOAs).
675
+
676
+ statement = *( reserved / unreserved / " " )
677
+ ; The purpose is to exclude LF (line breaks).
678
+
679
+ version = "1"
680
+
681
+ nonce = 8*( ALPHA / DIGIT )
682
+
683
+ issued-at = date-time
684
+ expiration-time = date-time
685
+ not-before = date-time
686
+
687
+ request-id = *pchar
688
+
689
+ chain-id = 1*DIGIT
690
+ ; See EIP-155 for valid CHAIN_IDs.
691
+
692
+ resources = *( LF resource )
693
+
694
+ resource = "- " URI
695
+
696
+ ; ------------------------------------------------------------------------------
697
+ ; RFC 3986
698
+
699
+ URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
700
+
701
+ hier-part = "//" authority path-abempty
702
+ / path-absolute
703
+ / path-rootless
704
+ / path-empty
705
+
706
+ scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
707
+
708
+ authority = [ userinfo "@" ] host [ ":" port ]
709
+ userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
710
+ host = IP-literal / IPv4address / reg-name
711
+ port = *DIGIT
712
+
713
+ IP-literal = "[" ( IPv6address / IPvFuture ) "]"
714
+
715
+ IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
716
+
717
+ IPv6address = 6( h16 ":" ) ls32
718
+ / "::" 5( h16 ":" ) ls32
719
+ / [ h16 ] "::" 4( h16 ":" ) ls32
720
+ / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
721
+ / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
722
+ / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
723
+ / [ *4( h16 ":" ) h16 ] "::" ls32
724
+ / [ *5( h16 ":" ) h16 ] "::" h16
725
+ / [ *6( h16 ":" ) h16 ] "::"
726
+
727
+ h16 = 1*4HEXDIG
728
+ ls32 = ( h16 ":" h16 ) / IPv4address
729
+ IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
730
+ dec-octet = DIGIT ; 0-9
731
+ / %x31-39 DIGIT ; 10-99
732
+ / "1" 2DIGIT ; 100-199
733
+ / "2" %x30-34 DIGIT ; 200-249
734
+ / "25" %x30-35 ; 250-255
735
+
736
+ reg-name = *( unreserved / pct-encoded / sub-delims )
737
+
738
+ path-abempty = *( "/" segment )
739
+ path-absolute = "/" [ segment-nz *( "/" segment ) ]
740
+ path-rootless = segment-nz *( "/" segment )
741
+ path-empty = 0pchar
742
+
743
+ segment = *pchar
744
+ segment-nz = 1*pchar
745
+
746
+ pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
747
+
748
+ query = *( pchar / "/" / "?" )
749
+
750
+ fragment = *( pchar / "/" / "?" )
751
+
752
+ pct-encoded = "%" HEXDIG HEXDIG
753
+
754
+ unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
755
+ reserved = gen-delims / sub-delims
756
+ gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
757
+ sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
758
+ / "*" / "+" / "," / ";" / "="
759
+
760
+ ; ------------------------------------------------------------------------------
761
+ ; RFC 4501
762
+
763
+ dnsauthority = host [ ":" port ]
764
+ ; See RFC 3986 for the
765
+ ; definition of "host" and "port".
766
+
767
+ ; ------------------------------------------------------------------------------
768
+ ; RFC 3339
769
+
770
+ date-fullyear = 4DIGIT
771
+ date-month = 2DIGIT ; 01-12
772
+ date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
773
+ ; month/year
774
+ time-hour = 2DIGIT ; 00-23
775
+ time-minute = 2DIGIT ; 00-59
776
+ time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
777
+ ; rules
778
+ time-secfrac = "." 1*DIGIT
779
+ time-numoffset = ("+" / "-") time-hour ":" time-minute
780
+ time-offset = "Z" / time-numoffset
781
+
782
+ partial-time = time-hour ":" time-minute ":" time-second
783
+ [time-secfrac]
784
+ full-date = date-fullyear "-" date-month "-" date-mday
785
+ full-time = partial-time time-offset
786
+
787
+ date-time = full-date "T" full-time
788
+
789
+ ; ------------------------------------------------------------------------------
790
+ ; RFC 5234
791
+
792
+ ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
793
+ LF = %x0A
794
+ ; linefeed
795
+ DIGIT = %x30-39
796
+ ; 0-9
797
+ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
798
+ `,Fu=class{constructor(e){let r=new f5.default(RL);if(r.generate(),r.errors.length)throw console.error(r.errorsToAscii()),console.error(r.linesToAscii()),console.log(r.displayAttributeErrors()),new Error("ABNF grammar has errors");let n=r.toObject(),i=new Yr.default.parser;i.ast=new Yr.default.ast;let a=Yr.default.ids,c=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.domain=Yr.default.utils.charsToString(oe,K,q)),le},"domain");i.ast.callbacks.domain=c;let u=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.address=Yr.default.utils.charsToString(oe,K,q)),le},"address");i.ast.callbacks.address=u;let d=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.statement=Yr.default.utils.charsToString(oe,K,q)),le},"statement");i.ast.callbacks.statement=d;let v=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.uri||(j.uri=Yr.default.utils.charsToString(oe,K,q))),le},"uri");i.ast.callbacks.uri=v;let y=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.version=Yr.default.utils.charsToString(oe,K,q)),le},"version");i.ast.callbacks.version=y;let S=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.chainId=Yr.default.utils.charsToString(oe,K,q)),le},"chainId");i.ast.callbacks["chain-id"]=S;let O=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.nonce=Yr.default.utils.charsToString(oe,K,q)),le},"nonce");i.ast.callbacks.nonce=O;let R=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.issuedAt=Yr.default.utils.charsToString(oe,K,q)),le},"issuedAt");i.ast.callbacks["issued-at"]=R;let I=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.expirationTime=Yr.default.utils.charsToString(oe,K,q)),le},"expirationTime");i.ast.callbacks["expiration-time"]=I;let N=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.notBefore=Yr.default.utils.charsToString(oe,K,q)),le},"notBefore");i.ast.callbacks["not-before"]=N;let J=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.requestId=Yr.default.utils.charsToString(oe,K,q)),le},"requestId");i.ast.callbacks["request-id"]=J;let L=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.resources=Yr.default.utils.charsToString(oe,K,q).slice(3).split(`
799
+ - `)),le},"resources");i.ast.callbacks.resources=L;let V=i.parse(n,"sign-in-with-ethereum",e);if(!V.success)throw new Error(`Invalid message: ${JSON.stringify(V)}`);let Z={};i.ast.translate(Z);for(let[Y,oe]of Object.entries(Z))this[Y]=oe}};o(Fu,"ParsedMessage");function cb(){return cb=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},cb.apply(this,arguments)}o(cb,"_extends");var ub={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}"}}}},NL={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},lb={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},PL={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:ub,1:lb}}},LL={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:ub,1:lb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},qu={2:ub,10:NL,19:{assetName:lb,assetType:PL,assetId:LL}};function c5(t,e){return t.split(e.parameters.delimiter)}o(c5,"splitParams");function Hu(t,e){var r=c5(t,e),n={};return r.forEach(function(i,a){n[e.parameters.values[a].name]=i}),n}o(Hu,"getParams");function hc(t,e){return Object.values(e.parameters.values).map(function(r){var n=t[r.name];return typeof n=="string"?n:hc(n,r)}).join(e.parameters.delimiter)}o(hc,"joinParams");function zu(t,e){if(!new RegExp(e.regex).test(t))return!1;var r=c5(t,e);if(r.length!==Object.keys(e.parameters.values).length)return!1;var n=r.map(function(i,a){return new RegExp(e.parameters.values[a].regex).test(i)}).filter(function(i){return!!i});return n.length===r.length}o(zu,"isValidId");var Hs=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.namespace=r.namespace,this.reference=r.reference}o(t,"ChainId"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();Hs.spec=qu[2];var zs=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.address=r.address}o(t,"AccountId"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=Hu(n,this.spec),a=i.namespace,c=i.reference,u=i.address,d=new Hs({namespace:a,reference:c});return new t({chainId:d,address:u}).toJSON()},"parse"),t.format=o(function(n){var i=new Hs(n.chainId),a=cb({},i.toJSON(),{address:n.address});return hc(a,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),t}();zs.spec=qu[10];var hb=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.namespace=r.namespace,this.reference=r.reference}o(t,"AssetName"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();hb.spec=qu[19].assetName;var BL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.assetName=new hb(r.assetName)}o(t,"AssetType"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),t}();BL.spec=qu[19].assetType;var UL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.assetName=new hb(r.assetName),this.tokenId=r.tokenId}o(t,"AssetId"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),t}();UL.spec=qu[19].assetId;var u5;(function(t){t.INVALID_SIGNATURE="Invalid signature.",t.EXPIRED_MESSAGE="Expired message.",t.MALFORMED_SESSION="Malformed session."})(u5||(u5={}));var ju;(function(t){t.PERSONAL_SIGNATURE="Personal signature"})(ju||(ju={}));var Ku=class{static fromCacao(e){let r=zs.parse(e.p.iss.replace("did:pkh:","")),n=new this({domain:e.p.domain,address:r.address,uri:e.p.aud,version:e.p.version,chainId:new Hs(r.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=ju.PERSONAL_SIGNATURE)),n}toMessage(e){return $L(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 r=new Fu(e);this.domain=r.domain,this.address=r.address,this.statement=r.statement,this.uri=r.uri,this.version=r.version,this.nonce=r.nonce,this.issuedAt=r.issuedAt,this.expirationTime=r.expirationTime,this.notBefore=r.notBefore,this.requestId=r.requestId,this.chainId=r.chainId,this.resources=r.resources}else Object.assign(this,e)}};o(Ku,"SiwxMessage");function l5(t,e){let r=`${t.domain} wants you to sign in with your ${e} account:`,n=`URI: ${t.uri}`,i=[r,t.address].join(`
800
+ `),a=`Version: ${t.version}`;t.nonce||(t.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${t.nonce}`,u=[n,a,c];if(t.issuedAt&&Date.parse(t.issuedAt),t.issuedAt=t.issuedAt?t.issuedAt:new Date().toISOString(),u.push(`Issued At: ${t.issuedAt}`),t.expirationTime){let v=`Expiration Time: ${t.expirationTime}`;u.push(v)}t.notBefore&&u.push(`Not Before: ${t.notBefore}`),t.requestId&&u.push(`Request ID: ${t.requestId}`),t.chainId&&u.push(`Chain ID: ${t.chainId}`),t.resources&&u.push(["Resources:",...t.resources.map(v=>`- ${v}`)].join(`
801
+ `));let d=u.join(`
802
+ `);return t.statement&&(i=[i,t.statement].join(`
803
+
804
+ `)),[i,d].join(`
805
+
806
+ `)}o(l5,"asLegacyChainIdString");function $L(t,e){let r=`${t.domain} wants you to sign in with your ${e} account:`,n=`URI: ${t.uri}`,i=[r,t.address].join(`
807
+ `),a=`Version: ${t.version}`;t.nonce||(t.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${t.nonce}`,u=`Chain ID: ${t.chainId}`,d=[n,a,u,c];if(t.issuedAt&&Date.parse(t.issuedAt),t.issuedAt=t.issuedAt?t.issuedAt:new Date().toISOString(),d.push(`Issued At: ${t.issuedAt}`),t.expirationTime){let y=`Expiration Time: ${t.expirationTime}`;d.push(y)}t.notBefore&&d.push(`Not Before: ${t.notBefore}`),t.requestId&&d.push(`Request ID: ${t.requestId}`),t.resources&&t.resources.length>=1&&d.push(["Resources:",...t.resources.map(y=>`- ${y}`)].join(`
808
+ `));let v=d.join(`
809
+ `);return t.statement&&(i=[i,t.statement].join(`
810
+
811
+ `)),[i,v].join(`
812
+
813
+ `)}o($L,"asString");var dc=class extends Ku{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case ju.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(dc,"SiweMessage");uu();var FL=5*60,EV=new Date("2022-09-20").valueOf(),Gu;(function(t){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"),t.fromSiweMessage=e;function r(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(r,"fromSiwsMessage"),t.fromSiwsMessage=r;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"),t.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"),t.fromSiwStacksMessage=i;async function a(u){return(await ew({bytes:u,codec:Hi,hasher:Ss})).value}o(a,"fromBlockBytes"),t.fromBlockBytes=a;async function c(u,d={}){db(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(c,"verify"),t.verify=c})(Gu||(Gu={}));var Vu;(function(t){function e(r){return Ba({value:r,codec:Hi,hasher:Ss})}o(e,"fromCacao"),t.fromCacao=e})(Vu||(Vu={}));function db(t){if(t.s===null||t.s===void 0)throw new Error("CACAO does not have a signature")}o(db,"assertSigned");function h5(t,e){let r=e.atTime?e.atTime.getTime():Date.now(),n=(e.clockSkewSecs??FL)*1e3;if(Date.parse(t.p.iat)>r+n||Date.parse(t.p.nbf)>r+n)throw new Error("CACAO is not valid yet");let i=e.revocationPhaseOutSecs?e.revocationPhaseOutSecs*1e3:0;if(!e.disableExpirationCheck&&Date.parse(t.p.exp)+i+n<r)throw new Error("CACAO has expired")}o(h5,"verifyTimeChecks");var d5="logger/5.7.0";var p5=!1,m5=!1,Od={debug:1,default:2,info:2,warning:3,error:4,off:5},b5=Od.default,pb=null;function qL(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}o(qL,"_checkNormalize");var g5=qL(),mb;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(mb||(mb={}));var Ki;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ki||(Ki={}));var v5="0123456789abcdef",At=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let n=e.toLowerCase();Od[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(b5>Od[n])&&console.log.apply(console,r)}debug(...e){this._log(At.levels.DEBUG,e)}info(...e){this._log(At.levels.INFO,e)}warn(...e){this._log(At.levels.WARNING,e)}makeError(e,r,n){if(m5)return this.makeError("censored error",r,{});r||(r=At.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(d=>{let v=n[d];try{if(v instanceof Uint8Array){let y="";for(let S=0;S<v.length;S++)y+=v5[v[S]>>4],y+=v5[v[S]&15];i.push(d+"=Uint8Array(0x"+y+")")}else i.push(d+"="+JSON.stringify(v))}catch{i.push(d+"="+JSON.stringify(n[d].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let a=e,c="";switch(r){case Ki.NUMERIC_FAULT:{c="NUMERIC_FAULT";let d=e;switch(d){case"overflow":case"underflow":case"division-by-zero":c+="-"+d;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Ki.CALL_EXCEPTION:case Ki.INSUFFICIENT_FUNDS:case Ki.MISSING_NEW:case Ki.NONCE_EXPIRED:case Ki.REPLACEMENT_UNDERPRICED:case Ki.TRANSACTION_REPLACED:case Ki.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let u=new Error(e);return u.reason=a,u.code=r,Object.keys(n).forEach(function(d){u[d]=n[d]}),u}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,At.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),g5&&this.throwError("platform missing String.prototype.normalize",At.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:g5})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,At.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,At.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,At.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,At.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",At.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",At.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",At.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return pb||(pb=new At(d5)),pb}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",At.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),p5){if(!e)return;this.globalLogger().throwError("error censorship permanent",At.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}m5=!!e,p5=!!r}static setLogLevel(e){let r=Od[e.toLowerCase()];if(r==null){At.globalLogger().warn("invalid log level - "+e);return}b5=r}static from(e){return new At(e)}};o(At,"Logger");At.errors=Ki;At.levels=mb;var y5="bytes/5.7.0";var gr=new At(y5);function w5(t){return!!t.toHexString}o(w5,"isHexable");function pc(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return pc(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}o(pc,"addSlice");function _5(t){return ji(t)&&!(t.length%2)||gb(t)}o(_5,"isBytesLike");function x5(t){return typeof t=="number"&&t==t&&t%1===0}o(x5,"isInteger");function gb(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!x5(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!x5(r)||r<0||r>=256)return!1}return!0}o(gb,"isBytes");function or(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),pc(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),w5(t)&&(t=t.toHexString()),ji(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":gr.throwArgumentError("hex data is odd-length","value",t));let n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return pc(new Uint8Array(n))}return gb(t)?pc(new Uint8Array(t)):gr.throwArgumentError("invalid arrayify value","value",t)}o(or,"arrayify");function vb(t){let e=t.map(i=>or(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),pc(n)}o(vb,"concat");function HL(t,e){t=or(t),t.length>e&&gr.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),pc(r)}o(HL,"zeroPad");function ji(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}o(ji,"isHexString");var bb="0123456789abcdef";function Xr(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=bb[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),w5(t))return t.toHexString();if(ji(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":gr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(gb(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=bb[(i&240)>>4]+bb[i&15]}return r}return gr.throwArgumentError("invalid hexlify value","value",t)}o(Xr,"hexlify");function Rd(t){if(typeof t!="string")t=Xr(t);else if(!ji(t)||t.length%2)return null;return(t.length-2)/2}o(Rd,"hexDataLength");function Nd(t,e,r){return typeof t!="string"?t=Xr(t):(!ji(t)||t.length%2)&&gr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}o(Nd,"hexDataSlice");function Ks(t,e){for(typeof t!="string"?t=Xr(t):ji(t)||gr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&gr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}o(Ks,"hexZeroPad");function Pd(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(_5(t)){let r=or(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Xr(r.slice(0,32)),e.s=Xr(r.slice(32,64))):r.length===65?(e.r=Xr(r.slice(0,32)),e.s=Xr(r.slice(32,64)),e.v=r[64]):gr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:gr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Xr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=HL(or(e._vs),32);e._vs=Xr(i);let a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&gr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=Xr(i);e.s==null?e.s=c:e.s!==c&&gr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?gr.throwArgumentError("signature missing v and recoveryParam","signature",t):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&&gr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!ji(e.r)?gr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ks(e.r,32),e.s==null||!ji(e.s)?gr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ks(e.s,32);let r=or(e.s);r[0]>=128&&gr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let n=Xr(r);e._vs&&(ji(e._vs)||gr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ks(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&gr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(Pd,"splitSignature");var S5=Pt(xb());var A5="bignumber/5.7.0";var zL=S5.default.BN,PV=new At(A5);function wb(t){return new zL(t,36).toString(16)}o(wb,"_base36To16");var M5=Pt(Hm());function mc(t){return"0x"+M5.default.keccak_256(or(t))}o(mc,"keccak256");var T5="address/5.7.0";var Wu=new At(T5);function C5(t){ji(t,20)||Wu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let n=or(mc(r));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(C5,"getChecksumAddress");var GL=9007199254740991;function VL(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}o(VL,"log10");var _b={};for(let t=0;t<10;t++)_b[String(t)]=String(t);for(let t=0;t<26;t++)_b[String.fromCharCode(65+t)]=String(10+t);var k5=Math.floor(VL(GL));function WL(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>_b[n]).join("");for(;e.length>=k5;){let n=e.substring(0,k5);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}o(WL,"ibanChecksum");function I5(t){let e=null;if(typeof t!="string"&&Wu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=C5(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Wu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==WL(t)&&Wu.throwArgumentError("bad icap checksum","address",t),e=wb(t.substring(4));e.length<40;)e="0"+e;e=C5("0x"+e)}else Wu.throwArgumentError("invalid address","address",t);return e}o(I5,"getAddress");var D5="properties/5.7.0";var ZV=new At(D5);function bc(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}o(bc,"defineReadOnly");var O5="strings/5.7.0";var R5=new At(O5),Ju;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Ju||(Ju={}));var Ka;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Ka||(Ka={}));function JL(t,e,r,n,i){return R5.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}o(JL,"errorFunc");function N5(t,e,r,n,i){if(t===Ka.BAD_PREFIX||t===Ka.UNEXPECTED_CONTINUE){let a=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)a++;return a}return t===Ka.OVERRUN?r.length-e-1:0}o(N5,"ignoreFunc");function YL(t,e,r,n,i){return t===Ka.OVERLONG?(n.push(i),0):(n.push(65533),N5(t,e,r,n,i))}o(YL,"replaceFunc");var XL=Object.freeze({error:JL,ignore:N5,replace:YL});function Yu(t,e=Ju.current){e!=Ju.current&&(R5.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;let a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(a&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return or(r)}o(Yu,"toUtf8Bytes");var P5=`Ethereum Signed Message:
814
+ `;function Eb(t){return typeof t=="string"&&(t=Yu(t)),mc(vb([Yu(P5),Yu(String(t.length)),t]))}o(Eb,"hashMessage");var yt=Pt(xb()),go=Pt(vu());function gc(t,e,r){return r={path:e,exports:{},require:function(n,i){return ZL(n,i??r.path)}},t(r,r.exports),r.exports}o(gc,"createCommonjsModule");function ZL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(ZL,"commonjsRequire");var Tb=B5;function B5(t,e){if(!t)throw new Error(e||"Assertion failed")}o(B5,"assert");B5.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual");var Gi=gc(function(t,e){"use strict";var r=e;function n(c,u){if(Array.isArray(c))return c.slice();if(!c)return[];var d=[];if(typeof c!="string"){for(var v=0;v<c.length;v++)d[v]=c[v]|0;return d}if(u==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var v=0;v<c.length;v+=2)d.push(parseInt(c[v]+c[v+1],16))}else for(var v=0;v<c.length;v++){var y=c.charCodeAt(v),S=y>>8,O=y&255;S?d.push(S,O):d.push(O)}return d}o(n,"toArray"),r.toArray=n;function i(c){return c.length===1?"0"+c:c}o(i,"zero2"),r.zero2=i;function a(c){for(var u="",d=0;d<c.length;d++)u+=i(c[d].toString(16));return u}o(a,"toHex"),r.toHex=a,r.encode=o(function(u,d){return d==="hex"?a(u):u},"encode")}),Hn=gc(function(t,e){"use strict";var r=e;r.assert=Tb,r.toArray=Gi.toArray,r.zero2=Gi.zero2,r.toHex=Gi.toHex,r.encode=Gi.encode;function n(d,v,y){var S=new Array(Math.max(d.bitLength(),y)+1);S.fill(0);for(var O=1<<v+1,R=d.clone(),I=0;I<S.length;I++){var N,J=R.andln(O-1);R.isOdd()?(J>(O>>1)-1?N=(O>>1)-J:N=J,R.isubn(N)):N=0,S[I]=N,R.iushrn(1)}return S}o(n,"getNAF"),r.getNAF=n;function i(d,v){var y=[[],[]];d=d.clone(),v=v.clone();for(var S=0,O=0,R;d.cmpn(-S)>0||v.cmpn(-O)>0;){var I=d.andln(3)+S&3,N=v.andln(3)+O&3;I===3&&(I=-1),N===3&&(N=-1);var J;(I&1)===0?J=0:(R=d.andln(7)+S&7,(R===3||R===5)&&N===2?J=-I:J=I),y[0].push(J);var L;(N&1)===0?L=0:(R=v.andln(7)+O&7,(R===3||R===5)&&I===2?L=-N:L=N),y[1].push(L),2*S===J+1&&(S=1-S),2*O===L+1&&(O=1-O),d.iushrn(1),v.iushrn(1)}return y}o(i,"getJSF"),r.getJSF=i;function a(d,v,y){var S="_"+v;d.prototype[v]=o(function(){return this[S]!==void 0?this[S]:this[S]=y.call(this)},"cachedProperty")}o(a,"cachedProperty"),r.cachedProperty=a;function c(d){return typeof d=="string"?r.toArray(d,"hex"):d}o(c,"parseBytes"),r.parseBytes=c;function u(d){return new yt.default(d,"hex","le")}o(u,"intFromLE"),r.intFromLE=u}),Ud=Hn.getNAF,QL=Hn.getJSF,$d=Hn.assert;function Gs(t,e){this.type=t,this.p=new yt.default(e.p,16),this.red=e.prime?yt.default.red(e.prime):yt.default.mont(this.p),this.zero=new yt.default(0).toRed(this.red),this.one=new yt.default(1).toRed(this.red),this.two=new yt.default(2).toRed(this.red),this.n=e.n&&new yt.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Gs,"BaseCurve");var ja=Gs;Gs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Gs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Gs.prototype._fixedNafMul=o(function(e,r){$d(e.precomputed);var n=e._getDoubles(),i=Ud(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],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];c.push(d)}for(var y=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)d=c[u],d===O?S=S.mixedAdd(n.points[u]):d===-O&&(S=S.mixedAdd(n.points[u].neg()));y=y.add(S)}return y.toP()},"_fixedNafMul");Gs.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=Ud(r,n,this._bitLength),u=this.jpoint(null,null,null),d=c.length-1;d>=0;d--){for(var v=0;d>=0&&c[d]===0;d--)v++;if(d>=0&&v++,u=u.dblp(v),d<0)break;var y=c[d];$d(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(a[y-1>>1]):u=u.mixedAdd(a[-y-1>>1].neg()):y>0?u=u.add(a[y-1>>1]):u=u.add(a[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Gs.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,d=this._wnafT3,v=0,y,S,O;for(y=0;y<i;y++){O=r[y];var R=O._getNAFPoints(e);c[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,N=y;if(c[I]!==1||c[N]!==1){d[I]=Ud(n[I],c[I],this._bitLength),d[N]=Ud(n[N],c[N],this._bitLength),v=Math.max(d[I].length,v),v=Math.max(d[N].length,v);continue}var J=[r[I],null,null,r[N]];r[I].y.cmp(r[N].y)===0?(J[1]=r[I].add(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg())):r[I].y.cmp(r[N].y.redNeg())===0?(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].add(r[N].neg())):(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],V=QL(n[I],n[N]);for(v=Math.max(V[0].length,v),d[I]=new Array(v),d[N]=new Array(v),S=0;S<v;S++){var Z=V[0][S]|0,Y=V[1][S]|0;d[I][S]=L[(Z+1)*3+(Y+1)],d[N][S]=0,u[I]=J}}var oe=this.jpoint(null,null,null),K=this._wnafT4;for(y=v;y>=0;y--){for(var q=0;y>=0;){var j=!0;for(S=0;S<i;S++)K[S]=d[S][y]|0,K[S]!==0&&(j=!1);if(!j)break;q++,y--}if(y>=0&&q++,oe=oe.dblp(q),y<0)break;for(S=0;S<i;S++){var le=K[S];le!==0&&(le>0?O=u[S][le-1>>1]:le<0&&(O=u[S][-le-1>>1].neg()),O.type==="affine"?oe=oe.mixedAdd(O):oe=oe.add(O))}}for(y=0;y<i;y++)u[y]=null;return a?oe:oe.toP()},"_wnafMulAdd");function xi(t,e){this.curve=t,this.type=e,this.precomputed=null}o(xi,"BasePoint");Gs.BasePoint=xi;xi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");xi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Gs.prototype.decodePoint=o(function(e,r){e=Hn.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?$d(e[e.length-1]%2===0):e[0]===7&&$d(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");xi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");xi.prototype._encode=o(function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode");xi.prototype.encode=o(function(e,r){return Hn.encode(this._encode(r),e)},"encode");xi.prototype.precompute=o(function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},"precompute");xi.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},"_hasDoubles");xi.prototype._getDoubles=o(function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=e){for(var c=0;c<e;c++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");xi.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:e,points:r}},"_getNAFPoints");xi.prototype._getBeta=o(function(){return null},"_getBeta");xi.prototype.dblp=o(function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r},"dblp");var Cb=gc(function(t){typeof Object.create=="function"?t.exports=o(function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):t.exports=o(function(r,n){if(n){r.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}},"inherits")}),eB=Hn.assert;function wi(t){ja.call(this,"short",t),this.a=new yt.default(t.a,16).toRed(this.red),this.b=new yt.default(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(wi,"ShortCurve");Cb(wi,ja);var tB=wi;wi.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new yt.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new yt.default(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],eB(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new yt.default(u.a,16),b:new yt.default(u.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism");wi.prototype._getEndoRoots=o(function(e){var r=e===this.p?this.red:yt.default.mont(e),n=new yt.default(2).toRed(r).redInvm(),i=n.redNeg(),a=new yt.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=i.redAdd(a).fromRed(),u=i.redSub(a).fromRed();return[c,u]},"_getEndoRoots");wi.prototype._getEndoBasis=o(function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),a=new yt.default(1),c=new yt.default(0),u=new yt.default(0),d=new yt.default(1),v,y,S,O,R,I,N,J=0,L,V;n.cmpn(0)!==0;){var Z=i.div(n);L=i.sub(Z.mul(n)),V=u.sub(Z.mul(a));var Y=d.sub(Z.mul(c));if(!S&&L.cmp(r)<0)v=N.neg(),y=a,S=L.neg(),O=V;else if(S&&++J===2)break;N=L,i=n,n=L,u=a,a=V,d=c,c=Y}R=L.neg(),I=V;var oe=S.sqr().add(O.sqr()),K=R.sqr().add(I.sqr());return K.cmp(oe)>=0&&(R=v,I=y),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:S,b:O},{a:R,b:I}]},"_getEndoBasis");wi.prototype._endoSplit=o(function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),c=n.b.neg().mul(e).divRound(this.n),u=a.mul(n.a),d=c.mul(i.a),v=a.mul(n.b),y=c.mul(i.b),S=e.sub(u).sub(d),O=v.add(y).neg();return{k1:S,k2:O}},"_endoSplit");wi.prototype.pointFromX=o(function(e,r){e=new yt.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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");wi.prototype.validate=o(function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},"validate");wi.prototype._endoWnafMulAdd=o(function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var u=this._endoSplit(r[c]),d=e[c],v=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=d,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return y},"_endoWnafMulAdd");function Ir(t,e,r,n){ja.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new yt.default(e,16),this.y=new yt.default(r,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");Cb(Ir,ja.BasePoint);wi.prototype.point=o(function(e,r,n){return new Ir(this,e,r,n)},"point");wi.prototype.pointFromJSON=o(function(e,r){return Ir.fromJSON(this,e,r)},"pointFromJSON");Ir.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(a){return n.point(a.x.redMul(n.endo.beta),a.y)},"endoMul");e.beta=r,r.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 r}},"_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,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function a(u){return e.point(u[0],u[1],n)}o(a,"obj2point");var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(a))}},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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),c=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,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 yt.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");Ir.prototype.mulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},"mulAdd");Ir.prototype.jmulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,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 r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(a){return a.neg()},"negate");r.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 r},"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 Fr(t,e,r,n){ja.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yt.default(0)):(this.x=new yt.default(e,16),this.y=new yt.default(r,16),this.z=new yt.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(Fr,"JPoint");Cb(Fr,ja.BasePoint);wi.prototype.jpoint=o(function(e,r,n){return new Fr(this,e,r,n)},"jpoint");Fr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)},"toP");Fr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Fr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(a),v=c.redSub(u);if(d.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),S=y.redMul(d),O=i.redMul(y),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(c.redMul(S)),N=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,N)},"add");Fr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,c=e.y.redMul(r).redMul(this.z),u=n.redSub(i),d=a.redSub(c);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),y=v.redMul(u),S=n.redMul(v),O=d.redSqr().redIAdd(y).redISub(S).redISub(S),R=d.redMul(S.redISub(O)).redISub(a.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");Fr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,c=this.x,u=this.y,d=this.z,v=d.redSqr().redSqr(),y=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=y.redSqr(),R=O.redSqr(),I=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),N=c.redMul(O),J=I.redSqr().redISub(N.redAdd(N)),L=N.redISub(J),V=I.redMul(L);V=V.redIAdd(V).redISub(R);var Z=y.redMul(d);r+1<e&&(v=v.redMul(R)),c=J,d=Z,y=V}return this.curve.jpoint(c,y.redMul(a),d)},"dblp");Fr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Fr.prototype._zeroDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),v=d.redSqr().redISub(u).redISub(u),y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),e=v,r=d.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(S).redISub(R);I=I.redIAdd(I);var N=S.redAdd(S).redIAdd(S),J=N.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=J.redISub(I).redISub(I),r=N.redMul(I.redISub(e)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)},"_zeroDbl");Fr.prototype._threeDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);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 y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),r=d.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(S).redMul(this.x.redAdd(S));I=I.redAdd(I).redIAdd(I);var N=R.redIAdd(R);N=N.redIAdd(N);var J=N.redAdd(N);e=I.redSqr().redISub(J),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(S);var L=O.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),r=I.redMul(N.redISub(e)).redISub(L)}return this.curve.jpoint(e,r,n)},"_threeDbl");Fr.prototype._dbl=o(function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),c=r.redSqr(),u=n.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var y=v.redMul(u),S=d.redSqr().redISub(y.redAdd(y)),O=y.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),N=n.redAdd(n).redMul(i);return this.curve.jpoint(S,I,N)},"_dbl");Fr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(c);var d=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var y=a.redIAdd(u).redSqr().redISub(c).redISub(d).redISub(v),S=r.redMul(y);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(d).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(v.redISub(y)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");Fr.prototype.mul=o(function(e,r){return e=new yt.default(e,r),this.curve._wnafMul(this,e)},"mul");Fr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Fr.prototype.eqXToP=o(function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},"eqXToP");Fr.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");Fr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var Ld=gc(function(t,e){"use strict";var r=e;r.base=ja,r.short=tB,r.mont=null,r.edwards=null}),Bd=gc(function(t,e){"use strict";var r=e,n=Hn.assert;function i(u){u.type==="short"?this.curve=new Ld.short(u):u.type==="edwards"?this.curve=new Ld.edwards(u):this.curve=new Ld.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"),r.PresetCurve=i;function a(u,d){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var v=new i(d);return Object.defineProperty(r,u,{configurable:!0,enumerable:!0,value:v}),v}})}o(a,"defineCurve"),a("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:go.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:go.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:go.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:go.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"]}),a("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:go.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:go.default.sha256,gRed:!1,g:["9"]}),a("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:go.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}a("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:go.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function js(t){if(!(this instanceof js))return new js(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Gi.toArray(t.entropy,t.entropyEnc||"hex"),r=Gi.toArray(t.nonce,t.nonceEnc||"hex"),n=Gi.toArray(t.pers,t.persEnc||"hex");Tb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(js,"HmacDRBG");var U5=js;js.prototype._init=o(function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");js.prototype._hmac=o(function(){return new go.default.hmac(this.hash,this.K)},"hmac");js.prototype._update=o(function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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");js.prototype.reseed=o(function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Gi.toArray(e,r),n=Gi.toArray(n,i),Tb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");js.prototype.generate=o(function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Gi.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(n),this._reseed++,Gi.encode(c,r)},"generate");var Mb=Hn.assert;function Zr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(Zr,"KeyPair");var kb=Zr;Zr.fromPublic=o(function(e,r,n){return r instanceof Zr?r:new Zr(e,{pub:r,pubEnc:n})},"fromPublic");Zr.fromPrivate=o(function(e,r,n){return r instanceof Zr?r:new Zr(e,{priv:r,privEnc:n})},"fromPrivate");Zr.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");Zr.prototype.getPublic=o(function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},"getPublic");Zr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Zr.prototype._importPrivate=o(function(e,r){this.priv=new yt.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Zr.prototype._importPublic=o(function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?Mb(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Mb(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,r)},"_importPublic");Zr.prototype.derive=o(function(e){return e.validate()||Mb(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Zr.prototype.sign=o(function(e,r,n){return this.ec.sign(e,this,r,n)},"sign");Zr.prototype.verify=o(function(e,r){return this.ec.verify(e,r,this)},"verify");Zr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var rB=Hn.assert;function Fd(t,e){if(t instanceof Fd)return t;this._importDER(t,e)||(rB(t.r&&t.s,"Signature without r or s"),this.r=new yt.default(t.r,16),this.s=new yt.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Fd,"Signature");var qd=Fd;function nB(){this.place=0}o(nB,"Position");function Ab(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,c=e.place;a<n;a++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}o(Ab,"getLength");function L5(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}o(L5,"rmPadding");Fd.prototype._importDER=o(function(e,r){e=Hn.toArray(e,r);var n=new nB;if(e[n.place++]!==48)return!1;var i=Ab(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=Ab(e,n);if(a===!1)return!1;var c=e.slice(n.place,a+n.place);if(n.place+=a,e[n.place++]!==2)return!1;var u=Ab(e,n);if(u===!1||e.length!==u+n.place)return!1;var d=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new yt.default(c),this.s=new yt.default(d),this.recoveryParam=null,!0},"_importDER");function Sb(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}o(Sb,"constructLength");Fd.prototype.toDER=o(function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=L5(r),n=L5(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Sb(i,r.length),i=i.concat(r),i.push(2),Sb(i,n.length);var a=i.concat(n),c=[48];return Sb(c,a.length),c=c.concat(a),Hn.encode(c,e)},"toDER");var iB=o(function(){throw new Error("unsupported")},"rand"),$5=Hn.assert;function yi(t){if(!(this instanceof yi))return new yi(t);typeof t=="string"&&($5(Object.prototype.hasOwnProperty.call(Bd,t),"Unknown curve "+t),t=Bd[t]),t instanceof Bd.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}o(yi,"EC");var oB=yi;yi.prototype.keyPair=o(function(e){return new kb(this,e)},"keyPair");yi.prototype.keyFromPrivate=o(function(e,r){return kb.fromPrivate(this,e,r)},"keyFromPrivate");yi.prototype.keyFromPublic=o(function(e,r){return kb.fromPublic(this,e,r)},"keyFromPublic");yi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new U5({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||iB(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yt.default(2));;){var a=new yt.default(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},"genKeyPair");yi.prototype._truncateToN=o(function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");yi.prototype.sign=o(function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yt.default(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),d=new U5({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new yt.default(1)),y=0;;y++){var S=i.k?i.k(y):new yt.default(d.generate(this.n.byteLength()));if(S=this._truncateToN(S,!0),!(S.cmpn(1)<=0||S.cmp(v)>=0)){var O=this.g.mul(S);if(!O.isInfinity()){var R=O.getX(),I=R.umod(this.n);if(I.cmpn(0)!==0){var N=S.invm(this.n).mul(I.mul(r.getPrivate()).iadd(e));if(N=N.umod(this.n),N.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),J^=1),new qd({r:I,s:N,recoveryParam:J})}}}}}},"sign");yi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new yt.default(e,16)),n=this.keyFromPublic(n,i),r=new qd(r,"hex");var a=r.r,c=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),d=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),v),y.isInfinity()?!1:y.eqXToP(a)):(y=this.g.mulAdd(d,n.getPublic(),v),y.isInfinity()?!1:y.getX().umod(this.n).cmp(a)===0)},"verify");yi.prototype.recoverPubKey=function(t,e,r,n){$5((3&r)===r,"The recovery param is more than two bits"),e=new qd(e,n);var i=this.n,a=new yt.default(t),c=e.r,u=e.s,d=r&1,v=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?c=this.curve.pointFromX(c.add(this.curve.n),d):c=this.curve.pointFromX(c,d);var y=e.r.invm(i),S=i.sub(a).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(S,c,O)};yi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new qd(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var sB=gc(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=Hn,r.rand=function(){throw new Error("unsupported")},r.curve=Ld,r.curves=Bd,r.ec=oB,r.eddsa=null}),F5=sB.ec;var q5="signing-key/5.7.0";var Db=new At(q5),Ib=null;function vo(){return Ib||(Ib=new F5("secp256k1")),Ib}o(vo,"getCurve");var Hd=class{constructor(e){bc(this,"curve","secp256k1"),bc(this,"privateKey",Xr(e)),Rd(this.privateKey)!==32&&Db.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=vo().keyFromPrivate(or(this.privateKey));bc(this,"publicKey","0x"+r.getPublic(!1,"hex")),bc(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),bc(this,"_isSigningKey",!0)}_addPoint(e){let r=vo().keyFromPublic(or(this.publicKey)),n=vo().keyFromPublic(or(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let r=vo().keyFromPrivate(or(this.privateKey)),n=or(e);n.length!==32&&Db.throwArgumentError("bad digest length","digest",e);let i=r.sign(n,{canonical:!0});return Pd({recoveryParam:i.recoveryParam,r:Ks("0x"+i.r.toString(16),32),s:Ks("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=vo().keyFromPrivate(or(this.privateKey)),n=vo().keyFromPublic(or(Ob(e)));return Ks("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(Hd,"SigningKey");function H5(t,e){let r=Pd(e),n={r:or(r.r),s:or(r.s)};return"0x"+vo().recoverPubKey(or(t),n,r.recoveryParam).encode("hex",!1)}o(H5,"recoverPublicKey");function Ob(t,e){let r=or(t);if(r.length===32){let n=new Hd(r);return e?"0x"+vo().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?Xr(r):"0x"+vo().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+vo().keyFromPublic(r).getPublic(!0,"hex"):Xr(r)}return Db.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(Ob,"computePublicKey");var z5="transactions/5.7.0";var OW=new At(z5),K5;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(K5||(K5={}));function j5(t){let e=Ob(t);return I5(Nd(mc(Nd(e,1)),12))}o(j5,"computeAddress");function G5(t,e){return j5(H5(or(t),e))}o(G5,"recoverAddress");var V5="wallet/5.7.0";var qW=new At(V5);function Rb(t,e){return G5(Eb(t),e)}o(Rb,"verifyMessage");function W5(){return{eip191:async(t,e)=>{fB(t,e)}}}o(W5,"getEIP191Verifier");var aB=new Date("2022-09-20").valueOf();function fB(t,e){db(t),h5(t,e);let n=[Rb(dc.fromCacao(t).toMessage(),t.s.s).toLowerCase()];if(Date.parse(t.p.iat)<=aB){let a=Rb(l5(dc.fromCacao(t),"Ethereum"),t.s.s).toLowerCase();n.push(a)}let i=zs.parse(t.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(fB,"verifyEIP191Signature");Uf();Dh();var J5=Pt(Da(),1);Uf();function Y5(){return kt((0,J5.randomBytes)(16),"base64")}o(Y5,"randomString");var X5="base64pad",Z5="base64url";function Q5(t){return kt(t,X5)}o(Q5,"encodeBase64");function e8(t){return kt(t,Z5)}o(e8,"encodeBase64Url");function t8(t){return Bt(t,X5)}o(t8,"decodeBase64");function zd(t){return JSON.parse(kt(Bt(t,Z5)))}o(zd,"base64urlToJSON");function r8(t){if(t.signatures.length>1)throw new Error("Cant convert to compact jws");return`${t.signatures[0].protected}.${t.payload}.${t.signatures[0].signature}`}o(r8,"fromDagJWS");function n8(t,e){if(e){let r=e.toISOString().split(".")[0]+"Z";return`${t}?versionTime=${r}`}else return t}o(n8,"didWithTime");function i8(t){return t?Array.isArray(t)?t:[t]:[]}o(i8,"extractControllers");var cB={...W5()};function uB(t){return"registry"in t&&"cache"in t}o(uB,"isResolver");var Ga=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 Ga({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new ac(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,r){this._resolver=uB(e)?e:new iu(e,r)}async authenticate({provider:e,paths:r=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=Y5(),a=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:r}),{kid:c}=await this.verifyJWS(a),u=zd(a.payload);if(!c.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,r={}){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 a=await Vu.fromCacao(this._capability),c=We.asCID(a.cid);if(!c)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");r.protected=r.protected||{},r.protected.cap=`ipfs://${c?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...r,payload:e});return n}async createDagJWS(e,r={}){let{cid:n,linkedBlock:i}=await a4(e),a=e8(n.bytes);Object.assign(r,{linkedBlock:Q5(i)});let c=await this.createJWS(a,r),u=We.asCID(n);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(c.link=u,this._capability){let d=await Vu.fromCacao(this._capability);return{jws:c,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:c,linkedBlock:i}}async verifyJWS(e,r={}){r=Object.assign({verifiers:cB},r),typeof e!="string"&&(e=r8(e));let n=zd(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!r.disableTimecheck){let v=i.didDocumentMetadata?.nextUpdate;if(v){let S=r.revocationPhaseOutSecs?r.revocationPhaseOutSecs*1e3:0,O=new Date(v).valueOf()+S;if(!(r.atTime&&r.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let y=i.didDocumentMetadata?.updated;if(y&&r.atTime&&r.atTime.getTime()<new Date(y).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let c=i.didDocument?.id;if(r.issuer&&r.issuer===r.capability?.p.iss&&c===r.capability.p.aud){if(!r.verifiers)throw new Error("Registered verifiers needed for CACAO");await Gu.verify(r.capability,{disableExpirationCheck:r.disableTimecheck,atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs,verifiers:r.verifiers??{}})}else if(r.issuer&&r.issuer!==c){let v=n8(r.issuer,r.atTime),S=(await this.resolve(v)).didDocument?.controller,O=i8(S);if(r.capability?.s&&r.capability.p.aud===c&&O.includes(r.capability.p.iss))await Gu.verify(r.capability,{atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs,verifiers:r.verifiers??{}});else if(!(c?O.includes(c):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];Wx(e,u);let d;try{d=zd(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,r,n={}){let i=await Xx(r,this._resolver);return Yx(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,r,n={}){let i=await f4(e);return this.createJWE(i,r,n)}async decryptJWE(e,r={}){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,...r,jwe:e});return t8(n)}async decryptDagJWE(e){let r=await this.decryptJWE(e);return c4(r)}async resolve(e){let r=await this._resolver.resolve(e);if(r.didResolutionMetadata.error){let{error:n,message:i}=r.didResolutionMetadata,a=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${a}`)}return r}constructor({provider:e,resolver:r={},resolverOptions:n,capability:i,parent:a}={}){if(e!=null&&(this._client=new ac(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,a&&this._parentId!==a)throw new Error("Capability issuer and parent not equal")}else a&&(this._parentId=a);this.setResolver(r,n)}};o(Ga,"DID");function o8(t){var e=0,r=t.length,n=[];if(r%2)throw new Error("invalid hex:"+t);for(;e<r;e+=2)n.push(parseInt(t.substr(e,2),16));return new Uint8Array(n)}o(o8,"toUint8Array");var jb=Pt(Xu(),1);wh();var Lb={};Jt(Lb,{keyToDidDoc:()=>AB});function AB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:kt(t,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(AB,"keyToDidDoc");var Bb={};Jt(Bb,{keyToDidDoc:()=>MB});Uf();var m8=Pt(id(),1);function SB(t){let e=new Uint8Array(t.length+2);return e[0]=236,e[1]=1,e.set(t,2),`z${kt(e,"base58btc")}`}o(SB,"encodeKey");function MB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=(0,m8.convertPublicKeyToX25519)(t),a=`${r}#${SB(i)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:kt(t,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:a,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:kt(i,"base58btc")}]}}o(MB,"keyToDidDoc");var Hb={};Jt(Hb,{keyToDidDoc:()=>LB,pubKeyBytesToXY:()=>v8});var Kd={};Jt(Kd,{ECPointDecompress:()=>RB});function TB(t){return t>=0?t:-t}o(TB,"abs");function CB(t,e){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),t<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,n=1n,i=1n,a=0n;for(;t!==0n;){let c=e/t,u=e%t,d=r-i*c,v=n-a*c;e=t,t=u,r=i,n=a,i=d,a=v}return{g:e,x:r,y:n}}o(CB,"eGcd");function Ub(t,e){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let r=t%e;return r<0n?r+e:r}o(Ub,"toZn");function kB(t,e){let r=CB(Ub(t,e),e);if(r.g!==1n)throw new RangeError(`${t.toString()} does not have inverse modulo ${e.toString()}`);return Ub(r.x,e)}o(kB,"modInv");function Va(t,e,r){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),typeof r=="number"&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(r===1n)return 0n;if(t=Ub(t,r),e<0n)return kB(Va(t,TB(e),r),r);let n=1n;for(;e>0;)e%2n===1n&&(n=n*t%r),e=e/2n,t=t**2n%r;return n}o(Va,"modPow");var vr={};Jt(vr,{pubKeyBytesToHex:()=>IB,publicKeyHexToUint8ArrayPointPair:()=>b8,publicKeyIntToUint8ArrayPointPair:()=>g8,publicKeyIntToXY:()=>OB,publicKeyToXY:()=>DB,testHexString:()=>Fb,testUint8Array:()=>Vs});_h();function IB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");return kt(t,"base16")}o(IB,"pubKeyBytesToHex");function DB(t){if(!Fb(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=b8(t),r=wa.encode(e.xOctet).slice(1),n=wa.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(DB,"publicKeyToXY");function b8(t){if(!Fb(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=t.slice(0,t.length/2),r=t.slice(t.length/2,t.length),n=Bt(e,"base16"),i=Bt(r,"base16");return{xOctet:n,yOctet:i}}o(b8,"publicKeyHexToUint8ArrayPointPair");function Fb(t){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(t)!==null&&e.test(t)&&typeof t=="string")}o(Fb,"testHexString");function Vs(t){return t==null?!1:t.constructor===Uint8Array}o(Vs,"testUint8Array");function OB(t){if(t==null)throw new TypeError("input cannot be null or undefined.");if(typeof t!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(t,"x")||!Object.prototype.hasOwnProperty.call(t,"y"))throw new Error("Input must have properties x and y");if(typeof t.x!="bigint"&&typeof t.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=g8(t),r=wa.encode(e.xOctet).slice(1),n=wa.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(OB,"publicKeyIntToXY");function g8(t){if(t==null)throw new TypeError("input cannot be null or undefined.");if(typeof t!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(t,"x")||!Object.prototype.hasOwnProperty.call(t,"y"))throw new Error("Input must have properties x and y");if(typeof t.x!="bigint"&&typeof t.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=t.x.toString(),r=t.y.toString(),n=Bt(e,"base10"),i=Bt(r,"base10");return{xOctet:n,yOctet:i}}o(g8,"publicKeyIntToUint8ArrayPointPair");function RB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),r=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),d=u**3n-u*3n+n,v=Va(d,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(RB,"ECPointDecompress");var jd={};Jt(jd,{ECPointDecompress:()=>NB});function NB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),r=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),d=u**3n-u*3n+n,v=Va(d,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(NB,"ECPointDecompress");var Gd={};Jt(Gd,{ECPointDecompress:()=>PB});function PB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),d=u**3n-u*3n+n,v=Va(d,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(PB,"ECPointDecompress");function LB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=v8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(LB,"keyToDidDoc");function v8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t),r=e.length/2;if(r==64)return vr.publicKeyToXY(e);if(r==65&&e.slice(0,2)=="04"){let n=e.slice(2);return vr.publicKeyToXY(n)}if(r==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Bt(e,"base16"),i=Kd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(v8,"pubKeyBytesToXY");var zb={};Jt(zb,{keyToDidDoc:()=>BB,pubKeyBytesToXY:()=>y8});function BB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=y8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(BB,"keyToDidDoc");function y8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t),r=e.length/2;if(r==96)return vr.publicKeyToXY(e);if(r==97&&e.slice(0,2)=="04"){let n=e.slice(2);return vr.publicKeyToXY(n)}if(r==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Bt(e,"base16"),i=jd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(y8,"pubKeyBytesToXY");var Kb={};Jt(Kb,{keyToDidDoc:()=>UB,pubKeyBytesToXY:()=>x8});function UB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=x8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(UB,"keyToDidDoc");function x8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let r=Bt(e,"base16"),n=Gd.ECPointDecompress(r);return vr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(x8,"pubKeyBytesToXY");var $B="application/did+ld+json",w8="application/did+json",FB={231:Lb,237:Bb,4608:Hb,4609:zb,4610:Kb};function qB(){return{key:async(t,e,r,n)=>{let i=n.accept||w8,a={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let c=ci.decode(e.id),u=jb.default.decode(c),d=c.slice(jb.default.decode.bytes),v=await FB[u].keyToDidDoc(d,e.id);i===$B?(v["@context"]="https://w3id.org/did/v1",a.didDocument=v):i===w8?a.didDocument=v:(delete a.didResolutionMetadata.contentType,a.didResolutionMetadata.error="representationNotSupported")}catch(c){a.didResolutionMetadata.error="invalidDid",a.didResolutionMetadata.message=c.toString()}return a}}}o(qB,"getResolver");var _8={getResolver:qB};var Vd=Pt(id(),1);var C8=Pt(A8(),1);var HB="base64pad";function S8(t){return JSON.parse((0,C8.default)(t))}o(S8,"toStableObject");function zB(t){let e=new Uint8Array(t.length+2);return e[0]=237,e[1]=1,e.set(t,2),`did:key:z${kt(e,"base58btc")}`}o(zB,"encodeDID");function M8(t){let[e,r,n]=t.split(".");return{payload:r,signatures:[{protected:e,signature:n}]}}o(M8,"toGeneralJWS");var T8=o(async(t,e,r,n={})=>{let i=`${e}#${e.split(":")[2]}`,a=zx(r),c=S8(Object.assign(n,{kid:i,alg:"EdDSA"}));return Vx(typeof t=="string"?t:S8(t),a,c)},"sign"),KB={did_authenticate:async({did:t,secretKey:e},r)=>{let n=await T8({did:t,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},t,e);return M8(n)},did_createJWS:async({did:t,secretKey:e},r)=>{if(r.did.split("#")[0]!==t)throw new wn(4100,`Unknown DID: ${t}`);let i=await T8(r.payload,t,e,r.protected);return{jws:M8(i)}},did_decryptJWE:async({secretKey:t},e)=>{let r=Qx((0,Vd.convertSecretKeyToX25519)(t));try{let n=await Jx(e.jwe,r);return{cleartext:kt(n,HB)}}catch(n){throw new wn(-32e3,n.message)}}},Zu=class{constructor(e){let{secretKey:r,publicKey:n}=(0,Vd.generateKeyPairFromSeed)(e),i=zB(n),a=b4(KB);this._handle=async c=>await a({did:i,secretKey:r},c)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(Zu,"Ed25519Provider");var Gb={};Jt(Gb,{JsonPatchError:()=>dr,_areEquals:()=>tl,applyOperation:()=>Wa,applyPatch:()=>e0,applyReducer:()=>JB,deepClone:()=>VB,getValueByPointer:()=>Zd,validate:()=>I8,validator:()=>Qd});var jB=function(){var t=o(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}o(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),GB=Object.prototype.hasOwnProperty;function Jd(t,e){return GB.call(t,e)}o(Jd,"hasOwnProperty");function Yd(t){if(Array.isArray(t)){for(var e=new Array(t.length),r=0;r<e.length;r++)e[r]=""+r;return e}if(Object.keys)return Object.keys(t);var n=[];for(var i in t)Jd(t,i)&&n.push(i);return n}o(Yd,"_objectKeys");function qr(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}o(qr,"_deepClone");function Xd(t){for(var e=0,r=t.length,n;e<r;){if(n=t.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(Xd,"isInteger");function yo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(yo,"escapePathComponent");function Qu(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(Qu,"unescapePathComponent");function Wd(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)if(Wd(t[e]))return!0}else if(typeof t=="object"){for(var n=Yd(t),i=n.length,a=0;a<i;a++)if(Wd(t[n[a]]))return!0}}return!1}o(Wd,"hasUndefined");function k8(t,e){var r=[t];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i<"u"&&r.push(n+": "+i)}return r.join(`
815
+ `)}o(k8,"patchErrorMessageFormatter");var el=function(t){jB(e,t);function e(r,n,i,a,c){var u=this.constructor,d=t.call(this,k8(r,{name:n,index:i,operation:a,tree:c}))||this;return d.name=n,d.index=i,d.operation=a,d.tree=c,Object.setPrototypeOf(d,u.prototype),d.message=k8(r,{name:n,index:i,operation:a,tree:c}),d}return o(e,"PatchError"),e}(Error);var dr=el,VB=qr,vc={add:function(t,e,r){return t[e]=this.value,{newDocument:r}},remove:function(t,e,r){var n=t[e];return delete t[e],{newDocument:r,removed:n}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:function(t,e,r){var n=Zd(r,this.path);n&&(n=qr(n));var i=Wa(r,{op:"remove",path:this.from}).removed;return Wa(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(t,e,r){var n=Zd(r,this.from);return Wa(r,{op:"add",path:this.path,value:qr(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:tl(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},WB={add:function(t,e,r){return Xd(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:r,index:e}},remove:function(t,e,r){var n=t.splice(e,1);return{newDocument:r,removed:n[0]}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:vc.move,copy:vc.copy,test:vc.test,_get:vc._get};function Zd(t,e){if(e=="")return t;var r={op:"_get",path:e};return Wa(t,r),r.value}o(Zd,"getValueByPointer");function Wa(t,e,r,n,i,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(e,0,t,e.path):Qd(e,0)),e.path===""){var c={newDocument:t};if(e.op==="add")return c.newDocument=e.value,c;if(e.op==="replace")return c.newDocument=e.value,c.removed=t,c;if(e.op==="move"||e.op==="copy")return c.newDocument=Zd(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=tl(t,e.value),c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c.newDocument=t,c}else{if(e.op==="remove")return c.removed=t,c.newDocument=null,c;if(e.op==="_get")return e.value=t,c;if(r)throw new dr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,e,t);return c}}else{n||(t=qr(t));var u=e.path||"",d=u.split("/"),v=t,y=1,S=d.length,O=void 0,R=void 0,I=void 0;for(typeof r=="function"?I=r:I=Qd;;){if(R=d[y],R&&R.indexOf("~")!=-1&&(R=Qu(R)),i&&(R=="__proto__"||R=="prototype"&&y>0&&d[y-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&O===void 0&&(v[R]===void 0?O=d.slice(0,y).join("/"):y==S-1&&(O=e.path),O!==void 0&&I(e,0,t,O)),y++,Array.isArray(v)){if(R==="-")R=v.length;else{if(r&&!Xd(R))throw new dr("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",a,e,t);Xd(R)&&(R=~~R)}if(y>=S){if(r&&e.op==="add"&&R>v.length)throw new dr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,e,t);var c=WB[e.op].call(e,v,R,t);if(c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c}}else if(y>=S){var c=vc[e.op].call(e,v,R,t);if(c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c}if(v=v[R],r&&y<S&&(!v||typeof v!="object"))throw new dr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,e,t)}}}o(Wa,"applyOperation");function e0(t,e,r,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),r&&!Array.isArray(e))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(t=qr(t));for(var a=new Array(e.length),c=0,u=e.length;c<u;c++)a[c]=Wa(t,e[c],r,!0,i,c),t=a[c].newDocument;return a.newDocument=t,a}o(e0,"applyPatch");function JB(t,e,r){var n=Wa(t,e);if(n.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",r,e,t);return n.newDocument}o(JB,"applyReducer");function Qd(t,e,r,n){if(typeof t!="object"||t===null||Array.isArray(t))throw new dr("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,r);if(vc[t.op]){if(typeof t.path!="string")throw new dr("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,r);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new dr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,r);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new dr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new dr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Wd(t.value))throw new dr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,r);if(r){if(t.op=="add"){var i=t.path.split("/").length,a=n.split("/").length;if(i!==a+1&&i!==a)throw new dr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,r)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==n)throw new dr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,r)}else if(t.op==="move"||t.op==="copy"){var c={op:"_get",path:t.from,value:void 0},u=I8([c],r);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new dr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,r)}}}else throw new dr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,r)}o(Qd,"validator");function I8(t,e,r){try{if(!Array.isArray(t))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)e0(qr(e),qr(t),r||!0);else{r=r||Qd;for(var n=0;n<t.length;n++)r(t[n],n,e,void 0)}}catch(i){if(i instanceof dr)return i;throw i}}o(I8,"validate");function tl(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var r=Array.isArray(t),n=Array.isArray(e),i,a,c;if(r&&n){if(a=t.length,a!=e.length)return!1;for(i=a;i--!==0;)if(!tl(t[i],e[i]))return!1;return!0}if(r!=n)return!1;var u=Object.keys(t);if(a=u.length,a!==Object.keys(e).length)return!1;for(i=a;i--!==0;)if(!e.hasOwnProperty(u[i]))return!1;for(i=a;i--!==0;)if(c=u[i],!tl(t[c],e[c]))return!1;return!0}return t!==t&&e!==e}o(tl,"_areEquals");var Yb={};Jt(Yb,{compare:()=>nU,generate:()=>Vb,observe:()=>rU,unobserve:()=>tU});var Wb=new WeakMap,YB=function(){function t(e){this.observers=new Map,this.obj=e}return o(t,"Mirror"),t}(),XB=function(){function t(e,r){this.callback=e,this.observer=r}return o(t,"ObserverInfo"),t}();function ZB(t){return Wb.get(t)}o(ZB,"getMirror");function QB(t,e){return t.observers.get(e)}o(QB,"getObserverFromMirror");function eU(t,e){t.observers.delete(e.callback)}o(eU,"removeObserverFromMirror");function tU(t,e){e.unobserve()}o(tU,"unobserve");function rU(t,e){var r=[],n,i=ZB(t);if(!i)i=new YB(t),Wb.set(t,i);else{var a=QB(i,e);n=a&&a.observer}if(n)return n;if(n={},i.value=qr(t),e){n.callback=e,n.next=null;var c=o(function(){Vb(n)},"dirtyCheck"),u=o(function(){clearTimeout(n.next),n.next=setTimeout(c)},"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=r,n.object=t,n.unobserve=function(){Vb(n),clearTimeout(n.next),eU(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 XB(e,n)),n}o(rU,"observe");function Vb(t,e){e===void 0&&(e=!1);var r=Wb.get(t.object);Jb(r.value,t.object,t.patches,"",e),t.patches.length&&e0(r.value,t.patches);var n=t.patches;return n.length>0&&(t.patches=[],t.callback&&t.callback(n)),n}o(Vb,"generate");function Jb(t,e,r,n,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var a=Yd(e),c=Yd(t),u=!1,d=!1,v=c.length-1;v>=0;v--){var y=c[v],S=t[y];if(Jd(e,y)&&!(e[y]===void 0&&S!==void 0&&Array.isArray(e)===!1)){var O=e[y];typeof S=="object"&&S!=null&&typeof O=="object"&&O!=null&&Array.isArray(S)===Array.isArray(O)?Jb(S,O,r,n+"/"+yo(y),i):S!==O&&(u=!0,i&&r.push({op:"test",path:n+"/"+yo(y),value:qr(S)}),r.push({op:"replace",path:n+"/"+yo(y),value:qr(O)}))}else Array.isArray(t)===Array.isArray(e)?(i&&r.push({op:"test",path:n+"/"+yo(y),value:qr(S)}),r.push({op:"remove",path:n+"/"+yo(y)}),d=!0):(i&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),u=!0)}if(!(!d&&a.length==c.length))for(var v=0;v<a.length;v++){var y=a[v];!Jd(t,y)&&e[y]!==void 0&&r.push({op:"add",path:n+"/"+yo(y),value:qr(e[y])})}}}o(Jb,"_generate");function nU(t,e,r){r===void 0&&(r=!1);var n=[];return Jb(t,e,n,"",r),n}o(nU,"compare");var t0=Object.assign({},Gb,Yb,{JsonPatchError:el,deepClone:qr,escapePathComponent:yo,unescapePathComponent:Qu});var GE=Pt(Ec(),1);var VE=Pt(Da(),1);var yr;(function(t){t[t.PREFER_CACHE=0]="PREFER_CACHE",t[t.SYNC_ALWAYS=1]="SYNC_ALWAYS",t[t.NEVER_SYNC=2]="NEVER_SYNC"})(yr||(yr={}));var Og=Pt(Ec(),1);Pi();Pf();var v_={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function D$(t){let e=v_[t];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${t}`)}o(D$,"codeByName");function O$(t){let e=Object.entries(v_).find(([,r])=>r===t);if(e)return e[0];throw new Error(`No stream type registered for index ${t}`)}o(O$,"nameByCode");var En=class{};o(En,"StreamType");En.nameByCode=O$;En.codeByName=D$;var vg=Pt(Xu(),1);function zn(t){let e,r,n;return typeof t=="object"?(e=t.hashFunction,r=t.expiring,n=t.tags):e=t,(i,a,c)=>{if(c.value!=null)c.value=y_(c.value,e,r,n);else if(c.get!=null)c.get=y_(c.get,e,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(zn,"Memoize");var lg=new Map;function y_(t,e,r=0,n){let i=Symbol("__memoized_map__");return function(...a){let c;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)lg.has(d)?lg.get(d).push(u):lg.set(d,[u]);if(e||a.length>0||r>0){let d;e===!0?d=a.map(S=>S.toString()).join("!"):e?d=e.apply(this,a):d=a[0];let v=`${d}__timestamp`,y=!1;if(r>0)if(!u.has(v))y=!0;else{let S=u.get(v);y=Date.now()-S>r}u.has(d)&&!y?c=u.get(d):(c=t.apply(this,a),u.set(d,c),r>0&&u.set(v,Date.now()))}else{let d=this;u.has(d)?c=u.get(d):(c=t.apply(this,a),u.set(d,c))}return c}}o(y_,"getNewFunction");Pi();Pf();uu();var bg=Pt(Xu(),1);function Ac(t){try{return t()}catch(e){return e}}o(Ac,"tryCatch");Pi();var hg=Pt(Xu(),1);Ea();function Za(t){let e=hg.default.decode(t),r=hg.default.decode.bytes,n=t.subarray(r);return[e,n,r]}o(Za,"readVarint");function R$(t){return t===0||t===1}o(R$,"isCidVersion");function dg(t){let[e,r]=Za(t);if(!R$(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=Za(r),[,a,c]=Za(i),[u,,d]=Za(a),v=i.subarray(0,c+d+u),y=i.subarray(c+d+u);return[We.create(e,n,Sh(v)),y]}o(dg,"readCid");Pi();Pf();function Qa(t,e="StreamRef"){let[r,n]=Za(t);if(r!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,a]=Za(n),c=dg(a),[u,d]=c;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]=dg(d);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(Qa,"fromBytes");var N$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Sc(t,e="StreamRef"){let r=N$.exec(t)||[],n=r[2];if(!n)throw new Error(`Malformed ${e} string: ${t}`);let i=Ni.decode(n),a=Qa(i),c=r[4];return c?{kind:"commit-id",type:a.type,genesis:a.genesis,commit:pg(a.genesis,c)}:a}o(Sc,"fromString");function P$(t){try{return typeof t=="string"?We.parse(t):We.asCID(t)}catch{return null}}o(P$,"parseCID");function pg(t,e=null){if(!e||e==="0")return null;let r=P$(e);if(r)return t.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(pg,"parseCommit");var ol=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},_i=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},u0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ni.encode(e)}: contains commit`)}};o(u0,"InvalidStreamIDBytesError");var l0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(l0,"InvalidStreamIDStringError");function __(t){let e=Qa(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new u0(t)}o(__,"fromBytes");function L$(t){return Ac(()=>__(t))}o(L$,"fromBytesNoThrow");function E_(t){let e=Sc(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new l0(t)}o(E_,"fromString");function B$(t){return Ac(()=>E_(t))}o(B$,"fromStringNoThrow");var w_=Symbol.for("@ceramicnetwork/streamid/StreamID"),rt=class{constructor(e,r){if(this._tag=w_,!(e||e===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?En.codeByName(e):e,this._cid=typeof r=="string"?We.parse(r):r}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===w_}static async fromGenesis(e,r){let n=await Ba({value:r,codec:Hi,hasher:Ss});return new rt(e,n.cid)}get type(){return this._type}get typeName(){return En.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=bg.default.encode(206),r=bg.default.encode(this.type);return Oi([e,r,this.cid.bytes])}get baseID(){return new rt(this._type,this._cid)}equals(e){return rt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Ni.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(rt,"StreamID");rt.fromBytes=__;rt.fromBytesNoThrow=L$;rt.fromString=E_;rt.fromStringNoThrow=B$;ol([zn(),_i("design:type",String),_i("design:paramtypes",[])],rt.prototype,"typeName",null);ol([zn(),_i("design:type",Uint8Array),_i("design:paramtypes",[])],rt.prototype,"bytes",null);ol([zn(),_i("design:type",rt),_i("design:paramtypes",[])],rt.prototype,"baseID",null);ol([zn(),_i("design:type",Function),_i("design:paramtypes",[]),_i("design:returntype",String)],rt.prototype,"toString",null);ol([zn(),_i("design:type",Function),_i("design:paramtypes",[]),_i("design:returntype",String)],rt.prototype,"toUrl",null);var Tc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},An=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},gg=function(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},os=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Mc,ef,sl,h0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ni.encode(e)}: no commit information provided`)}};o(h0,"InvalidCommitIDBytesError");var d0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(d0,"InvalidCommitIDStringError");function S_(t){let e=Qa(t,"CommitID");if(e.kind==="commit-id")return new Nt(e.type,e.genesis,e.commit);throw new h0(t)}o(S_,"fromBytes");function U$(t){return Ac(()=>S_(t))}o(U$,"fromBytesNoThrow");function M_(t){let e=Sc(t,"CommitID");if(e.kind==="commit-id")return new Nt(e.type,e.genesis,e.commit);throw new d0(t)}o(M_,"fromString");function $$(t){return Ac(()=>M_(t))}o($$,"fromStringNoThrow");var A_=Symbol.for("@ceramicnetwork/streamid/CommitID");function F$(t,e){return new Nt(t.type,t.cid,e)}o(F$,"make");var Nt=class{constructor(e,r,n=null){if(this._tag=A_,Mc.set(this,void 0),ef.set(this,void 0),sl.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");gg(this,Mc,typeof e=="string"?En.codeByName(e):e,"f"),gg(this,ef,typeof r=="string"?We.parse(r):r,"f"),gg(this,sl,pg(os(this,ef,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===A_}get baseID(){return new rt(os(this,Mc,"f"),os(this,ef,"f"))}get type(){return os(this,Mc,"f")}get typeName(){return En.nameByCode(os(this,Mc,"f"))}get cid(){return os(this,ef,"f")}get commit(){return os(this,sl,"f")||os(this,ef,"f")}get bytes(){let e=vg.default.encode(206),r=vg.default.encode(this.type),n=os(this,sl,"f")?.bytes||new Uint8Array([0]);return Oi([e,r,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Ni.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Mc=new WeakMap,ef=new WeakMap,sl=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Nt,"CommitID");Nt.fromBytes=S_;Nt.fromBytesNoThrow=U$;Nt.fromString=M_;Nt.fromStringNoThrow=$$;Nt.make=F$;Tc([zn(),An("design:type",rt),An("design:paramtypes",[])],Nt.prototype,"baseID",null);Tc([zn(),An("design:type",String),An("design:paramtypes",[])],Nt.prototype,"typeName",null);Tc([zn(),An("design:type",We),An("design:paramtypes",[])],Nt.prototype,"commit",null);Tc([zn(),An("design:type",Uint8Array),An("design:paramtypes",[])],Nt.prototype,"bytes",null);Tc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Nt.prototype,"toString",null);Tc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Nt.prototype,"toUrl",null);Pf();var fn;(function(t){function e(i){let a=Qa(i);switch(a.kind){case"commit-id":return new Nt(a.type,a.genesis,a.commit);case"stream-id":return new rt(a.type,a.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Ni.encode(i)}`)}}o(e,"fromBytes"),t.fromBytes=e;function r(i){let a=Sc(i);switch(a.kind){case"commit-id":return new Nt(a.type,a.genesis,a.commit);case"stream-id":return new rt(a.type,a.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(r,"fromString"),t.fromString=r;function n(i){if(rt.isInstance(i)||Nt.isInstance(i))return i;if(i instanceof Uint8Array)return e(i);if(typeof i=="string")return r(i);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(i)}`)}o(n,"from"),t.from=n})(fn||(fn={}));var Q_=Pt(Z_(),1),{__extends:Qr,__assign:hY,__rest:dY,__decorate:pY,__param:mY,__esDecorate:bY,__runInitializers:gY,__propKey:vY,__setFunctionName:yY,__metadata:xY,__awaiter:eE,__generator:g0,__exportStar:wY,__createBinding:_Y,__values:tf,__read:Kn,__spread:EY,__spreadArrays:AY,__spreadArray:Vi,__await:v0,__asyncGenerator:tE,__asyncDelegator:SY,__asyncValues:rE,__makeTemplateObject:MY,__importStar:TY,__importDefault:CY,__classPrivateFieldGet:kY,__classPrivateFieldSet:IY,__classPrivateFieldIn:DY}=Q_.default;function St(t){return typeof t=="function"}o(St,"isFunction");function kc(t){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}o(kc,"createErrorClass");var y0=kc(function(t){return o(function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
816
+ `+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
817
+ `):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function rf(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}o(rf,"arrRemove");var Js=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(t,"Subscription"),t.prototype.unsubscribe=function(){var e,r,n,i,a;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var u=tf(c),d=u.next();!d.done;d=u.next()){var v=d.value;v.remove(this)}}catch(N){e={error:N}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}else c.remove(this);var y=this.initialTeardown;if(St(y))try{y()}catch(N){a=N instanceof y0?N.errors:[N]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var O=tf(S),R=O.next();!R.done;R=O.next()){var I=R.value;try{nE(I)}catch(N){a=a??[],N instanceof y0?a=Vi(Vi([],Kn(a)),Kn(N.errors)):a.push(N)}}}catch(N){n={error:N}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(a)throw new y0(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)nE(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&rf(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&rf(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();var xg=Js.EMPTY;function x0(t){return t instanceof Js||t&&"closed"in t&&St(t.remove)&&St(t.add)&&St(t.unsubscribe)}o(x0,"isSubscription");function nE(t){St(t)?t():t.unsubscribe()}o(nE,"execFinalizer");var Wi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Ic={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ic.delegate;return i?.setTimeout?i.setTimeout.apply(i,Vi([t,e],Kn(r))):setTimeout.apply(void 0,Vi([t,e],Kn(r)))},clearTimeout:function(t){var e=Ic.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function w0(t){Ic.setTimeout(function(){var e=Wi.onUnhandledError;if(e)e(t);else throw t})}o(w0,"reportUnhandledError");function wg(){}o(wg,"noop");var iE=function(){return _g("C",void 0,void 0)}();function oE(t){return _g("E",void 0,t)}o(oE,"errorNotification");function sE(t){return _g("N",t,void 0)}o(sE,"nextNotification");function _g(t,e,r){return{kind:t,value:e,error:r}}o(_g,"createNotification");var nf=null;function Dc(t){if(Wi.useDeprecatedSynchronousErrorHandling){var e=!nf;if(e&&(nf={errorThrown:!1,error:null}),t(),e){var r=nf,n=r.errorThrown,i=r.error;if(nf=null,n)throw i}}else t()}o(Dc,"errorContext");function aE(t){Wi.useDeprecatedSynchronousErrorHandling&&nf&&(nf.errorThrown=!0,nf.error=t)}o(aE,"captureError");var al=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,x0(r)&&r.add(n)):n.destination=K$,n}return o(e,"Subscriber"),e.create=function(r,n,i){return new E0(r,n,i)},e.prototype.next=function(r){this.isStopped?Ag(sE(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?Ag(oE(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?Ag(iE,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Js);var q$=Function.prototype.bind;function Eg(t,e){return q$.call(t,e)}o(Eg,"bind");var H$=function(){function t(e){this.partialObserver=e}return o(t,"ConsumerObserver"),t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){_0(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){_0(n)}else _0(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){_0(r)}},t}(),E0=function(t){Qr(e,t);function e(r,n,i){var a=t.call(this)||this,c;if(St(r)||!r)c={next:r??void 0,error:n??void 0,complete:i??void 0};else{var u;a&&Wi.useDeprecatedNextContext?(u=Object.create(r),u.unsubscribe=function(){return a.unsubscribe()},c={next:r.next&&Eg(r.next,u),error:r.error&&Eg(r.error,u),complete:r.complete&&Eg(r.complete,u)}):c=r}return a.destination=new H$(c),a}return o(e,"SafeSubscriber"),e}(al);function _0(t){Wi.useDeprecatedSynchronousErrorHandling?aE(t):w0(t)}o(_0,"handleUnhandledError");function z$(t){throw t}o(z$,"defaultErrorHandler");function Ag(t,e){var r=Wi.onStoppedNotification;r&&Ic.setTimeout(function(){return r(t,e)})}o(Ag,"handleStoppedNotification");var K$={closed:!0,next:wg,error:z$,complete:wg};var Oc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Rc(t){return t}o(Rc,"identity");function fE(t){return t.length===0?Rc:t.length===1?t[0]:o(function(r){return t.reduce(function(n,i){return i(n)},r)},"piped")}o(fE,"pipeFromArray");var Wt=function(){function t(e){e&&(this._subscribe=e)}return o(t,"Observable"),t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,a=G$(e)?e:new E0(e,r,n);return Dc(function(){var c=i,u=c.operator,d=c.source;a.add(u?u.call(a,d):d?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=cE(r),new r(function(i,a){var c=new E0({next:function(u){try{e(u)}catch(d){a(d),c.unsubscribe()}},error:a,complete:i});n.subscribe(c)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Oc]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return fE(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=cE(e),new e(function(n,i){var a;r.subscribe(function(c){return a=c},function(c){return i(c)},function(){return n(a)})})},t.create=function(e){return new t(e)},t}();function cE(t){var e;return(e=t??Wi.Promise)!==null&&e!==void 0?e:Promise}o(cE,"getPromiseCtor");function j$(t){return t&&St(t.next)&&St(t.error)&&St(t.complete)}o(j$,"isObserver");function G$(t){return t&&t instanceof al||j$(t)&&x0(t)}o(G$,"isSubscriber");function V$(t){return St(t?.lift)}o(V$,"hasLift");function Dr(t){return function(e){if(V$(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Dr,"operate");function Or(t,e,r,n,i){return new W$(t,e,r,n,i)}o(Or,"createOperatorSubscriber");var W$=function(t){Qr(e,t);function e(r,n,i,a,c,u){var d=t.call(this,r)||this;return d.onFinalize=c,d.shouldUnsubscribe=u,d._next=n?function(v){try{n(v)}catch(y){r.error(y)}}:t.prototype._next,d._error=a?function(v){try{a(v)}catch(y){r.error(y)}finally{this.unsubscribe()}}:t.prototype._error,d._complete=i?function(){try{i()}catch(v){r.error(v)}finally{this.unsubscribe()}}:t.prototype._complete,d}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(al);var uE=kc(function(t){return o(function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Sg=function(t){Qr(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return o(e,"Subject"),e.prototype.lift=function(r){var n=new lE(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new uE},e.prototype.next=function(r){var n=this;Dc(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=tf(n.currentObservers),u=c.next();!u.done;u=c.next()){var d=u.value;d.next(r)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;Dc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;Dc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.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 r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,c=i.isStopped,u=i.observers;return a||c?xg:(this.currentObservers=null,u.push(r),new Js(function(){n.currentObservers=null,rf(u,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,c=n.isStopped;i?r.error(a):c&&r.complete()},e.prototype.asObservable=function(){var r=new Wt;return r.source=this,r},e.create=function(r,n){return new lE(r,n)},e}(Wt);var lE=function(t){Qr(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:xg},e}(Sg);var Mg=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Sg);var Tg={now:function(){return(Tg.delegate||Date).now()},delegate:void 0};var hE=function(t){Qr(e,t);function e(r,n){return t.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},e}(Js);var fl={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=fl.delegate;return i?.setInterval?i.setInterval.apply(i,Vi([t,e],Kn(r))):setInterval.apply(void 0,Vi([t,e],Kn(r)))},clearInterval:function(t){var e=fl.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var dE=function(t){Qr(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var a=this.id,c=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(c,a,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(c,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),fl.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&fl.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,a;try{this.work(r)}catch(c){i=!0,a=c||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,rf(a,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(hE);var Cg=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return o(t,"Scheduler"),t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Tg.now,t}();var pE=function(t){Qr(e,t);function e(r,n){n===void 0&&(n=Cg.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Cg);var J$=new pE(dE),mE=J$;var A0=new Wt(function(t){return t.complete()});function S0(t){return t&&St(t.schedule)}o(S0,"isScheduler");function bE(t){return t[t.length-1]}o(bE,"last");function gE(t){return S0(bE(t))?t.pop():void 0}o(gE,"popScheduler");function vE(t,e){return typeof bE(t)=="number"?t.pop():e}o(vE,"popNumber");var Nc=o(function(t){return t&&typeof t.length=="number"&&typeof t!="function"},"isArrayLike");function M0(t){return St(t?.then)}o(M0,"isPromise");function T0(t){return St(t[Oc])}o(T0,"isInteropObservable");function C0(t){return Symbol.asyncIterator&&St(t?.[Symbol.asyncIterator])}o(C0,"isAsyncIterable");function k0(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(k0,"createInvalidObservableTypeError");function Y$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Y$,"getSymbolIterator");var I0=Y$();function D0(t){return St(t?.[I0])}o(D0,"isIterable");function O0(t){return tE(this,arguments,o(function(){var r,n,i,a;return g0(this,function(c){switch(c.label){case 0:r=t.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,v0(r.read())];case 3:return n=c.sent(),i=n.value,a=n.done,a?[4,v0(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,v0(i)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(O0,"readableStreamLikeToAsyncGenerator");function R0(t){return St(t?.getReader)}o(R0,"isReadableStreamLike");function en(t){if(t instanceof Wt)return t;if(t!=null){if(T0(t))return X$(t);if(Nc(t))return Z$(t);if(M0(t))return Q$(t);if(C0(t))return yE(t);if(D0(t))return eF(t);if(R0(t))return tF(t)}throw k0(t)}o(en,"innerFrom");function X$(t){return new Wt(function(e){var r=t[Oc]();if(St(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(X$,"fromInteropObservable");function Z$(t){return new Wt(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}o(Z$,"fromArrayLike");function Q$(t){return new Wt(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,w0)})}o(Q$,"fromPromise");function eF(t){return new Wt(function(e){var r,n;try{for(var i=tf(t),a=i.next();!a.done;a=i.next()){var c=a.value;if(e.next(c),e.closed)return}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}o(eF,"fromIterable");function yE(t){return new Wt(function(e){rF(t,e).catch(function(r){return e.error(r)})})}o(yE,"fromAsyncIterable");function tF(t){return yE(O0(t))}o(tF,"fromReadableStreamLike");function rF(t,e){var r,n,i,a;return eE(this,void 0,void 0,function(){var c,u;return g0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=rE(t),d.label=1;case 1:return[4,r.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(c=n.value,e.next(c),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&&(a=r.return)?[4,a.call(r)]:[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(rF,"process");function Ei(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var a=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(a),!i)return a}o(Ei,"executeSchedule");function N0(t,e){return e===void 0&&(e=0),Dr(function(r,n){r.subscribe(Or(n,function(i){return Ei(n,t,function(){return n.next(i)},e)},function(){return Ei(n,t,function(){return n.complete()},e)},function(i){return Ei(n,t,function(){return n.error(i)},e)}))})}o(N0,"observeOn");function P0(t,e){return e===void 0&&(e=0),Dr(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}o(P0,"subscribeOn");function xE(t,e){return en(t).pipe(P0(e),N0(e))}o(xE,"scheduleObservable");function wE(t,e){return en(t).pipe(P0(e),N0(e))}o(wE,"schedulePromise");function _E(t,e){return new Wt(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}o(_E,"scheduleArray");function EE(t,e){return new Wt(function(r){var n;return Ei(r,e,function(){n=t[I0](),Ei(r,e,function(){var i,a,c;try{i=n.next(),a=i.value,c=i.done}catch(u){r.error(u);return}c?r.complete():r.next(a)},0,!0)}),function(){return St(n?.return)&&n.return()}})}o(EE,"scheduleIterable");function L0(t,e){if(!t)throw new Error("Iterable cannot be null");return new Wt(function(r){Ei(r,e,function(){var n=t[Symbol.asyncIterator]();Ei(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}o(L0,"scheduleAsyncIterable");function AE(t,e){return L0(O0(t),e)}o(AE,"scheduleReadableStreamLike");function SE(t,e){if(t!=null){if(T0(t))return xE(t,e);if(Nc(t))return _E(t,e);if(M0(t))return wE(t,e);if(C0(t))return L0(t,e);if(D0(t))return EE(t,e);if(R0(t))return AE(t,e)}throw k0(t)}o(SE,"scheduled");function ME(t,e){return e?SE(t,e):en(t)}o(ME,"from");var B0=kc(function(t){return o(function(){t(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function TE(t){return t instanceof Date&&!isNaN(t)}o(TE,"isValidDate");function U0(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){n.next(t.call(e,a,i++))}))})}o(U0,"map");var nF=Array.isArray;function iF(t,e){return nF(e)?t.apply(void 0,Vi([],Kn(e))):t(e)}o(iF,"callOrApply");function CE(t){return U0(function(e){return iF(t,e)})}o(CE,"mapOneOrManyArgs");function kE(t,e,r,n,i,a,c,u){var d=[],v=0,y=0,S=!1,O=o(function(){S&&!d.length&&!v&&e.complete()},"checkComplete"),R=o(function(N){return v<n?I(N):d.push(N)},"outerNext"),I=o(function(N){a&&e.next(N),v++;var J=!1;en(r(N,y++)).subscribe(Or(e,function(L){i?.(L),a?R(L):e.next(L)},function(){J=!0},void 0,function(){if(J)try{v--;for(var L=o(function(){var V=d.shift();c?Ei(e,c,function(){return I(V)}):I(V)},"_loop_1");d.length&&v<n;)L();O()}catch(V){e.error(V)}}))},"doInnerSub");return t.subscribe(Or(e,R,function(){S=!0,O()})),function(){u?.()}}o(kE,"mergeInternals");function cl(t,e,r){return r===void 0&&(r=1/0),St(e)?cl(function(n,i){return U0(function(a,c){return e(n,a,i,c)})(en(t(n,i)))},r):(typeof e=="number"&&(r=e),Dr(function(n,i){return kE(n,i,t,r)}))}o(cl,"mergeMap");function IE(t){return t===void 0&&(t=1/0),cl(Rc,t)}o(IE,"mergeAll");var oF=["addListener","removeListener"],sF=["addEventListener","removeEventListener"],aF=["on","off"];function ul(t,e,r,n){if(St(r)&&(n=r,r=void 0),n)return ul(t,e,r).pipe(CE(n));var i=Kn(uF(t)?sF.map(function(u){return function(d){return t[u](e,d,r)}}):fF(t)?oF.map(DE(t,e)):cF(t)?aF.map(DE(t,e)):[],2),a=i[0],c=i[1];if(!a&&Nc(t))return cl(function(u){return ul(u,e,r)})(en(t));if(!a)throw new TypeError("Invalid event target");return new Wt(function(u){var d=o(function(){for(var v=[],y=0;y<arguments.length;y++)v[y]=arguments[y];return u.next(1<v.length?v:v[0])},"handler");return a(d),function(){return c(d)}})}o(ul,"fromEvent");function DE(t,e){return function(r){return function(n){return t[r](e,n)}}}o(DE,"toCommonHandlerRegistry");function fF(t){return St(t.addListener)&&St(t.removeListener)}o(fF,"isNodeStyleEventEmitter");function cF(t){return St(t.on)&&St(t.off)}o(cF,"isJQueryStyleEventEmitter");function uF(t){return St(t.addEventListener)&&St(t.removeEventListener)}o(uF,"isEventTarget");function ll(t,e,r){t===void 0&&(t=0),r===void 0&&(r=mE);var n=-1;return e!=null&&(S0(e)?r=e:n=e),new Wt(function(i){var a=TE(t)?+t-r.now():t;a<0&&(a=0);var c=0;return r.schedule(function(){i.closed||(i.next(c++),0<=n?this.schedule(void 0,n):i.complete())},a)})}o(ll,"timer");function kg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=gE(t),n=vE(t,1/0),i=t;return i.length?i.length===1?en(i[0]):IE(n)(ME(i,r)):A0}o(kg,"merge");function OE(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){return t.call(e,a,i++)&&n.next(a)}))})}o(OE,"filter");function RE(t){return Dr(function(e,r){var n=!1;e.subscribe(Or(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}o(RE,"defaultIfEmpty");function NE(t){return t<=0?function(){return A0}:Dr(function(e,r){var n=0;e.subscribe(Or(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}o(NE,"take");function PE(t){return t===void 0&&(t=lF),Dr(function(e,r){var n=!1;e.subscribe(Or(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}o(PE,"throwIfEmpty");function lF(){return new B0}o(lF,"defaultErrorFactory");function Ig(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?OE(function(i,a){return t(i,a,n)}):Rc,NE(1),r?RE(e):PE(function(){return new B0}))}}o(Ig,"first");var hF={leading:!0,trailing:!1};function Dg(t,e){return e===void 0&&(e=hF),Dr(function(r,n){var i=e.leading,a=e.trailing,c=!1,u=null,d=null,v=!1,y=o(function(){d?.unsubscribe(),d=null,a&&(R(),v&&n.complete())},"endThrottling"),S=o(function(){d=null,v&&n.complete()},"cleanupThrottling"),O=o(function(I){return d=en(t(I)).subscribe(Or(n,y,S))},"startThrottle"),R=o(function(){if(c){c=!1;var I=u;u=null,n.next(I),!v&&O(I)}},"send");r.subscribe(Or(n,function(I){c=!0,u=I,!(d&&!d.closed)&&(i?R():O(I))},function(){v=!0,!(a&&c&&d&&!d.closed)&&n.complete()}))})}o(Dg,"throttle");var LE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(LE||(LE={}));var hl;(function(t){t[t.NOT_REQUESTED=0]="NOT_REQUESTED",t[t.PENDING=1]="PENDING",t[t.PROCESSING=2]="PROCESSING",t[t.ANCHORED=3]="ANCHORED",t[t.FAILED=4]="FAILED"})(hl||(hl={}));var Rg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(Rg||(Rg={}));var ss=class extends Wt{constructor(e,r){super(n=>{e.subscribe(n)}),this.state$=e,this._context=r}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:r}=this.state$.value;return(0,Og.default)(e?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Nt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Nt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Rg.ANCHOR).map(({cid:e})=>Nt.make(this.id,e))}get state(){return(0,Og.default)(this.state$.value)}async sync(e={}){e={sync:yr.PREFER_CACHE,...e};let r=await this.api.loadStream(this.id,e);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(ss,"Stream");function Pc(){return t=>{}}o(Pc,"StreamStatic");var HE=Pt($E(),1);function FE(t){let e=new AbortController;if(t.length===0)throw Error("Need abort signals to create a merged abort signal");return t.some(r=>r.aborted)?(e.abort(),e.signal):(kg(...t.map(r=>ul(r,"abort"))).pipe(Ig()).subscribe(()=>{e.abort()}),e.signal)}o(FE,"mergeAbortSignals");var dl=class{constructor(e){let r=new AbortController;if(this.signal=r.signal,e<=0){r.abort();return}this._subscription=ll(e).subscribe(()=>{r.abort()})}clear(){this._subscription?.unsubscribe()}};o(dl,"TimedAbortSignal");async function qE(t,e){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return t.addEventListener("abort",n),t.aborted&&r.abort(),e(r.signal).finally(()=>{t.removeEventListener("abort",n)})}o(qE,"abortable");var dF=60*1e3*3;async function Hr(t,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let r=e.timeout||dF,n=new dl(r),i=e.signal?FE([e.signal,n.signal]):n.signal,a=await qE(i,c=>(0,HE.default)(String(t),{...e,signal:c})).finally(()=>n.clear());if(!a.ok){let c=await a.text();throw new Error(`HTTP request to '${t}' failed with status '${a.statusText}': ${c}`)}return a.json()}o(Hr,"fetchJson");var pl=Pt(Ec(),1);Pi();function fs(t){let e=We.asCID(t);if(e)return e;if(typeof t=="string")return We.parse(t);if(t instanceof Uint8Array)return We.decode(t);throw new Error(`${t} cannot be converted to a CID`)}o(fs,"toCID");var zE=0,Xt=class{static streamIdFromState(e){return new rt(e.type,e.log[0].cid)}static serializeCommit(e){let r=(0,pl.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=r.jws.link.toString(),r.linkedBlock=kt(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=kt(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(e)&&(r.link=r.link.toString()),Xt.isAnchorCommit(e)&&(r.proof=r.proof.toString()),r.id&&(r.id=r.id.toString()),r.prev&&(r.prev=r.prev.toString()),e.header?.model&&(r.header.model=kt(e.header.model,"base64")),r)}static deserializeCommit(e){let r=(0,pl.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=fs(r.jws.link),r.linkedBlock=Bt(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=Bt(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(r)&&(r.link=fs(r.link)),Xt.isAnchorCommit(r)&&(r.proof=fs(r.proof)),r.id&&(r.id=fs(r.id)),r.prev&&(r.prev=fs(r.prev)),r.header?.model&&(r.header.model=Bt(r.header.model,"base64")),r)}static serializeState(e){let r=(0,pl.default)(e);return r.log=r.log.map(n=>({...n,cid:n.cid.toString()})),r.anchorStatus!=null&&(r.anchorStatus=hl[r.anchorStatus]),r.anchorProof!=null&&(r.anchorProof.txHash=r.anchorProof.txHash.toString(),r.anchorProof.root=r.anchorProof.root.toString()),e.metadata?.model&&(r.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(r.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=zE&&(r.metadata.unique=kt(r.metadata.unique,"base64")),r.doctype=En.nameByCode(r.type),r}static deserializeState(e){if(!e)return null;let r=(0,pl.default)(e);return r.doctype&&(r.type=En.codeByName(r.doctype),delete r.doctype),r.log=r.log.map(n=>({...n,cid:fs(n.cid)})),r.anchorProof&&(r.anchorProof.txHash=fs(r.anchorProof.txHash),r.anchorProof.root=fs(r.anchorProof.root)),r.anchorStatus&&(r.anchorStatus=hl[r.anchorStatus]),e.metadata?.model&&(r.metadata.model=rt.fromString(e.metadata.model)),e.next?.metadata?.model&&(r.next.metadata.model=rt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=zE&&(r.metadata.unique=Bt(e.metadata.unique,"base64")),r}static statesEqual(e,r){return JSON.stringify(Xt.serializeState(e))===JSON.stringify(Xt.serializeState(r))}static isStateSupersetOf(e,r){if(e.log.length<r.log.length)return!1;for(let n in r.log)if(!e.log[n].cid.equals(r.log[n].cid))return!1;return!(e.log.length===r.log.length&&e.anchorStatus!=r.anchorStatus)}static assertCommitLinksToState(e,r){let n=this.streamIdFromState(e);if(r.id&&!r.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${r.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!r.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${r.prev}`)}static async convertCommitToSignedCommitContainer(e,r){if(Xt.isSignedCommit(e)){let n=await r.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(Xt,"StreamUtils");var ml=class extends Mg{next(e){let r=this.value;Xt.statesEqual(r,e)||super.next(e)}};o(ml,"StreamStateSubject");var pF=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},jn,Ng={anchor:!0,publish:!0,pin:!0,sync:yr.PREFER_CACHE},mF={sync:yr.PREFER_CACHE},KE={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Pg(t,e){if(typeof t?.schema=="string")try{Nt.fromString(t.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:t?.controllers,family:t?.family,schema:t?.schema?.toString(),tags:t?.tags};if(e)t?.deterministic||(r.unique=kt((0,VE.randomBytes)(12),"base64")),t?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(t?.deterministic!==void 0||t?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(t?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}o(Pg,"headerFromMetadata");async function jE(t){if(!t.did)throw new Error("No DID provided");return t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`)),t.did}o(jE,"getAuthenticatedDID");async function Lg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Lg,"throwReadOnlyError");var Gn=jn=o(class extends ss{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,GE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(e,r,n,i={}){i={...Ng,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let a=i.asDID?{did:i.asDID}:e,c=await jn.makeGenesis(a,r,n);return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,c,i)}static async createFromGenesis(e,r,n={}){n={...Ng,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=r.data?await jn._signDagJWS(e,r):r;return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,i,n)}static async deterministic(e,r,n={}){if(n={...Ng,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let i=await jn.makeGenesis(e,null,r);return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,i,n)}static async load(e,r,n={}){n={...mF,...n};let i=fn.from(r);if(i.type!=jn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${jn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,r,n={}){n={...KE,...n};let i=n.asDID?{did:n.asDID}:this.api,a=await this.makeCommit(i,e,r),c=await this.api.applyCommit(this.id,a,n);this.state$.next(c.state)}async patch(e,r={}){r={...KE,...r};let i={header:Pg(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=await jn._signDagJWS(this.api,i),c=await this.api.applyCommit(this.id,a,r);this.state$.next(c.state)}makeReadOnly(){this.update=Lg,this.patch=Lg,this.sync=Lg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,r,n){let i=await this._makeRawCommit(r,n);return jn._signDagJWS(e,i)}async _makeRawCommit(e,r){r||(r={});let n=Pg(r,!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=t0.compare(this.content,e),a=this.state.log[0];return{header:n,data:i,prev:this.tip,id:a.cid}}static async makeGenesis(e,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let c=await jE(e);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=Pg(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:i};return Fa(c),c}let a={data:r,header:i};return jn._signDagJWS(e,a)}static async _signDagJWS(e,r){return(await jE(e)).createDagJWS(r)}},"TileDocument");Gn.STREAM_TYPE_NAME="tile";Gn.STREAM_TYPE_ID=0;Gn=jn=pF([Pc()],Gn);var e9=Pt(YE(),1);function SF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(SF,"_checkPrivateRedeclaration");function MF(t,e){return e.get?e.get.call(t):e.value}o(MF,"_classApplyDescriptorGet");function TF(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}o(TF,"_classApplyDescriptorSet");function QE(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(QE,"_classExtractFieldDescriptor");function Fg(t,e){var r=QE(t,e,"get");return MF(t,r)}o(Fg,"_classPrivateFieldGet");function XE(t,e,r){SF(t,e),e.set(t,r)}o(XE,"_classPrivateFieldInit");function ZE(t,e,r){var n=QE(t,e,"set");return TF(t,n,r),r}o(ZE,"_classPrivateFieldSet");function CF(t){return typeof t=="string"||Nt.isInstance(t)||rt.isInstance(t)?{streamId:t}:{streamId:t.streamId,genesis:t.genesis}}o(CF,"keyToQuery");function qg(t){return typeof t=="string"?fn.from(t).toString():Nt.isInstance(t)||rt.isInstance(t)?t.toString():t.streamId.toString()}o(qg,"keyToString");async function kF(t){let e=await Gn.makeGenesis({},null,{...t,deterministic:!0}),r=await rt.fromGenesis("tile",e);return{genesis:e,streamId:r}}o(kF,"getDeterministicQuery");var IF=o(()=>Promise.resolve([]),"tempBatchLoadFn"),F0=new WeakMap,Hg=new WeakMap,bl=class extends e9.default{cache(e){if(!Fg(this,Hg))return!1;let r=e.id.toString();return this.clear(r).prime(r,e),!0}async create(e,r,n){let i=await Gn.create(Fg(this,F0),e,r,n);return this.cache(i),i}async deterministic(e,r){let n=await kF(e);try{return await super.load(n)}catch{let a=await Gn.createFromGenesis(Fg(this,F0),n.genesis,r);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,r,n,i){let a=qg(e);this.clear(a);let c=await this.load({streamId:a});return await c.update(r,n,i),c}constructor(e){super(IF,{cache:!0,cacheKeyFn:qg,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),XE(this,F0,{writable:!0,value:void 0}),XE(this,Hg,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(r.map(CF),e.multiqueryTimeout);return r.map(i=>{let a=qg(i),c=n[a];return c||new Error(`Failed to load stream: ${a}`)})},ZE(this,F0,e.ceramic),ZE(this,Hg,!!e.cache)}};o(bl,"TileLoader");function zg(t){return typeof t=="string"?rt.fromString(t):t}o(zg,"typeStreamID");function t9(t,e){let r=new URL(t);for(let[n,i]of Object.entries(e))rt.isInstance(i)?r.searchParams.set(n,i.toString()):typeof i=="object"?r.searchParams.set(n,JSON.stringify(i)):r.searchParams.set(n,i);return r}o(t9,"serializeObjectToSearchParams");function Kg(t){let e={};for(let[r,n]of Object.entries(t))rt.isInstance(n)?e[r]=n.toString():e[r]=n;return e}o(Kg,"serializeObjectForHttpPost");var tn=class extends Wt{constructor(e,r,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=ll(0,n).pipe(Dg(()=>this._syncState(this.id,{sync:yr.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new ml(e),this._apiUrl=new URL(r)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,r){let n=await tn._load(e,this._apiUrl,r);this.state$.next(Xt.deserializeState(n))}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,r,n,i,a){let c=new URL("./streams",e),{state:u}=await Hr(c,{method:"post",body:{type:r,genesis:Xt.serializeCommit(n),opts:i}});return new tn(Xt.deserializeState(u),e,a)}static async applyCommit(e,r,n,i,a){let c=new URL("./commits",e),{state:u}=await Hr(c,{method:"post",body:{streamId:r.toString(),commit:Xt.serializeCommit(n),opts:i}});return new tn(Xt.deserializeState(u),e,a)}static async _load(e,r,n){let i=t9(new URL(`./streams/${e}`,r),n),{state:a}=await Hr(i);return a}static async load(e,r,n,i){let a=await tn._load(e,r,i);return new tn(Xt.deserializeState(a),r,n)}static async loadStreamCommits(e,r){let n=new URL(`./commits/${e}`,r),{commits:i}=await Hr(n);return i.map(a=>({cid:a.cid,value:Xt.deserializeCommit(a.value)}))}complete(){this.state$.complete()}};o(tn,"Document");var of;(function(t){t[t.PREFER_CACHE=0]="PREFER_CACHE",t[t.SYNC_ALWAYS=1]="SYNC_ALWAYS",t[t.NEVER_SYNC=2]="NEVER_SYNC",t[t.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(of||(of={}));var jg=Pt(Ec(),1);var r9;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(r9||(r9={}));var n9;(function(t){t[t.NOT_REQUESTED=0]="NOT_REQUESTED",t[t.PENDING=1]="PENDING",t[t.PROCESSING=2]="PROCESSING",t[t.ANCHORED=3]="ANCHORED",t[t.FAILED=4]="FAILED"})(n9||(n9={}));var Gg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(Gg||(Gg={}));var gl=class extends Wt{constructor(e,r){super(n=>{e.subscribe(n)}),this.state$=e,this._context=r}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:r}=this.state$.value;return(0,jg.default)(e?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Nt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Nt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Gg.ANCHOR).map(({cid:e})=>Nt.make(this.id,e))}get state(){return(0,jg.default)(this.state$.value)}async sync(e={}){e={sync:of.PREFER_CACHE,...e};let r=await this.api.loadStream(this.id,e);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(gl,"Stream");function i9(){return t=>{}}o(i9,"StreamStatic");function o9(t){if(typeof t=="string"&&t.includes("@")){let[e,r]=t.split("@");if(!e||!r)throw new Error("Invalid accountId provided");return new zs({address:e,chainId:r})}return new zs(t)}o(o9,"normalizeAccountId");var a9=Pt(Ec(),1);var DF=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},sf,Vg=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),s9={anchor:!1,publish:!0,pin:!0,sync:of.PREFER_CACHE},Wg={anchor:!0,publish:!0},OF={sync:of.PREFER_CACHE},af=sf=o(class extends gl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,a9.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(e,r,n={}){n={...s9,...n};let i=o9(r),a=sf.makeGenesis(i);return sf.fromGenesis(e,a,n)}static async fromGenesis(e,r,n={}){return n={...s9,...n},e.createStreamFromGenesis(sf.STREAM_TYPE_ID,r,n)}async setDid(e,r,n={}){n={...Wg,...n};let i=typeof e=="string"?e.trim():e.id;if(hm(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let c=await r.createLink(i);return this.setDidProof(c,n)}async setDidProof(e,r={}){r={...Wg,...r};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,r);this.state$.next(i.state)}async clearDid(e,r={}){r={...Wg,...r};let n=await e.createLink("");return this.setDidProof(n,r)}static async load(e,r,n={}){n={...OF,...n};let i=fn.from(r);if(i.type!=sf.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${sf.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=Vg,this.setDid=Vg,this.sync=Vg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");af.STREAM_TYPE_NAME="caip10-link";af.STREAM_TYPE_ID=1;af=sf=DF([i9()],af);Pi();Ea();var z9=Pt(q9(),1);var Sq=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},xo,Mq={sync:yr.PREFER_CACHE};async function H9(t){if(t.did==null)throw new Error("No DID provided");t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`))}o(H9,"_ensureAuthenticated");async function Tq(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Tq,"throwReadOnlyError");var Ys=xo=o(class extends ss{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:xo.MODEL}}static async create(e,r,n){xo.assertComplete(r);let i={publish:!0,anchor:!0,pin:!0,sync:yr.NEVER_SYNC,throwOnInvalidCommit:!0},a=await xo._makeGenesis(e,r,n);return await e.createStreamFromGenesis(xo.STREAM_TYPE_ID,a,i)}static assertComplete(e,r){if(!e.name)throw r?new Error(`Model with StreamID ${r.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw r?new Error(`Model ${e.name} (${r.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw r?new Error(`Model ${e.name} (${r.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static async load(e,r,n={}){n={...Mq,...n};let i=fn.from(r);if(i.type!=xo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${xo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,r,n){let i=await this._makeRawGenesis(e,r,n);return xo._signDagJWS(e,i)}static async _makeRawGenesis(e,r,n){if(r==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await H9(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:xo.MODEL.bytes};return{data:r,header:i}}makeReadOnly(){this.sync=Tq,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,r){return await H9(e),e.did.createDagJWS(r)}},"Model");Ys.STREAM_TYPE_NAME="model";Ys.STREAM_TYPE_ID=2;Ys.MODEL=function(){let t=Fa("model-v1"),e=z9.default.encode(t,"identity"),r=Ho(sc,e),n=We.createV1(sc,r);return new rt("UNLOADABLE",n)}();Ys=xo=Sq([Pc()],Ys);var G9=Pt(Da(),1);var Cq=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ji,kq={anchor:!0,publish:!0,pin:!0,sync:yr.NEVER_SYNC,syncTimeoutSeconds:0},Iq={anchor:!1,publish:!1,pin:!0,sync:yr.PREFER_CACHE},Dq={sync:yr.PREFER_CACHE},K9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function j9(t){if(t.did==null)throw new Error("No DID provided");t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`))}o(j9,"_ensureAuthenticated");async function Xg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Xg,"throwReadOnlyError");var cf=Ji=o(class extends ss{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,r,n,i={}){i={...kq,...i};let a=i.asDID?{did:i.asDID}:e,c=await Ji._makeGenesis(a,r,n);return e.createStreamFromGenesis(Ji.STREAM_TYPE_ID,c,i)}static async single(e,r,n={}){n={...Iq,...n};let i=n.asDID?{did:n.asDID}:e;r={...r,deterministic:!0};let a=await Ji._makeGenesis(i,null,r);return e.createStreamFromGenesis(Ji.STREAM_TYPE_ID,a,n)}static async load(e,r,n={}){n={...Dq,...n};let i=fn.from(r);if(i.type!=Ji.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ji.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,r={}){r={...K9,...r};let n=r.asDID?{did:r.asDID}:this.api,i=await this._makeCommit(n,e),a=await this.api.applyCommit(this.id,i,r);this.state$.next(a.state)}async patch(e,r={}){r={...K9,...r};let n={data:e,prev:this.tip,id:this.id.cid},i=await Ji._signDagJWS(this.api,n),a=await this.api.applyCommit(this.id,i,r);this.state$.next(a.state)}makeReadOnly(){this.replace=Xg,this.patch=Xg,this.sync=Xg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,r){let n=this._makeRawCommit(r);return Ji._signDagJWS(e,n)}_makeRawCommit(e){return{data:t0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,r,n){let i=await this._makeRawGenesis(e,r,n);return n.deterministic?(Fa(i),i):Ji._signDagJWS(e,i)}static async _makeRawGenesis(e,r,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 j9(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let a={controllers:[i],model:n.model.bytes};return n.deterministic||(a.unique=(0,G9.randomBytes)(12)),{data:r,header:a}}static async _signDagJWS(e,r){return await j9(e),e.did.createDagJWS(r)}},"ModelInstanceDocument");cf.STREAM_TYPE_NAME="MID";cf.STREAM_TYPE_ID=3;cf=Ji=Cq([Pc()],cf);var xl=class{constructor(e){this._apiUrl=e}async add(e,r){let n={};r&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await Hr(i,{method:"post",body:n})}async rm(e,r){let n=new URL(`./pins/${e}`,this._apiUrl);await Hr(n,{method:"delete",body:{opts:r}})}async ls(e){let r=new URL("./pins",this._apiUrl);e&&(r=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await Hr(r),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[a++],done:!1})}}}}}};o(xl,"RemotePinApi");var wl=class{constructor(e){this._fetchJson=Hr,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:Kg(e)})).count}async query(e){let r=await this._fetchJson(this._collectionURL,{method:"POST",body:Kg(e)});return{edges:r.edges.map(i=>({cursor:i.cursor,node:Xt.deserializeState(i.node)})),pageInfo:r.pageInfo}}};o(wl,"RemoteIndexApi");var _l=class{constructor(e,r){this._apiUrl=e,this._getDidFn=r,this._fetchJson=Hr,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,r,n){let i=n?{models:n.map(c=>c.toString())}:void 0,a=await e.createJWS({code:r,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${a.signatures[0].protected}.${a.payload}.${a.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let r=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),r,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=>rt.fromString(n))}async stopIndexingModels(e){let r=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),r,e)}})}};o(_l,"RemoteAdminApi");var Oq="/api/v0/",Rq="http://localhost:7007",Nq={syncInterval:5e3},Pq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},Lq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},V9={sync:yr.PREFER_CACHE},El=class{constructor(e=Rq,r={}){this._config={...Nq,...r},this._apiUrl=new URL(Oq,e),this._streamCache=new Map,this.context={api:this},this.pin=new xl(this._apiUrl),this.index=new wl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new _l(this._apiUrl,n),this._streamConstructors={[af.STREAM_TYPE_ID]:af,[Ys.STREAM_TYPE_ID]:Ys,[cf.STREAM_TYPE_ID]:cf,[Gn.STREAM_TYPE_ID]:Gn}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,r,n={}){n={...Lq,...n};let i=await tn.createFromGenesis(this._apiUrl,e,r,n,this._config.syncInterval),a=this._streamCache.get(i.id.toString());return a?(Xt.statesEqual(i.state,a.state)||a.next(i.state),this.buildStreamFromDocument(a)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,r={}){r={...V9,...r};let n=fn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,r):(i=await tn.load(n,this._apiUrl,this._config.syncInterval,r),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,r){let n=e.map(c=>({...c,streamId:typeof c.streamId=="string"?c.streamId:c.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),a=await Hr(i,{method:"post",body:{queries:n,timeout:r}});return Object.entries(a).reduce((c,u)=>{let[d,v]=u,y=Xt.deserializeState(v),S=new tn(y,this._apiUrl,this._config.syncInterval);return c[d]=this.buildStreamFromDocument(S),c},{})}loadStreamCommits(e){let r=zg(e);return tn.loadStreamCommits(r,this._apiUrl)}async applyCommit(e,r,n={}){n={...Pq,...n};let i=zg(e),a=await tn.applyCommit(this._apiUrl,i,r,n,this._config.syncInterval),c=this._streamCache.get(i.toString());return c?(c.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(i.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,r={}){r={...V9,...r};let{anchorStatus:n}=await Hr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:r}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let r=new tn(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(r)}buildStreamFromDocument(e){let r=e.state.type,n=this._streamConstructors[r];if(!n)throw new Error(`Failed to find constructor for stream ${r}`);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 Hr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(El,"CeramicClient");var zt;(function(t){t.assertEqual=i=>i;function e(i){}o(e,"assertIs"),t.assertIs=e;function r(i){throw new Error}o(r,"assertNever"),t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let c of i)a[c]=c;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),c={};for(let u of a)c[u]=i[u];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&a.push(c);return a},t.find=(i,a)=>{for(let c of i)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}o(n,"joinValues"),t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(zt||(zt={}));var Fe=zt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xs=o(t=>{switch(typeof t){case"undefined":return Fe.undefined;case"string":return Fe.string;case"number":return isNaN(t)?Fe.nan:Fe.number;case"boolean":return Fe.boolean;case"function":return Fe.function;case"bigint":return Fe.bigint;case"symbol":return Fe.symbol;case"object":return Array.isArray(t)?Fe.array:t===null?Fe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Fe.promise:typeof Map<"u"&&t instanceof Map?Fe.map:typeof Set<"u"&&t instanceof Set?Fe.set:typeof Date<"u"&&t instanceof Date?Fe.date:Fe.object;default:return Fe.unknown}},"getParsedType"),Re=zt.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"]),Bq=o(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ai=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 r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=o(a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let u=n,d=0;for(;d<c.path.length;){let v=c.path[d];d===c.path.length-1?(u[v]=u[v]||{_errors:[]},u[v]._errors.push(r(c))):u[v]=u[v]||{_errors:[]},u=u[v],d++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,zt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(Ai,"ZodError");Ai.create=t=>new Ai(t);var Sl=o((t,e)=>{let r;switch(t.code){case Re.invalid_type:t.received===Fe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Re.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,zt.jsonStringifyReplacer)}`;break;case Re.unrecognized_keys:r=`Unrecognized key(s) in object: ${zt.joinValues(t.keys,", ")}`;break;case Re.invalid_union:r="Invalid input";break;case Re.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${zt.joinValues(t.options)}`;break;case Re.invalid_enum_value:r=`Invalid enum value. Expected ${zt.joinValues(t.options)}, received '${t.received}'`;break;case Re.invalid_arguments:r="Invalid function arguments";break;case Re.invalid_return_type:r="Invalid function return type";break;case Re.invalid_date:r="Invalid date";break;case Re.invalid_string:typeof t.validation=="object"?"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:zt.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Re.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(t.minimum)}`:r="Invalid input";break;case Re.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(t.maximum)}`:r="Invalid input";break;case Re.custom:r="Invalid input";break;case Re.invalid_intersection_types:r="Intersection results could not be merged";break;case Re.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Re.not_finite:r="Number must be finite";break;default:r=e.defaultError,zt.assertNever(t)}return{message:r}},"errorMap"),Y9=Sl;function Uq(t){Y9=t}o(Uq,"setErrorMap");function G0(){return Y9}o(G0,"getErrorMap");var V0=o(t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],c={...i,path:a},u="",d=n.filter(v=>!!v).slice().reverse();for(let v of d)u=v(c,{data:e,defaultError:u}).message;return{...i,path:a,message:i.message||u}},"makeIssue"),$q=[];function Ke(t,e){let r=V0({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,G0(),Sl].filter(n=>!!n)});t.common.issues.push(r)}o(Ke,"addIssueToContext");var Rr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){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,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Rr.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:c}=i;if(a.status==="aborted"||c.status==="aborted")return gt;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),(typeof c.value<"u"||i.alwaysSet)&&(n[a.value]=c.value)}return{status:e.value,value:n}}};o(Rr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),X9=o(t=>({status:"dirty",value:t}),"DIRTY"),rn=o(t=>({status:"valid",value:t}),"OK"),Zg=o(t=>t.status==="aborted","isAborted"),Qg=o(t=>t.status==="dirty","isDirty"),W0=o(t=>t.status==="valid","isValid"),J0=o(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),It;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(It||(It={}));var Vn=class{constructor(e,r,n,i){this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(Vn,"ParseInputLazyPath");var W9=o((t,e)=>{if(W0(e))return{success:!0,data:e.value};{if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Ai(t.common.issues);return{success:!1,error:r}}},"handleResult");function _t(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||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((c,u)=>c.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:n??u.defaultError}:{message:r??u.defaultError},"customMap"),description:i}}o(_t,"processCreateParams");var xt=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Xs(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Xs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rr,ctx:{common:e.parent.common,data:e.data,parsedType:Xs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(J0(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xs(e)},a=this._parseSync({data:e,path:i.path,parent:i});return W9(i,a)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xs(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(J0(i)?i:Promise.resolve(i));return W9(n,a)}refine(e,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,a)=>{let c=e(i),u=o(()=>a.addIssue({code:Re.custom,...n(i)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mn({schema:this,typeName:pt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ti.create(this,this._def)}nullable(){return Ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sn.create(this,this._def)}promise(){return hs.create(this,this._def)}or(e){return ra.create([this,e],this._def)}and(e){return na.create(this,e,this._def)}transform(e){return new Mn({..._t(this._def),schema:this,typeName:pt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new fa({..._t(this._def),innerType:this,defaultValue:r,typeName:pt.ZodDefault})}brand(){return new Al({typeName:pt.ZodBranded,type:this,..._t(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new pf({..._t(this._def),innerType:this,catchValue:r,typeName:pt.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ca.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(xt,"ZodType");var Fq=/^c[^\s-]{8,}$/i,qq=/^[a-z][a-z0-9]*$/,Hq=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,zq=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/,Kq=o(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Si=class extends xt{constructor(){super(...arguments),this._regex=(e,r,n)=>this.refinement(i=>e.test(i),{validation:r,code:Re.invalid_string,...It.errToObj(n)}),this.nonempty=e=>this.min(1,It.errToObj(e)),this.trim=()=>new Si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Fe.string){let a=this._getOrReturnCtx(e);return Ke(a,{code:Re.invalid_type,expected:Fe.string,received:a.parsedType}),gt}let n=new Rr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let c=e.data.length>a.value,u=e.data.length<a.value;(c||u)&&(i=this._getOrReturnCtx(e,i),c?Ke(i,{code:Re.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):u&&Ke(i,{code:Re.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")zq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"email",code:Re.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Hq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"uuid",code:Re.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Fq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"cuid",code:Re.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")qq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"cuid2",code:Re.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ke(i,{validation:"url",code:Re.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"regex",code:Re.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Kq(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.invalid_string,validation:"datetime",message:a.message}),n.dirty()):zt.assertNever(a);return{status:n.value,value:e.data}}_addCheck(e){return new Si({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...It.errToObj(e)})}url(e){return this._addCheck({kind:"url",...It.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...It.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...It.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...It.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...It.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...It.errToObj(r)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...It.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...It.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...It.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...It.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...It.errToObj(r)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};o(Si,"ZodString");Si.create=t=>{var e;return new Si({checks:[],typeName:pt.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,..._t(t)})};function jq(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)}o(jq,"floatSafeRemainder");var Yi=class extends xt{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)!==Fe.number){let a=this._getOrReturnCtx(e);return Ke(a,{code:Re.invalid_type,expected:Fe.number,received:a.parsedType}),gt}let n,i=new Rr;for(let a of this._def.checks)a.kind==="int"?zt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:Re.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Re.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Re.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?jq(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Re.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:Re.not_finite,message:a.message}),i.dirty()):zt.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,It.toString(r))}gt(e,r){return this.setLimit("min",e,!1,It.toString(r))}lte(e,r){return this.setLimit("max",e,!0,It.toString(r))}lt(e,r){return this.setLimit("max",e,!1,It.toString(r))}setLimit(e,r,n,i){return new Yi({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:It.toString(i)}]})}_addCheck(e){return new Yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:It.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:It.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:It.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:It.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:It.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:It.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:It.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&zt.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};o(Yi,"ZodNumber");Yi.create=t=>new Yi({checks:[],typeName:pt.ZodNumber,coerce:t?.coerce||!1,..._t(t)});var Zs=class extends xt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Fe.bigint){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.bigint,received:n.parsedType}),gt}return rn(e.data)}};o(Zs,"ZodBigInt");Zs.create=t=>{var e;return new Zs({typeName:pt.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,..._t(t)})};var Qs=class extends xt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Fe.boolean){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.boolean,received:n.parsedType}),gt}return rn(e.data)}};o(Qs,"ZodBoolean");Qs.create=t=>new Qs({typeName:pt.ZodBoolean,coerce:t?.coerce||!1,..._t(t)});var wo=class extends xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Fe.date){let a=this._getOrReturnCtx(e);return Ke(a,{code:Re.invalid_type,expected:Fe.date,received:a.parsedType}),gt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Ke(a,{code:Re.invalid_date}),gt}let n=new Rr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Re.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):zt.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new wo({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:It.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:It.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};o(wo,"ZodDate");wo.create=t=>new wo({checks:[],coerce:t?.coerce||!1,typeName:pt.ZodDate,..._t(t)});var uf=class extends xt{_parse(e){if(this._getType(e)!==Fe.symbol){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.symbol,received:n.parsedType}),gt}return rn(e.data)}};o(uf,"ZodSymbol");uf.create=t=>new uf({typeName:pt.ZodSymbol,..._t(t)});var ea=class extends xt{_parse(e){if(this._getType(e)!==Fe.undefined){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.undefined,received:n.parsedType}),gt}return rn(e.data)}};o(ea,"ZodUndefined");ea.create=t=>new ea({typeName:pt.ZodUndefined,..._t(t)});var ta=class extends xt{_parse(e){if(this._getType(e)!==Fe.null){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.null,received:n.parsedType}),gt}return rn(e.data)}};o(ta,"ZodNull");ta.create=t=>new ta({typeName:pt.ZodNull,..._t(t)});var us=class extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return rn(e.data)}};o(us,"ZodAny");us.create=t=>new us({typeName:pt.ZodAny,..._t(t)});var _o=class extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rn(e.data)}};o(_o,"ZodUnknown");_o.create=t=>new _o({typeName:pt.ZodUnknown,..._t(t)});var Mi=class extends xt{_parse(e){let r=this._getOrReturnCtx(e);return Ke(r,{code:Re.invalid_type,expected:Fe.never,received:r.parsedType}),gt}};o(Mi,"ZodNever");Mi.create=t=>new Mi({typeName:pt.ZodNever,..._t(t)});var lf=class extends xt{_parse(e){if(this._getType(e)!==Fe.undefined){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.void,received:n.parsedType}),gt}return rn(e.data)}};o(lf,"ZodVoid");lf.create=t=>new lf({typeName:pt.ZodVoid,..._t(t)});var Sn=class extends xt{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==Fe.array)return Ke(r,{code:Re.invalid_type,expected:Fe.array,received:r.parsedType}),gt;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(c||u)&&(Ke(r,{code:c?Re.too_big:Re.too_small,minimum:u?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Ke(r,{code:Re.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Ke(r,{code:Re.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,u)=>i.type._parseAsync(new Vn(r,c,r.path,u)))).then(c=>Rr.mergeArray(n,c));let a=[...r.data].map((c,u)=>i.type._parseSync(new Vn(r,c,r.path,u)));return Rr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new Sn({...this._def,minLength:{value:e,message:It.toString(r)}})}max(e,r){return new Sn({...this._def,maxLength:{value:e,message:It.toString(r)}})}length(e,r){return new Sn({...this._def,exactLength:{value:e,message:It.toString(r)}})}nonempty(e){return this.min(1,e)}};o(Sn,"ZodArray");Sn.create=(t,e)=>new Sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pt.ZodArray,..._t(e)});var Y0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Y0||(Y0={}));function Fc(t){if(t instanceof nr){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ti.create(Fc(n))}return new nr({...t._def,shape:()=>e})}else return t instanceof Sn?Sn.create(Fc(t.element)):t instanceof Ti?Ti.create(Fc(t.unwrap())):t instanceof Ao?Ao.create(Fc(t.unwrap())):t instanceof Wn?Wn.create(t.items.map(e=>Fc(e))):t}o(Fc,"deepPartialify");var nr=class extends xt{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(),r=zt.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Fe.object){let v=this._getOrReturnCtx(e);return Ke(v,{code:Re.invalid_type,expected:Fe.object,received:v.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Mi&&this._def.unknownKeys==="strip"))for(let v in i.data)c.includes(v)||u.push(v);let d=[];for(let v of c){let y=a[v],S=i.data[v];d.push({key:{status:"valid",value:v},value:y._parse(new Vn(i,S,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Mi){let v=this._def.unknownKeys;if(v==="passthrough")for(let y of u)d.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(v==="strict")u.length>0&&(Ke(i,{code:Re.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 y of u){let S=i.data[y];d.push({key:{status:"valid",value:y},value:v._parse(new Vn(i,S,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let v=[];for(let y of d){let S=await y.key;v.push({key:S,value:await y.value,alwaysSet:y.alwaysSet})}return v}).then(v=>Rr.mergeObjectSync(n,v)):Rr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return It.errToObj,new nr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,c,u;let d=(c=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(u=It.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new nr({...this._def,unknownKeys:"strip"})}passthrough(){return new nr({...this._def,unknownKeys:"passthrough"})}extend(e){return new nr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Y0.mergeShapes(this._def.shape(),e._def.shape()),typeName:pt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new nr({...this._def,catchall:e})}pick(e){let r={};return zt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new nr({...this._def,shape:()=>r})}omit(e){let r={};return zt.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new nr({...this._def,shape:()=>r})}deepPartial(){return Fc(this)}partial(e){let r={};return zt.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new nr({...this._def,shape:()=>r})}required(e){let r={};return zt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Ti;)a=a._def.innerType;r[n]=a}}),new nr({...this._def,shape:()=>r})}keyof(){return Z9(zt.objectKeys(this.shape))}};o(nr,"ZodObject");nr.create=(t,e)=>new nr({shape:()=>t,unknownKeys:"strip",catchall:Mi.create(),typeName:pt.ZodObject,..._t(e)});nr.strictCreate=(t,e)=>new nr({shape:()=>t,unknownKeys:"strict",catchall:Mi.create(),typeName:pt.ZodObject,..._t(e)});nr.lazycreate=(t,e)=>new nr({shape:t,unknownKeys:"strip",catchall:Mi.create(),typeName:pt.ZodObject,..._t(e)});var ra=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let u of a)if(u.result.status==="valid")return u.result;for(let u of a)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let c=a.map(u=>new Ai(u.ctx.common.issues));return Ke(r,{code:Re.invalid_union,unionErrors:c}),gt}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async a=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let a,c=[];for(let d of n){let v={...r,common:{...r.common,issues:[]},parent:null},y=d._parseSync({data:r.data,path:r.path,parent:v});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:v}),v.common.issues.length&&c.push(v.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let u=c.map(d=>new Ai(d));return Ke(r,{code:Re.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ra,"ZodUnion");ra.create=(t,e)=>new ra({options:t,typeName:pt.ZodUnion,..._t(e)});var j0=o(t=>t instanceof oa?j0(t.schema):t instanceof Mn?j0(t.innerType()):t instanceof sa?[t.value]:t instanceof Xi?t.options:t instanceof aa?Object.keys(t.enum):t instanceof fa?j0(t._def.innerType):t instanceof ea?[void 0]:t instanceof ta?[null]:null,"getDiscriminator"),hf=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.object)return Ke(r,{code:Re.invalid_type,expected:Fe.object,received:r.parsedType}),gt;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(Ke(r,{code:Re.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,r,n){let i=new Map;for(let a of r){let c=j0(a.shape[e]);if(!c)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of c){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,a)}}return new hf({typeName:pt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,..._t(n)})}};o(hf,"ZodDiscriminatedUnion");function e2(t,e){let r=Xs(t),n=Xs(e);if(t===e)return{valid:!0,data:t};if(r===Fe.object&&n===Fe.object){let i=zt.objectKeys(e),a=zt.objectKeys(t).filter(u=>i.indexOf(u)!==-1),c={...t,...e};for(let u of a){let d=e2(t[u],e[u]);if(!d.valid)return{valid:!1};c[u]=d.data}return{valid:!0,data:c}}else if(r===Fe.array&&n===Fe.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let c=t[a],u=e[a],d=e2(c,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return r===Fe.date&&n===Fe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}o(e2,"mergeValues");var na=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=o((a,c)=>{if(Zg(a)||Zg(c))return gt;let u=e2(a.value,c.value);return u.valid?((Qg(a)||Qg(c))&&r.dirty(),{status:r.value,value:u.data}):(Ke(n,{code:Re.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(([a,c])=>i(a,c)):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(na,"ZodIntersection");na.create=(t,e,r)=>new na({left:t,right:e,typeName:pt.ZodIntersection,..._t(r)});var Wn=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.array)return Ke(n,{code:Re.invalid_type,expected:Fe.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return Ke(n,{code:Re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&(Ke(n,{code:Re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((c,u)=>{let d=this._def.items[u]||this._def.rest;return d?d._parse(new Vn(n,c,n.path,u)):null}).filter(c=>!!c);return n.common.async?Promise.all(a).then(c=>Rr.mergeArray(r,c)):Rr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Wn({...this._def,rest:e})}};o(Wn,"ZodTuple");Wn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wn({items:t,typeName:pt.ZodTuple,rest:null,..._t(e)})};var ia=class extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.object)return Ke(n,{code:Re.invalid_type,expected:Fe.object,received:n.parsedType}),gt;let i=[],a=this._def.keyType,c=this._def.valueType;for(let u in n.data)i.push({key:a._parse(new Vn(n,u,n.path,u)),value:c._parse(new Vn(n,n.data[u],n.path,u))});return n.common.async?Rr.mergeObjectAsync(r,i):Rr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xt?new ia({keyType:e,valueType:r,typeName:pt.ZodRecord,..._t(n)}):new ia({keyType:Si.create(),valueType:e,typeName:pt.ZodRecord,..._t(r)})}};o(ia,"ZodRecord");var df=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.map)return Ke(n,{code:Re.invalid_type,expected:Fe.map,received:n.parsedType}),gt;let i=this._def.keyType,a=this._def.valueType,c=[...n.data.entries()].map(([u,d],v)=>({key:i._parse(new Vn(n,u,n.path,[v,"key"])),value:a._parse(new Vn(n,d,n.path,[v,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of c){let v=await d.key,y=await d.value;if(v.status==="aborted"||y.status==="aborted")return gt;(v.status==="dirty"||y.status==="dirty")&&r.dirty(),u.set(v.value,y.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let d of c){let v=d.key,y=d.value;if(v.status==="aborted"||y.status==="aborted")return gt;(v.status==="dirty"||y.status==="dirty")&&r.dirty(),u.set(v.value,y.value)}return{status:r.value,value:u}}}};o(df,"ZodMap");df.create=(t,e,r)=>new df({valueType:e,keyType:t,typeName:pt.ZodMap,..._t(r)});var Eo=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.set)return Ke(n,{code:Re.invalid_type,expected:Fe.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Ke(n,{code:Re.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Ke(n,{code:Re.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function c(d){let v=new Set;for(let y of d){if(y.status==="aborted")return gt;y.status==="dirty"&&r.dirty(),v.add(y.value)}return{status:r.value,value:v}}o(c,"finalizeSet");let u=[...n.data.values()].map((d,v)=>a._parse(new Vn(n,d,n.path,v)));return n.common.async?Promise.all(u).then(d=>c(d)):c(u)}min(e,r){return new Eo({...this._def,minSize:{value:e,message:It.toString(r)}})}max(e,r){return new Eo({...this._def,maxSize:{value:e,message:It.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};o(Eo,"ZodSet");Eo.create=(t,e)=>new Eo({valueType:t,minSize:null,maxSize:null,typeName:pt.ZodSet,..._t(e)});var ls=class extends xt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.function)return Ke(r,{code:Re.invalid_type,expected:Fe.function,received:r.parsedType}),gt;function n(u,d){return V0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G0(),Sl].filter(v=>!!v),issueData:{code:Re.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return V0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G0(),Sl].filter(v=>!!v),issueData:{code:Re.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let a={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof hs?rn(async(...u)=>{let d=new Ai([]),v=await this._def.args.parseAsync(u,a).catch(O=>{throw d.addIssue(n(u,O)),d}),y=await c(...v);return await this._def.returns._def.type.parseAsync(y,a).catch(O=>{throw d.addIssue(i(y,O)),d})}):rn((...u)=>{let d=this._def.args.safeParse(u,a);if(!d.success)throw new Ai([n(u,d.error)]);let v=c(...d.data),y=this._def.returns.safeParse(v,a);if(!y.success)throw new Ai([i(v,y.error)]);return y.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ls({...this._def,args:Wn.create(e).rest(_o.create())})}returns(e){return new ls({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new ls({args:e||Wn.create([]).rest(_o.create()),returns:r||_o.create(),typeName:pt.ZodFunction,..._t(n)})}};o(ls,"ZodFunction");var oa=class extends xt{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(oa,"ZodLazy");oa.create=(t,e)=>new oa({getter:t,typeName:pt.ZodLazy,..._t(e)});var sa=class extends xt{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Ke(r,{received:r.data,code:Re.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(sa,"ZodLiteral");sa.create=(t,e)=>new sa({value:t,typeName:pt.ZodLiteral,..._t(e)});function Z9(t,e){return new Xi({values:t,typeName:pt.ZodEnum,..._t(e)})}o(Z9,"createZodEnum");var Xi=class extends xt{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{expected:zt.joinValues(n),received:r.parsedType,code:Re.invalid_type}),gt}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{received:r.data,code:Re.invalid_enum_value,options:n}),gt}return rn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Xi.create(e)}exclude(e){return Xi.create(this.options.filter(r=>!e.includes(r)))}};o(Xi,"ZodEnum");Xi.create=Z9;var aa=class extends xt{_parse(e){let r=zt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Fe.string&&n.parsedType!==Fe.number){let i=zt.objectValues(r);return Ke(n,{expected:zt.joinValues(i),received:n.parsedType,code:Re.invalid_type}),gt}if(r.indexOf(e.data)===-1){let i=zt.objectValues(r);return Ke(n,{received:n.data,code:Re.invalid_enum_value,options:i}),gt}return rn(e.data)}get enum(){return this._def.values}};o(aa,"ZodNativeEnum");aa.create=(t,e)=>new aa({values:t,typeName:pt.ZodNativeEnum,..._t(e)});var hs=class extends xt{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.promise&&r.common.async===!1)return Ke(r,{code:Re.invalid_type,expected:Fe.promise,received:r.parsedType}),gt;let n=r.parsedType===Fe.promise?r.data:Promise.resolve(r.data);return rn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(hs,"ZodPromise");hs.create=(t,e)=>new hs({type:t,typeName:pt.ZodPromise,..._t(e)});var Mn=class extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let c=i.transform(n.data);return n.common.async?Promise.resolve(c).then(u=>this._def.schema._parseAsync({data:u,path:n.path,parent:n})):this._def.schema._parseSync({data:c,path:n.path,parent:n})}let a={addIssue:c=>{Ke(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="refinement"){let c=o(u=>{let d=i.refinement(u,a);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"&&r.dirty(),c(u.value),{status:r.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"&&r.dirty(),c(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!W0(c))return c;let u=i.transform(c.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>W0(c)?Promise.resolve(i.transform(c.value,a)).then(u=>({status:r.value,value:u})):c);zt.assertNever(i)}};o(Mn,"ZodEffects");Mn.create=(t,e,r)=>new Mn({schema:t,typeName:pt.ZodEffects,effect:e,..._t(r)});Mn.createWithPreprocess=(t,e,r)=>new Mn({schema:e,effect:{type:"preprocess",transform:t},typeName:pt.ZodEffects,..._t(r)});var Ti=class extends xt{_parse(e){return this._getType(e)===Fe.undefined?rn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Ti,"ZodOptional");Ti.create=(t,e)=>new Ti({innerType:t,typeName:pt.ZodOptional,..._t(e)});var Ao=class extends xt{_parse(e){return this._getType(e)===Fe.null?rn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Ao,"ZodNullable");Ao.create=(t,e)=>new Ao({innerType:t,typeName:pt.ZodNullable,..._t(e)});var fa=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Fe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(fa,"ZodDefault");fa.create=(t,e)=>new fa({innerType:t,typeName:pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._t(e)});var pf=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r,common:{...r.common,issues:[]}}});return J0(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}};o(pf,"ZodCatch");pf.create=(t,e)=>new pf({innerType:t,typeName:pt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._t(e)});var mf=class extends xt{_parse(e){if(this._getType(e)!==Fe.nan){let n=this._getOrReturnCtx(e);return Ke(n,{code:Re.invalid_type,expected:Fe.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(mf,"ZodNaN");mf.create=t=>new mf({typeName:pt.ZodNaN,..._t(t)});var Gq=Symbol("zod_brand"),Al=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(Al,"ZodBranded");var ca=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?gt:a.status==="dirty"?(r.dirty(),X9(a.value)):this._def.out._parseAsync({data:a.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"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new ca({in:e,out:r,typeName:pt.ZodPipeline})}};o(ca,"ZodPipeline");var Q9=o((t,e={},r)=>t?us.create().superRefine((n,i)=>{if(!t(n)){let a=typeof e=="function"?e(n):e,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:r})}}):us.create(),"custom"),Vq={object:nr.lazycreate},pt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline"})(pt||(pt={}));var Wq=o((t,e={message:`Input not instance of ${t.name}`})=>Q9(r=>r instanceof t,e,!0),"instanceOfType"),e7=Si.create,t7=Yi.create,Jq=mf.create,Yq=Zs.create,r7=Qs.create,Xq=wo.create,Zq=uf.create,Qq=ea.create,eH=ta.create,tH=us.create,rH=_o.create,nH=Mi.create,iH=lf.create,oH=Sn.create,sH=nr.create,aH=nr.strictCreate,fH=ra.create,cH=hf.create,uH=na.create,lH=Wn.create,hH=ia.create,dH=df.create,pH=Eo.create,mH=ls.create,bH=oa.create,gH=sa.create,vH=Xi.create,yH=aa.create,xH=hs.create,J9=Mn.create,wH=Ti.create,_H=Ao.create,EH=Mn.createWithPreprocess,AH=ca.create,SH=o(()=>e7().optional(),"ostring"),MH=o(()=>t7().optional(),"onumber"),TH=o(()=>r7().optional(),"oboolean"),CH={string:t=>Si.create({...t,coerce:!0}),number:t=>Yi.create({...t,coerce:!0}),boolean:t=>Qs.create({...t,coerce:!0}),bigint:t=>Zs.create({...t,coerce:!0}),date:t=>wo.create({...t,coerce:!0})},kH=gt,W=Object.freeze({__proto__:null,defaultErrorMap:Sl,setErrorMap:Uq,getErrorMap:G0,makeIssue:V0,EMPTY_PATH:$q,addIssueToContext:Ke,ParseStatus:Rr,INVALID:gt,DIRTY:X9,OK:rn,isAborted:Zg,isDirty:Qg,isValid:W0,isAsync:J0,get util(){return zt},ZodParsedType:Fe,getParsedType:Xs,ZodType:xt,ZodString:Si,ZodNumber:Yi,ZodBigInt:Zs,ZodBoolean:Qs,ZodDate:wo,ZodSymbol:uf,ZodUndefined:ea,ZodNull:ta,ZodAny:us,ZodUnknown:_o,ZodNever:Mi,ZodVoid:lf,ZodArray:Sn,get objectUtil(){return Y0},ZodObject:nr,ZodUnion:ra,ZodDiscriminatedUnion:hf,ZodIntersection:na,ZodTuple:Wn,ZodRecord:ia,ZodMap:df,ZodSet:Eo,ZodFunction:ls,ZodLazy:oa,ZodLiteral:sa,ZodEnum:Xi,ZodNativeEnum:aa,ZodPromise:hs,ZodEffects:Mn,ZodTransformer:Mn,ZodOptional:Ti,ZodNullable:Ao,ZodDefault:fa,ZodCatch:pf,ZodNaN:mf,BRAND:Gq,ZodBranded:Al,ZodPipeline:ca,custom:Q9,Schema:xt,ZodSchema:xt,late:Vq,get ZodFirstPartyTypeKind(){return pt},coerce:CH,any:tH,array:oH,bigint:Yq,boolean:r7,date:Xq,discriminatedUnion:cH,effect:J9,enum:vH,function:mH,instanceof:Wq,intersection:uH,lazy:bH,literal:gH,map:dH,nan:Jq,nativeEnum:yH,never:nH,null:eH,nullable:_H,number:t7,object:sH,oboolean:TH,onumber:MH,optional:wH,ostring:SH,pipeline:AH,preprocess:EH,promise:xH,record:hH,set:pH,strictObject:aH,string:e7,symbol:Zq,transformer:J9,tuple:lH,undefined:Qq,union:fH,unknown:rH,void:iH,NEVER:kH,ZodIssueCode:Re,quotelessJson:Bq,ZodError:Ai});var i7=W.array(W.string().or(W.record(W.any()))),Ure=W.object({type:W.string().optional(),narrative:W.string().optional()}),Z0=W.string().or(W.object({id:W.string(),type:W.string(),caption:W.string().optional()})),IH=W.object({type:W.string().min(1).or(W.string().array().nonempty()),latitude:W.number(),longitude:W.number()}),DH=W.object({type:W.string().min(1).or(W.string().array().nonempty()),addressCountry:W.string().optional(),addressCountryCode:W.string().optional(),addressRegion:W.string().optional(),addressLocality:W.string().optional(),streetAddress:W.string().optional(),postOfficeBoxNumber:W.string().optional(),postalCode:W.string().optional(),geo:IH.optional()}),OH=W.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(W.string()),o7=W.object({type:W.string().min(1).or(W.string().array().nonempty()),identifier:W.string(),identifierType:OH}),Ml=W.string().or(W.object({id:W.string().optional(),type:W.string().or(W.string().array().nonempty().optional()),name:W.string().optional(),url:W.string().optional(),phone:W.string().optional(),description:W.string().optional(),endorsement:W.any().array().optional(),image:Z0.optional(),email:W.string().email().optional(),address:DH.optional(),otherIdentifier:o7.array().optional(),official:W.string().optional(),parentOrg:W.any().optional(),familyName:W.string().optional(),givenName:W.string().optional(),additionalName:W.string().optional(),patronymicName:W.string().optional(),honorificPrefix:W.string().optional(),honorificSuffix:W.string().optional(),familyNamePrefix:W.string().optional(),dateOfBirth:W.string().optional()}).catchall(W.any())),t2=W.object({id:W.string().optional()}).catchall(W.any()),RH=W.object({type:W.string(),id:W.string()}),NH=W.object({id:W.string(),type:W.string()}),PH=W.object({id:W.string(),type:W.string()}).catchall(W.any()),X0=W.object({"@context":i7,id:W.string().optional(),type:W.string().array().nonempty(),issuer:Ml,issuanceDate:W.string(),expirationDate:W.string().optional(),credentialSubject:t2.or(t2.array()),credentialStatus:RH.optional(),credentialSchema:NH.array().optional(),refreshService:PH.optional()}).catchall(W.any()),ua=W.object({type:W.string(),created:W.string(),challenge:W.string().optional(),domain:W.string().optional(),nonce:W.string().optional(),proofPurpose:W.string(),verificationMethod:W.string(),jws:W.string().optional()}).catchall(W.any()),Tl=X0.extend({proof:ua.or(ua.array())}),LH=W.object({"@context":i7,id:W.string().optional(),type:W.string().array().nonempty(),verifiableCredential:Tl.or(Tl.array()).optional(),holder:W.string().optional()}).catchall(W.any()),n2=LH.extend({proof:ua.or(ua.array())}),BH=W.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(W.string()),Q0=W.object({type:W.string().array().nonempty(),targetCode:W.string().optional(),targetDescription:W.string().optional(),targetName:W.string(),targetFramework:W.string().optional(),targetType:BH.optional(),targetUrl:W.string()}),UH=W.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"]),$H=UH.or(W.string()),FH=W.object({id:W.string().optional(),narrative:W.string().optional()}).catchall(W.any()),qH=W.object({id:W.string(),type:W.string().array().nonempty(),endorsementComment:W.string().optional()}),HH=X0.extend({credentialSubject:qH,proof:ua.or(ua.array()).optional()}),zH=W.object({id:W.string(),"@language":W.string().optional(),version:W.string().optional()}),KH=W.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(W.string()),jH=W.object({id:W.string(),type:W.string().array().nonempty(),alignment:Q0.array().optional(),description:W.string().optional(),level:W.string().optional(),name:W.string(),points:W.string().optional()}).catchall(W.any()),GH=W.object({id:W.string(),type:W.string().array().nonempty(),alignment:Q0.array().optional(),allowedValue:W.string().array().optional(),name:W.string(),requiredLevel:W.string().optional(),requiredValue:W.string().optional(),resultType:KH,rubricCriterionLevel:jH.array().optional(),valueMax:W.string().optional(),valueMin:W.string().optional()}).catchall(W.any()),VH=W.object({id:W.string().optional(),type:W.string().array().nonempty(),alignment:Q0.array().optional(),achievementType:$H.optional(),creator:Ml.optional(),creditsAvailable:W.number().optional(),criteria:FH,description:W.string(),endorsement:HH.array().optional(),fieldOfStudy:W.string().optional(),humanCode:W.string().optional(),image:Z0.optional(),"@language":W.string().optional(),name:W.string(),otherIdentifier:o7.array().optional(),related:zH.array().optional(),resultDescription:GH.array().optional(),specialization:W.string().optional(),tag:W.string().array().optional(),version:W.string().optional()}).catchall(W.any()),WH=W.object({type:W.string(),hashed:W.boolean(),identityHash:W.string(),identityType:W.string(),salt:W.string().optional()}),JH=W.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),YH=W.object({type:W.string().array().nonempty(),achievedLevel:W.string().optional(),alignment:Q0.array().optional(),resultDescription:W.string().optional(),status:JH.optional(),value:W.string().optional()}).catchall(W.any()),n7=W.object({id:W.string().optional(),type:W.string().array().nonempty(),activityEndDate:W.string().optional(),activityStartDate:W.string().optional(),creditsEarned:W.number().optional(),achievement:VH.optional(),identifier:WH.array().optional(),image:Z0.optional(),licenseNumber:W.string().optional(),narrative:W.string().optional(),result:YH.array().optional(),role:W.string().optional(),source:Ml.optional(),term:W.string().optional()}).catchall(W.any()),XH=W.object({id:W.string().optional(),type:W.string().array().nonempty(),narrative:W.string().optional(),name:W.string().optional(),description:W.string().optional(),genre:W.string().optional(),audience:W.string().optional()}).catchall(W.any()),ZH=X0.extend({name:W.string().optional(),description:W.string().optional(),image:Z0.optional(),credentialSubject:n7.or(n7.array()),endorsement:X0.array().optional(),evidence:XH.array().optional()}),Fre=ZH.extend({proof:ua.or(ua.array())}),Hre=W.object({checks:W.string().array(),warnings:W.string().array(),errors:W.string().array()}),s7=W.enum(["Success","Failed","Error"]),zre=s7.enum,Kre=W.object({check:W.string(),status:s7,message:W.string().optional(),details:W.string().optional()}),jre=W.object({title:W.string().optional(),createdAt:W.string().optional(),issuer:Ml.optional(),issuee:Ml.optional(),credentialSubject:t2.optional()}),Gre=W.object({id:W.string(),uri:W.string()}).catchall(W.any()),Jre=W.object({limit:W.number(),cursor:W.string().optional()}),QH=W.object({cursor:W.string().optional(),hasMore:W.boolean()}),ez=W.object({kty:W.string(),crv:W.string(),x:W.string(),y:W.string().optional(),n:W.string().optional(),d:W.string()}),tz=W.object({alg:W.string(),iv:W.string(),tag:W.string(),epk:ez.partial().optional(),kid:W.string().optional(),apv:W.string().optional(),apu:W.string().optional()}),rz=W.object({header:tz,encrypted_key:W.string()}),nz=W.object({protected:W.string(),iv:W.string(),ciphertext:W.string(),tag:W.string(),aad:W.string().optional(),recipients:rz.array().optional()}),iz=W.object({encryptedRecord:nz,fields:W.string().array(),id:W.string()}).catchall(W.any()),Xre=QH.extend({records:iz.array()}),r2=W.object({profileId:W.string().min(3).max(40),displayName:W.string().default(""),did:W.string(),email:W.string().optional(),image:W.string().optional(),isServiceProfile:W.boolean().default(!1).optional(),notificationsWebhook:W.string().url().startsWith("https://").optional()}),Qre=W.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),ene=W.object({uri:W.string(),to:W.string(),from:W.string(),sent:W.string().datetime(),received:W.string().datetime().optional()}),oz=W.enum(["DRAFT","LIVE"]),tne=W.object({uri:W.string(),name:W.string().optional(),type:W.string().optional(),category:W.string().optional(),status:oz.optional()}),rne=W.object({to:r2,from:W.string(),received:W.string()}),sz=W.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED"]),az=W.object({title:W.string().optional(),body:W.string().optional()}),fz=W.object({vcUris:W.array(W.string()).optional(),vpUris:W.array(W.string()).optional()}),nne=W.object({type:sz,to:r2.partial().and(W.object({did:W.string()})),from:r2.partial().and(W.object({did:W.string()})),message:az.optional(),data:fz.optional(),sent:W.string().datetime().optional()}),ine=W.object({endpoint:W.string(),name:W.string(),did:W.string().optional()}),one=W.object({ttlSeconds:W.number().optional(),totalUses:W.number().optional()}),cz=W.object({endpoint:W.string()}),sne=W.object({signingAuthority:cz,relationship:W.object({name:W.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:W.string()})});var ep=o(t=>`lc:ceramic:${t}`,"streamIdToCeramicURI");var i2=W.string().refine(t=>t.split(":").length===3&&t.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(t=>t.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var tp=o(async(t,{ceramicEndpoint:e,defaultContentFamily:r})=>{let n=new El(e),i=o(async(R,I,N,J)=>t.invoke.didResolver(R,J),"learnCardResolver"),a={..._8.getResolver(),web:i},c=new Ga({resolver:a});n.did=c;let u=t.invoke.getKey(),d=new Zu(o8(u));n.did.setProvider(d),await n.did.authenticate();let v=new bl({ceramic:n}),y=o(async(R,I={},N={},J)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=r),"pin"in N||(N.pin=!0),J?.encrypt){t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",J);let V=J?.recipients||[];J?.controllersCanDecrypt&&(V=[...V,...I.controllers]),R=await n?.did?.createDagJWE(R,a7.default.uniq(V))}return t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,N),(await Gn.create(n,R,I,N)).id.toString()},"publishContentToCeramic"),S=o(async R=>{let I=(await v.load(R))?.content;if(t.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await c.decryptDagJWE(I)}catch(N){throw t.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",N),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await Tl.or(n2).parseAsync(R),ep(await y(R,{},{},I))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,I)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(I)),uploadEncrypted:async(R,I,N)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...N?{recipients:N.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let N=await i2.spa(I);if(!N.success)return;let J=N.data.split(":")[2];try{return await Tl.or(n2).parseAsync(await S(J))}catch(L){R.debug?.(L);return}}},methods:{publishContentToCeramic:async(R,I,N)=>ep(await y(I,{},{},N)),readContentFromCeramic:async(R,I)=>S(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var uz=tp;
818
+ /*!
819
+ * https://github.com/Starcounter-Jack/JSON-Patch
820
+ * (c) 2017-2021 Joachim Wester
821
+ * MIT license
822
+ */
823
+ /*!
824
+ * https://github.com/Starcounter-Jack/JSON-Patch
825
+ * (c) 2017-2022 Joachim Wester
826
+ * MIT licensed
827
+ */
828
+ /**
829
+ * @license
830
+ * Lodash <https://lodash.com/>
831
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
832
+ * Released under MIT license <https://lodash.com/license>
833
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
834
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
835
+ */
836
+ /**
837
+ * [js-sha3]{@link https://github.com/emn178/js-sha3}
838
+ *
839
+ * @version 0.8.0
840
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
841
+ * @copyright Chen, Yi-Cyuan 2015-2018
842
+ * @license MIT
843
+ */
844
+ //# sourceMappingURL=ceramic-plugin.cjs.production.min.js.map