@blockcerts/blockcerts-verifier 1.60.0 → 1.61.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.
Files changed (39) hide show
  1. package/bundle-stats.html +1 -1
  2. package/dist/EcdsaSecp256k1Signature2019-Z9cbZqwb-BZqYyWXC.js +4 -0
  3. package/dist/{Ed25519Signature2020-PVto7akI-7D-o4uG8.js → Ed25519Signature2020-gHlOabgN-BQNMKhh-.js} +4 -4
  4. package/dist/{HashlinkVerifier-qOLUtyR6-bzhltPG4.js → HashlinkVerifier-JKby3RuX-Bn4E9EeP.js} +1 -1
  5. package/dist/{MerkleProof2017-MZJbBTpc-0GcGcIV-.js → MerkleProof2017-MZJbBTpc-B7HRJzRg.js} +1 -1
  6. package/dist/{MerkleProof2017-v-cug_ka-8h-1uHue.js → MerkleProof2017-qKpIAsVw-Diu6ftp6.js} +1 -1
  7. package/dist/MerkleProof2019-lYqSLW83-CdVVDNe8.js +3 -0
  8. package/dist/checkCredentialSchemaConformity-wYKX-T36-TKejNdGn.js +1 -0
  9. package/dist/{checkRevocationStatusList2021-NUr7Ungd-8lPXcMzr.js → checkRevocationStatusList2021-Zs7RTfS8-B_SBTuUQ.js} +1 -1
  10. package/dist/controlVerificationMethod-MnvnHDi1-BAzkUIZW.js +1 -0
  11. package/dist/{did-key-common.esm-2wmtjYcU-BR_8p3eV.js → did-key-common.esm-pD02457t-BaQe2n2J.js} +3 -3
  12. package/dist/{did-key-ed25519.esm-NX9dX9Vr-fZElVDYL.js → did-key-ed25519.esm-QkrYsBOv-KuYPtNeV.js} +1 -1
  13. package/dist/{did-key-secp256k1.esm-FBi5sg1U-hK5l_sjP.js → did-key-secp256k1.esm-byA8GFc3-AosubhwX.js} +1 -1
  14. package/dist/{downloadPDF-nmBhJVDh.js → downloadPDF-B1DL4u2a.js} +2 -2
  15. package/dist/{ensureNotRevoked-gui-UMnE-kFmYZEJe.js → ensureNotRevoked-gui-UMnE-CENgoep9.js} +1 -1
  16. package/dist/{index-UlvMASNZ.js → index-CfIOMbD1.js} +1 -1
  17. package/dist/index-qAZ-fmOX-CHN5LgUq.js +1 -0
  18. package/dist/{index-o5NaLUcd-9ST97EHw.js → index-zUaES8qy-CMAhMZvu.js} +2 -2
  19. package/dist/{index.es-wVskPDvK.js → index.es-D8QzgW47.js} +1 -1
  20. package/dist/{jsonld-signatures-mX3uMDo8-kWFWdwsD.js → jsonld-signatures-Lb-laFSH-v4kRGxlk.js} +8 -8
  21. package/dist/main.js +119 -119
  22. package/dist/{purify-W53PnvWj.js → purify-C5H8D62I.js} +1 -1
  23. package/dist/{x25519-X8M7VOup-2RynHlmX.js → x25519-axOdeC_8-BeczdkXC.js} +1 -1
  24. package/package.json +3 -3
  25. package/dist/EcdsaSecp256k1Signature2019-JXyaAxSS-p7r9wTPV.js +0 -4
  26. package/dist/MerkleProof2019-IxLr0Lr4-exvrsGAt.js +0 -3
  27. package/dist/controlVerificationMethod-Ai0yOkQs-GCeqYaBn.js +0 -1
  28. /package/dist/{Suite-Bhitn5l3-e2QgHGhx.js → Suite-Bhitn5l3-D1ucdMDB.js} +0 -0
  29. /package/dist/{_commonjs-dynamic-modules-F7P8sER7-fkA6S-_a.js → _commonjs-dynamic-modules-F7P8sER7-BHR_E30J.js} +0 -0
  30. /package/dist/{base64url-qi3FT6uz-yv4mTXpu.js → base64url-qi3FT6uz-vkTPfQOh.js} +0 -0
  31. /package/dist/{elliptic-xyZmv-oA-VPyWJbY1.js → elliptic-ycTr8sXF-D-NH8siB.js} +0 -0
  32. /package/dist/{ensureNotRevoked--X9grgJr-l9FjOXvf.js → ensureNotRevoked-EDQJmT-v-DvMIgM4L.js} +0 -0
  33. /package/dist/{ensureValidIssuingKey-U4G_F_Hm-UoJe_Wnf.js → ensureValidIssuingKey-_gUzjB7e-frafTbMl.js} +0 -0
  34. /package/dist/{index-CZOUZnn4-Lnb5-WZi.js → index-CZOUZnn4-ZifknGWx.js} +0 -0
  35. /package/dist/{index-aBVDu34R-o1HUYRUQ.js → index-tKimblBp-Dgus2xdV.js} +0 -0
  36. /package/dist/{jsonld-SAOezr4P-ioHKtwiZ.js → jsonld-8ujMRGin-D_C9ciG_.js} +0 -0
  37. /package/dist/{pako.esm-jjCKMBM4-RAILONW0.js → pako.esm-jjCKMBM4-HambcU-w.js} +0 -0
  38. /package/dist/{sha256-lGrd_b3t-9eo2gOQb.js → sha256-OznnmV9J-BYFBxJ7m.js} +0 -0
  39. /package/dist/{tslib.es6-M1zqH4el-x9kNW1T_.js → tslib.es6-M1zqH4el-CmLYFWVC.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{g as e,c as t}from"./downloadPDF-nmBhJVDh.js";function n(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var r={exports:{}};
1
+ import{g as e,c as t}from"./downloadPDF-B1DL4u2a.js";function n(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var r={exports:{}};
2
2
  /*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */r.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,a){return r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var a=new(Function.bind.apply(e,o));return r&&t(a,r.prototype),a},r.apply(null,arguments)}function o(e){return a(e)||i(e)||l(e)||u()}function a(e){if(Array.isArray(e))return c(e)}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s=Object.hasOwnProperty,m=Object.setPrototypeOf,f=Object.isFrozen,p=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor,h=Object.freeze,g=Object.seal,y=Object.create,b="undefined"!=typeof Reflect&&Reflect,v=b.apply,T=b.construct;v||(v=function(e,t,n){return e.apply(t,n)}),h||(h=function(e){return e}),g||(g=function(e){return e}),T||(T=function(e,t){return r(e,o(t))});var N=C(Array.prototype.forEach),E=C(Array.prototype.pop),A=C(Array.prototype.push),w=C(String.prototype.toLowerCase),x=C(String.prototype.match),_=C(String.prototype.replace),k=C(String.prototype.indexOf),S=C(String.prototype.trim),O=C(RegExp.prototype.test),D=R(TypeError);function C(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return v(e,t,r)}}function R(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return T(e,n)}}function M(e,t){m&&m(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=w(r);o!==r&&(f(t)||(t[n]=o),r=o)}e[r]=!0}return e}function L(e){var t,n=y(null);for(t in e)v(s,e,[t])&&(n[t]=e[t]);return n}function I(e,t){for(;null!==e;){var n=d(e,t);if(n){if(n.get)return C(n.get);if("function"==typeof n.value)return C(n.value)}e=p(e)}function r(e){return console.warn("fallback value for",e),null}return r}var F=h(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),H=h(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U=h(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),z=h(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),j=h(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),B=h(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=h(["#text"]),G=h(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),W=h(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),q=h(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Y=h(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),V=g(/<%[\w\W]*|[\w\W]*%>/gm),$=g(/^data-[\-\w.\u00B7-\uFFFF]/),X=g(/^aria-[\-\w]+$/),Z=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),J=g(/^(?:\w+script|data):/i),Q=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=g(/^html$/i),te=function(){return"undefined"==typeof window?null:window},ne=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,o="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(o)&&(r=n.currentScript.getAttribute(o));var a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),n=function(e){return re(e)};if(n.version="2.3.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,a=t.document,i=t.DocumentFragment,l=t.HTMLTemplateElement,c=t.Node,u=t.Element,s=t.NodeFilter,m=t.NamedNodeMap,f=void 0===m?t.NamedNodeMap||t.MozNamedAttrMap:m,p=t.HTMLFormElement,d=t.DOMParser,g=t.trustedTypes,y=u.prototype,b=I(y,"cloneNode"),v=I(y,"nextSibling"),T=I(y,"childNodes"),C=I(y,"parentNode");if("function"==typeof l){var R=a.createElement("template");R.content&&R.content.ownerDocument&&(a=R.content.ownerDocument)}var oe=ne(g,r),ae=oe?oe.createHTML(""):"",ie=a,le=ie.implementation,ce=ie.createNodeIterator,ue=ie.createDocumentFragment,se=ie.getElementsByTagName,me=r.importNode,fe={};try{fe=L(a).documentMode?a.documentMode:{}}catch(e){}var pe={};n.isSupported="function"==typeof C&&le&&void 0!==le.createHTMLDocument&&9!==fe;var de,he,ge=K,ye=V,be=$,ve=X,Te=J,Ne=Q,Ee=Z,Ae=null,we=M({},[].concat(o(F),o(H),o(U),o(j),o(P))),xe=null,_e=M({},[].concat(o(G),o(W),o(q),o(Y))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Oe=null,De=!0,Ce=!0,Re=!1,Me=!1,Le=!1,Ie=!1,Fe=!1,He=!1,Ue=!1,ze=!1,je=!0,Be=!0,Pe=!1,Ge={},We=null,qe=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ye=null,Ke=M({},["audio","video","img","source","image","track"]),Ve=null,$e=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml",Qe=Je,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,ot=a.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},it=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=L(t),Ae="ALLOWED_TAGS"in t?M({},t.ALLOWED_TAGS):we,xe="ALLOWED_ATTR"in t?M({},t.ALLOWED_ATTR):_e,Ve="ADD_URI_SAFE_ATTR"in t?M(L($e),t.ADD_URI_SAFE_ATTR):$e,Ye="ADD_DATA_URI_TAGS"in t?M(L(Ke),t.ADD_DATA_URI_TAGS):Ke,We="FORBID_CONTENTS"in t?M({},t.FORBID_CONTENTS):qe,Se="FORBID_TAGS"in t?M({},t.FORBID_TAGS):{},Oe="FORBID_ATTR"in t?M({},t.FORBID_ATTR):{},Ge="USE_PROFILES"in t&&t.USE_PROFILES,De=!1!==t.ALLOW_ARIA_ATTR,Ce=!1!==t.ALLOW_DATA_ATTR,Re=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=t.SAFE_FOR_TEMPLATES||!1,Le=t.WHOLE_DOCUMENT||!1,He=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,ze=t.RETURN_TRUSTED_TYPE||!1,Fe=t.FORCE_BODY||!1,je=!1!==t.SANITIZE_DOM,Be=!1!==t.KEEP_CONTENT,Pe=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,Qe=t.NAMESPACE||Je,t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de=de=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===de?function(e){return e}:w,Me&&(Ce=!1),Ue&&(He=!0),Ge&&(Ae=M({},o(P)),xe=[],!0===Ge.html&&(M(Ae,F),M(xe,G)),!0===Ge.svg&&(M(Ae,H),M(xe,W),M(xe,Y)),!0===Ge.svgFilters&&(M(Ae,U),M(xe,W),M(xe,Y)),!0===Ge.mathMl&&(M(Ae,j),M(xe,q),M(xe,Y))),t.ADD_TAGS&&(Ae===we&&(Ae=L(Ae)),M(Ae,t.ADD_TAGS)),t.ADD_ATTR&&(xe===_e&&(xe=L(xe)),M(xe,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&M(Ve,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(We===qe&&(We=L(We)),M(We,t.FORBID_CONTENTS)),Be&&(Ae["#text"]=!0),Le&&M(Ae,["html","head","body"]),Ae.table&&(M(Ae,["tbody"]),delete Se.tbody),h&&h(t),rt=t)},lt=M({},["mi","mo","mn","ms","mtext"]),ct=M({},["foreignobject","desc","title","annotation-xml"]),ut=M({},["title","style","font","a","script"]),st=M({},H);M(st,U),M(st,z);var mt=M({},j);M(mt,B);var ft=function(e){var t=C(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});var n=w(e.tagName),r=w(t.tagName);return e.namespaceURI===Ze?t.namespaceURI===Je?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(st[n]):e.namespaceURI===Xe?t.namespaceURI===Je?"math"===n:t.namespaceURI===Ze?"math"===n&&ct[r]:Boolean(mt[n]):e.namespaceURI===Je&&!(t.namespaceURI===Ze&&!ct[r])&&!(t.namespaceURI===Xe&&!lt[r])&&!mt[n]&&(ut[n]||!st[n])},pt=function(e){A(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},dt=function(e,t){try{A(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(He||Ue)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ht=function(e){var t,n;if(Fe)e="<remove></remove>"+e;else{var r=x(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=oe?oe.createHTML(e):e;if(Qe===Je)try{t=(new d).parseFromString(o,de)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?"":o}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(a.createTextNode(n),i.childNodes[0]||null),Qe===Je?se.call(t,Le?"html":"body")[0]:Le?t.documentElement:i},gt=function(e){return ce.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},yt=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof f)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},bt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},vt=function(e,t,r){pe[e]&&N(pe[e],(function(e){e.call(n,t,r,rt)}))},Tt=function(e){var t;if(vt("beforeSanitizeElements",e,null),yt(e))return pt(e),!0;if(O(/[\u0080-\uFFFF]/,e.nodeName))return pt(e),!0;var r=he(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:Ae}),e.hasChildNodes()&&!bt(e.firstElementChild)&&(!bt(e.content)||!bt(e.content.firstElementChild))&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return pt(e),!0;if("select"===r&&O(/<template/i,e.innerHTML))return pt(e),!0;if(!Ae[r]||Se[r]){if(!Se[r]&&Et(r)){if(ke.tagNameCheck instanceof RegExp&&O(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(Be&&!We[r]){var o=C(e)||e.parentNode,a=T(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(b(a[i],!0),v(e))}return pt(e),!0}return e instanceof u&&!ft(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r||!O(/<\/no(script|embed)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,t=_(t,ge," "),t=_(t,ye," "),e.textContent!==t&&(A(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(pt(e),!0)},Nt=function(e,t,n){if(je&&("id"===t||"name"===t)&&(n in a||n in ot))return!1;if(Ce&&!Oe[t]&&O(be,t));else if(De&&O(ve,t));else if(!xe[t]||Oe[t]){if(!(Et(e)&&(ke.tagNameCheck instanceof RegExp&&O(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&O(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&O(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Ve[t]);else if(O(Ee,_(n,Ne,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==k(n,"data:")||!Ye[e])if(Re&&!O(Te,_(n,Ne,"")));else if(n)return!1;return!0},Et=function(e){return e.indexOf("-")>0},At=function(e){var t,r,o,a;vt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(a=i.length;a--;){var c=t=i[a],u=c.name,s=c.namespaceURI;if(r="value"===u?t.value:S(t.value),o=he(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(dt(u,e),l.keepAttr))if(O(/\/>/i,r))dt(u,e);else{Me&&(r=_(r,ge," "),r=_(r,ye," "));var m=he(e.nodeName);if(Nt(m,o,r))try{s?e.setAttributeNS(s,u,r):e.setAttribute(u,r),E(n.removed)}catch(e){}}}vt("afterSanitizeAttributes",e,null)}},wt=function e(t){var n,r=gt(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),Tt(n)||(n.content instanceof i&&e(n.content),At(n));vt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(o,a){var l,u,s,m,f;if((et=!o)&&(o="\x3c!--\x3e"),"string"!=typeof o&&!bt(o)){if("function"!=typeof o.toString)throw D("toString is not a function");if("string"!=typeof(o=o.toString()))throw D("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof o)return t.toStaticHTML(o);if(bt(o))return t.toStaticHTML(o.outerHTML)}return o}if(Ie||it(a),n.removed=[],"string"==typeof o&&(Pe=!1),Pe){if(o.nodeName){var p=he(o.nodeName);if(!Ae[p]||Se[p])throw D("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof c)1===(u=(l=ht("\x3c!----\x3e")).ownerDocument.importNode(o,!0)).nodeType&&"BODY"===u.nodeName||"HTML"===u.nodeName?l=u:l.appendChild(u);else{if(!He&&!Me&&!Le&&-1===o.indexOf("<"))return oe&&ze?oe.createHTML(o):o;if(!(l=ht(o)))return He?null:ze?ae:""}l&&Fe&&pt(l.firstChild);for(var d=gt(Pe?o:l);s=d.nextNode();)3===s.nodeType&&s===m||Tt(s)||(s.content instanceof i&&wt(s.content),At(s),m=s);if(m=null,Pe)return o;if(He){if(Ue)for(f=ue.call(l.ownerDocument);l.firstChild;)f.appendChild(l.firstChild);else f=l;return xe.shadowroot&&(f=me.call(r,f,!0)),f}var h=Le?l.outerHTML:l.innerHTML;return Le&&Ae["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&O(ee,l.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+l.ownerDocument.doctype.name+">\n"+h),Me&&(h=_(h,ge," "),h=_(h,ye," ")),oe&&ze?oe.createHTML(h):h},n.setConfig=function(e){it(e),Ie=!0},n.clearConfig=function(){rt=null,Ie=!1},n.isValidAttribute=function(e,t,n){rt||it({});var r=he(e),o=he(t);return Nt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],A(pe[e],t))},n.removeHook=function(e){if(pe[e])return E(pe[e])},n.removeHooks=function(e){pe[e]&&(pe[e]=[])},n.removeAllHooks=function(){pe={}},n}var oe=re();return oe}();var o=r.exports,a=n({__proto__:null,default:e(o)},[o]);export{a as p};
@@ -1 +1 @@
1
- import{c as t}from"./_commonjs-dynamic-modules-F7P8sER7-fkA6S-_a.js";import{s as e}from"./main.js";var r={},n={},o={},i={};Object.defineProperty(i,"__esModule",{value:!0}),i.BrowserRandomSource=void 0;i.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t<e.length;t+=65536)this._crypto.getRandomValues(e.subarray(t,t+Math.min(e.length-t,65536)));return e}};var a={},s={};Object.defineProperty(s,"__esModule",{value:!0}),s.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t},Object.defineProperty(a,"__esModule",{value:!0}),a.NodeRandomSource=void 0;const f=s;a.NodeRandomSource=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,void 0!==t){const t=e;t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t<r.length;t++)r[t]=e[t];return(0,f.wipe)(e),r}},Object.defineProperty(o,"__esModule",{value:!0}),o.SystemRandomSource=void 0;const u=i,h=a;o.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new u.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new h.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}};var l,c={},d={};l=d,Object.defineProperty(l,"__esModule",{value:!0}),l.mul=Math.imul||function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16&65535)*n+r*(e>>>16&65535)<<16>>>0)|0},l.add=function(t,e){return t+e|0},l.sub=function(t,e){return t-e|0},l.rotl=function(t,e){return t<<e|t>>>32-e},l.rotr=function(t,e){return t<<32-e|t>>>e},l.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},l.MAX_SAFE_INTEGER=9007199254740991,l.isSafeInteger=function(t){return l.isInteger(t)&&t>=-l.MAX_SAFE_INTEGER&&t<=l.MAX_SAFE_INTEGER},Object.defineProperty(c,"__esModule",{value:!0});var y=d;function E(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function w(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function _(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function b(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function v(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function L(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function g(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function M(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function p(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),g(t/4294967296>>>0,e,r),g(t>>>0,e,r+4),e}function m(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),M(t>>>0,e,r),M(t/4294967296>>>0,e,r+4),e}c.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},c.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},c.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},c.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},c.writeUint16BE=E,c.writeInt16BE=E,c.writeUint16LE=w,c.writeInt16LE=w,c.readInt32BE=_,c.readUint32BE=b,c.readInt32LE=v,c.readUint32LE=L,c.writeUint32BE=g,c.writeInt32BE=g,c.writeUint32LE=M,c.writeInt32LE=M,c.readInt64BE=function(t,e){void 0===e&&(e=0);var r=_(t,e),n=_(t,e+4);return 4294967296*r+n-4294967296*(n>>31)},c.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*b(t,e)+b(t,e+4)},c.readInt64LE=function(t,e){void 0===e&&(e=0);var r=v(t,e);return 4294967296*v(t,e+4)+r-4294967296*(r>>31)},c.readUint64LE=function(t,e){void 0===e&&(e=0);var r=L(t,e);return 4294967296*L(t,e+4)+r},c.writeUint64BE=p,c.writeInt64BE=p,c.writeUint64LE=m,c.writeInt64LE=m,c.readUintBE=function(t,e,r){if(void 0===r&&(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,o=1,i=t/8+r-1;i>=r;i--)n+=e[i]*o,o*=256;return n},c.readUintLE=function(t,e,r){if(void 0===r&&(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,o=1,i=r;i<r+t/8;i++)n+=e[i]*o,o*=256;return n},c.writeUintBE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!y.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var o=1,i=t/8+n-1;i>=n;i--)r[i]=e/o&255,o*=256;return r},c.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!y.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,i=n;i<n+t/8;i++)r[i]=e/o&255,o*=256;return r},c.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},c.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},c.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},c.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},c.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},c.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},c.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},c.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=o,r=c,n=s;function i(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new e.SystemRandomSource,t.randomBytes=i,t.randomUint32=function(e=t.defaultRandomSource){const o=i(4,e),a=(0,r.readUint32LE)(o);return(0,n.wipe)(o),a};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(e,r=a,o=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let s="";const f=r.length,u=256-256%f;for(;e>0;){const t=i(Math.ceil(256*e/u),o);for(let n=0;n<t.length&&e>0;n++){const o=t[n];o<u&&(s+=r.charAt(o%f),e--)}(0,n.wipe)(t)}return s}t.randomString=f,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return f(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}}(n);var S={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=c,r=s;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function n(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.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 n.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},n.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},n.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},n.prototype.update=function(e,r){if(void 0===r&&(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<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(i(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=i(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},n.prototype.finish=function(t){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,o=r/536870912|0,a=r<<3,s=r%128<112?128:256;this._buffer[n]=128;for(var f=n+1;f<s-8;f++)this._buffer[f]=0;e.writeUint32BE(o,this._buffer,s-8),e.writeUint32BE(a,this._buffer,s-4),i(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(f=0;f<this.digestLength/8;f++)e.writeUint32BE(this._stateHi[f],t,8*f),e.writeUint32BE(this._stateLo[f],t,8*f+4);return this},n.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},n.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}},n.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},n.prototype.cleanSavedState=function(t){r.wipe(t.stateHi),r.wipe(t.stateLo),t.buffer&&r.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},n}();t.SHA512=n;var o=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 i(t,r,n,i,a,s,f){for(var u,h,l,c,d,y,E,w,_=n[0],b=n[1],v=n[2],L=n[3],g=n[4],M=n[5],p=n[6],m=n[7],S=i[0],A=i[1],U=i[2],H=i[3],B=i[4],I=i[5],T=i[6],K=i[7];f>=128;){for(var N=0;N<16;N++){var R=8*N+s;t[N]=e.readUint32BE(a,R),r[N]=e.readUint32BE(a,R+4)}for(N=0;N<80;N++){var F,G,P=_,O=b,C=v,D=L,Y=g,j=M,k=p,V=S,X=A,x=U,z=H,Z=B,$=I,q=T;if(d=65535&(h=K),y=h>>>16,E=65535&(u=m),w=u>>>16,d+=65535&(h=(B>>>14|g<<18)^(B>>>18|g<<14)^(g>>>9|B<<23)),y+=h>>>16,E+=65535&(u=(g>>>14|B<<18)^(g>>>18|B<<14)^(B>>>9|g<<23)),w+=u>>>16,d+=65535&(h=B&I^~B&T),y+=h>>>16,E+=65535&(u=g&M^~g&p),w+=u>>>16,u=o[2*N],d+=65535&(h=o[2*N+1]),y+=h>>>16,E+=65535&u,w+=u>>>16,u=t[N%16],y+=(h=r[N%16])>>>16,E+=65535&u,w+=u>>>16,E+=(y+=(d+=65535&h)>>>16)>>>16,d=65535&(h=c=65535&d|y<<16),y=h>>>16,E=65535&(u=l=65535&E|(w+=E>>>16)<<16),w=u>>>16,d+=65535&(h=(S>>>28|_<<4)^(_>>>2|S<<30)^(_>>>7|S<<25)),y+=h>>>16,E+=65535&(u=(_>>>28|S<<4)^(S>>>2|_<<30)^(S>>>7|_<<25)),w+=u>>>16,y+=(h=S&A^S&U^A&U)>>>16,E+=65535&(u=_&b^_&v^b&v),w+=u>>>16,F=65535&(E+=(y+=(d+=65535&h)>>>16)>>>16)|(w+=E>>>16)<<16,G=65535&d|y<<16,d=65535&(h=z),y=h>>>16,E=65535&(u=D),w=u>>>16,y+=(h=c)>>>16,E+=65535&(u=l),w+=u>>>16,b=P,v=O,L=C,g=D=65535&(E+=(y+=(d+=65535&h)>>>16)>>>16)|(w+=E>>>16)<<16,M=Y,p=j,m=k,_=F,A=V,U=X,H=x,B=z=65535&d|y<<16,I=Z,T=$,K=q,S=G,N%16==15)for(R=0;R<16;R++)u=t[R],d=65535&(h=r[R]),y=h>>>16,E=65535&u,w=u>>>16,u=t[(R+9)%16],d+=65535&(h=r[(R+9)%16]),y+=h>>>16,E+=65535&u,w+=u>>>16,l=t[(R+1)%16],d+=65535&(h=((c=r[(R+1)%16])>>>1|l<<31)^(c>>>8|l<<24)^(c>>>7|l<<25)),y+=h>>>16,E+=65535&(u=(l>>>1|c<<31)^(l>>>8|c<<24)^l>>>7),w+=u>>>16,l=t[(R+14)%16],y+=(h=((c=r[(R+14)%16])>>>19|l<<13)^(l>>>29|c<<3)^(c>>>6|l<<26))>>>16,E+=65535&(u=(l>>>19|c<<13)^(c>>>29|l<<3)^l>>>6),w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,t[R]=65535&E|w<<16,r[R]=65535&d|y<<16}d=65535&(h=S),y=h>>>16,E=65535&(u=_),w=u>>>16,u=n[0],y+=(h=i[0])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[0]=_=65535&E|w<<16,i[0]=S=65535&d|y<<16,d=65535&(h=A),y=h>>>16,E=65535&(u=b),w=u>>>16,u=n[1],y+=(h=i[1])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[1]=b=65535&E|w<<16,i[1]=A=65535&d|y<<16,d=65535&(h=U),y=h>>>16,E=65535&(u=v),w=u>>>16,u=n[2],y+=(h=i[2])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[2]=v=65535&E|w<<16,i[2]=U=65535&d|y<<16,d=65535&(h=H),y=h>>>16,E=65535&(u=L),w=u>>>16,u=n[3],y+=(h=i[3])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[3]=L=65535&E|w<<16,i[3]=H=65535&d|y<<16,d=65535&(h=B),y=h>>>16,E=65535&(u=g),w=u>>>16,u=n[4],y+=(h=i[4])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[4]=g=65535&E|w<<16,i[4]=B=65535&d|y<<16,d=65535&(h=I),y=h>>>16,E=65535&(u=M),w=u>>>16,u=n[5],y+=(h=i[5])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[5]=M=65535&E|w<<16,i[5]=I=65535&d|y<<16,d=65535&(h=T),y=h>>>16,E=65535&(u=p),w=u>>>16,u=n[6],y+=(h=i[6])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[6]=p=65535&E|w<<16,i[6]=T=65535&d|y<<16,d=65535&(h=K),y=h>>>16,E=65535&(u=m),w=u>>>16,u=n[7],y+=(h=i[7])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[7]=m=65535&E|w<<16,i[7]=K=65535&d|y<<16,s+=128,f-=128}return s}t.hash=function(t){var e=new n;e.update(t);var r=e.digest();return e.clean(),r}}(S),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=n,r=S,o=s;function i(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;new Uint8Array(32)[0]=9;const a=i(),f=i([1]),u=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),c=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(t,e){for(let r=0;r<16;r++)t[r]=0|e[r]}function E(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-65536*e}t[0]+=e-1+37*(e-1)}function w(t,e,r){const n=~(r-1);for(let r=0;r<16;r++){const o=n&(t[r]^e[r]);t[r]^=o,e[r]^=o}}function _(t,e){const r=i(),n=i();for(let t=0;t<16;t++)n[t]=e[t];E(n),E(n),E(n);for(let t=0;t<2;t++){r[0]=n[0]-65517;for(let t=1;t<15;t++)r[t]=n[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,w(n,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&n[e],t[2*e+1]=n[e]>>8}function b(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}function v(t,e){const r=new Uint8Array(32),n=new Uint8Array(32);return _(r,t),_(n,e),b(r,n)}function L(t){const e=new Uint8Array(32);return _(e,t),1&e[0]}function g(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function M(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function p(t,e,r){let n,o,i=0,a=0,s=0,f=0,u=0,h=0,l=0,c=0,d=0,y=0,E=0,w=0,_=0,b=0,v=0,L=0,g=0,M=0,p=0,m=0,S=0,A=0,U=0,H=0,B=0,I=0,T=0,K=0,N=0,R=0,F=0,G=r[0],P=r[1],O=r[2],C=r[3],D=r[4],Y=r[5],j=r[6],k=r[7],V=r[8],X=r[9],x=r[10],z=r[11],Z=r[12],$=r[13],q=r[14],J=r[15];n=e[0],i+=n*G,a+=n*P,s+=n*O,f+=n*C,u+=n*D,h+=n*Y,l+=n*j,c+=n*k,d+=n*V,y+=n*X,E+=n*x,w+=n*z,_+=n*Z,b+=n*$,v+=n*q,L+=n*J,n=e[1],a+=n*G,s+=n*P,f+=n*O,u+=n*C,h+=n*D,l+=n*Y,c+=n*j,d+=n*k,y+=n*V,E+=n*X,w+=n*x,_+=n*z,b+=n*Z,v+=n*$,L+=n*q,g+=n*J,n=e[2],s+=n*G,f+=n*P,u+=n*O,h+=n*C,l+=n*D,c+=n*Y,d+=n*j,y+=n*k,E+=n*V,w+=n*X,_+=n*x,b+=n*z,v+=n*Z,L+=n*$,g+=n*q,M+=n*J,n=e[3],f+=n*G,u+=n*P,h+=n*O,l+=n*C,c+=n*D,d+=n*Y,y+=n*j,E+=n*k,w+=n*V,_+=n*X,b+=n*x,v+=n*z,L+=n*Z,g+=n*$,M+=n*q,p+=n*J,n=e[4],u+=n*G,h+=n*P,l+=n*O,c+=n*C,d+=n*D,y+=n*Y,E+=n*j,w+=n*k,_+=n*V,b+=n*X,v+=n*x,L+=n*z,g+=n*Z,M+=n*$,p+=n*q,m+=n*J,n=e[5],h+=n*G,l+=n*P,c+=n*O,d+=n*C,y+=n*D,E+=n*Y,w+=n*j,_+=n*k,b+=n*V,v+=n*X,L+=n*x,g+=n*z,M+=n*Z,p+=n*$,m+=n*q,S+=n*J,n=e[6],l+=n*G,c+=n*P,d+=n*O,y+=n*C,E+=n*D,w+=n*Y,_+=n*j,b+=n*k,v+=n*V,L+=n*X,g+=n*x,M+=n*z,p+=n*Z,m+=n*$,S+=n*q,A+=n*J,n=e[7],c+=n*G,d+=n*P,y+=n*O,E+=n*C,w+=n*D,_+=n*Y,b+=n*j,v+=n*k,L+=n*V,g+=n*X,M+=n*x,p+=n*z,m+=n*Z,S+=n*$,A+=n*q,U+=n*J,n=e[8],d+=n*G,y+=n*P,E+=n*O,w+=n*C,_+=n*D,b+=n*Y,v+=n*j,L+=n*k,g+=n*V,M+=n*X,p+=n*x,m+=n*z,S+=n*Z,A+=n*$,U+=n*q,H+=n*J,n=e[9],y+=n*G,E+=n*P,w+=n*O,_+=n*C,b+=n*D,v+=n*Y,L+=n*j,g+=n*k,M+=n*V,p+=n*X,m+=n*x,S+=n*z,A+=n*Z,U+=n*$,H+=n*q,B+=n*J,n=e[10],E+=n*G,w+=n*P,_+=n*O,b+=n*C,v+=n*D,L+=n*Y,g+=n*j,M+=n*k,p+=n*V,m+=n*X,S+=n*x,A+=n*z,U+=n*Z,H+=n*$,B+=n*q,I+=n*J,n=e[11],w+=n*G,_+=n*P,b+=n*O,v+=n*C,L+=n*D,g+=n*Y,M+=n*j,p+=n*k,m+=n*V,S+=n*X,A+=n*x,U+=n*z,H+=n*Z,B+=n*$,I+=n*q,T+=n*J,n=e[12],_+=n*G,b+=n*P,v+=n*O,L+=n*C,g+=n*D,M+=n*Y,p+=n*j,m+=n*k,S+=n*V,A+=n*X,U+=n*x,H+=n*z,B+=n*Z,I+=n*$,T+=n*q,K+=n*J,n=e[13],b+=n*G,v+=n*P,L+=n*O,g+=n*C,M+=n*D,p+=n*Y,m+=n*j,S+=n*k,A+=n*V,U+=n*X,H+=n*x,B+=n*z,I+=n*Z,T+=n*$,K+=n*q,N+=n*J,n=e[14],v+=n*G,L+=n*P,g+=n*O,M+=n*C,p+=n*D,m+=n*Y,S+=n*j,A+=n*k,U+=n*V,H+=n*X,B+=n*x,I+=n*z,T+=n*Z,K+=n*$,N+=n*q,R+=n*J,n=e[15],L+=n*G,g+=n*P,M+=n*O,p+=n*C,m+=n*D,S+=n*Y,A+=n*j,U+=n*k,H+=n*V,B+=n*X,I+=n*x,T+=n*z,K+=n*Z,N+=n*$,R+=n*q,F+=n*J,i+=38*g,a+=38*M,s+=38*p,f+=38*m,u+=38*S,h+=38*A,l+=38*U,c+=38*H,d+=38*B,y+=38*I,E+=38*T,w+=38*K,_+=38*N,b+=38*R,v+=38*F,o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),t[0]=i,t[1]=a,t[2]=s,t[3]=f,t[4]=u,t[5]=h,t[6]=l,t[7]=c,t[8]=d,t[9]=y,t[10]=E,t[11]=w,t[12]=_,t[13]=b,t[14]=v,t[15]=L}function m(t,e){p(t,e,e)}function A(t,e){const r=i();let n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)m(r,r),2!==n&&4!==n&&p(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}function U(t,e){const r=i(),n=i(),o=i(),a=i(),s=i(),f=i(),u=i(),l=i(),c=i();M(r,t[1],t[0]),M(c,e[1],e[0]),p(r,r,c),g(n,t[0],t[1]),g(c,e[0],e[1]),p(n,n,c),p(o,t[3],e[3]),p(o,o,h),p(a,t[2],e[2]),g(a,a,a),M(s,n,r),M(f,a,o),g(u,a,o),g(l,n,r),p(t[0],s,f),p(t[1],l,u),p(t[2],u,f),p(t[3],s,l)}function H(t,e,r){for(let n=0;n<4;n++)w(t[n],e[n],r)}function B(t,e){const r=i(),n=i(),o=i();A(o,e[2]),p(r,e[0],o),p(n,e[1],o),_(t,n),t[31]^=L(r)<<7}function I(t,e,r){y(t[0],a),y(t[1],f),y(t[2],f),y(t[3],a);for(let n=255;n>=0;--n){const o=r[n/8|0]>>(7&n)&1;H(t,e,o),U(e,t),U(t,t),H(t,e,o)}}function T(t,e){const r=[i(),i(),i(),i()];y(r[0],l),y(r[1],c),y(r[2],f),p(r[3],l,c),I(t,r,e)}function K(e){if(e.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const n=(0,r.hash)(e);n[0]&=248,n[31]&=127,n[31]|=64;const o=new Uint8Array(32),a=[i(),i(),i(),i()];T(a,n),B(o,a);const s=new Uint8Array(64);return s.set(e),s.set(o,32),{publicKey:o,secretKey:s}}t.generateKeyPairFromSeed=K,t.generateKeyPair=function(t){const r=(0,e.randomBytes)(32,t),n=K(r);return(0,o.wipe)(r),n},t.extractPublicKeyFromSecretKey=function(e){if(e.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(e.subarray(32))};const N=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 R(t,e){let r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o<i;++o)e[o]+=r-16*e[n]*N[o-(n-32)],r=Math.floor((e[o]+128)/256),e[o]-=256*r;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;o++)e[o]+=r-(e[31]>>4)*N[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=r*N[o];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function F(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;R(t,e)}function G(t,e){const r=i(),n=i(),o=i(),s=i(),h=i(),l=i(),c=i();return y(t[2],f),function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(t[1],e),m(o,t[1]),p(s,o,u),M(o,o,t[2]),g(s,t[2],s),m(h,s),m(l,h),p(c,l,h),p(r,c,o),p(r,r,s),function(t,e){const r=i();let n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)m(r,r),1!==n&&p(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}(r,r),p(r,r,o),p(r,r,s),p(r,r,s),p(t[0],r,s),m(n,t[0]),p(n,n,s),v(n,o)&&p(t[0],t[0],d),m(n,t[0]),p(n,n,s),v(n,o)?-1:(L(t[0])===e[31]>>7&&M(t[0],a,t[0]),p(t[3],t[0],t[1]),0)}t.sign=function(t,e){const n=new Float64Array(64),o=[i(),i(),i(),i()],a=(0,r.hash)(t.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;const s=new Uint8Array(64);s.set(a.subarray(32),32);const f=new r.SHA512;f.update(s.subarray(32)),f.update(e);const u=f.digest();f.clean(),F(u),T(o,u),B(s,o),f.reset(),f.update(s.subarray(0,32)),f.update(t.subarray(32)),f.update(e);const h=f.digest();F(h);for(let t=0;t<32;t++)n[t]=u[t];for(let t=0;t<32;t++)for(let e=0;e<32;e++)n[t+e]+=h[t]*a[e];return R(s.subarray(32),n),s},t.verify=function(e,n,o){const a=new Uint8Array(32),s=[i(),i(),i(),i()],f=[i(),i(),i(),i()];if(o.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(G(f,e))return!1;const u=new r.SHA512;u.update(o.subarray(0,32)),u.update(e),u.update(n);const h=u.digest();return F(h),I(s,f,h),T(f,o.subarray(32)),U(s,f),B(a,s),!b(o,a)},t.convertPublicKeyToX25519=function(t){let e=[i(),i(),i(),i()];if(G(e,t))throw new Error("Ed25519: invalid public key");let r=i(),n=i(),o=e[1];g(r,f,o),M(n,f,o),A(n,n),p(r,r,n);let a=new Uint8Array(32);return _(a,r),a},t.convertSecretKeyToX25519=function(t){const e=(0,r.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;const n=new Uint8Array(e.subarray(0,32));return(0,o.wipe)(e),n}}(r);var A={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=n,r=s;function o(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;const i=new Uint8Array(32);i[0]=9;const a=o([56129,1]);function f(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-65536*e}t[0]+=e-1+37*(e-1)}function u(t,e,r){const n=~(r-1);for(let r=0;r<16;r++){const o=n&(t[r]^e[r]);t[r]^=o,e[r]^=o}}function h(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function l(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function c(t,e,r){let n,o,i=0,a=0,s=0,f=0,u=0,h=0,l=0,c=0,d=0,y=0,E=0,w=0,_=0,b=0,v=0,L=0,g=0,M=0,p=0,m=0,S=0,A=0,U=0,H=0,B=0,I=0,T=0,K=0,N=0,R=0,F=0,G=r[0],P=r[1],O=r[2],C=r[3],D=r[4],Y=r[5],j=r[6],k=r[7],V=r[8],X=r[9],x=r[10],z=r[11],Z=r[12],$=r[13],q=r[14],J=r[15];n=e[0],i+=n*G,a+=n*P,s+=n*O,f+=n*C,u+=n*D,h+=n*Y,l+=n*j,c+=n*k,d+=n*V,y+=n*X,E+=n*x,w+=n*z,_+=n*Z,b+=n*$,v+=n*q,L+=n*J,n=e[1],a+=n*G,s+=n*P,f+=n*O,u+=n*C,h+=n*D,l+=n*Y,c+=n*j,d+=n*k,y+=n*V,E+=n*X,w+=n*x,_+=n*z,b+=n*Z,v+=n*$,L+=n*q,g+=n*J,n=e[2],s+=n*G,f+=n*P,u+=n*O,h+=n*C,l+=n*D,c+=n*Y,d+=n*j,y+=n*k,E+=n*V,w+=n*X,_+=n*x,b+=n*z,v+=n*Z,L+=n*$,g+=n*q,M+=n*J,n=e[3],f+=n*G,u+=n*P,h+=n*O,l+=n*C,c+=n*D,d+=n*Y,y+=n*j,E+=n*k,w+=n*V,_+=n*X,b+=n*x,v+=n*z,L+=n*Z,g+=n*$,M+=n*q,p+=n*J,n=e[4],u+=n*G,h+=n*P,l+=n*O,c+=n*C,d+=n*D,y+=n*Y,E+=n*j,w+=n*k,_+=n*V,b+=n*X,v+=n*x,L+=n*z,g+=n*Z,M+=n*$,p+=n*q,m+=n*J,n=e[5],h+=n*G,l+=n*P,c+=n*O,d+=n*C,y+=n*D,E+=n*Y,w+=n*j,_+=n*k,b+=n*V,v+=n*X,L+=n*x,g+=n*z,M+=n*Z,p+=n*$,m+=n*q,S+=n*J,n=e[6],l+=n*G,c+=n*P,d+=n*O,y+=n*C,E+=n*D,w+=n*Y,_+=n*j,b+=n*k,v+=n*V,L+=n*X,g+=n*x,M+=n*z,p+=n*Z,m+=n*$,S+=n*q,A+=n*J,n=e[7],c+=n*G,d+=n*P,y+=n*O,E+=n*C,w+=n*D,_+=n*Y,b+=n*j,v+=n*k,L+=n*V,g+=n*X,M+=n*x,p+=n*z,m+=n*Z,S+=n*$,A+=n*q,U+=n*J,n=e[8],d+=n*G,y+=n*P,E+=n*O,w+=n*C,_+=n*D,b+=n*Y,v+=n*j,L+=n*k,g+=n*V,M+=n*X,p+=n*x,m+=n*z,S+=n*Z,A+=n*$,U+=n*q,H+=n*J,n=e[9],y+=n*G,E+=n*P,w+=n*O,_+=n*C,b+=n*D,v+=n*Y,L+=n*j,g+=n*k,M+=n*V,p+=n*X,m+=n*x,S+=n*z,A+=n*Z,U+=n*$,H+=n*q,B+=n*J,n=e[10],E+=n*G,w+=n*P,_+=n*O,b+=n*C,v+=n*D,L+=n*Y,g+=n*j,M+=n*k,p+=n*V,m+=n*X,S+=n*x,A+=n*z,U+=n*Z,H+=n*$,B+=n*q,I+=n*J,n=e[11],w+=n*G,_+=n*P,b+=n*O,v+=n*C,L+=n*D,g+=n*Y,M+=n*j,p+=n*k,m+=n*V,S+=n*X,A+=n*x,U+=n*z,H+=n*Z,B+=n*$,I+=n*q,T+=n*J,n=e[12],_+=n*G,b+=n*P,v+=n*O,L+=n*C,g+=n*D,M+=n*Y,p+=n*j,m+=n*k,S+=n*V,A+=n*X,U+=n*x,H+=n*z,B+=n*Z,I+=n*$,T+=n*q,K+=n*J,n=e[13],b+=n*G,v+=n*P,L+=n*O,g+=n*C,M+=n*D,p+=n*Y,m+=n*j,S+=n*k,A+=n*V,U+=n*X,H+=n*x,B+=n*z,I+=n*Z,T+=n*$,K+=n*q,N+=n*J,n=e[14],v+=n*G,L+=n*P,g+=n*O,M+=n*C,p+=n*D,m+=n*Y,S+=n*j,A+=n*k,U+=n*V,H+=n*X,B+=n*x,I+=n*z,T+=n*Z,K+=n*$,N+=n*q,R+=n*J,n=e[15],L+=n*G,g+=n*P,M+=n*O,p+=n*C,m+=n*D,S+=n*Y,A+=n*j,U+=n*k,H+=n*V,B+=n*X,I+=n*x,T+=n*z,K+=n*Z,N+=n*$,R+=n*q,F+=n*J,i+=38*g,a+=38*M,s+=38*p,f+=38*m,u+=38*S,h+=38*A,l+=38*U,c+=38*H,d+=38*B,y+=38*I,E+=38*T,w+=38*K,_+=38*N,b+=38*R,v+=38*F,o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),t[0]=i,t[1]=a,t[2]=s,t[3]=f,t[4]=u,t[5]=h,t[6]=l,t[7]=c,t[8]=d,t[9]=y,t[10]=E,t[11]=w,t[12]=_,t[13]=b,t[14]=v,t[15]=L}function d(t,e){c(t,e,e)}function y(t,e){const r=new Uint8Array(32),n=new Float64Array(80),i=o(),s=o(),y=o(),E=o(),w=o(),_=o();for(let e=0;e<31;e++)r[e]=t[e];r[31]=127&t[31]|64,r[0]&=248,function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(n,e);for(let t=0;t<16;t++)s[t]=n[t];i[0]=E[0]=1;for(let t=254;t>=0;--t){const e=r[t>>>3]>>>(7&t)&1;u(i,s,e),u(y,E,e),h(w,i,y),l(i,i,y),h(y,s,E),l(s,s,E),d(E,w),d(_,i),c(i,y,i),c(y,s,w),h(w,i,y),l(i,i,y),d(s,i),l(y,E,_),c(i,y,a),h(i,i,E),c(y,y,i),c(i,E,_),c(E,s,n),d(s,w),u(i,s,e),u(y,E,e)}for(let t=0;t<16;t++)n[t+16]=i[t],n[t+32]=y[t],n[t+48]=s[t],n[t+64]=E[t];const b=n.subarray(32),v=n.subarray(16);!function(t,e){const r=o();for(let t=0;t<16;t++)r[t]=e[t];for(let t=253;t>=0;t--)d(r,r),2!==t&&4!==t&&c(r,r,e);for(let e=0;e<16;e++)t[e]=r[e]}(b,b),c(v,v,b);const L=new Uint8Array(32);return function(t,e){const r=o(),n=o();for(let t=0;t<16;t++)n[t]=e[t];f(n),f(n),f(n);for(let t=0;t<2;t++){r[0]=n[0]-65517;for(let t=1;t<15;t++)r[t]=n[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,u(n,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&n[e],t[2*e+1]=n[e]>>8}(L,v),L}function E(t){return y(t,i)}function w(e){if(e.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const r=new Uint8Array(e);return{publicKey:E(r),secretKey:r}}t.scalarMult=y,t.scalarMultBase=E,t.generateKeyPairFromSeed=w,t.generateKeyPair=function(t){const n=(0,e.randomBytes)(32,t),o=w(n);return(0,r.wipe)(n),o},t.sharedKey=function(e,r,n=!1){if(e.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(r.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const o=y(e,r);if(n){let t=0;for(let e=0;e<o.length;e++)t|=o[e];if(0===t)throw new Error("X25519: invalid shared key")}return o}}(A);export{r as e,A as x};
1
+ import{c as t}from"./_commonjs-dynamic-modules-F7P8sER7-BHR_E30J.js";import{s as e}from"./main.js";var r={},n={},o={},i={};Object.defineProperty(i,"__esModule",{value:!0}),i.BrowserRandomSource=void 0;i.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t<e.length;t+=65536)this._crypto.getRandomValues(e.subarray(t,t+Math.min(e.length-t,65536)));return e}};var a={},s={};Object.defineProperty(s,"__esModule",{value:!0}),s.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t},Object.defineProperty(a,"__esModule",{value:!0}),a.NodeRandomSource=void 0;const f=s;a.NodeRandomSource=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,void 0!==t){const t=e;t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t<r.length;t++)r[t]=e[t];return(0,f.wipe)(e),r}},Object.defineProperty(o,"__esModule",{value:!0}),o.SystemRandomSource=void 0;const u=i,h=a;o.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new u.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new h.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}};var l,c={},d={};l=d,Object.defineProperty(l,"__esModule",{value:!0}),l.mul=Math.imul||function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16&65535)*n+r*(e>>>16&65535)<<16>>>0)|0},l.add=function(t,e){return t+e|0},l.sub=function(t,e){return t-e|0},l.rotl=function(t,e){return t<<e|t>>>32-e},l.rotr=function(t,e){return t<<32-e|t>>>e},l.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},l.MAX_SAFE_INTEGER=9007199254740991,l.isSafeInteger=function(t){return l.isInteger(t)&&t>=-l.MAX_SAFE_INTEGER&&t<=l.MAX_SAFE_INTEGER},Object.defineProperty(c,"__esModule",{value:!0});var y=d;function E(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function w(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function _(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function b(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function v(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function L(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function g(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function M(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function p(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),g(t/4294967296>>>0,e,r),g(t>>>0,e,r+4),e}function m(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),M(t>>>0,e,r),M(t/4294967296>>>0,e,r+4),e}c.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},c.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},c.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},c.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},c.writeUint16BE=E,c.writeInt16BE=E,c.writeUint16LE=w,c.writeInt16LE=w,c.readInt32BE=_,c.readUint32BE=b,c.readInt32LE=v,c.readUint32LE=L,c.writeUint32BE=g,c.writeInt32BE=g,c.writeUint32LE=M,c.writeInt32LE=M,c.readInt64BE=function(t,e){void 0===e&&(e=0);var r=_(t,e),n=_(t,e+4);return 4294967296*r+n-4294967296*(n>>31)},c.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*b(t,e)+b(t,e+4)},c.readInt64LE=function(t,e){void 0===e&&(e=0);var r=v(t,e);return 4294967296*v(t,e+4)+r-4294967296*(r>>31)},c.readUint64LE=function(t,e){void 0===e&&(e=0);var r=L(t,e);return 4294967296*L(t,e+4)+r},c.writeUint64BE=p,c.writeInt64BE=p,c.writeUint64LE=m,c.writeInt64LE=m,c.readUintBE=function(t,e,r){if(void 0===r&&(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,o=1,i=t/8+r-1;i>=r;i--)n+=e[i]*o,o*=256;return n},c.readUintLE=function(t,e,r){if(void 0===r&&(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,o=1,i=r;i<r+t/8;i++)n+=e[i]*o,o*=256;return n},c.writeUintBE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!y.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var o=1,i=t/8+n-1;i>=n;i--)r[i]=e/o&255,o*=256;return r},c.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!y.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,i=n;i<n+t/8;i++)r[i]=e/o&255,o*=256;return r},c.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},c.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},c.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},c.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},c.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},c.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},c.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},c.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=o,r=c,n=s;function i(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new e.SystemRandomSource,t.randomBytes=i,t.randomUint32=function(e=t.defaultRandomSource){const o=i(4,e),a=(0,r.readUint32LE)(o);return(0,n.wipe)(o),a};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(e,r=a,o=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let s="";const f=r.length,u=256-256%f;for(;e>0;){const t=i(Math.ceil(256*e/u),o);for(let n=0;n<t.length&&e>0;n++){const o=t[n];o<u&&(s+=r.charAt(o%f),e--)}(0,n.wipe)(t)}return s}t.randomString=f,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return f(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}}(n);var S={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=c,r=s;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function n(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.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 n.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},n.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},n.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},n.prototype.update=function(e,r){if(void 0===r&&(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<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(i(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=i(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},n.prototype.finish=function(t){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,o=r/536870912|0,a=r<<3,s=r%128<112?128:256;this._buffer[n]=128;for(var f=n+1;f<s-8;f++)this._buffer[f]=0;e.writeUint32BE(o,this._buffer,s-8),e.writeUint32BE(a,this._buffer,s-4),i(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(f=0;f<this.digestLength/8;f++)e.writeUint32BE(this._stateHi[f],t,8*f),e.writeUint32BE(this._stateLo[f],t,8*f+4);return this},n.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},n.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}},n.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},n.prototype.cleanSavedState=function(t){r.wipe(t.stateHi),r.wipe(t.stateLo),t.buffer&&r.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},n}();t.SHA512=n;var o=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 i(t,r,n,i,a,s,f){for(var u,h,l,c,d,y,E,w,_=n[0],b=n[1],v=n[2],L=n[3],g=n[4],M=n[5],p=n[6],m=n[7],S=i[0],A=i[1],U=i[2],H=i[3],B=i[4],I=i[5],T=i[6],K=i[7];f>=128;){for(var N=0;N<16;N++){var R=8*N+s;t[N]=e.readUint32BE(a,R),r[N]=e.readUint32BE(a,R+4)}for(N=0;N<80;N++){var F,G,P=_,O=b,C=v,D=L,Y=g,j=M,k=p,V=S,X=A,x=U,z=H,Z=B,$=I,q=T;if(d=65535&(h=K),y=h>>>16,E=65535&(u=m),w=u>>>16,d+=65535&(h=(B>>>14|g<<18)^(B>>>18|g<<14)^(g>>>9|B<<23)),y+=h>>>16,E+=65535&(u=(g>>>14|B<<18)^(g>>>18|B<<14)^(B>>>9|g<<23)),w+=u>>>16,d+=65535&(h=B&I^~B&T),y+=h>>>16,E+=65535&(u=g&M^~g&p),w+=u>>>16,u=o[2*N],d+=65535&(h=o[2*N+1]),y+=h>>>16,E+=65535&u,w+=u>>>16,u=t[N%16],y+=(h=r[N%16])>>>16,E+=65535&u,w+=u>>>16,E+=(y+=(d+=65535&h)>>>16)>>>16,d=65535&(h=c=65535&d|y<<16),y=h>>>16,E=65535&(u=l=65535&E|(w+=E>>>16)<<16),w=u>>>16,d+=65535&(h=(S>>>28|_<<4)^(_>>>2|S<<30)^(_>>>7|S<<25)),y+=h>>>16,E+=65535&(u=(_>>>28|S<<4)^(S>>>2|_<<30)^(S>>>7|_<<25)),w+=u>>>16,y+=(h=S&A^S&U^A&U)>>>16,E+=65535&(u=_&b^_&v^b&v),w+=u>>>16,F=65535&(E+=(y+=(d+=65535&h)>>>16)>>>16)|(w+=E>>>16)<<16,G=65535&d|y<<16,d=65535&(h=z),y=h>>>16,E=65535&(u=D),w=u>>>16,y+=(h=c)>>>16,E+=65535&(u=l),w+=u>>>16,b=P,v=O,L=C,g=D=65535&(E+=(y+=(d+=65535&h)>>>16)>>>16)|(w+=E>>>16)<<16,M=Y,p=j,m=k,_=F,A=V,U=X,H=x,B=z=65535&d|y<<16,I=Z,T=$,K=q,S=G,N%16==15)for(R=0;R<16;R++)u=t[R],d=65535&(h=r[R]),y=h>>>16,E=65535&u,w=u>>>16,u=t[(R+9)%16],d+=65535&(h=r[(R+9)%16]),y+=h>>>16,E+=65535&u,w+=u>>>16,l=t[(R+1)%16],d+=65535&(h=((c=r[(R+1)%16])>>>1|l<<31)^(c>>>8|l<<24)^(c>>>7|l<<25)),y+=h>>>16,E+=65535&(u=(l>>>1|c<<31)^(l>>>8|c<<24)^l>>>7),w+=u>>>16,l=t[(R+14)%16],y+=(h=((c=r[(R+14)%16])>>>19|l<<13)^(l>>>29|c<<3)^(c>>>6|l<<26))>>>16,E+=65535&(u=(l>>>19|c<<13)^(c>>>29|l<<3)^l>>>6),w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,t[R]=65535&E|w<<16,r[R]=65535&d|y<<16}d=65535&(h=S),y=h>>>16,E=65535&(u=_),w=u>>>16,u=n[0],y+=(h=i[0])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[0]=_=65535&E|w<<16,i[0]=S=65535&d|y<<16,d=65535&(h=A),y=h>>>16,E=65535&(u=b),w=u>>>16,u=n[1],y+=(h=i[1])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[1]=b=65535&E|w<<16,i[1]=A=65535&d|y<<16,d=65535&(h=U),y=h>>>16,E=65535&(u=v),w=u>>>16,u=n[2],y+=(h=i[2])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[2]=v=65535&E|w<<16,i[2]=U=65535&d|y<<16,d=65535&(h=H),y=h>>>16,E=65535&(u=L),w=u>>>16,u=n[3],y+=(h=i[3])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[3]=L=65535&E|w<<16,i[3]=H=65535&d|y<<16,d=65535&(h=B),y=h>>>16,E=65535&(u=g),w=u>>>16,u=n[4],y+=(h=i[4])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[4]=g=65535&E|w<<16,i[4]=B=65535&d|y<<16,d=65535&(h=I),y=h>>>16,E=65535&(u=M),w=u>>>16,u=n[5],y+=(h=i[5])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[5]=M=65535&E|w<<16,i[5]=I=65535&d|y<<16,d=65535&(h=T),y=h>>>16,E=65535&(u=p),w=u>>>16,u=n[6],y+=(h=i[6])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[6]=p=65535&E|w<<16,i[6]=T=65535&d|y<<16,d=65535&(h=K),y=h>>>16,E=65535&(u=m),w=u>>>16,u=n[7],y+=(h=i[7])>>>16,E+=65535&u,w+=u>>>16,w+=(E+=(y+=(d+=65535&h)>>>16)>>>16)>>>16,n[7]=m=65535&E|w<<16,i[7]=K=65535&d|y<<16,s+=128,f-=128}return s}t.hash=function(t){var e=new n;e.update(t);var r=e.digest();return e.clean(),r}}(S),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=n,r=S,o=s;function i(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;new Uint8Array(32)[0]=9;const a=i(),f=i([1]),u=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),c=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(t,e){for(let r=0;r<16;r++)t[r]=0|e[r]}function E(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-65536*e}t[0]+=e-1+37*(e-1)}function w(t,e,r){const n=~(r-1);for(let r=0;r<16;r++){const o=n&(t[r]^e[r]);t[r]^=o,e[r]^=o}}function _(t,e){const r=i(),n=i();for(let t=0;t<16;t++)n[t]=e[t];E(n),E(n),E(n);for(let t=0;t<2;t++){r[0]=n[0]-65517;for(let t=1;t<15;t++)r[t]=n[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,w(n,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&n[e],t[2*e+1]=n[e]>>8}function b(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}function v(t,e){const r=new Uint8Array(32),n=new Uint8Array(32);return _(r,t),_(n,e),b(r,n)}function L(t){const e=new Uint8Array(32);return _(e,t),1&e[0]}function g(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function M(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function p(t,e,r){let n,o,i=0,a=0,s=0,f=0,u=0,h=0,l=0,c=0,d=0,y=0,E=0,w=0,_=0,b=0,v=0,L=0,g=0,M=0,p=0,m=0,S=0,A=0,U=0,H=0,B=0,I=0,T=0,K=0,N=0,R=0,F=0,G=r[0],P=r[1],O=r[2],C=r[3],D=r[4],Y=r[5],j=r[6],k=r[7],V=r[8],X=r[9],x=r[10],z=r[11],Z=r[12],$=r[13],q=r[14],J=r[15];n=e[0],i+=n*G,a+=n*P,s+=n*O,f+=n*C,u+=n*D,h+=n*Y,l+=n*j,c+=n*k,d+=n*V,y+=n*X,E+=n*x,w+=n*z,_+=n*Z,b+=n*$,v+=n*q,L+=n*J,n=e[1],a+=n*G,s+=n*P,f+=n*O,u+=n*C,h+=n*D,l+=n*Y,c+=n*j,d+=n*k,y+=n*V,E+=n*X,w+=n*x,_+=n*z,b+=n*Z,v+=n*$,L+=n*q,g+=n*J,n=e[2],s+=n*G,f+=n*P,u+=n*O,h+=n*C,l+=n*D,c+=n*Y,d+=n*j,y+=n*k,E+=n*V,w+=n*X,_+=n*x,b+=n*z,v+=n*Z,L+=n*$,g+=n*q,M+=n*J,n=e[3],f+=n*G,u+=n*P,h+=n*O,l+=n*C,c+=n*D,d+=n*Y,y+=n*j,E+=n*k,w+=n*V,_+=n*X,b+=n*x,v+=n*z,L+=n*Z,g+=n*$,M+=n*q,p+=n*J,n=e[4],u+=n*G,h+=n*P,l+=n*O,c+=n*C,d+=n*D,y+=n*Y,E+=n*j,w+=n*k,_+=n*V,b+=n*X,v+=n*x,L+=n*z,g+=n*Z,M+=n*$,p+=n*q,m+=n*J,n=e[5],h+=n*G,l+=n*P,c+=n*O,d+=n*C,y+=n*D,E+=n*Y,w+=n*j,_+=n*k,b+=n*V,v+=n*X,L+=n*x,g+=n*z,M+=n*Z,p+=n*$,m+=n*q,S+=n*J,n=e[6],l+=n*G,c+=n*P,d+=n*O,y+=n*C,E+=n*D,w+=n*Y,_+=n*j,b+=n*k,v+=n*V,L+=n*X,g+=n*x,M+=n*z,p+=n*Z,m+=n*$,S+=n*q,A+=n*J,n=e[7],c+=n*G,d+=n*P,y+=n*O,E+=n*C,w+=n*D,_+=n*Y,b+=n*j,v+=n*k,L+=n*V,g+=n*X,M+=n*x,p+=n*z,m+=n*Z,S+=n*$,A+=n*q,U+=n*J,n=e[8],d+=n*G,y+=n*P,E+=n*O,w+=n*C,_+=n*D,b+=n*Y,v+=n*j,L+=n*k,g+=n*V,M+=n*X,p+=n*x,m+=n*z,S+=n*Z,A+=n*$,U+=n*q,H+=n*J,n=e[9],y+=n*G,E+=n*P,w+=n*O,_+=n*C,b+=n*D,v+=n*Y,L+=n*j,g+=n*k,M+=n*V,p+=n*X,m+=n*x,S+=n*z,A+=n*Z,U+=n*$,H+=n*q,B+=n*J,n=e[10],E+=n*G,w+=n*P,_+=n*O,b+=n*C,v+=n*D,L+=n*Y,g+=n*j,M+=n*k,p+=n*V,m+=n*X,S+=n*x,A+=n*z,U+=n*Z,H+=n*$,B+=n*q,I+=n*J,n=e[11],w+=n*G,_+=n*P,b+=n*O,v+=n*C,L+=n*D,g+=n*Y,M+=n*j,p+=n*k,m+=n*V,S+=n*X,A+=n*x,U+=n*z,H+=n*Z,B+=n*$,I+=n*q,T+=n*J,n=e[12],_+=n*G,b+=n*P,v+=n*O,L+=n*C,g+=n*D,M+=n*Y,p+=n*j,m+=n*k,S+=n*V,A+=n*X,U+=n*x,H+=n*z,B+=n*Z,I+=n*$,T+=n*q,K+=n*J,n=e[13],b+=n*G,v+=n*P,L+=n*O,g+=n*C,M+=n*D,p+=n*Y,m+=n*j,S+=n*k,A+=n*V,U+=n*X,H+=n*x,B+=n*z,I+=n*Z,T+=n*$,K+=n*q,N+=n*J,n=e[14],v+=n*G,L+=n*P,g+=n*O,M+=n*C,p+=n*D,m+=n*Y,S+=n*j,A+=n*k,U+=n*V,H+=n*X,B+=n*x,I+=n*z,T+=n*Z,K+=n*$,N+=n*q,R+=n*J,n=e[15],L+=n*G,g+=n*P,M+=n*O,p+=n*C,m+=n*D,S+=n*Y,A+=n*j,U+=n*k,H+=n*V,B+=n*X,I+=n*x,T+=n*z,K+=n*Z,N+=n*$,R+=n*q,F+=n*J,i+=38*g,a+=38*M,s+=38*p,f+=38*m,u+=38*S,h+=38*A,l+=38*U,c+=38*H,d+=38*B,y+=38*I,E+=38*T,w+=38*K,_+=38*N,b+=38*R,v+=38*F,o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),t[0]=i,t[1]=a,t[2]=s,t[3]=f,t[4]=u,t[5]=h,t[6]=l,t[7]=c,t[8]=d,t[9]=y,t[10]=E,t[11]=w,t[12]=_,t[13]=b,t[14]=v,t[15]=L}function m(t,e){p(t,e,e)}function A(t,e){const r=i();let n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)m(r,r),2!==n&&4!==n&&p(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}function U(t,e){const r=i(),n=i(),o=i(),a=i(),s=i(),f=i(),u=i(),l=i(),c=i();M(r,t[1],t[0]),M(c,e[1],e[0]),p(r,r,c),g(n,t[0],t[1]),g(c,e[0],e[1]),p(n,n,c),p(o,t[3],e[3]),p(o,o,h),p(a,t[2],e[2]),g(a,a,a),M(s,n,r),M(f,a,o),g(u,a,o),g(l,n,r),p(t[0],s,f),p(t[1],l,u),p(t[2],u,f),p(t[3],s,l)}function H(t,e,r){for(let n=0;n<4;n++)w(t[n],e[n],r)}function B(t,e){const r=i(),n=i(),o=i();A(o,e[2]),p(r,e[0],o),p(n,e[1],o),_(t,n),t[31]^=L(r)<<7}function I(t,e,r){y(t[0],a),y(t[1],f),y(t[2],f),y(t[3],a);for(let n=255;n>=0;--n){const o=r[n/8|0]>>(7&n)&1;H(t,e,o),U(e,t),U(t,t),H(t,e,o)}}function T(t,e){const r=[i(),i(),i(),i()];y(r[0],l),y(r[1],c),y(r[2],f),p(r[3],l,c),I(t,r,e)}function K(e){if(e.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const n=(0,r.hash)(e);n[0]&=248,n[31]&=127,n[31]|=64;const o=new Uint8Array(32),a=[i(),i(),i(),i()];T(a,n),B(o,a);const s=new Uint8Array(64);return s.set(e),s.set(o,32),{publicKey:o,secretKey:s}}t.generateKeyPairFromSeed=K,t.generateKeyPair=function(t){const r=(0,e.randomBytes)(32,t),n=K(r);return(0,o.wipe)(r),n},t.extractPublicKeyFromSecretKey=function(e){if(e.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(e.subarray(32))};const N=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 R(t,e){let r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o<i;++o)e[o]+=r-16*e[n]*N[o-(n-32)],r=Math.floor((e[o]+128)/256),e[o]-=256*r;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;o++)e[o]+=r-(e[31]>>4)*N[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=r*N[o];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function F(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;R(t,e)}function G(t,e){const r=i(),n=i(),o=i(),s=i(),h=i(),l=i(),c=i();return y(t[2],f),function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(t[1],e),m(o,t[1]),p(s,o,u),M(o,o,t[2]),g(s,t[2],s),m(h,s),m(l,h),p(c,l,h),p(r,c,o),p(r,r,s),function(t,e){const r=i();let n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)m(r,r),1!==n&&p(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}(r,r),p(r,r,o),p(r,r,s),p(r,r,s),p(t[0],r,s),m(n,t[0]),p(n,n,s),v(n,o)&&p(t[0],t[0],d),m(n,t[0]),p(n,n,s),v(n,o)?-1:(L(t[0])===e[31]>>7&&M(t[0],a,t[0]),p(t[3],t[0],t[1]),0)}t.sign=function(t,e){const n=new Float64Array(64),o=[i(),i(),i(),i()],a=(0,r.hash)(t.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;const s=new Uint8Array(64);s.set(a.subarray(32),32);const f=new r.SHA512;f.update(s.subarray(32)),f.update(e);const u=f.digest();f.clean(),F(u),T(o,u),B(s,o),f.reset(),f.update(s.subarray(0,32)),f.update(t.subarray(32)),f.update(e);const h=f.digest();F(h);for(let t=0;t<32;t++)n[t]=u[t];for(let t=0;t<32;t++)for(let e=0;e<32;e++)n[t+e]+=h[t]*a[e];return R(s.subarray(32),n),s},t.verify=function(e,n,o){const a=new Uint8Array(32),s=[i(),i(),i(),i()],f=[i(),i(),i(),i()];if(o.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(G(f,e))return!1;const u=new r.SHA512;u.update(o.subarray(0,32)),u.update(e),u.update(n);const h=u.digest();return F(h),I(s,f,h),T(f,o.subarray(32)),U(s,f),B(a,s),!b(o,a)},t.convertPublicKeyToX25519=function(t){let e=[i(),i(),i(),i()];if(G(e,t))throw new Error("Ed25519: invalid public key");let r=i(),n=i(),o=e[1];g(r,f,o),M(n,f,o),A(n,n),p(r,r,n);let a=new Uint8Array(32);return _(a,r),a},t.convertSecretKeyToX25519=function(t){const e=(0,r.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;const n=new Uint8Array(e.subarray(0,32));return(0,o.wipe)(e),n}}(r);var A={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=n,r=s;function o(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;const i=new Uint8Array(32);i[0]=9;const a=o([56129,1]);function f(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-65536*e}t[0]+=e-1+37*(e-1)}function u(t,e,r){const n=~(r-1);for(let r=0;r<16;r++){const o=n&(t[r]^e[r]);t[r]^=o,e[r]^=o}}function h(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function l(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function c(t,e,r){let n,o,i=0,a=0,s=0,f=0,u=0,h=0,l=0,c=0,d=0,y=0,E=0,w=0,_=0,b=0,v=0,L=0,g=0,M=0,p=0,m=0,S=0,A=0,U=0,H=0,B=0,I=0,T=0,K=0,N=0,R=0,F=0,G=r[0],P=r[1],O=r[2],C=r[3],D=r[4],Y=r[5],j=r[6],k=r[7],V=r[8],X=r[9],x=r[10],z=r[11],Z=r[12],$=r[13],q=r[14],J=r[15];n=e[0],i+=n*G,a+=n*P,s+=n*O,f+=n*C,u+=n*D,h+=n*Y,l+=n*j,c+=n*k,d+=n*V,y+=n*X,E+=n*x,w+=n*z,_+=n*Z,b+=n*$,v+=n*q,L+=n*J,n=e[1],a+=n*G,s+=n*P,f+=n*O,u+=n*C,h+=n*D,l+=n*Y,c+=n*j,d+=n*k,y+=n*V,E+=n*X,w+=n*x,_+=n*z,b+=n*Z,v+=n*$,L+=n*q,g+=n*J,n=e[2],s+=n*G,f+=n*P,u+=n*O,h+=n*C,l+=n*D,c+=n*Y,d+=n*j,y+=n*k,E+=n*V,w+=n*X,_+=n*x,b+=n*z,v+=n*Z,L+=n*$,g+=n*q,M+=n*J,n=e[3],f+=n*G,u+=n*P,h+=n*O,l+=n*C,c+=n*D,d+=n*Y,y+=n*j,E+=n*k,w+=n*V,_+=n*X,b+=n*x,v+=n*z,L+=n*Z,g+=n*$,M+=n*q,p+=n*J,n=e[4],u+=n*G,h+=n*P,l+=n*O,c+=n*C,d+=n*D,y+=n*Y,E+=n*j,w+=n*k,_+=n*V,b+=n*X,v+=n*x,L+=n*z,g+=n*Z,M+=n*$,p+=n*q,m+=n*J,n=e[5],h+=n*G,l+=n*P,c+=n*O,d+=n*C,y+=n*D,E+=n*Y,w+=n*j,_+=n*k,b+=n*V,v+=n*X,L+=n*x,g+=n*z,M+=n*Z,p+=n*$,m+=n*q,S+=n*J,n=e[6],l+=n*G,c+=n*P,d+=n*O,y+=n*C,E+=n*D,w+=n*Y,_+=n*j,b+=n*k,v+=n*V,L+=n*X,g+=n*x,M+=n*z,p+=n*Z,m+=n*$,S+=n*q,A+=n*J,n=e[7],c+=n*G,d+=n*P,y+=n*O,E+=n*C,w+=n*D,_+=n*Y,b+=n*j,v+=n*k,L+=n*V,g+=n*X,M+=n*x,p+=n*z,m+=n*Z,S+=n*$,A+=n*q,U+=n*J,n=e[8],d+=n*G,y+=n*P,E+=n*O,w+=n*C,_+=n*D,b+=n*Y,v+=n*j,L+=n*k,g+=n*V,M+=n*X,p+=n*x,m+=n*z,S+=n*Z,A+=n*$,U+=n*q,H+=n*J,n=e[9],y+=n*G,E+=n*P,w+=n*O,_+=n*C,b+=n*D,v+=n*Y,L+=n*j,g+=n*k,M+=n*V,p+=n*X,m+=n*x,S+=n*z,A+=n*Z,U+=n*$,H+=n*q,B+=n*J,n=e[10],E+=n*G,w+=n*P,_+=n*O,b+=n*C,v+=n*D,L+=n*Y,g+=n*j,M+=n*k,p+=n*V,m+=n*X,S+=n*x,A+=n*z,U+=n*Z,H+=n*$,B+=n*q,I+=n*J,n=e[11],w+=n*G,_+=n*P,b+=n*O,v+=n*C,L+=n*D,g+=n*Y,M+=n*j,p+=n*k,m+=n*V,S+=n*X,A+=n*x,U+=n*z,H+=n*Z,B+=n*$,I+=n*q,T+=n*J,n=e[12],_+=n*G,b+=n*P,v+=n*O,L+=n*C,g+=n*D,M+=n*Y,p+=n*j,m+=n*k,S+=n*V,A+=n*X,U+=n*x,H+=n*z,B+=n*Z,I+=n*$,T+=n*q,K+=n*J,n=e[13],b+=n*G,v+=n*P,L+=n*O,g+=n*C,M+=n*D,p+=n*Y,m+=n*j,S+=n*k,A+=n*V,U+=n*X,H+=n*x,B+=n*z,I+=n*Z,T+=n*$,K+=n*q,N+=n*J,n=e[14],v+=n*G,L+=n*P,g+=n*O,M+=n*C,p+=n*D,m+=n*Y,S+=n*j,A+=n*k,U+=n*V,H+=n*X,B+=n*x,I+=n*z,T+=n*Z,K+=n*$,N+=n*q,R+=n*J,n=e[15],L+=n*G,g+=n*P,M+=n*O,p+=n*C,m+=n*D,S+=n*Y,A+=n*j,U+=n*k,H+=n*V,B+=n*X,I+=n*x,T+=n*z,K+=n*Z,N+=n*$,R+=n*q,F+=n*J,i+=38*g,a+=38*M,s+=38*p,f+=38*m,u+=38*S,h+=38*A,l+=38*U,c+=38*H,d+=38*B,y+=38*I,E+=38*T,w+=38*K,_+=38*N,b+=38*R,v+=38*F,o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=E+o+65535,o=Math.floor(n/65536),E=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=_+o+65535,o=Math.floor(n/65536),_=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=L+o+65535,o=Math.floor(n/65536),L=n-65536*o,i+=o-1+37*(o-1),t[0]=i,t[1]=a,t[2]=s,t[3]=f,t[4]=u,t[5]=h,t[6]=l,t[7]=c,t[8]=d,t[9]=y,t[10]=E,t[11]=w,t[12]=_,t[13]=b,t[14]=v,t[15]=L}function d(t,e){c(t,e,e)}function y(t,e){const r=new Uint8Array(32),n=new Float64Array(80),i=o(),s=o(),y=o(),E=o(),w=o(),_=o();for(let e=0;e<31;e++)r[e]=t[e];r[31]=127&t[31]|64,r[0]&=248,function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(n,e);for(let t=0;t<16;t++)s[t]=n[t];i[0]=E[0]=1;for(let t=254;t>=0;--t){const e=r[t>>>3]>>>(7&t)&1;u(i,s,e),u(y,E,e),h(w,i,y),l(i,i,y),h(y,s,E),l(s,s,E),d(E,w),d(_,i),c(i,y,i),c(y,s,w),h(w,i,y),l(i,i,y),d(s,i),l(y,E,_),c(i,y,a),h(i,i,E),c(y,y,i),c(i,E,_),c(E,s,n),d(s,w),u(i,s,e),u(y,E,e)}for(let t=0;t<16;t++)n[t+16]=i[t],n[t+32]=y[t],n[t+48]=s[t],n[t+64]=E[t];const b=n.subarray(32),v=n.subarray(16);!function(t,e){const r=o();for(let t=0;t<16;t++)r[t]=e[t];for(let t=253;t>=0;t--)d(r,r),2!==t&&4!==t&&c(r,r,e);for(let e=0;e<16;e++)t[e]=r[e]}(b,b),c(v,v,b);const L=new Uint8Array(32);return function(t,e){const r=o(),n=o();for(let t=0;t<16;t++)n[t]=e[t];f(n),f(n),f(n);for(let t=0;t<2;t++){r[0]=n[0]-65517;for(let t=1;t<15;t++)r[t]=n[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,u(n,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&n[e],t[2*e+1]=n[e]>>8}(L,v),L}function E(t){return y(t,i)}function w(e){if(e.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const r=new Uint8Array(e);return{publicKey:E(r),secretKey:r}}t.scalarMult=y,t.scalarMultBase=E,t.generateKeyPairFromSeed=w,t.generateKeyPair=function(t){const n=(0,e.randomBytes)(32,t),o=w(n);return(0,r.wipe)(n),o},t.sharedKey=function(e,r,n=!1){if(e.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(r.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const o=y(e,r);if(n){let t=0;for(let e=0;e<o.length;e++)t|=o[e];if(0===t)throw new Error("X25519: invalid shared key")}return o}}(A);export{r as e,A as x};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockcerts/blockcerts-verifier",
3
- "version": "1.60.0",
3
+ "version": "1.61.0",
4
4
  "description": "A standalone universal viewer and verifier for blockcerts credentials",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@
11
11
  "node": ">=18.0.0 <19.0.0"
12
12
  },
13
13
  "dependencies": {
14
- "@blockcerts/cert-verifier-js": "^6.11.0",
14
+ "@blockcerts/cert-verifier-js": "^6.13.0",
15
15
  "@blockcerts/cert-verifier-js-v1-legacy": "^4.0.1",
16
16
  "@polymer/lit-element": "0.5.1",
17
17
  "@polymer/polymer": "3.5.1",
@@ -42,7 +42,7 @@
42
42
  "@types/jest": "^29.5.8",
43
43
  "@types/qrcode-svg": "^1.1.1",
44
44
  "@types/sinon": "^17.0.1",
45
- "@typescript-eslint/eslint-plugin": "^6.10.0",
45
+ "@typescript-eslint/eslint-plugin": "^7.1.1",
46
46
  "@typescript-eslint/parser": "^6.10.0",
47
47
  "codecov": "^3.8.3",
48
48
  "concurrently": "^8.2.0",
@@ -1,4 +0,0 @@
1
- import{a as e,t,p as r,B as i,d as n,h as o,f as s,V as a,u as h,v as u,w as c,g as l}from"./main.js";import{j as d}from"./jsonld-signatures-mX3uMDo8-kWFWdwsD.js";import{j as f}from"./jsonld-SAOezr4P-ioHKtwiZ.js";import{s as p,b as y,d as b,r as _,a as w,k as g,e as v}from"./index-o5NaLUcd-9ST97EHw.js";import{r as m,i as E,e as S}from"./elliptic-xyZmv-oA-VPyWJbY1.js";import{d as k,e as R}from"./index-CZOUZnn4-Lnb5-WZi.js";import{S as T}from"./Suite-Bhitn5l3-e2QgHGhx.js";import"./pako.esm-jjCKMBM4-RAILONW0.js";import"./sha256-lGrd_b3t-9eo2gOQb.js";import"./index-aBVDu34R-o1HUYRUQ.js";var M,x,A={exports:{}},K={},L=h(u),I=L.EventEmitter;function O(e,t){C(e,t),P(e)}function P(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function C(e,t){e.emit("error",t)}var D={destroy:function(e,r){var i=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t(C,this,e)):t(C,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!r&&e?i._writableState?i._writableState.errorEmitted?t(P,i):(i._writableState.errorEmitted=!0,t(O,i,e)):t(O,i,e):r?(t(P,i),r(e)):t(P,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}},B={};var N={};function j(e,t,r){r||(r=Error);var i=function(e){var r,i;function n(r,i,n){return e.call(this,function(e,r,i){return"string"==typeof t?t:t(e,r,i)}(r,i,n))||this}return i=e,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n}(r);i.prototype.name=r.name,i.prototype.code=e,N[e]=i}function U(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}j("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),j("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(U(t,"type"));else{var a=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(a," ").concat(i," ").concat(U(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),j("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),j("ERR_STREAM_PREMATURE_CLOSE","Premature close"),j("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),j("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),j("ERR_STREAM_WRITE_AFTER_END","write after end"),j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),j("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),B.codes=N;var V=B.codes.ERR_INVALID_OPT_VALUE;var q,W={getHighWaterMark:function(e,t,r,i){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new V(i?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}},F={};function z(){if(q)return F;q=1;var e=p.Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var i;switch(this.encoding=function(r){var i=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof i&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return i||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,i=4;break;case"utf8":this.fillLast=n,i=4;break;case"base64":this.text=a,this.end=h,i=3;break;default:return this.write=u,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(i)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function a(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function c(e){return e&&e.length?this.write(e):""}return F.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},F}var H=B.codes.ERR_STREAM_PREMATURE_CLOSE;function $(){}var Z,X,G,J,Y=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}(i||$);var n=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||h()},a=t._writableState&&t._writableState.finished,h=function(){o=!1,a=!0,n||i.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,o||i.call(t)},l=function(e){i.call(t,e)},d=function(){var e;return n&&!u?(t._readableState&&t._readableState.ended||(e=new H),i.call(t,e)):o&&!a?(t._writableState&&t._writableState.ended||(e=new H),i.call(t,e)):void 0},f=function(){t.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?o&&!t._writableState&&(t.on("end",s),t.on("close",s)):(t.on("complete",h),t.on("abort",d),t.req?f():t.on("request",f)),t.on("end",c),t.on("finish",h),!1!==r.error&&t.on("error",l),t.on("close",d),function(){t.removeListener("complete",h),t.removeListener("abort",d),t.removeListener("request",f),t.req&&t.req.removeListener("finish",h),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",h),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",d)}};function Q(){if(X)return Z;var e;function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}X=1;var i=Y,n=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),a=Symbol("ended"),h=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function l(e,t){return{value:e,done:t}}function d(e){var t=e[n];if(null!==t){var r=e[c].read();null!==r&&(e[h]=null,e[n]=null,e[o]=null,t(l(r,!1)))}}function f(e){t(d,e)}var p=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((r(e={get stream(){return this[c]},next:function(){var e=this,r=this[s];if(null!==r)return Promise.reject(r);if(this[a])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(r,i){t((function(){e[s]?i(e[s]):r(l(void 0,!0))}))}));var i,n=this[h];if(n)i=new Promise(function(e,t){return function(r,i){e.then((function(){t[a]?r(l(void 0,!0)):t[u](r,i)}),i)}}(n,this));else{var o=this[c].read();if(null!==o)return Promise.resolve(l(o,!1));i=new Promise(this[u])}return this[h]=i,i}},Symbol.asyncIterator,(function(){return this})),r(e,"return",(function(){var e=this;return new Promise((function(t,r){e[c].destroy(null,(function(e){e?r(e):t(l(void 0,!0))}))}))})),e),p);return Z=function(e){var t,d=Object.create(y,(r(t={},c,{value:e,writable:!0}),r(t,n,{value:null,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:e._readableState.endEmitted,writable:!0}),r(t,u,{value:function(e,t){var r=d[c].read();r?(d[h]=null,d[n]=null,d[o]=null,e(l(r,!1))):(d[n]=e,d[o]=t)},writable:!0}),t));return d[h]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=d[o];return null!==t&&(d[h]=null,d[n]=null,d[o]=null,t(e)),void(d[s]=e)}var r=d[n];null!==r&&(d[h]=null,d[n]=null,d[o]=null,r(l(void 0,!0))),d[a]=!0})),e.on("readable",f.bind(null,d)),d}}const ee=K;ee.Readable=me,me.ReadableState=ve,L.EventEmitter;var te=function(e,t){return e.listeners(t).length},re=I,ie=m.Buffer,ne=e.Uint8Array||function(){};var oe,se=w;oe=se&&se.debuglog?se.debuglog("stream"):function(){};var ae,he,ue,ce=function(){if(x)return M;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}x=1;var i=m.Buffer,n=w.inspect,o=n&&n.custom||"inspect";return M=function(){function s(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),this.head=null,this.tail=null,this.length=0}var a,h,u;return a=s,h=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t,r,n,o=i.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=o,n=a,i.prototype.copy.call(t,r,n),a+=s.data.length,s=s.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,o=e>n.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0==(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,s),0==(e-=s)){s===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(s));break}++n}return this.length-=n,t}},{key:o,value:function(r,i){return n(this,function(r){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}({},i,{depth:0,customInspect:!1}))}}],h&&r(a.prototype,h),u&&r(a,u),s}(),M}(),le=D,de=W.getHighWaterMark,fe=B.codes,pe=fe.ERR_INVALID_ARG_TYPE,ye=fe.ERR_STREAM_PUSH_AFTER_EOF,be=fe.ERR_METHOD_NOT_IMPLEMENTED,_e=fe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;E(me,re);var we=le.errorOrDestroy,ge=["error","close","destroy","pause","resume"];function ve(e,t,r){e=e||{},"boolean"!=typeof r&&(r=t instanceof ee.Duplex),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=de(this,e,"readableHighWaterMark",r),this.buffer=new ce,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(ae||(ae=z().StringDecoder),this.decoder=new ae(e.encoding),this.encoding=e.encoding)}function me(e){if(!(this instanceof me))return new me(e);var t=this instanceof ee.Duplex;this._readableState=new ve(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),re.call(this)}function Ee(e,t,r,i,n){oe("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(oe("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Te(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,Me(e)))}(e,s);else if(n||(o=function(e,t){var r;i=t,ie.isBuffer(i)||i instanceof ne||"string"==typeof t||void 0===t||e.objectMode||(r=new pe("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(s,t)),o)we(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===ie.prototype||(t=function(e){return ie.from(e)}(t)),i)s.endEmitted?we(e,new _e):Se(e,s,t,!0);else if(s.ended)we(e,new ye);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?Se(e,s,t,!1):xe(e,s)):Se(e,s,t,!1)}else i||(s.reading=!1,xe(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function Se(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Te(e)),xe(e,t)}Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),me.prototype.destroy=le.destroy,me.prototype._undestroy=le.undestroy,me.prototype._destroy=function(e,t){t(e)},me.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=ie.from(e,t),t=""),r=!0),Ee(this,e,t,!1,r)},me.prototype.unshift=function(e){return Ee(this,e,null,!0,!1)},me.prototype.isPaused=function(){return!1===this._readableState.flowing},me.prototype.setEncoding=function(e){ae||(ae=z().StringDecoder);var t=new ae(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var ke=1073741824;function Re(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=ke?e=ke:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Te(e){var r=e._readableState;oe("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(oe("emitReadable",r.flowing),r.emittedReadable=!0,t(Me,e))}function Me(e){var t=e._readableState;oe("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Oe(e)}function xe(e,r){r.readingMore||(r.readingMore=!0,t(Ae,e,r))}function Ae(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(oe("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function Ke(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Le(e){oe("readable nexttick read 0"),e.read(0)}function Ie(e,t){oe("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Oe(e),t.flowing&&!t.reading&&e.read(0)}function Oe(e){var t=e._readableState;for(oe("flow",t.flowing);t.flowing&&null!==e.read(););}function Pe(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Ce(e){var r=e._readableState;oe("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,t(De,r,e))}function De(e,t){if(oe("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Be(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}me.prototype.read=function(e){oe("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return oe("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Ce(this):Te(this),null;if(0===(e=Re(e,t))&&t.ended)return 0===t.length&&Ce(this),null;var i,n=t.needReadable;return oe("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&oe("length less than watermark",n=!0),t.ended||t.reading?oe("reading or ended",n=!1):n&&(oe("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Re(r,t))),null===(i=e>0?Pe(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Ce(this)),null!==i&&this.emit("data",i),i},me.prototype._read=function(e){we(this,new be("_read()"))},me.prototype.pipe=function(e,i){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,oe("pipe count=%d opts=%j",o.pipesCount,i);var s=(!i||!1!==i.end)&&e!==r.stdout&&e!==r.stderr?h:y;function a(t,r){oe("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,oe("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",a),n.removeListener("end",h),n.removeListener("end",y),n.removeListener("data",l),c=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function h(){oe("onend"),e.end()}o.endEmitted?t(s):n.once("end",s),e.on("unpipe",a);var u=function(e){return function(){var t=e._readableState;oe("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&te(e,"data")&&(t.flowing=!0,Oe(e))}}(n);e.on("drain",u);var c=!1;function l(t){oe("ondata");var r=e.write(t);oe("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==Be(o.pipes,e))&&!c&&(oe("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function d(t){oe("onerror",t),y(),e.removeListener("error",d),0===te(e,"error")&&we(e,t)}function f(){e.removeListener("finish",p),y()}function p(){oe("onfinish"),e.removeListener("close",f),y()}function y(){oe("unpipe"),n.unpipe(e)}return n.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),o.flowing||(oe("pipe resume"),n.resume()),e},me.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Be(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},me.prototype.on=function(e,r){var i=re.prototype.on.call(this,e,r),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,oe("on readable",n.length,n.reading),n.length?Te(this):n.reading||t(Le,this))),i},me.prototype.addListener=me.prototype.on,me.prototype.removeListener=function(e,r){var i=re.prototype.removeListener.call(this,e,r);return"readable"===e&&t(Ke,this),i},me.prototype.removeAllListeners=function(e){var r=re.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||t(Ke,this),r},me.prototype.resume=function(){var e=this._readableState;return e.flowing||(oe("resume"),e.flowing=!e.readableListening,function(e,r){r.resumeScheduled||(r.resumeScheduled=!0,t(Ie,e,r))}(this,e)),e.paused=!1,this},me.prototype.pause=function(){return oe("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(oe("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},me.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(oe("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(oe("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var o=0;o<ge.length;o++)e.on(ge[o],this.emit.bind(this,ge[o]));return this._read=function(t){oe("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(me.prototype[Symbol.asyncIterator]=function(){return void 0===he&&(he=Q()),he(this)}),Object.defineProperty(me.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(me.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(me.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),me._fromList=Pe,Object.defineProperty(me.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(me.from=function(e,t){return void 0===ue&&(ue=J?G:(J=1,G=function(){throw new Error("Readable.from is not available in the browser")})),ue(me,e,t)});var Ne=function(e,t){if(je("noDeprecation"))return e;var r=!1;return function(){if(!r){if(je("throwDeprecation"))throw new Error(t);je("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}};function je(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}const Ue=K;function Ve(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}Ue.Writable=at,at.WritableState=st;var qe={deprecate:Ne},We=I,Fe=m.Buffer,ze=e.Uint8Array||function(){};var He,$e=D,Ze=W.getHighWaterMark,Xe=B.codes,Ge=Xe.ERR_INVALID_ARG_TYPE,Je=Xe.ERR_METHOD_NOT_IMPLEMENTED,Ye=Xe.ERR_MULTIPLE_CALLBACK,Qe=Xe.ERR_STREAM_CANNOT_PIPE,et=Xe.ERR_STREAM_DESTROYED,tt=Xe.ERR_STREAM_NULL_VALUES,rt=Xe.ERR_STREAM_WRITE_AFTER_END,it=Xe.ERR_UNKNOWN_ENCODING,nt=$e.errorOrDestroy;function ot(){}function st(e,r,i){e=e||{},"boolean"!=typeof i&&(i=r instanceof Ue.Duplex),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Ze(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=!1===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,r){var i=e._writableState,n=i.sync,o=i.writecb;if("function"!=typeof o)throw new Ye;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),r)!function(e,r,i,n,o){--r.pendingcb,i?(t(o,n),t(ft,e,r),e._writableState.errorEmitted=!0,nt(e,n)):(o(n),e._writableState.errorEmitted=!0,nt(e,n),ft(e,r))}(e,i,n,r,o);else{var s=lt(i)||e.destroyed;s||i.corked||i.bufferProcessing||!i.bufferedRequest||ct(e,i),n?t(ut,e,i,s,o):ut(e,i,s,o)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Ve(this)}function at(e){var t=this instanceof Ue.Duplex;if(!t&&!He.call(at,this))return new at(e);this._writableState=new st(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),We.call(this)}function ht(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new et("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function ut(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),ft(e,t)}function ct(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,ht(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Ve(t),t.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,u=r.encoding,c=r.callback;if(ht(e,t,!1,t.objectMode?1:h.length,h,u,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function lt(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function dt(e,t){e._final((function(r){t.pendingcb--,r&&nt(e,r),t.prefinished=!0,e.emit("prefinish"),ft(e,t)}))}function ft(e,r){var i=lt(r);if(i&&(function(e,r){r.prefinished||r.finalCalled||("function"!=typeof e._final||r.destroyed?(r.prefinished=!0,e.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,t(dt,e,r)))}(e,r),0===r.pendingcb&&(r.finished=!0,e.emit("finish"),r.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return i}E(at,We),st.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(st.prototype,"buffer",{get:qe.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(He=Function.prototype[Symbol.hasInstance],Object.defineProperty(at,Symbol.hasInstance,{value:function(e){return!!He.call(this,e)||this===at&&(e&&e._writableState instanceof st)}})):He=function(e){return e instanceof this},at.prototype.pipe=function(){nt(this,new Qe)},at.prototype.write=function(e,r,i){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,Fe.isBuffer(n)||n instanceof ze);return a&&!Fe.isBuffer(e)&&(e=function(e){return Fe.from(e)}(e)),"function"==typeof r&&(i=r,r=null),a?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof i&&(i=ot),o.ending?function(e,r){var i=new rt;nt(e,i),t(r,i)}(this,i):(a||function(e,r,i,n){var o;return null===i?o=new tt:"string"==typeof i||r.objectMode||(o=new Ge("chunk",["string","Buffer"],i)),!o||(nt(e,o),t(n,o),!1)}(this,o,e,i))&&(o.pendingcb++,s=function(e,t,r,i,n,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Fe.from(t,r));return t}(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=t.objectMode?1:i.length;t.length+=a;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ht(e,t,!1,a,i,n,o);return h}(this,o,a,e,r,i)),s},at.prototype.cork=function(){this._writableState.corked++},at.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||ct(this,e))},at.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new it(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(at.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(at.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),at.prototype._write=function(e,t,r){r(new Je("_write()"))},at.prototype._writev=null,at.prototype.end=function(e,r,i){var n=this._writableState;return"function"==typeof e?(i=e,e=null,r=null):"function"==typeof r&&(i=r,r=null),null!=e&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,r,i){r.ending=!0,ft(e,r),i&&(r.finished?t(i):e.once("finish",i));r.ended=!0,e.writable=!1}(this,n,i),this},Object.defineProperty(at.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(at.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),at.prototype.destroy=$e.destroy,at.prototype._undestroy=$e.undestroy,at.prototype._destroy=function(e,t){t(e)};var pt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};const yt=K;yt.Duplex=gt,E(gt,yt.Readable);for(var bt=pt(yt.Writable.prototype),_t=0;_t<bt.length;_t++){var wt=bt[_t];gt.prototype[wt]||(gt.prototype[wt]=yt.Writable.prototype[wt])}function gt(e){if(!(this instanceof gt))return new gt(e);yt.Readable.call(this,e),yt.Writable.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",vt)))}function vt(){this._writableState.ended||t(mt,this)}function mt(e){e.end()}Object.defineProperty(gt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(gt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(gt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(gt.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});const Et=K;Et.Transform=At;var St=B.codes,kt=St.ERR_METHOD_NOT_IMPLEMENTED,Rt=St.ERR_MULTIPLE_CALLBACK,Tt=St.ERR_TRANSFORM_ALREADY_TRANSFORMING,Mt=St.ERR_TRANSFORM_WITH_LENGTH_0;function xt(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new Rt);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function At(e){if(!(this instanceof At))return new At(e);Et.Duplex.call(this,e),this._transformState={afterTransform:xt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",Kt)}function Kt(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?Lt(this,null,null):this._flush((function(t,r){Lt(e,t,r)}))}function Lt(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Mt;if(e._transformState.transforming)throw new Tt;return e.push(null)}E(At,Et.Duplex),At.prototype.push=function(e,t){return this._transformState.needTransform=!1,Et.Duplex.prototype.push.call(this,e,t)},At.prototype._transform=function(e,t,r){r(new kt("_transform()"))},At.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},At.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},At.prototype._destroy=function(e,t){Et.Duplex.prototype._destroy.call(this,e,(function(e){t(e)}))};const It=K;function Ot(e){if(!(this instanceof Ot))return new Ot(e);Transform.call(this,e)}var Pt;It.PassThrough=Ot,E(Ot,It.Transform),Ot.prototype._transform=function(e,t,r){r(null,e)};var Ct=B.codes,Dt=Ct.ERR_MISSING_ARGS,Bt=Ct.ERR_STREAM_DESTROYED;function Nt(e){if(e)throw e}function jt(e){e()}function Ut(e,t){return e.pipe(t)}var Vt=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i,n=function(e){return e.length?"function"!=typeof e[e.length-1]?Nt:e.pop():Nt}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Dt("streams");var o=t.map((function(e,r){var s=r<t.length-1;return function(e,t,r,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var n=!1;e.on("close",(function(){n=!0})),void 0===Pt&&(Pt=Y),Pt(e,{readable:t,writable:r},(function(e){if(e)return i(e);n=!0,i()}));var o=!1;return function(t){if(!n&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new Bt("pipe"))}}(e,s,r>0,(function(e){i||(i=e),e&&o.forEach(jt),s||(o.forEach(jt),n(i))}))}));return t.reduce(Ut)};!function(e,t){const r=K;(t=A.exports=r.Readable).Stream=r.Readable,t.Readable=r.Readable,t.Writable=r.Writable,t.Duplex=r.Duplex,t.Transform=r.Transform,t.PassThrough=r.PassThrough,t.finished=Y,t.pipeline=Vt}(0,A.exports);var qt=A.exports,Wt=p.Buffer,Ft=qt;function zt(e){Ft.Stream.Transform.call(this),this._block=Wt.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}E(zt,Ft.Stream.Transform),zt.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},zt.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},zt.prototype.update=function(e,t){if(function(e,t){if(!Wt.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");Wt.isBuffer(e)||(e=Wt.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,s=8*e.length;s>0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},zt.prototype._update=function(){throw new Error("_update is not implemented")},zt.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},zt.prototype._digest=function(){throw new Error("_digest is not implemented")};var Ht=zt,$t=E,Zt=Ht,Xt=p.Buffer,Gt=new Array(16);function Jt(){Zt.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Yt(e,t){return e<<t|e>>>32-t}function Qt(e,t,r,i,n,o,s){return Yt(e+(t&r|~t&i)+n+o|0,s)+t|0}function er(e,t,r,i,n,o,s){return Yt(e+(t&i|r&~i)+n+o|0,s)+t|0}function tr(e,t,r,i,n,o,s){return Yt(e+(t^r^i)+n+o|0,s)+t|0}function rr(e,t,r,i,n,o,s){return Yt(e+(r^(t|~i))+n+o|0,s)+t|0}$t(Jt,Zt),Jt.prototype._update=function(){for(var e=Gt,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;r=Qt(r,i,n,o,e[0],3614090360,7),o=Qt(o,r,i,n,e[1],3905402710,12),n=Qt(n,o,r,i,e[2],606105819,17),i=Qt(i,n,o,r,e[3],3250441966,22),r=Qt(r,i,n,o,e[4],4118548399,7),o=Qt(o,r,i,n,e[5],1200080426,12),n=Qt(n,o,r,i,e[6],2821735955,17),i=Qt(i,n,o,r,e[7],4249261313,22),r=Qt(r,i,n,o,e[8],1770035416,7),o=Qt(o,r,i,n,e[9],2336552879,12),n=Qt(n,o,r,i,e[10],4294925233,17),i=Qt(i,n,o,r,e[11],2304563134,22),r=Qt(r,i,n,o,e[12],1804603682,7),o=Qt(o,r,i,n,e[13],4254626195,12),n=Qt(n,o,r,i,e[14],2792965006,17),r=er(r,i=Qt(i,n,o,r,e[15],1236535329,22),n,o,e[1],4129170786,5),o=er(o,r,i,n,e[6],3225465664,9),n=er(n,o,r,i,e[11],643717713,14),i=er(i,n,o,r,e[0],3921069994,20),r=er(r,i,n,o,e[5],3593408605,5),o=er(o,r,i,n,e[10],38016083,9),n=er(n,o,r,i,e[15],3634488961,14),i=er(i,n,o,r,e[4],3889429448,20),r=er(r,i,n,o,e[9],568446438,5),o=er(o,r,i,n,e[14],3275163606,9),n=er(n,o,r,i,e[3],4107603335,14),i=er(i,n,o,r,e[8],1163531501,20),r=er(r,i,n,o,e[13],2850285829,5),o=er(o,r,i,n,e[2],4243563512,9),n=er(n,o,r,i,e[7],1735328473,14),r=tr(r,i=er(i,n,o,r,e[12],2368359562,20),n,o,e[5],4294588738,4),o=tr(o,r,i,n,e[8],2272392833,11),n=tr(n,o,r,i,e[11],1839030562,16),i=tr(i,n,o,r,e[14],4259657740,23),r=tr(r,i,n,o,e[1],2763975236,4),o=tr(o,r,i,n,e[4],1272893353,11),n=tr(n,o,r,i,e[7],4139469664,16),i=tr(i,n,o,r,e[10],3200236656,23),r=tr(r,i,n,o,e[13],681279174,4),o=tr(o,r,i,n,e[0],3936430074,11),n=tr(n,o,r,i,e[3],3572445317,16),i=tr(i,n,o,r,e[6],76029189,23),r=tr(r,i,n,o,e[9],3654602809,4),o=tr(o,r,i,n,e[12],3873151461,11),n=tr(n,o,r,i,e[15],530742520,16),r=rr(r,i=tr(i,n,o,r,e[2],3299628645,23),n,o,e[0],4096336452,6),o=rr(o,r,i,n,e[7],1126891415,10),n=rr(n,o,r,i,e[14],2878612391,15),i=rr(i,n,o,r,e[5],4237533241,21),r=rr(r,i,n,o,e[12],1700485571,6),o=rr(o,r,i,n,e[3],2399980690,10),n=rr(n,o,r,i,e[10],4293915773,15),i=rr(i,n,o,r,e[1],2240044497,21),r=rr(r,i,n,o,e[8],1873313359,6),o=rr(o,r,i,n,e[15],4264355552,10),n=rr(n,o,r,i,e[6],2734768916,15),i=rr(i,n,o,r,e[13],1309151649,21),r=rr(r,i,n,o,e[4],4149444226,6),o=rr(o,r,i,n,e[11],3174756917,10),n=rr(n,o,r,i,e[2],718787259,15),i=rr(i,n,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},Jt.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Xt.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var ir=Jt,nr=m.Buffer,or=E,sr=Ht,ar=new Array(16),hr=[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],ur=[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],cr=[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],lr=[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],dr=[0,1518500249,1859775393,2400959708,2840853838],fr=[1352829926,1548603684,1836072691,2053994217,0];function pr(){sr.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function yr(e,t){return e<<t|e>>>32-t}function br(e,t,r,i,n,o,s,a){return yr(e+(t^r^i)+o+s|0,a)+n|0}function _r(e,t,r,i,n,o,s,a){return yr(e+(t&r|~t&i)+o+s|0,a)+n|0}function wr(e,t,r,i,n,o,s,a){return yr(e+((t|~r)^i)+o+s|0,a)+n|0}function gr(e,t,r,i,n,o,s,a){return yr(e+(t&i|r&~i)+o+s|0,a)+n|0}function vr(e,t,r,i,n,o,s,a){return yr(e+(t^(r|~i))+o+s|0,a)+n|0}or(pr,sr),pr.prototype._update=function(){for(var e=ar,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,h=0|this._b,u=0|this._c,c=0|this._d,l=0|this._e,d=0;d<80;d+=1){var f,p;d<16?(f=br(r,i,n,o,s,e[hr[d]],dr[0],cr[d]),p=vr(a,h,u,c,l,e[ur[d]],fr[0],lr[d])):d<32?(f=_r(r,i,n,o,s,e[hr[d]],dr[1],cr[d]),p=gr(a,h,u,c,l,e[ur[d]],fr[1],lr[d])):d<48?(f=wr(r,i,n,o,s,e[hr[d]],dr[2],cr[d]),p=wr(a,h,u,c,l,e[ur[d]],fr[2],lr[d])):d<64?(f=gr(r,i,n,o,s,e[hr[d]],dr[3],cr[d]),p=_r(a,h,u,c,l,e[ur[d]],fr[3],lr[d])):(f=vr(r,i,n,o,s,e[hr[d]],dr[4],cr[d]),p=br(a,h,u,c,l,e[ur[d]],fr[4],lr[d])),r=s,s=o,o=yr(n,10),n=i,i=f,a=l,l=c,c=yr(u,10),u=h,h=p}var y=this._b+n+c|0;this._b=this._c+o+l|0,this._c=this._d+s+a|0,this._d=this._e+r+h|0,this._e=this._a+i+u|0,this._a=y},pr.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=nr.alloc?nr.alloc(20):new nr(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var mr=pr,Er={exports:{}},Sr=p.Buffer;function kr(e,t){this._block=Sr.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}kr.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Sr.from(e,t));for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,s=0;s<n;){for(var a=o%i,h=Math.min(n-s,i-a),u=0;u<h;u++)r[a+u]=e[s+u];s+=h,(o+=h)%i==0&&this._update(r)}return this._len+=n,this},kr.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},kr.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Rr=kr,Tr=E,Mr=Rr,xr=p.Buffer,Ar=[1518500249,1859775393,-1894007588,-899497514],Kr=new Array(80);function Lr(){this.init(),this._w=Kr,Mr.call(this,64,56)}function Ir(e){return e<<30|e>>>2}function Or(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}Tr(Lr,Mr),Lr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Lr.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var u=0;u<80;++u){var c=~~(u/20),l=0|((t=i)<<5|t>>>27)+Or(c,n,o,s)+a+r[u]+Ar[c];a=s,s=o,o=Ir(n),n=i,i=l}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},Lr.prototype._hash=function(){var e=xr.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var Pr=Lr,Cr=E,Dr=Rr,Br=p.Buffer,Nr=[1518500249,1859775393,-1894007588,-899497514],jr=new Array(80);function Ur(){this.init(),this._w=jr,Dr.call(this,64,56)}function Vr(e){return e<<5|e>>>27}function qr(e){return e<<30|e>>>2}function Wr(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}Cr(Ur,Dr),Ur.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Ur.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var u=0;u<80;++u){var c=~~(u/20),l=Vr(i)+Wr(c,n,o,s)+a+r[u]+Nr[c]|0;a=s,s=o,o=qr(n),n=i,i=l}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},Ur.prototype._hash=function(){var e=Br.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var Fr=Ur,zr=E,Hr=Rr,$r=p.Buffer,Zr=[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],Xr=new Array(64);function Gr(){this.init(),this._w=Xr,Hr.call(this,64,56)}function Jr(e,t,r){return r^e&(t^r)}function Yr(e,t,r){return e&t|r&(e|t)}function Qr(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function ei(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function ti(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}zr(Gr,Hr),Gr.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Gr.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,h=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<64;++l)r[l]=0|(((t=r[l-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[l-7]+ti(r[l-15])+r[l-16];for(var d=0;d<64;++d){var f=c+ei(a)+Jr(a,h,u)+Zr[d]+r[d]|0,p=Qr(i)+Yr(i,n,o)|0;c=u,u=h,h=a,a=s+f|0,s=o,o=n,n=i,i=f+p|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=h+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},Gr.prototype._hash=function(){var e=$r.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ri=Gr,ii=E,ni=ri,oi=Rr,si=p.Buffer,ai=new Array(64);function hi(){this.init(),this._w=ai,oi.call(this,64,56)}ii(hi,ni),hi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},hi.prototype._hash=function(){var e=si.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var ui=hi,ci=E,li=Rr,di=p.Buffer,fi=[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],pi=new Array(160);function yi(){this.init(),this._w=pi,li.call(this,128,112)}function bi(e,t,r){return r^e&(t^r)}function _i(e,t,r){return e&t|r&(e|t)}function wi(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function gi(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function vi(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function mi(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Ei(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Si(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ki(e,t){return e>>>0<t>>>0?1:0}ci(yi,li),yi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},yi.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,h=0|this._gh,u=0|this._hh,c=0|this._al,l=0|this._bl,d=0|this._cl,f=0|this._dl,p=0|this._el,y=0|this._fl,b=0|this._gl,_=0|this._hl,w=0;w<32;w+=2)t[w]=e.readInt32BE(4*w),t[w+1]=e.readInt32BE(4*w+4);for(;w<160;w+=2){var g=t[w-30],v=t[w-30+1],m=vi(g,v),E=mi(v,g),S=Ei(g=t[w-4],v=t[w-4+1]),k=Si(v,g),R=t[w-14],T=t[w-14+1],M=t[w-32],x=t[w-32+1],A=E+T|0,K=m+R+ki(A,E)|0;K=(K=K+S+ki(A=A+k|0,k)|0)+M+ki(A=A+x|0,x)|0,t[w]=K,t[w+1]=A}for(var L=0;L<160;L+=2){K=t[L],A=t[L+1];var I=_i(r,i,n),O=_i(c,l,d),P=wi(r,c),C=wi(c,r),D=gi(s,p),B=gi(p,s),N=fi[L],j=fi[L+1],U=bi(s,a,h),V=bi(p,y,b),q=_+B|0,W=u+D+ki(q,_)|0;W=(W=(W=W+U+ki(q=q+V|0,V)|0)+N+ki(q=q+j|0,j)|0)+K+ki(q=q+A|0,A)|0;var F=C+O|0,z=P+I+ki(F,C)|0;u=h,_=b,h=a,b=y,a=s,y=p,s=o+W+ki(p=f+q|0,f)|0,o=n,f=d,n=i,d=l,i=r,l=c,r=W+z+ki(c=q+F|0,q)|0}this._al=this._al+c|0,this._bl=this._bl+l|0,this._cl=this._cl+d|0,this._dl=this._dl+f|0,this._el=this._el+p|0,this._fl=this._fl+y|0,this._gl=this._gl+b|0,this._hl=this._hl+_|0,this._ah=this._ah+r+ki(this._al,c)|0,this._bh=this._bh+i+ki(this._bl,l)|0,this._ch=this._ch+n+ki(this._cl,d)|0,this._dh=this._dh+o+ki(this._dl,f)|0,this._eh=this._eh+s+ki(this._el,p)|0,this._fh=this._fh+a+ki(this._fl,y)|0,this._gh=this._gh+h+ki(this._gl,b)|0,this._hh=this._hh+u+ki(this._hl,_)|0},yi.prototype._hash=function(){var e=di.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ri=yi,Ti=E,Mi=Ri,xi=Rr,Ai=p.Buffer,Ki=new Array(160);function Li(){this.init(),this._w=Ki,xi.call(this,128,112)}Ti(Li,Mi),Li.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Li.prototype._hash=function(){var e=Ai.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Ii=Li,Oi=Er.exports=function(e){e=e.toLowerCase();var t=Oi[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};Oi.sha=Pr,Oi.sha1=Fr,Oi.sha224=ui,Oi.sha256=ri,Oi.sha384=Ii,Oi.sha512=Ri;var Pi=Er.exports,Ci=h(c),Di=p.Buffer,Bi=y.Transform,Ni=Ci.StringDecoder;function ji(e){Bi.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}E(ji,Bi),ji.prototype.update=function(e,t,r){"string"==typeof e&&(e=Di.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},ji.prototype.setAutoPadding=function(){},ji.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},ji.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},ji.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},ji.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},ji.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},ji.prototype._finalOrDigest=function(e){var t=this.__final()||Di.alloc(0);return e&&(t=this._toString(t,e,!0)),t},ji.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new Ni(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i};var Ui=ir,Vi=mr,qi=Pi,Wi=ji;function Fi(e){Wi.call(this,"digest"),this._hash=e}E(Fi,Wi),Fi.prototype._update=function(e){this._hash.update(e)},Fi.prototype._final=function(){return this._hash.digest()};var zi=l((function(e){return"md5"===(e=e.toLowerCase())?new Ui:"rmd160"===e||"ripemd160"===e?new Vi:new Fi(qi(e))}));const Hi=new(0,S.ec)("secp256k1"),$i=Hi.curve,Zi=$i.n.constructor;function Xi(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new Zi(t);if(r.cmp($i.p)>=0)return null;r=r.toRed($i.red);let i=r.redSqr().redIMul(r).redIAdd($i.b).redSqrt();return 3===e!==i.isOdd()&&(i=i.redNeg()),Hi.keyPair({pub:{x:r,y:i}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let i=new Zi(t),n=new Zi(r);if(i.cmp($i.p)>=0||n.cmp($i.p)>=0)return null;if(i=i.toRed($i.red),n=n.toRed($i.red),(6===e||7===e)&&n.isOdd()!==(7===e))return null;const o=i.redSqr().redIMul(i);return n.redSqr().redISub(o.redIAdd($i.b)).isZero()?Hi.keyPair({pub:{x:i,y:n}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function Gi(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}var Ji={contextRandomize:()=>0,privateKeyVerify(e){const t=new Zi(e);return t.cmp($i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new Zi(e),r=$i.n.sub(t).umod($i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new Zi(t);if(r.cmp($i.n)>=0)return 1;if(r.iadd(new Zi(e)),r.cmp($i.n)>=0&&r.isub($i.n),r.isZero())return 1;const i=r.toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakMul(e,t){let r=new Zi(t);if(r.cmp($i.n)>=0||r.isZero())return 1;r.imul(new Zi(e)),r.cmp($i.n)>=0&&(r=r.umod($i.n));const i=r.toArrayLike(Uint8Array,"be",32);return e.set(i),0},publicKeyVerify:e=>null===Xi(e)?1:0,publicKeyCreate(e,t){const r=new Zi(t);if(r.cmp($i.n)>=0||r.isZero())return 1;return Gi(e,Hi.keyFromPrivate(t).getPublic()),0},publicKeyConvert(e,t){const r=Xi(t);if(null===r)return 1;return Gi(e,r.getPublic()),0},publicKeyNegate(e,t){const r=Xi(t);if(null===r)return 1;const i=r.getPublic();return i.y=i.y.redNeg(),Gi(e,i),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=Xi(t[e]),null===r[e])return 1;let i=r[0].getPublic();for(let e=1;e<r.length;++e)i=i.add(r[e].pub);return i.isInfinity()?2:(Gi(e,i),0)},publicKeyTweakAdd(e,t,r){const i=Xi(t);if(null===i)return 1;if((r=new Zi(r)).cmp($i.n)>=0)return 2;const n=i.getPublic().add($i.g.mul(r));return n.isInfinity()?2:(Gi(e,n),0)},publicKeyTweakMul(e,t,r){const i=Xi(t);if(null===i)return 1;if((r=new Zi(r)).cmp($i.n)>=0||r.isZero())return 2;return Gi(e,i.getPublic().mul(r)),0},signatureNormalize(e){const t=new Zi(e.subarray(0,32)),r=new Zi(e.subarray(32,64));return t.cmp($i.n)>=0||r.cmp($i.n)>=0?1:(1===r.cmp(Hi.nh)&&e.set($i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),i=t.subarray(32,64);if(new Zi(r).cmp($i.n)>=0)return 1;if(new Zi(i).cmp($i.n)>=0)return 1;const{output:n}=e;let o=n.subarray(4,37);o[0]=0,o.set(r,1);let s=33,a=0;for(;s>1&&0===o[a]&&!(128&o[a+1]);--s,++a);if(o=o.subarray(a),128&o[0])return 1;if(s>1&&0===o[0]&&!(128&o[1]))return 1;let h=n.subarray(39,72);h[0]=0,h.set(i,1);let u=33,c=0;for(;u>1&&0===h[c]&&!(128&h[c+1]);--u,++c);return h=h.subarray(c),128&h[0]||u>1&&0===h[0]&&!(128&h[1])?1:(e.outputlen=6+s+u,n[0]=48,n[1]=e.outputlen-2,n[2]=2,n[3]=o.length,n.set(o,4),n[4+s]=2,n[5+s]=h.length,n.set(h,6+s),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const i=t[5+r];if(0===i)return 1;if(6+r+i!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(i>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let n=t.subarray(4,4+r);if(33===n.length&&0===n[0]&&(n=n.subarray(1)),n.length>32)return 1;let o=t.subarray(6+r);if(33===o.length&&0===o[0]&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");let s=new Zi(n);s.cmp($i.n)>=0&&(s=new Zi(0));let a=new Zi(t.subarray(6+r));return a.cmp($i.n)>=0&&(a=new Zi(0)),e.set(s.toArrayLike(Uint8Array,"be",32),0),e.set(a.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,i,n){if(n){const e=n;n=n=>{const o=e(t,r,null,i,n);if(!(o instanceof Uint8Array&&32===o.length))throw new Error("This is the way");return new Zi(o)}}const o=new Zi(r);if(o.cmp($i.n)>=0||o.isZero())return 1;let s;try{s=Hi.sign(t,r,{canonical:!0,k:n,pers:i})}catch(e){return 1}return e.signature.set(s.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(s.s.toArrayLike(Uint8Array,"be",32),32),e.recid=s.recoveryParam,0},ecdsaVerify(e,t,r){const i={r:e.subarray(0,32),s:e.subarray(32,64)},n=new Zi(i.r),o=new Zi(i.s);if(n.cmp($i.n)>=0||o.cmp($i.n)>=0)return 1;if(1===o.cmp(Hi.nh)||n.isZero()||o.isZero())return 3;const s=Xi(r);if(null===s)return 2;const a=s.getPublic();return Hi.verify(t,i,a)?0:3},ecdsaRecover(e,t,r,i){const n={r:t.slice(0,32),s:t.slice(32,64)},o=new Zi(n.r),s=new Zi(n.s);if(o.cmp($i.n)>=0||s.cmp($i.n)>=0)return 1;if(o.isZero()||s.isZero())return 2;let a;try{a=Hi.recoverPubKey(i,n,r)}catch(e){return 2}return Gi(e,a),0},ecdh(e,t,r,i,n,o,s){const a=Xi(t);if(null===a)return 1;const h=new Zi(r);if(h.cmp($i.n)>=0||h.isZero())return 2;const u=a.getPublic().mul(h);if(void 0===n){const t=u.encode(null,!0),r=Hi.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{o||(o=new Uint8Array(32));const t=u.getX().toArray("be",32);for(let e=0;e<32;++e)o[e]=t[e];s||(s=new Uint8Array(32));const r=u.getY().toArray("be",32);for(let e=0;e<32;++e)s[e]=r[e];const a=n(o,s,i);if(!(a instanceof Uint8Array&&a.length===e.length))return 2;e.set(a)}return 0}};const Yi="Impossible case. Please create issue.",Qi="The tweak was out of range or the resulted private key is invalid",en="The tweak was out of range or equal to zero",tn="Unknow error on context randomization",rn="Private Key is invalid",nn="Public Key could not be parsed",on="Public Key serialization error",sn="The sum of the public keys is not valid",an="Signature could not be parsed",hn="The nonce generation function failed, or the private key was invalid",un="Public key could not be recover",cn="Scalar was invalid (zero or overflow)";function ln(e,t){if(!e)throw new Error(t)}function dn(e,t,r){if(ln(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const i=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;ln(r.includes(t.length),i)}else{const i=`Expected ${e} to be an Uint8Array with length ${r}`;ln(t.length===r,i)}}function fn(e){ln("Boolean"===yn(e),"Expected compressed to be a Boolean")}function pn(e=(e=>new Uint8Array(e)),t){return"function"==typeof e&&(e=e(t)),dn("output",e,t),e}function yn(e){return Object.prototype.toString.call(e).slice(8,-1)}var bn=(e=>({contextRandomize(t){if(ln(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&dn("seed",t,32),1===e.contextRandomize(t))throw new Error(tn)},privateKeyVerify:t=>(dn("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(t){switch(dn("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(Yi)}},privateKeyTweakAdd(t,r){switch(dn("private key",t,32),dn("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(Qi)}},privateKeyTweakMul(t,r){switch(dn("private key",t,32),dn("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(en)}},publicKeyVerify:t=>(dn("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t,r=!0,i){switch(dn("private key",t,32),fn(r),i=pn(i,r?33:65),e.publicKeyCreate(i,t)){case 0:return i;case 1:throw new Error(rn);case 2:throw new Error(on)}},publicKeyConvert(t,r=!0,i){switch(dn("public key",t,[33,65]),fn(r),i=pn(i,r?33:65),e.publicKeyConvert(i,t)){case 0:return i;case 1:throw new Error(nn);case 2:throw new Error(on)}},publicKeyNegate(t,r=!0,i){switch(dn("public key",t,[33,65]),fn(r),i=pn(i,r?33:65),e.publicKeyNegate(i,t)){case 0:return i;case 1:throw new Error(nn);case 2:throw new Error(Yi);case 3:throw new Error(on)}},publicKeyCombine(t,r=!0,i){ln(Array.isArray(t),"Expected public keys to be an Array"),ln(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)dn("public key",e,[33,65]);switch(fn(r),i=pn(i,r?33:65),e.publicKeyCombine(i,t)){case 0:return i;case 1:throw new Error(nn);case 2:throw new Error(sn);case 3:throw new Error(on)}},publicKeyTweakAdd(t,r,i=!0,n){switch(dn("public key",t,[33,65]),dn("tweak",r,32),fn(i),n=pn(n,i?33:65),e.publicKeyTweakAdd(n,t,r)){case 0:return n;case 1:throw new Error(nn);case 2:throw new Error(Qi)}},publicKeyTweakMul(t,r,i=!0,n){switch(dn("public key",t,[33,65]),dn("tweak",r,32),fn(i),n=pn(n,i?33:65),e.publicKeyTweakMul(n,t,r)){case 0:return n;case 1:throw new Error(nn);case 2:throw new Error(en)}},signatureNormalize(t){switch(dn("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(an)}},signatureExport(t,r){dn("signature",t,64);const i={output:r=pn(r,72),outputlen:72};switch(e.signatureExport(i,t)){case 0:return r.slice(0,i.outputlen);case 1:throw new Error(an);case 2:throw new Error(Yi)}},signatureImport(t,r){switch(dn("signature",t),r=pn(r,64),e.signatureImport(r,t)){case 0:return r;case 1:throw new Error(an);case 2:throw new Error(Yi)}},ecdsaSign(t,r,i={},n){dn("message",t,32),dn("private key",r,32),ln("Object"===yn(i),"Expected options to be an Object"),void 0!==i.data&&dn("options.data",i.data),void 0!==i.noncefn&&ln("Function"===yn(i.noncefn),"Expected options.noncefn to be a Function");const o={signature:n=pn(n,64),recid:null};switch(e.ecdsaSign(o,t,r,i.data,i.noncefn)){case 0:return o;case 1:throw new Error(hn);case 2:throw new Error(Yi)}},ecdsaVerify(t,r,i){switch(dn("signature",t,64),dn("message",r,32),dn("public key",i,[33,65]),e.ecdsaVerify(t,r,i)){case 0:return!0;case 3:return!1;case 1:throw new Error(an);case 2:throw new Error(nn)}},ecdsaRecover(t,r,i,n=!0,o){switch(dn("signature",t,64),ln("Number"===yn(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),dn("message",i,32),fn(n),o=pn(o,n?33:65),e.ecdsaRecover(o,t,r,i)){case 0:return o;case 1:throw new Error(an);case 2:throw new Error(un);case 3:throw new Error(Yi)}},ecdh(t,r,i={},n){switch(dn("public key",t,[33,65]),dn("private key",r,32),ln("Object"===yn(i),"Expected options to be an Object"),void 0!==i.data&&dn("options.data",i.data),void 0!==i.hashfn?(ln("Function"===yn(i.hashfn),"Expected options.hashfn to be a Function"),void 0!==i.xbuf&&dn("options.xbuf",i.xbuf,32),void 0!==i.ybuf&&dn("options.ybuf",i.ybuf,32),dn("output",n)):n=pn(n,32),e.ecdh(n,t,r,i.data,i.hashfn,i.xbuf,i.ybuf)){case 0:return n;case 1:throw new Error(nn);case 2:throw new Error(cn)}}}))(Ji),_n=l(bn),wn={exports:{}},gn=65536,vn=4294967295;var mn=p.Buffer,En=e.crypto||e.msCrypto;En&&En.getRandomValues?wn.exports=function(e,r){if(e>vn)throw new RangeError("requested too many random bytes");var i=mn.allocUnsafe(e);if(e>0)if(e>gn)for(var n=0;n<e;n+=gn)En.getRandomValues(i.slice(n,n+gn));else En.getRandomValues(i);if("function"==typeof r)return t((function(){r(null,i)}));return i}:wn.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")};var Sn=l(wn.exports);var kn={CryptoLD:class{constructor({suites:e}={}){this.suites=e||new Map}use(e){this.suites.set(e.suite,e)}async generate(e={}){return this._suiteForType(e).generate(e)}async from(e={}){const t=this._suiteForType(e);return e["@context"]?t.fromKeyDocument({document:e}):t.from(e)}async fromKeyDocument({document:e,checkContext:t=!0,checkRevoked:r=!0}={}){if(!e)throw new TypeError('The "document" parameter is required.');return this._suiteForType(e).fromKeyDocument({document:e,checkContext:t,checkRevoked:r})}async fromKeyId({id:e,documentLoader:t,checkContext:r=!0,checkRevoked:i=!0}={}){if(!e)throw new TypeError('The "id" parameter is required.');if(!t)throw new TypeError('The "documentLoader" parameter is required.');let n;try{if(({document:n}=await t(e)),!n)throw new Error('The "documentLoader" function must return a "document" object.')}catch(e){const t=new Error("Error fetching document: "+e.message);throw t.cause=e,t}const o=n.type;if(!o)throw new Error("Key suite type not found in fetched document.");const s=this.suites.get(o);if(!s)throw new Error(`Support for suite "${o}" is not installed.`);return s.fromKeyDocument({document:n,checkContext:r,checkRevoked:i})}_installed({type:e}){return this.suites.has(e)}_suiteForType(e){const t=e&&e.type;if(!t)throw new TypeError("Missing key type.");if(!this._installed({type:t}))throw new Error(`Support for key type "${t}" is not installed.`);return this.suites.get(t)}}};
2
- /*!
3
- * Copyright (c) 2018-2021 Digital Bazaar, Inc. All rights reserved.
4
- */let Rn=class{constructor({id:e,controller:t,revoked:r}={}){this.id=e,this.controller=t,this.revoked=r}static async generate(){throw new Error("Abstract method, must be implemented in subclass.")}static async fromKeyDocument({document:e,checkContext:t=!0,checkRevoked:r=!0}={}){if(!e)throw new TypeError('The "document" parameter is required.');if(t){if(![].concat(e["@context"]).includes(this.SUITE_CONTEXT))throw new Error('Key document does not contain required context "'+this.SUITE_CONTEXT+'".')}if(r&&e.revoked)throw new Error(`Key has been revoked since: "${e.revoked}".`);return this.from(e)}static async from(){throw new Error("Abstract method from() must be implemented in subclass.")}export({publicKey:e=!1,privateKey:t=!1}={}){if(!e&&!t)throw new Error('Export requires specifying either "publicKey" or "privateKey".');const r={id:this.id,type:this.type,controller:this.controller};return this.revoked&&(r.revoked=this.revoked),r}fingerprint(){throw new Error("Abstract method, must be implemented in subclass.")}verifyFingerprint(){throw new Error("Abstract method, must be implemented in subclass.")}signer(){return{async sign({}){throw new Error("Abstract method, must be implemented in subclass.")}}}verifier(){return{async verify({}){throw new Error("Abstract method, must be implemented in subclass.")}}}};Rn.SUITE_CONTEXT="INVALID LDKeyPair CONTEXT";var Tn={LDKeyPair:Rn};const{CryptoLD:Mn}=kn,{LDKeyPair:xn}=Tn;var An=l({CryptoLD:Mn,LDKeyPair:xn});const Kn="EcdsaSecp256k1VerificationKey2019",Ln=e=>zi("sha256").update(e).digest();class In extends An.LDKeyPair{constructor({publicKeyBase58:e,privateKeyBase58:t,...r}){if(super(r),this.type=void 0,this.publicKeyBase58=void 0,this.privateKeyBase58=void 0,t&&!e){const e=bn.publicKeyCreate(k(t));this.publicKeyBase58=R(e)}else this.publicKeyBase58=e;if(this.type=Kn,this.privateKeyBase58=t,!this.publicKeyBase58)throw new TypeError('The "publicKeyBase58" property is required.')}static from(e){if(e.publicKeyHex||e.privateKeyHex){const{publicKeyHex:t,privateKeyHex:r,...n}=e;return new In({...n,publicKeyBase58:t?R(i.from(t,"hex")):void 0,privateKeyBase58:r?R(i.from(r,"hex")):void 0})}return new In(e)}static async generate({seed:e,compressed:t,...r}){if(e&&!bn.privateKeyVerify(e))throw new Error("Provided seed is not a valid private key");let i=e;for(;void 0===i||!bn.privateKeyVerify(i);)i=new Uint8Array(Sn(32));const n=bn.publicKeyCreate(i,t);return new In({publicKeyBase58:R(n),privateKeyBase58:R(i),...r})}export({publicKey:e=!1,privateKey:t=!1,includeContext:r=!1}={}){if(!e&&!t)throw new TypeError('export requires specifying either "publicKey" or "privateKey".');if(t&&!this.privateKeyBase58)throw new TypeError("No privateKey to export.");if(e&&!this.publicKeyBase58)throw new TypeError("No publicKey to export.");const i={type:this.type,id:this.id,controller:this.controller,revoked:this.revoked};return r&&(i["@context"]=In.SUITE_CONTEXT),t&&(i.privateKeyBase58=this.privateKeyBase58),e&&(i.publicKeyBase58=this.publicKeyBase58),i}signer(){const{privateKeyBase58:e}=this;return e?{async sign({data:t}){const r=b.encode(JSON.stringify({alg:"ES256K",b64:!1,crit:["b64"]})),n=i.from(t.buffer,t.byteOffset,t.length),o=Ln(i.from(i.concat([i.from(`${r}.`,"utf8"),i.from(n.buffer,n.byteOffset,n.length)]))),{signature:s}=bn.ecdsaSign(o,k(e));return`${r}..${b.encode(i.from(s))}`},id:this.id}:{async sign(){throw new Error("No private key to sign with.")},id:this.id}}verifier(){const{publicKeyBase58:e}=this;return e?{async verify({data:t,signature:r}){if(r.indexOf("..")<0)return!1;const[n,o]=r.split(".."),s=JSON.parse(b.decode(n));if("ES256K"!==s.alg||!1!==s.b64||!s.crit||!s.crit.length||"b64"!==s.crit[0])return!1;const a=i.from(t.buffer,t.byteOffset,t.length),h=Ln(i.from(i.concat([i.from(`${n}.`,"utf8"),i.from(a.buffer,a.byteOffset,a.length)])));let u;try{u=bn.ecdsaVerify(i.from(b.decode(o,"hex"),"hex"),h,k(e))}catch(e){u=!1}return u},id:this.id}:{async verify(){throw new Error("No public key to verify against")},id:this.id}}}In.suite=Kn,In.SUITE_CONTEXT="https://ns.did.ai/suites/secp256k1-2019/v1";const On="https://ns.did.ai/suites/secp256k1-2019/v1",Pn=({document:e,contextUrl:t})=>{const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)},Cn=({document:e})=>{const t=Pn({document:e,contextUrl:On}),r=Pn({document:e,contextUrl:"https://www.w3.org/2018/credentials/v1"}),i=Pn({document:e,contextUrl:"https://w3id.org/security/v2"});return t&&r?(console.warn("Warning: The secp256k1-2019/v1 and credentials/v1 contexts are incompatible."),console.warn("For VCs using EcdsaSecp256k1Signature2019 suite, using the credentials/v1 context is sufficient."),!1):t&&i?(console.warn("Warning: The secp256k1-2019/v1 and security/v2 contexts are incompatible."),console.warn("For VCs using EcdsaSecp256k1Signature2019 suite, using the security/v2 context is sufficient."),!1):t||r||i};let Dn=class extends d.suites.LinkedDataSignature{constructor(e={}){super({type:"EcdsaSecp256k1Signature2019",LDKeyClass:In,contextUrl:On,...e}),this.requiredKeyType=void 0,this.requiredKeyType="EcdsaSecp256k1VerificationKey2019"}async sign({verifyData:e,proof:t}){if(!this.signer||"function"!=typeof this.signer.sign)throw new Error("A signer API has not been specified.");return{...t,jws:await this.signer.sign({data:e})}}async verifySignature({verifyData:e,verificationMethod:t,proof:r}){const{jws:i}=r;if(!i||"string"!=typeof i)throw new TypeError('The proof does not include a valid "jws" property.');let{verifier:n}=this;if(!n){n=(await this.LDKeyClass.from(t)).verifier()}return n.verify({data:e,signature:i})}async assertVerificationMethod({verificationMethod:e}){if(!Cn({document:e}))throw new TypeError(`The verification method (key) must contain "${this.contextUrl}".`);if(!f.hasValue(e,"type",this.requiredKeyType))throw new Error(`Invalid key type. Key type must be "${this.requiredKeyType}".`);if(void 0!==e.revoked)throw new Error("The verification method has been revoked.")}async getVerificationMethod({proof:e,documentLoader:t}){if(this.key)return this.key.export({publicKey:!0});const r="object"==typeof e.verificationMethod?e.verificationMethod.id:e.verificationMethod;if(!r)throw new Error('No "verificationMethod" found in proof.');const i=await f.frame(r,{"@context":this.contextUrl,"@embed":"@always",id:r},{documentLoader:t,compactToRelative:!1});if(!i)throw new Error(`Verification method ${r} not found.`);if(void 0!==i.revoked)throw new Error("The verification method has been revoked.");return await this.assertVerificationMethod({verificationMethod:i}),i}async matchProof({proof:e,document:t,purpose:r,documentLoader:i,expansionMap:n}){if(!Cn({document:t}))return!1;if(!await super.matchProof({proof:e,document:t,purpose:r,documentLoader:i,expansionMap:n}))return!1;if(!this.key)return!0;const{verificationMethod:o}=e,s="object"==typeof o?o.id:o;return this.isVerificationMethodMatchingKeyId(s)}ensureSuiteContext({document:e,addSuiteContext:t}){Cn({document:e})||super.ensureSuiteContext({document:e,addSuiteContext:t})}isVerificationMethodMatchingKeyId(e){return e===this.key.id||e===`${this.key.controller}${this.key.id}`}};Dn.CONTEXT_URL=On,Dn.CONTEXT={"@context":{id:"@id",type:"@type","@protected":!0,proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},EcdsaSecp256k1VerificationKey2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1VerificationKey2019","@context":{"@protected":!0,id:"@id",type:"@type",controller:{"@id":"https://w3id.org/security#controller","@type":"@id"},revoked:{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},blockchainAccountId:{"@id":"https://w3id.org/security#blockchainAccountId"},publicKeyJwk:{"@id":"https://w3id.org/security#publicKeyJwk","@type":"@json"},publicKeyBase58:{"@id":"https://w3id.org/security#publicKeyBase58"},publicKeyMultibase:{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},EcdsaSecp256k1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@protected":!0,id:"@id",type:"@type",challenge:"https://w3id.org/security#challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},domain:"https://w3id.org/security#domain",expires:{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},nonce:"https://w3id.org/security#nonce",proofPurpose:{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":!0,id:"@id",type:"@type",assertionMethod:{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},capabilityDelegation:{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},keyAgreement:{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},jws:{"@id":"https://w3id.org/security#jws"},verificationMethod:{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}};const Bn="undefined"==typeof Buffer?i:Buffer,{purposes:{AssertionProofPurpose:Nn}}=d;var jn;!function(e){e.retrieveVerificationMethodPublicKey="retrieveVerificationMethodPublicKey",e.checkDocumentSignature="checkDocumentSignature"}(jn||(jn={}));class Un extends T{verificationProcess=[jn.retrieveVerificationMethodPublicKey,jn.checkDocumentSignature];documentToVerify;issuer;proof;type="EcdsaSecp256k1Signature2019";verificationKey;publicKey;constructor(e){super(e),e.executeStep&&(this.executeStep=e.executeStep),this.documentToVerify=e.document,this.issuer=e.issuer,this.proof=e.proof,this.validateProofType()}async init(){}async verifyProof(){for(const e of this.verificationProcess){if(!this[e])return void console.error("verification logic for",e,"not implemented");await this[e]()}}async verifyIdentity(){}getProofVerificationSteps(e){return this.verificationProcess.map((t=>n.verifier.convertToVerificationSubsteps(e,t)))}getIdentityVerificationSteps(){return[]}getIssuerPublicKey(){return this.publicKey}getIssuerName(){return this.issuer.name??""}getIssuerProfileDomain(){try{return new URL(this.getIssuerProfileUrl()).hostname??""}catch(e){return""}}getIssuerProfileUrl(){return this.issuer.id??""}getSigningDate(){return this.proof.created}async executeStep(e,t,r){throw new Error("doAction method needs to be overwritten by injecting from CVJS")}validateProofType(){const e=this.isProofChain()?this.proof.chainedProofType:this.proof.type;if(e!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${e}`)}isProofChain(){return"ChainedProof2021"===this.proof.type}generateDocumentLoader(){o[this.documentToVerify.issuer]=this.getTargetVerificationMethodContainer();return function(e){return e in o?{contextUrl:null,document:o[e],documentUrl:e}:f.documentLoader(e)}}retrieveInitialDocument(){const e=s(this.documentToVerify);if(Array.isArray(e.proof)){const t=e.proof.find((e=>e.type===this.type));delete e.proof,e.proof=t}return e}getTargetVerificationMethodContainer(){return this.issuer.didDocument??this.issuer}async retrieveVerificationMethodPublicKey(){this.verificationKey=await this.executeStep(jn.retrieveVerificationMethodPublicKey,(async()=>{const e=_(this.getTargetVerificationMethodContainer(),this.proof.verificationMethod);if(e.publicKeyJwk&&!e.publicKeyBase58){const r=(e=>{const t=g.from({...e,crv:"K-256"},"jwk").toString("blk","public"),r=_n.publicKeyConvert(Bn.from(t,"hex"),!0);return Bn.from(r).toString("hex")})(e.publicKeyJwk);e.publicKeyBase58=(t=r,v.encode(Bn.from(t,"hex")))}var t;this.publicKey=e.publicKeyBase58;const r=In.from({...e});if(!r)throw new a(jn.retrieveVerificationMethodPublicKey,"Could not derive the verification key");if(r.revoked)throw new a(jn.retrieveVerificationMethodPublicKey,"The verification key has been revoked");return r}),this.type)}async checkDocumentSignature(){await this.executeStep(jn.checkDocumentSignature,(async()=>{const e=new Dn({key:this.verificationKey});e.date=new Date(Date.now()).toISOString();const t=await d.verify(this.retrieveInitialDocument(),{suite:e,purpose:new Nn,documentLoader:this.generateDocumentLoader()});if(!t.verified)throw console.error(JSON.stringify(t,null,2)),new a(jn.checkDocumentSignature,`The document's ${this.type} signature could not be confirmed`);console.log("Credential Secp256k1 signature successfully verified")}),this.type)}}export{Un as default};