@blockcerts/blockcerts-verifier 1.72.3 → 1.73.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 (55) hide show
  1. package/README.md +8 -0
  2. package/bundle-stats.html +1 -1
  3. package/codecov +0 -0
  4. package/codecov.SHA256SUM +1 -0
  5. package/codecov.SHA256SUM.sig +16 -0
  6. package/coverage/lcov.info +475 -472
  7. package/dist/{DataIntegrityProof-BhL7Kkhm-affsdujn.js → DataIntegrityProof-D8TnXEkl-CGiIg0kn.js} +2 -2
  8. package/dist/{EcdsaSd2023-CUjrjGzC-Cx7ejHu-.js → EcdsaSd2023-D2eJBmaY-mHNjbn8h.js} +9 -13
  9. package/dist/EcdsaSecp256k1Signature2019-BRdQnZ0o-D_QN8KrS.js +1 -0
  10. package/dist/{Ed25519Signature2020-fJGvlbIp-B6XhFwr4.js → Ed25519Signature2020-D2tdrIA4-PSi5TCQH.js} +6 -6
  11. package/dist/EddsaRdfc2022-CpZAUc7W-BJP0532C.js +14 -0
  12. package/dist/{HashlinkVerifier-udsj5z09-BTqOkVoD.js → HashlinkVerifier-BcdAFe02-DMjUYzMR.js} +1 -1
  13. package/dist/MerkleProof2017-DW_9FhLr-C0dPtifx.js +1 -0
  14. package/dist/MerkleProof2019-DJbo7uW--CHlhsnHk.js +5 -0
  15. package/dist/Suite-BmP2Qu19-D1ucdMDB.js +1 -0
  16. package/dist/_polyfill-node.crypto-MVmI5M_M-exGcp6nW.js +1 -0
  17. package/dist/_polyfill-node.path-hKwMKLNw-B7aPtphV.js +1 -0
  18. package/dist/checkBitStringStatusList-BUPuVWy_-CYedocxJ.js +13 -0
  19. package/dist/checkCredentialSchemaConformity-CJdGwNcY-CaSak-bD.js +1 -0
  20. package/dist/controlVerificationMethod-C71lJp3H-n-AbzkO8.js +1 -0
  21. package/dist/{downloadPDF-UAsY-nU_.js → downloadPDF-BU6CfP-N.js} +2 -2
  22. package/dist/{ensureNotRevoked-ByWaYoog-BheL-ZKZ.js → ensureNotRevoked-BWp1jPEo-DSQMtjrj.js} +1 -1
  23. package/dist/ensureValidIssuingKey-BYAR3LEF-76kiqVKA.js +1 -0
  24. package/dist/{index-tlZQQ_rg-CYTlxhyY.js → index-BCu3PGuw-Dh4-8Ruv.js} +1 -1
  25. package/dist/index-CB7VaVsF-G_Mj6xql.js +30 -0
  26. package/dist/index-Jn9Q6fuB-uChPhl1c.js +56 -0
  27. package/dist/{index-DjD0A6uJ-BdFUkPCF.js → index-OtXtCWrq-CyttRwCk.js} +4 -4
  28. package/dist/{index.es-CnYWLNZV.js → index.es-C2GPR7m7.js} +1 -1
  29. package/dist/jsonld-DqC1oHcn-ruRlORc0.js +88 -0
  30. package/dist/main.js +84 -84
  31. package/dist/purify.es-C6IIzwyE.js +2 -0
  32. package/dist/{retrieveVerificationMethodPublicKey-D_autuwE-DGbK-RPm.js → retrieveVerificationMethodPublicKey-Dai7em0K-BqIH8qzD.js} +1 -1
  33. package/dist/verifyIssuerProfile-zkczSLpC-CTHpISfH.js +1 -0
  34. package/dist/webcrypto.es-9hytEjC6-gGk5JRJH.js +40 -0
  35. package/package.json +9 -9
  36. package/dist/EcdsaSecp256k1Signature2019-D90cAynb-Bf5kILPF.js +0 -1
  37. package/dist/EddsaRdfc2022-XufziFi3-D5IoKiRE.js +0 -14
  38. package/dist/MerkleProof2017-C0RhRNNx-zjQMRSQY.js +0 -1
  39. package/dist/MerkleProof2019-B7f1hhem-CjLDyx6Q.js +0 -5
  40. package/dist/Suite-Bu3gszvt-Dmvbh142.js +0 -33
  41. package/dist/_polyfill-node.crypto-DGISCHrB-C5-OOGc0.js +0 -1
  42. package/dist/checkCredentialSchemaConformity-CgpOS3eC-AjSPoJub.js +0 -1
  43. package/dist/checkRevocationStatusList2021-D4VNDRlW-DgNfOAoI.js +0 -13
  44. package/dist/controlVerificationMethod-CSwPoUL8-CvUADmjg.js +0 -1
  45. package/dist/ed25519-key-pair.esm-DxoBwwVJ-D8j8wFfG.js +0 -1
  46. package/dist/ensureValidIssuingKey-DEV9E0Ph-DY8BTObG.js +0 -1
  47. package/dist/index-DZ7aUhT_-D0G2DVsh.js +0 -29
  48. package/dist/jsonld-signatures-D4X_Irzi-D_wBqxSl.js +0 -56
  49. package/dist/pako.esm-BGRKTPxS-Bodm4Eha.js +0 -2
  50. package/dist/purify.es-Om653OSQ.js +0 -2
  51. package/dist/sha2-JcCWfgvE-By1_saxP.js +0 -2
  52. package/dist/tslib.es6--gQC4x5c-CmLYFWVC.js +0 -1
  53. package/dist/verifyIssuerProfile-2PhdMtQZ-CfqcAkBL.js +0 -1
  54. package/dist/webcrypto.es-BOyMRPOj-CAxP3jJR.js +0 -40
  55. /package/dist/{index-CyNtT_1q-Dgus2xdV.js → index-KzSDgEl9-Dgus2xdV.js} +0 -0
@@ -1,29 +0,0 @@
1
- import{s as e,f as t,u as r}from"./main.js";import{a as n,r as i,b as o,c as s,h as c,d as u,i as a,e as f,f as l,g as d,s as y}from"./sha2-JcCWfgvE-By1_saxP.js";
2
- /*!
3
- * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
4
- */
5
- const h="ECDSA",p=!0,w="https://w3id.org/security/suites/ecdsa-2019/v1",b="https://w3id.org/security/multikey/v1",g="z",m=new Uint8Array([231,1]),E=new Uint8Array([128,36]),v=new Uint8Array([129,36]),B=new Uint8Array([130,36]),k=new Uint8Array([129,38]),x=new Uint8Array([134,38]),K=new Uint8Array([135,38]),O=new Uint8Array([136,38]),R="P-256",A="P-384",S="P-521",U="K-256",I="SHA-256",M="SHA-384",q="SHA-512",j=globalThis.crypto,C=globalThis.CryptoKey??j.CryptoKey;function N({curve:e}){if(e===R||e===U)return I;if(e===A)return M;if(e===S)return q;throw new TypeError(`Unsupported curve "${e}".`)}
6
- /*!
7
- * Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
8
- */function P({publicMultikey:e}){if(e[0]===E[0]&&e[1]===E[1])return R;if(e[0]===v[0]&&e[1]===v[1])return A;if(e[0]===B[0]&&e[1]===B[1])return S;if(e[0]===m[0]&&e[1]===m[1])return U;throw new TypeError("Unsupported public multikey header.")}function T({secretMultikey:e}){if(e[0]===x[0]&&e[1]===x[1])return R;if(e[0]===K[0]&&e[1]===K[1])return A;if(e[0]===O[0]&&e[1]===O[1])return S;if(e[0]===k[0]&&e[1]===k[1])return U;throw new TypeError("Unsupported secret multikey header.")}function F({curve:e}){if(e===R||e===U)return 32;if(e===A)return 48;if(e===S)return 66;throw new TypeError(`Unsupported curve "${e}".`)}
9
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
10
- const H=BigInt(0),Z=BigInt(1);function V(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}" `)+"expected boolean, got type="+typeof e)}return e}function D(e){if("bigint"==typeof e){if(!G(e))throw new Error("positive bigint expected, got "+e)}else d(e);return e}function L(e){const t=D(e).toString(16);return 1&t.length?"0"+t:t}function _(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?H:BigInt("0x"+e)}function $(e){return _(o(e))}function Y(e){return _(o(function(e){return Uint8Array.from(e)}(s(e)).reverse()))}function z(e,t){d(t),e=D(e);const r=c(e.toString(16).padStart(2*t,"0"));if(r.length!==t)throw new Error("number too large");return r}function X(e,t){return z(e,t).reverse()}const G=e=>"bigint"==typeof e&&H<=e;function W(e,t,r,n){if(!function(e,t,r){return G(e)&&G(t)&&G(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}const J=e=>(Z<<BigInt(e))-Z;function Q(e,t={},r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");const n=(t,r)=>Object.entries(t).forEach(([t,n])=>function(t,r,n){const i=e[t];if(n&&void 0===i)return;const o=typeof i;if(o!==r||null===i)throw new Error(`param "${t}" is invalid: expected ${r}, got ${o}`)}(t,n,r));n(t,!1),n(r,!0)}function ee(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const o=e(r,...n);return t.set(r,o),o}}
11
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const te=BigInt(0),re=BigInt(1),ne=BigInt(2),ie=BigInt(3),oe=BigInt(4),se=BigInt(5),ce=BigInt(7),ue=BigInt(8),ae=BigInt(9),fe=BigInt(16);function le(e,t){const r=e%t;return r>=te?r:t+r}function de(e,t,r){let n=e;for(;t-- >te;)n*=n,n%=r;return n}function ye(e,t){if(e===te)throw new Error("invert: expected non-zero number");if(t<=te)throw new Error("invert: expected positive modulus, got "+t);let r=le(e,t),n=t,i=te,o=re;for(;r!==te;){const e=n%r,t=i-o*(n/r);n=r,r=e,i=o,o=t}if(n!==re)throw new Error("invert: does not exist");return le(i,t)}function he(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function pe(e,t){const r=(e.ORDER+re)/oe,n=e.pow(t,r);return he(e,n,t),n}function we(e,t){const r=(e.ORDER-se)/ue,n=e.mul(t,ne),i=e.pow(n,r),o=e.mul(t,i),s=e.mul(e.mul(o,ne),i),c=e.mul(o,e.sub(s,e.ONE));return he(e,c,t),c}function be(e){if(e<ie)throw new Error("sqrt is not defined for small field");let t=e-re,r=0;for(;t%ne===te;)t/=ne,r++;let n=ne;const i=ke(e);for(;1===ve(i,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return pe;let o=i.pow(n,t);const s=(t+re)/ne;return function(e,n){if(e.is0(n))return n;if(1!==ve(e,n))throw new Error("Cannot find square root");let i=r,c=e.mul(e.ONE,o),u=e.pow(n,t),a=e.pow(n,s);for(;!e.eql(u,e.ONE);){if(e.is0(u))return e.ZERO;let t=1,r=e.sqr(u);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw new Error("Cannot find square root");const n=re<<BigInt(i-t-1),o=e.pow(c,n);i=t,c=e.sqr(o),u=e.mul(u,c),a=e.mul(a,o)}return a}}function ge(e){return e%oe===ie?pe:e%ue===se?we:e%fe===ae?function(e){const t=ke(e),r=be(e),n=r(t,t.neg(t.ONE)),i=r(t,n),o=r(t,t.neg(n)),s=(e+ce)/fe;return(e,t)=>{let r=e.pow(t,s),c=e.mul(r,n);const u=e.mul(r,i),a=e.mul(r,o),f=e.eql(e.sqr(c),t),l=e.eql(e.sqr(u),t);r=e.cmov(r,c,f),c=e.cmov(a,u,l);const d=e.eql(e.sqr(c),t),y=e.cmov(r,c,d);return he(e,y,t),y}}(e):be(e)}const me=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ee(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),o=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),o),n}function ve(e,t){const r=(e.ORDER-re)/ne,n=e.pow(t,r),i=e.eql(n,e.ONE),o=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!i&&!o&&!s)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}class Be{ORDER;BITS;BYTES;isLE;ZERO=te;ONE=re;_lengths;_sqrt;_mod;constructor(e,t={}){if(e<=te)throw new Error("invalid field: expected ORDER > 0, got "+e);let r;this.isLE=!1,null!=t&&"object"==typeof t&&("number"==typeof t.BITS&&(r=t.BITS),"function"==typeof t.sqrt&&(this.sqrt=t.sqrt),"boolean"==typeof t.isLE&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=t.allowedLengths?.slice()),"boolean"==typeof t.modFromBytes&&(this._mod=t.modFromBytes));const{nBitLength:n,nByteLength:i}=function(e,t){void 0!==t&&d(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}(e,r);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=n,this.BYTES=i,this._sqrt=void 0,Object.preventExtensions(this)}create(e){return le(e,this.ORDER)}isValid(e){if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return te<=e&&e<this.ORDER}is0(e){return e===te}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&re)===re}neg(e){return le(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return le(e*e,this.ORDER)}add(e,t){return le(e+t,this.ORDER)}sub(e,t){return le(e-t,this.ORDER)}mul(e,t){return le(e*t,this.ORDER)}pow(e,t){return function(e,t,r){if(r<te)throw new Error("invalid exponent, negatives unsupported");if(r===te)return e.ONE;if(r===re)return t;let n=e.ONE,i=t;for(;r>te;)r&re&&(n=e.mul(n,i)),i=e.sqr(i),r>>=re;return n}(this,e,t)}div(e,t){return le(e*ye(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return ye(e,this.ORDER)}sqrt(e){return this._sqrt||(this._sqrt=ge(this.ORDER)),this._sqrt(this,e)}toBytes(e){return this.isLE?X(e,this.BYTES):z(e,this.BYTES)}fromBytes(e,t=!1){s(e);const{_lengths:r,BYTES:n,isLE:i,ORDER:o,_mod:c}=this;if(r){if(!r.includes(e.length)||e.length>n)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+e.length);const t=new Uint8Array(n);t.set(e,i?0:t.length-e.length),e=t}if(e.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+e.length);let u=i?Y(e):$(e);if(c&&(u=le(u,o)),!t&&!this.isValid(u))throw new Error("invalid field element: outside of range 0..ORDER");return u}invertBatch(e){return Ee(this,e)}cmov(e,t,r){return r?t:e}}function ke(e,t={}){return new Be(e,t)}function xe(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Ke(e){const t=xe(e);return t+Math.ceil(t/2)}
12
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
13
- const Oe=BigInt(0),Re=BigInt(1);function Ae(e,t){const r=t.negate();return e?r:t}function Se(e,t){const r=Ee(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function Ue(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Ie(e,t){Ue(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:J(e),maxNumber:r,shiftBy:BigInt(e)}}function Me(e,t,r){const{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r;let c=Number(e&i),u=e>>s;c>n&&(c-=o,u+=Re);const a=t*n;return{nextN:u,offset:a+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:t%2!=0,offsetF:a}}const qe=new WeakMap,je=new WeakMap;function Ce(e){return je.get(e)||1}function Ne(e){if(e!==Oe)throw new Error("invalid wNAF")}class Pe{BASE;ZERO;Fn;bits;constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>Oe;)t&Re&&(r=r.add(n)),n=n.double(),t>>=Re;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=Ie(t,this.bits),i=[];let o=e,s=o;for(let e=0;e<r;e++){s=o,i.push(s);for(let e=1;e<n;e++)s=s.add(o),i.push(s);o=s.double()}return i}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,i=this.BASE;const o=Ie(e,this.bits);for(let e=0;e<o.windows;e++){const{nextN:s,offset:c,isZero:u,isNeg:a,isNegF:f,offsetF:l}=Me(r,e,o);r=s,u?i=i.add(Ae(f,t[l])):n=n.add(Ae(a,t[c]))}return Ne(r),{p:n,f:i}}wNAFUnsafe(e,t,r,n=this.ZERO){const i=Ie(e,this.bits);for(let e=0;e<i.windows&&r!==Oe;e++){const{nextN:o,offset:s,isZero:c,isNeg:u}=Me(r,e,i);if(r=o,!c){const e=t[s];n=n.add(u?e.negate():e)}}return Ne(r),n}getPrecomputes(e,t,r){let n=qe.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),qe.set(t,n))),n}cached(e,t,r){const n=Ce(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const i=Ce(e);return 1===i?this._unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)}createCache(e,t){Ue(t,this.bits),je.set(e,t),qe.delete(e)}hasCache(e){return 1!==Ce(e)}}function Te(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){Q(e,me.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",BYTES:"number",BITS:"number"}))}(t),t}return ke(e,{isLE:r})}class Fe{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){if(n(e),s(t,void 0,"key"),this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),f(i)}update(e){return l(this),this.iHash.update(e),this}digestInto(e){l(this),s(e,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const He=(e,t,r)=>new Fe(e,t).update(r).digest();He.create=(e,t)=>new Fe(e,t);
14
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
15
- const Ze=(e,t)=>(e+(e>=0?t:-t)/Xe)/t;function Ve(e,t,r){const[[n,i],[o,s]]=t,c=Ze(s*e,r),u=Ze(-i*e,r);let a=e-c*n-u*o,f=-c*i-u*s;const l=a<Ye,d=f<Ye;l&&(a=-a),d&&(f=-f);const y=J(Math.ceil(function(e){let t;for(t=0;e>H;e>>=Z,t+=1);return t}(r)/2))+ze;if(a<Ye||a>=y||f<Ye||f>=y)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:l,k1:a,k2neg:d,k2:f}}function De(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function Le(e,t){const r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return V(r.lowS,"lowS"),V(r.prehash,"prehash"),void 0!==r.format&&De(r.format),r}class _e extends Error{constructor(e=""){super(e)}}const $e={Err:_e,_tlv:{encode:(e,t)=>{const{Err:r}=$e;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,i=L(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const o=n>127?L(i.length/2|128):"";return L(e)+o+i+t},decode(e,t){const{Err:r}=$e;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const i=t[n++];let o=0;if(!!(128&i)){const e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)o=o<<8|e;if(n+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;const s=t.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+o)}}},_int:{encode(e){const{Err:t}=$e;if(e<Ye)throw new t("integer: negative integers are not allowed");let r=L(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=$e;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return $(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=$e,i=s(e,void 0,"signature"),{v:o,l:c}=n.decode(48,i);if(c.length)throw new t("invalid signature: left bytes after parsing");const{v:u,l:a}=n.decode(2,o),{v:f,l:l}=n.decode(2,a);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(u),s:r.decode(f)}},hexFromSig(e){const{_tlv:t,_int:r}=$e,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},Ye=BigInt(0),ze=BigInt(1),Xe=BigInt(2),Ge=BigInt(3),We=BigInt(4);function Je(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>Oe))throw new Error(`CURVE.${e} must be positive bigint`)}const i=Te(t.p,r.Fp,n),o=Te(t.n,r.Fn,n),s=["Gx","Gy","a","b"];for(const e of s)if(!i.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:i,Fn:o}}("weierstrass",e,t),{Fp:n,Fn:i}=r;let a=r.CURVE;const{h:f,n:l}=a;Q(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});const{endo:d}=t;if(d&&(!n.is0(a.a)||"bigint"!=typeof d.beta||!Array.isArray(d.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const y=et(n,i);function h(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const p=t.toBytes||function(e,t,r){const{x:i,y:o}=t.toAffine(),s=n.toBytes(i);if(V(r,"isCompressed"),r){h();const e=!n.isOdd(o);return u(Qe(e),s)}return u(Uint8Array.of(4),s,n.toBytes(o))},w=t.fromBytes||function(e){s(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=y,i=e.length,o=e[0],c=e.subarray(1);if(i!==t||2!==o&&3!==o){if(i===r&&4===o){const e=n.BYTES,t=n.fromBytes(c.subarray(0,e)),r=n.fromBytes(c.subarray(e,2*e));if(!g(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${i}, expected compressed=${t} or uncompressed=${r}`)}{const e=n.fromBytes(c);if(!n.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=b(e);let r;try{r=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}h();return!(1&~o)!==n.isOdd(r)&&(r=n.neg(r)),{x:e,y:r}}};function b(e){const t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,a.a)),a.b)}function g(e,t){const r=n.sqr(t),i=b(e);return n.eql(r,i)}if(!g(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const m=n.mul(n.pow(a.a,Ge),We),E=n.mul(n.sqr(a.b),BigInt(27));if(n.is0(n.add(m,E)))throw new Error("bad curve params: a or b");function v(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function B(e){if(!(e instanceof R))throw new Error("Weierstrass Point expected")}function k(e){if(!d||!d.basises)throw new Error("no endo");return Ve(e,d.basises,i.ORDER)}const x=ee((e,t)=>{const{X:r,Y:i,Z:o}=e;if(n.eql(o,n.ONE))return{x:r,y:i};const s=e.is0();null==t&&(t=s?n.ONE:n.inv(o));const c=n.mul(r,t),u=n.mul(i,t),a=n.mul(o,t);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(a,n.ONE))throw new Error("invZ was invalid");return{x:c,y:u}}),K=ee(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:i}=e.toAffine();if(!n.isValid(r)||!n.isValid(i))throw new Error("bad point: x or y not field elements");if(!g(r,i))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function O(e,t,r,i,o){return r=new R(n.mul(r.X,e),r.Y,r.Z),t=Ae(i,t),r=Ae(o,r),t.add(r)}class R{static BASE=new R(a.Gx,a.Gy,n.ONE);static ZERO=new R(n.ZERO,n.ONE,n.ZERO);static Fp=n;static Fn=i;X;Y;Z;constructor(e,t,r){this.X=v("x",e),this.Y=v("y",t,!0),this.Z=v("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof R)throw new Error("projective point not allowed");return n.is0(t)&&n.is0(r)?R.ZERO:new R(t,r,n.ONE)}static fromBytes(e){const t=R.fromAffine(w(s(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return R.fromBytes(c(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return S.createCache(this,e),t||this.multiply(Ge),this}assertValidity(){K(this)}hasEvenY(){const{y:e}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){B(e);const{X:t,Y:r,Z:i}=this,{X:o,Y:s,Z:c}=e,u=n.eql(n.mul(t,c),n.mul(o,i)),a=n.eql(n.mul(r,c),n.mul(s,i));return u&&a}negate(){return new R(this.X,n.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,r=n.mul(t,Ge),{X:i,Y:o,Z:s}=this;let c=n.ZERO,u=n.ZERO,f=n.ZERO,l=n.mul(i,i),d=n.mul(o,o),y=n.mul(s,s),h=n.mul(i,o);return h=n.add(h,h),f=n.mul(i,s),f=n.add(f,f),c=n.mul(e,f),u=n.mul(r,y),u=n.add(c,u),c=n.sub(d,u),u=n.add(d,u),u=n.mul(c,u),c=n.mul(h,c),f=n.mul(r,f),y=n.mul(e,y),h=n.sub(l,y),h=n.mul(e,h),h=n.add(h,f),f=n.add(l,l),l=n.add(f,l),l=n.add(l,y),l=n.mul(l,h),u=n.add(u,l),y=n.mul(o,s),y=n.add(y,y),l=n.mul(y,h),c=n.sub(c,l),f=n.mul(y,d),f=n.add(f,f),f=n.add(f,f),new R(c,u,f)}add(e){B(e);const{X:t,Y:r,Z:i}=this,{X:o,Y:s,Z:c}=e;let u=n.ZERO,f=n.ZERO,l=n.ZERO;const d=a.a,y=n.mul(a.b,Ge);let h=n.mul(t,o),p=n.mul(r,s),w=n.mul(i,c),b=n.add(t,r),g=n.add(o,s);b=n.mul(b,g),g=n.add(h,p),b=n.sub(b,g),g=n.add(t,i);let m=n.add(o,c);return g=n.mul(g,m),m=n.add(h,w),g=n.sub(g,m),m=n.add(r,i),u=n.add(s,c),m=n.mul(m,u),u=n.add(p,w),m=n.sub(m,u),l=n.mul(d,g),u=n.mul(y,w),l=n.add(u,l),u=n.sub(p,l),l=n.add(p,l),f=n.mul(u,l),p=n.add(h,h),p=n.add(p,h),w=n.mul(d,w),g=n.mul(y,g),p=n.add(p,w),w=n.sub(h,w),w=n.mul(d,w),g=n.add(g,w),h=n.mul(p,g),f=n.add(f,h),h=n.mul(m,g),u=n.mul(b,u),u=n.sub(u,h),h=n.mul(b,p),l=n.mul(m,l),l=n.add(l,h),new R(u,f,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(R.ZERO)}multiply(e){const{endo:r}=t;if(!i.isValidNot0(e))throw new Error("invalid scalar: out of range");let n,o;const s=e=>S.cached(this,e,e=>Se(R,e));if(r){const{k1neg:t,k1:i,k2neg:c,k2:u}=k(e),{p:a,f:f}=s(i),{p:l,f:d}=s(u);o=f.add(d),n=O(r.beta,a,l,t,c)}else{const{p:t,f:r}=s(e);n=t,o=r}return Se(R,[n,o])[0]}multiplyUnsafe(e){const{endo:r}=t,n=this;if(!i.isValid(e))throw new Error("invalid scalar: out of range");if(e===Ye||n.is0())return R.ZERO;if(e===ze)return n;if(S.hasCache(this))return this.multiply(e);if(r){const{k1neg:t,k1:i,k2neg:o,k2:s}=k(e),{p1:c,p2:u}=function(e,t,r,n){let i=t,o=e.ZERO,s=e.ZERO;for(;r>Oe||n>Oe;)r&Re&&(o=o.add(i)),n&Re&&(s=s.add(i)),i=i.double(),r>>=Re,n>>=Re;return{p1:o,p2:s}}(R,n,i,s);return O(r.beta,c,u,t,o)}return S.unsafe(n,e)}toAffine(e){return x(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return f===ze||(e?e(R,this):S.unsafe(this,l).is0())}clearCofactor(){const{clearCofactor:e}=t;return f===ze?this:e?e(R,this):this.multiplyUnsafe(f)}isSmallOrder(){return this.multiplyUnsafe(f).is0()}toBytes(e=!0){return V(e,"isCompressed"),this.assertValidity(),p(R,this,e)}toHex(e=!0){return o(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const A=i.BITS,S=new Pe(R,t.endo?Math.ceil(A/2):A);return R.BASE.precompute(8),R}function Qe(e){return Uint8Array.of(e?2:3)}function et(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function tt(e,t={}){const{Fn:r}=e,n=t.randomBytes||i,o=Object.assign(et(e.Fp,r),{seed:Ke(r.ORDER)});function c(e=n(o.seed)){return function(e,t,r=!1){s(e);const n=e.length,i=xe(t),o=Ke(t);if(n<16||n<o||n>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+n);const c=le(r?Y(e):$(e),t-re)+re;return r?X(c,i):z(c,i)}(s(e,o.seed,"seed"),r.ORDER)}function u(t,n=!0){return e.BASE.multiply(r.fromBytes(t)).toBytes(n)}function f(e){const{secretKey:t,publicKey:n,publicKeyUncompressed:i}=o;if(!a(e))return;if("_lengths"in r&&r._lengths||t===n)return;const c=s(e,void 0,"key").length;return c===n||c===i}const l={isValidSecretKey:function(e){try{const t=r.fromBytes(e);return r.isValidNot0(t)}catch(e){return!1}},isValidPublicKey:function(t,r){const{publicKey:n,publicKeyUncompressed:i}=o;try{const o=t.length;return(!0!==r||o===n)&&((!1!==r||o===i)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:c},d=function(e,t){return function(r){const n=e(r);return{secretKey:n,publicKey:t(n)}}}(c,u);return Object.freeze({getPublicKey:u,getSharedSecret:function(t,n,i=!0){if(!0===f(t))throw new Error("first arg must be private key");if(!1===f(n))throw new Error("second arg must be public key");const o=r.fromBytes(t);return e.fromBytes(n).multiply(o).toBytes(i)},keygen:d,Point:e,utils:l,lengths:o})}function rt(e,t,r={}){n(t),Q(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const f=(r=Object.assign({},r)).randomBytes||i,l=r.hmac||((e,r)=>He(t,e,r)),{Fp:y,Fn:h}=e,{ORDER:p,BITS:w}=h,{keygen:b,getPublicKey:g,getSharedSecret:m,utils:E,lengths:v}=tt(e,r),B={prehash:!0,lowS:"boolean"!=typeof r.lowS||r.lowS,format:"compact",extraEntropy:!1},k=p*Xe<y.ORDER;function x(e){return e>p>>ze}function K(e,t){if(!h.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function O(){if(k)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function R(e,t){De(t);const r=v.signature;return s(e,"compact"===t?r:"recovered"===t?r+1:void 0)}class A{r;s;recovery;constructor(e,t,r){if(this.r=K("r",e),this.s=K("s",t),null!=r){if(O(),![0,1,2,3].includes(r))throw new Error("invalid recovery id");this.recovery=r}Object.freeze(this)}static fromBytes(e,t=B.format){let r;if(R(e,t),"der"===t){const{r:t,s:r}=$e.toSig(s(e));return new A(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const n=v.signature/2,i=e.subarray(0,n),o=e.subarray(n,2*n);return new A(h.fromBytes(i),h.fromBytes(o),r)}static fromHex(e,t){return this.fromBytes(c(e),t)}assertRecovery(){const{recovery:e}=this;if(null==e)throw new Error("invalid recovery id: must be present");return e}addRecoveryBit(e){return new A(this.r,this.s,e)}recoverPublicKey(t){const{r:r,s:n}=this,i=this.assertRecovery(),o=2===i||3===i?r+p:r;if(!y.isValid(o))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const c=y.toBytes(o),a=e.fromBytes(u(Qe(!(1&i)),c)),f=h.inv(o),l=U(s(t,void 0,"msgHash")),d=h.create(-l*f),w=h.create(n*f),b=e.BASE.multiplyUnsafe(d).add(a.multiplyUnsafe(w));if(b.is0())throw new Error("invalid recovery: point at infinify");return b.assertValidity(),b}hasHighS(){return x(this.s)}toBytes(e=B.format){if(De(e),"der"===e)return c($e.hexFromSig(this));const{r:t,s:r}=this,n=h.toBytes(t),i=h.toBytes(r);return"recovered"===e?(O(),u(Uint8Array.of(this.assertRecovery()),n,i)):u(n,i)}toHex(e){return o(this.toBytes(e))}}const S=r.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=$(e),r=8*e.length-w;return r>0?t>>BigInt(r):t},U=r.bits2int_modN||function(e){return h.create(S(e))},I=J(w);function M(e){return W("num < 2^"+w,e,Ye,I),h.toBytes(e)}function q(e,r){return s(e,void 0,"message"),r?s(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:b,getPublicKey:g,getSharedSecret:m,utils:E,lengths:v,Point:e,sign:function(r,n,i={}){const{seed:o,k2sig:c}=function(t,r,n){const{lowS:i,prehash:o,extraEntropy:c}=Le(n,B);t=q(t,o);const a=U(t),l=h.fromBytes(r);if(!h.isValidNot0(l))throw new Error("invalid private key");const d=[M(l),M(a)];if(null!=c&&!1!==c){const e=!0===c?f(v.secretKey):c;d.push(s(e,void 0,"extraEntropy"))}const y=u(...d),p=a;return{seed:y,k2sig:function(t){const r=S(t);if(!h.isValidNot0(r))return;const n=h.inv(r),o=e.BASE.multiply(r).toAffine(),s=h.create(o.x);if(s===Ye)return;const c=h.create(n*h.create(p+s*l));if(c===Ye)return;let u=(o.x===s?0:2)|Number(o.y&ze),a=c;return i&&x(c)&&(a=h.neg(c),u^=1),new A(s,a,k?void 0:u)}}}(r,n,i);return function(e,t,r){if(d(e,"hashLen"),d(t,"qByteLen"),"function"!=typeof r)throw new Error("hmacFn must be a function");const n=e=>new Uint8Array(e),i=Uint8Array.of(),o=Uint8Array.of(0),s=Uint8Array.of(1);let c=n(e),a=n(e),f=0;const l=()=>{c.fill(1),a.fill(0),f=0},y=(...e)=>r(a,u(c,...e)),h=(e=i)=>{a=y(o,e),c=y(),0!==e.length&&(a=y(s,e),c=y())},p=()=>{if(f++>=1e3)throw new Error("drbg: tried max amount of iterations");let e=0;const r=[];for(;e<t;){c=y();const t=c.slice();r.push(t),e+=c.length}return u(...r)};return(e,t)=>{let r;for(l(),h(e);!(r=t(p()));)h();return l(),r}}(t.outputLen,h.BYTES,l)(o,c).toBytes(i.format)},verify:function(t,r,n,i={}){const{lowS:o,prehash:c,format:u}=Le(i,B);if(n=s(n,void 0,"publicKey"),r=q(r,c),!a(t)){throw new Error("verify expects Uint8Array signature"+(t instanceof A?", use sig.toBytes()":""))}R(t,u);try{const i=A.fromBytes(t,u),s=e.fromBytes(n);if(o&&i.hasHighS())return!1;const{r:c,s:a}=i,f=U(r),l=h.inv(a),d=h.create(f*l),y=h.create(c*l),p=e.BASE.multiplyUnsafe(d).add(s.multiplyUnsafe(y));if(p.is0())return!1;return h.create(p.x)===c}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:n}=Le(r,B);return t=q(t,n),A.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:A,hash:t})}
16
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nt={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},it={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},ot=BigInt(2);const st=ke(nt.p,{sqrt:function(e){const t=nt.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),c=BigInt(44),u=BigInt(88),a=e*e*e%t,f=a*a*e%t,l=de(f,r,t)*f%t,d=de(l,r,t)*f%t,y=de(d,ot,t)*a%t,h=de(y,i,t)*y%t,p=de(h,o,t)*h%t,w=de(p,c,t)*p%t,b=de(w,u,t)*w%t,g=de(b,c,t)*p%t,m=de(g,r,t)*f%t,E=de(m,s,t)*h%t,v=de(E,n,t)*a%t,B=de(v,ot,t);if(!st.eql(st.sqr(B),e))throw new Error("Cannot find square root");return B}}),ct=rt(Je(nt,{Fp:st,endo:it}),y);class ut{constructor(e){this.ec={...ct},null!=e.priv&&(this.priv=e.priv),null!=e.pub&&(this.pub=e.pub)}static hexToBytes(e){if("string"!=typeof e)throw new Error("hex string expected");if(e.length%2)throw new Error("hex string must have even length");const t=e.length/2,r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=parseInt(e.substr(2*n,2),16);return r}static bytesToHex(e){return Array.from(e||[]).map(e=>e.toString(16).padStart(2,"0")).join("")}static keyFromPublic(e,t="hex"){const r="hex"===t?ut.hexToBytes(e):e;return new ut({pub:r})}getPublic(e=!0,t="hex"){this.pub||(this.pub=this.ec.getPublicKey(this.priv,!1));let r=this.pub;const n=this.ec.Point.fromHex(ut.bytesToHex(r)).toHex(e);return r=ut.hexToBytes(n),"hex"===t?ut.bytesToHex(r):r}}
17
- /*!
18
- * Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
19
- */const at=new Map([[R,{secret:new Uint8Array([48,103,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,77,48,75,2,1,1,4,32]),public:new Uint8Array([161,36,3,34,0])}],[A,{secret:new Uint8Array([48,129,132,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,4,109,48,107,2,1,1,4,48]),public:new Uint8Array([161,52,3,50,0])}],[S,{secret:new Uint8Array([48,129,170,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,4,129,146,48,129,143,2,1,1,4,66]),public:new Uint8Array([161,70,3,68,0])}],[U,{secret:new Uint8Array([48,129,132,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,10,4,109,48,107,2,1,1,4,32]),public:new Uint8Array([161,68,3,66,0])}]]),ft=new Map([[R,new Uint8Array([48,57,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,3,34,0])],[A,new Uint8Array([48,70,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,3,50,0])],[S,new Uint8Array([48,88,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,3,68,0])],[U,new Uint8Array([48,86,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,10,3,66,0])]]);function lt(e){return Uint8Array.from(ut.keyFromPublic(e,"bytes").getPublic(!1,"array"))}async function dt({id:e,controller:r,secretKeyMultibase:n,publicKeyMultibase:i,keyAgreement:o=!1}){if(!i)throw new TypeError('The "publicKeyMultibase" property is required.');const s={id:e,controller:r};if(!i||"string"!=typeof i||i[0]!==g)throw new TypeError('"publicKeyMultibase" must be a multibase, base58-encoded string.');const c=t(i.slice(1)),u={name:o?"ECDH":h,namedCurve:P({publicMultikey:c})},a=function({publicMultikey:e}){const t=P({publicMultikey:e});let r=e.subarray(2);t===U&&(r=lt(r));return function({curve:e,publicKey:t}){const r=ft.get(e),n=new Uint8Array(r.length+t.length);let i=0;return n.set(r,i),i+=r.length,n.set(t,i),n}
20
- /*!
21
- * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
22
- */({curve:t,publicKey:r})}({publicMultikey:c}),f=o?[]:["verify"];if(u.namedCurve===U){const{Crypto:e}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js"),t=new e;s.publicKey=await t.subtle.importKey("spki",a,u,p,f)}else s.publicKey=await j.subtle.importKey("spki",a,u,p,f);if(n){if("string"!=typeof n||n[0]!==g)throw new TypeError('"secretKeyMultibase" must be a multibase, base58-encoded string.');const e=t(n.slice(1));!function({secretMultikey:e,publicMultikey:t}){const r=P({publicMultikey:t}),n=T({secretMultikey:e});if(r!==n)throw new Error(`Public key curve ('${r}') does not match secret key curve ('${n}').`)}({secretMultikey:e,publicMultikey:c});const r=function({secretMultikey:e,publicMultikey:t}){const r=T({secretMultikey:e}),n=e.subarray(2),i=t.subarray(2);return function({curve:e,secretKey:t,publicKey:r}){const n=at.get(e);if(!n)throw new Error(`Unsupported curve "${e}".`);e===U&&(r=lt(r));const i=new Uint8Array(n.secret.length+t.length+n.public.length+r.length);let o=0;return i.set(n.secret,o),o+=n.secret.length,i.set(t,o),o+=t.length,i.set(n.public,o),o+=n.public.length,i.set(r,o),i}({curve:r,secretKey:n,publicKey:i})}({secretMultikey:e,publicMultikey:c}),i=o?["deriveBits"]:["sign"];if(u.namedCurve===U){const{Crypto:e}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js"),t=new e;s.secretKey=await t.subtle.importKey("pkcs8",r,u,p,i)}else s.secretKey=await j.subtle.importKey("pkcs8",r,u,p,i)}return s}function yt({jwk:t}={}){if("EC"!==t?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:r}=t,n=F({curve:r}),i=e(t.x),o=e(t.y),s=new Uint8Array(n+1),c=o[o.length-1]%2==0;return s[0]=c?2:3,s.set(i,s.length-i.length),s}function ht({jwk:t}={}){if("EC"!==t?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:n}=t,i=F({curve:n}),o=e(t.x),s=e(t.y),c=new Uint8Array(2+(i+1));!function({curve:e,buffer:t}){if(e===R)t[0]=E[0],t[1]=E[1];else if(e===A)t[0]=v[0],t[1]=v[1];else if(e===S)t[0]=B[0],t[1]=B[1];else{if(e!==U)throw new TypeError(`Unsupported curve "${e}".`);t[0]=m[0],t[1]=m[1]}}({curve:n,buffer:c});const u=s[s.length-1]%2==0;c[2]=u?2:3,c.set(o,c.length-o.length);return g+r(c)}function pt({jwk:t}={}){if("EC"!==t?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:n}=t,i=F({curve:n}),o=e(t.d),s=new Uint8Array(2+i);!function({curve:e,buffer:t}){if(e===R)t[0]=x[0],t[1]=x[1];else if(e===A)t[0]=K[0],t[1]=K[1];else if(e===S)t[0]=O[0],t[1]=O[1];else{if(e!==U)throw new TypeError(`Unsupported curve "${e}".`);t[0]=k[0],t[1]=k[1]}}({curve:t.crv,buffer:s}),s.set(o,s.length-o.length);return g+r(s)}const wt=new Set(["EcdsaSecp256r1VerificationKey2019","EcdsaSecp384r1VerificationKey2019","EcdsaSecp521r1VerificationKey2019","EcdsaSecp256k1VerificationKey2019"]);async function bt({keyPair:e}){if(!wt.has(e.type))throw new TypeError(`Unsupported key type "${e.type}".`);if(e["@context"]||(e["@context"]=w),!function({document:e,contextUrl:t}){const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)}
23
- /*!
24
- * Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
25
- */({document:e,contextUrl:w}))throw new TypeError(`Context not supported "${e["@context"]}".`);return{"@context":b,id:e.id,type:"Multikey",controller:e.controller,publicKeyMultibase:e.publicKeyMultibase,secretKeyMultibase:e.secretKeyMultibase}}async function gt(e,t={}){"boolean"==typeof t&&(t={keyAgreement:t});const{keyAgreement:r}=t;let n={...e};if("Multikey"!==n.type){if(n.publicKeyJwk)return async function({jwk:e,secretKey:t=!1}={}){const r={"@context":b,type:"Multikey",publicKeyMultibase:ht({jwk:e})};t&&e.d&&(r.secretKeyMultibase=pt({jwk:e}));const n=!e.key_ops||e.key_ops.includes("deriveBits");return gt(r,n)}({jwk:n.publicKeyJwk,secretKey:!1});if(n.type)return n=await bt({keyPair:n}),Et({keyPair:n,keyAgreement:r})}return n.type||(n.type="Multikey"),n["@context"]||(n["@context"]=b),n.controller&&!n.id&&(n.id=`${e.controller}#${e.publicKeyMultibase}`),function(e){if(!e||"object"!=typeof e)throw new TypeError('"key" must be an object.');if("Multikey"!==e.type)throw new TypeError('"key" must be a Multikey with type "Multikey".');if(!(e["@context"]===b||Array.isArray(e["@context"])&&e["@context"].includes(b)))throw new TypeError(`"key" must be a Multikey with context "${b}".`)}(n),Et({keyPair:n,keyAgreement:r})}async function mt({keyPair:e,secretKey:t=!1}={}){e?.publicKey instanceof C||(e=await dt(e));const r=t&&!!e.secretKey?e.secretKey:e.publicKey;let n;if(e.publicKey.algorithm.namedCurve===U){const{Crypto:e}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js"),t=new e;n=await t.subtle.exportKey("jwk",r)}else n=await j.subtle.exportKey("jwk",r);return n}async function Et({keyPair:t,keyAgreement:r=!1}){t?.publicKey instanceof C||t.publicKey?.algorithm.namedCurve===U||(t=await dt(t));const n=async({publicKey:r=!0,secretKey:n=!1,includeContext:i=!0,raw:o=!1}={})=>{if(o){const i=await mt({keyPair:t,secretKey:n}),o={};return r&&(o.publicKey=yt({jwk:i})),n&&(o.secretKey=function({jwk:t}={}){if("EC"!==t?.kty)throw new TypeError('"jwk.kty" must be "EC".');const{crv:r}=t,n=F({curve:r}),i=e(t.d),o=new Uint8Array(n);return o.set(i,o.length-i.length),o}({jwk:i})),o}return async function({keyPair:e,secretKey:t,publicKey:r,includeContext:n}={}){if(!r&&!t)throw new TypeError('Export requires specifying either "publicKey" or "secretKey".');const i=t&&!!e.secretKey,o=i?e.secretKey:e.publicKey;let s;if(o.algorithm.namedCurve===U){const{Crypto:e}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js"),t=new e;s=await t.subtle.exportKey("jwk",o)}else s=await j.subtle.exportKey("jwk",o);const c={};return n&&(c["@context"]=b),c.id=e.id,c.type="Multikey",c.controller=e.controller,r&&(c.publicKeyMultibase=ht({jwk:s})),i&&(c.secretKeyMultibase=pt({jwk:s})),c}({keyPair:t,publicKey:r,secretKey:n,includeContext:i})},{publicKeyMultibase:i,secretKeyMultibase:o}=await n({publicKey:!0,secretKey:!0,includeContext:!0});return t={...t,publicKeyMultibase:i,secretKeyMultibase:o,keyAgreement:r,export:n,signer(){const{id:e,secretKey:r}=t;
26
- /*!
27
- * Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
28
- */
29
- return function({id:e,secretKey:t}){if(!t)throw new Error('"secretKey" is required for signing.');const{namedCurve:r}=t.algorithm,n={name:h,hash:{name:N({curve:r})}};return{algorithm:r,id:e,async sign({data:e}={}){if(r===U){const{Crypto:r}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js"),i=new r;return new Uint8Array(await i.subtle.sign(n,t,e))}return new Uint8Array(await j.subtle.sign(n,t,e))}}}({id:e,secretKey:r})},verifier(){const{id:e,publicKey:r}=t;return function({id:e,publicKey:t}){if(!t)throw new Error('"publicKey" is required for verifying.');const{namedCurve:r}=t.algorithm,n={name:h,hash:{name:N({curve:r})}};return{algorithm:r,id:e,async verify({data:e,signature:i}={}){if(r===U){const{Crypto:r}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js");return(new r).subtle.verify(n,t,i,e)}return j.subtle.verify(n,t,i,e)}}}({id:e,publicKey:r})},async deriveSecret({publicKey:e,remotePublicKey:r}={}){if(r&&e)throw new Error('Only one of "remotePublicKey" and "publicKey" must be given.');if(!t.keyAgreement){const e=Error('"keyAgreement" is not supported by this keypair.');throw e.name="NotSupportedError",e}return async function({localKeyPair:e,remoteKeyPair:t}){if(!e.secretKey){const e=Error('"secretKey" required to derive secret.');throw e.name="NotSupportedError",e}e=await dt({...e,keyAgreement:!0}),t=await dt({...t,keyAgreement:!0});const{namedCurve:r}=e.secretKey.algorithm,n=F({curve:r});if(r===U){const{Crypto:i}=await import("./webcrypto.es-BOyMRPOj-CAxP3jJR.js"),o=new i,s=await o.subtle.deriveBits({name:"ECDH",namedCurve:r,public:t.publicKey},e.secretKey,8*n);return new Uint8Array(s,0,n)}const i=await j.subtle.deriveBits({name:"ECDH",namedCurve:r,public:t.publicKey},e.secretKey,8*n);return new Uint8Array(i,0,n)}({localKeyPair:this,remoteKeyPair:r||e})}}}export{yt as a,gt as f,mt as t};
@@ -1,56 +0,0 @@
1
- import{h as e,y as t,B as r}from"./main.js";import{a as o,r as n}from"./Suite-Bu3gszvt-Dmvbh142.js";var i,a,s,c,p,u,d,f,l,h,y,m,w,g,v,T,E,x,b,S,L,_,C,M,O,R,U,D,K,N,P,A,V,I,j,k,X=(function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){
2
- /*!
3
- * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
4
- */
5
- const o=r(1),n=r(2),i=r(3),{CONTEXT_URL:a,SECURITY_CONTEXT_V1_URL:s,SECURITY_CONTEXT_V2_URL:c}=i,p=new Map;p.set(s,o),p.set(c,n),e.exports={constants:i,contexts:p,SECURITY_CONTEXT_V1_URL:s,SECURITY_CONTEXT_V2_URL:c,CONTEXT_URL:a,CONTEXT:n}},function(e,t,r){
6
- /*!
7
- * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
8
- */
9
- e.exports={"@context":{id:"@id",type:"@type",dc:"http://purl.org/dc/terms/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",EcdsaKoblitzSignature2016:"sec:EcdsaKoblitzSignature2016",Ed25519Signature2018:"sec:Ed25519Signature2018",EncryptedMessage:"sec:EncryptedMessage",GraphSignature2012:"sec:GraphSignature2012",LinkedDataSignature2015:"sec:LinkedDataSignature2015",LinkedDataSignature2016:"sec:LinkedDataSignature2016",CryptographicKey:"sec:Key",authenticationTag:"sec:authenticationTag",canonicalizationAlgorithm:"sec:canonicalizationAlgorithm",cipherAlgorithm:"sec:cipherAlgorithm",cipherData:"sec:cipherData",cipherKey:"sec:cipherKey",created:{"@id":"dc:created","@type":"xsd:dateTime"},creator:{"@id":"dc:creator","@type":"@id"},digestAlgorithm:"sec:digestAlgorithm",digestValue:"sec:digestValue",domain:"sec:domain",encryptionKey:"sec:encryptionKey",expiration:{"@id":"sec:expiration","@type":"xsd:dateTime"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},initializationVector:"sec:initializationVector",iterationCount:"sec:iterationCount",nonce:"sec:nonce",normalizationAlgorithm:"sec:normalizationAlgorithm",owner:{"@id":"sec:owner","@type":"@id"},password:"sec:password",privateKey:{"@id":"sec:privateKey","@type":"@id"},privateKeyPem:"sec:privateKeyPem",publicKey:{"@id":"sec:publicKey","@type":"@id"},publicKeyBase58:"sec:publicKeyBase58",publicKeyPem:"sec:publicKeyPem",publicKeyWif:"sec:publicKeyWif",publicKeyService:{"@id":"sec:publicKeyService","@type":"@id"},revoked:{"@id":"sec:revoked","@type":"xsd:dateTime"},salt:"sec:salt",signature:"sec:signature",signatureAlgorithm:"sec:signingAlgorithm",signatureValue:"sec:signatureValue"}}},function(e,t,r){
10
- /*!
11
- * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
12
- */
13
- e.exports={"@context":[{"@version":1.1},"https://w3id.org/security/v1",{AesKeyWrappingKey2019:"sec:AesKeyWrappingKey2019",DeleteKeyOperation:"sec:DeleteKeyOperation",DeriveSecretOperation:"sec:DeriveSecretOperation",EcdsaSecp256k1Signature2019:"sec:EcdsaSecp256k1Signature2019",EcdsaSecp256r1Signature2019:"sec:EcdsaSecp256r1Signature2019",EcdsaSecp256k1VerificationKey2019:"sec:EcdsaSecp256k1VerificationKey2019",EcdsaSecp256r1VerificationKey2019:"sec:EcdsaSecp256r1VerificationKey2019",Ed25519Signature2018:"sec:Ed25519Signature2018",Ed25519VerificationKey2018:"sec:Ed25519VerificationKey2018",EquihashProof2018:"sec:EquihashProof2018",ExportKeyOperation:"sec:ExportKeyOperation",GenerateKeyOperation:"sec:GenerateKeyOperation",KmsOperation:"sec:KmsOperation",RevokeKeyOperation:"sec:RevokeKeyOperation",RsaSignature2018:"sec:RsaSignature2018",RsaVerificationKey2018:"sec:RsaVerificationKey2018",Sha256HmacKey2019:"sec:Sha256HmacKey2019",SignOperation:"sec:SignOperation",UnwrapKeyOperation:"sec:UnwrapKeyOperation",VerifyOperation:"sec:VerifyOperation",WrapKeyOperation:"sec:WrapKeyOperation",X25519KeyAgreementKey2019:"sec:X25519KeyAgreementKey2019",allowedAction:"sec:allowedAction",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"},capability:{"@id":"sec:capability","@type":"@id"},capabilityAction:"sec:capabilityAction",capabilityChain:{"@id":"sec:capabilityChain","@type":"@id","@container":"@list"},capabilityDelegation:{"@id":"sec:capabilityDelegationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"sec:capabilityInvocationMethod","@type":"@id","@container":"@set"},caveat:{"@id":"sec:caveat","@type":"@id","@container":"@set"},challenge:"sec:challenge",ciphertext:"sec:ciphertext",controller:{"@id":"sec:controller","@type":"@id"},delegator:{"@id":"sec:delegator","@type":"@id"},equihashParameterK:{"@id":"sec:equihashParameterK","@type":"xsd:integer"},equihashParameterN:{"@id":"sec:equihashParameterN","@type":"xsd:integer"},invocationTarget:{"@id":"sec:invocationTarget","@type":"@id"},invoker:{"@id":"sec:invoker","@type":"@id"},jws:"sec:jws",keyAgreement:{"@id":"sec:keyAgreementMethod","@type":"@id","@container":"@set"},kmsModule:{"@id":"sec:kmsModule"},parentCapability:{"@id":"sec:parentCapability","@type":"@id"},plaintext:"sec:plaintext",proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},proofValue:"sec:proofValue",referenceId:"sec:referenceId",unwrappedKey:"sec:unwrappedKey",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},verifyData:"sec:verifyData",wrappedKey:"sec:wrappedKey"}]}},function(e,t,r){
14
- /*!
15
- * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
16
- */
17
- e.exports={SECURITY_CONTEXT_V1_URL:"https://w3id.org/security/v1",SECURITY_CONTEXT_V2_URL:"https://w3id.org/security/v2",CONTEXT_URL:"https://w3id.org/security/v2"}}]))}(i={exports:{}},i.exports),i.exports),z=(a=X)&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,Y=X.contexts,q=X.constants,$=X.CONTEXT,B=X.CONTEXT_URL,F=X.SECURITY_CONTEXT_V1_URL,J=X.SECURITY_CONTEXT_V2_URL,G=t(Object.freeze({__proto__:null,CONTEXT:$,CONTEXT_URL:B,SECURITY_CONTEXT_V1_URL:F,SECURITY_CONTEXT_V2_URL:J,constants:q,contexts:Y,default:z}));function W(){if(c)return s;c=1;const{constants:e}=G;return s={SECURITY_CONTEXT_URL:e.SECURITY_CONTEXT_V2_URL,SECURITY_CONTEXT_V1_URL:e.SECURITY_CONTEXT_V1_URL,SECURITY_CONTEXT_V2_URL:e.SECURITY_CONTEXT_V2_URL,SECURITY_PROOF_URL:"https://w3id.org/security#proof",SECURITY_SIGNATURE_URL:"https://w3id.org/security#signature"}}
18
- /*!
19
- * Copyright (c) 2017-2023 Digital Bazaar, Inc. All rights reserved.
20
- */function H(){if(u)return p;u=1;const e=W(),{contexts:t}=G;return p=new Map([[e.SECURITY_CONTEXT_V1_URL,t.get(e.SECURITY_CONTEXT_V1_URL)],[e.SECURITY_CONTEXT_V2_URL,t.get(e.SECURITY_CONTEXT_V2_URL)]])}
21
- /*!
22
- * Copyright (c) 2018-2021 Digital Bazaar, Inc. All rights reserved.
23
- */function Q(){if(f)return d;f=1;const e=H(),t={};return d=t,t.extendContextLoader=t=>async r=>{const o=e.get(r);return void 0!==o?{contextUrl:null,documentUrl:r,document:o,tag:"static"}:t(r)},t.strictDocumentLoader=t.extendContextLoader(e=>{throw new Error(`${e} not found.`)}),d}function Z(){if(h)return l;h=1;class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{return String(e)}}}const t=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],o=Symbol(".toJSON called"),n=({from:e,seen:i,to_:a,forceEnumerable:s,maxDepth:c,depth:p})=>{const u=a||(Array.isArray(e)?[]:{});if(i.push(e),p>=c)return u;if("function"==typeof e.toJSON&&!0!==e[o])return(e=>{e[o]=!0;const t=e.toJSON();return delete e[o],t})(e);for(const[t,o]of Object.entries(e))"function"==typeof r&&r.isBuffer(o)?u[t]="[object Buffer]":"function"!=typeof o&&(o&&"object"==typeof o?i.includes(e[t])?u[t]="[Circular]":(p++,u[t]=n({from:e[t],seen:i.slice(),forceEnumerable:s,maxDepth:c,depth:p})):u[t]=o);for(const{property:r,enumerable:o}of t)"string"==typeof e[r]&&Object.defineProperty(u,r,{value:e[r],enumerable:!!s||o,configurable:!0,writable:!0});return u};return l={serializeError:(e,t={})=>{const{maxDepth:r=Number.POSITIVE_INFINITY}=t;return"object"==typeof e&&null!==e?n({from:e,seen:[],forceEnumerable:!0,maxDepth:r,depth:0}):"function"==typeof e?`[Function: ${e.name||"anonymous"}]`:e},deserializeError:(t,r={})=>{const{maxDepth:o=Number.POSITIVE_INFINITY}=r;if(t instanceof Error)return t;if("object"==typeof t&&null!==t&&!Array.isArray(t)){const e=new Error;return n({from:t,seen:[],to_:e,maxDepth:o,depth:0}),e}return new e(t)}}}
24
- /*!
25
- * Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved.
26
- */function ee(){if(m)return y;m=1;const e=W(),t=o(),{extendContextLoader:r,strictDocumentLoader:n}=Q(),{serializeError:i}=Z();function a({document:r}){let o;o=t.getValues(r,"proof");const n=r["@context"]||e.SECURITY_CONTEXT_URL;return o=o.map(e=>{const{cryptosuite:t}=e;return t?.includes?.("-jcs-")?e:{"@context":n,...e}}),o}function s(e){Object.defineProperty(e,"toJSON",{value:function(){return i(this)},configurable:!0,writable:!0})}return y=class{async add(e,{suite:o,purpose:i,documentLoader:s}={}){if(!o)throw new TypeError('"options.suite" is required.');if(!i)throw new TypeError('"options.purpose" is required.');s=s?r(s):n;const c={...e};delete c.proof;const p=a({document:e}),u=await o.createProof({document:c,purpose:i,proofSet:p,documentLoader:s});return t.addValue(e,"proof",u),e}async derive(e,{suite:t,purpose:o,documentLoader:i}={}){if(!t)throw new TypeError('"options.suite" is required.');if(!o)throw new TypeError('"options.purpose" is required.');i=i?r(i):n;const s={...e};delete s.proof;const c=a({document:e});return await t.derive({document:s,purpose:o,proofSet:c,documentLoader:i})}async verify(e,{suite:t,purpose:o,documentLoader:i}={}){if(!t)throw new TypeError('"options.suite" is required.');if(!o)throw new TypeError('"options.purpose" is required.');const c=Array.isArray(t)?t:[t];if(0===c.length)throw new TypeError("At least one suite is required.");i=i?r(i):n;try{const t=a({document:e={...e}});if(0===t.length)throw new Error("No matching proofs found in the given document.");delete e.proof;const r=await async function({document:e,suites:t,proofSet:r,purpose:o,documentLoader:n}){const i=Array.isArray(o)?o:[o],a=new Map,c=new Map,p=new Map;if(await Promise.all(i.map(o=>async function({purposeToProofs:e,proofToSuite:t,purpose:r,proofSet:o,suites:n,suiteMatchQueue:i,document:a,documentLoader:s}){for(const c of o){if(!await r.match(c,{document:a,documentLoader:s}))continue;let o=!1;for(const e of n){let r=i.get(e);r||i.set(e,r=new Map);let n=r.get(c);if(n||(n=e.matchProof({proof:c,document:a,documentLoader:s}),r.set(c,n)),await n){o=!0,t.set(c,e);break}}if(o){const t=e.get(r);t?t.push(c):e.set(r,[c])}}}({purposeToProofs:a,proofToSuite:c,purpose:o,proofSet:r,suites:t,suiteMatchQueue:p,document:e,documentLoader:n}))),a.size<i.length)return[];const u=new Map;return await Promise.all([...c.entries()].map(async([t,o])=>{let i;try{let a;const s={validate:async(e,{verificationMethod:t})=>(a=t,{valid:!0})},{verified:c,verificationMethod:p,error:u}=await o.verifyProof({proof:t,document:e,purpose:s,proofSet:r,documentLoader:n});a||(a=p),i={proof:t,verified:c,verificationMethod:a,error:u}}catch(e){i={proof:t,verified:!1,error:e}}i.error&&s(i.error),u.set(t,i)})),await Promise.all([...a.entries()].map(async([t,r])=>{for(const o of r){const r=u.get(o);if(!r.verified)continue;const{verificationMethod:i}=r,a=c.get(o);let p;try{p=await t.validate(o,{document:e,suite:a,verificationMethod:i,documentLoader:n})}catch(e){p={valid:!1,error:e}}r.purposeResult?Array.isArray(r.purposeResult)?r.purposeResult.push(p):r.purposeResult=[r.purposeResult,p]:r.purposeResult=p,p.valid||(s(p.error),r.error||(r.verified=!1,r.error=p.error))}})),[...u.values()]}({document:e,suites:c,proofSet:t,purpose:o,documentLoader:i});if(0===r.length){const e=new Error("Did not verify any proofs; insufficient proofs matched the acceptable suite(s) and required purpose(s).");throw e.name="NotFoundError",e}const n=r.some(e=>e.verified);if(!n){const e=[].concat(...r.filter(e=>e.error).map(e=>e.error)),t={verified:n,results:r};return e.length>0&&(t.error=e),t}return{verified:n,results:r}}catch(e){return s(e),{verified:!1,error:e}}}},y}
27
- /*!
28
- * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
29
- */function te(){return T?v:(T=1,v=class{constructor({type:e}={}){if("string"!=typeof e)throw new TypeError('A LinkedDataProof must have a "type".');this.type=e}async createProof({}){throw new Error('"createProof" must be implemented in a derived class.')}async derive({}){throw new Error('"deriveProof" must be implemented in a derived class.')}async verifyProof({}){throw new Error('"verifyProof" must be implemented in a derived class.')}async matchProof({proof:e}){return e.type===this.type}})}function re(){if(x)return E;x=1;const e={};return E=e,e.w3cDate=e=>{null==e?e=new Date:"number"!=typeof e&&"string"!=typeof e||(e=new Date(e));const t=e.toISOString();return t.substr(0,t.length-5)+"Z"},e.concat=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},E}function oe(){if(_)return L;_=1;const e=W(),t=o(),r=n(),i=re(),{sha256digest:a}=function(){if(S)return b;S=1;const e=self&&(self.crypto||self.msCrypto);return b={async sha256digest({string:t}){const r=(new TextEncoder).encode(t);return new Uint8Array(await e.subtle.digest("SHA-256",r))}}}
30
- /*!
31
- * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved.
32
- */(),s=te();return L=class extends s{constructor({type:e,proof:t,LDKeyClass:r,date:o,key:n,signer:i,verifier:a,useNativeCanonize:s,canonizeOptions:c,contextUrl:p}={}){super({type:e}),this.LDKeyClass=r,this.contextUrl=p,this.proof=t;const u=function({key:e,signer:t,verifier:r}){const o={};if(e){if(o.key=e,o.verificationMethod=e.id,"function"==typeof e.signer&&(o.signer=e.signer()),"function"==typeof e.verifier&&(o.verifier=e.verifier()),!o.signer&&!o.verifier)throw new TypeError('The "key" parameter must contain a "signer" or "verifier" method.')}else o.verificationMethod=t&&t.id||r&&r.id,o.signer=t,o.verifier=r;if(o.signer&&"function"!=typeof o.signer.sign)throw new TypeError("A signer API has not been specified.");if(o.verifier&&"function"!=typeof o.verifier.verify)throw new TypeError("A verifier API has not been specified.");return o}({key:n,signer:i,verifier:a});if(this.verificationMethod=u.verificationMethod,this.key=u.key,this.signer=u.signer,this.verifier=u.verifier,this.canonizeOptions=c,o&&(this.date=new Date(o),isNaN(this.date)))throw TypeError(`"date" "${o}" is not a valid date.`);this.useNativeCanonize=s,this._hashCache=null}async createProof({document:e,purpose:t,proofSet:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');let a;a=this.proof?{...this.proof}:{},a.type=this.type;let s=this.date;void 0===a.created&&void 0===s&&(s=new Date),s&&"string"!=typeof s&&(s=i.w3cDate(s)),s&&(a.created=s),a.verificationMethod=this.verificationMethod,a=await this.updateProof({document:e,proof:a,proofSet:r,purpose:t,documentLoader:o}),a=await t.update(a,{document:e,suite:this,documentLoader:o});const c=await this.createVerifyData({document:e,proof:a,proofSet:r,documentLoader:o});return a=await this.sign({verifyData:c,document:e,proof:a,documentLoader:o}),a}async updateProof({proof:e,expansionMap:t}){if(t)throw new Error('"expansionMap" not supported.');return e}async verifyProof({proof:e,document:t,proofSet:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');try{const i=await this.createVerifyData({document:t,proof:e,proofSet:r,documentLoader:o,expansionMap:n}),a=await this.getVerificationMethod({proof:e,document:t,documentLoader:o,expansionMap:n});if(!await this.verifySignature({verifyData:i,verificationMethod:a,document:t,proof:e,documentLoader:o,expansionMap:n}))throw new Error("Invalid signature.");return{verified:!0,verificationMethod:a}}catch(e){return{verified:!1,error:e}}}async canonize(e,{documentLoader:o,expansionMap:n,skipExpansion:i}){if(n)throw new Error('"expansionMap" not supported.');return async function(e,o){const n={rdfDirection:"i18n-datatype",...o,produceGeneralizedRdf:!1};delete n.format;const i=await t.toRDF(e,n);return r.canonize(i,o)}(e,{algorithm:"RDFC-1.0",base:null,format:"application/n-quads",documentLoader:o,safe:!0,skipExpansion:i,useNative:this.useNativeCanonize,...this.canonizeOptions})}async canonizeProof(t,{document:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');return delete(t={"@context":r["@context"]||e.SECURITY_CONTEXT_URL,...t}).jws,delete t.signatureValue,delete t.proofValue,this.canonize(t,{documentLoader:o,expansionMap:n,skipExpansion:!1,...this.canonizeOptions})}async createVerifyData({document:e,proof:t,documentLoader:r,expansionMap:o}){if(o)throw new Error('"expansionMap" not supported.');let n;const{_hashCache:s}=this;s&&s.document===e?n=s.hash:this._hashCache={document:e,hash:n=this.canonize(e,{documentLoader:r,expansionMap:o}).then(e=>a({string:e}))};const[c,p]=await Promise.all([this.canonizeProof(t,{document:e,documentLoader:r,expansionMap:o}).then(e=>a({string:e})),n]);return i.concat(c,p)}async derive(){throw new Error("Must be implemented by a derived class.")}async getVerificationMethod({proof:r,documentLoader:o}){let{verificationMethod:n}=r;if("object"==typeof n&&(n=n.id),!n)throw new Error('No "verificationMethod" found in proof.');const i=await t.frame(n,{"@context":e.SECURITY_CONTEXT_URL,"@embed":"@always",id:n},{documentLoader:o,compactToRelative:!1,safe:!0});if(!i)throw new Error(`Verification method ${n} not found.`);if(void 0!==i.revoked)throw new Error("The verification method has been revoked.");return i}async sign(){throw new Error("Must be implemented by a derived class.")}async verifySignature(){throw new Error("Must be implemented by a derived class.")}ensureSuiteContext({document:e,addSuiteContext:t}){const{contextUrl:r}=this;if(function({document:e,contextUrl:t}){const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)}({document:e,contextUrl:r}))return;if(!t)throw new TypeError(`The document to be signed must contain this suite's @context, "${r}".`);const o=e["@context"]||[];e["@context"]=Array.isArray(o)?[...o,r]:[o,r]}},L}
33
- /*!
34
- * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
35
- */function ne(){return R?O:(R=1,O=class{constructor({term:e,date:t,maxTimestampDelta:r=1/0}={}){if(void 0===e)throw new Error('"term" is required.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxTimestampDelta" must be a number.');if(this.term=e,void 0!==t&&(this.date=new Date(t),isNaN(this.date)))throw TypeError(`"date" "${t}" is not a valid date.`);this.maxTimestampDelta=r}async validate(e,{expansionMap:t}){if(t)throw new Error('"expansionMap" not supported.');try{if(this.maxTimestampDelta!==1/0){const t=(this.date||new Date).getTime(),r=1e3*this.maxTimestampDelta,o=new Date(e.created).getTime();if(!(o>=t-r&&o<=t+r))throw new Error("The proof's created timestamp is out of range.")}return{valid:!0}}catch(e){return{valid:!1,error:e}}}async update(e,{expansionMap:t}){if(t)throw new Error('"expansionMap" not supported.');return e.proofPurpose=this.term,e}async match(e,{expansionMap:t}){if(t)throw new Error('"expansionMap" not supported.');return e.proofPurpose===this.term}})}
36
- /*!
37
- * Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved.
38
- */function ie(){if(D)return U;D=1;const e=W(),t=o(),r=ne(),n="https://www.w3.org/ns/did/v1",i=["assertionMethod","authentication","capabilityInvocation","capabilityDelegation","keyAgreement","verificationMethod"];return U=class extends r{constructor({term:e,controller:t,date:r,maxTimestampDelta:o=1/0}={}){if(super({term:e,date:r,maxTimestampDelta:o}),void 0!==t){if("object"!=typeof t)throw new TypeError('"controller" must be an object.');this.controller=t}this._termDefinedByDIDContext=i.includes(e)}async validate(r,{verificationMethod:o,documentLoader:i,expansionMap:a}){try{const s=await super.validate(r,{verificationMethod:o,documentLoader:i,expansionMap:a});if(!s.valid)throw s.error;const{id:c}=o;if("string"!=typeof c)throw new Error(`Verification method ID "${o.id}" must be a string.`);const{term:p,_termDefinedByDIDContext:u}=this;if(this.controller)s.controller=this.controller;else{const{controller:r}=o;let a;if(r)if("object"==typeof r)a=r.id;else{if("string"!=typeof r)throw new TypeError('"controller" must be a string representing a URL.');a=r}let{document:d}=await i(a);!(u&&d["@context"]===n||Array.isArray(d["@context"])&&d["@context"][0]===n)&&(d=await t.frame(d,{"@context":e.SECURITY_CONTEXT_URL,id:a,[p]:{"@embed":"@never",id:c}},{documentLoader:i,compactToRelative:!1,safe:!0})),s.controller=d}const d=t.getValues(s.controller,p);if(s.valid=d.some(e=>e===c||"object"==typeof e&&e.id===c),!s.valid)throw new Error(`Verification method "${o.id}" not authorized by controller for proof purpose "${this.term}".`);return s}catch(e){return{valid:!1,error:e}}}},U}
39
- /*!
40
- * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
41
- */function ae(){if(N)return K;N=1;const e=ie();return K=class extends e{constructor({term:e="assertionMethod",controller:t,date:r,maxTimestampDelta:o=1/0}={}){super({term:e,controller:t,date:r,maxTimestampDelta:o})}}}
42
- /*!
43
- * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
44
- */function se(){if(A)return P;A=1;const e=ie();return P=class extends e{constructor({term:e="authentication",controller:t,challenge:r,date:o,domain:n,maxTimestampDelta:i=1/0}={}){if(super({term:e,controller:t,date:o,maxTimestampDelta:i}),"string"!=typeof r)throw new TypeError('"challenge" must be a string.');if(void 0!==n&&"string"!=typeof n)throw new TypeError('"domain" must be a string.');this.challenge=r,this.domain=n}async validate(e,{verificationMethod:t,documentLoader:r,expansionMap:o}){try{if(e.challenge!==this.challenge)throw new Error(`The challenge is not as expected; challenge="${e.challenge}", expected="${this.challenge}"`);if(void 0!==this.domain){const{domain:t}=e;if(!(t===this.domain||Array.isArray(t)&&t.includes(this.domain)))throw new Error(`The domain is not as expected; domain=${JSON.stringify(t)}, expected=${JSON.stringify(this.domain)}`)}return super.validate(e,{verificationMethod:t,documentLoader:r,expansionMap:o})}catch(e){return{valid:!1,error:e}}}async update(e,{document:t,suite:r,documentLoader:o,expansionMap:n}){return(e=await super.update(e,{document:t,suite:r,documentLoader:o,expansionMap:n})).challenge=this.challenge,void 0!==this.domain&&(e.domain=this.domain),e}},P}
45
- /*!
46
- * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
47
- */var ce=function(){if(k)return j;k=1;const e={};j=e;const t=W();Object.assign(e,t);const r=ee(),o=function(){if(g)return w;g=1;class e extends Error{constructor(e){super("Verification error(s)."),this.name="VerificationError",this.errors=[].concat(e)}}return w=e}
48
- /*!
49
- * Copyright (c) 2018-2023 Digital Bazaar, Inc. All rights reserved.
50
- */();return e.derive=async function(e,{suite:t,purpose:o,documentLoader:n,addSuiteContext:i=!0}={}){if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');t.ensureSuiteContext({document:e,addSuiteContext:i});try{return await(new r).derive(e,{suite:t,purpose:o,documentLoader:n})}catch(e){if(!n&&"jsonld.InvalidUrl"===e.name){const{details:{url:t}}=e,r=new Error(`A URL "${t}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "derive".`);throw r.cause=e,r}throw e}},e.sign=async function(e,{suite:t,purpose:o,documentLoader:n,expansionMap:i,addSuiteContext:a=!0}={}){if(i)throw new Error('"expansionMap" not supported.');if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');t.ensureSuiteContext({document:e,addSuiteContext:a});try{return await(new r).add(e,{suite:t,purpose:o,documentLoader:n})}catch(e){if(!n&&"jsonld.InvalidUrl"===e.name){const{details:{url:t}}=e,r=new Error(`A URL "${t}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "sign".`);throw r.cause=e,r}throw e}},e.verify=async function(e,{suite:t,purpose:n,documentLoader:i,expansionMap:a}={}){if(a)throw new Error('"expansionMap" not supported.');if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');const s=await(new r).verify(e,{suite:t,purpose:n,documentLoader:i}),{error:c}=s;if(c)if(i||"jsonld.InvalidUrl"!==c.name)s.error=new o(c);else{const{details:{url:e}}=c,t=new Error(`A URL "${e}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "verify".`);s.error=new o(t)}return s},e.suites=function(){if(M)return C;M=1;const e={};return C=e,e.suites={LinkedDataProof:te(),LinkedDataSignature:oe()},C}
51
- /*!
52
- * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
53
- */().suites,e.purposes=function(){if(I)return V;I=1;const e={};return V=e,e.purposes={AssertionProofPurpose:ae(),AuthenticationProofPurpose:se(),ControllerProofPurpose:ie(),ProofPurpose:ne()},V}
54
- /*!
55
- * Copyright (c) 2010-2023 Digital Bazaar, Inc. All rights reserved.
56
- */().purposes,Object.assign(e,Q()),j}(),pe=e(ce);export{pe as j};
@@ -1,2 +0,0 @@
1
- /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
2
- function t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=256,a=286,i=30,n=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),h=new Array(576);t(h);const d=new Array(60);t(d);const _=new Array(512);t(_);const f=new Array(256);t(f);const c=new Array(29);t(c);const u=new Array(i);function w(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let m,b,g;function p(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(u);const k=t=>t<256?_[t]:_[256+(t>>>7)],v=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},y=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,v(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=(t,e,a)=>{y(t,a[2*e],a[2*e+1])},z=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},A=(t,e,a)=>{const i=new Array(16);let s,r,o=0;for(s=1;s<=n;s++)o=o+a[s-1]<<1,i[s]=o;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=z(i[e]++,e))}},E=t=>{let e;for(e=0;e<a;e++)t.dyn_ltree[2*e]=0;for(e=0;e<i;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},R=t=>{t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[a]},U=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&Z(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!Z(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},S=(t,a,i)=>{let n,o,l,h,d=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+d++],n+=(255&t.pending_buf[t.sym_buf+d++])<<8,o=t.pending_buf[t.sym_buf+d++],0===n?x(t,o,a):(l=f[o],x(t,l+e+1,a),h=s[l],0!==h&&(o-=c[l],y(t,o,h)),n--,l=k(n),x(t,l,i),h=r[l],0!==h&&(n-=u[l],y(t,n,h)))}while(d<t.sym_next);x(t,256,a)},D=(t,e)=>{const a=e.dyn_tree,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.elems;let o,l,h,d=-1;for(t.heap_len=0,t.heap_max=573,o=0;o<r;o++)0!==a[2*o]?(t.heap[++t.heap_len]=d=o,t.depth[o]=0):a[2*o+1]=0;for(;t.heap_len<2;)h=t.heap[++t.heap_len]=d<2?++d:0,a[2*h]=1,t.depth[h]=0,t.opt_len--,s&&(t.static_len-=i[2*h+1]);for(e.max_code=d,o=t.heap_len>>1;o>=1;o--)U(t,a,o);h=r;do{o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,a,1),l=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=l,a[2*h]=a[2*o]+a[2*l],t.depth[h]=(t.depth[o]>=t.depth[l]?t.depth[o]:t.depth[l])+1,a[2*o+1]=a[2*l+1]=h,t.heap[1]=h++,U(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,s=e.stat_desc.static_tree,r=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,h=e.stat_desc.max_length;let d,_,f,c,u,w,m=0;for(c=0;c<=n;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=a[2*a[2*_+1]+1]+1,c>h&&(c=h,m++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=l&&(u=o[_-l]),w=a[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(s[2*_+1]+u)));if(0!==m){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,m-=2}while(m>0);for(c=h;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>i||(a[2*f+1]!==c&&(t.opt_len+=(c-a[2*f+1])*a[2*f],a[2*f+1]=c),_--)}})(t,e),A(a,d,t.bl_count)},T=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},F=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o<l&&n===r)){if(o<h)do{x(t,n,t.bl_tree)}while(0!==--o);else 0!==n?(n!==s&&(x(t,n,t.bl_tree),o--),x(t,16,t.bl_tree),y(t,o-3,2)):o<=10?(x(t,17,t.bl_tree),y(t,o-3,3)):(x(t,18,t.bl_tree),y(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let L=!1;const O=(t,e,a,i)=>{y(t,0+(i?1:0),3),R(t),v(t,a),v(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var B=(t,a,i,n)=>{let s,r,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let a,i=4093624447;for(a=0;a<=31;a++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*a])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(a=32;a<e;a++)if(0!==t.dyn_ltree[2*a])return 1;return 0})(t)),D(t,t.l_desc),D(t,t.d_desc),o=(t=>{let e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==a?O(t,a,i,n):4===t.strategy||r===s?(y(t,2+(n?1:0),3),S(t,h,d)):(y(t,4+(n?1:0),3),((t,e,a,i)=>{let n;for(y(t,e-257,5),y(t,a-1,5),y(t,i-4,4),n=0;n<i;n++)y(t,t.bl_tree[2*l[n]+1],3);F(t,t.dyn_ltree,e-1),F(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),S(t,t.dyn_ltree,t.dyn_dtree)),E(t),n&&R(t)},I={_tr_init:t=>{L||((()=>{let t,e,l,p,k;const v=new Array(16);for(l=0,p=0;p<28;p++)for(c[p]=l,t=0;t<1<<s[p];t++)f[l++]=p;for(f[l-1]=p,k=0,p=0;p<16;p++)for(u[p]=k,t=0;t<1<<r[p];t++)_[k++]=p;for(k>>=7;p<i;p++)for(u[p]=k<<7,t=0;t<1<<r[p]-7;t++)_[256+k++]=p;for(e=0;e<=n;e++)v[e]=0;for(t=0;t<=143;)h[2*t+1]=8,t++,v[8]++;for(;t<=255;)h[2*t+1]=9,t++,v[9]++;for(;t<=279;)h[2*t+1]=7,t++,v[7]++;for(;t<=287;)h[2*t+1]=8,t++,v[8]++;for(A(h,287,v),t=0;t<i;t++)d[2*t+1]=5,d[2*t]=z(t,5);m=new w(h,s,257,a,n),b=new w(d,r,0,i,n),g=new w(new Array(0),o,0,19,7)})(),L=!0),t.l_desc=new p(t.dyn_ltree,m),t.d_desc=new p(t.dyn_dtree,b),t.bl_desc=new p(t.bl_tree,g),t.bi_buf=0,t.bi_valid=0,E(t)},_tr_stored_block:O,_tr_flush_block:B,_tr_tally:(t,a,i)=>(t.pending_buf[t.sym_buf+t.sym_next++]=a,t.pending_buf[t.sym_buf+t.sym_next++]=a>>8,t.pending_buf[t.sym_buf+t.sym_next++]=i,0===a?t.dyn_ltree[2*i]++:(t.matches++,a--,t.dyn_ltree[2*(f[i]+e+1)]++,t.dyn_dtree[2*k(a)]++),t.sym_next===t.sym_end),_tr_align:t=>{y(t,2,3),x(t,256,h),(t=>{16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var N=(t,e,a,i)=>{let n=65535&t,s=t>>>16&65535,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16};const C=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var H=(t,e,a,i)=>{const n=C,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},M={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:K,_tr_stored_block:Y,_tr_flush_block:P,_tr_tally:G,_tr_align:W}=I,{Z_NO_FLUSH:X,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:ot,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:dt,Z_DEFLATED:_t}=j,ft=258,ct=262,ut=42,wt=113,mt=666,bt=(t,e)=>(t.msg=M[e],e),gt=t=>2*t-(t>4?9:0),pt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},kt=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let vt=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const yt=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},xt=(t,e)=>{P(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)},zt=(t,e)=>{t.pending_buf[t.pending++]=e},At=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Et=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=N(t.adler,e,n,a):2===t.state.wrap&&(t.adler=H(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},Rt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&s<f);if(i=ft-(f-s),s=f-ft,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!==--n);return r<=t.lookahead?r:t.lookahead},Zt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ct)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),kt(t),i+=e),0===t.strm.avail_in)break;if(a=Et(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=vt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ct&&0!==t.strm.avail_in)},Ut=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==Q||e===X||a!==i+t.strm.avail_in))break;r=e===Q&&a===i+t.strm.avail_in?1:0,Y(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,yt(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(Et(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==X&&e!==Q&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(Et(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===Q)&&e!==X&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===Q&&0===t.strm.avail_in&&a===i?1:0,Y(t,t.block_start,a,r),t.block_start+=a,yt(t.strm)),r?3:1)},St=(t,e)=>{let a,i;for(;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===X)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Rt(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(xt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(xt(t,!1),0===t.strm.avail_out)?1:2},Dt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===X)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ct&&(t.match_length=Rt(t,a),t.match_length<=5&&(t.strategy===st||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(xt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=G(t,0,t.window[t.strstart-1]),i&&xt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(xt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(xt(t,!1),0===t.strm.avail_out)?1:2};function Tt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Ft=[new Tt(0,0,0,0,Ut),new Tt(4,4,8,4,St),new Tt(4,5,16,8,St),new Tt(4,6,32,32,St),new Tt(4,4,16,16,Dt),new Tt(8,16,32,32,Dt),new Tt(8,16,128,128,Dt),new Tt(8,32,128,256,Dt),new Tt(32,128,258,1024,Dt),new Tt(32,258,258,4096,Dt)];function Lt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),pt(this.dyn_ltree),pt(this.dyn_dtree),pt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),pt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),pt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ut&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==wt&&e.status!==mt?1:0},Bt=t=>{if(Ot(t))return bt(t,et);t.total_in=t.total_out=0,t.data_type=dt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?ut:wt,t.adler=2===e.wrap?0:1,e.last_flush=-2,K(e),$},It=t=>{const e=Bt(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,pt(a.head),a.max_lazy_match=Ft[a.level].max_lazy,a.good_match=Ft[a.level].good_length,a.nice_match=Ft[a.level].nice_length,a.max_chain_length=Ft[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Nt=(t,e,a,i,n,s)=>{if(!t)return et;let r=1;if(e===nt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||s<0||s>lt||8===i&&1!==r)return bt(t,et);8===i&&(i=9);const o=new Lt;return t.state=o,o.strm=t,o.status=ut,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,It(t)};var Ct={deflateInit:(t,e)=>Nt(t,e,_t,15,8,ht),deflateInit2:Nt,deflateReset:It,deflateResetKeep:Bt,deflateSetHeader:(t,e)=>Ot(t)||2!==t.state.wrap?et:(t.state.gzhead=e,$),deflate:(t,e)=>{if(Ot(t)||e>V||e<0)return t?bt(t,et):et;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===mt&&e!==Q)return bt(t,0===t.avail_out?it:et);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(yt(t),0===t.avail_out)return a.last_flush=-1,$}else if(0===t.avail_in&&gt(e)<=gt(i)&&e!==Q)return bt(t,it);if(a.status===mt&&0!==t.avail_in)return bt(t,it);if(a.status===ut&&0===a.wrap&&(a.status=wt),a.status===ut){let e=_t+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=rt||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,At(a,e),0!==a.strstart&&(At(a,t.adler>>>16),At(a,65535&t.adler)),t.adler=1,a.status=wt,yt(t),0!==a.pending)return a.last_flush=-1,$}if(57===a.status)if(t.adler=0,zt(a,31),zt(a,139),zt(a,8),a.gzhead)zt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),zt(a,255&a.gzhead.time),zt(a,a.gzhead.time>>8&255),zt(a,a.gzhead.time>>16&255),zt(a,a.gzhead.time>>24&255),zt(a,9===a.level?2:a.strategy>=rt||a.level<2?4:0),zt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(zt(a,255&a.gzhead.extra.length),zt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=H(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(zt(a,0),zt(a,0),zt(a,0),zt(a,0),zt(a,0),zt(a,9===a.level?2:a.strategy>=rt||a.level<2?4:0),zt(a,3),a.status=wt,yt(t),0!==a.pending)return a.last_flush=-1,$;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=H(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,yt(t),0!==a.pending)return a.last_flush=-1,$;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=H(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=H(t.adler,a.pending_buf,a.pending-i,i)),yt(t),0!==a.pending)return a.last_flush=-1,$;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,zt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=H(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=H(t.adler,a.pending_buf,a.pending-i,i)),yt(t),0!==a.pending)return a.last_flush=-1,$;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,zt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=H(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(yt(t),0!==a.pending))return a.last_flush=-1,$;zt(a,255&t.adler),zt(a,t.adler>>8&255),t.adler=0}if(a.status=wt,yt(t),0!==a.pending)return a.last_flush=-1,$}if(0!==t.avail_in||0!==a.lookahead||e!==X&&a.status!==mt){let i=0===a.level?Ut(a,e):a.strategy===rt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Zt(t),0===t.lookahead)){if(e===X)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(xt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(xt(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===ot?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=ft){if(Zt(t),t.lookahead<=ft&&e===X)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+ft;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);t.match_length=ft-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(xt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(xt(t,!1),0===t.strm.avail_out)?1:2})(a,e):Ft[a.level].func(a,e);if(3!==i&&4!==i||(a.status=mt),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),$;if(2===i&&(e===q?W(a):e!==V&&(Y(a,0,0,!1),e===J&&(pt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),yt(t),0===t.avail_out))return a.last_flush=-1,$}return e!==Q?$:a.wrap<=0?tt:(2===a.wrap?(zt(a,255&t.adler),zt(a,t.adler>>8&255),zt(a,t.adler>>16&255),zt(a,t.adler>>24&255),zt(a,255&t.total_in),zt(a,t.total_in>>8&255),zt(a,t.total_in>>16&255),zt(a,t.total_in>>24&255)):(At(a,t.adler>>>16),At(a,65535&t.adler)),yt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?$:tt)},deflateEnd:t=>{if(Ot(t))return et;const e=t.state.status;return t.state=null,e===wt?bt(t,at):$},deflateSetDictionary:(t,e)=>{let a=e.length;if(Ot(t))return et;const i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==ut||i.lookahead)return et;if(1===n&&(t.adler=N(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(pt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Zt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=vt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Zt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};const Ht=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Mt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Ht(a,e)&&(t[e]=a[e])}}return t},jt=t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a};let Kt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Kt=!1}const Yt=new Uint8Array(256);for(let t=0;t<256;t++)Yt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Yt[254]=Yt[254]=1;var Pt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Gt=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Yt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Kt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},Wt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Yt[t[a]]>e?a:e};var Xt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const qt=Object.prototype.toString,{Z_NO_FLUSH:Jt,Z_SYNC_FLUSH:Qt,Z_FULL_FLUSH:Vt,Z_FINISH:$t,Z_OK:te,Z_STREAM_END:ee,Z_DEFAULT_COMPRESSION:ae,Z_DEFAULT_STRATEGY:ie,Z_DEFLATED:ne}=j;function se(t){this.options=Mt({level:ae,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ie},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xt,this.strm.avail_out=0;let a=Ct.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==te)throw new Error(M[a]);if(e.header&&Ct.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Pt(e.dictionary):"[object ArrayBuffer]"===qt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Ct.deflateSetDictionary(this.strm,t),a!==te)throw new Error(M[a]);this._dict_set=!0}}se.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?$t:Jt,"string"==typeof t?a.input=Pt(t):"[object ArrayBuffer]"===qt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Qt||s===Vt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Ct.deflate(a,s),n===ee)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Ct.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===te;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},se.prototype.onData=function(t){this.chunks.push(t)},se.prototype.onEnd=function(t){t===te&&(this.result=jt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var re={gzip:function(t,e){return(e=e||{}).gzip=!0,function(t,e){const a=new se(e);if(a.push(t,!0),a.err)throw a.msg||M[a.err];return a.result}(t,e)}};const oe=16209;var le=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(64&p){if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=oe;break t}g=u[(65535&g)+(f&(1<<p)-1)];continue e}for(k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,16&p){if(v=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),v+=f&(1<<p)-1,v>o){t.msg="invalid distance too far back",E.mode=oe;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=oe;break t}if(y=0,x=_,0===d){if(y+=l-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}else if(d<p){if(y+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[y++]}while(--p);if(y=0,d<k){p=d,k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}}else if(y+=d-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}for(;k>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}if(64&p){t.msg="invalid distance code",E.mode=oe;break t}g=w[(65535&g)+(f&(1<<p)-1)]}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const he=15,de=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),_e=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),fe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ce=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ue=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=he;w++)E[w]=0;for(m=0;m<i;m++)E[e[a+m]]++;for(p=l,g=he;g>=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b<g&&0===E[b];b++);for(p<b&&(p=b),y=1,w=1;w<=he;w++)if(y<<=1,y-=E[w],y<0)return-1;if(y>0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<he;w++)R[w+1]=R[w]+E[w];for(m=0;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=de,D=_e,u=257):(A=fe,D=ce,u=0),z=0,m=0,w=b,c=s,k=p,v=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-v,d=1<<k,b=d;do{d-=h,n[c+(z>>v)+d]=Z<<24|U<<16|S}while(0!==d);for(h=1<<w-1;z&h;)h>>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0===--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<<k;k+v<g&&(y-=E[k+v],!(y<=0));)k++,y<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s}}return 0!==z&&(n[c+z]=w-v<<24|64<<16),o.bits=p,0};const{Z_FINISH:we,Z_BLOCK:me,Z_TREES:be,Z_OK:ge,Z_STREAM_END:pe,Z_NEED_DICT:ke,Z_STREAM_ERROR:ve,Z_DATA_ERROR:ye,Z_MEM_ERROR:xe,Z_BUF_ERROR:ze,Z_DEFLATED:Ae}=j,Ee=16180,Re=16190,Ze=16191,Ue=16192,Se=16194,De=16199,Te=16200,Fe=16206,Le=16209,Oe=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Be(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ie=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Ee||e.mode>16211?1:0},Ne=t=>{if(Ie(t))return ve;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ee,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ge},Ce=t=>{if(Ie(t))return ve;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ne(t)},He=(t,e)=>{let a;if(Ie(t))return ve;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ve:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Ce(t))},Me=(t,e)=>{if(!t)return ve;const a=new Be;t.state=a,a.strm=t,a.window=null,a.mode=Ee;const i=He(t,e);return i!==ge&&(t.state=null),i};let je,Ke,Ye=!0;const Pe=t=>{if(Ye){je=new Int32Array(512),Ke=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ue(1,t.lens,0,288,je,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ue(2,t.lens,0,32,Ke,0,t.work,{bits:5}),Ye=!1}t.lencode=je,t.lenbits=9,t.distcode=Ke,t.distbits=5},Ge=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var We={inflateReset:Ce,inflateReset2:He,inflateResetKeep:Ne,inflateInit:t=>Me(t,15),inflateInit2:Me,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ie(t)||!t.output||!t.input&&0!==t.avail_in)return ve;a=t.state,a.mode===Ze&&(a.mode=Ue),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=ge;t:for(;;)switch(a.mode){case Ee:if(0===a.wrap){a.mode=Ue;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=H(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Le;break}if((15&h)!==Ae){t.msg="unknown compression method",a.mode=Le;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Le;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:Ze,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==Ae){t.msg="unknown compression method",a.mode=Le;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Le;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=H(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=H(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=H(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=H(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=H(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Le;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=Ze;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=Oe(h),h=0,d=0,a.mode=Re;case Re:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,ke;t.adler=a.check=1,a.mode=Ze;case Ze:if(e===me||e===be)break t;case Ue:if(a.last){h>>>=7&d,d-=7&d,a.mode=Fe;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Pe(a),a.mode=De,e===be){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Le}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Le;break}if(a.length=65535&h,h=0,d=0,a.mode=Se,e===be)break t;case Se:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=Ze;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Le;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ue(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=Le;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Le;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Le;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===Le)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Le;break}if(a.lenbits=9,E={bits:a.lenbits},x=ue(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=Le;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ue(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=Le;break}if(a.mode=De,e===be)break t;case De:a.mode=Te;case Te:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,le(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===Ze&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&!(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=Ze;break}if(64&b){t.msg="invalid literal/length code",a.mode=Le;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(!(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Le;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Le;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Le;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=Te);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=Te;break;case Fe:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,n,f,r-f):N(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:Oe(h))!==a.check){t.msg="incorrect data check",a.mode=Le;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Le;break}h=0,d=0}a.mode=16208;case 16208:x=pe;break t;case Le:x=ye;break t;case 16210:return xe;default:return ve}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Le&&(a.mode<Fe||e!==we))&&Ge(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,n,f,t.next_out-f):N(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===Ze?128:0)+(a.mode===De||a.mode===Se?256:0),(0===_&&0===f||e===we)&&x===ge&&(x=ze),x},inflateEnd:t=>{if(Ie(t))return ve;let e=t.state;return e.window&&(e.window=null),t.state=null,ge},inflateGetHeader:(t,e)=>{if(Ie(t))return ve;const a=t.state;return 2&a.wrap?(a.head=e,e.done=!1,ge):ve},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return Ie(t)?ve:(i=t.state,0!==i.wrap&&i.mode!==Re?ve:i.mode===Re&&(n=1,n=N(n,e,a,0),n!==i.check)?ye:(s=Ge(t,e,a,a),s?(i.mode=16210,xe):(i.havedict=1,ge)))},inflateInfo:"pako inflate (from Nodeca project)"};var Xe=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const qe=Object.prototype.toString,{Z_NO_FLUSH:Je,Z_FINISH:Qe,Z_OK:Ve,Z_STREAM_END:$e,Z_NEED_DICT:ta,Z_STREAM_ERROR:ea,Z_DATA_ERROR:aa,Z_MEM_ERROR:ia}=j;function na(t){this.options=Mt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xt,this.strm.avail_out=0;let a=We.inflateInit2(this.strm,e.windowBits);if(a!==Ve)throw new Error(M[a]);if(this.header=new Xe,We.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Pt(e.dictionary):"[object ArrayBuffer]"===qe.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=We.inflateSetDictionary(this.strm,e.dictionary),a!==Ve)))throw new Error(M[a])}na.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Qe:Je,"[object ArrayBuffer]"===qe.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=We.inflate(a,r),s===ta&&n&&(s=We.inflateSetDictionary(a,n),s===Ve?s=We.inflate(a,r):s===aa&&(s=ta));a.avail_in>0&&s===$e&&a.state.wrap>0&&0!==t[a.next_in];)We.inflateReset(a),s=We.inflate(a,r);switch(s){case ea:case aa:case ta:case ia:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===$e))if("string"===this.options.to){let t=Wt(a.output,a.next_out),e=a.next_out-t,n=Gt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Ve||0!==o){if(s===$e)return s=We.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},na.prototype.onData=function(t){this.chunks.push(t)},na.prototype.onEnd=function(t){t===Ve&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=jt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var sa={ungzip:function(t,e){const a=new na(e);if(a.push(t),a.err)throw a.msg||M[a.err];return a.result}};const{gzip:ra}=re,{ungzip:oa}=sa;var la=ra,ha=oa;export{la as g,ha as u};
@@ -1,2 +0,0 @@
1
- /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
2
- const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return e.apply(t,o)}),s||(s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const u=D(Array.prototype.forEach),m=D(Array.prototype.lastIndexOf),p=D(Array.prototype.pop),f=D(Array.prototype.push),d=D(Array.prototype.splice),h=D(String.prototype.toLowerCase),g=D(String.prototype.toString),T=D(String.prototype.match),y=D(String.prototype.replace),E=D(String.prototype.indexOf),A=D(String.prototype.trim),_=D(Object.prototype.hasOwnProperty),b=D(RegExp.prototype.test),S=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function D(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function R(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function w(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function C(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=w(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=C(r):n[o]=r)}return n}function O(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return D(n.get);if("function"==typeof n.value)return D(n.value)}e=o(e)}return function(){return null}}const v=i(["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","search","section","select","shadow","slot","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"]),k=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),L=i(["animate","color-profile","cursor","discard","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"]),I=i(["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","mprescripts"]),M=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","mask-type","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","slope","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","tablevalues","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"]),F=i(["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"]),H=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=a(/<%[\w\W]*|[\w\W]*%>/gm),W=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:G,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:W});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.3.3",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:D,Element:w,NodeFilter:B,NamedNodeMap:G=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:W,DOMParser:Y,trustedTypes:j}=n,q=w.prototype,$=O(q,"cloneNode"),V=O(q,"remove"),re=O(q,"nextSibling"),ie=O(q,"childNodes"),ae=O(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:be}=Z;let{IS_ALLOWED_URI:Se}=Z,Ne=null;const De=R({},[...v,...k,...x,...I,...U]);let Re=null;const we=R({},[...z,...P,...F,...H]);let Ce=Object.seal(l(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}})),Oe=null,ve=null;const ke=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xe=!0,Le=!0,Ie=!1,Me=!0,Ue=!1,ze=!0,Pe=!1,Fe=!1,He=!1,Be=!1,Ge=!1,We=!1,Ye=!0,je=!1,Xe=!0,qe=!1,$e={},Ke=null;const Ve=R({},["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"]);let Ze=null;const Je=R({},["audio","video","img","source","image","track"]);let Qe=null;const et=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let rt=ot,it=!1,at=null;const lt=R({},[tt,nt,ot],g);let ct=R({},["mi","mo","mn","ms","mtext"]),st=R({},["annotation-xml"]);const ut=R({},["title","style","font","a","script"]);let mt=null;const pt=["application/xhtml+xml","text/html"];let ft=null,dt=null;const ht=r.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},Tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),mt=-1===pt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ft="application/xhtml+xml"===mt?g:h,Ne=_(e,"ALLOWED_TAGS")?R({},e.ALLOWED_TAGS,ft):De,Re=_(e,"ALLOWED_ATTR")?R({},e.ALLOWED_ATTR,ft):we,at=_(e,"ALLOWED_NAMESPACES")?R({},e.ALLOWED_NAMESPACES,g):lt,Qe=_(e,"ADD_URI_SAFE_ATTR")?R(C(et),e.ADD_URI_SAFE_ATTR,ft):et,Ze=_(e,"ADD_DATA_URI_TAGS")?R(C(Je),e.ADD_DATA_URI_TAGS,ft):Je,Ke=_(e,"FORBID_CONTENTS")?R({},e.FORBID_CONTENTS,ft):Ve,Oe=_(e,"FORBID_TAGS")?R({},e.FORBID_TAGS,ft):C({}),ve=_(e,"FORBID_ATTR")?R({},e.FORBID_ATTR,ft):C({}),$e=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,xe=!1!==e.ALLOW_ARIA_ATTR,Le=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ue=e.SAFE_FOR_TEMPLATES||!1,ze=!1!==e.SAFE_FOR_XML,Pe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ge=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ye=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,Xe=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||X,rt=e.NAMESPACE||ot,ct=e.MATHML_TEXT_INTEGRATION_POINTS||ct,st=e.HTML_INTEGRATION_POINTS||st,Ce=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&gt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&gt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(Le=!1),Ge&&(Be=!0),$e&&(Ne=R({},U),Re=l(null),!0===$e.html&&(R(Ne,v),R(Re,z)),!0===$e.svg&&(R(Ne,k),R(Re,P),R(Re,H)),!0===$e.svgFilters&&(R(Ne,x),R(Re,P),R(Re,H)),!0===$e.mathMl&&(R(Ne,I),R(Re,F),R(Re,H))),_(e,"ADD_TAGS")||(ke.tagCheck=null),_(e,"ADD_ATTR")||(ke.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?ke.tagCheck=e.ADD_TAGS:(Ne===De&&(Ne=C(Ne)),R(Ne,e.ADD_TAGS,ft))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?ke.attributeCheck=e.ADD_ATTR:(Re===we&&(Re=C(Re)),R(Re,e.ADD_ATTR,ft))),e.ADD_URI_SAFE_ATTR&&R(Qe,e.ADD_URI_SAFE_ATTR,ft),e.FORBID_CONTENTS&&(Ke===Ve&&(Ke=C(Ke)),R(Ke,e.FORBID_CONTENTS,ft)),e.ADD_FORBID_CONTENTS&&(Ke===Ve&&(Ke=C(Ke)),R(Ke,e.ADD_FORBID_CONTENTS,ft)),Xe&&(Ne["#text"]=!0),Pe&&R(Ne,["html","head","body"]),Ne.table&&(R(Ne,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),dt=e}},yt=R({},[...k,...x,...L]),Et=R({},[...I,...M]),At=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},_t=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Be||Ge)try{At(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===mt&&rt===ot&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(rt===ot)try{t=(new Y).parseFromString(o,mt)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),rt===ot?pe.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},Nt=function(e){return e instanceof W&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof G)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Dt=function(e){return"function"==typeof D&&e instanceof D};function Rt(e,t,n){u(e,e=>{e.call(o,t,n,dt)})}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),Nt(e))return At(e),!0;const n=ft(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),ze&&e.hasChildNodes()&&!Dt(e.firstElementChild)&&b(/<[/\w!]/g,e.innerHTML)&&b(/<[/\w!]/g,e.textContent))return At(e),!0;if(e.nodeType===ee)return At(e),!0;if(ze&&e.nodeType===te&&b(/<[/\w]/g,e.data))return At(e),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(n))&&(!Ne[n]||Oe[n])){if(!Oe[n]&&Ot(n)){if(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,n))return!1;if(Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))return!1}if(Xe&&!Ke[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return At(e),!0}return e instanceof w&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===ot?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===o||ct[o]):Boolean(yt[n]):e.namespaceURI===tt?t.namespaceURI===ot?"math"===n:t.namespaceURI===nt?"math"===n&&st[o]:Boolean(Et[n]):e.namespaceURI===ot?!(t.namespaceURI===nt&&!st[o])&&!(t.namespaceURI===tt&&!ct[o])&&!Et[n]&&(ut[n]||!yt[n]):!("application/xhtml+xml"!==mt||!at[e.namespaceURI]))}(e)?(At(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ue&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],e=>{t=y(t,e," ")}),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(At(e),!0)},Ct=function(e,t,n){if(ve[t])return!1;if(Ye&&("id"===t||"name"===t)&&(n in r||n in ht))return!1;if(Le&&!ve[t]&&b(ye,t));else if(xe&&b(Ee,t));else if(ke.attributeCheck instanceof Function&&ke.attributeCheck(t,e));else if(!Re[t]||ve[t]){if(!(Ot(e)&&(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,e)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(e))&&(Ce.attributeNameCheck instanceof RegExp&&b(Ce.attributeNameCheck,t)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(t,e))||"is"===t&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,n)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))))return!1}else if(Qe[t]);else if(b(Se,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ze[e]){if(Ie&&!b(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Ot=function(e){return"annotation-xml"!==e&&T(e,be)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Nt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=ft(a),m=c;let f="value"===a?m:A(m);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),f=n.attrValue,!je||"id"!==s&&"name"!==s||(_t(a,e),f="user-content-"+f),ze&&b(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){_t(a,e);continue}if("attributename"===s&&T(f,"href")){_t(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){_t(a,e);continue}if(!Me&&b(/\/>/i,f)){_t(a,e);continue}Ue&&u([he,ge,Te],e=>{f=y(f,e," ")});const d=ft(e.nodeName);if(Ct(d,s,f)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(d,s)){case"TrustedHTML":f=le.createHTML(f);break;case"TrustedScriptURL":f=le.createScriptURL(f)}if(f!==m)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),Nt(e)?At(e):p(o.removed)}catch(t){_t(a,e)}}else _t(a,e)}Rt(de.afterSanitizeAttributes,e,null)},kt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(it=!e,it&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Dt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Fe||Tt(t),o.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=ft(e.nodeName);if(!Ne[t]||Oe[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof D)n=bt("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Be&&!Ue&&!Pe&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=bt(e),!n)return Be?null:We?ce:""}n&&He&&At(n.firstChild);const c=St(qe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&kt(i.content);if(qe)return e;if(Be){if(Ge)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Re.shadowroot||Re.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=Pe?n.outerHTML:n.innerHTML;return Pe&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&b(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ue&&u([he,ge,Te],e=>{m=y(m,e," ")}),le&&We?le.createHTML(m):m},o.setConfig=function(){Tt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},o.clearConfig=function(){dt=null,Fe=!1},o.isValidAttribute=function(e,t,n){dt||Tt({});const o=ft(e),r=ft(t);return Ct(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();export{re as default};
@@ -1,2 +0,0 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
- function t(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function e(t,e=""){if(!Number.isSafeInteger(t)||t<0){throw new Error(`${e&&`"${e}" `}expected integer >= 0, got ${t}`)}}function n(e,n,r=""){const s=t(e),o=e?.length,i=void 0!==n;if(!s||i&&o!==n){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(i?` of length ${n}`:"")+", got "+(s?`length=${o}`:"type="+typeof e))}return e}function r(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash must wrapped by utils.createHasher");e(t.outputLen),e(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function o(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function i(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function h(t,e){return t<<32-e|t>>>e}const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),c=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function u(t){if(n(t),f)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=c[t[n]];return e}const a=48,l=57,d=65,g=70,p=97,y=102;function w(t){return t>=a&&t<=l?t-a:t>=d&&t<=g?t-(d-10):t>=p&&t<=y?t-(p-10):void 0}function b(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(f)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,s=0;e<n;e++,s+=2){const n=w(t.charCodeAt(s)),o=w(t.charCodeAt(s+1));if(void 0===n||void 0===o){const e=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+s)}r[e]=16*n+o}return r}function A(...t){let e=0;for(let r=0;r<t.length;r++){const s=t[r];n(s),e+=s.length}const r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const s=t[e];r.set(s,n),n+=s.length}return r}function L(t,e={}){const n=(e,n)=>t(n).update(e).digest(),r=t(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=e=>t(e),Object.assign(n,e),Object.freeze(n)}function E(t=32){const e="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof e?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");return e.getRandomValues(new Uint8Array(t))}const x=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function U(t,e,n){return t&e^~t&n}function m(t,e,n){return t&e^t&n^e&n}class H{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,e,n,r){this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=i(this.buffer)}update(t){s(this),n(t);const{view:e,buffer:r,blockLen:o}=this,h=t.length;for(let n=0;n<h;){const s=Math.min(o-this.pos,h-n);if(s===o){const e=i(t);for(;o<=h-n;n+=o)this.process(e,n);continue}r.set(t.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){s(this),function(t,e){n(t,void 0,"digestInto() output");const r=e.outputLen;if(t.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:h,isLE:f}=this;let{pos:c}=this;e[c++]=128,o(this.buffer.subarray(c)),this.padOffset>h-c&&(this.process(r,0),c=0);for(let t=c;t<h;t++)e[t]=0;r.setBigUint64(h-8,BigInt(8*this.length),f),this.process(r,0);const u=i(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const l=a/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)u.setUint32(4*t,d[t],f)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:s,destroyed:o,pos:i}=this;return t.destroyed=o,t.finished=s,t.length=r,t.pos=i,r%e&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const v=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),C=Uint32Array.from([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]),k=new Uint32Array(64);class B extends H{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:e,C:n,D:r,E:s,F:o,G:i,H:h}=this;return[t,e,n,r,s,o,i,h]}set(t,e,n,r,s,o,i,h){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|s,this.F=0|o,this.G=0|i,this.H=0|h}process(t,e){for(let n=0;n<16;n++,e+=4)k[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=k[t-15],n=k[t-2],r=h(e,7)^h(e,18)^e>>>3,s=h(n,17)^h(n,19)^n>>>10;k[t]=s+k[t-7]+r+k[t-16]|0}let{A:n,B:r,C:s,D:o,E:i,F:f,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(h(i,6)^h(i,11)^h(i,25))+U(i,f,c)+C[t]+k[t]|0,a=(h(n,2)^h(n,13)^h(n,22))+m(n,r,s)|0;u=c,c=f,f=i,i=o+e|0,o=s,s=r,r=n,n=e+a|0}n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,o=o+this.D|0,i=i+this.E|0,f=f+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,s,o,i,f,c,u)}roundClean(){o(k)}destroy(){this.set(0,0,0,0,0,0,0,0),o(this.buffer)}}class I extends B{A=0|v[0];B=0|v[1];C=0|v[2];D=0|v[3];E=0|v[4];F=0|v[5];G=0|v[6];H=0|v[7];constructor(){super(32)}}const D=L(()=>new I,x(1));export{r as a,u as b,n as c,A as d,o as e,s as f,e as g,b as h,t as i,E as r,D as s};
@@ -1 +0,0 @@
1
- function e(e,r,t,o){var c,f=arguments.length,n=f<3?r:null===o?o=Object.getOwnPropertyDescriptor(r,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,r,t,o);else for(var p=e.length-1;p>=0;p--)(c=e[p])&&(n=(f<3?c(n):f>3?c(r,t,n):c(r,t))||n);return f>3&&n&&Object.defineProperty(r,t,n),n}"function"==typeof SuppressedError&&SuppressedError;export{e as _};
@@ -1 +0,0 @@
1
- import{H as r,I as t}from"./main.js";async function e(e){if(!e.proof)return void console.warn("No proof found in the issuer profile.");let o=e.proof.type;"DataIntegrityProof"===o&&(o=r(e.proof.cryptosuite));const i=await async function(r){if(r===t.MerkleProof2019){const{default:r}=await import("./MerkleProof2019-B7f1hhem-CjLDyx6Q.js");return r}if(r===t.Ed25519Signature2020){const{default:r}=await import("./Ed25519Signature2020-fJGvlbIp-B6XhFwr4.js");return r}if(r===t.EcdsaSecp256k1Signature2019){const{default:r}=await import("./EcdsaSecp256k1Signature2019-D90cAynb-Bf5kILPF.js");return r}if(r===t.EcdsaSd2023){const{default:r}=await import("./EcdsaSd2023-CUjrjGzC-Cx7ejHu-.js");return r}}(o),a=new i({document:e,proof:e.proof,issuer:e.issuer?e.issuer:e,executeStep:async(r,t,e)=>t()});await a.init();try{await a.verifyProof()}catch(r){throw new Error(`Issuer profile verification failed: ${r.message}`)}}export{e as default};