@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
@@ -0,0 +1,56 @@
1
+ import{a as t}from"./jsonld-DqC1oHcn-ruRlORc0.js";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const i=256,a=286,s=30,r=15,n=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]),o=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]),d=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);e(h);const c=new Array(60);e(c);const w=new Array(512);e(w);const _=new Array(256);e(_);const p=new Array(29);e(p);const u=new Array(s);function f(t,e,i,a,s){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=a,this.max_length=s,this.has_stree=t&&t.length}let g,m,b;function y(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(u);const v=t=>t<256?w[t]:w[256+(t>>>7)],k=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,i)=>{t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)},z=(t,e,i)=>{x(t,i[2*e],i[2*e+1])},S=(t,e)=>{let i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1},A=(t,e,i)=>{const a=new Array(16);let s,n,o=0;for(s=1;s<=r;s++)o=o+i[s-1]<<1,a[s]=o;for(n=0;n<=e;n++){let e=t[2*n+1];0!==e&&(t[2*n]=S(a[e]++,e))}},E=t=>{let e;for(e=0;e<a;e++)t.dyn_ltree[2*e]=0;for(e=0;e<s;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},M=t=>{t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},R=(t,e,i,a)=>{const s=2*e,r=2*i;return t[s]<t[r]||t[s]===t[r]&&a[e]<=a[i]},U=(t,e,i)=>{const a=t.heap[i];let s=i<<1;for(;s<=t.heap_len&&(s<t.heap_len&&R(e,t.heap[s+1],t.heap[s],t.depth)&&s++,!R(e,a,t.heap[s],t.depth));)t.heap[i]=t.heap[s],i=s,s<<=1;t.heap[i]=a},L=(t,e,a)=>{let s,r,d,l,h=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+h++],s+=(255&t.pending_buf[t.sym_buf+h++])<<8,r=t.pending_buf[t.sym_buf+h++],0===s?z(t,r,e):(d=_[r],z(t,d+i+1,e),l=n[d],0!==l&&(r-=p[d],x(t,r,l)),s--,d=v(s),z(t,d,a),l=o[d],0!==l&&(s-=u[d],x(t,s,l)))}while(h<t.sym_next);z(t,256,e)},Z=(t,e)=>{const i=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,n=e.stat_desc.elems;let o,d,l,h=-1;for(t.heap_len=0,t.heap_max=573,o=0;o<n;o++)0!==i[2*o]?(t.heap[++t.heap_len]=h=o,t.depth[o]=0):i[2*o+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,i[2*l]=1,t.depth[l]=0,t.opt_len--,s&&(t.static_len-=a[2*l+1]);for(e.max_code=h,o=t.heap_len>>1;o>=1;o--)U(t,i,o);l=n;do{o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),d=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=d,i[2*l]=i[2*o]+i[2*d],t.depth[l]=(t.depth[o]>=t.depth[d]?t.depth[o]:t.depth[d])+1,i[2*o+1]=i[2*d+1]=l,t.heap[1]=l++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const i=e.dyn_tree,a=e.max_code,s=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,c,w,_,p,u,f=0;for(_=0;_<=r;_++)t.bl_count[_]=0;for(i[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)c=t.heap[h],_=i[2*i[2*c+1]+1]+1,_>l&&(_=l,f++),i[2*c+1]=_,c>a||(t.bl_count[_]++,p=0,c>=d&&(p=o[c-d]),u=i[2*c],t.opt_len+=u*(_+p),n&&(t.static_len+=u*(s[2*c+1]+p)));if(0!==f){do{for(_=l-1;0===t.bl_count[_];)_--;t.bl_count[_]--,t.bl_count[_+1]+=2,t.bl_count[l]--,f-=2}while(f>0);for(_=l;0!==_;_--)for(c=t.bl_count[_];0!==c;)w=t.heap[--h],w>a||(i[2*w+1]!==_&&(t.opt_len+=(_-i[2*w+1])*i[2*w],i[2*w+1]=_),c--)}})(t,e),A(i,h,t.bl_count)},T=(t,e,i)=>{let a,s,r=-1,n=e[1],o=0,d=7,l=4;for(0===n&&(d=138,l=3),e[2*(i+1)+1]=65535,a=0;a<=i;a++)s=n,n=e[2*(a+1)+1],++o<d&&s===n||(o<l?t.bl_tree[2*s]+=o:0!==s?(s!==r&&t.bl_tree[2*s]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=s,0===n?(d=138,l=3):s===n?(d=6,l=3):(d=7,l=4))},D=(t,e,i)=>{let a,s,r=-1,n=e[1],o=0,d=7,l=4;for(0===n&&(d=138,l=3),a=0;a<=i;a++)if(s=n,n=e[2*(a+1)+1],!(++o<d&&s===n)){if(o<l)do{z(t,s,t.bl_tree)}while(0!==--o);else 0!==s?(s!==r&&(z(t,s,t.bl_tree),o--),z(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(z(t,17,t.bl_tree),x(t,o-3,3)):(z(t,18,t.bl_tree),x(t,o-11,7));o=0,r=s,0===n?(d=138,l=3):s===n?(d=6,l=3):(d=7,l=4)}};let j=!1;const C=(t,e,i,a)=>{x(t,0+(a?1:0),3),M(t),k(t,i),k(t,~i),i&&t.pending_buf.set(t.window.subarray(e,e+i),t.pending),t.pending+=i};var O=(t,e,a,s)=>{let r,n,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<i;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),Z(t,t.l_desc),Z(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),Z(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),r=t.opt_len+3+7>>>3,n=t.static_len+3+7>>>3,n<=r&&(r=n)):r=n=a+5,a+4<=r&&-1!==e?C(t,e,a,s):4===t.strategy||n===r?(x(t,2+(s?1:0),3),L(t,h,c)):(x(t,4+(s?1:0),3),((t,e,i,a)=>{let s;for(x(t,e-257,5),x(t,i-1,5),x(t,a-4,4),s=0;s<a;s++)x(t,t.bl_tree[2*l[s]+1],3);D(t,t.dyn_ltree,e-1),D(t,t.dyn_dtree,i-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),L(t,t.dyn_ltree,t.dyn_dtree)),E(t),s&&M(t)},F={_tr_init:t=>{j||((()=>{let t,e,i,l,y;const v=new Array(16);for(i=0,l=0;l<28;l++)for(p[l]=i,t=0;t<1<<n[l];t++)_[i++]=l;for(_[i-1]=l,y=0,l=0;l<16;l++)for(u[l]=y,t=0;t<1<<o[l];t++)w[y++]=l;for(y>>=7;l<s;l++)for(u[l]=y<<7,t=0;t<1<<o[l]-7;t++)w[256+y++]=l;for(e=0;e<=r;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<s;t++)c[2*t+1]=5,c[2*t]=S(t,5);g=new f(h,n,257,a,r),m=new f(c,o,0,s,r),b=new f(new Array(0),d,0,19,7)})(),j=!0),t.l_desc=new y(t.dyn_ltree,g),t.d_desc=new y(t.dyn_dtree,m),t.bl_desc=new y(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,E(t)},_tr_stored_block:C,_tr_flush_block:O,_tr_tally:(t,e,a)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+i+1)]++,t.dyn_dtree[2*v(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{x(t,2,3),z(t,256,h),(t=>{16===t.bi_valid?(k(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 I=(t,e,i,a)=>{let s=65535&t,r=t>>>16&65535,n=0;for(;0!==i;){n=i>2e3?2e3:i,i-=n;do{s=s+e[a++]|0,r=r+s|0}while(--n);s%=65521,r%=65521}return s|r<<16};const B=new Uint32Array((()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var a=0;a<8;a++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e})());var N=(t,e,i,a)=>{const s=B,r=a+i;t^=-1;for(let i=a;i<r;i++)t=t>>>8^s[255&(t^e[i])];return-1^t},P={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"},H={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:V,_tr_stored_block:X,_tr_flush_block:K,_tr_tally:Y,_tr_align:J}=F,{Z_NO_FLUSH:G,Z_PARTIAL_FLUSH:W,Z_FULL_FLUSH:q,Z_FINISH:$,Z_BLOCK:Q,Z_OK:tt,Z_STREAM_END:et,Z_STREAM_ERROR:it,Z_DATA_ERROR:at,Z_BUF_ERROR:st,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:nt,Z_HUFFMAN_ONLY:ot,Z_RLE:dt,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:ct,Z_DEFLATED:wt}=H,_t=258,pt=262,ut=42,ft=113,gt=666,mt=(t,e)=>(t.msg=P[e],e),bt=t=>2*t-(t>4?9:0),yt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},vt=t=>{let e,i,a,s=t.w_size;e=t.hash_size,a=e;do{i=t.head[--a],t.head[a]=i>=s?i-s:0}while(--e);e=s,a=e;do{i=t.prev[--a],t.prev[a]=i>=s?i-s:0}while(--e)};let kt=(t,e,i)=>(e<<t.hash_shift^i)&t.hash_mask;const xt=(t,e)=>{let i;if(t.legacy_hash)i=t.ins_h=kt(t,t.ins_h,t.window[e+3-1]);else{const a=t.window,s=a[e]|a[e+1]<<8|a[e+2]<<16|a[e+3]<<24;i=t.ins_h=Math.imul(s,66521)+66521>>>16&t.hash_mask}const a=t.prev[e&t.w_mask]=t.head[i];return t.head[i]=e,a},zt=t=>{const e=t.state;let i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+i),t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))},St=(t,e)=>{K(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,zt(t.strm)},At=(t,e)=>{t.pending_buf[t.pending++]=e},Et=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=(t,e,i,a)=>{let s=t.avail_in;return s>a&&(s=a),0===s?0:(t.avail_in-=s,e.set(t.input.subarray(t.next_in,t.next_in+s),i),1===t.state.wrap?t.adler=I(t.adler,e,s,i):2===t.state.wrap&&(t.adler=N(t.adler,e,s,i)),t.next_in+=s,t.total_in+=s,s)},Rt=(t,e)=>{let i,a,s=t.max_chain_length,r=t.strstart,n=t.prev_length,o=t.nice_match;const d=t.strstart>t.w_size-pt?t.strstart-(t.w_size-pt):0,l=t.window,h=t.w_mask,c=t.prev,w=t.strstart+_t;let _=l[r+n-1],p=l[r+n];t.prev_length>=t.good_match&&(s>>=2),o>t.lookahead&&(o=t.lookahead);do{if(i=e,l[i+n]===p&&l[i+n-1]===_&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do{}while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<w);if(a=_t-(w-r),r=w-_t,a>n){if(t.match_start=e,n=a,a>=o)break;_=l[r+n-1],p=l[r+n]}}}while((e=c[e&h])>d&&0!==--s);return n<=t.lookahead?n:t.lookahead},Ut=t=>{const e=t.w_size;let i,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-pt)&&(t.window.set(t.window.subarray(e,e+e-a),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),vt(t),a+=e),0===t.strm.avail_in)break;if(i=Mt(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=i,t.legacy_hash){if(t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=kt(t,t.ins_h,t.window[s+1]);t.insert&&(xt(t,s),s++,t.insert--,!(t.lookahead+t.insert<3)););}else if(t.lookahead+t.insert>3)for(s=t.strstart-t.insert;t.insert&&(xt(t,s),s++,t.insert--,!(t.lookahead+t.insert<=3)););}while(t.lookahead<pt&&0!==t.strm.avail_in)},Lt=(t,e)=>{let i,a,s,r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n=0,o=t.strm.avail_in;do{if(i=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s)break;if(s=t.strm.avail_out-s,a=t.strstart-t.block_start,i>a+t.strm.avail_in&&(i=a+t.strm.avail_in),i>s&&(i=s),i<r&&(0===i&&e!==$||e===G||i!==a+t.strm.avail_in))break;n=e===$&&i===a+t.strm.avail_in?1:0,X(t,0,0,n),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,zt(t.strm),a&&(a>i&&(a=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+a),t.strm.next_out),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a,t.block_start+=a,i-=a),i&&(Mt(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(0===n);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),n?4:e!==G&&e!==$&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(s=t.window_size-t.strstart,t.strm.avail_in>s&&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++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(Mt(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,r=s>t.w_size?t.w_size:s,a=t.strstart-t.block_start,(a>=r||(a||e===$)&&e!==G&&0===t.strm.avail_in&&a<=s)&&(i=a>s?s:a,n=e===$&&0===t.strm.avail_in&&i===a?1:0,X(t,t.block_start,i,n),t.block_start+=i,zt(t.strm)),n?3:1)},Zt=(t,e)=>{let i,a;for(;;){if(t.lookahead<pt){if(Ut(t),t.lookahead<pt&&e===G)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(i=xt(t,t.strstart)),0!==i&&t.strstart-i<=t.w_size-pt&&(t.match_length=Rt(t,i)),t.match_length>=3)if(a=Y(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++,i=xt(t,t.strstart)}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.legacy_hash&&(t.ins_h=t.window[t.strstart],t.ins_h=kt(t,t.ins_h,t.window[t.strstart+1]));else a=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(a&&(St(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===$?(St(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(St(t,!1),0===t.strm.avail_out)?1:2},Tt=(t,e)=>{let i,a,s;for(;;){if(t.lookahead<pt){if(Ut(t),t.lookahead<pt&&e===G)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(i=xt(t,t.strstart)),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-pt&&(t.match_length=Rt(t,i),t.match_length<=5&&(t.strategy===nt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){s=t.strstart+t.lookahead-3,a=Y(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=s&&(i=xt(t,t.strstart))}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,a&&(St(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(a=Y(t,0,t.window[t.strstart-1]),a&&St(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&&(a=Y(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===$?(St(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(St(t,!1),0===t.strm.avail_out)?1:2};function Dt(t,e,i,a,s){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=a,this.func=s}const jt=[new Dt(0,0,0,0,Lt),new Dt(4,4,8,4,Zt),new Dt(4,5,16,8,Zt),new Dt(4,6,32,32,Zt),new Dt(4,4,16,16,Tt),new Dt(8,16,32,32,Tt),new Dt(8,16,128,128,Tt),new Dt(8,32,128,256,Tt),new Dt(32,128,258,1024,Tt),new Dt(32,258,258,4096,Tt)];function Ct(){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=wt,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.legacy_hash=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),yt(this.dyn_ltree),yt(this.dyn_dtree),yt(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),yt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),yt(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!==ft&&e.status!==gt?1:0},Ft=t=>{if(Ot(t))return mt(t,it);t.total_in=t.total_out=0,t.data_type=ct;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:ft,t.adler=2===e.wrap?0:1,e.last_flush=-2,V(e),tt},It=t=>{const e=Ft(t);var i;return e===tt&&((i=t.state).window_size=2*i.w_size,yt(i.head),i.max_lazy_match=jt[i.level].max_lazy,i.good_match=jt[i.level].good_length,i.nice_match=jt[i.level].nice_length,i.max_chain_length=jt[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),e},Bt=(t,e,i,a,s,r,n)=>{if(!t)return it;let o=1;if(e===rt&&(e=6),a<0?(o=0,a=-a):a>15&&(o=2,a-=16),s<1||s>9||i!==wt||a<8||a>15||e<0||e>9||r<0||r>lt||8===a&&1!==o)return mt(t,it);8===a&&(a=9);const d=new Ct;return t.state=d,d.strm=t,d.status=ut,d.wrap=o,d.gzhead=null,d.w_bits=a,d.w_size=1<<d.w_bits,d.w_mask=d.w_size-1,d.legacy_hash=n?1:0,d.hash_bits=s+7,!d.legacy_hash&&d.hash_bits<15&&(d.hash_bits=15),d.hash_size=1<<d.hash_bits,d.hash_mask=d.hash_size-1,d.hash_shift=~~((d.hash_bits+3-1)/3),d.window=new Uint8Array(2*d.w_size),d.head=new Uint16Array(d.hash_size),d.prev=new Uint16Array(d.w_size),d.lit_bufsize=1<<s+6,d.pending_buf_size=4*d.lit_bufsize,d.pending_buf=new Uint8Array(d.pending_buf_size),d.sym_buf=d.lit_bufsize,d.sym_end=3*(d.lit_bufsize-1),d.level=e,d.strategy=r,d.method=i,It(t)};var Nt={deflateInit:(t,e)=>Bt(t,e,wt,15,8,ht),deflateInit2:Bt,deflateReset:It,deflateResetKeep:Ft,deflateSetHeader:(t,e)=>Ot(t)||2!==t.state.wrap?it:(t.state.gzhead=e,tt),deflate:(t,e)=>{if(Ot(t)||e>Q||e<0)return t?mt(t,it):it;const i=t.state;if(!t.output||0!==t.avail_in&&!t.input||i.status===gt&&e!==$)return mt(t,0===t.avail_out?st:it);const a=i.last_flush;if(i.last_flush=e,0!==i.pending){if(zt(t),0===t.avail_out)return i.last_flush=-1,tt}else if(0===t.avail_in&&bt(e)<=bt(a)&&e!==$)return mt(t,st);if(i.status===gt&&0!==t.avail_in)return mt(t,st);if(i.status===ut&&0===i.wrap&&(i.status=ft),i.status===ut){let e=wt+(i.w_bits-8<<4)<<8,a=-1;if(a=i.strategy>=ot||i.level<2?0:i.level<6?1:6===i.level?2:3,e|=a<<6,0!==i.strstart&&(e|=32),e+=31-e%31,Et(i,e),0!==i.strstart&&(Et(i,t.adler>>>16),Et(i,65535&t.adler)),t.adler=1,i.status=ft,zt(t),0!==i.pending)return i.last_flush=-1,tt}if(57===i.status)if(t.adler=0,At(i,31),At(i,139),At(i,8),i.gzhead)At(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),At(i,255&i.gzhead.time),At(i,i.gzhead.time>>8&255),At(i,i.gzhead.time>>16&255),At(i,i.gzhead.time>>24&255),At(i,9===i.level?2:i.strategy>=ot||i.level<2?4:0),At(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(At(i,255&i.gzhead.extra.length),At(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=N(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(At(i,0),At(i,0),At(i,0),At(i,0),At(i,0),At(i,9===i.level?2:i.strategy>=ot||i.level<2?4:0),At(i,3),i.status=ft,zt(t),0!==i.pending)return i.last_flush=-1,tt;if(69===i.status){if(i.gzhead.extra){let e=i.pending,a=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+a>i.pending_buf_size;){let s=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+s),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>e&&(t.adler=N(t.adler,i.pending_buf,i.pending-e,e)),i.gzindex+=s,zt(t),0!==i.pending)return i.last_flush=-1,tt;e=0,a-=s}let s=new Uint8Array(i.gzhead.extra);i.pending_buf.set(s.subarray(i.gzindex,i.gzindex+a),i.pending),i.pending+=a,i.gzhead.hcrc&&i.pending>e&&(t.adler=N(t.adler,i.pending_buf,i.pending-e,e)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let e,a=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>a&&(t.adler=N(t.adler,i.pending_buf,i.pending-a,a)),zt(t),0!==i.pending)return i.last_flush=-1,tt;a=0}e=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,At(i,e)}while(0!==e);i.gzhead.hcrc&&i.pending>a&&(t.adler=N(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let e,a=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>a&&(t.adler=N(t.adler,i.pending_buf,i.pending-a,a)),zt(t),0!==i.pending)return i.last_flush=-1,tt;a=0}e=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,At(i,e)}while(0!==e);i.gzhead.hcrc&&i.pending>a&&(t.adler=N(t.adler,i.pending_buf,i.pending-a,a))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(zt(t),0!==i.pending))return i.last_flush=-1,tt;At(i,255&t.adler),At(i,t.adler>>8&255),t.adler=0}if(i.status=ft,zt(t),0!==i.pending)return i.last_flush=-1,tt}if(0!==t.avail_in||0!==i.lookahead||e!==G&&i.status!==gt){let a=0===i.level?Lt(i,e):i.strategy===ot?((t,e)=>{let i;for(;;){if(0===t.lookahead&&(Ut(t),0===t.lookahead)){if(e===G)return 1;break}if(t.match_length=0,i=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(St(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===$?(St(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(St(t,!1),0===t.strm.avail_out)?1:2})(i,e):i.strategy===dt?((t,e)=>{let i,a,s,r;const n=t.window;for(;;){if(t.lookahead<=_t){if(Ut(t),t.lookahead<=_t&&e===G)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(s=t.strstart-1,a=n[s],a===n[++s]&&a===n[++s]&&a===n[++s])){r=t.strstart+_t;do{}while(a===n[++s]&&a===n[++s]&&a===n[++s]&&a===n[++s]&&a===n[++s]&&a===n[++s]&&a===n[++s]&&a===n[++s]&&s<r);t.match_length=_t-(r-s),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=Y(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(St(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===$?(St(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(St(t,!1),0===t.strm.avail_out)?1:2})(i,e):jt[i.level].func(i,e);if(3!==a&&4!==a||(i.status=gt),1===a||3===a)return 0===t.avail_out&&(i.last_flush=-1),tt;if(2===a&&(e===W?J(i):e!==Q&&(X(i,0,0,!1),e===q&&(yt(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),zt(t),0===t.avail_out))return i.last_flush=-1,tt}return e!==$?tt:i.wrap<=0?et:(2===i.wrap?(At(i,255&t.adler),At(i,t.adler>>8&255),At(i,t.adler>>16&255),At(i,t.adler>>24&255),At(i,255&t.total_in),At(i,t.total_in>>8&255),At(i,t.total_in>>16&255),At(i,t.total_in>>24&255)):(Et(i,t.adler>>>16),Et(i,65535&t.adler)),zt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?tt:et)},deflateEnd:t=>{if(Ot(t))return it;const e=t.state.status;return t.state=null,e===ft?mt(t,at):tt},deflateSetDictionary:(t,e)=>{let i=e.length;if(Ot(t))return it;const a=t.state,s=a.wrap;if(2===s||1===s&&a.status!==ut||a.lookahead)return it;if(1===s&&(t.adler=I(t.adler,e,i,0)),a.wrap=0,i>=a.w_size){0===s&&(yt(a.head),a.strstart=0,a.block_start=0,a.insert=0);let t=new Uint8Array(a.w_size);t.set(e.subarray(i-a.w_size,i),0),e=t,i=a.w_size}const r=t.avail_in,n=t.next_in,o=t.input;for(t.avail_in=i,t.next_in=0,t.input=e,Ut(a);a.lookahead>=3;){let t=a.strstart,e=a.lookahead-2;do{xt(a,t),t++}while(--e);a.strstart=t,a.lookahead=2,Ut(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,t.next_in=n,t.input=o,t.avail_in=r,a.wrap=s,tt},deflateInfo:"pako deflate (from Nodeca project)"};const Pt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Ht=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)Pt(i,e)&&(t[e]=i[e])}}return t},Vt=t=>{let e=0;for(let i=0,a=t.length;i<a;i++)e+=t[i].length;const i=new Uint8Array(e);for(let e=0,a=0,s=t.length;e<s;e++){let s=t[e];i.set(s,a),a+=s.length}return i};let Xt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Xt=!1}const Kt=new Uint8Array(256);for(let t=0;t<256;t++)Kt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Kt[254]=Kt[255]=1;var Yt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,i,a,s,r,n=t.length,o=0;for(s=0;s<n;s++)i=t.charCodeAt(s),55296==(64512&i)&&s+1<n&&(a=t.charCodeAt(s+1),56320==(64512&a)&&(i=65536+(i-55296<<10)+(a-56320),s++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(o),r=0,s=0;r<o;s++)i=t.charCodeAt(s),55296==(64512&i)&&s+1<n&&(a=t.charCodeAt(s+1),56320==(64512&a)&&(i=65536+(i-55296<<10)+(a-56320),s++)),i<128?e[r++]=i:i<2048?(e[r++]=192|i>>>6,e[r++]=128|63&i):i<65536?(e[r++]=224|i>>>12,e[r++]=128|i>>>6&63,e[r++]=128|63&i):(e[r++]=240|i>>>18,e[r++]=128|i>>>12&63,e[r++]=128|i>>>6&63,e[r++]=128|63&i);return e},Jt=(t,e)=>{const i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let a,s;const r=new Array(2*i);for(s=0,a=0;a<i;){let e=t[a++];if(e<128){r[s++]=e;continue}let n=Kt[e];if(n>4)r[s++]=65533,a+=n-1;else{for(e&=2===n?31:3===n?15:7;n>1&&a<i;)e=e<<6|63&t[a++],n--;n>1?r[s++]=65533:e<65536?r[s++]=e:(e-=65536,r[s++]=55296|e>>10&1023,r[s++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Xt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i})(r,s)},Gt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Kt[t[i]]>e?i:e};var Wt=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:$t,Z_SYNC_FLUSH:Qt,Z_FULL_FLUSH:te,Z_FINISH:ee,Z_OK:ie,Z_STREAM_END:ae,Z_DEFAULT_COMPRESSION:se,Z_DEFAULT_STRATEGY:re,Z_DEFLATED:ne}=H,oe={level:se,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:re,legacyHash:!0};function de(t){this.options=Ht({},oe,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 Wt,this.strm.avail_out=0;let i=Nt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash);if(i!==ie)throw new Error(P[i]);if(e.header&&Nt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Yt(e.dictionary):"[object ArrayBuffer]"===qt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,i=Nt.deflateSetDictionary(this.strm,t),i!==ie)throw new Error(P[i]);this._dict_set=!0}}de.prototype.push=function(t,e){const i=this.strm,a=this.options.chunkSize;let s,r;if(this.ended)return!1;for(r=e===~~e?e:!0===e?ee:$t,"string"==typeof t?i.input=Yt(t):"[object ArrayBuffer]"===qt.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),(r===Qt||r===te)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(s=Nt.deflate(i,r),s===ae)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),s=Nt.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ie;if(0!==i.avail_out){if(r>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},de.prototype.onData=function(t){this.chunks.push(t)},de.prototype.onEnd=function(t){t===ie&&(this.result=Vt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var le={gzip:function(t,e){return(e=e||{}).gzip=!0,function(t,e){const i=new de(e);if(i.push(t,!0),i.err)throw i.msg||P[i.err];return i.result}(t,e)}};const he=16209;var ce=function(t,e){let i,a,s,r,n,o,d,l,h,c,w,_,p,u,f,g,m,b,y,v,k,x,z,S;const A=t.state;i=t.next_in,z=t.input,a=i+(t.avail_in-5),s=t.next_out,S=t.output,r=s-(e-t.avail_out),n=s+(t.avail_out-257),o=A.dmax,d=A.wsize,l=A.whave,h=A.wnext,c=A.window,w=A.hold,_=A.bits,p=A.lencode,u=A.distcode,f=(1<<A.lenbits)-1,g=(1<<A.distbits)-1;t:do{_<15&&(w+=z[i++]<<_,_+=8,w+=z[i++]<<_,_+=8),m=p[w&f];e:for(;;){if(b=m>>>24,w>>>=b,_-=b,b=m>>>16&255,0===b)S[s++]=65535&m;else{if(!(16&b)){if(64&b){if(32&b){A.mode=16191;break t}t.msg="invalid literal/length code",A.mode=he;break t}m=p[(65535&m)+(w&(1<<b)-1)];continue e}for(y=65535&m,b&=15,b&&(_<b&&(w+=z[i++]<<_,_+=8),y+=w&(1<<b)-1,w>>>=b,_-=b),_<15&&(w+=z[i++]<<_,_+=8,w+=z[i++]<<_,_+=8),m=u[w&g];;){if(b=m>>>24,w>>>=b,_-=b,b=m>>>16&255,16&b){if(v=65535&m,b&=15,_<b&&(w+=z[i++]<<_,_+=8,_<b&&(w+=z[i++]<<_,_+=8)),v+=w&(1<<b)-1,v>o){t.msg="invalid distance too far back",A.mode=he;break t}if(w>>>=b,_-=b,b=s-r,v>b){if(b=v-b,b>l&&A.sane){t.msg="invalid distance too far back",A.mode=he;break t}if(k=0,x=c,0===h){if(k+=d-b,b<y){y-=b;do{S[s++]=c[k++]}while(--b);k=s-v,x=S}}else if(h<b){if(k+=d+h-b,b-=h,b<y){y-=b;do{S[s++]=c[k++]}while(--b);if(k=0,h<y){b=h,y-=b;do{S[s++]=c[k++]}while(--b);k=s-v,x=S}}}else if(k+=h-b,b<y){y-=b;do{S[s++]=c[k++]}while(--b);k=s-v,x=S}for(;y>2;)S[s++]=x[k++],S[s++]=x[k++],S[s++]=x[k++],y-=3;y&&(S[s++]=x[k++],y>1&&(S[s++]=x[k++]))}else{k=s-v;do{S[s++]=S[k++],S[s++]=S[k++],S[s++]=S[k++],y-=3}while(y>2);y&&(S[s++]=S[k++],y>1&&(S[s++]=S[k++]))}break}if(64&b){t.msg="invalid distance code",A.mode=he;break t}m=u[(65535&m)+(w&(1<<b)-1)]}}break}}while(i<a&&s<n);y=_>>3,i-=y,_-=y<<3,w&=(1<<_)-1,t.next_in=i,t.next_out=s,t.avail_in=i<a?a-i+5:5-(i-a),t.avail_out=s<n?n-s+257:257-(s-n),A.hold=w,A.bits=_};const we=15,_e=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]),pe=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,199,75]),ue=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]),fe=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 ge=(t,e,i,a,s,r,n,o)=>{const d=o.bits;let l,h,c,w,_,p,u=0,f=0,g=0,m=0,b=0,y=0,v=0,k=0,x=0,z=0,S=null;const A=new Uint16Array(16),E=new Uint16Array(16);let M,R,U,L=null;for(u=0;u<=we;u++)A[u]=0;for(f=0;f<a;f++)A[e[i+f]]++;for(b=d,m=we;m>=1&&0===A[m];m--);if(b>m&&(b=m),0===m)return s[r++]=20971520,s[r++]=20971520,o.bits=1,0;for(g=1;g<m&&0===A[g];g++);for(b<g&&(b=g),k=1,u=1;u<=we;u++)if(k<<=1,k-=A[u],k<0)return-1;if(k>0&&(0===t||1!==m))return-1;for(E[1]=0,u=1;u<we;u++)E[u+1]=E[u]+A[u];for(f=0;f<a;f++)0!==e[i+f]&&(n[E[e[i+f]]++]=f);if(0===t?(S=L=n,p=20):1===t?(S=_e,L=pe,p=257):(S=ue,L=fe,p=0),z=0,f=0,u=g,_=r,y=b,v=0,c=-1,x=1<<b,w=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){M=u-v,n[f]+1<p?(R=0,U=n[f]):n[f]>=p?(R=L[n[f]-p],U=S[n[f]-p]):(R=96,U=0),l=1<<u-v,h=1<<y,g=h;do{h-=l,s[_+(z>>v)+h]=M<<24|R<<16|U}while(0!==h);for(l=1<<u-1;z&l;)l>>=1;if(0!==l?(z&=l-1,z+=l):z=0,f++,0===--A[u]){if(u===m)break;u=e[i+n[f]]}if(u>b&&(z&w)!==c){for(0===v&&(v=b),_+=g,y=u-v,k=1<<y;y+v<m&&(k-=A[y+v],!(k<=0));)y++,k<<=1;if(x+=1<<y,1===t&&x>852||2===t&&x>592)return 1;c=z&w,s[c]=b<<24|y<<16|_-r}}return 0!==z&&(s[_+z]=u-v<<24|64<<16),o.bits=b,0};const{Z_FINISH:me,Z_BLOCK:be,Z_TREES:ye,Z_OK:ve,Z_STREAM_END:ke,Z_NEED_DICT:xe,Z_STREAM_ERROR:ze,Z_DATA_ERROR:Se,Z_MEM_ERROR:Ae,Z_BUF_ERROR:Ee,Z_DEFLATED:Me}=H,Re=16180,Ue=16190,Le=16191,Ze=16192,Te=16194,De=16199,je=16200,Ce=16206,Oe=16209,Fe=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ie(){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 Be=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Re||e.mode>16211?1:0},Ne=t=>{if(Be(t))return ze;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=Re,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,ve},Pe=t=>{if(Be(t))return ze;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ne(t)},He=(t,e)=>{let i;if(Be(t))return ze;const a=t.state;return e<0?(i=0,e=-e):(i=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ze:(null!==a.window&&a.wbits!==e&&(a.window=null),a.wrap=i,a.wbits=e,Pe(t))},Ve=(t,e)=>{if(!t)return ze;const i=new Ie;t.state=i,i.strm=t,i.window=null,i.mode=Re;const a=He(t,e);return a!==ve&&(t.state=null),a};let Xe,Ke,Ye=!0;const Je=t=>{if(Ye){Xe=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(ge(1,t.lens,0,288,Xe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ge(2,t.lens,0,32,Ke,0,t.work,{bits:5}),Ye=!1}t.lencode=Xe,t.lenbits=9,t.distcode=Ke,t.distbits=5},Ge=(t,e,i,a)=>{let s;const r=t.state;return null===r.window&&(r.window=new Uint8Array(1<<r.wbits)),0===r.wsize&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0),a>=r.wsize?(r.window.set(e.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>a&&(s=a),r.window.set(e.subarray(i-a,i-a+s),r.wnext),(a-=s)?(r.window.set(e.subarray(i-a,i),0),r.wnext=a,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=s))),0};var We={inflateReset:Pe,inflateReset2:He,inflateResetKeep:Ne,inflateInit:t=>Ve(t,15),inflateInit2:Ve,inflate:(t,e)=>{let i,a,s,r,n,o,d,l,h,c,w,_,p,u,f,g,m,b,y,v,k,x,z=0;const S=new Uint8Array(4);let A,E;const M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Be(t)||!t.output||!t.input&&0!==t.avail_in)return ze;i=t.state,i.mode===Le&&(i.mode=Ze),n=t.next_out,s=t.output,d=t.avail_out,r=t.next_in,a=t.input,o=t.avail_in,l=i.hold,h=i.bits,c=o,w=d,x=ve;t:for(;;)switch(i.mode){case Re:if(0===i.wrap){i.mode=Ze;break}for(;h<16;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(2&i.wrap&&35615===l){0===i.wbits&&(i.wbits=15),i.check=0,S[0]=255&l,S[1]=l>>>8&255,i.check=N(i.check,S,2,0),l=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",i.mode=Oe;break}if((15&l)!==Me){t.msg="unknown compression method",i.mode=Oe;break}if(l>>>=4,h-=4,k=8+(15&l),0===i.wbits&&(i.wbits=k),k>15||k>i.wbits){t.msg="invalid window size",i.mode=Oe;break}i.dmax=1<<i.wbits,i.flags=0,t.adler=i.check=1,i.mode=512&l?16189:Le,l=0,h=0;break;case 16181:for(;h<16;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(i.flags=l,(255&i.flags)!==Me){t.msg="unknown compression method",i.mode=Oe;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=Oe;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&4&i.wrap&&(S[0]=255&l,S[1]=l>>>8&255,i.check=N(i.check,S,2,0)),l=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}i.head&&(i.head.time=l),512&i.flags&&4&i.wrap&&(S[0]=255&l,S[1]=l>>>8&255,S[2]=l>>>16&255,S[3]=l>>>24&255,i.check=N(i.check,S,4,0)),l=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&4&i.wrap&&(S[0]=255&l,S[1]=l>>>8&255,i.check=N(i.check,S,2,0)),l=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&4&i.wrap&&(S[0]=255&l,S[1]=l>>>8&255,i.check=N(i.check,S,2,0)),l=0,h=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(_=i.length,_>o&&(_=o),_&&(i.head&&(k=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(a.subarray(r,r+_),k)),512&i.flags&&4&i.wrap&&(i.check=N(i.check,a,_,r)),o-=_,r+=_,i.length-=_),i.length))break t;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===o)break t;_=0;do{k=a[r+_++],i.head&&k&&i.length<65536&&(i.head.name+=String.fromCharCode(k))}while(k&&_<o);if(512&i.flags&&4&i.wrap&&(i.check=N(i.check,a,_,r)),o-=_,r+=_,k)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===o)break t;_=0;do{k=a[r+_++],i.head&&k&&i.length<65536&&(i.head.comment+=String.fromCharCode(k))}while(k&&_<o);if(512&i.flags&&4&i.wrap&&(i.check=N(i.check,a,_,r)),o-=_,r+=_,k)break t}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(4&i.wrap&&l!==(65535&i.check)){t.msg="header crc mismatch",i.mode=Oe;break}l=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=Le;break;case 16189:for(;h<32;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}t.adler=i.check=Fe(l),l=0,h=0,i.mode=Ue;case Ue:if(0===i.havedict)return t.next_out=n,t.avail_out=d,t.next_in=r,t.avail_in=o,i.hold=l,i.bits=h,xe;t.adler=i.check=1,i.mode=Le;case Le:if(e===be||e===ye)break t;case Ze:if(i.last){l>>>=7&h,h-=7&h,i.mode=Ce;break}for(;h<3;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}switch(i.last=1&l,l>>>=1,h-=1,3&l){case 0:i.mode=16193;break;case 1:if(Je(i),i.mode=De,e===ye){l>>>=2,h-=2;break t}break;case 2:i.mode=16196;break;case 3:t.msg="invalid block type",i.mode=Oe}l>>>=2,h-=2;break;case 16193:for(l>>>=7&h,h-=7&h;h<32;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if((65535&l)!=(l>>>16^65535)){t.msg="invalid stored block lengths",i.mode=Oe;break}if(i.length=65535&l,l=0,h=0,i.mode=Te,e===ye)break t;case Te:i.mode=16195;case 16195:if(_=i.length,_){if(_>o&&(_=o),_>d&&(_=d),0===_)break t;s.set(a.subarray(r,r+_),n),o-=_,r+=_,d-=_,n+=_,i.length-=_;break}i.mode=Le;break;case 16196:for(;h<14;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(i.nlen=257+(31&l),l>>>=5,h-=5,i.ndist=1+(31&l),l>>>=5,h-=5,i.ncode=4+(15&l),l>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=Oe;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}i.lens[M[i.have++]]=7&l,l>>>=3,h-=3}for(;i.have<19;)i.lens[M[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,A={bits:i.lenbits},x=ge(0,i.lens,0,19,i.lencode,0,i.work,A),i.lenbits=A.bits,x){t.msg="invalid code lengths set",i.mode=Oe;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;z=i.lencode[l&(1<<i.lenbits)-1],f=z>>>24,g=z>>>16&255,m=65535&z,!(f<=h);){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(m<16)l>>>=f,h-=f,i.lens[i.have++]=m;else{if(16===m){for(E=f+2;h<E;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(l>>>=f,h-=f,0===i.have){t.msg="invalid bit length repeat",i.mode=Oe;break}k=i.lens[i.have-1],_=3+(3&l),l>>>=2,h-=2}else if(17===m){for(E=f+3;h<E;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}l>>>=f,h-=f,k=0,_=3+(7&l),l>>>=3,h-=3}else{for(E=f+7;h<E;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}l>>>=f,h-=f,k=0,_=11+(127&l),l>>>=7,h-=7}if(i.have+_>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=Oe;break}for(;_--;)i.lens[i.have++]=k}}if(i.mode===Oe)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=Oe;break}if(i.lenbits=9,A={bits:i.lenbits},x=ge(1,i.lens,0,i.nlen,i.lencode,0,i.work,A),i.lenbits=A.bits,x){t.msg="invalid literal/lengths set",i.mode=Oe;break}if(i.distbits=6,i.distcode=i.distdyn,A={bits:i.distbits},x=ge(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,A),i.distbits=A.bits,x){t.msg="invalid distances set",i.mode=Oe;break}if(i.mode=De,e===ye)break t;case De:i.mode=je;case je:if(o>=6&&d>=258){t.next_out=n,t.avail_out=d,t.next_in=r,t.avail_in=o,i.hold=l,i.bits=h,ce(t,w),n=t.next_out,s=t.output,d=t.avail_out,r=t.next_in,a=t.input,o=t.avail_in,l=i.hold,h=i.bits,i.mode===Le&&(i.back=-1);break}for(i.back=0;z=i.lencode[l&(1<<i.lenbits)-1],f=z>>>24,g=z>>>16&255,m=65535&z,!(f<=h);){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(g&&!(240&g)){for(b=f,y=g,v=m;z=i.lencode[v+((l&(1<<b+y)-1)>>b)],f=z>>>24,g=z>>>16&255,m=65535&z,!(b+f<=h);){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}l>>>=b,h-=b,i.back+=b}if(l>>>=f,h-=f,i.back+=f,i.length=m,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=Le;break}if(64&g){t.msg="invalid literal/length code",i.mode=Oe;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(E=i.extra;h<E;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;z=i.distcode[l&(1<<i.distbits)-1],f=z>>>24,g=z>>>16&255,m=65535&z,!(f<=h);){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(!(240&g)){for(b=f,y=g,v=m;z=i.distcode[v+((l&(1<<b+y)-1)>>b)],f=z>>>24,g=z>>>16&255,m=65535&z,!(b+f<=h);){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}l>>>=b,h-=b,i.back+=b}if(l>>>=f,h-=f,i.back+=f,64&g){t.msg="invalid distance code",i.mode=Oe;break}i.offset=m,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(E=i.extra;h<E;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=Oe;break}i.mode=16204;case 16204:if(0===d)break t;if(_=w-d,i.offset>_){if(_=i.offset-_,_>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=Oe;break}_>i.wnext?(_-=i.wnext,p=i.wsize-_):p=i.wnext-_,_>i.length&&(_=i.length),u=i.window}else u=s,p=n-i.offset,_=i.length;_>d&&(_=d),d-=_,i.length-=_;do{s[n++]=u[p++]}while(--_);0===i.length&&(i.mode=je);break;case 16205:if(0===d)break t;s[n++]=i.length,d--,i.mode=je;break;case Ce:if(i.wrap){for(;h<32;){if(0===o)break t;o--,l|=a[r++]<<h,h+=8}if(w-=d,t.total_out+=w,i.total+=w,4&i.wrap&&w&&(t.adler=i.check=i.flags?N(i.check,s,w,n-w):I(i.check,s,w,n-w)),w=d,4&i.wrap&&(i.flags?l:Fe(l))!==i.check){t.msg="incorrect data check",i.mode=Oe;break}l=0,h=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===o)break t;o--,l+=a[r++]<<h,h+=8}if(4&i.wrap&&l!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=Oe;break}l=0,h=0}i.mode=16208;case 16208:x=ke;break t;case Oe:x=Se;break t;case 16210:return Ae;default:return ze}return t.next_out=n,t.avail_out=d,t.next_in=r,t.avail_in=o,i.hold=l,i.bits=h,(i.wsize||w!==t.avail_out&&i.mode<Oe&&(i.mode<Ce||e!==me))&&Ge(t,t.output,t.next_out,w-t.avail_out),c-=t.avail_in,w-=t.avail_out,t.total_in+=c,t.total_out+=w,i.total+=w,4&i.wrap&&w&&(t.adler=i.check=i.flags?N(i.check,s,w,t.next_out-w):I(i.check,s,w,t.next_out-w)),t.data_type=i.bits+(i.last?64:0)+(i.mode===Le?128:0)+(i.mode===De||i.mode===Te?256:0),(0===c&&0===w||e===me)&&x===ve&&(x=Ee),x},inflateEnd:t=>{if(Be(t))return ze;let e=t.state;return e.window&&(e.window=null),t.state=null,ve},inflateGetHeader:(t,e)=>{if(Be(t))return ze;const i=t.state;return 2&i.wrap?(i.head=e,e.done=!1,ve):ze},inflateSetDictionary:(t,e)=>{const i=e.length;let a,s,r;return Be(t)?ze:(a=t.state,0!==a.wrap&&a.mode!==Ue?ze:a.mode===Ue&&(s=1,s=I(s,e,i,0),s!==a.check)?Se:(r=Ge(t,e,i,i),r?(a.mode=16210,Ae):(a.havedict=1,ve)))},inflateInfo:"pako inflate (from Nodeca project)"};var qe=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 $e=Object.prototype.toString,{Z_NO_FLUSH:Qe,Z_FINISH:ti,Z_OK:ei,Z_STREAM_END:ii,Z_NEED_DICT:ai,Z_STREAM_ERROR:si,Z_DATA_ERROR:ri,Z_MEM_ERROR:ni,Z_BUF_ERROR:oi}=H,di={chunkSize:65536,windowBits:15,to:""};function li(t){this.options=Ht({},di,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 Wt,this.strm.avail_out=0;let i=We.inflateInit2(this.strm,e.windowBits);if(i!==ei)throw new Error(P[i]);if(this.header=new qe,We.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Yt(e.dictionary):"[object ArrayBuffer]"===$e.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=We.inflateSetDictionary(this.strm,e.dictionary),i!==ei)))throw new Error(P[i])}li.prototype.push=function(t,e){const i=this.strm,a=this.options.chunkSize,s=this.options.dictionary;let r,n,o;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ti:Qe,"[object ArrayBuffer]"===$e.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),r=We.inflate(i,n),r===ai&&s&&(r=We.inflateSetDictionary(i,s),r===ei?r=We.inflate(i,n):r===ri&&(r=ai));i.avail_in>0&&r===ii&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)We.inflateReset(i),r=We.inflate(i,n);switch(r){case si:case ri:case ai:case ni:return this.onEnd(r),this.ended=!0,!1}if(o=i.avail_out,i.next_out&&(0===i.avail_out||r===ii||n>0))if("string"===this.options.to){let t=Gt(i.output,i.next_out),e=i.next_out-t,s=Jt(i.output,t);i.next_out=e,i.avail_out=a-e,e&&i.output.set(i.output.subarray(t,t+e),0),this.onData(s)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0;if(r!==ei&&r!==oi||0!==o){if(r===ii)return r=We.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===i.avail_in){if(n===ti)return r=We.inflateEnd(this.strm),this.onEnd(r===ei?oi:r),this.ended=!0,!1;break}}}return!0},li.prototype.onData=function(t){this.chunks.push(t)},li.prototype.onEnd=function(t){t===ei&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Vt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var hi={ungzip:function(t,e){const i=new li(e);if(i.push(t,!0),i.err)throw i.msg||P[i.err];return i.result}};const{gzip:ci}=le,{ungzip:wi}=hi;var _i=ci,pi=wi;
2
+ /*!
3
+ * Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
4
+ */
5
+ const ui=new Map,fi=new Map,gi=new Map;function mi({contextsMap:t,metadataMap:e,namedMap:i,metadata:a}){t.set(a.id,a.context),e.set(a.id,a),i.set(a.shortName,a)}mi({contextsMap:ui,metadataMap:fi,namedMap:gi,metadata:{id:"https://www.w3.org/ns/credentials/undefined-terms/v2",type:"ContextMetadata",shortName:"undefined-terms-v2",url:new URL("../contexts/undefined-terms-v2.jsonld",import.meta.url),context:{"@context":{"@vocab":"https://www.w3.org/ns/credentials/undefined-term#"}}}}),mi({contextsMap:ui,metadataMap:fi,namedMap:gi,metadata:{id:"https://www.w3.org/2018/credentials/v1",type:"ContextMetadata",shortName:"v1",url:new URL("../contexts/v1.jsonld",import.meta.url),context:{"@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",VerifiableCredential:{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",credentialSchema:{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",JsonSchemaValidator2018:"cred:JsonSchemaValidator2018"}},credentialStatus:{"@id":"cred:credentialStatus","@type":"@id"},credentialSubject:{"@id":"cred:credentialSubject","@type":"@id"},evidence:{"@id":"cred:evidence","@type":"@id"},expirationDate:{"@id":"cred:expirationDate","@type":"xsd:dateTime"},holder:{"@id":"cred:holder","@type":"@id"},issued:{"@id":"cred:issued","@type":"xsd:dateTime"},issuer:{"@id":"cred:issuer","@type":"@id"},issuanceDate:{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},refreshService:{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",ManualRefreshService2018:"cred:ManualRefreshService2018"}},termsOfUse:{"@id":"cred:termsOfUse","@type":"@id"},validFrom:{"@id":"cred:validFrom","@type":"xsd:dateTime"},validUntil:{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},VerifiablePresentation:{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",holder:{"@id":"cred:holder","@type":"@id"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},verifiableCredential:{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},EcdsaSecp256k1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},EcdsaSecp256r1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},Ed25519Signature2018:{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},RsaSignature2018:{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,"@protected":!0,challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":!0,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}}}}),mi({contextsMap:ui,metadataMap:fi,namedMap:gi,metadata:{id:"https://www.w3.org/ns/credentials/v2",type:"ContextMetadata",shortName:"v2",url:new URL("../contexts/v2.jsonld",import.meta.url),context:{"@context":{"@protected":!0,id:"@id",type:"@type",description:"https://schema.org/description",digestMultibase:{"@id":"https://w3id.org/security#digestMultibase","@type":"https://w3id.org/security#multibase"},digestSRI:{"@id":"https://www.w3.org/2018/credentials#digestSRI","@type":"https://www.w3.org/2018/credentials#sriString"},mediaType:{"@id":"https://schema.org/encodingFormat"},name:"https://schema.org/name",VerifiableCredential:{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@protected":!0,id:"@id",type:"@type",confidenceMethod:{"@id":"https://www.w3.org/2018/credentials#confidenceMethod","@type":"@id"},credentialSchema:{"@id":"https://www.w3.org/2018/credentials#credentialSchema","@type":"@id"},credentialStatus:{"@id":"https://www.w3.org/2018/credentials#credentialStatus","@type":"@id"},credentialSubject:{"@id":"https://www.w3.org/2018/credentials#credentialSubject","@type":"@id"},description:"https://schema.org/description",evidence:{"@id":"https://www.w3.org/2018/credentials#evidence","@type":"@id"},issuer:{"@id":"https://www.w3.org/2018/credentials#issuer","@type":"@id"},name:"https://schema.org/name",proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},refreshService:{"@id":"https://www.w3.org/2018/credentials#refreshService","@type":"@id"},relatedResource:{"@id":"https://www.w3.org/2018/credentials#relatedResource","@type":"@id"},renderMethod:{"@id":"https://www.w3.org/2018/credentials#renderMethod","@type":"@id"},termsOfUse:{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},validFrom:{"@id":"https://www.w3.org/2018/credentials#validFrom","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},validUntil:{"@id":"https://www.w3.org/2018/credentials#validUntil","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}},EnvelopedVerifiableCredential:"https://www.w3.org/2018/credentials#EnvelopedVerifiableCredential",VerifiablePresentation:{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@protected":!0,id:"@id",type:"@type",holder:{"@id":"https://www.w3.org/2018/credentials#holder","@type":"@id"},proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},termsOfUse:{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},verifiableCredential:{"@id":"https://www.w3.org/2018/credentials#verifiableCredential","@type":"@id","@container":"@graph","@context":null}}},EnvelopedVerifiablePresentation:"https://www.w3.org/2018/credentials#EnvelopedVerifiablePresentation",JsonSchemaCredential:"https://www.w3.org/2018/credentials#JsonSchemaCredential",JsonSchema:{"@id":"https://www.w3.org/2018/credentials#JsonSchema","@context":{"@protected":!0,id:"@id",type:"@type",jsonSchema:{"@id":"https://www.w3.org/2018/credentials#jsonSchema","@type":"@json"}}},BitstringStatusListCredential:"https://www.w3.org/ns/credentials/status#BitstringStatusListCredential",BitstringStatusList:{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusList","@context":{"@protected":!0,id:"@id",type:"@type",encodedList:{"@id":"https://www.w3.org/ns/credentials/status#encodedList","@type":"https://w3id.org/security#multibase"},statusPurpose:"https://www.w3.org/ns/credentials/status#statusPurpose",ttl:"https://www.w3.org/ns/credentials/status#ttl"}},BitstringStatusListEntry:{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusListEntry","@context":{"@protected":!0,id:"@id",type:"@type",statusListCredential:{"@id":"https://www.w3.org/ns/credentials/status#statusListCredential","@type":"@id"},statusListIndex:"https://www.w3.org/ns/credentials/status#statusListIndex",statusPurpose:"https://www.w3.org/ns/credentials/status#statusPurpose",statusMessage:{"@id":"https://www.w3.org/ns/credentials/status#statusMessage","@context":{"@protected":!0,id:"@id",type:"@type",message:"https://www.w3.org/ns/credentials/status#message",status:"https://www.w3.org/ns/credentials/status#status"}},statusReference:{"@id":"https://www.w3.org/ns/credentials/status#statusReference","@type":"@id"},statusSize:{"@id":"https://www.w3.org/ns/credentials/status#statusSize","@type":"https://www.w3.org/2001/XMLSchema#integer"}}},DataIntegrityProof:{"@id":"https://w3id.org/security#DataIntegrityProof","@context":{"@protected":!0,id:"@id",type:"@type",challenge:"https://w3id.org/security#challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},cryptosuite:{"@id":"https://w3id.org/security#cryptosuite","@type":"https://w3id.org/security#cryptosuiteString"},domain:"https://w3id.org/security#domain",expires:{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},nonce:"https://w3id.org/security#nonce",previousProof:{"@id":"https://w3id.org/security#previousProof","@type":"@id"},proofPurpose:{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":!0,id:"@id",type:"@type",assertionMethod:{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},capabilityDelegation:{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},keyAgreement:{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},proofValue:{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},verificationMethod:{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}},"...":{"@id":"https://www.iana.org/assignments/jwt#..."},_sd:{"@id":"https://www.iana.org/assignments/jwt#_sd","@type":"@json"},_sd_alg:{"@id":"https://www.iana.org/assignments/jwt#_sd_alg"},aud:{"@id":"https://www.iana.org/assignments/jwt#aud","@type":"@id"},cnf:{"@id":"https://www.iana.org/assignments/jwt#cnf","@context":{"@protected":!0,kid:{"@id":"https://www.iana.org/assignments/jwt#kid","@type":"@id"},jwk:{"@id":"https://www.iana.org/assignments/jwt#jwk","@type":"@json"}}},exp:{"@id":"https://www.iana.org/assignments/jwt#exp","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},iat:{"@id":"https://www.iana.org/assignments/jwt#iat","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},iss:{"@id":"https://www.iana.org/assignments/jose#iss","@type":"@id"},jku:{"@id":"https://www.iana.org/assignments/jose#jku","@type":"@id"},kid:{"@id":"https://www.iana.org/assignments/jose#kid","@type":"@id"},nbf:{"@id":"https://www.iana.org/assignments/jwt#nbf","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},sub:{"@id":"https://www.iana.org/assignments/jose#sub","@type":"@id"},x5u:{"@id":"https://www.iana.org/assignments/jose#x5u","@type":"@id"}}}}}),
6
+ /*!
7
+ * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
8
+ */
9
+ gi.get("v1").id,gi.get("v2").id;
10
+ /*!
11
+ * Copyright (c) 2019-2024 Digital Bazaar, Inc. All rights reserved.
12
+ */
13
+ const bi=new Map([...ui]);
14
+ /*!
15
+ * Copyright (c) 2019-2023 Digital Bazaar, Inc. All rights reserved.
16
+ */
17
+ /*!
18
+ * Copyright (c) 2019-2023 Digital Bazaar, Inc. All rights reserved.
19
+ */
20
+ const{purposes:{AssertionProofPurpose:yi}}=t,{AssertionProofPurpose:vi,AuthenticationProofPurpose:ki}=t.purposes;
21
+ /**
22
+ * A JavaScript implementation of Verifiable Credentials.
23
+ *
24
+ * @author Dave Longley
25
+ * @author David I. Lehn
26
+ *
27
+ * @license BSD 3-Clause License
28
+ * Copyright (c) 2017-2025 Digital Bazaar, Inc.
29
+ * All rights reserved.
30
+ *
31
+ * Redistribution and use in source and binary forms, with or without
32
+ * modification, are permitted provided that the following conditions are met:
33
+ *
34
+ * Redistributions of source code must retain the above copyright notice,
35
+ * this list of conditions and the following disclaimer.
36
+ *
37
+ * Redistributions in binary form must reproduce the above copyright
38
+ * notice, this list of conditions and the following disclaimer in the
39
+ * documentation and/or other materials provided with the distribution.
40
+ *
41
+ * Neither the name of the Digital Bazaar, Inc. nor the names of its
42
+ * contributors may be used to endorse or promote products derived from
43
+ * this software without specific prior written permission.
44
+ *
45
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
46
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
47
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
48
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
51
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
52
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
53
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
54
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
55
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56
+ */t.extendContextLoader(async function(t){const e=bi.get(t);if(void 0!==e)return{contextUrl:null,documentUrl:t,document:e};throw new Error(`Document loader unable to load URL "${t}".`)});export{_i as g,pi as u};
@@ -1,5 +1,5 @@
1
- import{t as e,u as t,s as r,f as n}from"./main.js";import{_ as i}from"./_polyfill-node.crypto-DGISCHrB-C5-OOGc0.js";
2
- /*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const o=BigInt(0),s=BigInt(1),c=BigInt(2),a=BigInt(8),f=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),u=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:f,n:f,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),l=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),y=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742");const d=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),w=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),p=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),h=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class b{constructor(e,t,r,n){this.x=e,this.y=t,this.z=r,this.t=n}static fromAffine(e){if(!(e instanceof k))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(k.ZERO)?b.ZERO:new b(e.x,e.y,s,j(e.x*e.y))}static toAffineBatch(e){const t=function(e,t=u.P){const r=new Array(e.length),n=_(e.reduce((e,n,i)=>n===o?e:(r[i]=e,j(e*n,t)),s),t);return e.reduceRight((e,n,i)=>n===o?e:(r[i]=j(e*r[i],t),j(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){x(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e,c=j(t*s),a=j(i*n),f=j(r*s),u=j(o*n);return c===a&&f===u}negate(){return new b(j(-this.x),this.y,this.z,j(-this.t))}double(){const{x:e,y:t,z:r}=this,{a:n}=u,i=j(e*e),o=j(t*t),s=j(c*j(r*r)),a=j(n*i),f=e+t,l=j(j(f*f)-i-o),y=a+o,d=y-s,w=a-o,p=j(l*d),h=j(y*w),g=j(l*w),x=j(d*y);return new b(p,h,x,g)}add(e){x(e);const{x:t,y:r,z:n,t:i}=this,{x:s,y:a,z:f,t:u}=e,l=j((r-t)*(a+s)),y=j((r+t)*(a-s)),d=j(y-l);if(d===o)return this.double();const w=j(n*c*u),p=j(i*c*f),h=p+w,g=y+l,m=p-w,E=j(h*d),K=j(g*m),B=j(h*m),k=j(d*g);return new b(E,K,k,B)}subtract(e){return this.add(e.negate())}precomputeWindow(e){const t=1+256/e,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(b.BASE)&&(t=k.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&B.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=b.normalizeZ(n),B.set(t,n)));let i=b.ZERO,o=b.BASE;const c=1+256/r,a=2**(r-1),f=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let t=0;t<c;t++){const r=t*a;let c=Number(e&f);e>>=l,c>a&&(c-=u,e+=s);const y=r,d=r+Math.abs(c)-1,w=t%2!=0,p=c<0;0===c?o=o.add(g(w,n[y])):i=i.add(g(p,n[d]))}return b.normalizeZ([i,o])[0]}multiply(e,t){return this.wNAF(V(e,u.l),t)}multiplyUnsafe(e){let t=V(e,u.l,!1);const r=b.BASE,n=b.ZERO;if(t===o)return n;if(this.equals(n)||t===s)return this;if(this.equals(r))return this.wNAF(t);let i=n,c=this;for(;t>o;)t&s&&(i=i.add(c)),c=c.double(),t>>=s;return i}isSmallOrder(){return this.multiplyUnsafe(u.h).equals(b.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(u.l/c).double();return u.l%c&&(e=e.add(this)),e.equals(b.ZERO)}toAffine(e){const{x:t,y:r,z:n}=this,i=this.equals(b.ZERO);null==e&&(e=i?a:_(n));const o=j(t*e),c=j(r*e),f=j(n*e);if(i)return k.ZERO;if(f!==s)throw new Error("invZ was invalid");return new k(o,c)}fromRistrettoBytes(){E()}toRistrettoBytes(){E()}fromRistrettoHash(){E()}}function g(e,t){const r=t.negate();return e?r:t}function x(e){if(!(e instanceof b))throw new TypeError("ExtendedPoint expected")}function m(e){if(!(e instanceof K))throw new TypeError("RistrettoPoint expected")}function E(){throw new Error("Legacy method: switch to RistrettoPoint")}b.BASE=new b(u.Gx,u.Gy,s,j(u.Gx*u.Gy)),b.ZERO=new b(o,s,s,o);class K{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){const{d:t}=u,r=j(y*e*e),n=j((r+s)*p);let i=BigInt(-1);const o=j((i-t*r)*j(r+t));let{isValid:c,value:a}=H(n,o),f=j(a*e);S(f)||(f=j(-f)),c||(a=f),c||(i=r);const l=j(i*(r-s)*h-o),w=a*a,g=j((a+a)*o),x=j(l*d),m=j(s-w),E=j(s+w);return new b(j(g*E),j(m*x),j(x*E),j(g*m))}static hashToCurve(e){const t=O((e=N(e,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(t),n=O(e.slice(32,64)),i=this.calcElligatorRistrettoMap(n);return new K(r.add(i))}static fromHex(e){e=N(e,32);const{a:t,d:r}=u,n="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",i=O(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(U(i),e)||S(i))throw new Error(n);const c=j(i*i),a=j(s+t*c),f=j(s-t*c),l=j(a*a),y=j(f*f),d=j(t*r*l-y),{isValid:w,value:p}=q(j(d*y)),h=j(p*f),g=j(p*h*d);let x=j((i+i)*h);S(x)&&(x=j(-x));const m=j(a*g),E=j(x*m);if(!w||S(E)||m===o)throw new Error(n);return new K(new b(x,m,s,E))}toRawBytes(){let{x:e,y:t,z:r,t:n}=this.ep;const i=j(j(r+t)*j(r-t)),o=j(e*t),s=j(o*o),{value:c}=q(j(i*s)),a=j(c*i),f=j(c*o),u=j(a*f*n);let l;if(S(n*u)){let r=j(t*y),n=j(e*y);e=r,t=n,l=j(a*w)}else l=f;S(e*u)&&(t=j(-t));let d=j((r-t)*l);return S(d)&&(d=j(-d)),U(d)}toHex(){return M(this.toRawBytes())}toString(){return this.toHex()}equals(e){m(e);const t=this.ep,r=e.ep,n=j(t.x*r.y)===j(t.y*r.x),i=j(t.y*r.y)===j(t.x*r.x);return n||i}add(e){return m(e),new K(this.ep.add(e.ep))}subtract(e){return m(e),new K(this.ep.subtract(e.ep))}multiply(e){return new K(this.ep.multiply(e))}multiplyUnsafe(e){return new K(this.ep.multiplyUnsafe(e))}}K.BASE=new K(b.BASE),K.ZERO=new K(b.ZERO);const B=new WeakMap;class k{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,B.delete(this)}static fromHex(e,t=!0){const{d:r,P:n}=u,i=(e=N(e,32)).slice();i[31]=-129&e[31];const o=T(i);if(t&&o>=n)throw new Error("Expected 0 < hex < P");if(!t&&o>=l)throw new Error("Expected 0 < hex < 2**256");const c=j(o*o),a=j(c-s),f=j(r*c+s);let{isValid:y,value:d}=H(a,f);if(!y)throw new Error("Point.fromHex: invalid y coordinate");const w=(d&s)===s;return!!(128&e[31])!==w&&(d=j(-d)),new k(d,o)}static async fromPrivateKey(e){return(await F(e)).point}toRawBytes(){const e=U(this.y);return e[31]|=this.x&s?128:0,e}toHex(){return M(this.toRawBytes())}toX25519(){const{y:e}=this;return U(j((s+e)*_(s-e)))}isTorsionFree(){return b.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new k(j(-this.x),this.y)}add(e){return b.fromAffine(this).add(b.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return b.fromAffine(this).multiply(e,this).toAffine()}}k.BASE=new k(u.Gx,u.Gy),k.ZERO=new k(o,s);class A{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=N(e,64),r=k.fromHex(t.slice(0,32),!1),n=T(t.slice(32,64));return new A(r,n)}assertValidity(){const{r:e,s:t}=this;if(!(e instanceof k))throw new Error("Expected Point instance");return V(t,u.l,!1),this}toRawBytes(){const e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(U(this.s),32),e}toHex(){return M(this.toRawBytes())}}function v(...e){if(!e.every(e=>e instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const P=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function M(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=P[e[r]];return t}function I(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function R(e){return I(e.toString(16).padStart(64,"0"))}function U(e){return R(e).reverse()}function S(e){return(j(e)&s)===s}function T(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+M(Uint8Array.from(e).reverse()))}const z=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function O(e){return j(T(e)&z)}function j(e,t=u.P){const r=e%t;return r>=o?r:t+r}function _(e,t=u.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=j(e,t),n=t,i=o,c=s;for(;r!==o;){const e=n%r,t=i-c*(n/r);n=r,r=e,i=c,c=t}if(n!==s)throw new Error("invert: does not exist");return j(i,t)}function Z(e,t){const{P:r}=u;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function H(e,t){const r=j(t*t*t),n=function(e){const{P:t}=u,r=BigInt(5),n=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),f=e*e%t*e%t,l=Z(f,c)*f%t,y=Z(l,s)*e%t,d=Z(y,r)*y%t,w=Z(d,n)*d%t,p=Z(w,i)*w%t,h=Z(p,o)*p%t,b=Z(h,a)*h%t,g=Z(b,a)*h%t,x=Z(g,n)*d%t;return{pow_p_5_8:Z(x,c)*e%t,b2:f}}(e*j(r*r*t)).pow_p_5_8;let i=j(e*r*n);const o=j(t*i*i),a=i,f=j(i*y),l=o===e,d=o===j(-e),w=o===j(-e*y);return l&&(i=a),(d||w)&&(i=f),S(i)&&(i=j(-i)),{isValid:l||d,value:i}}function q(e){return H(s,e)}function $(e){return j(T(e),u.l)}function N(e,t){const r=e instanceof Uint8Array?Uint8Array.from(e):I(e);if("number"==typeof t&&r.length!==t)throw new Error(`Expected ${t} bytes`);return r}function V(e,t,r=!0){if(!t)throw new TypeError("Specify max value");if("number"==typeof e&&Number.isSafeInteger(e)&&(e=BigInt(e)),"bigint"==typeof e&&e<t)if(r){if(o<e)return e}else if(o<=e)return e;throw new TypeError("Expected valid scalar: 0 < scalar < max")}let W;async function F(e){return function(e){const t=((r=e.slice(0,32))[0]&=248,r[31]&=127,r[31]|=64,r);var r;const n=e.slice(32,64),i=$(t),o=k.BASE.multiply(i),s=o.toRawBytes();return{head:t,prefix:n,scalar:i,point:o,pointBytes:s}}(await L.sha512(function(e){if(32!==(e="bigint"==typeof e||"number"==typeof e?R(V(e,l)):N(e)).length)throw new Error("Expected 32 bytes");return e}(e)))}async function G(e){return(await F(e)).pointBytes}async function C(e,t){e=N(e);const{prefix:r,scalar:n,pointBytes:i}=await F(t),o=$(await L.sha512(r,e)),s=k.BASE.multiply(o),c=j(o+$(await L.sha512(s.toRawBytes(),i,e))*n,u.l);return new A(s,c).toRawBytes()}async function J(e,t,r){const{r:n,SB:i,msg:o,pub:s}=function(e,t,r){t=N(t),r instanceof k||(r=k.fromHex(r,!1));const{r:n,s:i}=e instanceof A?e.assertValidity():A.fromHex(e);return{r:n,s:i,SB:b.BASE.multiplyUnsafe(i),pub:r,msg:t}}(e,t,r),c=await L.sha512(n.toRawBytes(),s.toRawBytes(),o);return function(e,t,r,n){const i=$(n),o=b.fromAffine(e).multiplyUnsafe(i);return b.fromAffine(t).add(o).subtract(r).multiplyUnsafe(u.h).equals(b.ZERO)}(s,n,i,c)}k.BASE._setWindowSize(8);const D={node:i,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},L={bytesToHex:M,hexToBytes:I,concatBytes:v,getExtendedPublicKey:F,mod:j,invert:_,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:e=>{if((e=N(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return j(T(e),u.l-s)+s},randomBytes:(e=32)=>{if(D.web)return D.web.getRandomValues(new Uint8Array(e));if(D.node){const{randomBytes:t}=D.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>L.randomBytes(32),sha512:async(...e)=>{const t=v(...e);if(D.web){const e=await D.web.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}if(D.node)return Uint8Array.from(D.node.createHash("sha512").update(t).digest());throw new Error("The environment doesn't have sha512 function")},precompute(e=8,t=k.BASE){const r=t.equals(k.BASE)?t:new k(t.x,t.y);return r._setWindowSize(e),r.multiply(c),r},sha512Sync:void 0};Object.defineProperties(L,{sha512Sync:{configurable:!1,get:()=>W,set(e){W||(W=e)}}});
1
+ import{u as e,v as t,t as r,f as n}from"./main.js";import{n as i}from"./_polyfill-node.crypto-MVmI5M_M-exGcp6nW.js";
2
+ /*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const o=BigInt(0),s=BigInt(1),c=BigInt(2),a=BigInt(8),f=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),u=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:f,n:f,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),l=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),y=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742");const d=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),w=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),p=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),h=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class b{constructor(e,t,r,n){this.x=e,this.y=t,this.z=r,this.t=n}static fromAffine(e){if(!(e instanceof k))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(k.ZERO)?b.ZERO:new b(e.x,e.y,s,j(e.x*e.y))}static toAffineBatch(e){const t=function(e,t=u.P){const r=new Array(e.length),n=_(e.reduce((e,n,i)=>n===o?e:(r[i]=e,j(e*n,t)),s),t);return e.reduceRight((e,n,i)=>n===o?e:(r[i]=j(e*r[i],t),j(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){m(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e,c=j(t*s),a=j(i*n),f=j(r*s),u=j(o*n);return c===a&&f===u}negate(){return new b(j(-this.x),this.y,this.z,j(-this.t))}double(){const{x:e,y:t,z:r}=this,{a:n}=u,i=j(e*e),o=j(t*t),s=j(c*j(r*r)),a=j(n*i),f=e+t,l=j(j(f*f)-i-o),y=a+o,d=y-s,w=a-o,p=j(l*d),h=j(y*w),g=j(l*w),m=j(d*y);return new b(p,h,m,g)}add(e){m(e);const{x:t,y:r,z:n,t:i}=this,{x:s,y:a,z:f,t:u}=e,l=j((r-t)*(a+s)),y=j((r+t)*(a-s)),d=j(y-l);if(d===o)return this.double();const w=j(n*c*u),p=j(i*c*f),h=p+w,g=y+l,x=p-w,E=j(h*d),K=j(g*x),B=j(h*x),k=j(d*g);return new b(E,K,k,B)}subtract(e){return this.add(e.negate())}precomputeWindow(e){const t=1+256/e,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(b.BASE)&&(t=k.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&B.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=b.normalizeZ(n),B.set(t,n)));let i=b.ZERO,o=b.BASE;const c=1+256/r,a=2**(r-1),f=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let t=0;t<c;t++){const r=t*a;let c=Number(e&f);e>>=l,c>a&&(c-=u,e+=s);const y=r,d=r+Math.abs(c)-1,w=t%2!=0,p=c<0;0===c?o=o.add(g(w,n[y])):i=i.add(g(p,n[d]))}return b.normalizeZ([i,o])[0]}multiply(e,t){return this.wNAF(N(e,u.l),t)}multiplyUnsafe(e){let t=N(e,u.l,!1);const r=b.BASE,n=b.ZERO;if(t===o)return n;if(this.equals(n)||t===s)return this;if(this.equals(r))return this.wNAF(t);let i=n,c=this;for(;t>o;)t&s&&(i=i.add(c)),c=c.double(),t>>=s;return i}isSmallOrder(){return this.multiplyUnsafe(u.h).equals(b.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(u.l/c).double();return u.l%c&&(e=e.add(this)),e.equals(b.ZERO)}toAffine(e){const{x:t,y:r,z:n}=this,i=this.equals(b.ZERO);null==e&&(e=i?a:_(n));const o=j(t*e),c=j(r*e),f=j(n*e);if(i)return k.ZERO;if(f!==s)throw new Error("invZ was invalid");return new k(o,c)}fromRistrettoBytes(){E()}toRistrettoBytes(){E()}fromRistrettoHash(){E()}}function g(e,t){const r=t.negate();return e?r:t}function m(e){if(!(e instanceof b))throw new TypeError("ExtendedPoint expected")}function x(e){if(!(e instanceof K))throw new TypeError("RistrettoPoint expected")}function E(){throw new Error("Legacy method: switch to RistrettoPoint")}b.BASE=new b(u.Gx,u.Gy,s,j(u.Gx*u.Gy)),b.ZERO=new b(o,s,s,o);class K{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){const{d:t}=u,r=j(y*e*e),n=j((r+s)*p);let i=BigInt(-1);const o=j((i-t*r)*j(r+t));let{isValid:c,value:a}=H(n,o),f=j(a*e);S(f)||(f=j(-f)),c||(a=f),c||(i=r);const l=j(i*(r-s)*h-o),w=a*a,g=j((a+a)*o),m=j(l*d),x=j(s-w),E=j(s+w);return new b(j(g*E),j(x*m),j(m*E),j(g*x))}static hashToCurve(e){const t=O((e=V(e,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(t),n=O(e.slice(32,64)),i=this.calcElligatorRistrettoMap(n);return new K(r.add(i))}static fromHex(e){e=V(e,32);const{a:t,d:r}=u,n="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",i=O(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(U(i),e)||S(i))throw new Error(n);const c=j(i*i),a=j(s+t*c),f=j(s-t*c),l=j(a*a),y=j(f*f),d=j(t*r*l-y),{isValid:w,value:p}=q(j(d*y)),h=j(p*f),g=j(p*h*d);let m=j((i+i)*h);S(m)&&(m=j(-m));const x=j(a*g),E=j(m*x);if(!w||S(E)||x===o)throw new Error(n);return new K(new b(m,x,s,E))}toRawBytes(){let{x:e,y:t,z:r,t:n}=this.ep;const i=j(j(r+t)*j(r-t)),o=j(e*t),s=j(o*o),{value:c}=q(j(i*s)),a=j(c*i),f=j(c*o),u=j(a*f*n);let l;if(S(n*u)){let r=j(t*y),n=j(e*y);e=r,t=n,l=j(a*w)}else l=f;S(e*u)&&(t=j(-t));let d=j((r-t)*l);return S(d)&&(d=j(-d)),U(d)}toHex(){return P(this.toRawBytes())}toString(){return this.toHex()}equals(e){x(e);const t=this.ep,r=e.ep,n=j(t.x*r.y)===j(t.y*r.x),i=j(t.y*r.y)===j(t.x*r.x);return n||i}add(e){return x(e),new K(this.ep.add(e.ep))}subtract(e){return x(e),new K(this.ep.subtract(e.ep))}multiply(e){return new K(this.ep.multiply(e))}multiplyUnsafe(e){return new K(this.ep.multiplyUnsafe(e))}}K.BASE=new K(b.BASE),K.ZERO=new K(b.ZERO);const B=new WeakMap;class k{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,B.delete(this)}static fromHex(e,t=!0){const{d:r,P:n}=u,i=(e=V(e,32)).slice();i[31]=-129&e[31];const o=T(i);if(t&&o>=n)throw new Error("Expected 0 < hex < P");if(!t&&o>=l)throw new Error("Expected 0 < hex < 2**256");const c=j(o*o),a=j(c-s),f=j(r*c+s);let{isValid:y,value:d}=H(a,f);if(!y)throw new Error("Point.fromHex: invalid y coordinate");const w=(d&s)===s;return!!(128&e[31])!==w&&(d=j(-d)),new k(d,o)}static async fromPrivateKey(e){return(await F(e)).point}toRawBytes(){const e=U(this.y);return e[31]|=this.x&s?128:0,e}toHex(){return P(this.toRawBytes())}toX25519(){const{y:e}=this;return U(j((s+e)*_(s-e)))}isTorsionFree(){return b.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new k(j(-this.x),this.y)}add(e){return b.fromAffine(this).add(b.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return b.fromAffine(this).multiply(e,this).toAffine()}}k.BASE=new k(u.Gx,u.Gy),k.ZERO=new k(o,s);class A{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=V(e,64),r=k.fromHex(t.slice(0,32),!1),n=T(t.slice(32,64));return new A(r,n)}assertValidity(){const{r:e,s:t}=this;if(!(e instanceof k))throw new Error("Expected Point instance");return N(t,u.l,!1),this}toRawBytes(){const e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(U(this.s),32),e}toHex(){return P(this.toRawBytes())}}function v(...e){if(!e.every(e=>e instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const M=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function P(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=M[e[r]];return t}function I(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function R(e){return I(e.toString(16).padStart(64,"0"))}function U(e){return R(e).reverse()}function S(e){return(j(e)&s)===s}function T(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+P(Uint8Array.from(e).reverse()))}const z=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function O(e){return j(T(e)&z)}function j(e,t=u.P){const r=e%t;return r>=o?r:t+r}function _(e,t=u.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=j(e,t),n=t,i=o,c=s;for(;r!==o;){const e=n%r,t=i-c*(n/r);n=r,r=e,i=c,c=t}if(n!==s)throw new Error("invert: does not exist");return j(i,t)}function Z(e,t){const{P:r}=u;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function H(e,t){const r=j(t*t*t),n=function(e){const{P:t}=u,r=BigInt(5),n=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),f=e*e%t*e%t,l=Z(f,c)*f%t,y=Z(l,s)*e%t,d=Z(y,r)*y%t,w=Z(d,n)*d%t,p=Z(w,i)*w%t,h=Z(p,o)*p%t,b=Z(h,a)*h%t,g=Z(b,a)*h%t,m=Z(g,n)*d%t;return{pow_p_5_8:Z(m,c)*e%t,b2:f}}(e*j(r*r*t)).pow_p_5_8;let i=j(e*r*n);const o=j(t*i*i),a=i,f=j(i*y),l=o===e,d=o===j(-e),w=o===j(-e*y);return l&&(i=a),(d||w)&&(i=f),S(i)&&(i=j(-i)),{isValid:l||d,value:i}}function q(e){return H(s,e)}function $(e){return j(T(e),u.l)}function V(e,t){const r=e instanceof Uint8Array?Uint8Array.from(e):I(e);if("number"==typeof t&&r.length!==t)throw new Error(`Expected ${t} bytes`);return r}function N(e,t,r=!0){if(!t)throw new TypeError("Specify max value");if("number"==typeof e&&Number.isSafeInteger(e)&&(e=BigInt(e)),"bigint"==typeof e&&e<t)if(r){if(o<e)return e}else if(o<=e)return e;throw new TypeError("Expected valid scalar: 0 < scalar < max")}let W;async function F(e){return function(e){const t=((r=e.slice(0,32))[0]&=248,r[31]&=127,r[31]|=64,r);var r;const n=e.slice(32,64),i=$(t),o=k.BASE.multiply(i),s=o.toRawBytes();return{head:t,prefix:n,scalar:i,point:o,pointBytes:s}}(await L.sha512(function(e){if(32!==(e="bigint"==typeof e||"number"==typeof e?R(N(e,l)):V(e)).length)throw new Error("Expected 32 bytes");return e}(e)))}async function G(e){return(await F(e)).pointBytes}async function J(e,t){e=V(e);const{prefix:r,scalar:n,pointBytes:i}=await F(t),o=$(await L.sha512(r,e)),s=k.BASE.multiply(o),c=j(o+$(await L.sha512(s.toRawBytes(),i,e))*n,u.l);return new A(s,c).toRawBytes()}async function C(e,t,r){const{r:n,SB:i,msg:o,pub:s}=function(e,t,r){t=V(t),r instanceof k||(r=k.fromHex(r,!1));const{r:n,s:i}=e instanceof A?e.assertValidity():A.fromHex(e);return{r:n,s:i,SB:b.BASE.multiplyUnsafe(i),pub:r,msg:t}}(e,t,r),c=await L.sha512(n.toRawBytes(),s.toRawBytes(),o);return function(e,t,r,n){const i=$(n),o=b.fromAffine(e).multiplyUnsafe(i);return b.fromAffine(t).add(o).subtract(r).multiplyUnsafe(u.h).equals(b.ZERO)}(s,n,i,c)}k.BASE._setWindowSize(8);const D={node:i,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},L={bytesToHex:P,hexToBytes:I,concatBytes:v,getExtendedPublicKey:F,mod:j,invert:_,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:e=>{if((e=V(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return j(T(e),u.l-s)+s},randomBytes:(e=32)=>{if(D.web)return D.web.getRandomValues(new Uint8Array(e));if(D.node){const{randomBytes:t}=D.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>L.randomBytes(32),sha512:async(...e)=>{const t=v(...e);if(D.web){const e=await D.web.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}if(D.node)return Uint8Array.from(D.node.createHash("sha512").update(t).digest());throw new Error("The environment doesn't have sha512 function")},precompute(e=8,t=k.BASE){const r=t.equals(k.BASE)?t:new k(t.x,t.y);return r._setWindowSize(e),r.multiply(c),r},sha512Sync:void 0};Object.defineProperties(L,{sha512Sync:{configurable:!1,get:()=>W,set(e){W||(W=e)}}});
3
3
  /*!
4
4
  * Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
5
5
  */
@@ -11,7 +11,7 @@ function({bytes:e,expectedLength:t=32,code:r}){if(!(e instanceof Uint8Array))thr
11
11
  /*!
12
12
  * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved.
13
13
  */
14
- const Y="Ed25519";function ee({id:e,secretKey:t}){if(!t)throw new Error("A secret key is not available for signing.");return{algorithm:Y,id:e,sign:async({data:e})=>async function(e,t){return C(t,e.slice(0,32))}(t,e)}}function te({id:e,publicKey:t}){if(!t)throw new Error("A public key is not available for verifying.");return{algorithm:Y,id:e,verify:async({data:e,signature:r})=>async function(e,t,r){return J(r,t,e)}(t,e,r)}}
14
+ const Y="Ed25519";function ee({id:e,secretKey:t}){if(!t)throw new Error("A secret key is not available for signing.");return{algorithm:Y,id:e,sign:async({data:e})=>async function(e,t){return J(t,e.slice(0,32))}(t,e)}}function te({id:e,publicKey:t}){if(!t)throw new Error("A public key is not available for verifying.");return{algorithm:Y,id:e,verify:async({data:e,signature:r})=>async function(e,t,r){return C(r,t,e)}(t,e,r)}}
15
15
  /*!
16
16
  * Copyright (c) 2022-2024 Digital Bazaar, Inc. All rights reserved.
17
17
  */const re=new Uint8Array([237,1]),ne=new Uint8Array([128,38]),ie="https://w3id.org/security/multikey/v1",oe=32,se=32;
@@ -30,4 +30,4 @@ function ce({keyPair:e}){const t={};return e.publicKey&&(t.publicKeyMultibase=ae
30
30
  */}]]);async function we({keyPair:e}){const t=de.get(e.type);if(!t)throw new Error(`Unsupported key type "${e.type}".`);const{contextUrl:r,translationFn:n}=t;if(e["@context"]||(e["@context"]=r),!function({document:e,contextUrl:t}){const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)}
31
31
  /*!
32
32
  * Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
33
- */({document:e,contextUrl:r}))throw new Error(`Context not supported "${e["@context"]}".`);return n({keyPair:e})}async function pe(e){let t={...e};if("Multikey"!==t.type){if(t.publicKeyJwk){let e,r;return"JsonWebKey"!==t.type&&"JsonWebKey2020"!==t.type||({id:e,controller:r}=t),he({jwk:t.publicKeyJwk,secretKey:!1,id:e,controller:r})}if(t.type)return t=await we({keyPair:t}),be({keyPair:t})}return t.type||(t.type="Multikey"),t["@context"]||(t["@context"]=ie),function(e){if(!e||"object"!=typeof e)throw new TypeError('"key" must be an object.');if("Multikey"!==e.type)throw new Error('"key" must be a Multikey with type "Multikey".');if(!(e["@context"]===ie||Array.isArray(e["@context"])&&e["@context"].includes(ie)))throw new TypeError(`"key" must be a Multikey with context "${ie}".`)}(t),be({keyPair:t})}async function he({jwk:e,secretKey:t=!1,id:r,controller:n}={}){const i={"@context":ie,type:"Multikey",publicKeyMultibase:le({jwk:e})};return"string"==typeof r&&(i.id=r),"string"==typeof n&&(i.controller=n),t&&e.d&&(i.secretKeyMultibase=ye({jwk:e})),pe(i)}async function be({keyPair:e}){return e.publicKey||(e=await ue(e)),e={...e,async export({publicKey:t=!0,secretKey:r=!1,includeContext:n=!0,raw:i=!1,canonicalize:o=!1}={}){if(i){const{publicKey:t,secretKey:r}=e,n={};return t&&(n.publicKey=t.slice()),r&&(o&&r.length>se?n.secretKey=r.subarray(0,se).slice():n.secretKey=r),n}return fe({keyPair:e,publicKey:t,secretKey:r,includeContext:n,canonicalize:o})},signer(){const{id:t,secretKey:r}=e;return ee({id:t,secretKey:r})},verifier(){const{id:t,publicKey:r}=e;return te({id:t,publicKey:r})}}}var ge=Object.freeze({__proto__:null,from:pe,fromJwk:he,generate:async function({id:e,controller:t,seed:r}={}){let n;n=r?await Q(r):await async function(){const e=new Uint8Array(32);X.getRandomValues(e);const t=await Q(e);return e.fill(0),t}();const{publicKeyMultibase:i,secretKeyMultibase:o}=ce({keyPair:n});return t&&!e&&(e=`${t}#${i}`),be({keyPair:{id:e,controller:t,publicKeyMultibase:i,secretKeyMultibase:o,...n}})},toJwk:async function({keyPair:t,secretKey:r=!1}={}){const n={kty:"OKP",crv:"Ed25519",x:e(t.publicKey)};return r&&!!t.secretKey&&(n.d=e(t.secretKey)),n}});export{pe as f,G as g,ge as i,C as s,J as v};
33
+ */({document:e,contextUrl:r}))throw new Error(`Context not supported "${e["@context"]}".`);return n({keyPair:e})}async function pe(e){let t={...e};if("Multikey"!==t.type){if(t.publicKeyJwk){let e,r;return"JsonWebKey"!==t.type&&"JsonWebKey2020"!==t.type||({id:e,controller:r}=t),he({jwk:t.publicKeyJwk,secretKey:!1,id:e,controller:r})}if(t.type)return t=await we({keyPair:t}),be({keyPair:t})}return t.type||(t.type="Multikey"),t["@context"]||(t["@context"]=ie),function(e){if(!e||"object"!=typeof e)throw new TypeError('"key" must be an object.');if("Multikey"!==e.type)throw new Error('"key" must be a Multikey with type "Multikey".');if(!(e["@context"]===ie||Array.isArray(e["@context"])&&e["@context"].includes(ie)))throw new TypeError(`"key" must be a Multikey with context "${ie}".`)}(t),be({keyPair:t})}async function he({jwk:e,secretKey:t=!1,id:r,controller:n}={}){const i={"@context":ie,type:"Multikey",publicKeyMultibase:le({jwk:e})};return"string"==typeof r&&(i.id=r),"string"==typeof n&&(i.controller=n),t&&e.d&&(i.secretKeyMultibase=ye({jwk:e})),pe(i)}async function be({keyPair:e}){return e.publicKey||(e=await ue(e)),e={...e,async export({publicKey:t=!0,secretKey:r=!1,includeContext:n=!0,raw:i=!1,canonicalize:o=!1}={}){if(i){const{publicKey:t,secretKey:r}=e,n={};return t&&(n.publicKey=t.slice()),r&&(o&&r.length>se?n.secretKey=r.subarray(0,se).slice():n.secretKey=r),n}return fe({keyPair:e,publicKey:t,secretKey:r,includeContext:n,canonicalize:o})},signer(){const{id:t,secretKey:r}=e;return ee({id:t,secretKey:r})},verifier(){const{id:t,publicKey:r}=e;return te({id:t,publicKey:r})}}}var ge=Object.freeze({__proto__:null,from:pe,fromJwk:he,generate:async function({id:e,controller:t,seed:r}={}){let n;n=r?await Q(r):await async function(){const e=new Uint8Array(32);X.getRandomValues(e);const t=await Q(e);return e.fill(0),t}();const{publicKeyMultibase:i,secretKeyMultibase:o}=ce({keyPair:n});return t&&!e&&(e=`${t}#${i}`),be({keyPair:{id:e,controller:t,publicKeyMultibase:i,secretKeyMultibase:o,...n}})},toJwk:async function({keyPair:t,secretKey:r=!1}={}){const n={kty:"OKP",crv:"Ed25519",x:e(t.publicKey)};return r&&!!t.secretKey&&(n.d=e(t.secretKey)),n}});export{pe as f,G as g,ge as i,J as s,C as v};