From 8aaebe5e35470079befc6d3d5c344f04e091cb5c Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Mon, 18 Nov 2024 09:54:51 +0100 Subject: [PATCH] chore: release 2.1.0-rc.1 --- dist/doip.fetchers.js | 2 +- dist/doip.fetchers.min.js | 2 +- dist/doip.fetchers.minimal.js | 2 +- dist/doip.fetchers.minimal.min.js | 2 +- package.json | 2 +- src/constants.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/doip.fetchers.js b/dist/doip.fetchers.js index f7030fa..0a27b82 100644 --- a/dist/doip.fetchers.js +++ b/dist/doip.fetchers.js @@ -6002,7 +6002,7 @@ var doipFetchers = (function (exports) { * doip.js library version * @constant {string} */ - const version = '2.0.1'; + const version = '2.1.0-rc.1'; /* Copyright 2022 Yarmo Mackenbach diff --git a/dist/doip.fetchers.min.js b/dist/doip.fetchers.min.js index 4281680..c1c66e9 100644 --- a/dist/doip.fetchers.min.js +++ b/dist/doip.fetchers.min.js @@ -1,4 +1,4 @@ -var doipFetchers=function(e){"use strict";var t=Object.freeze({__proto__:null,get activitypub(){return Or},get aspe(){return Vw},get dns(){return $w},get graphql(){return Xw},get http(){return rv},get irc(){return RB},get matrix(){return FB},get openpgp(){return TB},get telegram(){return qB},get xmpp(){return lS}}),r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,o=(s=Object.create(null),e=>{const t=i.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>o(t)===e),u=e=>t=>typeof t===e,{isArray:h}=Array,l=u("undefined");const f=c("ArrayBuffer");const d=u("string"),p=u("function"),g=u("number"),A=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==o(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=c("Date"),b=c("File"),w=c("Blob"),v=c("FileList"),I=c("URLSearchParams");function E(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),h(e))for(n=0,i=e.length;n0;)if(n=r[i],t===n.toLowerCase())return n;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r,_=e=>!l(e)&&e!==C;const k=(S="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>S&&e instanceof S);var S;const Q=c("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),P=c("RegExp"),M=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};E(r,((r,i)=>{let a;!1!==(a=t(r,i,e))&&(n[i]=a||r)})),Object.defineProperties(e,n)},U="abcdefghijklmnopqrstuvwxyz",D="0123456789",R={DIGIT:D,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+D};const F=c("AsyncFunction");var T={isArray:h,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=o(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:d,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:A,isPlainObject:y,isUndefined:l,isDate:m,isFile:b,isBlob:w,isRegExp:P,isFunction:p,isStream:e=>A(e)&&p(e.pipe),isURLSearchParams:I,isTypedArray:k,isFileList:v,forEach:E,merge:function e(){const{caseless:t}=_(this)&&this||{},r={},n=(n,i)=>{const a=t&&B(r,i)||i;y(r[a])&&y(n)?r[a]=e(r[a],n):y(n)?r[a]=e({},n):h(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e(E(t,((t,i)=>{r&&p(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!g(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Q,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:M,freezeMethods:e=>{M(e,((t,r)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];p(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return h(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:B,global:C,isContextDefined:_,ALPHABET:R,generateString:(e=16,t=R.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(A(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=h(e)?[]:{};return E(e,((e,t)=>{const a=r(e,n+1);!l(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:F,isThenable:e=>e&&(A(e)||p(e))&&p(e.then)&&p(e.catch)},q=[],O=[],K="undefined"!=typeof Uint8Array?Uint8Array:Array,H=!1;function N(){H=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)q[t]=e[t],O[e.charCodeAt(t)]=t;O["-".charCodeAt(0)]=62,O["_".charCodeAt(0)]=63}function L(e,t,r){for(var n,i,a=[],o=t;o>18&63]+q[i>>12&63]+q[i>>6&63]+q[63&i]);return a.join("")}function G(e){var t;H||N();for(var r=e.length,n=r%3,i="",a=[],o=16383,s=0,c=r-n;sc?c:s+o));return 1===n?(t=e[r-1],i+=q[t>>2],i+=q[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=q[t>>10],i+=q[t>>4&63],i+=q[t<<2&63],i+="="),a.push(i),a.join("")}function j(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=e[t+l];for(l+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+l],l+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+l],l+=f,h-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)}function z(e,t,r,n,i,a){var o,s,c,u=8*a-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=h?(s=0,o=h):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*g}var W={}.toString,Z=Array.isArray||function(e){return"[object Array]"==W.call(e)};$.TYPED_ARRAY_SUPPORT=void 0===r.TYPED_ARRAY_SUPPORT||r.TYPED_ARRAY_SUPPORT;var J=V();function V(){return $.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Y(e,t){if(V()=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return 0|e}function ie(e){return!(null==e||!e._isBuffer)}function ae(e,t){if(ie(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Me(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ue(e).length;default:if(n)return Me(e).length;t=(""+t).toLowerCase(),n=!0}}function oe(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return ve(this,t,r);case"utf8":case"utf-8":return ye(this,t,r);case"ascii":return be(this,t,r);case"latin1":case"binary":return we(this,t,r);case"base64":return Ae(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function se(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function ce(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=$.from(t,n)),ie(t))return 0===t.length?-1:ue(e,t,r,n,i);if("number"==typeof t)return t&=255,$.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ue(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ue(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){for(var l=!0,f=0;fi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function Ae(e,t,r){return 0===t&&r===e.length?G(e):G(e.slice(t,r))}function ye(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(h=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(h=c)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(e){var t=e.length;if(t<=me)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},$.prototype.compare=function(e,t,r,n,i){if(!ie(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),u=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return he(this,e,t,r);case"utf8":case"utf-8":return le(this,e,t,r);case"ascii":return fe(this,e,t,r);case"latin1":case"binary":return de(this,e,t,r);case"base64":return pe(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var me=4096;function be(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Be(e,t,r,n,i,a){if(!ie(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Ce(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function _e(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function ke(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Se(e,t,r,n,i){return i||ke(e,0,r,4),z(e,t,r,n,23,4),r+4}function Qe(e,t,r,n,i){return i||ke(e,0,r,8),z(e,t,r,n,52,8),r+8}$.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},$.prototype.readUInt8=function(e,t){return t||Ee(e,1,this.length),this[e]},$.prototype.readUInt16LE=function(e,t){return t||Ee(e,2,this.length),this[e]|this[e+1]<<8},$.prototype.readUInt16BE=function(e,t){return t||Ee(e,2,this.length),this[e]<<8|this[e+1]},$.prototype.readUInt32LE=function(e,t){return t||Ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},$.prototype.readUInt32BE=function(e,t){return t||Ee(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},$.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Ee(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},$.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Ee(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},$.prototype.readInt8=function(e,t){return t||Ee(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},$.prototype.readInt16LE=function(e,t){t||Ee(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},$.prototype.readInt16BE=function(e,t){t||Ee(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},$.prototype.readInt32LE=function(e,t){return t||Ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},$.prototype.readInt32BE=function(e,t){return t||Ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},$.prototype.readFloatLE=function(e,t){return t||Ee(e,4,this.length),j(this,e,!0,23,4)},$.prototype.readFloatBE=function(e,t){return t||Ee(e,4,this.length),j(this,e,!1,23,4)},$.prototype.readDoubleLE=function(e,t){return t||Ee(e,8,this.length),j(this,e,!0,52,8)},$.prototype.readDoubleBE=function(e,t){return t||Ee(e,8,this.length),j(this,e,!1,52,8)},$.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Be(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},$.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,1,255,0),$.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},$.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ce(this,e,t,!0),t+2},$.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ce(this,e,t,!1),t+2},$.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_e(this,e,t,!0),t+4},$.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_e(this,e,t,!1),t+4},$.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Be(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},$.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Be(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},$.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,1,127,-128),$.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},$.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ce(this,e,t,!0),t+2},$.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ce(this,e,t,!1),t+2},$.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,2147483647,-2147483648),$.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_e(this,e,t,!0),t+4},$.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_e(this,e,t,!1),t+4},$.prototype.writeFloatLE=function(e,t,r){return Se(this,e,t,!0,r)},$.prototype.writeFloatBE=function(e,t,r){return Se(this,e,t,!1,r)},$.prototype.writeDoubleLE=function(e,t,r){return Qe(this,e,t,!0,r)},$.prototype.writeDoubleBE=function(e,t,r){return Qe(this,e,t,!1,r)},$.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!$.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Ue(e){return function(e){var t,r,n,i,a,o;H||N();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new K(3*s/4-a),n=a>0?s-4:s;var c=0;for(t=0,r=0;t>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===a?(i=O[e.charCodeAt(t)]<<2|O[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===a&&(i=O[e.charCodeAt(t)]<<10|O[e.charCodeAt(t+1)]<<4|O[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(xe,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function De(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Re(e){return null!=e&&(!!e._isBuffer||Fe(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Fe(e.slice(0,0))}(e))}function Fe(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Te=Object.freeze({__proto__:null,Buffer:$,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),$.alloc(+e)},isBuffer:Re,kMaxLength:J});function qe(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}T.inherits(qe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Oe=qe.prototype,Ke={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ke[e]={value:e}})),Object.defineProperties(qe,Ke),Object.defineProperty(Oe,"isAxiosError",{value:!0}),qe.from=(e,t,r,n,i,a)=>{const o=Object.create(Oe);return T.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),qe.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function He(e){return T.isPlainObject(e)||T.isArray(e)}function Ne(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Le(e,t,r){return e?e.concat(t).map((function(e,t){return e=Ne(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Ge=T.toFlatObject(T,{},null,(function(e){return/^is[A-Z]/.test(e)}));function je(e,t,r){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=T.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!T.isUndefined(t[e])}))).metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(T.isDate(e))return e.toISOString();if(!s&&T.isBlob(e))throw new qe("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(e)||T.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):$.from(e):e}function u(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(T.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(T.isArray(e)&&function(e){return T.isArray(e)&&!e.some(He)}(e)||(T.isFileList(e)||T.endsWith(r,"[]"))&&(s=T.toArray(e)))return r=Ne(r),s.forEach((function(e,n){!T.isUndefined(e)&&null!==e&&t.append(!0===o?Le([r],n,a):null===o?r:r+"[]",c(e))})),!1;return!!He(e)||(t.append(Le(i,r,a),c(e)),!1)}const h=[],l=Object.assign(Ge,{defaultVisitor:u,convertValue:c,isVisitable:He});if(!T.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!T.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),T.forEach(r,(function(r,a){!0===(!(T.isUndefined(r)||null===r)&&i.call(t,r,T.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),h.pop()}}(e),t}function ze(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function We(e,t){this._pairs=[],e&&je(e,this,t)}const Ze=We.prototype;function Je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ve(e,t,r){if(!t)return e;const n=r&&r.encode||Je,i=r&&r.serialize;let a;if(a=i?i(t,r):T.isURLSearchParams(t)?t.toString():new We(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Ze.append=function(e,t){this._pairs.push([e,t])},Ze.toString=function(e){const t=e?function(t){return e.call(this,t,ze)}:ze;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Ye=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){T.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},$e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:We,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const et="undefined"!=typeof window&&"undefined"!=typeof document,tt=(rt="undefined"!=typeof navigator&&navigator.product,et&&["ReactNative","NativeScript","NS"].indexOf(rt)<0);var rt;const nt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var it={...Object.freeze({__proto__:null,hasBrowserEnv:et,hasStandardBrowserEnv:tt,hasStandardBrowserWebWorkerEnv:nt}),...Xe};function at(e){function t(e,r,n,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&T.isArray(n)?n.length:a,s)return T.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&T.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&T.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n{t(function(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ot={transitional:$e,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=T.isObject(e);i&&T.isHTMLForm(e)&&(e=new FormData(e));if(T.isFormData(e))return n&&n?JSON.stringify(at(e)):e;if(T.isArrayBuffer(e)||T.isBuffer(e)||T.isStream(e)||T.isFile(e)||T.isBlob(e))return e;if(T.isArrayBufferView(e))return e.buffer;if(T.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return je(e,new it.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return it.isNode&&T.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=T.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return je(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ot.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&T.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw qe.from(e,qe.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:it.classes.FormData,Blob:it.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],(e=>{ot.headers[e]={}}));var st=ot;const ct=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ut=Symbol("internals");function ht(e){return e&&String(e).trim().toLowerCase()}function lt(e){return!1===e||null==e?e:T.isArray(e)?e.map(lt):String(e)}function ft(e,t,r,n,i){return T.isFunction(n)?n.call(this,t,r):(i&&(t=r),T.isString(t)?T.isString(n)?-1!==t.indexOf(n):T.isRegExp(n)?n.test(t):void 0:void 0)}class dt{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ht(t);if(!i)throw new Error("header name must be a non-empty string");const a=T.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=lt(e))}const a=(e,t)=>T.forEach(e,((e,r)=>i(e,r,t)));return T.isPlainObject(e)||e instanceof this.constructor?a(e,t):T.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ct[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ht(e)){const r=T.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(T.isFunction(t))return t.call(this,e,r);if(T.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ht(e)){const r=T.findKey(this,e);return!(!r||void 0===this[r]||t&&!ft(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ht(e)){const i=T.findKey(r,e);!i||t&&!ft(0,r[i],i,t)||(delete r[i],n=!0)}}return T.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!ft(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return T.forEach(this,((n,i)=>{const a=T.findKey(r,i);if(a)return t[a]=lt(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=lt(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return T.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&T.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ut]=this[ut]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ht(e);t[n]||(!function(e,t){const r=T.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return T.isArray(e)?e.forEach(n):n(e),this}}dt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(dt.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),T.freezeMethods(dt);var pt=dt;function gt(e,t){const r=this||st,n=t||r,i=pt.from(n.headers);let a=n.data;return T.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function At(e){return!(!e||!e.__CANCEL__)}function yt(e,t,r){qe.call(this,null==e?"canceled":e,qe.ERR_CANCELED,t,r),this.name="CanceledError"}T.inherits(yt,qe,{__CANCEL__:!0});var mt=it.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];T.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),T.isString(n)&&o.push("path="+n),T.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function bt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var wt=it.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=T.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function vt(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=n[o];i||(i=c),r[a]=s,n[a]=c;let h=o,l=0;for(;h!==a;)l+=r[h++],h%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,c=n(s);r=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var It="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=pt.from(e.headers).normalize();let a,o,{responseType:s,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(T.isFormData(n))if(it.hasStandardBrowserEnv||it.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let h=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const l=bt(e.baseURL,e.url);function f(){if(!h)return;const n=pt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new qe("Request failed with status code "+r.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),u()}),(function(e){r(e),u()}),{data:s&&"text"!==s&&"json"!==s?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}if(h.open(e.method.toUpperCase(),Ve(l,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(f)},h.onabort=function(){h&&(r(new qe("Request aborted",qe.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new qe("Network Error",qe.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||$e;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new qe(t,n.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,e,h)),h=null},it.hasStandardBrowserEnv&&(c&&T.isFunction(c)&&(c=c(e)),c||!1!==c&&wt(l))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&mt.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in h&&T.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),T.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),s&&"json"!==s&&(h.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",vt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",vt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{h&&(r(!t||t.type?new yt(null,e,h):t),h.abort(),h=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);d&&-1===it.protocols.indexOf(d)?r(new qe("Unsupported protocol "+d+":",qe.ERR_BAD_REQUEST,e)):h.send(n||null)}))};const Et={http:null,xhr:It};T.forEach(Et,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Bt=e=>`- ${e}`,Ct=e=>T.isFunction(e)||null===e||!1===e;var _t=e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new qe("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Bt).join("\n"):" "+Bt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function kt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yt(null,e)}function St(e){kt(e),e.headers=pt.from(e.headers),e.data=gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return _t(e.adapter||st.adapter)(e).then((function(t){return kt(e),t.data=gt.call(e,e.transformResponse,t),t.headers=pt.from(t.headers),t}),(function(t){return At(t)||(kt(e),t&&t.response&&(t.response.data=gt.call(e,e.transformResponse,t.response),t.response.headers=pt.from(t.response.headers))),Promise.reject(t)}))}const Qt=e=>e instanceof pt?e.toJSON():e;function xt(e,t){t=t||{};const r={};function n(e,t,r){return T.isPlainObject(e)&&T.isPlainObject(t)?T.merge.call({caseless:r},e,t):T.isPlainObject(t)?T.merge({},t):T.isArray(t)?t.slice():t}function i(e,t,r){return T.isUndefined(t)?T.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!T.isUndefined(t))return n(void 0,t)}function o(e,t){return T.isUndefined(t)?T.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Qt(e),Qt(t),!0)};return T.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=c[n]||i,o=a(e[n],t[n],n);T.isUndefined(o)&&a!==s||(r[n]=o)})),r}const Pt="1.6.5",Mt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Mt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ut={};Mt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.5] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new qe(n(i," has been removed"+(t?" in "+t:"")),qe.ERR_DEPRECATED);return t&&!Ut[i]&&(Ut[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new qe("option "+a+" must be "+r,qe.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new qe("Unknown option "+a,qe.ERR_BAD_OPTION)}},validators:Mt};const Rt=Dt.validators;class Ft{constructor(e){this.defaults=e,this.interceptors={request:new Ye,response:new Ye}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=xt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Dt.assertOptions(r,{silentJSONParsing:Rt.transitional(Rt.boolean),forcedJSONParsing:Rt.transitional(Rt.boolean),clarifyTimeoutError:Rt.transitional(Rt.boolean)},!1),null!=n&&(T.isFunction(n)?t.paramsSerializer={serialize:n}:Dt.assertOptions(n,{encode:Rt.function,serialize:Rt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&T.merge(i.common,i[t.method]);i&&T.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=pt.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,l=0;if(!s){const e=[St.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);l{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new yt(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new qt((function(t){e=t}));return{token:t,cancel:e}}}var Ot=qt;const Kt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Kt).forEach((([e,t])=>{Kt[t]=e}));var Ht=Kt;const Nt=function e(t){const r=new Tt(t),i=n(Tt.prototype.request,r);return T.extend(i,Tt.prototype,r,{allOwnKeys:!0}),T.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(xt(t,r))},i}(st);Nt.Axios=Tt,Nt.CanceledError=yt,Nt.CancelToken=Ot,Nt.isCancel=At,Nt.VERSION=Pt,Nt.toFormData=je,Nt.AxiosError=qe,Nt.Cancel=Nt.CanceledError,Nt.all=function(e){return Promise.all(e)},Nt.spread=function(e){return function(t){return e.apply(null,t)}},Nt.isAxiosError=function(e){return T.isObject(e)&&!0===e.isAxiosError},Nt.mergeConfig=xt,Nt.AxiosHeaders=pt,Nt.formToJSON=e=>at(T.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=_t,Nt.HttpStatusCode=Ht,Nt.default=Nt;var Lt=Nt,Gt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Wt={exports:{}},Zt={exports:{}};!function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var n=r(e);throw null===e?n="null":"object"===n&&(n=e.constructor.name),new TypeError("Expected a string but received a ".concat(n))}},e.exports=t.default,e.exports.default=t.default}(Zt,Zt.exports);var Jt=Zt.exports,Vt={exports:{}},Yt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(Yt,Yt.exports);var $t=Yt.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),o=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(o))return!1;if(/\s/.test(o))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(o))return!1;return i.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var r=i(Jt),n=i($t);function i(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(Vt,Vt.exports);var Xt=Vt.exports,er=jt(Xt),tr={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,n.default)(t),r=String(r),!r)return e(t,4)||e(t,6);if("4"===r)return o.test(t);if("6"===r)return c.test(t);return!1};var r,n=(r=Jt)&&r.__esModule?r:{default:r};var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(i,"[.]){3}").concat(i),o=new RegExp("^".concat(a,"$")),s="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(a,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(a,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(a,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(a,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(a,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(a,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(a,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(tr,tr.exports);var rr=tr.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,a.default)(t,c)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var o,l,f,d,p,g,A,y;if(A=e.split("#"),e=A.shift(),A=e.split("?"),e=A.shift(),(A=e.split("://")).length>1){if(o=A.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(o))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;A[0]=e.slice(2)}}if(""===(e=A.join("://")))return!1;if(A=e.split("/"),""===(e=A.shift())&&!t.require_host)return!0;if((A=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===A[0])return!1;if((l=A.shift()).indexOf(":")>=0&&l.split(":").length>2)return!1;var m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(l.split(":"),2),b=m[0],w=m[1];if(""===b&&""===w)return!1}d=A.join("@"),g=null,y=null;var v=d.match(u);v?(f="",y=v[1],g=v[2]||null):(f=(A=d.split(":")).shift(),A.length&&(g=A.join(":")));if(null!==g&&g.length>0){if(p=parseInt(g,10),!/^[0-9]+$/.test(g)||p<=0||p>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return h(f,t.host_whitelist);if(""===f&&!t.require_host)return!0;if(!((0,i.default)(f)||(0,n.default)(f,t)||y&&(0,i.default)(y,6)))return!1;if(f=f||y,t.host_blacklist&&h(f,t.host_blacklist))return!1;return!0};var r=o(Jt),n=o(Xt),i=o(rr),a=o($t);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)for(var r=1;r{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:5e3)})),i=new Promise(((r,n)=>{(async()=>{let i=!1;try{nr(t.claims.activitypub.url),i=!0}catch(e){}const a=new Date,{host:o,pathname:s,search:c}=new URL(e.url),u={host:o,date:a.toUTCString(),accept:"application/activity+json","User-Agent":`doipjs/${Tr}`};if(i&&Rr){const e=`(request-target): get ${s}${c}\nhost: ${o}\ndate: ${a.toUTCString()}`,r=Fr.createSign("SHA256");r.write(e),r.end();const n=r.sign(t.claims.activitypub.privateKey.replace(/\\n/g,"\n"),"base64");u.signature=`keyId="${t.claims.activitypub.url}#main-key",headers="(request-target) host date",signature="${n}",algorithm="rsa-sha256"`}Lt.get(e.url,{headers:u}).then((e=>e.data)).then((e=>{r(e)})).catch((e=>{n(e)}))})()}));return Promise.race([i,n]).finally((()=>{clearTimeout(r)}))}var Or=Object.freeze({__proto__:null,fn:qr,timeout:5e3}),Kr=crypto;const Hr=e=>e instanceof CryptoKey;var Nr=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await Kr.subtle.digest(r,t))};const Lr=new TextEncoder,Gr=new TextDecoder;const jr=e=>(e=>{let t=e;"string"==typeof t&&(t=Lr.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=Gr.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;ee.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}function nn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var an=(e,...t)=>nn("Key must be ",e,...t);function on(e,t,...r){return nn(`Key for the ${e} algorithm must be `,t,...r)}var sn=e=>Hr(e);const cn=["CryptoKey"];var un=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function hn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var ln=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Jr(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Jr('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),a=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return Kr.subtle.importKey("raw",zr(e.k),...a);const o={...e};return delete o.alg,delete o.use,Kr.subtle.importKey("jwk",o,...a)};var fn=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!sn(t))throw new TypeError(on(e,t,...cn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${cn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!sn(t))throw new TypeError(on(e,t,...cn));if("secret"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};var dn=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};var pn=async(e,t,r,n)=>{const i=await function(e,t,r){if(Hr(t))return rn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(an(t,...cn));return Kr.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(an(t,...cn,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,i);const a=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new Jr(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,i.algorithm);try{return await Kr.subtle.verify(a,i,r,n)}catch(e){return!1}};async function gn(e,t,r){var n;if(!hn(e))throw new Vr("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Vr('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Vr("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Vr("JWS Payload missing");if("string"!=typeof e.signature)throw new Vr("JWS Signature missing or incorrect type");if(void 0!==e.header&&!hn(e.header))throw new Vr("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=zr(e.protected);i=JSON.parse(Gr.decode(t))}catch(e){throw new Vr("JWS Protected Header is invalid")}if(!un(i,e.header))throw new Vr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...i,...e.header},o=function(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!a.has(t))throw new Jr(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(Vr,new Map([["b64",!0]]),null==r?void 0:r.crit,i,a);let s=!0;if(o.has("b64")&&(s=i.b64,"boolean"!=typeof s))throw new Vr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=a;if("string"!=typeof c||!c)throw new Vr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const u=r&&dn("algorithms",r.algorithms);if(u&&!u.has(c))throw new Zr('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof e.payload)throw new Vr("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Vr("JWS Payload must be a string or an Uint8Array instance");let h=!1;"function"==typeof t&&(t=await t(i,e),h=!0),fn(c,t,"verify");const l=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(Lr.encode(null!==(n=e.protected)&&void 0!==n?n:""),Lr.encode("."),"string"==typeof e.payload?Lr.encode(e.payload):e.payload);let f;try{f=zr(e.signature)}catch(e){throw new Vr("Failed to base64url decode the signature")}if(!await pn(c,t,f,l))throw new $r;let d;if(s)try{d=zr(e.payload)}catch(e){throw new Vr("Failed to base64url decode the payload")}else d="string"==typeof e.payload?Lr.encode(e.payload):e.payload;const p={payload:d};return void 0!==e.protected&&(p.protectedHeader=i),void 0!==e.header&&(p.unprotectedHeader=e.header),h?{...p,key:t}:p}const An=(e,t)=>{if("string"!=typeof e||!e)throw new Yr(`${t} missing or invalid`)};const yn=zr;function mn(e,t,r){var n;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var i=0;i=8&&(s-=8,o[u++]=255&c>>s)}if(s>=t.bits||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o}function bn(e,t,r){void 0===r&&(r={});for(var n=r.pad,i=void 0===n||n,a=(1<t.bits;)s-=t.bits,o+=t.chars[a&c>>s];if(s&&(o+=t.chars[a&c<1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,Wn.default)(e);var n=e,i=r.ignore;if(i)if(i instanceof RegExp)n=n.replace(i,"");else{if("string"!=typeof i)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(i.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(t in Zn.alphanumeric)return Zn.alphanumeric[t].test(n);throw new Error("Invalid locale '".concat(t,"'"))};Bn.locales=void 0;var zn,Wn=(zn=Jt)&&zn.__esModule?zn:{default:zn},Zn=Cn;var Jn=Object.keys(Zn.alphanumeric);Bn.locales=Jn;var Vn={exports:{}};(function(e){e.exports.is_uri=r,e.exports.is_http_uri=n,e.exports.is_https_uri=i,e.exports.is_web_uri=a,e.exports.isUri=r,e.exports.isHttpUri=n,e.exports.isHttpsUri=i,e.exports.isWebUri=a;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function r(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var r,n,i,a,o,s="",c="";if(s=(r=t(e))[1],n=r[2],i=r[3],a=r[4],o=r[5],s&&s.length&&i.length>=0){if(n&&n.length){if(0!==i.length&&!/^\//.test(i))return}else if(/^\/\//.test(i))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(s.toLowerCase()))return c+=s+":",n&&n.length&&(c+="//"+n),c+=i,a&&a.length&&(c+="?"+a),o&&o.length&&(c+="#"+o),c}}}function n(e,n){if(r(e)){var i,a,o,s,c="",u="",h="",l="";if(c=(i=t(e))[1],u=i[2],a=i[3],o=i[4],s=i[5],c){if(n){if("https"!=c.toLowerCase())return}else if("http"!=c.toLowerCase())return;if(u)return/:(\d+)$/.test(u)&&(h=u.match(/:(\d+)$/)[0],u=u.replace(/:\d+$/,"")),l+=c+":",l+="//"+u,h&&(l+=h),l+=a,o&&o.length&&(l+="?"+o),s&&s.length&&(l+="#"+s),l}}}function i(e){return n(e,!0)}function a(e){return n(e)||i(e)}})(Vn);var Yn=Vn.exports;const $n=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},{hasOwnProperty:Xn}=Object.prototype,{propertyIsEnumerable:ei}=Object,ti=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),ri=Gt,ni={concatArrays:!1,ignoreUndefined:!1},ii=e=>{const t=[];for(const r in e)Xn.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)ei.call(e,n)&&t.push(n)}return t};function ai(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return ii(e).forEach((r=>{ti(t,r,ai(e[r]))})),t}(e):$n(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return ii(e).forEach((r=>{ti(t,r,ai(e[r]))})),t}(e):e}const oi=(e,t,r,n)=>(r.forEach((r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?ti(e,r,ci(e[r],t[r],n)):ti(e,r,ai(t[r])))})),e),si=(e,t,r)=>{let n=e.slice(0,0),i=0;return[e,t].forEach((t=>{const a=[];for(let r=0;r!a.includes(e))),r)})),n};function ci(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?si(e,t,r):$n(t)&&$n(e)?oi(e,t,ii(t),r):ai(t)}var ui=function(...e){const t=ci(ai(ni),this!==ri&&this||{},ni);let r={_:{}};for(const n of e)if(void 0!==n){if(!$n(n))throw new TypeError("`"+n+"` is not an Option Object");r=ci(r,{_:n},t)}return r._},hi=jt(ui);const li="adaptive",fi="always",di="never",pi="activitypub",gi="aspe",Ai="dns",yi="graphql",mi="http",bi="irc",wi="matrix",vi="openpgp",Ii="telegram",Ei="xmpp",Bi="plain",Ci="html",_i="xml",ki="none",Si="nocors",Qi="granted",xi="server",Pi="json",Mi="text",Ui="uri",Di="fingerprint",Ri="contains",Fi="equals",Ti="oneof",qi=100,Oi=101,Ki=200,Hi=201,Ni=301,Li=401,Gi={ASP:"asp",OPENPGP:"openpgp"},ji={EDDSA:"eddsa",ES256:"es256",OPENPGP:"openpgp",UNKNOWN:"unknown",NONE:"none"},zi={PEM:"pem",JWK:"jwk",ARMORED_PGP:"armored_pgp",NONE:"none"},Wi="none",Zi="hkp",Ji="wkd";class Vi{constructor(e,t){this.identifier=null,this.name=e,this.email=null,this.description=null,this.avatarUrl=null,this.themeColor=null,this.claims=t,this.isRevoked=!1}static fromJSON(e,t){let r,n;if("object"==typeof e&&t){if(2!==t)throw new Error("Invalid persona version");if(n=function(e){const t=e.claims.map((e=>zw.fromJSON(e))),r=new Vi(e.name,t);return r.identifier=e.identifier,r.email=e.email,r.description=e.description,r.avatarUrl=e.avatarUrl,r.themeColor=e.avatarUrl,r.isRevoked=e.isRevoked,r}(e),n instanceof Error)throw n;r=n}return r}setIdentifier(e){this.identifier=e}setDescription(e){this.description=e}setEmailAddress(e){this.email=e}setAvatarUrl(e){this.avatarUrl=e}addClaim(e){this.claims.push(e)}revoke(){this.isRevoked=!0}toJSON(){return{identifier:this.identifier,name:this.name,email:this.email,description:this.description,avatarUrl:this.avatarUrl,themeColor:this.themeColor,isRevoked:this.isRevoked,claims:this.claims.map((e=>e.toJSON()))}}}class Yi{constructor(e,t,r){this.profileVersion=2,this.profileType=e,this.identifier=t,this.personas=r||[],this.primaryPersonaIndex=r.length>0?0:-1,this.publicKey={keyType:ji.NONE,fingerprint:null,encoding:zi.NONE,encodedKey:null,key:null,fetch:{method:Wi,query:null,resolvedUrl:null}},this.verifiers=[]}static fromJSON(e){let t,r;if("object"==typeof e&&"profileVersion"in e){if(2!==e.profileVersion)throw new Error("Invalid profile version");if(r=function(e){if(!("profileVersion"in e)||2!==e.profileVersion)return new Error("Invalid profile");const t=e.personas.map((e=>Vi.fromJSON(e,2))),r=new Yi(e.profileType,e.identifier,t);return r.primaryPersonaIndex=e.primaryPersonaIndex,r.publicKey=e.publicKey,r.verifiers=e.verifiers,r}(e),r instanceof Error)throw r;t=r}return t}addVerifier(e,t){this.verifiers.push({name:e,url:t})}toJSON(){return{profileVersion:this.profileVersion,profileType:this.profileType,identifier:this.identifier,personas:this.personas.map((e=>e.toJSON())),primaryPersonaIndex:this.primaryPersonaIndex,publicKey:{keyType:this.publicKey.keyType,fingerprint:this.publicKey.fingerprint,encoding:this.publicKey.encoding,encodedKey:this.publicKey.encodedKey,fetch:{method:this.publicKey.fetch.method,query:this.publicKey.fetch.query,resolvedUrl:this.publicKey.fetch.resolvedUrl}},verifiers:this.verifiers}}}class $i{constructor(e){this.about=e.about,this.profile=e.profile,this.claim=e.claim,this.proof=e.proof}toJSON(){return{about:this.about,profile:this.profile,claim:this.claim,proof:this.proof}}}const Xi=/^aspe:([a-zA-Z0-9.\-_]*):([a-zA-Z0-9]*)/;var ea=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Xi);return er(t[1])?new $i({about:{id:"aspe",name:"ASPE"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:Xi.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:gi,accessRestriction:ki,data:{aspeUri:e}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["claims"]}]}}):null},reURI:Xi,tests:[{uri:"aspe:domain.tld:abc123def456",shouldMatch:!0},{uri:"aspe:domain.tld",shouldMatch:!1},{uri:"dns:domain.tld",shouldMatch:!1},{uri:"https://domain.tld",shouldMatch:!1}]});const ta=/^openpgp4fpr:(?:0x)?([a-zA-Z0-9.\-_]*)/,ra=/^https:\/\/(.*)\/.well-known\/openpgpkey\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/,na=/^https:\/\/(openpgpkey.*)\/.well-known\/openpgpkey\/(.*)\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/;var ia=Object.freeze({__proto__:null,processURI:function(e){let t=null,r=null,n=null;ta.test(e)&&(t=ta,r=Zi,n=e.match(t)),!r&&na.test(e)&&(t=na,r=Ji,n=e.match(t)),!r&&ra.test(e)&&(t=ra,r=Ji,n=e.match(t));let i=null;switch(r){case Zi:i=new $i({about:{id:"openpgp",name:"OpenPGP"},profile:{display:`openpgp4fpr:${n[1]}`,uri:`https://keys.openpgp.org/search?q=${n[1]}`,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,fetcher:vi,accessRestriction:ki,data:{url:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,protocol:Zi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["notations","proof@ariadne.id"]}]}});break;case Ji:i=new $i({about:{id:"openpgp",name:"OpenPGP"},profile:{display:"unknown fingerprint",uri:e,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:vi,accessRestriction:ki,data:{url:e,protocol:Ji}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["notations","proof@ariadne.id"]}]}})}return i},reURI:/^(.*)/,tests:[{uri:"openpgp4fpr:123456789",shouldMatch:!0},{uri:"openpgp4fpr:abcdef123",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/123abc456def?l=name",shouldMatch:!0}]});const aa=/^dns:([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var oa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(aa);return new $i({about:{id:"dns",name:"DNS"},profile:{display:t[1],uri:`https://${t[1]}`,qr:null},claim:{uriRegularExpression:aa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:Ai,accessRestriction:xi,data:{domain:t[1]}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["records","txt"]}]}})},reURI:aa,tests:[{uri:"dns:domain.org",shouldMatch:!0},{uri:"dns:domain.org?type=TXT",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const sa=/^irc:\/\/(.*)\/([a-zA-Z0-9\-[\]\\`_^{|}]*)/;var ca=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(sa);return new $i({about:{id:"irc",name:"IRC"},profile:{display:`${t[1]}/${t[2]}`,uri:e,qr:null},claim:{uriRegularExpression:sa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:bi,accessRestriction:xi,data:{domain:t[1],nick:t[2]}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:[]}]}})},reURI:sa,tests:[{uri:"irc://chat.ircserver.org/Alice1",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice?param=123",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice_bob",shouldMatch:!0},{uri:"https://chat.ircserver.org/alice",shouldMatch:!1}]});const ua=/^xmpp:([a-zA-Z0-9.\-_]*)@([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var ha=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ua);return new $i({about:{id:"xmpp",name:"XMPP",homepage:"https://xmpp.org"},profile:{display:`${t[1]}@${t[2]}`,uri:e,qr:e},claim:{uriRegularExpression:ua.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:Ei,accessRestriction:xi,data:{id:`${t[1]}@${t[2]}`}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:[]}]}})},reURI:ua,tests:[{uri:"xmpp:alice@domain.org",shouldMatch:!0},{uri:"xmpp:alice@domain.org?omemo-sid-123456789=A1B2C3D4E5F6G7H8I9",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const la=/^matrix:u\/(?:@)?([^@:]*:[^?]*)(\?.*)?/;var fa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(la);if(!t[2])return null;const r=new URLSearchParams(t[2]);if(!r.has("org.keyoxide.e")||!r.has("org.keyoxide.r"))return null;const n=`${"!"!==r.get("org.keyoxide.r")[0]?"!":""}${r.get("org.keyoxide.r")}`,i=`${"$"!==r.get("org.keyoxide.e")[0]?"$":""}${r.get("org.keyoxide.e")}`,a=`https://matrix.to/#/@${t[1]}`,o=`https://matrix.to/#/${n}/${i}`;return new $i({about:{id:"matrix",name:"Matrix",homepage:"https://matrix.org"},profile:{display:`@${t[1]}`,uri:a,qr:null},claim:{uriRegularExpression:la.toString(),uriIsAmbiguous:!1},proof:{request:{uri:o,fetcher:wi,accessRestriction:Qi,data:{eventId:i,roomId:n}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["content","body"]}]}})},reURI:la,tests:[{uri:"matrix:u/alice:matrix.domain.org?org.keyoxide.r=123:domain.org&org.keyoxide.e=123",shouldMatch:!0},{uri:"matrix:u/alice:matrix.domain.org",shouldMatch:!0},{uri:"matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123",shouldMatch:!0},{uri:"xmpp:alice@domain.org",shouldMatch:!1},{uri:"https://domain.org/@alice",shouldMatch:!1}]});const da=/https:\/\/t.me\/([A-Za-z0-9_]{5,32})\?proof=([A-Za-z0-9_]{5,32})/;var pa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(da);return new $i({about:{id:"telegram",name:"Telegram",homepage:"https://telegram.org"},profile:{display:`@${t[1]}`,uri:`https://t.me/${t[1]}`,qr:`https://t.me/${t[1]}`},claim:{uriRegularExpression:da.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://t.me/${t[2]}`,fetcher:Ii,accessRestriction:Qi,data:{user:t[1],chat:t[2]}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["text"]}]}})},reURI:da,tests:[{uri:"https://t.me/alice?proof=foobar",shouldMatch:!0},{uri:"https://t.me/complex_user_1234?proof=complex_chat_1234",shouldMatch:!0},{uri:"https://t.me/foobar",shouldMatch:!1},{uri:"https://t.me/foobar?proof=",shouldMatch:!1},{uri:"https://t.me/?proof=foobar",shouldMatch:!1}]});const ga=/^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;var Aa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ga),r=new URLSearchParams;return r.set("url",t[0]),r.set("omit_script","1"),new $i({about:{id:"twitter",name:"Twitter",homepage:"https://twitter.com"},profile:{display:`@${t[1]}`,uri:`https://twitter.com/${t[1]}`,qr:null},claim:{uriRegularExpression:ga.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://publish.twitter.com/oembed?${r}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["html"]}]}})},reURI:ga,tests:[{uri:"https://twitter.com/alice/status/1234567890123456789",shouldMatch:!0},{uri:"https://twitter.com/alice/status/1234567890123456789/",shouldMatch:!0},{uri:"https://domain.org/alice/status/1234567890123456789",shouldMatch:!1}]});const ya=/^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;var ma=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ya);return new $i({about:{id:"reddit",name:"Reddit",homepage:"https://reddit.com"},profile:{display:t[1],uri:`https://www.reddit.com/user/${t[1]}`,qr:null},claim:{uriRegularExpression:ya.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://www.reddit.com/user/${t[1]}/comments/${t[2]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["data","children","data","selftext"]}]}})},reURI:ya,tests:[{uri:"https://www.reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://www.reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://domain.org/user/Alice/comments/123456/post",shouldMatch:!1}]});const ba=/^https:\/\/liberapay\.com\/(.*)\/?/;var wa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ba);return new $i({about:{id:"liberapay",name:"Liberapay",homepage:"https://liberapay.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:ba.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:`https://liberapay.com/${t[1]}/public.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["statements","content"]}]}})},reURI:ba,tests:[{uri:"https://liberapay.com/alice",shouldMatch:!0},{uri:"https://liberapay.com/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const va=/^https:\/\/lichess\.org\/@\/(.*)\/?/;var Ia=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(va);return new $i({about:{id:"lichess",name:"Lichess",homepage:"https://lichess.org"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:va.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lichess.org/api/user/${t[1]}`,fetcher:mi,accessRestriction:ki,data:{url:`https://lichess.org/api/user/${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Di,encoding:Bi,relation:Ri,path:["profile","links"]}]}})},reURI:va,tests:[{uri:"https://lichess.org/@/Alice",shouldMatch:!0},{uri:"https://lichess.org/@/Alice/",shouldMatch:!0},{uri:"https://domain.org/@/Alice",shouldMatch:!1}]});const Ea=/^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;var Ba=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ea);return new $i({about:{id:"hackernews",name:"Hacker News",homepage:"https://news.ycombinator.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ea.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,fetcher:mi,accessRestriction:Si,data:{url:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Ci,relation:Ri,path:["about"]}]}})},reURI:Ea,tests:[{uri:"https://news.ycombinator.com/user?id=Alice",shouldMatch:!0},{uri:"https://news.ycombinator.com/user?id=Alice/",shouldMatch:!0},{uri:"https://domain.org/user?id=Alice",shouldMatch:!1}]});const Ca=/^https:\/\/lobste\.rs\/(?:~|u\/)(.*)\/?/;var _a=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ca);return new $i({about:{id:"lobsters",name:"Lobsters",homepage:"https://lobste.rs"},profile:{display:t[1],uri:`https://lobste.rs/~${t[1]}`,qr:null},claim:{uriRegularExpression:Ca.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lobste.rs/~${t[1]}.json`,fetcher:mi,accessRestriction:Si,data:{url:`https://lobste.rs/~${t[1]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["about"]}]}})},reURI:Ca,tests:[{uri:"https://lobste.rs/~Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice/",shouldMatch:!0},{uri:"https://domain.org/~Alice",shouldMatch:!1},{uri:"https://domain.org/u/Alice",shouldMatch:!1}]});const ka=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var Sa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ka);return new $i({about:{id:"forem",name:"Forem",homepage:"https://www.forem.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:ka.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/api/articles/${t[2]}/${t[3]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["body_markdown"]}]}})},reURI:ka,tests:[{uri:"https://domain.org/alice/post",shouldMatch:!0},{uri:"https://domain.org/alice/post/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Qa=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;const xa={validate:async(e,t,r)=>{const n=`https://${new URL(e.proof.request.uri).hostname}/api/forgejo/v1/version`,i=await tv({url:n,format:Pi});return i&&"version"in i}};var Pa=Object.freeze({__proto__:null,functions:xa,processURI:function(e){const t=e.match(Qa);return new $i({about:{id:"forgejo",name:"Forgejo",homepage:"https://forgejo.org"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Qa.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["description"]}]}})},reURI:Qa,tests:[{uri:"https://domain.org/alice/forgejo_proof",shouldMatch:!0},{uri:"https://domain.org/alice/forgejo_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Ma=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var Ua=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ma);return new $i({about:{id:"gitea",name:"Gitea",homepage:"https://about.gitea.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Ma.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["description"]}]}})},reURI:Ma,tests:[{uri:"https://domain.org/alice/gitea_proof",shouldMatch:!0},{uri:"https://domain.org/alice/gitea_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Da=/^https:\/\/(.*)\/(.*)\/gitlab_proof\/?/;var Ra=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Da);return new $i({about:{id:"gitlab",name:"GitLab",homepage:"https://about.gitlab.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Da.toString(),uriIsAmbiguous:!0},proof:{request:{fetcher:mi,accessRestriction:ki,data:{url:`https://${t[1]}/api/v4/projects/${t[2]}%2Fgitlab_proof`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["description"]}]}})},reURI:Da,tests:[{uri:"https://gitlab.domain.org/alice/gitlab_proof",shouldMatch:!0},{uri:"https://gitlab.domain.org/alice/gitlab_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]});const Fa=/^https:\/\/gist\.github\.com\/(.*)\/(.*)\/?/;var Ta=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Fa);return new $i({about:{id:"github",name:"GitHub",homepage:"https://github.com"},profile:{display:t[1],uri:`https://github.com/${t[1]}`,qr:null},claim:{uriRegularExpression:Fa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:`https://api.github.com/gists/${t[2]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["files","proof.md","content"]},{format:Ui,encoding:Bi,relation:Ri,path:["files","openpgp.md","content"]}]}})},reURI:Fa,tests:[{uri:"https://gist.github.com/Alice/123456789",shouldMatch:!0},{uri:"https://gist.github.com/Alice/123456789/",shouldMatch:!0},{uri:"https://domain.org/Alice/123456789",shouldMatch:!1}]});const qa=/^https:\/\/(.*)\/?/;const Oa={postprocess:async(e,t,r)=>{switch(t.result.type){case"Note":{e.profile.uri=t.result.attributedTo,e.profile.display=t.result.attributedTo;const n=await qr({url:t.result.attributedTo},r).catch((e=>null));n&&(e.profile.display=`@${n.preferredUsername}@${new URL(e.proof.request.uri).hostname}`);break}case"Person":e.profile.display=`@${t.result.preferredUsername}@${new URL(e.proof.request.uri).hostname}`}const n=await Ka(new URL(e.proof.request.uri).hostname);return n&&(e.about.name=n.software.name,e.about.id=n.software.name,e.about.homepage=n.software.homepage),{claimData:e,proofData:t}}},Ka=async e=>{const t=await fetch(`https://${e}/.well-known/nodeinfo`).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).catch((e=>null));if(!t)return null;{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:e.software.homepage||"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}};var Ha=Object.freeze({__proto__:null,functions:Oa,processURI:function(e){return new $i({about:{id:"activitypub",name:"ActivityPub",homepage:"https://activitypub.rocks"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:qa.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:pi,accessRestriction:ki,data:{url:e}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["summary"]},{format:Ui,encoding:Bi,relation:Ri,path:["attachment","value"]},{format:Ui,encoding:Bi,relation:Ri,path:["content"]}]}})},reURI:qa,tests:[{uri:"https://domain.org",shouldMatch:!0},{uri:"https://domain.org/@/alice/",shouldMatch:!0},{uri:"https://domain.org/@alice",shouldMatch:!0},{uri:"https://domain.org/@alice/123456",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/123456",shouldMatch:!0},{uri:"http://domain.org/alice",shouldMatch:!1}]});const Na=/^https:\/\/(.*)\/u\/(.*)\/?/;var La=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Na);return new $i({about:{id:"discourse",name:"Discourse",homepage:"https://www.discourse.org"},profile:{display:`${t[2]}@${t[1]}`,uri:e,qr:null},claim:{uriRegularExpression:Na.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/u/${t[2]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["user","bio_raw"]}]}})},reURI:Na,tests:[{uri:"https://domain.org/u/alice",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Ga=/^https:\/\/(.*)/;var ja=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ga);return new $i({about:{id:"owncast",name:"Owncast",homepage:"https://owncast.online"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ga.toString(),uriIsAmbiguous:!0},proof:{request:{uri:`${e}/api/config`,fetcher:mi,accessRestriction:ki,data:{url:`${e}/api/config`,format:Pi}},response:{format:Pi},target:[{format:Di,encoding:Bi,relation:Ri,path:["socialHandles","url"]}]}})},reURI:Ga,tests:[{uri:"https://live.domain.org",shouldMatch:!0},{uri:"https://live.domain.org/",shouldMatch:!0},{uri:"https://domain.org/live",shouldMatch:!0},{uri:"https://domain.org/live/",shouldMatch:!0}]});const za=/^https:\/\/(.*(?:askubuntu|mathoverflow|serverfault|stackapps|stackoverflow|superuser)|.+\.stackexchange)\.com\/users\/(\d+)/,Wa=/\.stackexchange$/;var Za=Object.freeze({__proto__:null,processURI:function(e){const[,t,r]=e.match(za),n=t.replace(Wa,"");return new $i({about:{id:"stackexchange",name:"Stack Exchange",homepage:"https://stackexchange.com"},profile:{display:`${r}@${n}`,uri:e,qr:null},claim:{uriRegularExpression:za.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://${t}.com/users/${r}?tab=profile`,fetcher:mi,accessRestriction:ki,data:{url:`https://api.stackexchange.com/2.3/users/${r}?site=${n}&filter=!AH)b5JqVyImf`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["items","about_me"]}]}})},reURI:za,tests:[{uri:"https://stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234?tab=topactivity",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice?tab=profile",shouldMatch:!0},{uri:"https://meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://serverfault.com/users/1234",shouldMatch:!0},{uri:"https://meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://gaming.meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://stackexchange.com/users/1234",shouldMatch:!1},{uri:"https://domain.com/users/1234",shouldMatch:!1},{uri:"https://meta.domain.com/users/1234",shouldMatch:!1}]});const Ja=/^https:\/\/keybase.io\/(.*)\/?/;var Va=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ja);return new $i({about:{id:"keybase",name:"keybase",homepage:"https://keybase.io"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ja.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,fetcher:mi,accessRestriction:Si,data:{url:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Di,encoding:Bi,relation:Ri,path:["them","public_keys","primary","key_fingerprint"]}]}})},reURI:Ja,tests:[{uri:"https://keybase.io/Alice",shouldMatch:!0},{uri:"https://keybase.io/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const Ya=/^https:\/\/opencollective\.com\/(.*)\/?/;var $a=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ya);return new $i({about:{id:"opencollective",name:"Open Collective",homepage:"https://opencollective.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ya.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:Si,data:{url:"https://api.opencollective.com/graphql/v2",query:`{ "query": "query { account(slug: \\"${t[1]}\\") { longDescription } }" }`}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["data","account","longDescription"]}]}})},reURI:Ya,tests:[{uri:"https://opencollective.com/Alice",shouldMatch:!0},{uri:"https://opencollective.com/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const Xa=/^https:\/\/orcid\.org\/(.*)\/?/;var eo=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Xa);return new $i({about:{id:"orcid",name:"ORCiD",homepage:"https://orcid.org/"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Xa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:e,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["person","biography","content"]},{format:Ui,encoding:Bi,relation:Fi,path:["person","researcher-urls","researcher-url","url","value"]},{format:Ui,encoding:Bi,relation:Fi,path:["person","keywords","keyword","content"]}]}})},reURI:Xa,tests:[{uri:"https://orcid.org/0000-0000-0000-0000",shouldMatch:!0},{uri:"https://orcid.org/0000-0000-0000-0000/",shouldMatch:!0},{uri:"https://domain.org/0000-0000-0000-0000",shouldMatch:!1}]});const to=/^https:\/\/pronouns\.cc\/@(.*)\/?/;var ro=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(to);return new $i({about:{id:"pronounscc",name:"pronouns.cc",homepage:"https://pronouns.cc"},profile:{display:`@${t[1]}`,uri:`https://pronouns.cc/@${t[1]}`,qr:null},claim:{uriRegularExpression:to.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://pronouns.cc/api/v1/users/${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["links"]},{format:Ui,encoding:Bi,relation:Ri,path:["bio"]}]}})},reURI:to,tests:[{uri:"https://pronouns.cc/@Alice",shouldMatch:!0},{uri:"https://pronouns.cc/@Alice/",shouldMatch:!0},{uri:"https://pronouns.cc/Alice",shouldMatch:!1},{uri:"https://pronouns.cc/Alice/",shouldMatch:!1}]});const no=/^https:\/\/(?:discord\.gg|discord\.com\/invite)\/(.+)/;var io=Object.freeze({__proto__:null,functions:{postprocess:async(e,t,r)=>(e.profile.display=t.result.inviter.username,{claimData:e,proofData:t})},processURI:function(e){const t=e.match(no);return new $i({about:{id:"discord",name:"Discord",homepage:"https://discord.com"},profile:{display:"Unknown username",uri:null,qr:null},claim:{uriRegularExpression:no.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://discord.com/api/v10/invites/${t[1]}`,fetcher:mi,accessRestriction:Si,data:{url:`https://discord.com/api/v10/invites/${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["guild","description"]},{format:Ui,encoding:Bi,relation:Ri,path:["guild","name"]}]}})},reURI:no,tests:[{uri:"https://discord.com/invite/AbCdEf",shouldMatch:!0},{uri:"https://discord.com/invite/AbCdEfGh",shouldMatch:!0},{uri:"https://discord.gg/AbCdEf",shouldMatch:!0},{uri:"https://discord.gg/AbCdEfGh",shouldMatch:!0},{uri:"https://domain.com/invite/AbCdEf",shouldMatch:!1},{uri:"https://domain.gg/AbCdEf",shouldMatch:!1},{uri:"https://discord.com/invite/",shouldMatch:!1},{uri:"https://discord.gg/",shouldMatch:!1}]});const ao=/^https:\/\/bsky\.app\/profile\/([^/]+)(?:\/?$|\/post\/([^/]+)\/?)/;var oo=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ao),r=new URLSearchParams;return t[2]?r.set("uri",`at://${t[1]}/app.bsky.feed.post/${t[2]}`):r.set("actor",t[1]),new $i({about:{id:"bsky",name:"Bluesky",homepage:"https://bsky.app"},profile:{display:`@${t[1]}`,uri:`https://bsky.app/profile/${t[1]}`,qr:null},claim:{uriRegularExpression:ao.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:t[2]?`https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?${r}`:`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?${r}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:t[2]?["thread","post","record","text"]:["description"]}]}})},reURI:ao,tests:[{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/post/",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/profile/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/post/a1b2c3d4e5/",shouldMatch:!1}]});const so=/^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;const co={aspe:ea,openpgp:ia,dns:oa,irc:ca,xmpp:ha,matrix:fa,telegram:pa,twitter:Aa,reddit:ma,liberapay:wa,lichess:Ia,hackernews:Ba,lobsters:_a,forem:Sa,forgejo:Pa,gitea:Ua,gitlab:Ra,github:Ta,activitypub:Ha,discourse:La,owncast:ja,stackexchange:Za,keybase:Va,opencollective:$a,orcid:eo,pronounscc:ro,discord:io,bsky:oo,sourcehut:Object.freeze({__proto__:null,processURI:function(e){const[,t,r,,n]=e.match(so);return new $i({about:{id:"sourcehut",name:"SourceHut",homepage:"https://sourcehut.org"},profile:{display:t,uri:`https://sr.ht/~${t}`,qr:null},claim:{uriRegularExpression:so.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:`https://git.sr.ht/~${t}/${r}/blob/${n??"main"}/proof.md`,format:Mi}},response:{format:Mi},target:[{format:Ui,encoding:Bi,relation:Ri,path:[]}]}})},reURI:so,tests:[{uri:"https://git.sr.ht/~alice/sourcehut_proof",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/keyoxide_proof/",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/proof_repo/tree/master",shouldMatch:!0},{uri:"https://domain.org/alice/keyoxide_proof",shouldMatch:!1}]})},uo=Object.keys(co),ho="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lo=Symbol("doneWritingPromise"),fo=Symbol("doneWritingResolve"),po=Symbol("doneWritingReject"),go=Symbol("readingIndex");class Ao extends Array{constructor(){super(),this[lo]=new Promise(((e,t)=>{this[fo]=e,this[po]=t})),this[lo].catch((()=>{}))}}function yo(e){return e&&e.getReader&&Array.isArray(e)}function mo(e){if(!yo(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}Ao.prototype.getReader=function(){return void 0===this[go]&&(this[go]=0),{read:async()=>(await this[lo],this[go]===this.length?{value:void 0,done:!0}:{value:this[this[go]++],done:!1})}},Ao.prototype.readToEnd=async function(e){await this[lo];const t=e(this.slice(this[go]));return this.length=0,t},Ao.prototype.clone=function(){const e=new Ao;return e[lo]=this[lo].then((()=>{e.push(...this)})),e},mo.prototype.write=async function(e){this.stream.push(e)},mo.prototype.close=async function(){this.stream[fo]()},mo.prototype.abort=async function(e){return this.stream[po](e),e},mo.prototype.releaseLock=function(){};const bo="object"==typeof ho.process&&"object"==typeof ho.process.versions,wo=bo&&void 0;function vo(e){return yo(e)?"array":ho.ReadableStream&&ho.ReadableStream.prototype.isPrototypeOf(e)?"web":Mo&&Mo.prototype.isPrototypeOf(e)?"ponyfill":wo&&wo.prototype.isPrototypeOf(e)?"node":!(!e||!e.getReader)&&"web-like"}function Io(e){return Uint8Array.prototype.isPrototypeOf(e)}function Eo(e){if(1===e.length)return e[0];let t=0;for(let r=0;r{t||(Bo.isBuffer(n)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),r.enqueue(n),e.pause())})),e.on("end",(()=>{t||r.close()})),e.on("error",(e=>r.error(e)))},pull(){e.resume()},cancel(r){t=!0,e.destroy(r)}})};class e extends Co{constructor(e,t){super(t),this._reader=Oo(e)}async _read(e){try{for(;;){const{done:e,value:t}=await this._reader.read();if(e){this.push(null);break}if(!this.push(t))break}}catch(e){this.destroy(e)}}async _destroy(e,t){this._reader.cancel(e).then(t,t)}}ko=function(t,r){return new e(t,r)}}const So=new WeakSet,Qo=Symbol("externalBuffer");function xo(e){if(this.stream=e,e[Qo]&&(this[Qo]=e[Qo].slice()),yo(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let t=vo(e);if("node"===t&&(e=_o(e)),t){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let r=!1;this._read=async()=>r||So.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{So.add(e)}catch(e){}}}xo.prototype.read=async function(){return this[Qo]&&this[Qo].length?{done:!1,value:this[Qo].shift()}:this._read()},xo.prototype.releaseLock=function(){this[Qo]&&(this.stream[Qo]=this[Qo]),this._releaseLock()},xo.prototype.cancel=function(e){return this._cancel(e)},xo.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:n}=await this.read();if(n+="",r)return t.length?qo(t):void 0;const i=n.indexOf("\n")+1;i&&(e=qo(t.concat(n.substr(0,i))),t=[]),i!==n.length&&t.push(n.substr(i))}return this.unshift(...t),e},xo.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(Jo(t,1)),r},xo.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:n,value:i}=await this.read();if(n)return t.length?qo(t):void 0;if(t.push(i),r+=i.length,r>=e){const r=qo(t);return this.unshift(Jo(r,e)),Jo(r,0,e)}}},xo.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},xo.prototype.unshift=function(...e){this[Qo]||(this[Qo]=[]),1===e.length&&Io(e[0])&&this[Qo].length&&e[0].length&&this[Qo][0].byteOffset>=e[0].length?this[Qo][0]=new Uint8Array(this[Qo][0].buffer,this[Qo][0].byteOffset-e[0].length,this[Qo][0].byteLength+e[0].length):this[Qo].unshift(...e.filter((e=>e&&e.length)))},xo.prototype.readToEnd=async function(e=qo){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};let Po,{ReadableStream:Mo,WritableStream:Uo,TransformStream:Do}=ho;const Ro=bo&&void 0;function Fo(e){let t=vo(e);return"node"===t?_o(e):"web"===t&&Po?Po(e):t?e:new Mo({start(t){t.enqueue(e),t.close()}})}function To(e){if(vo(e))return e;const t=new Ao;return(async()=>{const r=Ko(t);await r.write(e),await r.close()})(),t}function qo(e){return e.some((e=>vo(e)&&!yo(e)))?function(e){e=e.map(Fo);const t=Lo((async function(e){await Promise.all(n.map((t=>async function(e,t){if(vo(e)){if(e.cancel)return e.cancel(t);if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}(t,e))))}));let r=Promise.resolve();const n=e.map(((n,i)=>jo(n,((n,a)=>(r=r.then((()=>Ho(n,t.writable,{preventClose:i!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>yo(e)))?function(e){const t=new Ao;let r=Promise.resolve();return e.forEach(((n,i)=>(r=r.then((()=>Ho(n,t,{preventClose:i!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):Ro&&Ro.isBuffer(e[0])?Ro.concat(e):Eo(e)}function Oo(e){return new xo(e)}function Ko(e){return new mo(e)}async function Ho(e,t,{preventClose:r=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(vo(e)&&!yo(e)){e=Fo(e);try{if(e[Qo]){const r=Ko(t);for(let t=0;t{t=e})),t=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function Go(e,t=(()=>{}),r=(()=>{})){if(yo(e)){const n=new Ao;return(async()=>{const i=Ko(n);try{const n=await Vo(e),a=t(n),o=r();let s;s=void 0!==a&&void 0!==o?qo([a,o]):void 0!==a?a:o,await i.write(s),await i.close()}catch(e){await i.abort(e)}})(),n}if(vo(e))return No(e,{async transform(e,r){try{const n=await t(e);void 0!==n&&r.enqueue(n)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const n=t(e),i=r();return void 0!==n&&void 0!==i?qo([n,i]):void 0!==n?n:i}function jo(e,t){if(vo(e)&&!yo(e)){let r;const n=new Do({start(e){r=e}}),i=Ho(e,n.writable),a=Lo((async function(e){r.error(e),await i,await new Promise(setTimeout)}));return t(n.readable,a.writable),a.readable}e=To(e);const r=new Ao;return t(e,r),r}function zo(e){if(yo(e))return e.clone();if(vo(e)){const t=function(e){if(yo(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(vo(e)){const t=Fo(e).tee();return t[0][Qo]=t[1][Qo]=e[Qo],t}return[Jo(e),Jo(e)]}(e);return Zo(e,t[0]),t[1]}return Jo(e)}function Wo(e){return yo(e)?zo(e):vo(e)?new Mo({start(t){const r=jo(e,(async(e,r)=>{const n=Oo(e),i=Ko(r);try{for(;;){await i.ready;const{done:r,value:a}=await n.read();if(r){try{t.close()}catch(e){}return void await i.close()}try{t.enqueue(a)}catch(e){}await i.write(a)}}catch(e){t.error(e),await i.abort(e)}}));Zo(e,r)}}):Jo(e)}function Zo(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,n])=>{"constructor"!==r&&(n.value?n.value=n.value.bind(t):n.get=n.get.bind(t),Object.defineProperty(e,r,n))}))}function Jo(e,t=0,r=1/0){if(yo(e))throw Error("Not implemented");if(vo(e)){if(t>=0&&r>=0){let n=0;return No(e,{transform(e,i){n=t&&i.enqueue(Jo(e,Math.max(t-n,0),r-n)),n+=e.length):i.terminate()}})}if(t<0&&(r<0||r===1/0)){let n=[];return Go(e,(e=>{e.length>=-t?n=[e]:n.push(e)}),(()=>Jo(qo(n),t,r)))}if(0===t&&r<0){let n;return Go(e,(e=>{const i=n?qo([n,e]):e;if(i.length>=-r)return n=Jo(i,r),Jo(i,t,r);n=i}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),Yo((async()=>Jo(await Vo(e),t,r)))}return e[Qo]&&(e=qo(e[Qo].concat([e]))),!Io(e)||Ro&&Ro.isBuffer(e)?e.slice(t,r):(r===1/0&&(r=e.length),e.subarray(t,r))}async function Vo(e,t=qo){return yo(e)?e.readToEnd(t):vo(e)?Oo(e).readToEnd(t):e}function Yo(e){const t=new Ao;return(async()=>{const r=Ko(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}class $o{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,r=Array(t.length);for(let e=0;eBigInt(0);){const e=r&BigInt(1);r>>=BigInt(1);const a=i*n%t.value;i=e?a:i,n=n*n%t.value}return new $o(i)}modInv(e){const{gcd:t,x:r}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return r.add(e).mod(e)}_egcd(e){let t=BigInt(0),r=BigInt(1),n=BigInt(1),i=BigInt(0),a=this.value;for(e=e.value;e!==BigInt(0);){const o=a/e;let s=t;t=n-o*t,n=s,s=r,r=i-o*r,i=s,s=e,e=a%e,a=s}return{x:new $o(n),y:new $o(i),gcd:new $o(a)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const r=e;e=t%e,t=r}return new $o(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new $o(0),t=new $o(1),r=new $o(-1),n=this.isNegative()?r:e;let i=1;const a=this.clone();for(;!a.irightShift(t).equal(n);)i++;return i}byteLength(){const e=new $o(0),t=new $o(-1),r=this.isNegative()?t:e,n=new $o(8);let i=1;const a=this.clone();for(;!a.irightShift(n).equal(r);)i++;return i}toUint8Array(e="be",t){let r=this.value.toString(16);r.length%2==1&&(r="0"+r);const n=r.length/2,i=new Uint8Array(t||n),a=t?t-n:0;let o=0;for(;o{e[Xo][r]=t}))),void 0!==e[Xo][t])return e[Xo][t];throw Error("Invalid enum value.")}};const ts=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),rs={isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return e instanceof Array},isUint8Array:Io,isStream:vo,readNumber:function(e){let t=0;for(let r=0;r>8*(t-n-1)&255;return r},readDate:function(e){const t=rs.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return rs.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=7+(e[0]<<8|e[1])>>>3;return e.subarray(2,2+t)},leftPad(e,t){const r=new Uint8Array(t),n=t-e.length;return r.set(e,n),r},uint8ArrayToMPI:function(e){const t=rs.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),n=new Uint8Array([(65280&t)>>8,255&t]);return rs.concatUint8Array([n,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t>1);for(let r=0;r>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t=[],r=e.length;let n,i=0;for(;i{if(!rs.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;rr("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return Go(e,r,(()=>r(new Uint8Array,!0)))},concat:qo,concatUint8Array:Eo,equalsUint8Array:function(e,t){if(!rs.isUint8Array(e)||!rs.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let n=0;n>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){return void 0!==ho&&ho.crypto&&ho.crypto.subtle},getBigInteger:async function(){if("undefined"!=typeof BigInt)return $o;{const{default:e}=await Promise.resolve().then((function(){return bm}));return e}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return"undefined"!=typeof navigator?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(e){return!!rs.isString(e)&&/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(e)},canonicalizeEOL:function(e){let t=!1;return Go(e,(e=>{let r;t&&(e=rs.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const n=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&n.push(r);if(!n.length)return e;const i=new Uint8Array(e.length+n.length);let a=0;for(let t=0;tt?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return Go(e,(e=>{let r;13===(e=t&&10!==e[0]?rs.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let n=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const i=r-(10===e[r]?1:0);t&&e.copyWithin(n,t,i),n+=i-t}return e.subarray(0,n)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let n;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){n=e}}))),r(n)}))},selectUint8Array:function(e,t,r){const n=Math.max(t.length,r.length),i=new Uint8Array(n);let a=0;for(let n=0;n{t=rs.concatUint8Array([t,e]);const r=[],n=Math.floor(t.length/45),i=45*n,a=is(t.subarray(0,i));for(let e=0;et.length?is(t)+"\n":""))}function ss(e){let t="";return Go(e,(e=>{t+=e;let r=0;const n=[" ","\t","\r","\n"];for(let e=0;e0&&(i-r)%4!=0;i--)n.includes(t[i])&&r--;const a=as(t.substr(0,i));return t=t.substr(i),a}),(()=>as(t)))}function cs(e){return ss(e.replace(/-/g,"+").replace(/_/g,"/"))}function us(e,t){let r=os(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}ns?(is=e=>ns.from(e).toString("base64"),as=e=>{const t=ns.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(is=e=>btoa(rs.uint8ArrayToString(e)),as=e=>rs.stringToUint8Array(atob(e)));var hs={preferredHashAlgorithm:es.hash.sha256,preferredSymmetricAlgorithm:es.symmetric.aes256,preferredCompressionAlgorithm:es.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:es.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([es.symmetric.aes128,es.symmetric.aes192,es.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([es.hash.md5,es.hash.ripemd]),rejectMessageHashAlgorithms:new Set([es.hash.md5,es.hash.ripemd,es.hash.sha1]),rejectPublicKeyAlgorithms:new Set([es.publicKey.elgamal,es.publicKey.dsa]),rejectCurves:new Set([es.curve.secp256k1])};function ls(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?es.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?es.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?es.armor.signed:/MESSAGE/.test(t[1])?es.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?es.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?es.armor.privateKey:/SIGNATURE/.test(t[1])?es.armor.signature:void 0}function fs(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function ds(e){return os(function(e){let t=13501623;return Go(e,(e=>{const r=gs?Math.floor(e.length/4):0,n=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e>24&255]^ps[1][t>>16&255]^ps[2][t>>8&255]^ps[3][t>>0&255];for(let n=4*r;n>8^ps[0][255&t^e[n]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e))}const ps=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);ps[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)ps[1][e]=ps[0][e]>>8^ps[0][255&ps[0][e]];for(let e=0;e<=255;e++)ps[2][e]=ps[1][e]>>8^ps[0][255&ps[1][e]];for(let e=0;e<=255;e++)ps[3][e]=ps[2][e]>>8^ps[0][255&ps[2][e]];const gs=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function As(e){for(let t=0;t=0&&n!==e.length-1&&(t=e.slice(0,n),r=e.slice(n+1).substr(0,4)),{body:t,checksum:r}}function ms(e,t=hs){return new Promise((async(r,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let o;const s=[];let c,u,h,l=s,f=[],d=ss(jo(e,(async(e,t)=>{const p=Oo(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=rs.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),o)if(c)u||2!==o||(i.test(e)?(f=f.join("\r\n"),u=!0,As(l),l=[],c=!1):f.push(e.replace(/^- /,"")));else if(i.test(e)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(e)){if(As(l),c=!0,u||2!==o){r({text:f,data:d,headers:s,type:o});break}}else l.push(e);else i.test(e)&&(o=ls(e))}}catch(e){return void n(e)}const g=Ko(t);try{for(;;){await g.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=rs.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(i);if(1===t.length)throw Error("Misformed armored text");const n=ys(t[0].slice(0,-1));h=n.checksum,await g.write(n.body);break}await g.write(r)}await g.ready,await g.close()}catch(e){await g.abort(e)}})));d=jo(d,(async(e,r)=>{const n=Vo(ds(Wo(e)));n.catch((()=>{})),await Ho(e,r,{preventClose:!0});const i=Ko(r);try{const e=(await n).replace("\n","");if(h!==e&&(h||t.checksumRequired))throw Error("Ascii armor integrity check failed");await i.ready,await i.close()}catch(e){await i.abort(e)}}))}catch(e){n(e)}})).then((async e=>(yo(e.data)&&(e.data=await Vo(e.data)),e)))}function bs(e,t,r,n,i,a=hs){let o,s;e===es.armor.signed&&(o=t.text,s=t.hash,t=t.data);const c=Wo(t),u=[];switch(e){case es.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+n+"-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP MESSAGE, PART "+r+"/"+n+"-----\n");break;case es.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case es.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push("Hash: "+s+"\n\n"),u.push(o.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP SIGNATURE-----\n");break;case es.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP MESSAGE-----\n");break;case es.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case es.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case es.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP SIGNATURE-----\n")}return rs.concat(u)}class ws{constructor(){this.bytes=""}read(e){return this.bytes=rs.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return rs.stringToUint8Array(this.bytes)}toHex(){return rs.uint8ArrayToHex(rs.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new ws;return t.read(rs.hexToUint8Array(e)),t}static wildcard(){const e=new ws;return e.read(new Uint8Array(8)),e}}var vs=function(){var e,t,r=!1;function n(r,n){var i=e[(t[r]+t[n])%255];return 0!==r&&0!==n||(i=0),i}var i,a,o,s,c=!1;function u(){function u(r){var n,i,a;for(i=a=function(r){var n=e[255-t[r]];return 0===r&&(n=0),n}(r),n=0;n<4;n++)a^=i=255&(i<<1|i>>>7);return 99^a}r||function(){e=[],t=[];var n,i,a=1;for(n=0;n<255;n++)e[n]=a,i=128&a,a<<=1,a&=255,128===i&&(a^=27),a^=e[n],t[e[n]]=n;e[255]=e[0],t[0]=0,r=!0}(),i=[],a=[],o=[[],[],[],[]],s=[[],[],[],[]];for(var h=0;h<256;h++){var l=u(h);i[h]=l,a[l]=h,o[0][h]=n(2,l)<<24|l<<16|l<<8|n(3,l),s[0][l]=n(14,h)<<24|n(9,h)<<16|n(13,h)<<8|n(11,h);for(var f=1;f<4;f++)o[f][h]=o[f-1][h]>>>8|o[f-1][h]<<24,s[f][l]=s[f-1][l]>>>8|s[f-1][l]<<24}c=!0}var h=function(e,t){c||u();var r=new Uint32Array(t);r.set(i,512),r.set(a,768);for(var n=0;n<4;n++)r.set(o[n],4096+1024*n>>2),r.set(s[n],8192+1024*n>>2);var h=function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0;var B=new e.Uint32Array(r),C=new e.Uint8Array(r);function _(e,t,r,s,c,u,h,l){e=e|0;t=t|0;r=r|0;s=s|0;c=c|0;u=u|0;h=h|0;l=l|0;var f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;f=r|0x400,d=r|0x800,p=r|0xc00;c=c^B[(e|0)>>2],u=u^B[(e|4)>>2],h=h^B[(e|8)>>2],l=l^B[(e|12)>>2];for(b=16;(b|0)<=s<<4;b=b+16|0){g=B[(r|c>>22&1020)>>2]^B[(f|u>>14&1020)>>2]^B[(d|h>>6&1020)>>2]^B[(p|l<<2&1020)>>2]^B[(e|b|0)>>2],A=B[(r|u>>22&1020)>>2]^B[(f|h>>14&1020)>>2]^B[(d|l>>6&1020)>>2]^B[(p|c<<2&1020)>>2]^B[(e|b|4)>>2],y=B[(r|h>>22&1020)>>2]^B[(f|l>>14&1020)>>2]^B[(d|c>>6&1020)>>2]^B[(p|u<<2&1020)>>2]^B[(e|b|8)>>2],m=B[(r|l>>22&1020)>>2]^B[(f|c>>14&1020)>>2]^B[(d|u>>6&1020)>>2]^B[(p|h<<2&1020)>>2]^B[(e|b|12)>>2];c=g,u=A,h=y,l=m}n=B[(t|c>>22&1020)>>2]<<24^B[(t|u>>14&1020)>>2]<<16^B[(t|h>>6&1020)>>2]<<8^B[(t|l<<2&1020)>>2]^B[(e|b|0)>>2],i=B[(t|u>>22&1020)>>2]<<24^B[(t|h>>14&1020)>>2]<<16^B[(t|l>>6&1020)>>2]<<8^B[(t|c<<2&1020)>>2]^B[(e|b|4)>>2],a=B[(t|h>>22&1020)>>2]<<24^B[(t|l>>14&1020)>>2]<<16^B[(t|c>>6&1020)>>2]<<8^B[(t|u<<2&1020)>>2]^B[(e|b|8)>>2],o=B[(t|l>>22&1020)>>2]<<24^B[(t|c>>14&1020)>>2]<<16^B[(t|u>>6&1020)>>2]<<8^B[(t|h<<2&1020)>>2]^B[(e|b|12)>>2]}function k(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;_(0x0000,0x0800,0x1000,E,e,t,r,n)}function S(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0;_(0x0400,0x0c00,0x2000,E,e,n,r,t);a=i,i=o,o=a}function Q(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s^e,c^t,u^r,h^l);s=n,c=i,u=a,h=o}function x(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;var f=0;_(0x0400,0x0c00,0x2000,E,e,l,r,t);f=i,i=o,o=f;n=n^s,i=i^c,a=a^u,o=o^h;s=e,c=t,u=r,h=l}function P(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n=n^e,c=i=i^t,u=a=a^r,h=o=o^l}function M(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);n=n^e,i=i^t,a=a^r,o=o^l;s=e,c=t,u=r,h=l}function U(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n,c=i,u=a,h=o;n=n^e,i=i^t,a=a^r,o=o^l}function D(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;_(0x0000,0x0800,0x1000,E,l,f,d,p);p=~m&p|m&p+1;d=~y&d|y&d+((p|0)==0);f=~A&f|A&f+((d|0)==0);l=~g&l|g&l+((f|0)==0);n=n^e;i=i^t;a=a^r;o=o^s}function R(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0,o=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0;e=e^s,t=t^c,r=r^u,n=n^h;i=b|0,a=w|0,o=v|0,l=I|0;for(;(A|0)<128;A=A+1|0){if(i>>>31){f=f^e,d=d^t,p=p^r,g=g^n}i=i<<1|a>>>31,a=a<<1|o>>>31,o=o<<1|l>>>31,l=l<<1;y=n&1;n=n>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(y)e=e^0xe1000000}s=f,c=d,u=p,h=g}function F(e){e=e|0;E=e}function T(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;n=e,i=t,a=r,o=s}function q(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;s=e,c=t,u=r,h=n}function O(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;l=e,f=t,d=r,p=n}function K(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;g=e,A=t,y=r,m=n}function H(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;p=~m&p|m&n,d=~y&d|y&r,f=~A&f|A&t,l=~g&l|g&e}function N(e){e=e|0;if(e&15)return-1;C[e|0]=n>>>24,C[e|1]=n>>>16&255,C[e|2]=n>>>8&255,C[e|3]=n&255,C[e|4]=i>>>24,C[e|5]=i>>>16&255,C[e|6]=i>>>8&255,C[e|7]=i&255,C[e|8]=a>>>24,C[e|9]=a>>>16&255,C[e|10]=a>>>8&255,C[e|11]=a&255,C[e|12]=o>>>24,C[e|13]=o>>>16&255,C[e|14]=o>>>8&255,C[e|15]=o&255;return 16}function L(e){e=e|0;if(e&15)return-1;C[e|0]=s>>>24,C[e|1]=s>>>16&255,C[e|2]=s>>>8&255,C[e|3]=s&255,C[e|4]=c>>>24,C[e|5]=c>>>16&255,C[e|6]=c>>>8&255,C[e|7]=c&255,C[e|8]=u>>>24,C[e|9]=u>>>16&255,C[e|10]=u>>>8&255,C[e|11]=u&255,C[e|12]=h>>>24,C[e|13]=h>>>16&255,C[e|14]=h>>>8&255,C[e|15]=h&255;return 16}function G(){k(0,0,0,0);b=n,w=i,v=a,I=o}function j(e,t,r){e=e|0;t=t|0;r=r|0;var s=0;if(t&15)return-1;while((r|0)>=16){W[e&7](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);C[t|0]=n>>>24,C[t|1]=n>>>16&255,C[t|2]=n>>>8&255,C[t|3]=n&255,C[t|4]=i>>>24,C[t|5]=i>>>16&255,C[t|6]=i>>>8&255,C[t|7]=i&255,C[t|8]=a>>>24,C[t|9]=a>>>16&255,C[t|10]=a>>>8&255,C[t|11]=a&255,C[t|12]=o>>>24,C[t|13]=o>>>16&255,C[t|14]=o>>>8&255,C[t|15]=o&255;s=s+16|0,t=t+16|0,r=r-16|0}return s|0}function z(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){Z[e&1](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);n=n+16|0,t=t+16|0,r=r-16|0}return n|0}var W=[k,S,Q,x,P,M,U,D];var Z=[Q,R];return{set_rounds:F,set_state:T,set_iv:q,set_nonce:O,set_mask:K,set_counter:H,get_state:N,get_iv:L,gcm_init:G,cipher:j,mac:z}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},e,t);return h.set_key=function(e,t,n,a,o,c,u,l,f){var d=r.subarray(0,60),p=r.subarray(256,316);d.set([t,n,a,o,c,u,l,f]);for(var g=e,A=1;g<4*e+28;g++){var y=d[g-1];(g%e==0||8===e&&g%e==4)&&(y=i[y>>>24]<<24^i[y>>>16&255]<<16^i[y>>>8&255]<<8^i[255&y]),g%e==0&&(y=y<<8^y>>>24^A<<24,A=A<<1^(128&A?27:0)),d[g]=d[g-e]^y}for(var m=0;m=g-4?y:s[0][i[y>>>24]]^s[1][i[y>>>16&255]]^s[2][i[y>>>8&255]]^s[3][i[255&y]];h.set_rounds(e+5)},h};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function Is(e){return e instanceof Uint8Array}function Es(e,t){const r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return e||new Uint8Array(new ArrayBuffer(r))}function Bs(e,t,r,n,i){const a=e.length-t,o=ae+t.length),0),r=new Uint8Array(t);let n=0;for(let t=0;t>2,i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12),n>16?i.getUint32(16):0,n>16?i.getUint32(20):0,n>24?i.getUint32(24):0,n>24?i.getUint32(28):0),void 0!==t){if(16!==t.length)throw new ks("illegal iv size");let e=new DataView(t.buffer,t.byteOffset,t.byteLength);r.set_iv(e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12))}else r.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!Is(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),n=vs.ENC[this.mode],i=vs.HEAP_DATA,a=this.pos,o=this.len,s=0,c=e.length||0,u=0,h=0,l=new Uint8Array(o+c&-16);for(;c>0;)h=Bs(t,a+o,e,s,c),o+=h,s+=h,c-=h,h=r.cipher(n,i+a,o),h&&l.set(t.subarray(a,a+h),u),u+=h,h0;)f=Bs(t,a+o,e,s,c),o+=f,s+=f,c-=f,f=r.cipher(n,i+a,o-(c?0:l)),f&&d.set(t.subarray(a,a+f),u),u+=f,f0){if(a%16){if(this.hasOwnProperty("padding"))throw new ks("data length must be a multiple of the block size");a+=16-a%16}if(t.cipher(r,n+i,a),this.hasOwnProperty("padding")&&this.padding){let t=e[i+o-1];if(t<1||t>16||t>o)throw new Ss("bad padding");let r=0;for(let n=t;n>1;n--)r|=t^e[i+o-n];if(r)throw new Ss("bad padding");o-=t}}const s=new Uint8Array(o);return o>0&&s.set(e.subarray(i,i+o)),this.pos=0,this.len=0,this.release_asm(),s}}class Ms{static encrypt(e,t,r=!1){return new Ms(t,r).encrypt(e)}static decrypt(e,t,r=!1){return new Ms(t,r).decrypt(e)}constructor(e,t=!1,r){this.aes=r||new Ps(e,void 0,t,"ECB")}encrypt(e){return Cs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Cs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Us(e){const t=function(e){const t=new Ms(e);this.encrypt=function(e){return t.encrypt(e)},this.decrypt=function(e){return t.decrypt(e)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=e/8,t}function Ds(e,t,r,n,i,a){const o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],c=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let p,g,A,y,m,b,w,v,I,E,B,C,_,k,S=0,Q=t.length;const x=32===e.length?3:9;v=3===x?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(e,t){const r=8-e.length%8;let n;if(2===t&&r<8)n=32;else if(1===t)n=r;else{if(t||!(r<8)){if(8===r)return e;throw Error("des: invalid padding")}n=0}const i=new Uint8Array(e.length+r);for(let t=0;t>>4^w),w^=A,b^=A<<4,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,b=b<<1|b>>>31,w=w<<1|w>>>31,g=0;g>>4|w<<28)^e[p+1],A=b,b=w,w=A^(s[y>>>24&63]|u[y>>>16&63]|l[y>>>8&63]|d[63&y]|o[m>>>24&63]|c[m>>>16&63]|h[m>>>8&63]|f[63&m]);A=b,b=w,w=A}b=b>>>1|b<<31,w=w>>>1|w<<31,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=252645135&(b>>>4^w),w^=A,b^=A<<4,1===n&&(r?(I=b,B=w):(b^=E,w^=C)),P[M++]=b>>>24,P[M++]=b>>>16&255,P[M++]=b>>>8&255,P[M++]=255&b,P[M++]=w>>>24,P[M++]=w>>>16&255,P[M++]=w>>>8&255,P[M++]=255&w}return r||(P=function(e,t){let r,n=null;if(2===t)r=32;else if(1===t)n=e[e.length-1];else{if(t)throw Error("des: invalid padding");r=0}if(!n){for(n=1;e[e.length-n]===r;)n++;n--}return e.subarray(0,e.length-n)}(P,a)),P}function Rs(e){const t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],p=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length>8?3:1,A=Array(32*g),y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let m,b,w,v=0,I=0;for(let E=0;E>>4^E),E^=w,g^=w<<4,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=858993459&(g>>>2^E),E^=w,g^=w<<2,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=16711935&(E>>>8^g),g^=w,E^=w<<8,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=g<<8|E>>>20&240,g=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=w;for(let e=0;e<16;e++)y[e]?(g=g<<2|g>>>26,E=E<<2|E>>>26):(g=g<<1|g>>>27,E=E<<1|E>>>27),g&=-15,E&=-15,m=t[g>>>28]|r[g>>>24&15]|n[g>>>20&15]|i[g>>>16&15]|a[g>>>12&15]|o[g>>>8&15]|s[g>>>4&15],b=c[E>>>28]|u[E>>>24&15]|h[E>>>20&15]|l[E>>>16&15]|f[E>>>12&15]|d[E>>>8&15]|p[E>>>4&15],w=65535&(b>>>16^m),A[I++]=m^w,A[I++]=b^w<<16}return A}function Fs(e){this.key=[];for(let t=0;t<3;t++)this.key.push(new Uint8Array(e.subarray(8*t,8*t+8)));this.encrypt=function(e){return Ds(Rs(this.key[2]),Ds(Rs(this.key[1]),Ds(Rs(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Ts(){this.BlockSize=8,this.KeySize=16,this.setKey=function(e){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),e.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(e),!0},this.reset=function(){for(let e=0;e<16;e++)this.masking[e]=0,this.rotate[e]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>>16&255,t[a+6]=s>>>8&255,t[a+7]=255&s}return t},this.decrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>16&255,t[a+6]=s>>8&255,t[a+7]=255&s}return t};const e=[,,,,];e[0]=[,,,,],e[0][0]=[4,0,13,15,12,14,8],e[0][1]=[5,2,16,18,17,19,10],e[0][2]=[6,3,23,22,21,20,9],e[0][3]=[7,1,26,25,27,24,11],e[1]=[,,,,],e[1][0]=[0,6,21,23,20,22,16],e[1][1]=[1,4,0,2,1,3,18],e[1][2]=[2,5,7,6,5,4,17],e[1][3]=[3,7,10,9,11,8,19],e[2]=[,,,,],e[2][0]=[4,0,13,15,12,14,8],e[2][1]=[5,2,16,18,17,19,10],e[2][2]=[6,3,23,22,21,20,9],e[2][3]=[7,1,26,25,27,24,11],e[3]=[,,,,],e[3][0]=[0,6,21,23,20,22,16],e[3][1]=[1,4,0,2,1,3,18],e[3][2]=[2,5,7,6,5,4,17],e[3][3]=[3,7,10,9,11,8,19];const t=[,,,,];function r(e,t,r){const n=t+e,i=n<>>32-r;return(a[0][i>>>24]^a[1][i>>>16&255])-a[2][i>>>8&255]+a[3][255&i]}function n(e,t,r){const n=t^e,i=n<>>32-r;return a[0][i>>>24]-a[1][i>>>16&255]+a[2][i>>>8&255]^a[3][255&i]}function i(e,t,r){const n=t-e,i=n<>>32-r;return(a[0][i>>>24]+a[1][i>>>16&255]^a[2][i>>>8&255])-a[3][255&i]}t[0]=[,,,,],t[0][0]=[24,25,23,22,18],t[0][1]=[26,27,21,20,22],t[0][2]=[28,29,19,18,25],t[0][3]=[30,31,17,16,28],t[1]=[,,,,],t[1][0]=[3,2,12,13,8],t[1][1]=[1,0,14,15,13],t[1][2]=[7,6,8,9,3],t[1][3]=[5,4,10,11,7],t[2]=[,,,,],t[2][0]=[19,18,28,29,25],t[2][1]=[17,16,30,31,28],t[2][2]=[23,22,24,25,18],t[2][3]=[21,20,26,27,22],t[3]=[,,,,],t[3][0]=[8,9,7,6,3],t[3][1]=[10,11,5,4,7],t[3][2]=[12,13,3,2,8],t[3][3]=[14,15,1,0,13],this.keySchedule=function(r){const n=[,,,,,,,,],i=Array(32);let o;for(let e=0;e<4;e++)o=4*e,n[e]=r[o]<<24|r[o+1]<<16|r[o+2]<<8|r[o+3];const s=[6,7,4,5];let c,u=0;for(let r=0;r<2;r++)for(let r=0;r<4;r++){for(o=0;o<4;o++){const t=e[r][o];c=n[t[1]],c^=a[4][n[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=a[5][n[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=a[6][n[t[4]>>>2]>>>24-8*(3&t[4])&255],c^=a[7][n[t[5]>>>2]>>>24-8*(3&t[5])&255],c^=a[s[o]][n[t[6]>>>2]>>>24-8*(3&t[6])&255],n[t[0]]=c}for(o=0;o<4;o++){const e=t[r][o];c=a[4][n[e[0]>>>2]>>>24-8*(3&e[0])&255],c^=a[5][n[e[1]>>>2]>>>24-8*(3&e[1])&255],c^=a[6][n[e[2]>>>2]>>>24-8*(3&e[2])&255],c^=a[7][n[e[3]>>>2]>>>24-8*(3&e[3])&255],c^=a[4+o][n[e[4]>>>2]>>>24-8*(3&e[4])&255],i[u]=c,u++}}for(let e=0;e<16;e++)this.masking[e]=i[e],this.rotate[e]=31&i[16+e]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function qs(e){this.cast5=new Ts,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Fs.keySize=Fs.prototype.keySize=24,Fs.blockSize=Fs.prototype.blockSize=8,qs.blockSize=qs.prototype.blockSize=8,qs.keySize=qs.prototype.keySize=16;const Os=4294967295;function Ks(e,t){return(e<>>32-t)&Os}function Hs(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Ns(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function Ls(e,t){return e>>>8*t&255}function Gs(e){this.tf=function(){let e=null,t=null,r=-1,n=[],i=[[],[],[],[]];function a(e){return i[0][Ls(e,0)]^i[1][Ls(e,1)]^i[2][Ls(e,2)]^i[3][Ls(e,3)]}function o(e){return i[0][Ls(e,3)]^i[1][Ls(e,0)]^i[2][Ls(e,1)]^i[3][Ls(e,2)]}function s(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Ks(t[2]^r+i+n[4*e+8]&Os,31),t[3]=Ks(t[3],1)^r+2*i+n[4*e+9]&Os,r=a(t[2]),i=o(t[3]),t[0]=Ks(t[0]^r+i+n[4*e+10]&Os,31),t[1]=Ks(t[1],1)^r+2*i+n[4*e+11]&Os}function c(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Ks(t[2],1)^r+i+n[4*e+10]&Os,t[3]=Ks(t[3]^r+2*i+n[4*e+11]&Os,31),r=a(t[2]),i=o(t[3]),t[0]=Ks(t[0],1)^r+i+n[4*e+8]&Os,t[1]=Ks(t[1]^r+2*i+n[4*e+9]&Os,31)}return{name:"twofish",blocksize:16,open:function(t){let r,a,o,s,c;e=t;const u=[],h=[],l=[];let f;const d=[];let p,g,A;const y=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],m=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],b=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],w=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],v=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],I=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],E=[[],[]],B=[[],[],[],[]];function C(e){return e^e>>2^[0,90,180,238][3&e]}function _(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function k(e,t){let r,n,i;for(r=0;r<8;r++)n=t>>>24,t=t<<8&Os|e>>>24,e=e<<8&Os,i=n<<1,128&n&&(i^=333),t^=n^i<<16,i^=n>>>1,1&n&&(i^=166),t^=i<<24|i<<8;return t}function S(e,t){const r=t>>4,n=15&t,i=y[e][r^n],a=m[e][v[n]^I[r]];return w[e][v[a]^I[i]]<<4|b[e][i^a]}function Q(e,t){let r=Ls(e,0),n=Ls(e,1),i=Ls(e,2),a=Ls(e,3);switch(f){case 4:r=E[1][r]^Ls(t[3],0),n=E[0][n]^Ls(t[3],1),i=E[0][i]^Ls(t[3],2),a=E[1][a]^Ls(t[3],3);case 3:r=E[1][r]^Ls(t[2],0),n=E[1][n]^Ls(t[2],1),i=E[0][i]^Ls(t[2],2),a=E[0][a]^Ls(t[2],3);case 2:r=E[0][E[0][r]^Ls(t[1],0)]^Ls(t[0],0),n=E[0][E[1][n]^Ls(t[1],1)]^Ls(t[0],1),i=E[1][E[0][i]^Ls(t[1],2)]^Ls(t[0],2),a=E[1][E[1][a]^Ls(t[1],3)]^Ls(t[0],3)}return B[0][r]^B[1][n]^B[2][i]^B[3][a]}for(e=e.slice(0,32),r=e.length;16!==r&&24!==r&&32!==r;)e[r++]=0;for(r=0;r>2]=Hs(e,r);for(r=0;r<256;r++)E[0][r]=S(0,r),E[1][r]=S(1,r);for(r=0;r<256;r++)p=E[1][r],g=C(p),A=_(p),B[0][r]=p+(g<<8)+(A<<16)+(A<<24),B[2][r]=g+(A<<8)+(p<<16)+(A<<24),p=E[0][r],g=C(p),A=_(p),B[1][r]=A+(A<<8)+(g<<16)+(p<<24),B[3][r]=g+(p<<8)+(A<<16)+(g<<24);for(f=l.length/2,r=0;r=0;e--)c(e,a);Ns(t,r,a[2]^n[0]),Ns(t,r+4,a[3]^n[1]),Ns(t,r+8,a[0]^n[2]),Ns(t,r+12,a[1]^n[3]),r+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function js(){}function zs(e){this.bf=new js,this.bf.init(e),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Gs.keySize=Gs.prototype.keySize=32,Gs.blockSize=Gs.prototype.blockSize=16,js.prototype.BLOCKSIZE=8,js.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],js.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],js.prototype.NN=16,js.prototype._clean=function(e){return e<0&&(e=2147483648+(2147483647&e)),e},js.prototype._F=function(e){let t;const r=255&e,n=255&(e>>>=8),i=255&(e>>>=8),a=255&(e>>>=8);return t=this.sboxes[0][a]+this.sboxes[1][i],t^=this.sboxes[2][n],t+=this.sboxes[3][r],t},js.prototype._encryptBlock=function(e){let t,r=e[0],n=e[1];for(t=0;t>>24-8*t&255,i[t+n]=r[1]>>>24-8*t&255;return i},js.prototype._decryptBlock=function(e){let t,r=e[0],n=e[1];for(t=this.NN+1;t>1;--t){r^=this.parray[t],n=this._F(r)^n;const e=r;r=n,n=e}r^=this.parray[1],n^=this.parray[0],e[0]=this._clean(n),e[1]=this._clean(r)},js.prototype.init=function(e){let t,r=0;for(this.parray=[],t=0;t=e.length&&(r=0);this.parray[t]=this.PARRAY[t]^n}for(this.sboxes=[],t=0;t<4;++t)for(this.sboxes[t]=[],r=0;r<256;++r)this.sboxes[t][r]=this.SBOXES[t][r];const n=[0,0];for(t=0;t>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=t+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=r+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=c+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=u+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=h+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=l+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=f+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=d+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=p+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=g+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=A+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=y+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=m+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=b+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=w+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=m^d^r^e;S=_<<1|_>>>31;k=S+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=b^p^c^t;Q=_<<1|_>>>31;k=Q+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=w^g^u^r;x=_<<1|_>>>31;k=x+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=S^A^h^c;P=_<<1|_>>>31;k=P+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Q^y^l^u;M=_<<1|_>>>31;k=M+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=x^m^f^h;U=_<<1|_>>>31;k=U+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=P^b^d^l;D=_<<1|_>>>31;k=D+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=M^w^p^f;R=_<<1|_>>>31;k=R+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=U^S^g^d;F=_<<1|_>>>31;k=F+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=D^Q^A^p;T=_<<1|_>>>31;k=T+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=R^x^y^g;q=_<<1|_>>>31;k=q+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=F^P^m^A;O=_<<1|_>>>31;k=O+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=T^M^b^y;K=_<<1|_>>>31;k=K+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=q^U^w^m;H=_<<1|_>>>31;k=H+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=O^D^S^b;N=_<<1|_>>>31;k=N+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=K^R^Q^w;L=_<<1|_>>>31;k=L+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=H^F^x^S;G=_<<1|_>>>31;k=G+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=N^T^P^Q;j=_<<1|_>>>31;k=j+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=L^q^M^x;z=_<<1|_>>>31;k=z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=G^O^U^P;W=_<<1|_>>>31;k=W+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=j^K^D^M;Z=_<<1|_>>>31;k=Z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=z^H^R^U;J=_<<1|_>>>31;k=J+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=W^N^F^D;V=_<<1|_>>>31;k=V+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Z^L^T^R;Y=_<<1|_>>>31;k=Y+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=J^G^q^F;$=_<<1|_>>>31;k=$+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=V^j^O^T;X=_<<1|_>>>31;k=X+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Y^z^K^q;ee=_<<1|_>>>31;k=ee+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=$^W^H^O;te=_<<1|_>>>31;k=te+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=X^Z^N^K;re=_<<1|_>>>31;k=re+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ee^J^L^H;ne=_<<1|_>>>31;k=ne+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=te^V^G^N;ie=_<<1|_>>>31;k=ie+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=re^Y^j^L;ae=_<<1|_>>>31;k=ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ne^$^z^G;oe=_<<1|_>>>31;k=oe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ie^X^W^j;se=_<<1|_>>>31;k=se+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ae^ee^Z^z;ce=_<<1|_>>>31;k=ce+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=oe^te^J^W;ue=_<<1|_>>>31;k=ue+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=se^re^V^Z;he=_<<1|_>>>31;k=he+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ce^ne^Y^J;le=_<<1|_>>>31;k=le+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ue^ie^$^V;fe=_<<1|_>>>31;k=fe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=he^ae^X^Y;de=_<<1|_>>>31;k=de+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=le^oe^ee^$;pe=_<<1|_>>>31;k=pe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=fe^se^te^X;ge=_<<1|_>>>31;k=ge+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=de^ce^re^ee;Ae=_<<1|_>>>31;k=Ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=pe^ue^ne^te;ye=_<<1|_>>>31;k=ye+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ge^he^ie^re;me=_<<1|_>>>31;k=me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ae^le^ae^ne;be=_<<1|_>>>31;k=be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ye^fe^oe^ie;we=_<<1|_>>>31;k=we+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=me^de^se^ae;ve=_<<1|_>>>31;k=ve+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=be^pe^ce^oe;Ie=_<<1|_>>>31;k=Ie+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=we^ge^ue^se;Ee=_<<1|_>>>31;k=Ee+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ve^Ae^he^ce;Be=_<<1|_>>>31;k=Be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ie^ye^le^ue;Ce=_<<1|_>>>31;k=Ce+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ee^me^fe^he;_e=_<<1|_>>>31;k=_e+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Be^be^de^le;ke=_<<1|_>>>31;k=ke+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ce^we^pe^fe;Se=_<<1|_>>>31;k=Se+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=_e^ve^ge^de;Qe=_<<1|_>>>31;k=Qe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ke^Ie^Ae^pe;xe=_<<1|_>>>31;k=xe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Se^Ee^ye^ge;Pe=_<<1|_>>>31;k=Pe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Qe^Be^me^Ae;Me=_<<1|_>>>31;k=Me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=xe^Ce^be^ye;Ue=_<<1|_>>>31;k=Ue+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Pe^_e^we^me;De=_<<1|_>>>31;k=De+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Me^ke^ve^be;Re=_<<1|_>>>31;k=Re+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ue^Se^Ie^we;Fe=_<<1|_>>>31;k=Fe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=De^Qe^Ee^ve;Te=_<<1|_>>>31;k=Te+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;n=n+v|0;i=i+I|0;a=a+E|0;o=o+B|0;s=s+C|0}function I(e){e=e|0;v(w[e|0]<<24|w[e|1]<<16|w[e|2]<<8|w[e|3],w[e|4]<<24|w[e|5]<<16|w[e|6]<<8|w[e|7],w[e|8]<<24|w[e|9]<<16|w[e|10]<<8|w[e|11],w[e|12]<<24|w[e|13]<<16|w[e|14]<<8|w[e|15],w[e|16]<<24|w[e|17]<<16|w[e|18]<<8|w[e|19],w[e|20]<<24|w[e|21]<<16|w[e|22]<<8|w[e|23],w[e|24]<<24|w[e|25]<<16|w[e|26]<<8|w[e|27],w[e|28]<<24|w[e|29]<<16|w[e|30]<<8|w[e|31],w[e|32]<<24|w[e|33]<<16|w[e|34]<<8|w[e|35],w[e|36]<<24|w[e|37]<<16|w[e|38]<<8|w[e|39],w[e|40]<<24|w[e|41]<<16|w[e|42]<<8|w[e|43],w[e|44]<<24|w[e|45]<<16|w[e|46]<<8|w[e|47],w[e|48]<<24|w[e|49]<<16|w[e|50]<<8|w[e|51],w[e|52]<<24|w[e|53]<<16|w[e|54]<<8|w[e|55],w[e|56]<<24|w[e|57]<<16|w[e|58]<<8|w[e|59],w[e|60]<<24|w[e|61]<<16|w[e|62]<<8|w[e|63])}function E(e){e=e|0;w[e|0]=n>>>24;w[e|1]=n>>>16&255;w[e|2]=n>>>8&255;w[e|3]=n&255;w[e|4]=i>>>24;w[e|5]=i>>>16&255;w[e|6]=i>>>8&255;w[e|7]=i&255;w[e|8]=a>>>24;w[e|9]=a>>>16&255;w[e|10]=a>>>8&255;w[e|11]=a&255;w[e|12]=o>>>24;w[e|13]=o>>>16&255;w[e|14]=o>>>8&255;w[e|15]=o&255;w[e|16]=s>>>24;w[e|17]=s>>>16&255;w[e|18]=s>>>8&255;w[e|19]=s&255}function B(){n=0x67452301;i=0xefcdab89;a=0x98badcfe;o=0x10325476;s=0xc3d2e1f0;c=u=0}function C(e,t,r,h,l,f,d){e=e|0;t=t|0;r=r|0;h=h|0;l=l|0;f=f|0;d=d|0;n=e;i=t;a=r;o=h;s=l;c=f;u=d}function _(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){I(e);e=e+64|0;t=t-64|0;r=r+64|0}c=c+r|0;if(c>>>0>>0)u=u+1|0;return r|0}function k(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=_(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;c=c+t|0;if(c>>>0>>0)u=u+1|0;w[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)w[e|i]=0x00;I(e);t=0;w[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)w[e|i]=0;w[e|56]=u>>>21&255;w[e|57]=u>>>13&255;w[e|58]=u>>>5&255;w[e|59]=u<<3&255|c>>>29;w[e|60]=c>>>21&255;w[e|61]=c>>>13&255;w[e|62]=c>>>5&255;w[e|63]=c<<3&255;I(e);if(~r)E(r);return n|0}function S(){n=h;i=l;a=f;o=d;s=p;c=64;u=0}function Q(){n=g;i=A;a=y;o=m;s=b;c=64;u=0}function x(e,t,r,w,I,E,C,_,k,S,Q,x,P,M,U,D){e=e|0;t=t|0;r=r|0;w=w|0;I=I|0;E=E|0;C=C|0;_=_|0;k=k|0;S=S|0;Q=Q|0;x=x|0;P=P|0;M=M|0;U=U|0;D=D|0;B();v(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,w^0x5c5c5c5c,I^0x5c5c5c5c,E^0x5c5c5c5c,C^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,S^0x5c5c5c5c,Q^0x5c5c5c5c,x^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,U^0x5c5c5c5c,D^0x5c5c5c5c);g=n;A=i;y=a;m=o;b=s;B();v(e^0x36363636,t^0x36363636,r^0x36363636,w^0x36363636,I^0x36363636,E^0x36363636,C^0x36363636,_^0x36363636,k^0x36363636,S^0x36363636,Q^0x36363636,x^0x36363636,P^0x36363636,M^0x36363636,U^0x36363636,D^0x36363636);h=n;l=i;f=a;d=o;p=s;c=64;u=0}function P(e,t,r){e=e|0;t=t|0;r=r|0;var c=0,u=0,h=0,l=0,f=0,d=0;if(e&63)return-1;if(~r)if(r&31)return-1;d=k(e,t,-1)|0;c=n,u=i,h=a,l=o,f=s;Q();v(c,u,h,l,f,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)E(r);return d|0}function M(e,t,r,c,u){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;var h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~u)if(u&31)return-1;w[e+t|0]=r>>>24;w[e+t+1|0]=r>>>16&255;w[e+t+2|0]=r>>>8&255;w[e+t+3|0]=r&255;P(e,t+4|0,-1)|0;h=g=n,l=A=i,f=y=a,d=m=o,p=b=s;c=c-1|0;while((c|0)>0){S();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;Q();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;h=h^n;l=l^i;f=f^a;d=d^o;p=p^s;c=c-1|0}n=h;i=l;a=f;o=d;s=p;if(~u)E(u);return 0}return{reset:B,init:C,process:_,finish:k,hmac_reset:S,hmac_init:x,hmac_finish:P,pbkdf2_generate_block:M}};class $s{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(null!==this.result)throw new _s("state must be reset before processing new data");const{asm:t,heap:r}=this.acquire_asm();let n=this.pos,i=this.len,a=0,o=e.length,s=0;for(;o>0;)s=Bs(r,n+i,e,a,o),i+=s,a+=s,o-=s,s=t.process(n,i),n+=s,i-=s,i||(n=0);return this.pos=n,this.len=i,this}finish(){if(null!==this.result)throw new _s("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const Xs=[],ec=[];class tc extends $s{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Xs.pop()||Es(),this.asm=ec.pop()||Ys({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Xs.push(this.heap),ec.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new tc).process(e).finish().result}}tc.NAME="sha1",tc.heap_pool=[],tc.asm_pool=[],tc.asm_function=Ys;const rc=[],nc=[];class ic extends $s{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=rc.pop()||Es(),this.asm=nc.pop()||function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=new e.Uint8Array(r);function x(e,t,r,l,f,d,p,g,A,y,m,b,w,v,I,E){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;w=w|0;v=v|0;I=I|0;E=E|0;var B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0;B=n;C=i;_=a;k=o;S=s;Q=c;x=u;P=h;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x428a2f98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x71374491|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb5c0fbcf|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xe9b5dba5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x3956c25b|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x59f111f1|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x923f82a4|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xab1c5ed5|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xd807aa98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x12835b01|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x243185be|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x550c7dc3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x72be5d74|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x80deb1fe|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x9bdc06a7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc19bf174|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xe49b69c1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xefbe4786|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x0fc19dc6|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x240ca1cc|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x2de92c6f|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4a7484aa|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5cb0a9dc|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x76f988da|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x983e5152|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa831c66d|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb00327c8|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xbf597fc7|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xc6e00bf3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd5a79147|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x06ca6351|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x14292967|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x27b70a85|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x2e1b2138|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x4d2c6dfc|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x53380d13|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x650a7354|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x766a0abb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x81c2c92e|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x92722c85|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xa2bfe8a1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa81a664b|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xc24b8b70|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xc76c51a3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xd192e819|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd6990624|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xf40e3585|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x106aa070|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x19a4c116|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x1e376c08|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x2748774c|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x34b0bcb5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x391c0cb3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4ed8aa4a|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5b9cca4f|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x682e6ff3|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x748f82ee|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x78a5636f|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x84c87814|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x8cc70208|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x90befffa|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xa4506ceb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xbef9a3f7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc67178f2|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;n=n+B|0;i=i+C|0;a=a+_|0;o=o+k|0;s=s+S|0;c=c+Q|0;u=u+x|0;h=h+P|0}function P(e){e=e|0;x(Q[e|0]<<24|Q[e|1]<<16|Q[e|2]<<8|Q[e|3],Q[e|4]<<24|Q[e|5]<<16|Q[e|6]<<8|Q[e|7],Q[e|8]<<24|Q[e|9]<<16|Q[e|10]<<8|Q[e|11],Q[e|12]<<24|Q[e|13]<<16|Q[e|14]<<8|Q[e|15],Q[e|16]<<24|Q[e|17]<<16|Q[e|18]<<8|Q[e|19],Q[e|20]<<24|Q[e|21]<<16|Q[e|22]<<8|Q[e|23],Q[e|24]<<24|Q[e|25]<<16|Q[e|26]<<8|Q[e|27],Q[e|28]<<24|Q[e|29]<<16|Q[e|30]<<8|Q[e|31],Q[e|32]<<24|Q[e|33]<<16|Q[e|34]<<8|Q[e|35],Q[e|36]<<24|Q[e|37]<<16|Q[e|38]<<8|Q[e|39],Q[e|40]<<24|Q[e|41]<<16|Q[e|42]<<8|Q[e|43],Q[e|44]<<24|Q[e|45]<<16|Q[e|46]<<8|Q[e|47],Q[e|48]<<24|Q[e|49]<<16|Q[e|50]<<8|Q[e|51],Q[e|52]<<24|Q[e|53]<<16|Q[e|54]<<8|Q[e|55],Q[e|56]<<24|Q[e|57]<<16|Q[e|58]<<8|Q[e|59],Q[e|60]<<24|Q[e|61]<<16|Q[e|62]<<8|Q[e|63])}function M(e){e=e|0;Q[e|0]=n>>>24;Q[e|1]=n>>>16&255;Q[e|2]=n>>>8&255;Q[e|3]=n&255;Q[e|4]=i>>>24;Q[e|5]=i>>>16&255;Q[e|6]=i>>>8&255;Q[e|7]=i&255;Q[e|8]=a>>>24;Q[e|9]=a>>>16&255;Q[e|10]=a>>>8&255;Q[e|11]=a&255;Q[e|12]=o>>>24;Q[e|13]=o>>>16&255;Q[e|14]=o>>>8&255;Q[e|15]=o&255;Q[e|16]=s>>>24;Q[e|17]=s>>>16&255;Q[e|18]=s>>>8&255;Q[e|19]=s&255;Q[e|20]=c>>>24;Q[e|21]=c>>>16&255;Q[e|22]=c>>>8&255;Q[e|23]=c&255;Q[e|24]=u>>>24;Q[e|25]=u>>>16&255;Q[e|26]=u>>>8&255;Q[e|27]=u&255;Q[e|28]=h>>>24;Q[e|29]=h>>>16&255;Q[e|30]=h>>>8&255;Q[e|31]=h&255}function U(){n=0x6a09e667;i=0xbb67ae85;a=0x3c6ef372;o=0xa54ff53a;s=0x510e527f;c=0x9b05688c;u=0x1f83d9ab;h=0x5be0cd19;l=f=0}function D(e,t,r,d,p,g,A,y,m,b){e=e|0;t=t|0;r=r|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;n=e;i=t;a=r;o=d;s=p;c=g;u=A;h=y;l=m;f=b}function R(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){P(e);e=e+64|0;t=t-64|0;r=r+64|0}l=l+r|0;if(l>>>0>>0)f=f+1|0;return r|0}function F(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=R(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;l=l+t|0;if(l>>>0>>0)f=f+1|0;Q[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)Q[e|i]=0x00;P(e);t=0;Q[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)Q[e|i]=0;Q[e|56]=f>>>21&255;Q[e|57]=f>>>13&255;Q[e|58]=f>>>5&255;Q[e|59]=f<<3&255|l>>>29;Q[e|60]=l>>>21&255;Q[e|61]=l>>>13&255;Q[e|62]=l>>>5&255;Q[e|63]=l<<3&255;P(e);if(~r)M(r);return n|0}function T(){n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;l=64;f=0}function q(){n=v;i=I;a=E;o=B;s=C;c=_;u=k;h=S;l=64;f=0}function O(e,t,r,Q,P,M,D,R,F,T,q,O,K,H,N,L){e=e|0;t=t|0;r=r|0;Q=Q|0;P=P|0;M=M|0;D=D|0;R=R|0;F=F|0;T=T|0;q=q|0;O=O|0;K=K|0;H=H|0;N=N|0;L=L|0;U();x(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,Q^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,D^0x5c5c5c5c,R^0x5c5c5c5c,F^0x5c5c5c5c,T^0x5c5c5c5c,q^0x5c5c5c5c,O^0x5c5c5c5c,K^0x5c5c5c5c,H^0x5c5c5c5c,N^0x5c5c5c5c,L^0x5c5c5c5c);v=n;I=i;E=a;B=o;C=s;_=c;k=u;S=h;U();x(e^0x36363636,t^0x36363636,r^0x36363636,Q^0x36363636,P^0x36363636,M^0x36363636,D^0x36363636,R^0x36363636,F^0x36363636,T^0x36363636,q^0x36363636,O^0x36363636,K^0x36363636,H^0x36363636,N^0x36363636,L^0x36363636);d=n;p=i;g=a;A=o;y=s;m=c;b=u;w=h;l=64;f=0}function K(e,t,r){e=e|0;t=t|0;r=r|0;var l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~r)if(r&31)return-1;b=F(e,t,-1)|0;l=n,f=i,d=a,p=o,g=s,A=c,y=u,m=h;q();x(l,f,d,p,g,A,y,m,0x80000000,0,0,0,0,0,0,768);if(~r)M(r);return b|0}function H(e,t,r,l,f){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;var d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0;if(e&63)return-1;if(~f)if(f&31)return-1;Q[e+t|0]=r>>>24;Q[e+t+1|0]=r>>>16&255;Q[e+t+2|0]=r>>>8&255;Q[e+t+3|0]=r&255;K(e,t+4|0,-1)|0;d=v=n,p=I=i,g=E=a,A=B=o,y=C=s,m=_=c,b=k=u,w=S=h;l=l-1|0;while((l|0)>0){T();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;q();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;d=d^n;p=p^i;g=g^a;A=A^o;y=y^s;m=m^c;b=b^u;w=w^h;l=l-1|0}n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;if(~f)M(f);return 0}return{reset:U,init:D,process:R,finish:F,hmac_reset:T,hmac_init:O,hmac_finish:K,pbkdf2_generate_block:H}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(rc.push(this.heap),nc.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new ic).process(e).finish().result}}ic.NAME="sha256";var ac=oc;function oc(e,t){if(!e)throw Error(t||"Assertion failed")}oc.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var sc=void 0!==ho?ho:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cc(e,t){return e(t={exports:{}},t.exports),t.exports}function uc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var hc=cc((function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}));function lc(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function fc(e){return 1===e.length?"0"+e:e}function dc(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var pc={inherits:hc,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>0}return a},split32:function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},sum64_hi:function(e,t,r,n){return(t+n>>>0>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,a,o,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},sum64_5_hi:function(e,t,r,n,i,a,o,s,c,u){var h=0,l=t;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,r,n,i,a,o,s,c,u){return t+n+a+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function gc(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Ac=gc;gc.prototype.update=function(e,t){if(e=pc.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=pc.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},Sc=function(e){return mc(e,17)^mc(e,19)^e>>>10},Qc=pc.sum32,xc=pc.sum32_4,Pc=pc.sum32_5,Mc=Ec,Uc=Bc,Dc=Cc,Rc=_c,Fc=kc,Tc=Sc,qc=yc.BlockHash,Oc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Kc(){if(!(this instanceof Kc))return new Kc;qc.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Oc,this.W=Array(64)}pc.inherits(Kc,qc);var Hc=Kc;function Nc(){if(!(this instanceof Nc))return new Nc;Hc.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Kc.blockSize=512,Kc.outSize=256,Kc.hmacStrength=192,Kc.padLength=64,Kc.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>32-i,r)}function Fu(e,t,r,n,i,a,o){return Ru(t&r|~t&n,e,t,i,a,o)}function Tu(e,t,r,n,i,a,o){return Ru(t&n|r&~n,e,t,i,a,o)}function qu(e,t,r,n,i,a,o){return Ru(t^r^n,e,t,i,a,o)}function Ou(e,t,r,n,i,a,o){return Ru(r^(t|~n),e,t,i,a,o)}function Ku(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}const Hu="0123456789abcdef".split("");function Nu(e){let t="",r=0;for(;r<4;r++)t+=Hu[e>>8*r+4&15]+Hu[e>>8*r&15];return t}function Lu(e,t){return e+t&4294967295}const Gu=rs.getWebCrypto(),ju=rs.getNodeCrypto(),zu=ju&&ju.getHashes();function Wu(e){if(ju&&zu.includes(e))return async function(t){const r=ju.createHash(e);return Go(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function Zu(e,t){return async function(r,n=hs){if(yo(r)&&(r=await Vo(r)),!rs.isStream(r)&&Gu&&t&&r.length>=n.minBytesForWebCrypto)return new Uint8Array(await Gu.digest(t,r));const i=e();return Go(r,(e=>{i.update(e)}),(()=>new Uint8Array(i.digest())))}}function Ju(e,t){return async function(r,n=hs){if(yo(r)&&(r=await Vo(r)),rs.isStream(r)){const t=new e;return Go(r,(e=>{t.process(e)}),(()=>t.finish().result))}return Gu&&t&&r.length>=n.minBytesForWebCrypto?new Uint8Array(await Gu.digest(t,r)):e.bytes(r)}}const Vu={md5:Wu("md5")||async function(e){const t=function(e){const t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)Du(r,Ku(e.substring(n-64,n)));e=e.substring(n-64);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n>2]|=e.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(Du(r,i),n=0;n<16;n++)i[n]=0;return i[14]=8*t,Du(r,i),r}(rs.uint8ArrayToString(e));return rs.hexToUint8Array(function(e){for(let t=0;tnew Uint8Array(a.update(e))))}(e,t,r,n);if(rs.isAES(e))return function(e,t,r,n,i){if(rs.getWebCrypto()&&24!==t.length&&!rs.isStream(r)&&r.length>=3e3*i.minBytesForWebCrypto)return async function(e,t,r,n){const i="AES-CBC",a=await eh.importKey("raw",t,{name:i},!1,["encrypt"]),{blockSize:o}=Xu(e),s=rs.concatUint8Array([new Uint8Array(o),r]),c=new Uint8Array(await eh.encrypt({name:i,iv:n},a,s)).subarray(0,r.length);return function(e,t){for(let r=0;ra.aes.AES_Encrypt_process(e)),(()=>a.aes.AES_Encrypt_finish()))}(e,t,r,n,i);const o=new(Xu(e))(t),s=o.blockSize,c=n.slice();let u=new Uint8Array;const h=e=>{e&&(u=rs.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,n=0;for(;e?u.length>=s:u.length;){const e=o.encrypt(c);for(r=0;rnew Uint8Array(a.update(e))))}(e,t,r,n);if(rs.isAES(e))return function(e,t,r,n){if(rs.isStream(r)){const e=new $u(t,n);return Go(r,(t=>e.aes.AES_Decrypt_process(t)),(()=>e.aes.AES_Decrypt_finish()))}return $u.decrypt(r,t,n)}(0,t,r,n);const a=new(Xu(e))(t),o=a.blockSize;let s=n,c=new Uint8Array;const u=e=>{e&&(c=rs.concatUint8Array([c,e]));const t=new Uint8Array(c.length);let r,n=0;for(;e?c.length>=o:c.length;){const e=a.encrypt(s);for(s=c.subarray(0,o),r=0;r48)throw new ks("illegal counter size");let e=Math.pow(2,r)-1;n.set_mask(0,0,e/4294967296|0,0|e)}else r=48,n.set_mask(0,0,65535,4294967295);if(void 0===e)throw Error("nonce is required");{let t=e.length;if(!t||t>16)throw new ks("illegal nonce size");let r=new DataView(new ArrayBuffer(16));new Uint8Array(r.buffer).set(e),n.set_nonce(r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12))}if(void 0!==t){if(t<0||t>=Math.pow(2,r))throw new ks("illegal counter value");n.set_counter(0,0,t/4294967296|0,0|t)}}}class oh{static encrypt(e,t,r=!0,n){return new oh(t,n,r).encrypt(e)}static decrypt(e,t,r=!0,n){return new oh(t,n,r).decrypt(e)}constructor(e,t,r=!0,n){this.aes=n||new Ps(e,t,r,"CBC")}encrypt(e){return Cs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Cs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const sh=rs.getWebCrypto(),ch=rs.getNodeCrypto(),uh=16;function hh(e,t){const r=e.length-uh;for(let n=0;n>3),17+(u>>3)),8-(7&u)).subarray(1),d=new Uint8Array(Bh),p=new Uint8Array(t.length+Ch);let g,A=0;for(g=0;g16)throw new ks("illegal tagSize value");const s=t.length||0,c=new Uint8Array(16);12!==s?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=s>>>29,o[12]=s>>>21&255,o[13]=s>>>13&255,o[14]=s>>>5&255,o[15]=s<<3&255,a.mac(vs.MAC.GCM,vs.HEAP_DATA,16),a.get_iv(vs.HEAP_DATA),a.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const u=new DataView(c.buffer);if(this.gamma0=u.getUint32(12),a.set_nonce(u.getUint32(0),u.getUint32(4),u.getUint32(8),0),a.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>Mh)throw new ks("illegal adata length");r.length?(this.adata=r,this._gcm_mac_process(r)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");a.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,r,n,i){return new Uh(t,r,n,i).encrypt(e)}static decrypt(e,t,r,n,i){return new Uh(t,r,n,i).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.aes.pos,s=this.aes.len,c=0,u=s+r&-16,h=0;if((a-1<<4)+s+r>Mh)throw new RangeError("counter overflow");const l=new Uint8Array(u);for(;r>0;)h=Bs(i,o+s,e,t,r),s+=h,t+=h,r-=h,h=n.cipher(vs.ENC.CTR,vs.HEAP_DATA+o,s),h=n.mac(vs.MAC.GCM,vs.HEAP_DATA+o,h),h&&l.set(i.subarray(o,o+h),c),a+=h>>>4,c+=h,h>>29,t[4]=u>>>21,t[5]=u>>>13&255,t[6]=u>>>5&255,t[7]=u<<3&255,t[8]=t[9]=t[10]=0,t[11]=h>>>29,t[12]=h>>>21&255,t[13]=h>>>13&255,t[14]=h>>>5&255,t[15]=h<<3&255,e.mac(vs.MAC.GCM,vs.HEAP_DATA,16),e.get_iv(vs.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(vs.ENC.CTR,vs.HEAP_DATA,16),s.set(t.subarray(0,n),o),this.counter=1,this.aes.pos=0,this.aes.len=0,s}AES_GCM_Decrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.tagSize,s=this.aes.pos,c=this.aes.len,u=0,h=c+r>o?c+r-o&-16:0,l=c+r-h,f=0;if((a-1<<4)+c+r>Mh)throw new RangeError("counter overflow");const d=new Uint8Array(h);for(;r>l;)f=Bs(i,s+c,e,t,r-l),c+=f,t+=f,r-=f,f=n.mac(vs.MAC.GCM,vs.HEAP_DATA+s,f),f=n.cipher(vs.DEC.CTR,vs.HEAP_DATA+s,f),f&&d.set(i.subarray(s,s+f),u),a+=f>>>4,u+=f,s=0,c=0;return r>0&&(c+=Bs(i,0,e,t,r)),this.counter=a,this.aes.pos=s,this.aes.len=c,d}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.tagSize,n=this.adata,i=this.counter,a=this.aes.pos,o=this.aes.len,s=o-r;if(o>>29,t[4]=l>>>21,t[5]=l>>>13&255,t[6]=l>>>5&255,t[7]=l<<3&255,t[8]=t[9]=t[10]=0,t[11]=f>>>29,t[12]=f>>>21&255,t[13]=f>>>13&255,t[14]=f>>>5&255,t[15]=f<<3&255,e.mac(vs.MAC.GCM,vs.HEAP_DATA,16),e.get_iv(vs.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(vs.ENC.CTR,vs.HEAP_DATA,16);let d=0;for(let e=0;e0;){for(a=Bs(r,0,e,n,i),n+=a,i-=a;15&a;)r[a++]=0;t.mac(vs.MAC.GCM,vs.HEAP_DATA,a)}}}const Dh=rs.getWebCrypto(),Rh=rs.getNodeCrypto(),Fh=rs.getNodeBuffer(),Th=16,qh="AES-GCM";async function Oh(e,t){if(e!==es.symmetric.aes128&&e!==es.symmetric.aes192&&e!==es.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(rs.getNodeCrypto())return{encrypt:async function(e,r,n=new Uint8Array){const i=new Rh.createCipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n);const a=Fh.concat([i.update(e),i.final(),i.getAuthTag()]);return new Uint8Array(a)},decrypt:async function(e,r,n=new Uint8Array){const i=new Rh.createDecipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n),i.setAuthTag(e.slice(e.length-Th,e.length));const a=Fh.concat([i.update(e.slice(0,e.length-Th)),i.final()]);return new Uint8Array(a)}};if(rs.getWebCrypto()&&24!==t.length){const e=await Dh.importKey("raw",t,{name:qh},!1,["encrypt","decrypt"]);return{encrypt:async function(r,n,i=new Uint8Array){if(!r.length)return Uh.encrypt(r,t,n,i);const a=await Dh.encrypt({name:qh,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)},decrypt:async function(r,n,i=new Uint8Array){if(r.length===Th)return Uh.decrypt(r,t,n,i);const a=await Dh.decrypt({name:qh,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)}}}return{encrypt:async function(e,r,n){return Uh.encrypt(e,t,r,n)},decrypt:async function(e,r,n){return Uh.decrypt(e,t,r,n)}}}Oh.getNonce=function(e,t){const r=e.slice();for(let e=0;e>>8)-1}(e,t,r,n)}function d(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function p(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function g(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function A(e,r){var n,i,a,o=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(p(s),p(s),p(s),i=0;i<2;i++){for(o[0]=s[0]-65517,n=1;n<15;n++)o[n]=s[n]-65535-(o[n-1]>>16&1),o[n-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,g(s,o,1-a)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function y(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return A(r,e),A(n,t),f(r,0,n,0)}function m(e){var t=new Uint8Array(32);return A(t,e),1&t[0]}function b(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function w(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function v(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function I(e,t,r){var n,i,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0,M=0,U=0,D=0,R=0,F=r[0],T=r[1],q=r[2],O=r[3],K=r[4],H=r[5],N=r[6],L=r[7],G=r[8],j=r[9],z=r[10],W=r[11],Z=r[12],J=r[13],V=r[14],Y=r[15];a+=(n=t[0])*F,o+=n*T,s+=n*q,c+=n*O,u+=n*K,h+=n*H,l+=n*N,f+=n*L,d+=n*G,p+=n*j,g+=n*z,A+=n*W,y+=n*Z,m+=n*J,b+=n*V,w+=n*Y,o+=(n=t[1])*F,s+=n*T,c+=n*q,u+=n*O,h+=n*K,l+=n*H,f+=n*N,d+=n*L,p+=n*G,g+=n*j,A+=n*z,y+=n*W,m+=n*Z,b+=n*J,w+=n*V,v+=n*Y,s+=(n=t[2])*F,c+=n*T,u+=n*q,h+=n*O,l+=n*K,f+=n*H,d+=n*N,p+=n*L,g+=n*G,A+=n*j,y+=n*z,m+=n*W,b+=n*Z,w+=n*J,v+=n*V,I+=n*Y,c+=(n=t[3])*F,u+=n*T,h+=n*q,l+=n*O,f+=n*K,d+=n*H,p+=n*N,g+=n*L,A+=n*G,y+=n*j,m+=n*z,b+=n*W,w+=n*Z,v+=n*J,I+=n*V,E+=n*Y,u+=(n=t[4])*F,h+=n*T,l+=n*q,f+=n*O,d+=n*K,p+=n*H,g+=n*N,A+=n*L,y+=n*G,m+=n*j,b+=n*z,w+=n*W,v+=n*Z,I+=n*J,E+=n*V,B+=n*Y,h+=(n=t[5])*F,l+=n*T,f+=n*q,d+=n*O,p+=n*K,g+=n*H,A+=n*N,y+=n*L,m+=n*G,b+=n*j,w+=n*z,v+=n*W,I+=n*Z,E+=n*J,B+=n*V,C+=n*Y,l+=(n=t[6])*F,f+=n*T,d+=n*q,p+=n*O,g+=n*K,A+=n*H,y+=n*N,m+=n*L,b+=n*G,w+=n*j,v+=n*z,I+=n*W,E+=n*Z,B+=n*J,C+=n*V,_+=n*Y,f+=(n=t[7])*F,d+=n*T,p+=n*q,g+=n*O,A+=n*K,y+=n*H,m+=n*N,b+=n*L,w+=n*G,v+=n*j,I+=n*z,E+=n*W,B+=n*Z,C+=n*J,_+=n*V,k+=n*Y,d+=(n=t[8])*F,p+=n*T,g+=n*q,A+=n*O,y+=n*K,m+=n*H,b+=n*N,w+=n*L,v+=n*G,I+=n*j,E+=n*z,B+=n*W,C+=n*Z,_+=n*J,k+=n*V,S+=n*Y,p+=(n=t[9])*F,g+=n*T,A+=n*q,y+=n*O,m+=n*K,b+=n*H,w+=n*N,v+=n*L,I+=n*G,E+=n*j,B+=n*z,C+=n*W,_+=n*Z,k+=n*J,S+=n*V,Q+=n*Y,g+=(n=t[10])*F,A+=n*T,y+=n*q,m+=n*O,b+=n*K,w+=n*H,v+=n*N,I+=n*L,E+=n*G,B+=n*j,C+=n*z,_+=n*W,k+=n*Z,S+=n*J,Q+=n*V,x+=n*Y,A+=(n=t[11])*F,y+=n*T,m+=n*q,b+=n*O,w+=n*K,v+=n*H,I+=n*N,E+=n*L,B+=n*G,C+=n*j,_+=n*z,k+=n*W,S+=n*Z,Q+=n*J,x+=n*V,P+=n*Y,y+=(n=t[12])*F,m+=n*T,b+=n*q,w+=n*O,v+=n*K,I+=n*H,E+=n*N,B+=n*L,C+=n*G,_+=n*j,k+=n*z,S+=n*W,Q+=n*Z,x+=n*J,P+=n*V,M+=n*Y,m+=(n=t[13])*F,b+=n*T,w+=n*q,v+=n*O,I+=n*K,E+=n*H,B+=n*N,C+=n*L,_+=n*G,k+=n*j,S+=n*z,Q+=n*W,x+=n*Z,P+=n*J,M+=n*V,U+=n*Y,b+=(n=t[14])*F,w+=n*T,v+=n*q,I+=n*O,E+=n*K,B+=n*H,C+=n*N,_+=n*L,k+=n*G,S+=n*j,Q+=n*z,x+=n*W,P+=n*Z,M+=n*J,U+=n*V,D+=n*Y,w+=(n=t[15])*F,o+=38*(I+=n*q),s+=38*(E+=n*O),c+=38*(B+=n*K),u+=38*(C+=n*H),h+=38*(_+=n*N),l+=38*(k+=n*L),f+=38*(S+=n*G),d+=38*(Q+=n*j),p+=38*(x+=n*z),g+=38*(P+=n*W),A+=38*(M+=n*Z),y+=38*(U+=n*J),m+=38*(D+=n*V),b+=38*(R+=n*Y),a=(n=(a+=38*(v+=n*T))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=A,e[12]=y,e[13]=m,e[14]=b,e[15]=w}function E(e,t){I(e,t,t)}function B(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)E(i,i),2!==n&&4!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function C(e,r,n){var i,a,s=new Uint8Array(32),c=new Float64Array(80),u=t(),h=t(),l=t(),f=t(),d=t(),p=t();for(a=0;a<31;a++)s[a]=r[a];for(s[31]=127&r[31]|64,s[0]&=248,b(c,n),a=0;a<16;a++)h[a]=c[a],f[a]=u[a]=l[a]=0;for(u[0]=f[0]=1,a=254;a>=0;--a)g(u,h,i=s[a>>>3]>>>(7&a)&1),g(l,f,i),w(d,u,l),v(u,u,l),w(l,h,f),v(h,h,f),E(f,d),E(p,u),I(u,l,u),I(l,h,d),w(d,u,l),v(u,u,l),E(h,u),v(l,f,p),I(u,l,o),w(u,u,f),I(l,l,u),I(u,f,p),I(f,h,c),E(h,d),g(u,h,i),g(l,f,i);for(a=0;a<16;a++)c[a+16]=u[a],c[a+32]=l[a],c[a+48]=h[a],c[a+64]=f[a];var y=c.subarray(32),m=c.subarray(16);return B(y,y),I(m,m,y),A(e,m),0}function _(e,t){return C(e,t,n)}function k(e,r){var n=t(),i=t(),a=t(),o=t(),s=t(),u=t(),h=t(),l=t(),f=t();v(n,e[1],e[0]),v(f,r[1],r[0]),I(n,n,f),w(i,e[0],e[1]),w(f,r[0],r[1]),I(i,i,f),I(a,e[3],r[3]),I(a,a,c),I(o,e[2],r[2]),w(o,o,o),v(s,i,n),v(u,o,a),w(h,o,a),w(l,i,n),I(e[0],s,u),I(e[1],l,h),I(e[2],h,u),I(e[3],s,l)}function S(e,t,r){var n;for(n=0;n<4;n++)g(e[n],t[n],r)}function Q(e,r){var n=t(),i=t(),a=t();B(a,r[2]),I(n,r[0],a),I(i,r[1],a),A(e,i),e[31]^=m(n)<<7}function x(e,t,r){var n,o;for(d(e[0],i),d(e[1],a),d(e[2],a),d(e[3],i),o=255;o>=0;--o)S(e,t,n=r[o/8|0]>>(7&o)&1),k(t,e),k(e,e),S(e,t,n)}function P(e,r){var n=[t(),t(),t(),t()];d(n[0],u),d(n[1],h),d(n[2],a),I(n[3],u,h),x(e,n,r)}function M(n,i,a){var o,s,c=[t(),t(),t(),t()];for(a||r(i,32),(o=e.hash(i.subarray(0,32)))[0]&=248,o[31]&=127,o[31]|=64,P(c,o),Q(n,c),s=0;s<32;s++)i[s+32]=n[s];return 0}var U=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function D(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>4)*U[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*U[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function R(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;D(e,r)}function F(e,r){var n=t(),o=t(),c=t(),u=t(),h=t(),f=t(),p=t();return d(e[2],a),b(e[1],r),E(c,e[1]),I(u,c,s),v(c,c,e[2]),w(u,e[2],u),E(h,u),E(f,h),I(p,f,h),I(n,p,c),I(n,n,u),function(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)E(i,i),1!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}(n,n),I(n,n,c),I(n,n,u),I(n,n,u),I(e[0],n,u),E(o,e[0]),I(o,o,u),y(o,c)&&I(e[0],e[0],l),E(o,e[0]),I(o,o,u),y(o,c)?-1:(m(e[0])===r[31]>>7&&v(e[0],i,e[0]),I(e[3],e[0],e[1]),0)}var T=64;function q(){for(var e=0;e=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return M(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(q(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;re&&(c.imod(a.leftShift(i)).iadd(a),u=c.mod(o).toNumber())}while(!await Wh(c,t,r));return c}async function Wh(e,t,r){return!(t&&!e.dec().gcd(t).isOne()||!await async function(e){const t=await rs.getBigInteger();return Zh.every((r=>0!==e.mod(new t(r))))}(e)||!await async function(e,t){const r=await rs.getBigInteger();return(t=t||new r(2)).modExp(e.dec(),e).isOne()}(e)||!await async function(e,t,r){const n=await rs.getBigInteger(),i=e.bitLength();t||(t=Math.max(1,i/48|0));const a=e.dec();let o=0;for(;!a.getBit(o);)o++;const s=e.rightShift(new n(o));for(;t>0;t--){let t,r=(await Gh(new n(2),a)).modExp(s,e);if(!r.isOne()&&!r.equal(a)){for(t=1;tt-11)throw Error("Message too long");const n=function(e){const t=new Uint8Array(e);let r=0;for(;r=8&!n;if(t)return rs.selectUint8Array(o,a,t);if(o)return a;throw Error("Decryption error")}async function $h(e,t,r){let n;if(t.length!==Yu.getHashByteLength(e))throw Error("Invalid hash length");const i=new Uint8Array(Jh[e].length);for(n=0;n{tl.generateKeyPair("rsa",r,((r,n,i)=>{r?t(r):e(nl.decode(i,"der"))}))}));return{n:n.modulus.toArrayLike(Uint8Array),e:n.publicExponent.toArrayLike(Uint8Array),d:n.privateExponent.toArrayLike(Uint8Array),p:n.prime2.toArrayLike(Uint8Array),q:n.prime1.toArrayLike(Uint8Array),u:n.coefficient.toArrayLike(Uint8Array)}}let r,n,i;do{n=await zh(e-(e>>1),t,40),r=await zh(e>>1,t,40),i=r.mul(n)}while(i.bitLength()!==e);const a=r.dec().imul(n.dec());return n.lt(r)&&([r,n]=[n,r]),{n:i.toUint8Array(),e:t.toUint8Array(),d:t.modInv(a).toUint8Array(),p:r.toUint8Array(),q:n.toUint8Array(),u:r.modInv(n).toUint8Array()}},validateParams:async function(e,t,r,n,i,a){const o=await rs.getBigInteger();if(e=new o(e),n=new o(n),i=new o(i),!n.mul(i).equal(e))return!1;const s=new o(2);if(a=new o(a),!n.mul(a).mod(i).isOne())return!1;t=new o(t),r=new o(r);const c=new o(Math.floor(e.bitLength()/3)),u=await Gh(s,s.leftShift(c)),h=u.mul(r).mul(t);return!(!h.mod(n.dec()).equal(u)||!h.mod(i.dec()).equal(u))}}),ol=Object.freeze({__proto__:null,encrypt:async function(e,t,r,n){const i=await rs.getBigInteger();t=new i(t),r=new i(r),n=new i(n);const a=new i(Vh(e,t.byteLength())),o=await Gh(new i(1),t.dec());return{c1:r.modExp(o,t).toUint8Array(),c2:n.modExp(o,t).imul(a).imod(t).toUint8Array()}},decrypt:async function(e,t,r,n,i){const a=await rs.getBigInteger();return e=new a(e),t=new a(t),r=new a(r),n=new a(n),Yh(e.modExp(n,r).modInv(r).imul(t).imod(r).toUint8Array("be",r.byteLength()),i)},validateParams:async function(e,t,r,n){const i=await rs.getBigInteger();e=new i(e),t=new i(t),r=new i(r);const a=new i(1);if(t.lte(a)||t.gte(e))return!1;const o=new i(e.bitLength()),s=new i(1023);if(o.lt(s))return!1;if(!t.modExp(e.dec(),e).isOne())return!1;let c=t;const u=new i(1),h=new i(2).leftShift(new i(17));for(;u.lt(h);){if(c=c.mul(t).imod(e),c.isOne())return!1;u.iinc()}n=new i(n);const l=new i(2),f=await Gh(l.leftShift(o.dec()),l.leftShift(o)),d=e.dec().imul(f).iadd(n);return!!r.equal(t.modExp(d,e))}});class sl{constructor(e){if(e instanceof sl)this.oid=e.oid;else if(rs.isArray(e)||rs.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return rs.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return rs.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(es.curve[e])return es.write(es.curve,e);throw Error("Unknown curve object identifier.")}}function cl(e,t){return e.keyPair({priv:t})}function ul(e,t){const r=e.keyPair({pub:t});if(!0!==r.validate().result)throw Error("Invalid elliptic public key");return r}async function hl(e){if(!hs.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:t}=await Promise.resolve().then((function(){return Rb}));return new t.ec(e)}function ll(e){let t,r=0;const n=e[0];return n<192?([r]=e,t=1):n<255?(r=(e[0]-192<<8)+e[1]+192,t=2):255===n&&(r=rs.readNumber(e.subarray(1,5)),t=5),{len:r,offset:t}}function fl(e){return e<192?new Uint8Array([e]):e>191&&e<8384?new Uint8Array([192+(e-192>>8),e-192&255]):rs.concatUint8Array([new Uint8Array([255]),rs.writeNumber(e,4)])}function dl(e){if(e<0||e>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+e])}function pl(e){return new Uint8Array([192|e])}function gl(e,t){return rs.concatUint8Array([pl(e),fl(t)])}function Al(e){return[es.packet.literalData,es.packet.compressedData,es.packet.symmetricallyEncryptedData,es.packet.symEncryptedIntegrityProtectedData,es.packet.aeadEncryptedData].includes(e)}async function yl(e,t){const r=Oo(e);let n,i;try{const a=await r.peekBytes(2);if(!a||a.length<2||0==(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const o=await r.readByte();let s,c,u=-1,h=-1;h=0,0!=(64&o)&&(h=1),h?u=63&o:(u=(63&o)>>2,c=3&o);const l=Al(u);let f,d=null;if(l){if("array"===rs.isStream(e)){const e=new Ao;n=Ko(e),d=e}else{const e=new Do;n=Ko(e.writable),d=e.readable}i=t({tag:u,packet:d})}else d=[];do{if(h){const e=await r.readByte();if(f=!1,e<192)s=e;else if(e>=192&&e<224)s=(e-192<<8)+await r.readByte()+192;else if(e>223&&e<255){if(s=1<<(31&e),f=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(c){case 0:s=await r.readByte();break;case 1:s=await r.readByte()<<8|await r.readByte();break;case 2:s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:s=1/0}if(s>0){let e=0;for(;;){n&&await n.ready;const{done:t,value:i}=await r.read();if(t){if(s===1/0)break;throw Error("Unexpected end of packet")}const a=s===1/0?i:i.subarray(0,s-e);if(n?await n.write(a):d.push(a),e+=i.length,e>=s){r.unshift(i.subarray(s-e+i.length));break}}}}while(f);const p=await r.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(d=rs.concatUint8Array(d),await t({tag:u,packet:d})),!p||!p.length}catch(e){if(n)return await n.abort(e),!0;throw e}finally{n&&await i,r.releaseLock()}}class ml extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,ml),this.name="UnsupportedError"}}class bl{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const wl=rs.getWebCrypto(),vl=rs.getNodeCrypto(),Il={p256:"P-256",p384:"P-384",p521:"P-521"},El=vl?vl.getCurves():[],Bl=vl?{secp256k1:El.includes("secp256k1")?"secp256k1":void 0,p256:El.includes("prime256v1")?"prime256v1":void 0,p384:El.includes("secp384r1")?"secp384r1":void 0,p521:El.includes("secp521r1")?"secp521r1":void 0,ed25519:El.includes("ED25519")?"ED25519":void 0,curve25519:El.includes("X25519")?"X25519":void 0,brainpoolP256r1:El.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:El.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:El.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Cl={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:es.publicKey.ecdsa,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:Bl.p256,web:Il.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:es.publicKey.ecdsa,hash:es.hash.sha384,cipher:es.symmetric.aes192,node:Bl.p384,web:Il.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:es.publicKey.ecdsa,hash:es.hash.sha512,cipher:es.symmetric.aes256,node:Bl.p521,web:Il.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:es.publicKey.ecdsa,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:Bl.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:es.publicKey.eddsaLegacy,hash:es.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:es.publicKey.ecdh,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:es.publicKey.ecdsa,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:Bl.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:es.publicKey.ecdsa,hash:es.hash.sha384,cipher:es.symmetric.aes192,node:Bl.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:es.publicKey.ecdsa,hash:es.hash.sha512,cipher:es.symmetric.aes256,node:Bl.brainpoolP512r1,payloadSize:64}};class _l{constructor(e,t){try{(rs.isArray(e)||rs.isUint8Array(e))&&(e=new sl(e)),e instanceof sl&&(e=e.getName()),this.name=es.write(es.curve,e)}catch(e){throw new ml("Unknown curve")}t=t||Cl[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Cl[this.name],this.web=t.web&&Cl[this.name],this.payloadSize=t.payloadSize,this.web&&rs.getWebCrypto()?this.type="web":this.node&&rs.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(e){const t=await wl.generateKey({name:"ECDSA",namedCurve:Il[e]},!0,["sign","verify"]),r=await wl.exportKey("jwk",t.privateKey);return{publicKey:Sl(await wl.exportKey("jwk",t.publicKey)),privateKey:cs(r.d)}}(this.name)}catch(e){rs.printDebugError("Browser did not support generating ec key "+e.message);break}case"node":return async function(e){const t=vl.createECDH(Bl[e]);return await t.generateKeys(),{publicKey:new Uint8Array(t.getPublicKey()),privateKey:new Uint8Array(t.getPrivateKey())}}(this.name);case"curve25519":{const t=Lh(32);t[0]=127&t[0]|64,t[31]&=248;const r=t.slice().reverse();return e=Hh.box.keyPair.fromSecretKey(r),{publicKey:rs.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:t}}case"ed25519":{const e=Lh(32),t=Hh.sign.keyPair.fromSeed(e);return{publicKey:rs.concatUint8Array([new Uint8Array([64]),t.publicKey]),privateKey:e}}}const t=await hl(this.name);return e=await t.genKeyPair({entropy:rs.uint8ArrayToString(Lh(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function kl(e,t,r,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:e===es.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=t.getName();if(!i[a])return!1;if("curve25519"===a){n=n.slice().reverse();const{publicKey:e}=Hh.box.keyPair.fromSecretKey(n);r=new Uint8Array(r);const t=new Uint8Array([64,...e]);return!!rs.equalsUint8Array(t,r)}const o=await hl(a);try{r=ul(o,r).getPublic()}catch(e){return!1}return!!cl(o,n).getPublic().eq(r)}function Sl(e){const t=cs(e.x),r=cs(e.y),n=new Uint8Array(t.length+r.length+1);return n[0]=4,n.set(t,1),n.set(r,t.length+1),n}function Ql(e,t,r){const n=e,i=r.slice(1,n+1),a=r.slice(n+1,2*n+1);return{kty:"EC",crv:t,x:us(i,!0),y:us(a,!0),ext:!0}}function xl(e,t,r,n){const i=Ql(e,t,r);return i.d=us(n,!0),i}const Pl=rs.getWebCrypto(),Ml=rs.getNodeCrypto();async function Ul(e,t,r,n,i,a){const o=new _l(e);if(r&&!rs.isStream(r)){const a={publicKey:n,privateKey:i};switch(o.type){case"web":try{return await async function(e,t,r,n){const i=e.payloadSize,a=xl(e.payloadSize,Il[e.name],n.publicKey,n.privateKey),o=await Pl.importKey("jwk",a,{name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,e.hash)}},!1,["sign"]),s=new Uint8Array(await Pl.sign({name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,t)}},o,r));return{r:s.slice(0,i),s:s.slice(i,i<<1)}}(o,t,r,a)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;rs.printDebugError("Browser did not support signing: "+e.message)}break;case"node":{const e=await async function(e,t,r,n){const i=Ml.createSign(es.read(es.hash,t));i.write(r),i.end();const a=Tl.encode({version:1,parameters:e.oid,privateKey:Array.from(n.privateKey),publicKey:{unused:0,data:Array.from(n.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Fl.decode(i.sign(a),"der")}(o,t,r,a);return{r:e.r.toArrayLike(Uint8Array),s:e.s.toArrayLike(Uint8Array)}}}}return async function(e,t,r){const n=cl(await hl(e.name),r).sign(t);return{r:n.r.toArrayLike(Uint8Array),s:n.s.toArrayLike(Uint8Array)}}(o,a,i)}async function Dl(e,t,r,n,i,a){const o=new _l(e);if(n&&!rs.isStream(n))switch(o.type){case"web":try{return await async function(e,t,{r:r,s:n},i,a){const o=Ql(e.payloadSize,Il[e.name],a),s=await Pl.importKey("jwk",o,{name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,e.hash)}},!1,["verify"]),c=rs.concatUint8Array([r,n]).buffer;return Pl.verify({name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,t)}},s,c,i)}(o,t,r,n,i)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;rs.printDebugError("Browser did not support verifying: "+e.message)}break;case"node":return async function(e,t,{r:r,s:n},i,a){const{default:o}=await Promise.resolve().then((function(){return Am})),s=Ml.createVerify(es.read(es.hash,t));s.write(i),s.end();const c=Ol.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:e.oid},subjectPublicKey:{unused:0,data:Array.from(a)}},"pem",{label:"PUBLIC KEY"}),u=Fl.encode({r:new o(r),s:new o(n)},"der");try{return s.verify(c,u)}catch(e){return!1}}(o,t,r,n,i)}return async function(e,t,r,n){return ul(await hl(e.name),n).verify(r,t)}(o,r,void 0===t?n:a,i)}const Rl=void 0,Fl=Ml?Rl.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,Tl=Ml?Rl.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,ql=Ml?Rl.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,Ol=Ml?Rl.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(ql),this.key("subjectPublicKey").bitstr())})):void 0;var Kl=Object.freeze({__proto__:null,sign:Ul,verify:Dl,validateParams:async function(e,t,r){const n=new _l(e);if(n.keyType!==es.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const n=Lh(8),i=es.hash.sha256,a=await Yu.digest(i,n);try{const o=await Ul(e,i,n,t,r,a);return await Dl(e,i,o,n,t,a)}catch(e){return!1}}default:return kl(es.publicKey.ecdsa,e,t,r)}}});Hh.hash=e=>new Uint8Array(iu().update(e).digest());var Hl=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){if(Yu.getHashByteLength(t)new Uint8Array(iu().update(e).digest());var Ll=Object.freeze({__proto__:null,generate:async function(e){if(e===es.publicKey.ed25519){const e=Lh(32),{publicKey:t}=Hh.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(e,t,r,n,i,a){if(Yu.getHashByteLength(t)=0;--e)for(let t=s-1;t>=0;--t)c[1]=s*e+(t+1),u[0]=a[0]^c[0],u[1]=a[1]^c[1],u[2]=o[2*t],u[3]=o[2*t+1],u=zl(r.decrypt(Wl(u))),a=u.subarray(0,2),o[2*t]=u[2],o[2*t+1]=u[3];if(a[0]===n[0]&&a[1]===n[1])return Wl(o);throw Error("Key Data Integrity failed")}function zl(e){const{length:t}=e,r=function(e){if(rs.isString(e)){const{length:t}=e,r=new ArrayBuffer(t),n=new Uint8Array(r);for(let r=0;r0){const r=e[t-1];if(r>=1){const n=e.subarray(t-r),i=new Uint8Array(r).fill(r);if(rs.equalsUint8Array(n,i))return e.subarray(0,t-r)}}throw Error("Invalid padding")}var Yl=Object.freeze({__proto__:null,encode:Jl,decode:Vl});const $l=rs.getWebCrypto(),Xl=rs.getNodeCrypto();function ef(e,t,r,n){return rs.concatUint8Array([t.write(),new Uint8Array([e]),r.write(),rs.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function tf(e,t,r,n,i=!1,a=!1){let o;if(i){for(o=0;o=0&&0===t[o];o--);t=t.subarray(0,o+1)}return(await Yu.digest(e,rs.concatUint8Array([new Uint8Array([0,0,0,1]),t,n]))).subarray(0,r)}async function rf(e,t,r,n){if(n.length!==e.payloadSize){const t=new Uint8Array(e.payloadSize);t.set(n,e.payloadSize-n.length),n=t}switch(e.type){case"curve25519":{const e=n.slice().reverse();return{secretKey:e,sharedKey:Hh.scalarMult(e,t.subarray(1))}}case"web":if(e.web&&rs.getWebCrypto())try{return await async function(e,t,r,n){const i=xl(e.payloadSize,e.web.web,r,n);let a=$l.importKey("jwk",i,{name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]);const o=Ql(e.payloadSize,e.web.web,t);let s=$l.importKey("jwk",o,{name:"ECDH",namedCurve:e.web.web},!0,[]);[a,s]=await Promise.all([a,s]);let c=$l.deriveBits({name:"ECDH",namedCurve:e.web.web,public:s},a,e.web.sharedSize),u=$l.exportKey("jwk",a);[c,u]=await Promise.all([c,u]);const h=new Uint8Array(c);return{secretKey:cs(u.d),sharedKey:h}}(e,t,r,n)}catch(e){rs.printDebugError(e)}break;case"node":return async function(e,t,r){const n=Xl.createECDH(e.node.node);n.setPrivateKey(r);const i=new Uint8Array(n.computeSecret(t));return{secretKey:new Uint8Array(n.getPrivateKey()),sharedKey:i}}(e,t,n)}return async function(e,t,r){const n=await hl(e.name);t=ul(n,t),r=cl(n,r);const i=new Uint8Array(r.getPrivate()),a=r.derive(t.getPublic()),o=n.curve.p.byteLength();return{secretKey:i,sharedKey:a.toArrayLike(Uint8Array,"be",o)}}(e,t,n)}var nf=Object.freeze({__proto__:null,validateParams:async function(e,t,r){return kl(es.publicKey.ecdh,e,t,r)},encrypt:async function(e,t,r,n,i){const a=Jl(r),o=new _l(e),{publicKey:s,sharedKey:c}=await async function(e,t){switch(e.type){case"curve25519":{const r=Lh(32),{secretKey:n,sharedKey:i}=await rf(e,t,null,r);let{publicKey:a}=Hh.box.keyPair.fromSecretKey(n);return a=rs.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(e.web&&rs.getWebCrypto())try{return await async function(e,t){const r=Ql(e.payloadSize,e.web.web,t);let n=$l.generateKey({name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]),i=$l.importKey("jwk",r,{name:"ECDH",namedCurve:e.web.web},!1,[]);[n,i]=await Promise.all([n,i]);let a=$l.deriveBits({name:"ECDH",namedCurve:e.web.web,public:i},n.privateKey,e.web.sharedSize),o=$l.exportKey("jwk",n.publicKey);[a,o]=await Promise.all([a,o]);const s=new Uint8Array(a);return{publicKey:new Uint8Array(Sl(o)),sharedKey:s}}(e,t)}catch(e){rs.printDebugError(e)}break;case"node":return async function(e,t){const r=Xl.createECDH(e.node.node);r.generateKeys();const n=new Uint8Array(r.computeSecret(t));return{publicKey:new Uint8Array(r.getPublicKey()),sharedKey:n}}(e,t)}return async function(e,t){const r=await hl(e.name),n=await e.genKeyPair();t=ul(r,t);const i=cl(r,n.privateKey),a=n.publicKey,o=i.derive(t.getPublic()),s=r.curve.p.byteLength();return{publicKey:a,sharedKey:o.toArrayLike(Uint8Array,"be",s)}}(e,t)}(o,n),u=ef(es.publicKey.ecdh,e,t,i),{keySize:h}=Xu(t.cipher);return{publicKey:s,wrappedKey:Gl(await tf(t.hash,c,h,u),a)}},decrypt:async function(e,t,r,n,i,a,o){const s=new _l(e),{sharedKey:c}=await rf(s,r,i,a),u=ef(es.publicKey.ecdh,e,t,o),{keySize:h}=Xu(t.cipher);let l;for(let r=0;r<3;r++)try{return Vl(jl(await tf(t.hash,c,h,u,1===r,2===r),n))}catch(e){l=e}throw l}});const af=rs.getWebCrypto(),of=rs.getNodeCrypto(),sf=of&&of.webcrypto&&of.webcrypto.subtle;async function cf(e,t,r,n,i){const a=es.read(es.webHash,e);if(!a)throw Error("Hash algo not supported with HKDF");if(af||sf){const e=af||sf,o=await e.importKey("raw",t,"HKDF",!1,["deriveBits"]),s=await e.deriveBits({name:"HKDF",hash:a,salt:r,info:n},o,8*i);return new Uint8Array(s)}if(of){const a=es.read(es.hash,e),o=(e,t)=>of.createHmac(a,e).update(t).digest(),s=o(r,t),c=s.length,u=Math.ceil(i/c),h=new Uint8Array(u*c),l=new Uint8Array(c+n.length+1);l.set(n,c);for(let e=0;e0?l:l.subarray(c));l.set(t,0),h.set(t,e*c)}return h.subarray(0,i)}throw Error("No HKDF implementation available")}const uf={x25519:rs.encodeUTF8("OpenPGP X25519")};var hf=Object.freeze({__proto__:null,generate:async function(e){if(e===es.publicKey.x25519){const e=Lh(32),{publicKey:t}=Hh.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(e,t,r){if(e===es.publicKey.x25519){const{publicKey:e}=Hh.box.keyPair.fromSecretKey(r);return rs.equalsUint8Array(t,e)}return!1},encrypt:async function(e,t,r){if(e===es.publicKey.x25519){const e=Lh(32),n=Hh.scalarMult(e,r),{publicKey:i}=Hh.box.keyPair.fromSecretKey(e),a=rs.concatUint8Array([i,r,n]),{keySize:o}=Xu(es.symmetric.aes128);return{ephemeralPublicKey:i,wrappedKey:Gl(await cf(es.hash.sha256,a,new Uint8Array,uf.x25519,o),t)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(e,t,r,n,i){if(e===es.publicKey.x25519){const e=Hh.scalarMult(i,t),a=rs.concatUint8Array([t,n,e]),{keySize:o}=Xu(es.symmetric.aes128);return jl(await cf(es.hash.sha256,a,new Uint8Array,uf.x25519,o),r)}throw Error("Unsupported ECDH algorithm")}}),lf=Object.freeze({__proto__:null,CurveWithOID:_l,ecdh:nf,ecdhX:hf,ecdsa:Kl,eddsaLegacy:Hl,eddsa:Ll,generate:async function(e){const t=await rs.getBigInteger();e=new _l(e);const r=await e.genKeyPair(),n=new t(r.publicKey).toUint8Array(),i=new t(r.privateKey).toUint8Array("be",e.payloadSize);return{oid:e.oid,Q:n,secret:i,hash:e.hash,cipher:e.cipher}},getPreferredHashAlgo:function(e){return Cl[es.write(es.curve,e.toHex())].hash}}),ff=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){const o=await rs.getBigInteger(),s=new o(1);let c,u,h,l;n=new o(n),i=new o(i),r=new o(r),a=new o(a),r=r.mod(n),a=a.mod(i);const f=new o(t.subarray(0,i.byteLength())).mod(i);for(;;){if(c=await Gh(s,i),u=r.modExp(c,n).imod(i),u.isZero())continue;const e=a.mul(u).imod(i);if(l=f.add(e).imod(i),h=c.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:u.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(e,t,r,n,i,a,o,s){const c=await rs.getBigInteger(),u=new c(0);if(t=new c(t),r=new c(r),a=new c(a),o=new c(o),i=new c(i),s=new c(s),t.lte(u)||t.gte(o)||r.lte(u)||r.gte(o))return rs.printDebug("invalid DSA Signature"),!1;const h=new c(n.subarray(0,o.byteLength())).imod(o),l=r.modInv(o);if(l.isZero())return rs.printDebug("invalid DSA Signature"),!1;i=i.mod(a),s=s.mod(a);const f=h.mul(l).imod(o),d=t.mul(l).imod(o),p=i.modExp(f,a),g=s.modExp(d,a);return p.mul(g).imod(a).imod(o).equal(t)},validateParams:async function(e,t,r,n,i){const a=await rs.getBigInteger();e=new a(e),t=new a(t),r=new a(r),n=new a(n);const o=new a(1);if(r.lte(o)||r.gte(e))return!1;if(!e.dec().mod(t).isZero())return!1;if(!r.modExp(t,e).isOne())return!1;const s=new a(t.bitLength()),c=new a(150);if(s.lt(c)||!await Wh(t,null,32))return!1;i=new a(i);const u=new a(2),h=await Gh(u.leftShift(s.dec()),u.leftShift(s)),l=t.mul(h).add(i);return!!n.equal(r.modExp(l,e))}}),df={rsa:al,elgamal:ol,elliptic:lf,dsa:ff,nacl:Hh},pf=Object.freeze({__proto__:null,parseSignatureParams:function(e,t){let r=0;switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:case es.publicKey.rsaSign:return{s:rs.readMPI(t.subarray(r))};case es.publicKey.dsa:case es.publicKey.ecdsa:{const e=rs.readMPI(t.subarray(r));return r+=e.length+2,{r:e,s:rs.readMPI(t.subarray(r))}}case es.publicKey.eddsaLegacy:{let e=rs.readMPI(t.subarray(r));r+=e.length+2,e=rs.leftPad(e,32);let n=rs.readMPI(t.subarray(r));return n=rs.leftPad(n,32),{r:e,s:n}}case es.publicKey.ed25519:{const e=t.subarray(r,r+64);return r+=e.length,{RS:e}}default:throw new ml("Unknown signature algorithm.")}},verify:async function(e,t,r,n,i,a){switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:case es.publicKey.rsaSign:{const{n:e,e:o}=n,s=rs.leftPad(r.s,e.length);return df.rsa.verify(t,i,s,e,o,a)}case es.publicKey.dsa:{const{g:e,p:i,q:o,y:s}=n,{r:c,s:u}=r;return df.dsa.verify(t,c,u,a,e,i,o,s)}case es.publicKey.ecdsa:{const{oid:e,Q:o}=n,s=new df.elliptic.CurveWithOID(e).payloadSize,c=rs.leftPad(r.r,s),u=rs.leftPad(r.s,s);return df.elliptic.ecdsa.verify(e,t,{r:c,s:u},i,o,a)}case es.publicKey.eddsaLegacy:{const{oid:e,Q:o}=n;return df.elliptic.eddsaLegacy.verify(e,t,r,i,o,a)}case es.publicKey.ed25519:{const{A:o}=n;return df.elliptic.eddsa.verify(e,t,r,i,o,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(e,t,r,n,i,a){if(!r||!n)throw Error("Missing key parameters");switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:case es.publicKey.rsaSign:{const{n:e,e:o}=r,{d:s,p:c,q:u,u:h}=n;return{s:await df.rsa.sign(t,i,e,o,s,c,u,h,a)}}case es.publicKey.dsa:{const{g:e,p:i,q:o}=r,{x:s}=n;return df.dsa.sign(t,a,e,i,o,s)}case es.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case es.publicKey.ecdsa:{const{oid:e,Q:o}=r,{d:s}=n;return df.elliptic.ecdsa.sign(e,t,i,o,s,a)}case es.publicKey.eddsaLegacy:{const{oid:e,Q:o}=r,{seed:s}=n;return df.elliptic.eddsaLegacy.sign(e,t,i,o,s,a)}case es.publicKey.ed25519:{const{A:o}=r,{seed:s}=n;return df.elliptic.eddsa.sign(e,t,i,o,s,a)}default:throw Error("Unknown signature algorithm.")}}});class gf{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return rs.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class Af{constructor(e){if(e){const{hash:t,cipher:r}=e;this.hash=t,this.cipher=r}else this.hash=null,this.cipher=null}read(e){if(e.length<4||3!==e[0]||1!==e[1])throw new ml("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class yf{static fromObject({wrappedKey:e,algorithm:t}){const r=new yf;return r.wrappedKey=e,r.algorithm=t,r}read(e){let t=0,r=e[t++];this.algorithm=r%2?e[t++]:null,r-=r%2,this.wrappedKey=e.subarray(t,t+r),t+=r}write(){return rs.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function mf(e){try{e.getName()}catch(e){throw new ml("Unknown curve OID")}}var bf=Object.freeze({__proto__:null,publicKeyEncrypt:async function(e,t,r,n,i){switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:{const{n:e,e:t}=r;return{c:await df.rsa.encrypt(n,e,t)}}case es.publicKey.elgamal:{const{p:e,g:t,y:i}=r;return df.elgamal.encrypt(n,e,t,i)}case es.publicKey.ecdh:{const{oid:e,Q:t,kdfParams:a}=r,{publicKey:o,wrappedKey:s}=await df.elliptic.ecdh.encrypt(e,a,n,t,i);return{V:o,C:new gf(s)}}case es.publicKey.x25519:{if(!rs.isAES(t))throw Error("X25519 keys can only encrypt AES session keys");const{A:i}=r,{ephemeralPublicKey:a,wrappedKey:o}=await df.elliptic.ecdhX.encrypt(e,n,i);return{ephemeralPublicKey:a,C:yf.fromObject({algorithm:t,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(e,t,r,n,i,a){switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:{const{c:e}=n,{n:i,e:o}=t,{d:s,p:c,q:u,u:h}=r;return df.rsa.decrypt(e,i,o,s,c,u,h,a)}case es.publicKey.elgamal:{const{c1:e,c2:i}=n,o=t.p,s=r.x;return df.elgamal.decrypt(e,i,o,s,a)}case es.publicKey.ecdh:{const{oid:e,Q:a,kdfParams:o}=t,{d:s}=r,{V:c,C:u}=n;return df.elliptic.ecdh.decrypt(e,o,c,u.data,a,s,i)}case es.publicKey.x25519:{const{A:i}=t,{k:a}=r,{ephemeralPublicKey:o,C:s}=n;if(!rs.isAES(s.algorithm))throw Error("AES session key expected");return df.elliptic.ecdhX.decrypt(e,o,s.wrappedKey,i,a)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(e,t){let r=0;switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=rs.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{n:e,e:n}}}case es.publicKey.dsa:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=rs.readMPI(t.subarray(r));r+=n.length+2;const i=rs.readMPI(t.subarray(r));r+=i.length+2;const a=rs.readMPI(t.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:e,q:n,g:i,y:a}}}case es.publicKey.elgamal:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=rs.readMPI(t.subarray(r));r+=n.length+2;const i=rs.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{p:e,g:n,y:i}}}case es.publicKey.ecdsa:{const e=new sl;r+=e.read(t),mf(e);const n=rs.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{oid:e,Q:n}}}case es.publicKey.eddsaLegacy:{const e=new sl;r+=e.read(t),mf(e);let n=rs.readMPI(t.subarray(r));return r+=n.length+2,n=rs.leftPad(n,33),{read:r,publicParams:{oid:e,Q:n}}}case es.publicKey.ecdh:{const e=new sl;r+=e.read(t),mf(e);const n=rs.readMPI(t.subarray(r));r+=n.length+2;const i=new Af;return r+=i.read(t.subarray(r)),{read:r,publicParams:{oid:e,Q:n,kdfParams:i}}}case es.publicKey.ed25519:case es.publicKey.x25519:{const e=t.subarray(r,r+32);return r+=e.length,{read:r,publicParams:{A:e}}}default:throw new ml("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(e,t,r){let n=0;switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:{const e=rs.readMPI(t.subarray(n));n+=e.length+2;const r=rs.readMPI(t.subarray(n));n+=r.length+2;const i=rs.readMPI(t.subarray(n));n+=i.length+2;const a=rs.readMPI(t.subarray(n));return n+=a.length+2,{read:n,privateParams:{d:e,p:r,q:i,u:a}}}case es.publicKey.dsa:case es.publicKey.elgamal:{const e=rs.readMPI(t.subarray(n));return n+=e.length+2,{read:n,privateParams:{x:e}}}case es.publicKey.ecdsa:case es.publicKey.ecdh:{const e=new _l(r.oid);let i=rs.readMPI(t.subarray(n));return n+=i.length+2,i=rs.leftPad(i,e.payloadSize),{read:n,privateParams:{d:i}}}case es.publicKey.eddsaLegacy:{const e=new _l(r.oid);let i=rs.readMPI(t.subarray(n));return n+=i.length+2,i=rs.leftPad(i,e.payloadSize),{read:n,privateParams:{seed:i}}}case es.publicKey.ed25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{seed:e}}}case es.publicKey.x25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{k:e}}}default:throw new ml("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(e,t){let r=0;switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:return{c:rs.readMPI(t.subarray(r))};case es.publicKey.elgamal:{const e=rs.readMPI(t.subarray(r));return r+=e.length+2,{c1:e,c2:rs.readMPI(t.subarray(r))}}case es.publicKey.ecdh:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=new gf;return n.read(t.subarray(r)),{V:e,C:n}}case es.publicKey.x25519:{const e=t.subarray(r,r+32);r+=e.length;const n=new yf;return n.read(t.subarray(r)),{ephemeralPublicKey:e,C:n}}default:throw new ml("Unknown public key encryption algorithm.")}},serializeParams:function(e,t){const r=new Set([es.publicKey.ed25519,es.publicKey.x25519]),n=Object.keys(t).map((n=>{const i=t[n];return rs.isUint8Array(i)?r.has(e)?i:rs.uint8ArrayToMPI(i):i.write()}));return rs.concatUint8Array(n)},generateParams:function(e,t,r){switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:return df.rsa.generate(t,65537).then((({n:e,e:t,d:r,p:n,q:i,u:a})=>({privateParams:{d:r,p:n,q:i,u:a},publicParams:{n:e,e:t}})));case es.publicKey.ecdsa:return df.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{d:r},publicParams:{oid:new sl(e),Q:t}})));case es.publicKey.eddsaLegacy:return df.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{seed:r},publicParams:{oid:new sl(e),Q:t}})));case es.publicKey.ecdh:return df.elliptic.generate(r).then((({oid:e,Q:t,secret:r,hash:n,cipher:i})=>({privateParams:{d:r},publicParams:{oid:new sl(e),Q:t,kdfParams:new Af({hash:n,cipher:i})}})));case es.publicKey.ed25519:return df.elliptic.eddsa.generate(e).then((({A:e,seed:t})=>({privateParams:{seed:t},publicParams:{A:e}})));case es.publicKey.x25519:return df.elliptic.ecdhX.generate(e).then((({A:e,k:t})=>({privateParams:{k:t},publicParams:{A:e}})));case es.publicKey.dsa:case es.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(e,t,r){if(!t||!r)throw Error("Missing key parameters");switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:{const{n:e,e:n}=t,{d:i,p:a,q:o,u:s}=r;return df.rsa.validateParams(e,n,i,a,o,s)}case es.publicKey.dsa:{const{p:e,q:n,g:i,y:a}=t,{x:o}=r;return df.dsa.validateParams(e,n,i,a,o)}case es.publicKey.elgamal:{const{p:e,g:n,y:i}=t,{x:a}=r;return df.elgamal.validateParams(e,n,i,a)}case es.publicKey.ecdsa:case es.publicKey.ecdh:{const n=df.elliptic[es.read(es.publicKey,e)],{oid:i,Q:a}=t,{d:o}=r;return n.validateParams(i,a,o)}case es.publicKey.eddsaLegacy:{const{Q:e,oid:n}=t,{seed:i}=r;return df.elliptic.eddsaLegacy.validateParams(n,e,i)}case es.publicKey.ed25519:{const{A:n}=t,{seed:i}=r;return df.elliptic.eddsa.validateParams(e,n,i)}case es.publicKey.x25519:{const{A:n}=t,{k:i}=r;return df.elliptic.ecdhX.validateParams(e,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(e){const{blockSize:t}=Xu(e),r=await Lh(t),n=new Uint8Array([r[r.length-2],r[r.length-1]]);return rs.concat([r,n])},generateSessionKey:function(e){const{keySize:t}=Xu(e);return Lh(t)},getAEADMode:function(e){const t=es.read(es.aead,e);return Kh[t]},getCipher:Xu,getPreferredCurveHashAlgo:function(e,t){switch(e){case es.publicKey.ecdsa:case es.publicKey.eddsaLegacy:return df.elliptic.getPreferredHashAlgo(t);case es.publicKey.ed25519:return df.elliptic.eddsa.getPreferredHashAlgo(e);default:throw Error("Unknown elliptic signing algo")}}});const wf={cipher:Vs,hash:Yu,mode:Kh,publicKey:df,signature:pf,random:jh,pkcs1:Xh,pkcs5:Yl,aesKW:Zl};Object.assign(wf,bf);var vf="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;const If={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(let a=0;a=0;)e[t]=0}const Pf=0,Mf=1,Uf=2,Df=29,Rf=256,Ff=Rf+1+Df,Tf=30,qf=19,Of=2*Ff+1,Kf=15,Hf=16,Nf=256,Lf=16,Gf=17,jf=18,zf=[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],Wf=[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],Zf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Jf=Array(2*(Ff+2));xf(Jf);const Vf=Array(2*Tf);xf(Vf);const Yf=Array(512);xf(Yf);const $f=Array(256);xf($f);const Xf=Array(Df);xf(Xf);const ed=Array(Tf);function td(e){return e<256?Yf[e]:Yf[256+(e>>>7)]}function rd(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function nd(e,t,r){e.bi_valid>Hf-r?(e.bi_buf|=t<>Hf-e.bi_valid,e.bi_valid+=r-Hf):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function od(e,t,r){const n=Array(Kf+1);let i,a,o=0;for(i=1;i<=Kf;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){const t=e[2*a+1];0!==t&&(e[2*a]=ad(n[t]++,t))}}function sd(e){let t;for(t=0;t8?rd(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ud(e,t,r,n){const i=2*t,a=2*r;return e[i]>1;o>=1;o--)hd(e,r,o);c=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hd(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*c]=r[2*o]+r[2*s],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=c,e.heap[1]=c++,hd(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,l,f,d,p,g=0;for(f=0;f<=Kf;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;uc&&(f=c,g++),r[2*h+1]=f,h>n||(e.bl_count[f]++,d=0,h>=s&&(d=o[h-s]),p=r[2*h],e.opt_len+=p*(f+d),a&&(e.static_len+=p*(i[2*h+1]+d)));if(0!==g){do{for(f=c-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(f=c;0!==f;f--)for(h=e.bl_count[f];0!==h;)l=e.heap[--u],l>n||(r[2*l+1]!==f&&(e.opt_len+=(f-r[2*l+1])*r[2*l],r[2*l+1]=f),h--)}}(e,t),od(r,u,e.bl_count)}function dd(e,t,r){let n,i,a=-1,o=t[1],s=0,c=7,u=4;for(0===o&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*($f[r]+Rf+1)]++,e.dyn_dtree[2*td(t)]++),e.last_lit===e.lit_bufsize-1}function yd(e,t,r,n){let i=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}const md=function(){let e;const t=[];for(let r=0;r<256;r++){e=r;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function bd(e,t,r,n){const i=md,a=n+r;e^=-1;for(let r=n;r>>8^i[255&(e^t[r])];return-1^e}const wd=3,vd=258,Id=vd+wd+1;function Ed(e){const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Cf(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Bd(e,t){(function(e,t,r,n){let i,a,o=0;e.level>0?(e.strm.data_type===Qf&&(e.strm.data_type=function(e){let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return kf;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Sf;for(t=32;t=3&&0===e.bl_tree[2*Zf[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?gd(e,t,r,n):e.strategy===_f||a===i?(nd(e,(Mf<<1)+(n?1:0),3),ld(e,Jf,Vf)):(nd(e,(Uf<<1)+(n?1:0),3),function(e,t,r,n){let i;for(nd(e,t-257,5),nd(e,r-1,5),nd(e,n-4,4),i=0;i=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ed(e.strm)}function Cd(e,t,r,n){let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,Cf(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=yd(e.adler,t,i,r):2===e.state.wrap&&(e.adler=bd(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function _d(e,t){let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-Id?e.strstart-(e.w_size-Id):0,u=e.window,h=e.w_mask,l=e.prev,f=e.strstart+vd;let d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,u[r+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=l[t&h])>c&&0!=--i);return o<=e.lookahead?o:e.lookahead}function kd(e){const t=e.w_size;let r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Id)){Cf(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);a+=t}if(0===e.strm.avail_in)break;if(n=Cd(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=wd)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=wd&&(e.ins_h=(e.ins_h<=wd)if(n=Ad(e,e.strstart-e.match_start,e.match_length-wd),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=wd){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=wd&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=wd-1)),e.prev_length>=wd&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-wd,n=Ad(e,e.strstart-1-e.prev_match,e.prev_length-wd),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(kd(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Bd(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-Id&&(Bd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Bd(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Bd(e,!1),e.strm.avail_out),1)})),new xd(4,4,8,4,Sd),new xd(4,5,16,8,Sd),new xd(4,6,32,32,Sd),new xd(4,4,16,16,Qd),new xd(8,16,32,32,Qd),new xd(8,16,128,128,Qd),new xd(8,32,128,256,Qd),new xd(32,128,258,1024,Qd),new xd(32,258,258,4096,Qd);try{String.fromCharCode.call(null,0)}catch(ho){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(ho){}const Pd=new Bf(256);for(let e=0;e<256;e++)Pd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Pd[254]=Pd[254]=1;var Md=[0,1,3,7,15,31,63,127,255],Ud=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Ud.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},Ud.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Md[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var n=r-e;t|=(this.curByte&Md[e]<>n,this.bitOffset+=e,e=0}}return t},Ud.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1},Ud.prototype.pi=function(){var e,t=new Uint8Array(6);for(e=0;e("00"+e.toString(16)).slice(-2))).join("")}(t)};var Dd=Ud,Rd=function(){};Rd.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Rd.prototype.read=function(e,t,r){for(var n=0;n>>0},this.updateCRC=function(t){e=e<<8^Fd[255&(e>>>24^t)]},this.updateCRCRun=function(t,r){for(;r-- >0;)e=e<<8^Fd[255&(e>>>24^t)]}}),qd=function(e,t){var r,n=e[t];for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},Od=-2,Kd=-3,Hd=-4,Nd=-5,Ld=-6,Gd=-7,jd={"-1":"Bad file checksum"};jd[Od]="Not bzip data",jd[Kd]="Unexpected input EOF",jd[Hd]="Unexpected output EOF",jd[Nd]="Data error",jd[Ld]="Out of memory",jd[Gd]="Obsolete (pre 0.9.5) bzip format not supported.";var zd=function(e,t){var r=jd[e]||"unknown error";t&&(r+=": "+t);var n=new TypeError(r);throw n.errorCode=e,n},Wd=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};Wd.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new Td,!0):(this.writeCount=-1,!1)},Wd.prototype._start_bunzip=function(e,t){var r=new Uint8Array(4);4===e.read(r,0,4)&&"BZh"===String.fromCharCode(r[0],r[1],r[2])||zd(Od,"bad magic");var n=r[3]-48;(n<1||n>9)&&zd(Od,"level out of range"),this.reader=new Dd(e),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},Wd.prototype._get_next_block=function(){var e,t,r,n=this.reader,i=n.pi();if("177245385090"===i)return!1;"314159265359"!==i&&zd(Od),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&zd(Gd);var a=n.read(24);a>this.dbufSize&&zd(Nd,"initial position out of bounds");var o=n.read(16),s=new Uint8Array(256),c=0;for(e=0;e<16;e++)if(o&1<<15-e){var u=16*e;for(r=n.read(16),t=0;t<16;t++)r&1<<15-t&&(s[c++]=u+t)}var h=n.read(3);(h<2||h>6)&&zd(Nd);var l=n.read(15);0===l&&zd(Nd);var f=new Uint8Array(256);for(e=0;e=h&&zd(Nd);d[e]=qd(f,t)}var p,g=c+2,A=[];for(t=0;t20)&&zd(Nd),n.read(1);)n.read(1)?o--:o++;b[e]=o}for(y=m=b[0],e=1;em?m=b[e]:b[e]=l&&zd(Nd),p=A[d[_++]]),e=p.minLen,t=n.read(e);e>p.maxLen&&zd(Nd),!(t<=p.limit[e]);e++)t=t<<1|n.read(1);((t-=p.base[e])<0||t>=258)&&zd(Nd);var S=p.permute[t];if(0!==S&&1!==S){if(B)for(B=0,C+o>this.dbufSize&&zd(Nd),I[E=s[f[0]]]+=o;o--;)k[C++]=E;if(S>c)break;C>=this.dbufSize&&zd(Nd),I[E=s[E=qd(f,e=S-1)]]++,k[C++]=E}else B||(B=1,o=0),o+=0===S?B:2*B,B<<=1}for((a<0||a>=C)&&zd(Nd),t=0,e=0;e<256;e++)r=t+I[e],I[e]=t,t=r;for(e=0;e>=8,P=-1),this.writePos=Q,this.writeCurrent=x,this.writeCount=C,this.writeRun=P,!0},Wd.prototype._read_bunzip=function(e,t){var r,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var u=this.writeRun;c;){for(c--,n=s,s=255&(o=a[o]),o>>=8,3==u++?(r=s,i=n,s=-1):(r=1,i=s),this.blockCRC.updateCRCRun(i,r);r--;)this.outputStream.writeByte(i),this.nextoutput++;s!=n&&(u=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&zd(Nd,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};const Zd=Symbol("verified"),Jd=new Set([es.signatureSubpacket.issuer,es.signatureSubpacket.issuerFingerprint,es.signatureSubpacket.embeddedSignature]);class Vd{static get tag(){return es.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new ws,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Zd]=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new ml(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=wf.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Yo((async()=>wf.serializeParams(this.publicKeyAlgorithm,await this.params))):wf.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),rs.concat(e)}async sign(e,t,r=new Date,n=!1){5===e.version?this.version=5:this.version=4;const i=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=rs.normalizeDate(r),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),i.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=rs.concat(i);const a=this.toHash(this.signatureType,t,n),o=await this.hash(this.signatureType,t,a,n);this.signedHashValue=Jo(zo(o),0,2);const s=async()=>wf.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,a,await Vo(o));rs.isStream(o)?this.params=s():(this.params=await s(),this[Zd]=!0)}writeHashedSubPackets(){const e=es.signatureSubpacket,t=[];let r;if(null===this.created)throw Error("Missing signature creation time");t.push(Yd(e.signatureCreationTime,!0,rs.writeDate(this.created))),null!==this.signatureExpirationTime&&t.push(Yd(e.signatureExpirationTime,!0,rs.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&t.push(Yd(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(r=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Yd(e.trustSignature,!0,r))),null!==this.regularExpression&&t.push(Yd(e.regularExpression,!0,this.regularExpression)),null!==this.revocable&&t.push(Yd(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&t.push(Yd(e.keyExpirationTime,!0,rs.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Yd(e.preferredSymmetricAlgorithms,!1,r))),null!==this.revocationKeyClass&&(r=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),r=rs.concat([r,this.revocationKeyFingerprint]),t.push(Yd(e.revocationKey,!1,r))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||t.push(Yd(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:n,value:i,humanReadable:a,critical:o})=>{r=[new Uint8Array([a?128:0,0,0,0])];const s=rs.encodeUTF8(n);r.push(rs.writeNumber(s.length,2)),r.push(rs.writeNumber(i.length,2)),r.push(s),r.push(i),r=rs.concat(r),t.push(Yd(e.notationData,o,r))})),null!==this.preferredHashAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Yd(e.preferredHashAlgorithms,!1,r))),null!==this.preferredCompressionAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Yd(e.preferredCompressionAlgorithms,!1,r))),null!==this.keyServerPreferences&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.keyServerPreferences)),t.push(Yd(e.keyServerPreferences,!1,r))),null!==this.preferredKeyServer&&t.push(Yd(e.preferredKeyServer,!1,rs.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&t.push(Yd(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&t.push(Yd(e.policyURI,!1,rs.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.keyFlags)),t.push(Yd(e.keyFlags,!0,r))),null!==this.signersUserID&&t.push(Yd(e.signersUserID,!1,rs.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(r=rs.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Yd(e.reasonForRevocation,!0,r))),null!==this.features&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.features)),t.push(Yd(e.features,!1,r))),null!==this.signatureTargetPublicKeyAlgorithm&&(r=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],r.push(rs.stringToUint8Array(this.signatureTargetHash)),r=rs.concat(r),t.push(Yd(e.signatureTarget,!0,r))),null!==this.embeddedSignature&&t.push(Yd(e.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=rs.concat(r),t.push(Yd(e.issuerFingerprint,5===this.version,r))),null!==this.preferredAEADAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Yd(e.preferredAEADAlgorithms,!1,r)));const n=rs.concat(t),i=rs.writeNumber(n.length,2);return rs.concat([i,n])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach((t=>{e.push(fl(t.length)),e.push(t)}));const t=rs.concat(e),r=rs.writeNumber(t.length,2);return rs.concat([r,t])}readSubPacket(e,t=!0){let r=0;const n=!!(128&e[r]),i=127&e[r];if(t||(this.unhashedSubpackets.push(e.subarray(r,e.length)),Jd.has(i)))switch(r++,i){case es.signatureSubpacket.signatureCreationTime:this.created=rs.readDate(e.subarray(r,e.length));break;case es.signatureSubpacket.signatureExpirationTime:{const t=rs.readNumber(e.subarray(r,e.length));this.signatureNeverExpires=0===t,this.signatureExpirationTime=t;break}case es.signatureSubpacket.exportableCertification:this.exportable=1===e[r++];break;case es.signatureSubpacket.trustSignature:this.trustLevel=e[r++],this.trustAmount=e[r++];break;case es.signatureSubpacket.regularExpression:this.regularExpression=e[r];break;case es.signatureSubpacket.revocable:this.revocable=1===e[r++];break;case es.signatureSubpacket.keyExpirationTime:{const t=rs.readNumber(e.subarray(r,e.length));this.keyExpirationTime=t,this.keyNeverExpires=0===t;break}case es.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.revocationKey:this.revocationKeyClass=e[r++],this.revocationKeyAlgorithm=e[r++],this.revocationKeyFingerprint=e.subarray(r,r+20);break;case es.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(r,e.length));break;case es.signatureSubpacket.notationData:{const t=!!(128&e[r]);r+=4;const i=rs.readNumber(e.subarray(r,r+2));r+=2;const a=rs.readNumber(e.subarray(r,r+2));r+=2;const o=rs.decodeUTF8(e.subarray(r,r+i)),s=e.subarray(r+i,r+i+a);this.rawNotations.push({name:o,humanReadable:t,value:s,critical:n}),t&&(this.notations[o]=rs.decodeUTF8(s));break}case es.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==e[r++];break;case es.signatureSubpacket.policyURI:this.policyURI=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.signersUserID:this.signersUserID=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[r++],this.reasonForRevocationString=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.features:this.features=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[r++],this.signatureTargetHashAlgorithm=e[r++];const t=wf.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=rs.uint8ArrayToString(e.subarray(r,r+t));break}case es.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Vd,this.embeddedSignature.read(e.subarray(r,e.length));break;case es.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[r++],this.issuerFingerprint=e.subarray(r,e.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case es.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(r,e.length)];break;default:{const e=Error("Unknown signature subpacket type "+i);if(n)throw e;rs.printDebug(e)}}}readSubPackets(e,t=!0,r){const n=rs.readNumber(e.subarray(0,2));let i=2;for(;i<2+n;){const n=ll(e.subarray(i,e.length));i+=n.offset,this.readSubPacket(e.subarray(i,i+n.len),t,r),i+=n.len}return i}toSign(e,t){const r=es.signature;switch(e){case r.binary:return null!==t.text?rs.encodeUTF8(t.getText(!0)):t.getBytes(!0);case r.text:{const e=t.getBytes(!0);return rs.canonicalizeEOL(e)}case r.standalone:return new Uint8Array(0);case r.certGeneric:case r.certPersona:case r.certCasual:case r.certPositive:case r.certRevocation:{let e,n;if(t.userID)n=180,e=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");n=209,e=t.userAttribute}const i=e.write();return rs.concat([this.toSign(r.key,t),new Uint8Array([n]),rs.writeNumber(i.length,4),i])}case r.subkeyBinding:case r.subkeyRevocation:case r.keyBinding:return rs.concat([this.toSign(r.key,t),this.toSign(r.key,{key:t.bind})]);case r.key:if(void 0===t.key)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case r.keyRevocation:return this.toSign(r.key,t);case r.timestamp:return new Uint8Array(0);case r.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let r=0;return Go(zo(this.signatureData),(e=>{r+=e.length}),(()=>{const n=[];return 5!==this.version||this.signatureType!==es.signature.binary&&this.signatureType!==es.signature.text||(t?n.push(new Uint8Array(6)):n.push(e.writeHeader())),n.push(new Uint8Array([this.version,255])),5===this.version&&n.push(new Uint8Array(4)),n.push(rs.writeNumber(r,4)),rs.concat(n)}))}toHash(e,t,r=!1){const n=this.toSign(e,t);return rs.concat([n,this.signatureData,this.calculateTrailer(t,r)])}async hash(e,t,r,n=!1){return r||(r=this.toHash(e,t,n)),wf.hash.digest(this.hashAlgorithm,r)}async verify(e,t,r,n=new Date,i=!1,a=hs){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===es.signature.binary||t===es.signature.text;if(!this[Zd]||o){let n,a;if(this.hashed?a=await this.hashed:(n=this.toHash(t,r,i),a=await this.hash(t,r,n)),a=await Vo(a),this.signedHashValue[0]!==a[0]||this.signedHashValue[1]!==a[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[Zd]=await wf.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,n,a),!this[Zd])throw Error("Signature verification failed")}const s=rs.normalizeDate(n);if(s&&this.created>s)throw Error("Signature creation time is in the future");if(s&&s>=this.getExpirationTime())throw Error("Signature is expired");if(a.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+es.read(es.hash,this.hashAlgorithm).toUpperCase());if(a.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[es.signature.binary,es.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+es.read(es.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:e,critical:t})=>{if(t&&a.knownNotations.indexOf(e)<0)throw Error("Unknown critical notation: "+e)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=rs.normalizeDate(e);return null!==t&&!(this.created<=t&&tVd.prototype.calculateTrailer.apply(await this.correspondingSig,e)))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==es.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function Xd(e,t){if(!t[e]){let r;try{r=es.read(es.packet,e)}catch(t){throw new ml("Unknown packet type with tag: "+e)}throw Error("Packet not allowed in this context: "+r)}return new t[e]}$d.prototype.hash=Vd.prototype.hash,$d.prototype.toHash=Vd.prototype.toHash,$d.prototype.toSign=Vd.prototype.toSign;class ep extends Array{static async fromBinary(e,t,r=hs){const n=new ep;return await n.read(e,t,r),n}async read(e,t,r=hs){r.additionalAllowedPackets.length&&(t={...t,...rs.constructAllowedPackets(r.additionalAllowedPackets)}),this.stream=jo(e,(async(e,n)=>{const i=Ko(n);try{for(;;)if(await i.ready,await yl(e,(async e=>{try{if(e.tag===es.packet.marker||e.tag===es.packet.trust)return;const n=Xd(e.tag,t);n.packets=new ep,n.fromStream=rs.isStream(e.packet),await n.read(e.packet,r),await i.write(n)}catch(t){const n=!r.ignoreUnsupportedPackets&&t instanceof ml,a=!(r.ignoreMalformedPackets||t instanceof ml);if(n||a||Al(e.tag))await i.abort(t);else{const t=new bl(e.tag,e.packet);await i.write(t)}rs.printDebugError(t)}})))return await i.ready,void await i.close()}catch(e){await i.abort(e)}}));const n=Oo(this.stream);for(;;){const{done:e,value:t}=await n.read();if(e?this.stream=null:this.push(t),e||Al(t.constructor.tag))break}n.releaseLock()}write(){const e=[];for(let t=0;t{if(t.push(e),i+=e.length,i>=a){const e=Math.min(Math.log(i)/Math.LN2|0,30),r=2**e,n=rs.concat([dl(e)].concat(t));return t=[n.subarray(1+r)],i=t[0].length,n.subarray(0,1+r)}}),(()=>rs.concat([fl(i)].concat(t)))))}else{if(rs.isStream(n)){let t=0;e.push(Go(zo(n),(e=>{t+=e.length}),(()=>gl(r,t))))}else e.push(gl(r,n.length));e.push(n)}}return rs.concat(e)}filterByTag(...e){const t=new ep,r=e=>t=>e===t;for(let n=0;nt.constructor.tag===e))}indexOfTag(...e){const t=[],r=this,n=e=>t=>e===t;for(let i=0;i>4)}read(e){let t=0;try{this.type=es.read(es.s2k,e[t++])}catch(e){throw new ml("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==rs.uint8ArrayToString(e.subarray(t,t+3)))throw new ml("Unknown s2k type.");if(t+=3,1001!==1e3+e[t++])throw new ml("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new ml("Unknown s2k type.")}return t}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...rs.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([es.write(es.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return rs.concatUint8Array(e)}async produceKey(e,t){e=rs.encodeUTF8(e);const r=[];let n=0,i=0;for(;n{this.privateParams[e].fill(0),delete this.privateParams[e]})),this.privateParams=null,this.isEncrypted=!0)}}async function sp(e,t,r){const{keySize:n}=wf.getCipher(r);return e.produceKey(t,n)}var cp=cc((function(e){!function(t){function r(e){function t(){return Ee0&&(t.semantic=" "),t}}function A(e,t){return function(){var n,a,s,u,h;for(u=r(),n=o("star"),s=0,h=void 0===t?0:t;null!==(a=e());)s+=1,c(n,a);return s>=h?n:(i(u),null)}}function y(e){return e.charCodeAt(0)>=128}function m(){return s("cr",h("\r")())}function b(){return s("crlf",l(m,I)())}function w(){return s("dquote",h('"')())}function v(){return s("htab",h("\t")())}function I(){return s("lf",h("\n")())}function E(){return s("sp",h(" ")())}function B(){return s("vchar",u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n})))}function C(){return s("wsp",f(E,v)())}function _(){var e=s("quoted-pair",f(l(h("\\"),f(B,C)),ne)());return null===e?null:(e.semantic=e.semantic[1],e)}function k(){return s("fws",f(ae,l(d(l(A(C),p(b))),A(C,1)))())}function S(){return s("ctext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=39||42<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),te)())}function Q(){return s("ccontent",f(S,_,x)())}function x(){return s("comment",l(h("("),A(l(d(k),Q)),d(k),h(")"))())}function P(){return s("cfws",f(l(A(l(d(k),x),1),d(k)),k)())}function M(){return s("atext",u((function(t){var r="a"<=t&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(t)>=0;return e.rfc6532&&(r=r||y(t)),r})))}function U(){return s("atom",l(g(d(P)),A(M,1),g(d(P)))())}function D(){var e,t;return null===(e=s("dot-atom-text",A(M,1)()))||null!==(t=A(l(h("."),A(M,1)))())&&c(e,t),e}function R(){return s("dot-atom",l(p(d(P)),D,p(d(P)))())}function F(){return s("qtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33===r||35<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),re)())}function T(){return s("qcontent",f(F,_)())}function q(){return s("quoted-string",l(p(d(P)),p(w),A(l(d(g(k)),T)),d(p(k)),p(w),p(d(P)))())}function O(){return s("word",f(U,q)())}function K(){return s("address",f(H,G)())}function H(){return s("mailbox",f(N,X)())}function N(){return s("name-addr",l(d(j),L)())}function L(){return s("angle-addr",f(l(p(d(P)),h("<"),X,h(">"),p(d(P))),oe)())}function G(){return s("group",l(j,h(":"),d(Z),h(";"),p(d(P)))())}function j(){return s("display-name",(null!==(e=s("phrase",f(ie,A(O,1))()))&&(e.semantic=function(e){return e.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(e.semantic)),e));var e}function z(){return s("mailbox-list",f(l(H,A(l(h(","),H))),ue)())}function W(){return s("address-list",f(l(K,A(l(h(","),K))),he)())}function Z(){return s("group-list",f(z,p(P),le)())}function J(){return s("local-part",f(fe,R,q)())}function V(){return s("dtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=90||94<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),pe)())}function Y(){return s("domain-literal",l(p(d(P)),h("["),A(l(d(k),V)),d(k),h("]"),p(d(P)))())}function $(){return s("domain",(t=f(de,R,Y)(),e.rejectTLD&&t&&t.semantic&&t.semantic.indexOf(".")<0?null:(t&&(t.semantic=t.semantic.replace(/\s+/g,"")),t)));var t}function X(){return s("addr-spec",l(J,h("@"),$)())}function ee(){return e.strict?null:s("obs-NO-WS-CTL",u((function(e){var t=e.charCodeAt(0);return 1<=t&&t<=8||11===t||12===t||14<=t&&t<=31||127===t})))}function te(){return e.strict?null:s("obs-ctext",ee())}function re(){return e.strict?null:s("obs-qtext",ee())}function ne(){return e.strict?null:s("obs-qp",l(h("\\"),f(h("\0"),ee,I,m))())}function ie(){return e.strict?null:e.atInDisplayName?s("obs-phrase",l(O,A(f(O,h("."),h("@"),g(P))))()):s("obs-phrase",l(O,A(f(O,h("."),g(P))))())}function ae(){return e.strict?null:s("obs-FWS",A(l(p(d(b)),C),1)())}function oe(){return e.strict?null:s("obs-angle-addr",l(p(d(P)),h("<"),se,X,h(">"),p(d(P)))())}function se(){return e.strict?null:s("obs-route",l(ce,h(":"))())}function ce(){return e.strict?null:s("obs-domain-list",l(A(f(p(P),h(","))),h("@"),$,A(l(h(","),p(d(P)),d(l(h("@"),$)))))())}function ue(){return e.strict?null:s("obs-mbox-list",l(A(l(p(d(P)),h(","))),H,A(l(h(","),d(l(H,p(P))))))())}function he(){return e.strict?null:s("obs-addr-list",l(A(l(p(d(P)),h(","))),K,A(l(h(","),d(l(K,p(P))))))())}function le(){return e.strict?null:s("obs-group-list",l(A(l(p(d(P)),h(",")),1),p(d(P)))())}function fe(){return e.strict?null:s("obs-local-part",l(O,A(l(h("."),O)))())}function de(){return e.strict?null:s("obs-domain",l(U,A(l(h("."),U)))())}function pe(){return e.strict?null:s("obs-dtext",f(ee,_)())}function ge(e,t){var r,n,i;if(null==t)return null;for(n=[t];n.length>0;){if((i=n.pop()).name===e)return i;for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r])}return null}function Ae(e,t){var r,n,i,a,o;if(null==t)return null;for(n=[t],a=[],o={},r=0;r0;)if((i=n.pop()).name in o)a.push(i);else for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}function ye(t){var r,n,i,a,o;if(null===t)return null;for(r=[],n=Ae(["group","mailbox"],t),i=0;i1?null:t.addresses&&t.addresses[0]:null}(o):e.simple?o&&o.addresses:o}function me(e){var t,r=ge("display-name",e),n=[],i=Ae(["mailbox"],e);for(t=0;t0;)for("cfws"===(i=n.pop()).name&&a.push(i),r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}(0,e),i=Ae(["comment"],e),a=ge("local-part",r),o=ge("domain",r);return{node:e,parts:{name:t,address:r,local:a,domain:o,comments:n},type:e.name,name:we(t),address:we(r),local:we(a),domain:we(o),comments:ve(i),groupName:we(e.groupName)}}function we(e){return null!=e?e.semantic:null}function ve(e){var t="";if(e)for(var r=0;r`),t.userID=r.join(" "),t}read(e,t=hs){const r=rs.decodeUTF8(e);if(r.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:e,address:t,comments:n}=cp.parseOneAddress({input:r,atInDisplayName:!0});this.comment=n.replace(/^\(|\)$/g,""),this.name=e,this.email=t}catch(e){}this.userID=r}write(){return rs.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class hp extends op{static get tag(){return es.packet.secretSubkey}constructor(e=new Date,t=hs){super(e,t)}}async function lp(e,t,r,n,i=new Date,a){let o,s;for(let c=e.length-1;c>=0;c--)try{(!o||e[c].created>=o.created)&&(await e[c].verify(t,r,n,i,void 0,a),o=e[c])}catch(e){s=e}if(!o)throw rs.wrapError(`Could not find valid ${es.read(es.signature,r)} signature in key ${t.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((e,t,r)=>t+" "+r.toLowerCase())),s);return o}function fp(e,t,r=new Date){const n=rs.normalizeDate(r);if(null!==n){const r=Ap(e,t);return!(e.created<=n&&ne.equals(i.issuerKeyID)))||i.revoked||!1,i.revoked):c.length>0}function Ap(e,t){let r;return!1===t.keyNeverExpires&&(r=e.created.getTime()+1e3*t.keyExpirationTime),r?new Date(r):1/0}function yp(e,t){const r=e.algorithm;return r!==es.publicKey.rsaEncrypt&&r!==es.publicKey.elgamal&&r!==es.publicKey.ecdh&&r!==es.publicKey.x25519&&(!t.keyFlags||0!=(t.keyFlags[0]&es.keyFlags.signData))}function mp(e,t){const r=e.algorithm;return r!==es.publicKey.dsa&&r!==es.publicKey.rsaSign&&r!==es.publicKey.ecdsa&&r!==es.publicKey.eddsaLegacy&&r!==es.publicKey.ed25519&&(!t.keyFlags||0!=(t.keyFlags[0]&es.keyFlags.encryptCommunication)||0!=(t.keyFlags[0]&es.keyFlags.encryptStorage))}function bp(e,t){return!!t.allowInsecureDecryptionWithSigningKeys||!e.keyFlags||0!=(e.keyFlags[0]&es.keyFlags.encryptCommunication)||0!=(e.keyFlags[0]&es.keyFlags.encryptStorage)}function wp(e,t){const r=es.write(es.publicKey,e.algorithm),n=e.getAlgorithmInfo();if(t.rejectPublicKeyAlgorithms.has(r))throw Error(n.algorithm+" keys are considered too weak.");switch(r){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:case es.publicKey.rsaEncrypt:if(n.bitse.getKeys(s).length>0));return 0===c.length?null:(await Promise.all(c.map((async t=>{const a=await t.getSigningKey(s,e.created,void 0,n);if(e.revoked||await i.isRevoked(e,a.keyPacket,r,n))throw Error("User certificate is revoked");try{await e.verify(a.keyPacket,es.signature.certGeneric,o,r,void 0,n)}catch(e){throw rs.wrapError("User certificate is invalid",e)}}))),!0)}async verifyAllCertifications(e,t=new Date,r){const n=this,i=this.selfCertifications.concat(this.otherCertifications);return Promise.all(i.map((async i=>({keyID:i.issuerKeyID,valid:await n.verifyCertificate(i,e,t,r).catch((()=>!1))}))))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const r=this,n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};let a;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const a=this.selfCertifications[o];if(a.revoked||await r.isRevoked(a,void 0,e,t))throw Error("Self-certification is revoked");try{await a.verify(n,es.signature.certGeneric,i,e,void 0,t)}catch(e){throw rs.wrapError("Self-certification is invalid",e)}return!0}catch(e){a=e}throw a}async update(e,t,r){const n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};await pp(e,this,"selfCertifications",t,(async function(e){try{return await e.verify(n,es.signature.certGeneric,i,t,!1,r),!0}catch(e){return!1}})),await pp(e,this,"otherCertifications",t),await pp(e,this,"revocationSignatures",t,(function(e){return gp(n,es.signature.certRevocation,i,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=es.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=hs){const a={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new vp(a.userID||a.userAttribute,this.mainKey);return o.revocationSignatures.push(await dp(a,null,e,{signatureType:es.signature.certRevocation,reasonForRevocationFlag:es.write(es.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}}class Ip{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new ep;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new Ip(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,r=new Date,n=hs){const i=this.mainKey.keyPacket;return gp(i,es.signature.subkeyRevocation,{key:i,bind:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verify(e=new Date,t=hs){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket},i=await lp(this.bindingSignatures,r,es.signature.subkeyBinding,n,e,t);if(i.revoked||await this.isRevoked(i,null,e,t))throw Error("Subkey is revoked");if(fp(this.keyPacket,i,e))throw Error("Subkey is expired");return i}async getExpirationTime(e=new Date,t=hs){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket};let i;try{i=await lp(this.bindingSignatures,r,es.signature.subkeyBinding,n,e,t)}catch(e){return null}const a=Ap(this.keyPacket,i),o=i.getExpirationTime();return ai.bindingSignatures[t].created&&(i.bindingSignatures[t]=e),!1;try{return await e.verify(n,es.signature.subkeyBinding,a,t,void 0,r),!0}catch(e){return!1}})),await pp(e,this,"revocationSignatures",t,(function(e){return gp(n,es.signature.subkeyRevocation,a,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=es.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=hs){const a={key:e,bind:this.keyPacket},o=new Ip(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await dp(a,null,e,{signatureType:es.signature.subkeyRevocation,reasonForRevocationFlag:es.write(es.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((e=>{Ip.prototype[e]=function(){return this.keyPacket[e]()}}));const Ep=rs.constructAllowedPackets([Vd]),Bp=new Set([es.packet.publicKey,es.packet.privateKey]),Cp=new Set([es.packet.publicKey,es.packet.privateKey,es.packet.publicSubkey,es.packet.privateSubkey]);class _p{packetListToStructure(e,t=new Set){let r,n,i,a;for(const o of e){if(o instanceof bl){Cp.has(o.tag)&&!a&&(a=Bp.has(o.tag)?Bp:Cp);continue}const e=o.constructor.tag;if(a){if(!a.has(e))continue;a=null}if(t.has(e))throw Error("Unexpected packet type: "+e);switch(e){case es.packet.publicKey:case es.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,n=this.getKeyID(),!n)throw Error("Missing Key ID");break;case es.packet.userID:case es.packet.userAttribute:r=new vp(o,this),this.users.push(r);break;case es.packet.publicSubkey:case es.packet.secretSubkey:r=null,i=new Ip(o,this),this.subkeys.push(i);break;case es.packet.signature:switch(o.signatureType){case es.signature.certGeneric:case es.signature.certPersona:case es.signature.certCasual:case es.signature.certPositive:if(!r){rs.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(n)?r.selfCertifications.push(o):r.otherCertifications.push(o);break;case es.signature.certRevocation:r?r.revocationSignatures.push(o):this.directSignatures.push(o);break;case es.signature.key:this.directSignatures.push(o);break;case es.signature.subkeyBinding:if(!i){rs.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}i.bindingSignatures.push(o);break;case es.signature.keyRevocation:this.revocationSignatures.push(o);break;case es.signature.subkeyRevocation:if(!i){rs.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}i.revocationSignatures.push(o)}}}}toPacketList(){const e=new ep;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map((t=>e.push(...t.toPacketList()))),this.subkeys.map((t=>e.push(...t.toPacketList()))),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach((e=>{if(e.keyPacket=Object.create(Object.getPrototypeOf(e.keyPacket),Object.getOwnPropertyDescriptors(e.keyPacket)),!e.keyPacket.isDecrypted())return;const t={};Object.keys(e.keyPacket.privateParams).forEach((r=>{t[r]=new Uint8Array(e.keyPacket.privateParams[r])})),e.keyPacket.privateParams=t})),t}getSubkeys(e=null){return this.subkeys.filter((t=>!e||t.getKeyID().equals(e,!0)))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map((e=>e.getKeyID()))}getUserIDs(){return this.users.map((e=>e.userID?e.userID.userID:null)).filter((e=>null!==e))}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,r={},n=hs){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await lp(r.bindingSignatures,i,es.signature.subkeyBinding,e,t,n);if(!yp(r.keyPacket,a))continue;if(!a.embeddedSignature)throw Error("Missing embedded signature");return await lp([a.embeddedSignature],r.keyPacket,es.signature.keyBinding,e,t,n),wp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&yp(i,a.selfCertification))return wp(i,n),this}catch(e){o=e}throw rs.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,r={},n=hs){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await lp(r.bindingSignatures,i,es.signature.subkeyBinding,e,t,n);if(mp(r.keyPacket,a))return wp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&mp(i,a.selfCertification))return wp(i,n),this}catch(e){o=e}throw rs.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,r=new Date,n=hs){return gp(this.keyPacket,es.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verifyPrimaryKey(e=new Date,t={},r=hs){const n=this.keyPacket;if(await this.isRevoked(null,null,e,r))throw Error("Primary key is revoked");const{selfCertification:i}=await this.getPrimaryUser(e,t,r);if(fp(n,i,e))throw Error("Primary key is expired");const a=await lp(this.directSignatures,n,es.signature.key,{key:n},e,r).catch((()=>{}));if(a&&fp(n,a,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=hs){let r;try{const{selfCertification:n}=await this.getPrimaryUser(null,e,t),i=Ap(this.keyPacket,n),a=n.getExpirationTime(),o=await lp(this.directSignatures,this.keyPacket,es.signature.key,{key:this.keyPacket},null,t).catch((()=>{}));if(o){const e=Ap(this.keyPacket,o);r=Math.min(i,a,e)}else r=ie.subkeys.some((e=>t.hasSameFingerprintAs(e))))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,r)}const n=this.clone();return await pp(e,n,"revocationSignatures",t,(i=>gp(n.keyPacket,es.signature.keyRevocation,n,[i],null,e.keyPacket,t,r))),await pp(e,n,"directSignatures",t),await Promise.all(e.users.map((async e=>{const i=n.users.filter((t=>e.userID&&e.userID.equals(t.userID)||e.userAttribute&&e.userAttribute.equals(t.userAttribute)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.users.push(t)}}))),await Promise.all(e.subkeys.map((async e=>{const i=n.subkeys.filter((t=>t.hasSameFingerprintAs(e)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.subkeys.push(t)}}))),n}async getRevocationCertificate(e=new Date,t=hs){const r={key:this.keyPacket},n=await lp(this.revocationSignatures,this.keyPacket,es.signature.keyRevocation,r,e,t),i=new ep;return i.push(n),bs(es.armor.publicKey,i.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,r=hs){const n=await ms(e,r),i=(await ep.fromBinary(n.data,Ep,r)).findPacket(es.packet.signature);if(!i||i.signatureType!==es.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!i.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await i.verify(this.keyPacket,es.signature.keyRevocation,{key:this.keyPacket},t,void 0,r)}catch(e){throw rs.wrapError("Could not verify revocation signature",e)}const a=this.clone();return a.revocationSignatures.push(i),a}async signPrimaryUser(e,t,r,n=hs){const{index:i,user:a}=await this.getPrimaryUser(t,r,n),o=await a.certify(e,t,n),s=this.clone();return s.users[i]=o,s}async signAllUsers(e,t=new Date,r=hs){const n=this.clone();return n.users=await Promise.all(this.users.map((function(n){return n.certify(e,t,r)}))),n}async verifyPrimaryUser(e,t=new Date,r,n=hs){const i=this.keyPacket,{user:a}=await this.getPrimaryUser(t,r,n);return e?await a.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await a.verify(t,n).catch((()=>!1))}]}async verifyAllUsers(e,t=new Date,r=hs){const n=this.keyPacket,i=[];return await Promise.all(this.users.map((async a=>{const o=e?await a.verifyAllCertifications(e,t,r):[{keyID:n.getKeyID(),valid:await a.verify(t,r).catch((()=>!1))}];i.push(...o.map((e=>({userID:a.userID?a.userID.userID:null,userAttribute:a.userAttribute,keyID:e.keyID,valid:e.valid}))))}))),i}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((e=>{_p.prototype[e]=Ip.prototype[e]}));class kp extends _p{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([es.packet.secretKey,es.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=hs){return bs(es.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class Sp extends kp{constructor(e){if(super(),this.packetListToStructure(e,new Set([es.packet.publicKey,es.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new ep,t=this.toPacketList();for(const r of t)switch(r.constructor.tag){case es.packet.secretKey:{const t=np.fromSecretKeyPacket(r);e.push(t);break}case es.packet.secretSubkey:{const t=ip.fromSecretSubkeyPacket(r);e.push(t);break}default:e.push(r)}return new kp(e)}armor(e=hs){return bs(es.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,r={},n=hs){const i=this.keyPacket,a=[];for(let r=0;re.isDecrypted()))}async validate(e=hs){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const r=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});r&&!r.keyPacket.isDummy()&&(t=r.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const e=this.getKeys(),t=e.map((e=>e.keyPacket.isDummy())).every(Boolean);if(t)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(e.map((async e=>e.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()}))}async revoke({flag:e=es.reasonForRevocation.noReason,string:t=""}={},r=new Date,n=hs){if(!this.isPrivate())throw Error("Need private key for revoking");const i={key:this.keyPacket},a=this.clone();return a.revocationSignatures.push(await dp(i,null,this.keyPacket,{signatureType:es.signature.keyRevocation,reasonForRevocationFlag:es.write(es.reasonForRevocation,e),reasonForRevocationString:t},r,void 0,void 0,void 0,n)),a}async addSubkey(e={}){const t={...hs,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1),await dp(i,null,t,a,r.date,void 0,void 0,void 0,n)}(i,r,e,t),o=this.toPacketList();return o.push(i,a),new Sp(o)}}const Qp=rs.constructAllowedPackets([np,ip,op,hp,up,ap,Vd]);async function xp({armoredKey:e,binaryKey:t,config:r,...n}){if(r={...hs,...r},!e&&!t)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!rs.isString(e))throw Error("readKey: options.armoredKey must be a string");if(t&&!rs.isUint8Array(t))throw Error("readKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(e){const{type:t,data:n}=await ms(e,r);if(t!==es.armor.publicKey&&t!==es.armor.privateKey)throw Error("Armored text not of type key");a=n}else a=t;return function(e){for(const t of e)switch(t.constructor.tag){case es.packet.secretKey:return new Sp(e);case es.packet.publicKey:return new kp(e)}throw Error("No key packet found")}(await ep.fromBinary(a,Qp,r))}Object.keys(hs).length;const Pp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function Mp(){}const Up="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Dp(e){return"object"==typeof e&&null!==e||"function"==typeof e}const Rp=Mp,Fp=Promise,Tp=Promise.prototype.then,qp=Promise.resolve.bind(Fp),Op=Promise.reject.bind(Fp);function Kp(e){return new Fp(e)}function Hp(e){return qp(e)}function Np(e){return Op(e)}function Lp(e,t,r){return Tp.call(e,t,r)}function Gp(e,t,r){Lp(Lp(e,t,r),void 0,Rp)}function jp(e,t){Gp(e,t)}function zp(e,t){Gp(e,void 0,t)}function Wp(e,t,r){return Lp(e,t,r)}function Zp(e){Lp(e,void 0,Rp)}const Jp=(()=>{const e=Up&&Up.queueMicrotask;if("function"==typeof e)return e;const t=Hp(void 0);return e=>Lp(t,e)})();function Vp(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Yp(e,t,r){try{return Hp(Vp(e,t,r))}catch(e){return Np(e)}}class $p{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let n=r+1;const i=e._elements,a=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}function Xp(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?ng(e):"closed"===t._state?function(e){ng(e),og(e)}(e):ig(e,t._storedError)}function eg(e,t){return Ry(e._ownerReadableStream,t)}function tg(e){"readable"===e._ownerReadableStream._state?ag(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){ig(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function rg(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function ng(e){e._closedPromise=Kp(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function ig(e,t){ng(e),ag(e,t)}function ag(e,t){void 0!==e._closedPromise_reject&&(Zp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function og(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const sg=Pp("[[AbortSteps]]"),cg=Pp("[[ErrorSteps]]"),ug=Pp("[[CancelSteps]]"),hg=Pp("[[PullSteps]]"),lg=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},fg=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function dg(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(t+" is not an object.");var r}function pg(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function gg(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function Ag(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function yg(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function mg(e){return Number(e)}function bg(e){return 0===e?0:e}function wg(e,t){const r=Number.MAX_SAFE_INTEGER;let n=Number(e);if(n=bg(n),!lg(n))throw new TypeError(t+" is not a finite number");if(n=function(e){return bg(fg(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return lg(n)&&0!==n?n:0}function vg(e,t){if(!Uy(e))throw new TypeError(t+" is not a ReadableStream.")}function Ig(e){return new kg(e)}function Eg(e,t){e._reader._readRequests.push(t)}function Bg(e,t,r){const n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Cg(e){return e._reader._readRequests.length}function _g(e){const t=e._reader;return void 0!==t&&!!Sg(t)}class kg{constructor(e){if(Ag(e,1,"ReadableStreamDefaultReader"),vg(e,"First parameter"),Dy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Xp(this,e),this._readRequests=new $p}get closed(){return Sg(this)?this._closedPromise:Np(xg("closed"))}cancel(e=void 0){return Sg(this)?void 0===this._ownerReadableStream?Np(rg("cancel")):eg(this,e):Np(xg("cancel"))}read(){if(!Sg(this))return Np(xg("read"));if(void 0===this._ownerReadableStream)return Np(rg("read from"));let e,t;const r=Kp(((r,n)=>{e=r,t=n}));return Qg(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!Sg(this))throw xg("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tg(this)}}}function Sg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Qg(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[hg](t)}function xg(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let Pg;Object.defineProperties(kg.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(kg.prototype,Pp.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Pp.asyncIterator&&(Pg={[Pp.asyncIterator](){return this}},Object.defineProperty(Pg,Pp.asyncIterator,{enumerable:!1}));class Mg{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Wp(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?Wp(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(void 0===e._ownerReadableStream)return Np(rg("iterate"));let t,r;const n=Kp(((e,n)=>{t=e,r=n}));return Qg(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,Jp((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,tg(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,tg(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(void 0===t._ownerReadableStream)return Np(rg("finish iterating"));if(!this._preventCancel){const r=eg(t,e);return tg(t),Wp(r,(()=>({value:e,done:!0})))}return tg(t),Hp({value:e,done:!0})}}const Ug={next(){return Dg(this)?this._asyncIteratorImpl.next():Np(Rg("next"))},return(e){return Dg(this)?this._asyncIteratorImpl.return(e):Np(Rg("return"))}};function Dg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Rg(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==Pg&&Object.setPrototypeOf(Ug,Pg);const Fg=Number.isNaN||function(e){return e!=e};function Tg(e){return!!function(e){return"number"==typeof e&&(!Fg(e)&&!(e<0))}(e)&&e!==1/0}function qg(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function Og(e,t,r){if(!Tg(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Kg(e){e._queue=new $p,e._queueTotalSize=0}function Hg(e){return e.slice()}class Ng{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!jg(this))throw oA("view");return this._view}respond(e){if(!jg(this))throw oA("respond");if(Ag(e,1,"respond"),e=wg(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!Tg(t=Number(t)))throw new RangeError("bytesWritten must be a finite");tA(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!jg(this))throw oA("respondWithNewView");if(Ag(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){const r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,tA(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Ng.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Ng.prototype,Pp.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Lg{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Gg(this))throw sA("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Ng.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}get desiredSize(){if(!Gg(this))throw sA("desiredSize");return aA(this)}close(){if(!Gg(this))throw sA("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);!function(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw iA(e,t),t}nA(e),Fy(t)}}(this)}enqueue(e){if(!Gg(this))throw sA("enqueue");if(Ag(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);!function(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const n=t.buffer,i=t.byteOffset,a=t.byteLength,o=n;_g(r)?0===Cg(r)?Jg(e,o,i,a):Bg(r,new Uint8Array(o,i,a),!1):hA(r)?(Jg(e,o,i,a),eA(e)):Jg(e,o,i,a),zg(e)}(this,e)}error(e=void 0){if(!Gg(this))throw sA("error");iA(this,e)}[ug](e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0),Kg(this);const t=this._cancelAlgorithm(e);return nA(this),t}[hg](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0){const t=this._queue.shift();this._queueTotalSize-=t.byteLength,$g(this);const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}const r=this._autoAllocateChunkSize;if(void 0!==r){let n;try{n=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const i={buffer:n,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}Eg(t,e),zg(this)}}function Gg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function jg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function zg(e){const t=function(e){const t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(_g(t)&&Cg(t)>0)return!0;if(hA(t)&&uA(t)>0)return!0;return aA(e)>0}(e);t&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Gp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,zg(e))}),(t=>{iA(e,t)}))))}function Wg(e,t){let r=!1;"closed"===e._state&&(r=!0);const n=Zg(t);"default"===t.readerType?Bg(e,n,r):function(e,t,r){const n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Zg(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Jg(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Vg(e,t){const r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,o=a-a%r;let s=i,c=!1;o>n&&(s=o-t.bytesFilled,c=!0);const u=e._queue;for(;s>0;){const r=u.peek(),n=Math.min(s,r.byteLength),i=t.byteOffset+t.bytesFilled;h=t.buffer,l=i,f=r.buffer,d=r.byteOffset,p=n,new Uint8Array(h).set(new Uint8Array(f,d,p),l),r.byteLength===n?u.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,Yg(e,n,t),s-=n}var h,l,f,d,p;return c}function Yg(e,t,r){Xg(e),r.bytesFilled+=t}function $g(e){0===e._queueTotalSize&&e._closeRequested?(nA(e),Fy(e._controlledReadableByteStream)):zg(e)}function Xg(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function eA(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();Vg(e,t)&&(rA(e),Wg(e._controlledReadableByteStream,t))}}function tA(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;const r=e._controlledReadableByteStream;if(hA(r))for(;uA(r)>0;)Wg(r,rA(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Yg(e,t,r),r.bytesFilled0){const t=r.byteOffset+r.bytesFilled,i=r.buffer.slice(t-n,t);Jg(e,i,0,i.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,Wg(e._controlledReadableByteStream,r),eA(e)}(e,t,r);zg(e)}function rA(e){const t=e._pendingPullIntos.shift();return Xg(e),t}function nA(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function iA(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(function(e){Xg(e),e._pendingPullIntos=new $p}(e),Kg(e),nA(e),Ty(r,t))}function aA(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function oA(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function sA(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function cA(e,t){e._reader._readIntoRequests.push(t)}function uA(e){return e._reader._readIntoRequests.length}function hA(e){const t=e._reader;return void 0!==t&&!!fA(t)}Object.defineProperties(Lg.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Lg.prototype,Pp.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class lA{constructor(e){if(Ag(e,1,"ReadableStreamBYOBReader"),vg(e,"First parameter"),Dy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Gg(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Xp(this,e),this._readIntoRequests=new $p}get closed(){return fA(this)?this._closedPromise:Np(dA("closed"))}cancel(e=void 0){return fA(this)?void 0===this._ownerReadableStream?Np(rg("cancel")):eg(this,e):Np(dA("cancel"))}read(e){if(!fA(this))return Np(dA("read"));if(!ArrayBuffer.isView(e))return Np(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Np(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Np(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Np(rg("read from"));let t,r;const n=Kp(((e,n)=>{t=e,r=n}));return function(e,t,r){const n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){const n=e._controlledReadableByteStream;let i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);const a=t.constructor,o={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),void cA(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Vg(e,o)){const t=Zg(o);return $g(e),void r._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return iA(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(o),cA(n,r),zg(e)}else{const e=new a(o.buffer,o.byteOffset,0);r._closeSteps(e)}}(n._readableStreamController,t,r)}(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),n}releaseLock(){if(!fA(this))throw dA("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tg(this)}}}function fA(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function dA(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function pA(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Fg(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function gA(e){const{size:t}=e;return t||(()=>1)}function AA(e,t){dg(e,t);const r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:mg(r),size:void 0===n?void 0:yA(n,t+" has member 'size' that")}}function yA(e,t){return pg(e,t),t=>mg(e(t))}function mA(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function bA(e,t,r){return pg(e,r),()=>Yp(e,t,[])}function wA(e,t,r){return pg(e,r),r=>Vp(e,t,[r])}function vA(e,t,r){return pg(e,r),(r,n)=>Yp(e,t,[r,n])}function IA(e,t){if(!_A(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(lA.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(lA.prototype,Pp.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class EA{constructor(e={},t={}){void 0===e?e=null:gg(e,"First parameter");const r=AA(t,"Second parameter"),n=function(e,t){dg(e,t);const r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,a=null==e?void 0:e.type,o=null==e?void 0:e.write;return{abort:void 0===r?void 0:mA(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:bA(n,e,t+" has member 'close' that"),start:void 0===i?void 0:wA(i,e,t+" has member 'start' that"),write:void 0===o?void 0:vA(o,e,t+" has member 'write' that"),type:a}}(e,"First parameter");if(CA(this),void 0!==n.type)throw new RangeError("Invalid type is specified");const i=gA(r);!function(e,t,r,n){const i=Object.create(LA.prototype);let a=()=>{},o=()=>Hp(void 0),s=()=>Hp(void 0),c=()=>Hp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.write&&(o=e=>t.write(e,i)),void 0!==t.close&&(s=()=>t.close()),void 0!==t.abort&&(c=e=>t.abort(e)),GA(e,i,a,o,s,c,r,n)}(this,n,pA(r,1),i)}get locked(){if(!_A(this))throw YA("locked");return kA(this)}abort(e=void 0){return _A(this)?kA(this)?Np(new TypeError("Cannot abort a stream that already has a writer")):SA(this,e):Np(YA("abort"))}close(){return _A(this)?kA(this)?Np(new TypeError("Cannot close a stream that already has a writer")):UA(this)?Np(new TypeError("Cannot close an already-closing stream")):QA(this):Np(YA("close"))}getWriter(){if(!_A(this))throw YA("getWriter");return BA(this)}}function BA(e){return new FA(e)}function CA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new $p,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function _A(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function kA(e){return void 0!==e._writer}function SA(e,t){const r=e._state;if("closed"===r||"errored"===r)return Hp(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let n=!1;"erroring"===r&&(n=!0,t=void 0);const i=Kp(((r,i)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||PA(e,t),i}function QA(e){const t=e._state;if("closed"===t||"errored"===t)return Np(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Kp(((t,r)=>{const n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;var i;return void 0!==n&&e._backpressure&&"writable"===t&&cy(n),Og(i=e._writableStreamController,NA,0),WA(i),r}function xA(e,t){"writable"!==e._state?MA(e):PA(e,t)}function PA(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const n=e._writer;void 0!==n&&OA(n,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&MA(e)}function MA(e){e._state="errored",e._writableStreamController[cg]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new $p,void 0===e._pendingAbortRequest)return void DA(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void DA(e);Gp(e._writableStreamController[sg](r._reason),(()=>{r._resolve(),DA(e)}),(t=>{r._reject(t),DA(e)}))}function UA(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function DA(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&ry(t,e._storedError)}function RA(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){iy(e)}(r):cy(r)),e._backpressure=t}Object.defineProperties(EA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(EA.prototype,Pp.toStringTag,{value:"WritableStream",configurable:!0});class FA{constructor(e){if(Ag(e,1,"WritableStreamDefaultWriter"),IA(e,"First parameter"),kA(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!UA(e)&&e._backpressure?iy(this):oy(this),ey(this);else if("erroring"===t)ay(this,e._storedError),ey(this);else if("closed"===t)oy(this),ey(this),ny(this);else{const t=e._storedError;ay(this,t),ty(this,t)}}get closed(){return TA(this)?this._closedPromise:Np($A("closed"))}get desiredSize(){if(!TA(this))throw $A("desiredSize");if(void 0===this._ownerWritableStream)throw XA("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:zA(t._writableStreamController)}(this)}get ready(){return TA(this)?this._readyPromise:Np($A("ready"))}abort(e=void 0){return TA(this)?void 0===this._ownerWritableStream?Np(XA("abort")):function(e,t){return SA(e._ownerWritableStream,t)}(this,e):Np($A("abort"))}close(){if(!TA(this))return Np($A("close"));const e=this._ownerWritableStream;return void 0===e?Np(XA("close")):UA(e)?Np(new TypeError("Cannot close an already-closing stream")):qA(this)}releaseLock(){if(!TA(this))throw $A("releaseLock");void 0!==this._ownerWritableStream&&KA(this)}write(e=void 0){return TA(this)?void 0===this._ownerWritableStream?Np(XA("write to")):HA(this,e):Np($A("write"))}}function TA(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function qA(e){return QA(e._ownerWritableStream)}function OA(e,t){"pending"===e._readyPromiseState?sy(e,t):function(e,t){ay(e,t)}(e,t)}function KA(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");OA(e,r),function(e,t){"pending"===e._closedPromiseState?ry(e,t):function(e,t){ty(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function HA(e,t){const r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return ZA(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return Np(XA("write to"));const a=r._state;if("errored"===a)return Np(r._storedError);if(UA(r)||"closed"===a)return Np(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Np(r._storedError);const o=function(e){return Kp(((t,r)=>{const n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{Og(e,t,r)}catch(t){return void ZA(e,t)}const n=e._controlledWritableStream;UA(n)||"writable"!==n._state||RA(n,JA(e)),WA(e)}(n,t,i),o}Object.defineProperties(FA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(FA.prototype,Pp.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const NA={};class LA{constructor(){throw new TypeError("Illegal constructor")}error(e=void 0){if(!function(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&VA(this,e)}[sg](e){const t=this._abortAlgorithm(e);return jA(this),t}[cg](){Kg(this)}}function GA(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Kg(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;const c=JA(t);RA(e,c),Gp(Hp(r()),(()=>{t._started=!0,WA(t)}),(r=>{t._started=!0,xA(e,r)}))}function jA(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function zA(e){return e._strategyHWM-e._queueTotalSize}function WA(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void MA(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===NA?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),qg(e);const r=e._closeAlgorithm();jA(e),Gp(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&ny(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),xA(e,t)}(t,e)}))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r);Gp(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(qg(e),!UA(r)&&"writable"===t){const t=JA(e);RA(r,t)}WA(e)}),(t=>{"writable"===r._state&&jA(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,xA(e,t)}(r,t)}))}(e,r)}function ZA(e,t){"writable"===e._controlledWritableStream._state&&VA(e,t)}function JA(e){return zA(e)<=0}function VA(e,t){const r=e._controlledWritableStream;jA(e),PA(r,t)}function YA(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function $A(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function XA(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function ey(e){e._closedPromise=Kp(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function ty(e,t){ey(e),ry(e,t)}function ry(e,t){void 0!==e._closedPromise_reject&&(Zp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function ny(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function iy(e){e._readyPromise=Kp(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function ay(e,t){iy(e),sy(e,t)}function oy(e){iy(e),cy(e)}function sy(e,t){void 0!==e._readyPromise_reject&&(Zp(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function cy(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(LA.prototype,{error:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(LA.prototype,Pp.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const uy="undefined"!=typeof DOMException?DOMException:void 0,hy=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(uy)?uy:function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function ly(e,t,r,n,i,a){const o=Ig(e),s=BA(t);e._disturbed=!0;let c=!1,u=Hp(void 0);return Kp(((h,l)=>{let f;if(void 0!==a){if(f=()=>{const r=new hy("Aborted","AbortError"),a=[];n||a.push((()=>"writable"===t._state?SA(t,r):Hp(void 0))),i||a.push((()=>"readable"===e._state?Ry(e,r):Hp(void 0))),g((()=>Promise.all(a.map((e=>e())))),!0,r)},a.aborted)return void f();a.addEventListener("abort",f)}if(p(e,o._closedPromise,(e=>{n?A(!0,e):g((()=>SA(t,e)),!0,e)})),p(t,s._closedPromise,(t=>{i?A(!0,t):g((()=>Ry(e,t)),!0,t)})),function(e,t,r){"closed"===e._state?r():jp(t,r)}(e,o._closedPromise,(()=>{r?A():g((()=>function(e){const t=e._ownerWritableStream,r=t._state;return UA(t)||"closed"===r?Hp(void 0):"errored"===r?Np(t._storedError):qA(e)}(s)))})),UA(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");i?A(!0,t):g((()=>Ry(e,t)),!0,t)}function d(){const e=u;return Lp(u,(()=>e!==u?d():void 0))}function p(e,t,r){"errored"===e._state?r(e._storedError):zp(t,r)}function g(e,r,n){function i(){Gp(e(),(()=>y(r,n)),(e=>y(!0,e)))}c||(c=!0,"writable"!==t._state||UA(t)?i():jp(d(),i))}function A(e,r){c||(c=!0,"writable"!==t._state||UA(t)?y(e,r):jp(d(),(()=>y(e,r))))}function y(e,t){KA(s),tg(o),void 0!==a&&a.removeEventListener("abort",f),e?l(t):h(void 0)}Zp(Kp(((e,t)=>{!function r(n){n?e():Lp(c?Hp(!0):Lp(s._readyPromise,(()=>Kp(((e,t)=>{Qg(o,{_chunkSteps:t=>{u=Lp(HA(s,t),void 0,Mp),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class fy{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!dy(this))throw Ey("desiredSize");return wy(this)}close(){if(!dy(this))throw Ey("close");if(!vy(this))throw new TypeError("The stream is not in a state that permits close");yy(this)}enqueue(e=void 0){if(!dy(this))throw Ey("enqueue");if(!vy(this))throw new TypeError("The stream is not in a state that permits enqueue");return my(this,e)}error(e=void 0){if(!dy(this))throw Ey("error");by(this,e)}[ug](e){Kg(this);const t=this._cancelAlgorithm(e);return Ay(this),t}[hg](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=qg(this);this._closeRequested&&0===this._queue.length?(Ay(this),Fy(t)):py(this),e._chunkSteps(r)}else Eg(t,e),py(this)}}function dy(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function py(e){gy(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Gp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,py(e))}),(t=>{by(e,t)}))))}function gy(e){const t=e._controlledReadableStream;return!!vy(e)&&(!!e._started&&(!!(Dy(t)&&Cg(t)>0)||wy(e)>0))}function Ay(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function yy(e){if(!vy(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Ay(e),Fy(t))}function my(e,t){if(!vy(e))return;const r=e._controlledReadableStream;if(Dy(r)&&Cg(r)>0)Bg(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw by(e,t),t}try{Og(e,t,r)}catch(t){throw by(e,t),t}}py(e)}function by(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(Kg(e),Ay(e),Ty(r,t))}function wy(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function vy(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function Iy(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Kg(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,Gp(Hp(r()),(()=>{t._started=!0,py(t)}),(e=>{by(t,e)}))}function Ey(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function By(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function Cy(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function _y(e,t,r){return pg(e,r),r=>Vp(e,t,[r])}function ky(e,t){if("bytes"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Sy(e,t){if("byob"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Qy(e,t){dg(e,t);const r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!n,preventClose:!!i,signal:a}}Object.defineProperties(fy.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(fy.prototype,Pp.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class xy{constructor(e={},t={}){void 0===e?e=null:gg(e,"First parameter");const r=AA(t,"Second parameter"),n=function(e,t){dg(e,t);const r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,o=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:wg(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:By(i,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:Cy(a,r,t+" has member 'pull' that"),start:void 0===o?void 0:_y(o,r,t+" has member 'start' that"),type:void 0===s?void 0:ky(s,t+" has member 'type' that")}}(e,"First parameter");if(My(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){const n=Object.create(Lg.prototype);let i=()=>{},a=()=>Hp(void 0),o=()=>Hp(void 0);void 0!==t.start&&(i=()=>t.start(n)),void 0!==t.pull&&(a=()=>t.pull(n)),void 0!==t.cancel&&(o=e=>t.cancel(e));const s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Kg(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new $p,e._readableStreamController=t,Gp(Hp(r()),(()=>{t._started=!0,zg(t)}),(e=>{iA(t,e)}))}(e,n,i,a,o,r,s)}(this,n,pA(r,0))}else{const e=gA(r);!function(e,t,r,n){const i=Object.create(fy.prototype);let a=()=>{},o=()=>Hp(void 0),s=()=>Hp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.pull&&(o=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e)),Iy(e,i,a,o,s,r,n)}(this,n,pA(r,1),e)}}get locked(){if(!Uy(this))throw qy("locked");return Dy(this)}cancel(e=void 0){return Uy(this)?Dy(this)?Np(new TypeError("Cannot cancel a stream that already has a reader")):Ry(this,e):Np(qy("cancel"))}getReader(e=void 0){if(!Uy(this))throw qy("getReader");const t=function(e,t){dg(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:Sy(r,t+" has member 'mode' that")}}(e,"First parameter");return void 0===t.mode?Ig(this):function(e){return new lA(e)}(this)}pipeThrough(e,t={}){if(!Uy(this))throw qy("pipeThrough");Ag(e,1,"pipeThrough");const r=function(e,t){dg(e,t);const r=null==e?void 0:e.readable;yg(r,"readable","ReadableWritablePair"),vg(r,t+" has member 'readable' that");const n=null==e?void 0:e.writable;return yg(n,"writable","ReadableWritablePair"),IA(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=Qy(t,"Second parameter");if(Dy(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(kA(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Zp(ly(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!Uy(this))return Np(qy("pipeTo"));if(void 0===e)return Np("Parameter 1 is required in 'pipeTo'.");if(!_A(e))return Np(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Qy(t,"Second parameter")}catch(e){return Np(e)}return Dy(this)?Np(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):kA(e)?Np(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ly(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!Uy(this))throw qy("tee");const e=function(e,t){const r=Ig(e);let n,i,a,o,s,c=!1,u=!1,h=!1;const l=Kp((e=>{s=e}));function f(){return c||(c=!0,Qg(r,{_chunkSteps:e=>{Jp((()=>{c=!1;const t=e,r=e;u||my(a._readableStreamController,t),h||my(o._readableStreamController,r)}))},_closeSteps:()=>{c=!1,u||yy(a._readableStreamController),h||yy(o._readableStreamController),u&&h||s(void 0)},_errorSteps:()=>{c=!1}})),Hp(void 0)}function d(){}return a=Py(d,f,(function(t){if(u=!0,n=t,h){const t=Hg([n,i]),r=Ry(e,t);s(r)}return l})),o=Py(d,f,(function(t){if(h=!0,i=t,u){const t=Hg([n,i]),r=Ry(e,t);s(r)}return l})),zp(r._closedPromise,(e=>{by(a._readableStreamController,e),by(o._readableStreamController,e),u&&h||s(void 0)})),[a,o]}(this);return Hg(e)}values(e=void 0){if(!Uy(this))throw qy("values");return function(e,t){const r=Ig(e),n=new Mg(r,t),i=Object.create(Ug);return i._asyncIteratorImpl=n,i}(this,function(e,t){return dg(e,"First parameter"),{preventCancel:!!(null==e?void 0:e.preventCancel)}}(e).preventCancel)}}function Py(e,t,r,n=1,i=(()=>1)){const a=Object.create(xy.prototype);return My(a),Iy(a,Object.create(fy.prototype),e,t,r,n,i),a}function My(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Uy(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Dy(e){return void 0!==e._reader}function Ry(e,t){return e._disturbed=!0,"closed"===e._state?Hp(void 0):"errored"===e._state?Np(e._storedError):(Fy(e),Wp(e._readableStreamController[ug](t),Mp))}function Fy(e){e._state="closed";const t=e._reader;void 0!==t&&(og(t),Sg(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new $p))}function Ty(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(ag(r,t),Sg(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new $p):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new $p))}function qy(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Oy(e,t){dg(e,t);const r=null==e?void 0:e.highWaterMark;return yg(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:mg(r)}}Object.defineProperties(xy.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(xy.prototype,Pp.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Pp.asyncIterator&&Object.defineProperty(xy.prototype,Pp.asyncIterator,{value:xy.prototype.values,writable:!0,configurable:!0});const Ky=function(e){return e.byteLength};class Hy{constructor(e){Ag(e,1,"ByteLengthQueuingStrategy"),e=Oy(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ly(this))throw Ny("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ly(this))throw Ny("size");return Ky}}function Ny(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Ly(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(Hy.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Hy.prototype,Pp.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Gy=function(){return 1};class jy{constructor(e){Ag(e,1,"CountQueuingStrategy"),e=Oy(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Wy(this))throw zy("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Wy(this))throw zy("size");return Gy}}function zy(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Wy(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function Zy(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function Jy(e,t,r){return pg(e,r),r=>Vp(e,t,[r])}function Vy(e,t,r){return pg(e,r),(r,n)=>Yp(e,t,[r,n])}Object.defineProperties(jy.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(jy.prototype,Pp.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Yy{constructor(e={},t={},r={}){void 0===e&&(e=null);const n=AA(t,"Second parameter"),i=AA(r,"Third parameter"),a=function(e,t){dg(e,t);const r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,o=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Zy(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===i?void 0:Jy(i,e,t+" has member 'start' that"),transform:void 0===a?void 0:Vy(a,e,t+" has member 'transform' that"),writableType:o}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");const o=pA(i,0),s=gA(i),c=pA(n,1),u=gA(n);let h;!function(e,t,r,n,i,a){function o(){return t}e._writable=function(e,t,r,n,i=1,a=(()=>1)){const o=Object.create(EA.prototype);return CA(o),GA(o,Object.create(LA.prototype),e,t,r,n,i,a),o}(o,(function(t){return function(e,t){const r=e._transformStreamController;return e._backpressure?Wp(e._backpressureChangePromise,(()=>{const n=e._writable;if("erroring"===n._state)throw n._storedError;return om(r,t)})):om(r,t)}(e,t)}),(function(){return function(e){const t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return im(r),Wp(n,(()=>{if("errored"===t._state)throw t._storedError;yy(t._readableStreamController)}),(r=>{throw Xy(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return Xy(e,t),Hp(void 0)}(e,t)}),r,n),e._readable=Py(o,(function(){return function(e){return tm(e,!1),e._backpressureChangePromise}(e)}),(function(t){return em(e,t),Hp(void 0)}),i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,tm(e,!0),e._transformStreamController=void 0}(this,Kp((e=>{h=e})),c,u,o,s),function(e,t){const r=Object.create(rm.prototype);let n=e=>{try{return am(r,e),Hp(void 0)}catch(e){return Np(e)}},i=()=>Hp(void 0);void 0!==t.transform&&(n=e=>t.transform(e,r)),void 0!==t.flush&&(i=()=>t.flush(r)),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,a),void 0!==a.start?h(a.start(this._transformStreamController)):h(void 0)}get readable(){if(!$y(this))throw cm("readable");return this._readable}get writable(){if(!$y(this))throw cm("writable");return this._writable}}function $y(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Xy(e,t){by(e._readable._readableStreamController,t),em(e,t)}function em(e,t){im(e._transformStreamController),ZA(e._writable._writableStreamController,t),e._backpressure&&tm(e,!1)}function tm(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Kp((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(Yy.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Yy.prototype,Pp.toStringTag,{value:"TransformStream",configurable:!0});class rm{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!nm(this))throw sm("desiredSize");return wy(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!nm(this))throw sm("enqueue");am(this,e)}error(e=void 0){if(!nm(this))throw sm("error");var t;t=e,Xy(this._controlledTransformStream,t)}terminate(){if(!nm(this))throw sm("terminate");!function(e){const t=e._controlledTransformStream;yy(t._readable._readableStreamController),em(t,new TypeError("TransformStream terminated"))}(this)}}function nm(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function im(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function am(e,t){const r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!vy(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{my(n,t)}catch(e){throw em(r,e),r._readable._storedError}const i=function(e){return!gy(e)}(n);i!==r._backpressure&&tm(r,!0)}function om(e,t){return Wp(e._transformAlgorithm(t),void 0,(t=>{throw Xy(e._controlledTransformStream,t),t}))}function sm(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function cm(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(rm.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(rm.prototype,Pp.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var um=function(e,t){return um=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},um(e,t) +var doipFetchers=function(e){"use strict";var t=Object.freeze({__proto__:null,get activitypub(){return Or},get aspe(){return Vw},get dns(){return $w},get graphql(){return Xw},get http(){return rv},get irc(){return RB},get matrix(){return FB},get openpgp(){return TB},get telegram(){return qB},get xmpp(){return lS}}),r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,o=(s=Object.create(null),e=>{const t=i.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>o(t)===e),u=e=>t=>typeof t===e,{isArray:h}=Array,l=u("undefined");const f=c("ArrayBuffer");const d=u("string"),p=u("function"),g=u("number"),A=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==o(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=c("Date"),b=c("File"),w=c("Blob"),v=c("FileList"),I=c("URLSearchParams");function E(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),h(e))for(n=0,i=e.length;n0;)if(n=r[i],t===n.toLowerCase())return n;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r,_=e=>!l(e)&&e!==C;const k=(S="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>S&&e instanceof S);var S;const Q=c("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),P=c("RegExp"),M=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};E(r,((r,i)=>{let a;!1!==(a=t(r,i,e))&&(n[i]=a||r)})),Object.defineProperties(e,n)},U="abcdefghijklmnopqrstuvwxyz",D="0123456789",R={DIGIT:D,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+D};const F=c("AsyncFunction");var T={isArray:h,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=o(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:d,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:A,isPlainObject:y,isUndefined:l,isDate:m,isFile:b,isBlob:w,isRegExp:P,isFunction:p,isStream:e=>A(e)&&p(e.pipe),isURLSearchParams:I,isTypedArray:k,isFileList:v,forEach:E,merge:function e(){const{caseless:t}=_(this)&&this||{},r={},n=(n,i)=>{const a=t&&B(r,i)||i;y(r[a])&&y(n)?r[a]=e(r[a],n):y(n)?r[a]=e({},n):h(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e(E(t,((t,i)=>{r&&p(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!g(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Q,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:M,freezeMethods:e=>{M(e,((t,r)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];p(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return h(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:B,global:C,isContextDefined:_,ALPHABET:R,generateString:(e=16,t=R.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(A(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=h(e)?[]:{};return E(e,((e,t)=>{const a=r(e,n+1);!l(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:F,isThenable:e=>e&&(A(e)||p(e))&&p(e.then)&&p(e.catch)},q=[],O=[],K="undefined"!=typeof Uint8Array?Uint8Array:Array,H=!1;function N(){H=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)q[t]=e[t],O[e.charCodeAt(t)]=t;O["-".charCodeAt(0)]=62,O["_".charCodeAt(0)]=63}function L(e,t,r){for(var n,i,a=[],o=t;o>18&63]+q[i>>12&63]+q[i>>6&63]+q[63&i]);return a.join("")}function G(e){var t;H||N();for(var r=e.length,n=r%3,i="",a=[],o=16383,s=0,c=r-n;sc?c:s+o));return 1===n?(t=e[r-1],i+=q[t>>2],i+=q[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=q[t>>10],i+=q[t>>4&63],i+=q[t<<2&63],i+="="),a.push(i),a.join("")}function j(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=e[t+l];for(l+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+l],l+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+l],l+=f,h-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)}function z(e,t,r,n,i,a){var o,s,c,u=8*a-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=h?(s=0,o=h):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*g}var W={}.toString,Z=Array.isArray||function(e){return"[object Array]"==W.call(e)};$.TYPED_ARRAY_SUPPORT=void 0===r.TYPED_ARRAY_SUPPORT||r.TYPED_ARRAY_SUPPORT;var J=V();function V(){return $.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Y(e,t){if(V()=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return 0|e}function ie(e){return!(null==e||!e._isBuffer)}function ae(e,t){if(ie(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Me(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ue(e).length;default:if(n)return Me(e).length;t=(""+t).toLowerCase(),n=!0}}function oe(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return ve(this,t,r);case"utf8":case"utf-8":return ye(this,t,r);case"ascii":return be(this,t,r);case"latin1":case"binary":return we(this,t,r);case"base64":return Ae(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function se(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function ce(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=$.from(t,n)),ie(t))return 0===t.length?-1:ue(e,t,r,n,i);if("number"==typeof t)return t&=255,$.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ue(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ue(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){for(var l=!0,f=0;fi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function Ae(e,t,r){return 0===t&&r===e.length?G(e):G(e.slice(t,r))}function ye(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(h=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(h=c)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(e){var t=e.length;if(t<=me)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},$.prototype.compare=function(e,t,r,n,i){if(!ie(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),u=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return he(this,e,t,r);case"utf8":case"utf-8":return le(this,e,t,r);case"ascii":return fe(this,e,t,r);case"latin1":case"binary":return de(this,e,t,r);case"base64":return pe(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var me=4096;function be(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Be(e,t,r,n,i,a){if(!ie(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Ce(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function _e(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function ke(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Se(e,t,r,n,i){return i||ke(e,0,r,4),z(e,t,r,n,23,4),r+4}function Qe(e,t,r,n,i){return i||ke(e,0,r,8),z(e,t,r,n,52,8),r+8}$.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},$.prototype.readUInt8=function(e,t){return t||Ee(e,1,this.length),this[e]},$.prototype.readUInt16LE=function(e,t){return t||Ee(e,2,this.length),this[e]|this[e+1]<<8},$.prototype.readUInt16BE=function(e,t){return t||Ee(e,2,this.length),this[e]<<8|this[e+1]},$.prototype.readUInt32LE=function(e,t){return t||Ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},$.prototype.readUInt32BE=function(e,t){return t||Ee(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},$.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Ee(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},$.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Ee(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},$.prototype.readInt8=function(e,t){return t||Ee(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},$.prototype.readInt16LE=function(e,t){t||Ee(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},$.prototype.readInt16BE=function(e,t){t||Ee(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},$.prototype.readInt32LE=function(e,t){return t||Ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},$.prototype.readInt32BE=function(e,t){return t||Ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},$.prototype.readFloatLE=function(e,t){return t||Ee(e,4,this.length),j(this,e,!0,23,4)},$.prototype.readFloatBE=function(e,t){return t||Ee(e,4,this.length),j(this,e,!1,23,4)},$.prototype.readDoubleLE=function(e,t){return t||Ee(e,8,this.length),j(this,e,!0,52,8)},$.prototype.readDoubleBE=function(e,t){return t||Ee(e,8,this.length),j(this,e,!1,52,8)},$.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Be(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},$.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,1,255,0),$.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},$.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ce(this,e,t,!0),t+2},$.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ce(this,e,t,!1),t+2},$.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_e(this,e,t,!0),t+4},$.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_e(this,e,t,!1),t+4},$.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Be(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},$.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Be(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},$.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,1,127,-128),$.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},$.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ce(this,e,t,!0),t+2},$.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ce(this,e,t,!1),t+2},$.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,2147483647,-2147483648),$.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_e(this,e,t,!0),t+4},$.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Be(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),$.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_e(this,e,t,!1),t+4},$.prototype.writeFloatLE=function(e,t,r){return Se(this,e,t,!0,r)},$.prototype.writeFloatBE=function(e,t,r){return Se(this,e,t,!1,r)},$.prototype.writeDoubleLE=function(e,t,r){return Qe(this,e,t,!0,r)},$.prototype.writeDoubleBE=function(e,t,r){return Qe(this,e,t,!1,r)},$.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!$.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Ue(e){return function(e){var t,r,n,i,a,o;H||N();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new K(3*s/4-a),n=a>0?s-4:s;var c=0;for(t=0,r=0;t>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===a?(i=O[e.charCodeAt(t)]<<2|O[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===a&&(i=O[e.charCodeAt(t)]<<10|O[e.charCodeAt(t+1)]<<4|O[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(xe,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function De(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Re(e){return null!=e&&(!!e._isBuffer||Fe(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Fe(e.slice(0,0))}(e))}function Fe(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Te=Object.freeze({__proto__:null,Buffer:$,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),$.alloc(+e)},isBuffer:Re,kMaxLength:J});function qe(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}T.inherits(qe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Oe=qe.prototype,Ke={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ke[e]={value:e}})),Object.defineProperties(qe,Ke),Object.defineProperty(Oe,"isAxiosError",{value:!0}),qe.from=(e,t,r,n,i,a)=>{const o=Object.create(Oe);return T.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),qe.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function He(e){return T.isPlainObject(e)||T.isArray(e)}function Ne(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Le(e,t,r){return e?e.concat(t).map((function(e,t){return e=Ne(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Ge=T.toFlatObject(T,{},null,(function(e){return/^is[A-Z]/.test(e)}));function je(e,t,r){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=T.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!T.isUndefined(t[e])}))).metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(T.isDate(e))return e.toISOString();if(!s&&T.isBlob(e))throw new qe("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(e)||T.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):$.from(e):e}function u(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(T.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(T.isArray(e)&&function(e){return T.isArray(e)&&!e.some(He)}(e)||(T.isFileList(e)||T.endsWith(r,"[]"))&&(s=T.toArray(e)))return r=Ne(r),s.forEach((function(e,n){!T.isUndefined(e)&&null!==e&&t.append(!0===o?Le([r],n,a):null===o?r:r+"[]",c(e))})),!1;return!!He(e)||(t.append(Le(i,r,a),c(e)),!1)}const h=[],l=Object.assign(Ge,{defaultVisitor:u,convertValue:c,isVisitable:He});if(!T.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!T.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),T.forEach(r,(function(r,a){!0===(!(T.isUndefined(r)||null===r)&&i.call(t,r,T.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),h.pop()}}(e),t}function ze(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function We(e,t){this._pairs=[],e&&je(e,this,t)}const Ze=We.prototype;function Je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ve(e,t,r){if(!t)return e;const n=r&&r.encode||Je,i=r&&r.serialize;let a;if(a=i?i(t,r):T.isURLSearchParams(t)?t.toString():new We(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Ze.append=function(e,t){this._pairs.push([e,t])},Ze.toString=function(e){const t=e?function(t){return e.call(this,t,ze)}:ze;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Ye=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){T.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},$e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:We,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const et="undefined"!=typeof window&&"undefined"!=typeof document,tt=(rt="undefined"!=typeof navigator&&navigator.product,et&&["ReactNative","NativeScript","NS"].indexOf(rt)<0);var rt;const nt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var it={...Object.freeze({__proto__:null,hasBrowserEnv:et,hasStandardBrowserEnv:tt,hasStandardBrowserWebWorkerEnv:nt}),...Xe};function at(e){function t(e,r,n,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&T.isArray(n)?n.length:a,s)return T.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&T.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&T.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n{t(function(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ot={transitional:$e,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=T.isObject(e);i&&T.isHTMLForm(e)&&(e=new FormData(e));if(T.isFormData(e))return n&&n?JSON.stringify(at(e)):e;if(T.isArrayBuffer(e)||T.isBuffer(e)||T.isStream(e)||T.isFile(e)||T.isBlob(e))return e;if(T.isArrayBufferView(e))return e.buffer;if(T.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return je(e,new it.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return it.isNode&&T.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=T.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return je(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ot.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&T.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw qe.from(e,qe.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:it.classes.FormData,Blob:it.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],(e=>{ot.headers[e]={}}));var st=ot;const ct=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ut=Symbol("internals");function ht(e){return e&&String(e).trim().toLowerCase()}function lt(e){return!1===e||null==e?e:T.isArray(e)?e.map(lt):String(e)}function ft(e,t,r,n,i){return T.isFunction(n)?n.call(this,t,r):(i&&(t=r),T.isString(t)?T.isString(n)?-1!==t.indexOf(n):T.isRegExp(n)?n.test(t):void 0:void 0)}class dt{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ht(t);if(!i)throw new Error("header name must be a non-empty string");const a=T.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=lt(e))}const a=(e,t)=>T.forEach(e,((e,r)=>i(e,r,t)));return T.isPlainObject(e)||e instanceof this.constructor?a(e,t):T.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ct[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ht(e)){const r=T.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(T.isFunction(t))return t.call(this,e,r);if(T.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ht(e)){const r=T.findKey(this,e);return!(!r||void 0===this[r]||t&&!ft(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ht(e)){const i=T.findKey(r,e);!i||t&&!ft(0,r[i],i,t)||(delete r[i],n=!0)}}return T.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!ft(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return T.forEach(this,((n,i)=>{const a=T.findKey(r,i);if(a)return t[a]=lt(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=lt(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return T.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&T.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ut]=this[ut]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ht(e);t[n]||(!function(e,t){const r=T.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return T.isArray(e)?e.forEach(n):n(e),this}}dt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(dt.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),T.freezeMethods(dt);var pt=dt;function gt(e,t){const r=this||st,n=t||r,i=pt.from(n.headers);let a=n.data;return T.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function At(e){return!(!e||!e.__CANCEL__)}function yt(e,t,r){qe.call(this,null==e?"canceled":e,qe.ERR_CANCELED,t,r),this.name="CanceledError"}T.inherits(yt,qe,{__CANCEL__:!0});var mt=it.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];T.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),T.isString(n)&&o.push("path="+n),T.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function bt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var wt=it.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=T.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function vt(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=n[o];i||(i=c),r[a]=s,n[a]=c;let h=o,l=0;for(;h!==a;)l+=r[h++],h%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,c=n(s);r=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var It="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=pt.from(e.headers).normalize();let a,o,{responseType:s,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(T.isFormData(n))if(it.hasStandardBrowserEnv||it.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let h=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const l=bt(e.baseURL,e.url);function f(){if(!h)return;const n=pt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new qe("Request failed with status code "+r.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),u()}),(function(e){r(e),u()}),{data:s&&"text"!==s&&"json"!==s?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}if(h.open(e.method.toUpperCase(),Ve(l,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(f)},h.onabort=function(){h&&(r(new qe("Request aborted",qe.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new qe("Network Error",qe.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||$e;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new qe(t,n.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,e,h)),h=null},it.hasStandardBrowserEnv&&(c&&T.isFunction(c)&&(c=c(e)),c||!1!==c&&wt(l))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&mt.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in h&&T.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),T.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),s&&"json"!==s&&(h.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",vt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",vt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{h&&(r(!t||t.type?new yt(null,e,h):t),h.abort(),h=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);d&&-1===it.protocols.indexOf(d)?r(new qe("Unsupported protocol "+d+":",qe.ERR_BAD_REQUEST,e)):h.send(n||null)}))};const Et={http:null,xhr:It};T.forEach(Et,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Bt=e=>`- ${e}`,Ct=e=>T.isFunction(e)||null===e||!1===e;var _t=e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new qe("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Bt).join("\n"):" "+Bt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function kt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yt(null,e)}function St(e){kt(e),e.headers=pt.from(e.headers),e.data=gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return _t(e.adapter||st.adapter)(e).then((function(t){return kt(e),t.data=gt.call(e,e.transformResponse,t),t.headers=pt.from(t.headers),t}),(function(t){return At(t)||(kt(e),t&&t.response&&(t.response.data=gt.call(e,e.transformResponse,t.response),t.response.headers=pt.from(t.response.headers))),Promise.reject(t)}))}const Qt=e=>e instanceof pt?e.toJSON():e;function xt(e,t){t=t||{};const r={};function n(e,t,r){return T.isPlainObject(e)&&T.isPlainObject(t)?T.merge.call({caseless:r},e,t):T.isPlainObject(t)?T.merge({},t):T.isArray(t)?t.slice():t}function i(e,t,r){return T.isUndefined(t)?T.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!T.isUndefined(t))return n(void 0,t)}function o(e,t){return T.isUndefined(t)?T.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Qt(e),Qt(t),!0)};return T.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=c[n]||i,o=a(e[n],t[n],n);T.isUndefined(o)&&a!==s||(r[n]=o)})),r}const Pt="1.6.5",Mt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Mt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ut={};Mt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.5] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new qe(n(i," has been removed"+(t?" in "+t:"")),qe.ERR_DEPRECATED);return t&&!Ut[i]&&(Ut[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new qe("option "+a+" must be "+r,qe.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new qe("Unknown option "+a,qe.ERR_BAD_OPTION)}},validators:Mt};const Rt=Dt.validators;class Ft{constructor(e){this.defaults=e,this.interceptors={request:new Ye,response:new Ye}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=xt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Dt.assertOptions(r,{silentJSONParsing:Rt.transitional(Rt.boolean),forcedJSONParsing:Rt.transitional(Rt.boolean),clarifyTimeoutError:Rt.transitional(Rt.boolean)},!1),null!=n&&(T.isFunction(n)?t.paramsSerializer={serialize:n}:Dt.assertOptions(n,{encode:Rt.function,serialize:Rt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&T.merge(i.common,i[t.method]);i&&T.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=pt.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,l=0;if(!s){const e=[St.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);l{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new yt(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new qt((function(t){e=t}));return{token:t,cancel:e}}}var Ot=qt;const Kt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Kt).forEach((([e,t])=>{Kt[t]=e}));var Ht=Kt;const Nt=function e(t){const r=new Tt(t),i=n(Tt.prototype.request,r);return T.extend(i,Tt.prototype,r,{allOwnKeys:!0}),T.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(xt(t,r))},i}(st);Nt.Axios=Tt,Nt.CanceledError=yt,Nt.CancelToken=Ot,Nt.isCancel=At,Nt.VERSION=Pt,Nt.toFormData=je,Nt.AxiosError=qe,Nt.Cancel=Nt.CanceledError,Nt.all=function(e){return Promise.all(e)},Nt.spread=function(e){return function(t){return e.apply(null,t)}},Nt.isAxiosError=function(e){return T.isObject(e)&&!0===e.isAxiosError},Nt.mergeConfig=xt,Nt.AxiosHeaders=pt,Nt.formToJSON=e=>at(T.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=_t,Nt.HttpStatusCode=Ht,Nt.default=Nt;var Lt=Nt,Gt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Wt={exports:{}},Zt={exports:{}};!function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var n=r(e);throw null===e?n="null":"object"===n&&(n=e.constructor.name),new TypeError("Expected a string but received a ".concat(n))}},e.exports=t.default,e.exports.default=t.default}(Zt,Zt.exports);var Jt=Zt.exports,Vt={exports:{}},Yt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(Yt,Yt.exports);var $t=Yt.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),o=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(o))return!1;if(/\s/.test(o))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(o))return!1;return i.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var r=i(Jt),n=i($t);function i(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(Vt,Vt.exports);var Xt=Vt.exports,er=jt(Xt),tr={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,n.default)(t),r=String(r),!r)return e(t,4)||e(t,6);if("4"===r)return o.test(t);if("6"===r)return c.test(t);return!1};var r,n=(r=Jt)&&r.__esModule?r:{default:r};var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(i,"[.]){3}").concat(i),o=new RegExp("^".concat(a,"$")),s="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(a,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(a,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(a,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(a,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(a,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(a,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(a,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(tr,tr.exports);var rr=tr.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,a.default)(t,c)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var o,l,f,d,p,g,A,y;if(A=e.split("#"),e=A.shift(),A=e.split("?"),e=A.shift(),(A=e.split("://")).length>1){if(o=A.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(o))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;A[0]=e.slice(2)}}if(""===(e=A.join("://")))return!1;if(A=e.split("/"),""===(e=A.shift())&&!t.require_host)return!0;if((A=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===A[0])return!1;if((l=A.shift()).indexOf(":")>=0&&l.split(":").length>2)return!1;var m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(l.split(":"),2),b=m[0],w=m[1];if(""===b&&""===w)return!1}d=A.join("@"),g=null,y=null;var v=d.match(u);v?(f="",y=v[1],g=v[2]||null):(f=(A=d.split(":")).shift(),A.length&&(g=A.join(":")));if(null!==g&&g.length>0){if(p=parseInt(g,10),!/^[0-9]+$/.test(g)||p<=0||p>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return h(f,t.host_whitelist);if(""===f&&!t.require_host)return!0;if(!((0,i.default)(f)||(0,n.default)(f,t)||y&&(0,i.default)(y,6)))return!1;if(f=f||y,t.host_blacklist&&h(f,t.host_blacklist))return!1;return!0};var r=o(Jt),n=o(Xt),i=o(rr),a=o($t);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)for(var r=1;r{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:5e3)})),i=new Promise(((r,n)=>{(async()=>{let i=!1;try{nr(t.claims.activitypub.url),i=!0}catch(e){}const a=new Date,{host:o,pathname:s,search:c}=new URL(e.url),u={host:o,date:a.toUTCString(),accept:"application/activity+json","User-Agent":`doipjs/${Tr}`};if(i&&Rr){const e=`(request-target): get ${s}${c}\nhost: ${o}\ndate: ${a.toUTCString()}`,r=Fr.createSign("SHA256");r.write(e),r.end();const n=r.sign(t.claims.activitypub.privateKey.replace(/\\n/g,"\n"),"base64");u.signature=`keyId="${t.claims.activitypub.url}#main-key",headers="(request-target) host date",signature="${n}",algorithm="rsa-sha256"`}Lt.get(e.url,{headers:u}).then((e=>e.data)).then((e=>{r(e)})).catch((e=>{n(e)}))})()}));return Promise.race([i,n]).finally((()=>{clearTimeout(r)}))}var Or=Object.freeze({__proto__:null,fn:qr,timeout:5e3}),Kr=crypto;const Hr=e=>e instanceof CryptoKey;var Nr=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await Kr.subtle.digest(r,t))};const Lr=new TextEncoder,Gr=new TextDecoder;const jr=e=>(e=>{let t=e;"string"==typeof t&&(t=Lr.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=Gr.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;ee.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}function nn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var an=(e,...t)=>nn("Key must be ",e,...t);function on(e,t,...r){return nn(`Key for the ${e} algorithm must be `,t,...r)}var sn=e=>Hr(e);const cn=["CryptoKey"];var un=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function hn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var ln=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Jr(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Jr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Jr('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),a=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return Kr.subtle.importKey("raw",zr(e.k),...a);const o={...e};return delete o.alg,delete o.use,Kr.subtle.importKey("jwk",o,...a)};var fn=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!sn(t))throw new TypeError(on(e,t,...cn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${cn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!sn(t))throw new TypeError(on(e,t,...cn));if("secret"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${cn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};var dn=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};var pn=async(e,t,r,n)=>{const i=await function(e,t,r){if(Hr(t))return rn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(an(t,...cn));return Kr.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(an(t,...cn,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,i);const a=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new Jr(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,i.algorithm);try{return await Kr.subtle.verify(a,i,r,n)}catch(e){return!1}};async function gn(e,t,r){var n;if(!hn(e))throw new Vr("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Vr('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Vr("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Vr("JWS Payload missing");if("string"!=typeof e.signature)throw new Vr("JWS Signature missing or incorrect type");if(void 0!==e.header&&!hn(e.header))throw new Vr("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=zr(e.protected);i=JSON.parse(Gr.decode(t))}catch(e){throw new Vr("JWS Protected Header is invalid")}if(!un(i,e.header))throw new Vr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...i,...e.header},o=function(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!a.has(t))throw new Jr(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(Vr,new Map([["b64",!0]]),null==r?void 0:r.crit,i,a);let s=!0;if(o.has("b64")&&(s=i.b64,"boolean"!=typeof s))throw new Vr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=a;if("string"!=typeof c||!c)throw new Vr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const u=r&&dn("algorithms",r.algorithms);if(u&&!u.has(c))throw new Zr('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof e.payload)throw new Vr("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Vr("JWS Payload must be a string or an Uint8Array instance");let h=!1;"function"==typeof t&&(t=await t(i,e),h=!0),fn(c,t,"verify");const l=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(Lr.encode(null!==(n=e.protected)&&void 0!==n?n:""),Lr.encode("."),"string"==typeof e.payload?Lr.encode(e.payload):e.payload);let f;try{f=zr(e.signature)}catch(e){throw new Vr("Failed to base64url decode the signature")}if(!await pn(c,t,f,l))throw new $r;let d;if(s)try{d=zr(e.payload)}catch(e){throw new Vr("Failed to base64url decode the payload")}else d="string"==typeof e.payload?Lr.encode(e.payload):e.payload;const p={payload:d};return void 0!==e.protected&&(p.protectedHeader=i),void 0!==e.header&&(p.unprotectedHeader=e.header),h?{...p,key:t}:p}const An=(e,t)=>{if("string"!=typeof e||!e)throw new Yr(`${t} missing or invalid`)};const yn=zr;function mn(e,t,r){var n;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var i=0;i=8&&(s-=8,o[u++]=255&c>>s)}if(s>=t.bits||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o}function bn(e,t,r){void 0===r&&(r={});for(var n=r.pad,i=void 0===n||n,a=(1<t.bits;)s-=t.bits,o+=t.chars[a&c>>s];if(s&&(o+=t.chars[a&c<1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,Wn.default)(e);var n=e,i=r.ignore;if(i)if(i instanceof RegExp)n=n.replace(i,"");else{if("string"!=typeof i)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(i.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(t in Zn.alphanumeric)return Zn.alphanumeric[t].test(n);throw new Error("Invalid locale '".concat(t,"'"))};Bn.locales=void 0;var zn,Wn=(zn=Jt)&&zn.__esModule?zn:{default:zn},Zn=Cn;var Jn=Object.keys(Zn.alphanumeric);Bn.locales=Jn;var Vn={exports:{}};(function(e){e.exports.is_uri=r,e.exports.is_http_uri=n,e.exports.is_https_uri=i,e.exports.is_web_uri=a,e.exports.isUri=r,e.exports.isHttpUri=n,e.exports.isHttpsUri=i,e.exports.isWebUri=a;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function r(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var r,n,i,a,o,s="",c="";if(s=(r=t(e))[1],n=r[2],i=r[3],a=r[4],o=r[5],s&&s.length&&i.length>=0){if(n&&n.length){if(0!==i.length&&!/^\//.test(i))return}else if(/^\/\//.test(i))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(s.toLowerCase()))return c+=s+":",n&&n.length&&(c+="//"+n),c+=i,a&&a.length&&(c+="?"+a),o&&o.length&&(c+="#"+o),c}}}function n(e,n){if(r(e)){var i,a,o,s,c="",u="",h="",l="";if(c=(i=t(e))[1],u=i[2],a=i[3],o=i[4],s=i[5],c){if(n){if("https"!=c.toLowerCase())return}else if("http"!=c.toLowerCase())return;if(u)return/:(\d+)$/.test(u)&&(h=u.match(/:(\d+)$/)[0],u=u.replace(/:\d+$/,"")),l+=c+":",l+="//"+u,h&&(l+=h),l+=a,o&&o.length&&(l+="?"+o),s&&s.length&&(l+="#"+s),l}}}function i(e){return n(e,!0)}function a(e){return n(e)||i(e)}})(Vn);var Yn=Vn.exports;const $n=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},{hasOwnProperty:Xn}=Object.prototype,{propertyIsEnumerable:ei}=Object,ti=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),ri=Gt,ni={concatArrays:!1,ignoreUndefined:!1},ii=e=>{const t=[];for(const r in e)Xn.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)ei.call(e,n)&&t.push(n)}return t};function ai(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return ii(e).forEach((r=>{ti(t,r,ai(e[r]))})),t}(e):$n(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return ii(e).forEach((r=>{ti(t,r,ai(e[r]))})),t}(e):e}const oi=(e,t,r,n)=>(r.forEach((r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?ti(e,r,ci(e[r],t[r],n)):ti(e,r,ai(t[r])))})),e),si=(e,t,r)=>{let n=e.slice(0,0),i=0;return[e,t].forEach((t=>{const a=[];for(let r=0;r!a.includes(e))),r)})),n};function ci(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?si(e,t,r):$n(t)&&$n(e)?oi(e,t,ii(t),r):ai(t)}var ui=function(...e){const t=ci(ai(ni),this!==ri&&this||{},ni);let r={_:{}};for(const n of e)if(void 0!==n){if(!$n(n))throw new TypeError("`"+n+"` is not an Option Object");r=ci(r,{_:n},t)}return r._},hi=jt(ui);const li="adaptive",fi="always",di="never",pi="activitypub",gi="aspe",Ai="dns",yi="graphql",mi="http",bi="irc",wi="matrix",vi="openpgp",Ii="telegram",Ei="xmpp",Bi="plain",Ci="html",_i="xml",ki="none",Si="nocors",Qi="granted",xi="server",Pi="json",Mi="text",Ui="uri",Di="fingerprint",Ri="contains",Fi="equals",Ti="oneof",qi=100,Oi=101,Ki=200,Hi=201,Ni=301,Li=401,Gi={ASP:"asp",OPENPGP:"openpgp"},ji={EDDSA:"eddsa",ES256:"es256",OPENPGP:"openpgp",UNKNOWN:"unknown",NONE:"none"},zi={PEM:"pem",JWK:"jwk",ARMORED_PGP:"armored_pgp",NONE:"none"},Wi="none",Zi="hkp",Ji="wkd";class Vi{constructor(e,t){this.identifier=null,this.name=e,this.email=null,this.description=null,this.avatarUrl=null,this.themeColor=null,this.claims=t,this.isRevoked=!1}static fromJSON(e,t){let r,n;if("object"==typeof e&&t){if(2!==t)throw new Error("Invalid persona version");if(n=function(e){const t=e.claims.map((e=>zw.fromJSON(e))),r=new Vi(e.name,t);return r.identifier=e.identifier,r.email=e.email,r.description=e.description,r.avatarUrl=e.avatarUrl,r.themeColor=e.avatarUrl,r.isRevoked=e.isRevoked,r}(e),n instanceof Error)throw n;r=n}return r}setIdentifier(e){this.identifier=e}setDescription(e){this.description=e}setEmailAddress(e){this.email=e}setAvatarUrl(e){this.avatarUrl=e}addClaim(e){this.claims.push(e)}revoke(){this.isRevoked=!0}toJSON(){return{identifier:this.identifier,name:this.name,email:this.email,description:this.description,avatarUrl:this.avatarUrl,themeColor:this.themeColor,isRevoked:this.isRevoked,claims:this.claims.map((e=>e.toJSON()))}}}class Yi{constructor(e,t,r){this.profileVersion=2,this.profileType=e,this.identifier=t,this.personas=r||[],this.primaryPersonaIndex=r.length>0?0:-1,this.publicKey={keyType:ji.NONE,fingerprint:null,encoding:zi.NONE,encodedKey:null,key:null,fetch:{method:Wi,query:null,resolvedUrl:null}},this.verifiers=[]}static fromJSON(e){let t,r;if("object"==typeof e&&"profileVersion"in e){if(2!==e.profileVersion)throw new Error("Invalid profile version");if(r=function(e){if(!("profileVersion"in e)||2!==e.profileVersion)return new Error("Invalid profile");const t=e.personas.map((e=>Vi.fromJSON(e,2))),r=new Yi(e.profileType,e.identifier,t);return r.primaryPersonaIndex=e.primaryPersonaIndex,r.publicKey=e.publicKey,r.verifiers=e.verifiers,r}(e),r instanceof Error)throw r;t=r}return t}addVerifier(e,t){this.verifiers.push({name:e,url:t})}toJSON(){return{profileVersion:this.profileVersion,profileType:this.profileType,identifier:this.identifier,personas:this.personas.map((e=>e.toJSON())),primaryPersonaIndex:this.primaryPersonaIndex,publicKey:{keyType:this.publicKey.keyType,fingerprint:this.publicKey.fingerprint,encoding:this.publicKey.encoding,encodedKey:this.publicKey.encodedKey,fetch:{method:this.publicKey.fetch.method,query:this.publicKey.fetch.query,resolvedUrl:this.publicKey.fetch.resolvedUrl}},verifiers:this.verifiers}}}class $i{constructor(e){this.about=e.about,this.profile=e.profile,this.claim=e.claim,this.proof=e.proof}toJSON(){return{about:this.about,profile:this.profile,claim:this.claim,proof:this.proof}}}const Xi=/^aspe:([a-zA-Z0-9.\-_]*):([a-zA-Z0-9]*)/;var ea=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Xi);return er(t[1])?new $i({about:{id:"aspe",name:"ASPE"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:Xi.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:gi,accessRestriction:ki,data:{aspeUri:e}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["claims"]}]}}):null},reURI:Xi,tests:[{uri:"aspe:domain.tld:abc123def456",shouldMatch:!0},{uri:"aspe:domain.tld",shouldMatch:!1},{uri:"dns:domain.tld",shouldMatch:!1},{uri:"https://domain.tld",shouldMatch:!1}]});const ta=/^openpgp4fpr:(?:0x)?([a-zA-Z0-9.\-_]*)/,ra=/^https:\/\/(.*)\/.well-known\/openpgpkey\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/,na=/^https:\/\/(openpgpkey.*)\/.well-known\/openpgpkey\/(.*)\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/;var ia=Object.freeze({__proto__:null,processURI:function(e){let t=null,r=null,n=null;ta.test(e)&&(t=ta,r=Zi,n=e.match(t)),!r&&na.test(e)&&(t=na,r=Ji,n=e.match(t)),!r&&ra.test(e)&&(t=ra,r=Ji,n=e.match(t));let i=null;switch(r){case Zi:i=new $i({about:{id:"openpgp",name:"OpenPGP"},profile:{display:`openpgp4fpr:${n[1]}`,uri:`https://keys.openpgp.org/search?q=${n[1]}`,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,fetcher:vi,accessRestriction:ki,data:{url:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,protocol:Zi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["notations","proof@ariadne.id"]}]}});break;case Ji:i=new $i({about:{id:"openpgp",name:"OpenPGP"},profile:{display:"unknown fingerprint",uri:e,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:vi,accessRestriction:ki,data:{url:e,protocol:Ji}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["notations","proof@ariadne.id"]}]}})}return i},reURI:/^(.*)/,tests:[{uri:"openpgp4fpr:123456789",shouldMatch:!0},{uri:"openpgp4fpr:abcdef123",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/123abc456def?l=name",shouldMatch:!0}]});const aa=/^dns:([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var oa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(aa);return new $i({about:{id:"dns",name:"DNS"},profile:{display:t[1],uri:`https://${t[1]}`,qr:null},claim:{uriRegularExpression:aa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:Ai,accessRestriction:xi,data:{domain:t[1]}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["records","txt"]}]}})},reURI:aa,tests:[{uri:"dns:domain.org",shouldMatch:!0},{uri:"dns:domain.org?type=TXT",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const sa=/^irc:\/\/(.*)\/([a-zA-Z0-9\-[\]\\`_^{|}]*)/;var ca=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(sa);return new $i({about:{id:"irc",name:"IRC"},profile:{display:`${t[1]}/${t[2]}`,uri:e,qr:null},claim:{uriRegularExpression:sa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:bi,accessRestriction:xi,data:{domain:t[1],nick:t[2]}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:[]}]}})},reURI:sa,tests:[{uri:"irc://chat.ircserver.org/Alice1",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice?param=123",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice_bob",shouldMatch:!0},{uri:"https://chat.ircserver.org/alice",shouldMatch:!1}]});const ua=/^xmpp:([a-zA-Z0-9.\-_]*)@([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var ha=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ua);return new $i({about:{id:"xmpp",name:"XMPP",homepage:"https://xmpp.org"},profile:{display:`${t[1]}@${t[2]}`,uri:e,qr:e},claim:{uriRegularExpression:ua.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:Ei,accessRestriction:xi,data:{id:`${t[1]}@${t[2]}`}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:[]}]}})},reURI:ua,tests:[{uri:"xmpp:alice@domain.org",shouldMatch:!0},{uri:"xmpp:alice@domain.org?omemo-sid-123456789=A1B2C3D4E5F6G7H8I9",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const la=/^matrix:u\/(?:@)?([^@:]*:[^?]*)(\?.*)?/;var fa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(la);if(!t[2])return null;const r=new URLSearchParams(t[2]);if(!r.has("org.keyoxide.e")||!r.has("org.keyoxide.r"))return null;const n=`${"!"!==r.get("org.keyoxide.r")[0]?"!":""}${r.get("org.keyoxide.r")}`,i=`${"$"!==r.get("org.keyoxide.e")[0]?"$":""}${r.get("org.keyoxide.e")}`,a=`https://matrix.to/#/@${t[1]}`,o=`https://matrix.to/#/${n}/${i}`;return new $i({about:{id:"matrix",name:"Matrix",homepage:"https://matrix.org"},profile:{display:`@${t[1]}`,uri:a,qr:null},claim:{uriRegularExpression:la.toString(),uriIsAmbiguous:!1},proof:{request:{uri:o,fetcher:wi,accessRestriction:Qi,data:{eventId:i,roomId:n}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["content","body"]}]}})},reURI:la,tests:[{uri:"matrix:u/alice:matrix.domain.org?org.keyoxide.r=123:domain.org&org.keyoxide.e=123",shouldMatch:!0},{uri:"matrix:u/alice:matrix.domain.org",shouldMatch:!0},{uri:"matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123",shouldMatch:!0},{uri:"xmpp:alice@domain.org",shouldMatch:!1},{uri:"https://domain.org/@alice",shouldMatch:!1}]});const da=/https:\/\/t.me\/([A-Za-z0-9_]{5,32})\?proof=([A-Za-z0-9_]{5,32})/;var pa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(da);return new $i({about:{id:"telegram",name:"Telegram",homepage:"https://telegram.org"},profile:{display:`@${t[1]}`,uri:`https://t.me/${t[1]}`,qr:`https://t.me/${t[1]}`},claim:{uriRegularExpression:da.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://t.me/${t[2]}`,fetcher:Ii,accessRestriction:Qi,data:{user:t[1],chat:t[2]}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["text"]}]}})},reURI:da,tests:[{uri:"https://t.me/alice?proof=foobar",shouldMatch:!0},{uri:"https://t.me/complex_user_1234?proof=complex_chat_1234",shouldMatch:!0},{uri:"https://t.me/foobar",shouldMatch:!1},{uri:"https://t.me/foobar?proof=",shouldMatch:!1},{uri:"https://t.me/?proof=foobar",shouldMatch:!1}]});const ga=/^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;var Aa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ga),r=new URLSearchParams;return r.set("url",t[0]),r.set("omit_script","1"),new $i({about:{id:"twitter",name:"Twitter",homepage:"https://twitter.com"},profile:{display:`@${t[1]}`,uri:`https://twitter.com/${t[1]}`,qr:null},claim:{uriRegularExpression:ga.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://publish.twitter.com/oembed?${r}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["html"]}]}})},reURI:ga,tests:[{uri:"https://twitter.com/alice/status/1234567890123456789",shouldMatch:!0},{uri:"https://twitter.com/alice/status/1234567890123456789/",shouldMatch:!0},{uri:"https://domain.org/alice/status/1234567890123456789",shouldMatch:!1}]});const ya=/^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;var ma=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ya);return new $i({about:{id:"reddit",name:"Reddit",homepage:"https://reddit.com"},profile:{display:t[1],uri:`https://www.reddit.com/user/${t[1]}`,qr:null},claim:{uriRegularExpression:ya.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://www.reddit.com/user/${t[1]}/comments/${t[2]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["data","children","data","selftext"]}]}})},reURI:ya,tests:[{uri:"https://www.reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://www.reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://domain.org/user/Alice/comments/123456/post",shouldMatch:!1}]});const ba=/^https:\/\/liberapay\.com\/(.*)\/?/;var wa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ba);return new $i({about:{id:"liberapay",name:"Liberapay",homepage:"https://liberapay.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:ba.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:`https://liberapay.com/${t[1]}/public.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["statements","content"]}]}})},reURI:ba,tests:[{uri:"https://liberapay.com/alice",shouldMatch:!0},{uri:"https://liberapay.com/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const va=/^https:\/\/lichess\.org\/@\/(.*)\/?/;var Ia=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(va);return new $i({about:{id:"lichess",name:"Lichess",homepage:"https://lichess.org"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:va.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lichess.org/api/user/${t[1]}`,fetcher:mi,accessRestriction:ki,data:{url:`https://lichess.org/api/user/${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Di,encoding:Bi,relation:Ri,path:["profile","links"]}]}})},reURI:va,tests:[{uri:"https://lichess.org/@/Alice",shouldMatch:!0},{uri:"https://lichess.org/@/Alice/",shouldMatch:!0},{uri:"https://domain.org/@/Alice",shouldMatch:!1}]});const Ea=/^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;var Ba=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ea);return new $i({about:{id:"hackernews",name:"Hacker News",homepage:"https://news.ycombinator.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ea.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,fetcher:mi,accessRestriction:Si,data:{url:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Ci,relation:Ri,path:["about"]}]}})},reURI:Ea,tests:[{uri:"https://news.ycombinator.com/user?id=Alice",shouldMatch:!0},{uri:"https://news.ycombinator.com/user?id=Alice/",shouldMatch:!0},{uri:"https://domain.org/user?id=Alice",shouldMatch:!1}]});const Ca=/^https:\/\/lobste\.rs\/(?:~|u\/)(.*)\/?/;var _a=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ca);return new $i({about:{id:"lobsters",name:"Lobsters",homepage:"https://lobste.rs"},profile:{display:t[1],uri:`https://lobste.rs/~${t[1]}`,qr:null},claim:{uriRegularExpression:Ca.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lobste.rs/~${t[1]}.json`,fetcher:mi,accessRestriction:Si,data:{url:`https://lobste.rs/~${t[1]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["about"]}]}})},reURI:Ca,tests:[{uri:"https://lobste.rs/~Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice/",shouldMatch:!0},{uri:"https://domain.org/~Alice",shouldMatch:!1},{uri:"https://domain.org/u/Alice",shouldMatch:!1}]});const ka=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var Sa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ka);return new $i({about:{id:"forem",name:"Forem",homepage:"https://www.forem.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:ka.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/api/articles/${t[2]}/${t[3]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["body_markdown"]}]}})},reURI:ka,tests:[{uri:"https://domain.org/alice/post",shouldMatch:!0},{uri:"https://domain.org/alice/post/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Qa=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;const xa={validate:async(e,t,r)=>{const n=`https://${new URL(e.proof.request.uri).hostname}/api/forgejo/v1/version`,i=await tv({url:n,format:Pi});return i&&"version"in i}};var Pa=Object.freeze({__proto__:null,functions:xa,processURI:function(e){const t=e.match(Qa);return new $i({about:{id:"forgejo",name:"Forgejo",homepage:"https://forgejo.org"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Qa.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["description"]}]}})},reURI:Qa,tests:[{uri:"https://domain.org/alice/forgejo_proof",shouldMatch:!0},{uri:"https://domain.org/alice/forgejo_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Ma=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var Ua=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ma);return new $i({about:{id:"gitea",name:"Gitea",homepage:"https://about.gitea.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Ma.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["description"]}]}})},reURI:Ma,tests:[{uri:"https://domain.org/alice/gitea_proof",shouldMatch:!0},{uri:"https://domain.org/alice/gitea_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Da=/^https:\/\/(.*)\/(.*)\/gitlab_proof\/?/;var Ra=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Da);return new $i({about:{id:"gitlab",name:"GitLab",homepage:"https://about.gitlab.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Da.toString(),uriIsAmbiguous:!0},proof:{request:{fetcher:mi,accessRestriction:ki,data:{url:`https://${t[1]}/api/v4/projects/${t[2]}%2Fgitlab_proof`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Fi,path:["description"]}]}})},reURI:Da,tests:[{uri:"https://gitlab.domain.org/alice/gitlab_proof",shouldMatch:!0},{uri:"https://gitlab.domain.org/alice/gitlab_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]});const Fa=/^https:\/\/gist\.github\.com\/(.*)\/(.*)\/?/;var Ta=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Fa);return new $i({about:{id:"github",name:"GitHub",homepage:"https://github.com"},profile:{display:t[1],uri:`https://github.com/${t[1]}`,qr:null},claim:{uriRegularExpression:Fa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:`https://api.github.com/gists/${t[2]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["files","proof.md","content"]},{format:Ui,encoding:Bi,relation:Ri,path:["files","openpgp.md","content"]}]}})},reURI:Fa,tests:[{uri:"https://gist.github.com/Alice/123456789",shouldMatch:!0},{uri:"https://gist.github.com/Alice/123456789/",shouldMatch:!0},{uri:"https://domain.org/Alice/123456789",shouldMatch:!1}]});const qa=/^https:\/\/(.*)\/?/;const Oa={postprocess:async(e,t,r)=>{switch(t.result.type){case"Note":{e.profile.uri=t.result.attributedTo,e.profile.display=t.result.attributedTo;const n=await qr({url:t.result.attributedTo},r).catch((e=>null));n&&(e.profile.display=`@${n.preferredUsername}@${new URL(e.proof.request.uri).hostname}`);break}case"Person":e.profile.display=`@${t.result.preferredUsername}@${new URL(e.proof.request.uri).hostname}`}const n=await Ka(new URL(e.proof.request.uri).hostname);return n&&(e.about.name=n.software.name,e.about.id=n.software.name,e.about.homepage=n.software.homepage),{claimData:e,proofData:t}}},Ka=async e=>{const t=await fetch(`https://${e}/.well-known/nodeinfo`).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).catch((e=>null));if(!t)return null;{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:e.software.homepage||"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}};var Ha=Object.freeze({__proto__:null,functions:Oa,processURI:function(e){return new $i({about:{id:"activitypub",name:"ActivityPub",homepage:"https://activitypub.rocks"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:qa.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:pi,accessRestriction:ki,data:{url:e}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["summary"]},{format:Ui,encoding:Bi,relation:Ri,path:["attachment","value"]},{format:Ui,encoding:Bi,relation:Ri,path:["content"]}]}})},reURI:qa,tests:[{uri:"https://domain.org",shouldMatch:!0},{uri:"https://domain.org/@/alice/",shouldMatch:!0},{uri:"https://domain.org/@alice",shouldMatch:!0},{uri:"https://domain.org/@alice/123456",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/123456",shouldMatch:!0},{uri:"http://domain.org/alice",shouldMatch:!1}]});const Na=/^https:\/\/(.*)\/u\/(.*)\/?/;var La=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Na);return new $i({about:{id:"discourse",name:"Discourse",homepage:"https://www.discourse.org"},profile:{display:`${t[2]}@${t[1]}`,uri:e,qr:null},claim:{uriRegularExpression:Na.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://${t[1]}/u/${t[2]}.json`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["user","bio_raw"]}]}})},reURI:Na,tests:[{uri:"https://domain.org/u/alice",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Ga=/^https:\/\/(.*)/;var ja=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ga);return new $i({about:{id:"owncast",name:"Owncast",homepage:"https://owncast.online"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ga.toString(),uriIsAmbiguous:!0},proof:{request:{uri:`${e}/api/config`,fetcher:mi,accessRestriction:ki,data:{url:`${e}/api/config`,format:Pi}},response:{format:Pi},target:[{format:Di,encoding:Bi,relation:Ri,path:["socialHandles","url"]}]}})},reURI:Ga,tests:[{uri:"https://live.domain.org",shouldMatch:!0},{uri:"https://live.domain.org/",shouldMatch:!0},{uri:"https://domain.org/live",shouldMatch:!0},{uri:"https://domain.org/live/",shouldMatch:!0}]});const za=/^https:\/\/(.*(?:askubuntu|mathoverflow|serverfault|stackapps|stackoverflow|superuser)|.+\.stackexchange)\.com\/users\/(\d+)/,Wa=/\.stackexchange$/;var Za=Object.freeze({__proto__:null,processURI:function(e){const[,t,r]=e.match(za),n=t.replace(Wa,"");return new $i({about:{id:"stackexchange",name:"Stack Exchange",homepage:"https://stackexchange.com"},profile:{display:`${r}@${n}`,uri:e,qr:null},claim:{uriRegularExpression:za.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://${t}.com/users/${r}?tab=profile`,fetcher:mi,accessRestriction:ki,data:{url:`https://api.stackexchange.com/2.3/users/${r}?site=${n}&filter=!AH)b5JqVyImf`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["items","about_me"]}]}})},reURI:za,tests:[{uri:"https://stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234?tab=topactivity",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice?tab=profile",shouldMatch:!0},{uri:"https://meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://serverfault.com/users/1234",shouldMatch:!0},{uri:"https://meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://gaming.meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://stackexchange.com/users/1234",shouldMatch:!1},{uri:"https://domain.com/users/1234",shouldMatch:!1},{uri:"https://meta.domain.com/users/1234",shouldMatch:!1}]});const Ja=/^https:\/\/keybase.io\/(.*)\/?/;var Va=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ja);return new $i({about:{id:"keybase",name:"keybase",homepage:"https://keybase.io"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ja.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,fetcher:mi,accessRestriction:Si,data:{url:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Di,encoding:Bi,relation:Ri,path:["them","public_keys","primary","key_fingerprint"]}]}})},reURI:Ja,tests:[{uri:"https://keybase.io/Alice",shouldMatch:!0},{uri:"https://keybase.io/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const Ya=/^https:\/\/opencollective\.com\/(.*)\/?/;var $a=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ya);return new $i({about:{id:"opencollective",name:"Open Collective",homepage:"https://opencollective.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ya.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:Si,data:{url:"https://api.opencollective.com/graphql/v2",query:`{ "query": "query { account(slug: \\"${t[1]}\\") { longDescription } }" }`}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["data","account","longDescription"]}]}})},reURI:Ya,tests:[{uri:"https://opencollective.com/Alice",shouldMatch:!0},{uri:"https://opencollective.com/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const Xa=/^https:\/\/orcid\.org\/(.*)\/?/;var eo=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Xa);return new $i({about:{id:"orcid",name:"ORCiD",homepage:"https://orcid.org/"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Xa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:e,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["person","biography","content"]},{format:Ui,encoding:Bi,relation:Fi,path:["person","researcher-urls","researcher-url","url","value"]},{format:Ui,encoding:Bi,relation:Fi,path:["person","keywords","keyword","content"]}]}})},reURI:Xa,tests:[{uri:"https://orcid.org/0000-0000-0000-0000",shouldMatch:!0},{uri:"https://orcid.org/0000-0000-0000-0000/",shouldMatch:!0},{uri:"https://domain.org/0000-0000-0000-0000",shouldMatch:!1}]});const to=/^https:\/\/pronouns\.cc\/@(.*)\/?/;var ro=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(to);return new $i({about:{id:"pronounscc",name:"pronouns.cc",homepage:"https://pronouns.cc"},profile:{display:`@${t[1]}`,uri:`https://pronouns.cc/@${t[1]}`,qr:null},claim:{uriRegularExpression:to.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:`https://pronouns.cc/api/v1/users/${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["links"]},{format:Ui,encoding:Bi,relation:Ri,path:["bio"]}]}})},reURI:to,tests:[{uri:"https://pronouns.cc/@Alice",shouldMatch:!0},{uri:"https://pronouns.cc/@Alice/",shouldMatch:!0},{uri:"https://pronouns.cc/Alice",shouldMatch:!1},{uri:"https://pronouns.cc/Alice/",shouldMatch:!1}]});const no=/^https:\/\/(?:discord\.gg|discord\.com\/invite)\/(.+)/;var io=Object.freeze({__proto__:null,functions:{postprocess:async(e,t,r)=>(e.profile.display=t.result.inviter.username,{claimData:e,proofData:t})},processURI:function(e){const t=e.match(no);return new $i({about:{id:"discord",name:"Discord",homepage:"https://discord.com"},profile:{display:"Unknown username",uri:null,qr:null},claim:{uriRegularExpression:no.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://discord.com/api/v10/invites/${t[1]}`,fetcher:mi,accessRestriction:Si,data:{url:`https://discord.com/api/v10/invites/${t[1]}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:["guild","description"]},{format:Ui,encoding:Bi,relation:Ri,path:["guild","name"]}]}})},reURI:no,tests:[{uri:"https://discord.com/invite/AbCdEf",shouldMatch:!0},{uri:"https://discord.com/invite/AbCdEfGh",shouldMatch:!0},{uri:"https://discord.gg/AbCdEf",shouldMatch:!0},{uri:"https://discord.gg/AbCdEfGh",shouldMatch:!0},{uri:"https://domain.com/invite/AbCdEf",shouldMatch:!1},{uri:"https://domain.gg/AbCdEf",shouldMatch:!1},{uri:"https://discord.com/invite/",shouldMatch:!1},{uri:"https://discord.gg/",shouldMatch:!1}]});const ao=/^https:\/\/bsky\.app\/profile\/([^/]+)(?:\/?$|\/post\/([^/]+)\/?)/;var oo=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ao),r=new URLSearchParams;return t[2]?r.set("uri",`at://${t[1]}/app.bsky.feed.post/${t[2]}`):r.set("actor",t[1]),new $i({about:{id:"bsky",name:"Bluesky",homepage:"https://bsky.app"},profile:{display:`@${t[1]}`,uri:`https://bsky.app/profile/${t[1]}`,qr:null},claim:{uriRegularExpression:ao.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:mi,accessRestriction:Si,data:{url:t[2]?`https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?${r}`:`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?${r}`,format:Pi}},response:{format:Pi},target:[{format:Ui,encoding:Bi,relation:Ri,path:t[2]?["thread","post","record","text"]:["description"]}]}})},reURI:ao,tests:[{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/post/",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/profile/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/post/a1b2c3d4e5/",shouldMatch:!1}]});const so=/^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;const co={aspe:ea,openpgp:ia,dns:oa,irc:ca,xmpp:ha,matrix:fa,telegram:pa,twitter:Aa,reddit:ma,liberapay:wa,lichess:Ia,hackernews:Ba,lobsters:_a,forem:Sa,forgejo:Pa,gitea:Ua,gitlab:Ra,github:Ta,activitypub:Ha,discourse:La,owncast:ja,stackexchange:Za,keybase:Va,opencollective:$a,orcid:eo,pronounscc:ro,discord:io,bsky:oo,sourcehut:Object.freeze({__proto__:null,processURI:function(e){const[,t,r,,n]=e.match(so);return new $i({about:{id:"sourcehut",name:"SourceHut",homepage:"https://sourcehut.org"},profile:{display:t,uri:`https://sr.ht/~${t}`,qr:null},claim:{uriRegularExpression:so.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:mi,accessRestriction:ki,data:{url:`https://git.sr.ht/~${t}/${r}/blob/${n??"main"}/proof.md`,format:Mi}},response:{format:Mi},target:[{format:Ui,encoding:Bi,relation:Ri,path:[]}]}})},reURI:so,tests:[{uri:"https://git.sr.ht/~alice/sourcehut_proof",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/keyoxide_proof/",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/proof_repo/tree/master",shouldMatch:!0},{uri:"https://domain.org/alice/keyoxide_proof",shouldMatch:!1}]})},uo=Object.keys(co),ho="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lo=Symbol("doneWritingPromise"),fo=Symbol("doneWritingResolve"),po=Symbol("doneWritingReject"),go=Symbol("readingIndex");class Ao extends Array{constructor(){super(),this[lo]=new Promise(((e,t)=>{this[fo]=e,this[po]=t})),this[lo].catch((()=>{}))}}function yo(e){return e&&e.getReader&&Array.isArray(e)}function mo(e){if(!yo(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}Ao.prototype.getReader=function(){return void 0===this[go]&&(this[go]=0),{read:async()=>(await this[lo],this[go]===this.length?{value:void 0,done:!0}:{value:this[this[go]++],done:!1})}},Ao.prototype.readToEnd=async function(e){await this[lo];const t=e(this.slice(this[go]));return this.length=0,t},Ao.prototype.clone=function(){const e=new Ao;return e[lo]=this[lo].then((()=>{e.push(...this)})),e},mo.prototype.write=async function(e){this.stream.push(e)},mo.prototype.close=async function(){this.stream[fo]()},mo.prototype.abort=async function(e){return this.stream[po](e),e},mo.prototype.releaseLock=function(){};const bo="object"==typeof ho.process&&"object"==typeof ho.process.versions,wo=bo&&void 0;function vo(e){return yo(e)?"array":ho.ReadableStream&&ho.ReadableStream.prototype.isPrototypeOf(e)?"web":Mo&&Mo.prototype.isPrototypeOf(e)?"ponyfill":wo&&wo.prototype.isPrototypeOf(e)?"node":!(!e||!e.getReader)&&"web-like"}function Io(e){return Uint8Array.prototype.isPrototypeOf(e)}function Eo(e){if(1===e.length)return e[0];let t=0;for(let r=0;r{t||(Bo.isBuffer(n)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),r.enqueue(n),e.pause())})),e.on("end",(()=>{t||r.close()})),e.on("error",(e=>r.error(e)))},pull(){e.resume()},cancel(r){t=!0,e.destroy(r)}})};class e extends Co{constructor(e,t){super(t),this._reader=Oo(e)}async _read(e){try{for(;;){const{done:e,value:t}=await this._reader.read();if(e){this.push(null);break}if(!this.push(t))break}}catch(e){this.destroy(e)}}async _destroy(e,t){this._reader.cancel(e).then(t,t)}}ko=function(t,r){return new e(t,r)}}const So=new WeakSet,Qo=Symbol("externalBuffer");function xo(e){if(this.stream=e,e[Qo]&&(this[Qo]=e[Qo].slice()),yo(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let t=vo(e);if("node"===t&&(e=_o(e)),t){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let r=!1;this._read=async()=>r||So.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{So.add(e)}catch(e){}}}xo.prototype.read=async function(){return this[Qo]&&this[Qo].length?{done:!1,value:this[Qo].shift()}:this._read()},xo.prototype.releaseLock=function(){this[Qo]&&(this.stream[Qo]=this[Qo]),this._releaseLock()},xo.prototype.cancel=function(e){return this._cancel(e)},xo.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:n}=await this.read();if(n+="",r)return t.length?qo(t):void 0;const i=n.indexOf("\n")+1;i&&(e=qo(t.concat(n.substr(0,i))),t=[]),i!==n.length&&t.push(n.substr(i))}return this.unshift(...t),e},xo.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(Jo(t,1)),r},xo.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:n,value:i}=await this.read();if(n)return t.length?qo(t):void 0;if(t.push(i),r+=i.length,r>=e){const r=qo(t);return this.unshift(Jo(r,e)),Jo(r,0,e)}}},xo.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},xo.prototype.unshift=function(...e){this[Qo]||(this[Qo]=[]),1===e.length&&Io(e[0])&&this[Qo].length&&e[0].length&&this[Qo][0].byteOffset>=e[0].length?this[Qo][0]=new Uint8Array(this[Qo][0].buffer,this[Qo][0].byteOffset-e[0].length,this[Qo][0].byteLength+e[0].length):this[Qo].unshift(...e.filter((e=>e&&e.length)))},xo.prototype.readToEnd=async function(e=qo){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};let Po,{ReadableStream:Mo,WritableStream:Uo,TransformStream:Do}=ho;const Ro=bo&&void 0;function Fo(e){let t=vo(e);return"node"===t?_o(e):"web"===t&&Po?Po(e):t?e:new Mo({start(t){t.enqueue(e),t.close()}})}function To(e){if(vo(e))return e;const t=new Ao;return(async()=>{const r=Ko(t);await r.write(e),await r.close()})(),t}function qo(e){return e.some((e=>vo(e)&&!yo(e)))?function(e){e=e.map(Fo);const t=Lo((async function(e){await Promise.all(n.map((t=>async function(e,t){if(vo(e)){if(e.cancel)return e.cancel(t);if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}(t,e))))}));let r=Promise.resolve();const n=e.map(((n,i)=>jo(n,((n,a)=>(r=r.then((()=>Ho(n,t.writable,{preventClose:i!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>yo(e)))?function(e){const t=new Ao;let r=Promise.resolve();return e.forEach(((n,i)=>(r=r.then((()=>Ho(n,t,{preventClose:i!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):Ro&&Ro.isBuffer(e[0])?Ro.concat(e):Eo(e)}function Oo(e){return new xo(e)}function Ko(e){return new mo(e)}async function Ho(e,t,{preventClose:r=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(vo(e)&&!yo(e)){e=Fo(e);try{if(e[Qo]){const r=Ko(t);for(let t=0;t{t=e})),t=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function Go(e,t=(()=>{}),r=(()=>{})){if(yo(e)){const n=new Ao;return(async()=>{const i=Ko(n);try{const n=await Vo(e),a=t(n),o=r();let s;s=void 0!==a&&void 0!==o?qo([a,o]):void 0!==a?a:o,await i.write(s),await i.close()}catch(e){await i.abort(e)}})(),n}if(vo(e))return No(e,{async transform(e,r){try{const n=await t(e);void 0!==n&&r.enqueue(n)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const n=t(e),i=r();return void 0!==n&&void 0!==i?qo([n,i]):void 0!==n?n:i}function jo(e,t){if(vo(e)&&!yo(e)){let r;const n=new Do({start(e){r=e}}),i=Ho(e,n.writable),a=Lo((async function(e){r.error(e),await i,await new Promise(setTimeout)}));return t(n.readable,a.writable),a.readable}e=To(e);const r=new Ao;return t(e,r),r}function zo(e){if(yo(e))return e.clone();if(vo(e)){const t=function(e){if(yo(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(vo(e)){const t=Fo(e).tee();return t[0][Qo]=t[1][Qo]=e[Qo],t}return[Jo(e),Jo(e)]}(e);return Zo(e,t[0]),t[1]}return Jo(e)}function Wo(e){return yo(e)?zo(e):vo(e)?new Mo({start(t){const r=jo(e,(async(e,r)=>{const n=Oo(e),i=Ko(r);try{for(;;){await i.ready;const{done:r,value:a}=await n.read();if(r){try{t.close()}catch(e){}return void await i.close()}try{t.enqueue(a)}catch(e){}await i.write(a)}}catch(e){t.error(e),await i.abort(e)}}));Zo(e,r)}}):Jo(e)}function Zo(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,n])=>{"constructor"!==r&&(n.value?n.value=n.value.bind(t):n.get=n.get.bind(t),Object.defineProperty(e,r,n))}))}function Jo(e,t=0,r=1/0){if(yo(e))throw Error("Not implemented");if(vo(e)){if(t>=0&&r>=0){let n=0;return No(e,{transform(e,i){n=t&&i.enqueue(Jo(e,Math.max(t-n,0),r-n)),n+=e.length):i.terminate()}})}if(t<0&&(r<0||r===1/0)){let n=[];return Go(e,(e=>{e.length>=-t?n=[e]:n.push(e)}),(()=>Jo(qo(n),t,r)))}if(0===t&&r<0){let n;return Go(e,(e=>{const i=n?qo([n,e]):e;if(i.length>=-r)return n=Jo(i,r),Jo(i,t,r);n=i}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),Yo((async()=>Jo(await Vo(e),t,r)))}return e[Qo]&&(e=qo(e[Qo].concat([e]))),!Io(e)||Ro&&Ro.isBuffer(e)?e.slice(t,r):(r===1/0&&(r=e.length),e.subarray(t,r))}async function Vo(e,t=qo){return yo(e)?e.readToEnd(t):vo(e)?Oo(e).readToEnd(t):e}function Yo(e){const t=new Ao;return(async()=>{const r=Ko(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}class $o{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,r=Array(t.length);for(let e=0;eBigInt(0);){const e=r&BigInt(1);r>>=BigInt(1);const a=i*n%t.value;i=e?a:i,n=n*n%t.value}return new $o(i)}modInv(e){const{gcd:t,x:r}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return r.add(e).mod(e)}_egcd(e){let t=BigInt(0),r=BigInt(1),n=BigInt(1),i=BigInt(0),a=this.value;for(e=e.value;e!==BigInt(0);){const o=a/e;let s=t;t=n-o*t,n=s,s=r,r=i-o*r,i=s,s=e,e=a%e,a=s}return{x:new $o(n),y:new $o(i),gcd:new $o(a)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const r=e;e=t%e,t=r}return new $o(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new $o(0),t=new $o(1),r=new $o(-1),n=this.isNegative()?r:e;let i=1;const a=this.clone();for(;!a.irightShift(t).equal(n);)i++;return i}byteLength(){const e=new $o(0),t=new $o(-1),r=this.isNegative()?t:e,n=new $o(8);let i=1;const a=this.clone();for(;!a.irightShift(n).equal(r);)i++;return i}toUint8Array(e="be",t){let r=this.value.toString(16);r.length%2==1&&(r="0"+r);const n=r.length/2,i=new Uint8Array(t||n),a=t?t-n:0;let o=0;for(;o{e[Xo][r]=t}))),void 0!==e[Xo][t])return e[Xo][t];throw Error("Invalid enum value.")}};const ts=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),rs={isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return e instanceof Array},isUint8Array:Io,isStream:vo,readNumber:function(e){let t=0;for(let r=0;r>8*(t-n-1)&255;return r},readDate:function(e){const t=rs.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return rs.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=7+(e[0]<<8|e[1])>>>3;return e.subarray(2,2+t)},leftPad(e,t){const r=new Uint8Array(t),n=t-e.length;return r.set(e,n),r},uint8ArrayToMPI:function(e){const t=rs.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),n=new Uint8Array([(65280&t)>>8,255&t]);return rs.concatUint8Array([n,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t>1);for(let r=0;r>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t=[],r=e.length;let n,i=0;for(;i{if(!rs.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;rr("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return Go(e,r,(()=>r(new Uint8Array,!0)))},concat:qo,concatUint8Array:Eo,equalsUint8Array:function(e,t){if(!rs.isUint8Array(e)||!rs.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let n=0;n>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){return void 0!==ho&&ho.crypto&&ho.crypto.subtle},getBigInteger:async function(){if("undefined"!=typeof BigInt)return $o;{const{default:e}=await Promise.resolve().then((function(){return bm}));return e}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return"undefined"!=typeof navigator?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(e){return!!rs.isString(e)&&/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(e)},canonicalizeEOL:function(e){let t=!1;return Go(e,(e=>{let r;t&&(e=rs.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const n=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&n.push(r);if(!n.length)return e;const i=new Uint8Array(e.length+n.length);let a=0;for(let t=0;tt?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return Go(e,(e=>{let r;13===(e=t&&10!==e[0]?rs.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let n=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const i=r-(10===e[r]?1:0);t&&e.copyWithin(n,t,i),n+=i-t}return e.subarray(0,n)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let n;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){n=e}}))),r(n)}))},selectUint8Array:function(e,t,r){const n=Math.max(t.length,r.length),i=new Uint8Array(n);let a=0;for(let n=0;n{t=rs.concatUint8Array([t,e]);const r=[],n=Math.floor(t.length/45),i=45*n,a=is(t.subarray(0,i));for(let e=0;et.length?is(t)+"\n":""))}function ss(e){let t="";return Go(e,(e=>{t+=e;let r=0;const n=[" ","\t","\r","\n"];for(let e=0;e0&&(i-r)%4!=0;i--)n.includes(t[i])&&r--;const a=as(t.substr(0,i));return t=t.substr(i),a}),(()=>as(t)))}function cs(e){return ss(e.replace(/-/g,"+").replace(/_/g,"/"))}function us(e,t){let r=os(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}ns?(is=e=>ns.from(e).toString("base64"),as=e=>{const t=ns.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(is=e=>btoa(rs.uint8ArrayToString(e)),as=e=>rs.stringToUint8Array(atob(e)));var hs={preferredHashAlgorithm:es.hash.sha256,preferredSymmetricAlgorithm:es.symmetric.aes256,preferredCompressionAlgorithm:es.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:es.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([es.symmetric.aes128,es.symmetric.aes192,es.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([es.hash.md5,es.hash.ripemd]),rejectMessageHashAlgorithms:new Set([es.hash.md5,es.hash.ripemd,es.hash.sha1]),rejectPublicKeyAlgorithms:new Set([es.publicKey.elgamal,es.publicKey.dsa]),rejectCurves:new Set([es.curve.secp256k1])};function ls(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?es.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?es.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?es.armor.signed:/MESSAGE/.test(t[1])?es.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?es.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?es.armor.privateKey:/SIGNATURE/.test(t[1])?es.armor.signature:void 0}function fs(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function ds(e){return os(function(e){let t=13501623;return Go(e,(e=>{const r=gs?Math.floor(e.length/4):0,n=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e>24&255]^ps[1][t>>16&255]^ps[2][t>>8&255]^ps[3][t>>0&255];for(let n=4*r;n>8^ps[0][255&t^e[n]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e))}const ps=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);ps[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)ps[1][e]=ps[0][e]>>8^ps[0][255&ps[0][e]];for(let e=0;e<=255;e++)ps[2][e]=ps[1][e]>>8^ps[0][255&ps[1][e]];for(let e=0;e<=255;e++)ps[3][e]=ps[2][e]>>8^ps[0][255&ps[2][e]];const gs=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function As(e){for(let t=0;t=0&&n!==e.length-1&&(t=e.slice(0,n),r=e.slice(n+1).substr(0,4)),{body:t,checksum:r}}function ms(e,t=hs){return new Promise((async(r,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let o;const s=[];let c,u,h,l=s,f=[],d=ss(jo(e,(async(e,t)=>{const p=Oo(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=rs.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),o)if(c)u||2!==o||(i.test(e)?(f=f.join("\r\n"),u=!0,As(l),l=[],c=!1):f.push(e.replace(/^- /,"")));else if(i.test(e)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(e)){if(As(l),c=!0,u||2!==o){r({text:f,data:d,headers:s,type:o});break}}else l.push(e);else i.test(e)&&(o=ls(e))}}catch(e){return void n(e)}const g=Ko(t);try{for(;;){await g.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=rs.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(i);if(1===t.length)throw Error("Misformed armored text");const n=ys(t[0].slice(0,-1));h=n.checksum,await g.write(n.body);break}await g.write(r)}await g.ready,await g.close()}catch(e){await g.abort(e)}})));d=jo(d,(async(e,r)=>{const n=Vo(ds(Wo(e)));n.catch((()=>{})),await Ho(e,r,{preventClose:!0});const i=Ko(r);try{const e=(await n).replace("\n","");if(h!==e&&(h||t.checksumRequired))throw Error("Ascii armor integrity check failed");await i.ready,await i.close()}catch(e){await i.abort(e)}}))}catch(e){n(e)}})).then((async e=>(yo(e.data)&&(e.data=await Vo(e.data)),e)))}function bs(e,t,r,n,i,a=hs){let o,s;e===es.armor.signed&&(o=t.text,s=t.hash,t=t.data);const c=Wo(t),u=[];switch(e){case es.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+n+"-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP MESSAGE, PART "+r+"/"+n+"-----\n");break;case es.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case es.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push("Hash: "+s+"\n\n"),u.push(o.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP SIGNATURE-----\n");break;case es.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP MESSAGE-----\n");break;case es.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case es.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case es.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(fs(i,a)),u.push(os(t)),u.push("=",ds(c)),u.push("-----END PGP SIGNATURE-----\n")}return rs.concat(u)}class ws{constructor(){this.bytes=""}read(e){return this.bytes=rs.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return rs.stringToUint8Array(this.bytes)}toHex(){return rs.uint8ArrayToHex(rs.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new ws;return t.read(rs.hexToUint8Array(e)),t}static wildcard(){const e=new ws;return e.read(new Uint8Array(8)),e}}var vs=function(){var e,t,r=!1;function n(r,n){var i=e[(t[r]+t[n])%255];return 0!==r&&0!==n||(i=0),i}var i,a,o,s,c=!1;function u(){function u(r){var n,i,a;for(i=a=function(r){var n=e[255-t[r]];return 0===r&&(n=0),n}(r),n=0;n<4;n++)a^=i=255&(i<<1|i>>>7);return 99^a}r||function(){e=[],t=[];var n,i,a=1;for(n=0;n<255;n++)e[n]=a,i=128&a,a<<=1,a&=255,128===i&&(a^=27),a^=e[n],t[e[n]]=n;e[255]=e[0],t[0]=0,r=!0}(),i=[],a=[],o=[[],[],[],[]],s=[[],[],[],[]];for(var h=0;h<256;h++){var l=u(h);i[h]=l,a[l]=h,o[0][h]=n(2,l)<<24|l<<16|l<<8|n(3,l),s[0][l]=n(14,h)<<24|n(9,h)<<16|n(13,h)<<8|n(11,h);for(var f=1;f<4;f++)o[f][h]=o[f-1][h]>>>8|o[f-1][h]<<24,s[f][l]=s[f-1][l]>>>8|s[f-1][l]<<24}c=!0}var h=function(e,t){c||u();var r=new Uint32Array(t);r.set(i,512),r.set(a,768);for(var n=0;n<4;n++)r.set(o[n],4096+1024*n>>2),r.set(s[n],8192+1024*n>>2);var h=function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0;var B=new e.Uint32Array(r),C=new e.Uint8Array(r);function _(e,t,r,s,c,u,h,l){e=e|0;t=t|0;r=r|0;s=s|0;c=c|0;u=u|0;h=h|0;l=l|0;var f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;f=r|0x400,d=r|0x800,p=r|0xc00;c=c^B[(e|0)>>2],u=u^B[(e|4)>>2],h=h^B[(e|8)>>2],l=l^B[(e|12)>>2];for(b=16;(b|0)<=s<<4;b=b+16|0){g=B[(r|c>>22&1020)>>2]^B[(f|u>>14&1020)>>2]^B[(d|h>>6&1020)>>2]^B[(p|l<<2&1020)>>2]^B[(e|b|0)>>2],A=B[(r|u>>22&1020)>>2]^B[(f|h>>14&1020)>>2]^B[(d|l>>6&1020)>>2]^B[(p|c<<2&1020)>>2]^B[(e|b|4)>>2],y=B[(r|h>>22&1020)>>2]^B[(f|l>>14&1020)>>2]^B[(d|c>>6&1020)>>2]^B[(p|u<<2&1020)>>2]^B[(e|b|8)>>2],m=B[(r|l>>22&1020)>>2]^B[(f|c>>14&1020)>>2]^B[(d|u>>6&1020)>>2]^B[(p|h<<2&1020)>>2]^B[(e|b|12)>>2];c=g,u=A,h=y,l=m}n=B[(t|c>>22&1020)>>2]<<24^B[(t|u>>14&1020)>>2]<<16^B[(t|h>>6&1020)>>2]<<8^B[(t|l<<2&1020)>>2]^B[(e|b|0)>>2],i=B[(t|u>>22&1020)>>2]<<24^B[(t|h>>14&1020)>>2]<<16^B[(t|l>>6&1020)>>2]<<8^B[(t|c<<2&1020)>>2]^B[(e|b|4)>>2],a=B[(t|h>>22&1020)>>2]<<24^B[(t|l>>14&1020)>>2]<<16^B[(t|c>>6&1020)>>2]<<8^B[(t|u<<2&1020)>>2]^B[(e|b|8)>>2],o=B[(t|l>>22&1020)>>2]<<24^B[(t|c>>14&1020)>>2]<<16^B[(t|u>>6&1020)>>2]<<8^B[(t|h<<2&1020)>>2]^B[(e|b|12)>>2]}function k(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;_(0x0000,0x0800,0x1000,E,e,t,r,n)}function S(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0;_(0x0400,0x0c00,0x2000,E,e,n,r,t);a=i,i=o,o=a}function Q(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s^e,c^t,u^r,h^l);s=n,c=i,u=a,h=o}function x(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;var f=0;_(0x0400,0x0c00,0x2000,E,e,l,r,t);f=i,i=o,o=f;n=n^s,i=i^c,a=a^u,o=o^h;s=e,c=t,u=r,h=l}function P(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n=n^e,c=i=i^t,u=a=a^r,h=o=o^l}function M(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);n=n^e,i=i^t,a=a^r,o=o^l;s=e,c=t,u=r,h=l}function U(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n,c=i,u=a,h=o;n=n^e,i=i^t,a=a^r,o=o^l}function D(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;_(0x0000,0x0800,0x1000,E,l,f,d,p);p=~m&p|m&p+1;d=~y&d|y&d+((p|0)==0);f=~A&f|A&f+((d|0)==0);l=~g&l|g&l+((f|0)==0);n=n^e;i=i^t;a=a^r;o=o^s}function R(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0,o=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0;e=e^s,t=t^c,r=r^u,n=n^h;i=b|0,a=w|0,o=v|0,l=I|0;for(;(A|0)<128;A=A+1|0){if(i>>>31){f=f^e,d=d^t,p=p^r,g=g^n}i=i<<1|a>>>31,a=a<<1|o>>>31,o=o<<1|l>>>31,l=l<<1;y=n&1;n=n>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(y)e=e^0xe1000000}s=f,c=d,u=p,h=g}function F(e){e=e|0;E=e}function T(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;n=e,i=t,a=r,o=s}function q(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;s=e,c=t,u=r,h=n}function O(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;l=e,f=t,d=r,p=n}function K(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;g=e,A=t,y=r,m=n}function H(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;p=~m&p|m&n,d=~y&d|y&r,f=~A&f|A&t,l=~g&l|g&e}function N(e){e=e|0;if(e&15)return-1;C[e|0]=n>>>24,C[e|1]=n>>>16&255,C[e|2]=n>>>8&255,C[e|3]=n&255,C[e|4]=i>>>24,C[e|5]=i>>>16&255,C[e|6]=i>>>8&255,C[e|7]=i&255,C[e|8]=a>>>24,C[e|9]=a>>>16&255,C[e|10]=a>>>8&255,C[e|11]=a&255,C[e|12]=o>>>24,C[e|13]=o>>>16&255,C[e|14]=o>>>8&255,C[e|15]=o&255;return 16}function L(e){e=e|0;if(e&15)return-1;C[e|0]=s>>>24,C[e|1]=s>>>16&255,C[e|2]=s>>>8&255,C[e|3]=s&255,C[e|4]=c>>>24,C[e|5]=c>>>16&255,C[e|6]=c>>>8&255,C[e|7]=c&255,C[e|8]=u>>>24,C[e|9]=u>>>16&255,C[e|10]=u>>>8&255,C[e|11]=u&255,C[e|12]=h>>>24,C[e|13]=h>>>16&255,C[e|14]=h>>>8&255,C[e|15]=h&255;return 16}function G(){k(0,0,0,0);b=n,w=i,v=a,I=o}function j(e,t,r){e=e|0;t=t|0;r=r|0;var s=0;if(t&15)return-1;while((r|0)>=16){W[e&7](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);C[t|0]=n>>>24,C[t|1]=n>>>16&255,C[t|2]=n>>>8&255,C[t|3]=n&255,C[t|4]=i>>>24,C[t|5]=i>>>16&255,C[t|6]=i>>>8&255,C[t|7]=i&255,C[t|8]=a>>>24,C[t|9]=a>>>16&255,C[t|10]=a>>>8&255,C[t|11]=a&255,C[t|12]=o>>>24,C[t|13]=o>>>16&255,C[t|14]=o>>>8&255,C[t|15]=o&255;s=s+16|0,t=t+16|0,r=r-16|0}return s|0}function z(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){Z[e&1](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);n=n+16|0,t=t+16|0,r=r-16|0}return n|0}var W=[k,S,Q,x,P,M,U,D];var Z=[Q,R];return{set_rounds:F,set_state:T,set_iv:q,set_nonce:O,set_mask:K,set_counter:H,get_state:N,get_iv:L,gcm_init:G,cipher:j,mac:z}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},e,t);return h.set_key=function(e,t,n,a,o,c,u,l,f){var d=r.subarray(0,60),p=r.subarray(256,316);d.set([t,n,a,o,c,u,l,f]);for(var g=e,A=1;g<4*e+28;g++){var y=d[g-1];(g%e==0||8===e&&g%e==4)&&(y=i[y>>>24]<<24^i[y>>>16&255]<<16^i[y>>>8&255]<<8^i[255&y]),g%e==0&&(y=y<<8^y>>>24^A<<24,A=A<<1^(128&A?27:0)),d[g]=d[g-e]^y}for(var m=0;m=g-4?y:s[0][i[y>>>24]]^s[1][i[y>>>16&255]]^s[2][i[y>>>8&255]]^s[3][i[255&y]];h.set_rounds(e+5)},h};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function Is(e){return e instanceof Uint8Array}function Es(e,t){const r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return e||new Uint8Array(new ArrayBuffer(r))}function Bs(e,t,r,n,i){const a=e.length-t,o=ae+t.length),0),r=new Uint8Array(t);let n=0;for(let t=0;t>2,i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12),n>16?i.getUint32(16):0,n>16?i.getUint32(20):0,n>24?i.getUint32(24):0,n>24?i.getUint32(28):0),void 0!==t){if(16!==t.length)throw new ks("illegal iv size");let e=new DataView(t.buffer,t.byteOffset,t.byteLength);r.set_iv(e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12))}else r.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!Is(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),n=vs.ENC[this.mode],i=vs.HEAP_DATA,a=this.pos,o=this.len,s=0,c=e.length||0,u=0,h=0,l=new Uint8Array(o+c&-16);for(;c>0;)h=Bs(t,a+o,e,s,c),o+=h,s+=h,c-=h,h=r.cipher(n,i+a,o),h&&l.set(t.subarray(a,a+h),u),u+=h,h0;)f=Bs(t,a+o,e,s,c),o+=f,s+=f,c-=f,f=r.cipher(n,i+a,o-(c?0:l)),f&&d.set(t.subarray(a,a+f),u),u+=f,f0){if(a%16){if(this.hasOwnProperty("padding"))throw new ks("data length must be a multiple of the block size");a+=16-a%16}if(t.cipher(r,n+i,a),this.hasOwnProperty("padding")&&this.padding){let t=e[i+o-1];if(t<1||t>16||t>o)throw new Ss("bad padding");let r=0;for(let n=t;n>1;n--)r|=t^e[i+o-n];if(r)throw new Ss("bad padding");o-=t}}const s=new Uint8Array(o);return o>0&&s.set(e.subarray(i,i+o)),this.pos=0,this.len=0,this.release_asm(),s}}class Ms{static encrypt(e,t,r=!1){return new Ms(t,r).encrypt(e)}static decrypt(e,t,r=!1){return new Ms(t,r).decrypt(e)}constructor(e,t=!1,r){this.aes=r||new Ps(e,void 0,t,"ECB")}encrypt(e){return Cs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Cs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Us(e){const t=function(e){const t=new Ms(e);this.encrypt=function(e){return t.encrypt(e)},this.decrypt=function(e){return t.decrypt(e)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=e/8,t}function Ds(e,t,r,n,i,a){const o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],c=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let p,g,A,y,m,b,w,v,I,E,B,C,_,k,S=0,Q=t.length;const x=32===e.length?3:9;v=3===x?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(e,t){const r=8-e.length%8;let n;if(2===t&&r<8)n=32;else if(1===t)n=r;else{if(t||!(r<8)){if(8===r)return e;throw Error("des: invalid padding")}n=0}const i=new Uint8Array(e.length+r);for(let t=0;t>>4^w),w^=A,b^=A<<4,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,b=b<<1|b>>>31,w=w<<1|w>>>31,g=0;g>>4|w<<28)^e[p+1],A=b,b=w,w=A^(s[y>>>24&63]|u[y>>>16&63]|l[y>>>8&63]|d[63&y]|o[m>>>24&63]|c[m>>>16&63]|h[m>>>8&63]|f[63&m]);A=b,b=w,w=A}b=b>>>1|b<<31,w=w>>>1|w<<31,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=252645135&(b>>>4^w),w^=A,b^=A<<4,1===n&&(r?(I=b,B=w):(b^=E,w^=C)),P[M++]=b>>>24,P[M++]=b>>>16&255,P[M++]=b>>>8&255,P[M++]=255&b,P[M++]=w>>>24,P[M++]=w>>>16&255,P[M++]=w>>>8&255,P[M++]=255&w}return r||(P=function(e,t){let r,n=null;if(2===t)r=32;else if(1===t)n=e[e.length-1];else{if(t)throw Error("des: invalid padding");r=0}if(!n){for(n=1;e[e.length-n]===r;)n++;n--}return e.subarray(0,e.length-n)}(P,a)),P}function Rs(e){const t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],p=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length>8?3:1,A=Array(32*g),y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let m,b,w,v=0,I=0;for(let E=0;E>>4^E),E^=w,g^=w<<4,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=858993459&(g>>>2^E),E^=w,g^=w<<2,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=16711935&(E>>>8^g),g^=w,E^=w<<8,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=g<<8|E>>>20&240,g=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=w;for(let e=0;e<16;e++)y[e]?(g=g<<2|g>>>26,E=E<<2|E>>>26):(g=g<<1|g>>>27,E=E<<1|E>>>27),g&=-15,E&=-15,m=t[g>>>28]|r[g>>>24&15]|n[g>>>20&15]|i[g>>>16&15]|a[g>>>12&15]|o[g>>>8&15]|s[g>>>4&15],b=c[E>>>28]|u[E>>>24&15]|h[E>>>20&15]|l[E>>>16&15]|f[E>>>12&15]|d[E>>>8&15]|p[E>>>4&15],w=65535&(b>>>16^m),A[I++]=m^w,A[I++]=b^w<<16}return A}function Fs(e){this.key=[];for(let t=0;t<3;t++)this.key.push(new Uint8Array(e.subarray(8*t,8*t+8)));this.encrypt=function(e){return Ds(Rs(this.key[2]),Ds(Rs(this.key[1]),Ds(Rs(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Ts(){this.BlockSize=8,this.KeySize=16,this.setKey=function(e){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),e.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(e),!0},this.reset=function(){for(let e=0;e<16;e++)this.masking[e]=0,this.rotate[e]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>>16&255,t[a+6]=s>>>8&255,t[a+7]=255&s}return t},this.decrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>16&255,t[a+6]=s>>8&255,t[a+7]=255&s}return t};const e=[,,,,];e[0]=[,,,,],e[0][0]=[4,0,13,15,12,14,8],e[0][1]=[5,2,16,18,17,19,10],e[0][2]=[6,3,23,22,21,20,9],e[0][3]=[7,1,26,25,27,24,11],e[1]=[,,,,],e[1][0]=[0,6,21,23,20,22,16],e[1][1]=[1,4,0,2,1,3,18],e[1][2]=[2,5,7,6,5,4,17],e[1][3]=[3,7,10,9,11,8,19],e[2]=[,,,,],e[2][0]=[4,0,13,15,12,14,8],e[2][1]=[5,2,16,18,17,19,10],e[2][2]=[6,3,23,22,21,20,9],e[2][3]=[7,1,26,25,27,24,11],e[3]=[,,,,],e[3][0]=[0,6,21,23,20,22,16],e[3][1]=[1,4,0,2,1,3,18],e[3][2]=[2,5,7,6,5,4,17],e[3][3]=[3,7,10,9,11,8,19];const t=[,,,,];function r(e,t,r){const n=t+e,i=n<>>32-r;return(a[0][i>>>24]^a[1][i>>>16&255])-a[2][i>>>8&255]+a[3][255&i]}function n(e,t,r){const n=t^e,i=n<>>32-r;return a[0][i>>>24]-a[1][i>>>16&255]+a[2][i>>>8&255]^a[3][255&i]}function i(e,t,r){const n=t-e,i=n<>>32-r;return(a[0][i>>>24]+a[1][i>>>16&255]^a[2][i>>>8&255])-a[3][255&i]}t[0]=[,,,,],t[0][0]=[24,25,23,22,18],t[0][1]=[26,27,21,20,22],t[0][2]=[28,29,19,18,25],t[0][3]=[30,31,17,16,28],t[1]=[,,,,],t[1][0]=[3,2,12,13,8],t[1][1]=[1,0,14,15,13],t[1][2]=[7,6,8,9,3],t[1][3]=[5,4,10,11,7],t[2]=[,,,,],t[2][0]=[19,18,28,29,25],t[2][1]=[17,16,30,31,28],t[2][2]=[23,22,24,25,18],t[2][3]=[21,20,26,27,22],t[3]=[,,,,],t[3][0]=[8,9,7,6,3],t[3][1]=[10,11,5,4,7],t[3][2]=[12,13,3,2,8],t[3][3]=[14,15,1,0,13],this.keySchedule=function(r){const n=[,,,,,,,,],i=Array(32);let o;for(let e=0;e<4;e++)o=4*e,n[e]=r[o]<<24|r[o+1]<<16|r[o+2]<<8|r[o+3];const s=[6,7,4,5];let c,u=0;for(let r=0;r<2;r++)for(let r=0;r<4;r++){for(o=0;o<4;o++){const t=e[r][o];c=n[t[1]],c^=a[4][n[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=a[5][n[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=a[6][n[t[4]>>>2]>>>24-8*(3&t[4])&255],c^=a[7][n[t[5]>>>2]>>>24-8*(3&t[5])&255],c^=a[s[o]][n[t[6]>>>2]>>>24-8*(3&t[6])&255],n[t[0]]=c}for(o=0;o<4;o++){const e=t[r][o];c=a[4][n[e[0]>>>2]>>>24-8*(3&e[0])&255],c^=a[5][n[e[1]>>>2]>>>24-8*(3&e[1])&255],c^=a[6][n[e[2]>>>2]>>>24-8*(3&e[2])&255],c^=a[7][n[e[3]>>>2]>>>24-8*(3&e[3])&255],c^=a[4+o][n[e[4]>>>2]>>>24-8*(3&e[4])&255],i[u]=c,u++}}for(let e=0;e<16;e++)this.masking[e]=i[e],this.rotate[e]=31&i[16+e]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function qs(e){this.cast5=new Ts,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Fs.keySize=Fs.prototype.keySize=24,Fs.blockSize=Fs.prototype.blockSize=8,qs.blockSize=qs.prototype.blockSize=8,qs.keySize=qs.prototype.keySize=16;const Os=4294967295;function Ks(e,t){return(e<>>32-t)&Os}function Hs(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Ns(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function Ls(e,t){return e>>>8*t&255}function Gs(e){this.tf=function(){let e=null,t=null,r=-1,n=[],i=[[],[],[],[]];function a(e){return i[0][Ls(e,0)]^i[1][Ls(e,1)]^i[2][Ls(e,2)]^i[3][Ls(e,3)]}function o(e){return i[0][Ls(e,3)]^i[1][Ls(e,0)]^i[2][Ls(e,1)]^i[3][Ls(e,2)]}function s(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Ks(t[2]^r+i+n[4*e+8]&Os,31),t[3]=Ks(t[3],1)^r+2*i+n[4*e+9]&Os,r=a(t[2]),i=o(t[3]),t[0]=Ks(t[0]^r+i+n[4*e+10]&Os,31),t[1]=Ks(t[1],1)^r+2*i+n[4*e+11]&Os}function c(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Ks(t[2],1)^r+i+n[4*e+10]&Os,t[3]=Ks(t[3]^r+2*i+n[4*e+11]&Os,31),r=a(t[2]),i=o(t[3]),t[0]=Ks(t[0],1)^r+i+n[4*e+8]&Os,t[1]=Ks(t[1]^r+2*i+n[4*e+9]&Os,31)}return{name:"twofish",blocksize:16,open:function(t){let r,a,o,s,c;e=t;const u=[],h=[],l=[];let f;const d=[];let p,g,A;const y=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],m=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],b=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],w=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],v=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],I=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],E=[[],[]],B=[[],[],[],[]];function C(e){return e^e>>2^[0,90,180,238][3&e]}function _(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function k(e,t){let r,n,i;for(r=0;r<8;r++)n=t>>>24,t=t<<8&Os|e>>>24,e=e<<8&Os,i=n<<1,128&n&&(i^=333),t^=n^i<<16,i^=n>>>1,1&n&&(i^=166),t^=i<<24|i<<8;return t}function S(e,t){const r=t>>4,n=15&t,i=y[e][r^n],a=m[e][v[n]^I[r]];return w[e][v[a]^I[i]]<<4|b[e][i^a]}function Q(e,t){let r=Ls(e,0),n=Ls(e,1),i=Ls(e,2),a=Ls(e,3);switch(f){case 4:r=E[1][r]^Ls(t[3],0),n=E[0][n]^Ls(t[3],1),i=E[0][i]^Ls(t[3],2),a=E[1][a]^Ls(t[3],3);case 3:r=E[1][r]^Ls(t[2],0),n=E[1][n]^Ls(t[2],1),i=E[0][i]^Ls(t[2],2),a=E[0][a]^Ls(t[2],3);case 2:r=E[0][E[0][r]^Ls(t[1],0)]^Ls(t[0],0),n=E[0][E[1][n]^Ls(t[1],1)]^Ls(t[0],1),i=E[1][E[0][i]^Ls(t[1],2)]^Ls(t[0],2),a=E[1][E[1][a]^Ls(t[1],3)]^Ls(t[0],3)}return B[0][r]^B[1][n]^B[2][i]^B[3][a]}for(e=e.slice(0,32),r=e.length;16!==r&&24!==r&&32!==r;)e[r++]=0;for(r=0;r>2]=Hs(e,r);for(r=0;r<256;r++)E[0][r]=S(0,r),E[1][r]=S(1,r);for(r=0;r<256;r++)p=E[1][r],g=C(p),A=_(p),B[0][r]=p+(g<<8)+(A<<16)+(A<<24),B[2][r]=g+(A<<8)+(p<<16)+(A<<24),p=E[0][r],g=C(p),A=_(p),B[1][r]=A+(A<<8)+(g<<16)+(p<<24),B[3][r]=g+(p<<8)+(A<<16)+(g<<24);for(f=l.length/2,r=0;r=0;e--)c(e,a);Ns(t,r,a[2]^n[0]),Ns(t,r+4,a[3]^n[1]),Ns(t,r+8,a[0]^n[2]),Ns(t,r+12,a[1]^n[3]),r+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function js(){}function zs(e){this.bf=new js,this.bf.init(e),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Gs.keySize=Gs.prototype.keySize=32,Gs.blockSize=Gs.prototype.blockSize=16,js.prototype.BLOCKSIZE=8,js.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],js.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],js.prototype.NN=16,js.prototype._clean=function(e){return e<0&&(e=2147483648+(2147483647&e)),e},js.prototype._F=function(e){let t;const r=255&e,n=255&(e>>>=8),i=255&(e>>>=8),a=255&(e>>>=8);return t=this.sboxes[0][a]+this.sboxes[1][i],t^=this.sboxes[2][n],t+=this.sboxes[3][r],t},js.prototype._encryptBlock=function(e){let t,r=e[0],n=e[1];for(t=0;t>>24-8*t&255,i[t+n]=r[1]>>>24-8*t&255;return i},js.prototype._decryptBlock=function(e){let t,r=e[0],n=e[1];for(t=this.NN+1;t>1;--t){r^=this.parray[t],n=this._F(r)^n;const e=r;r=n,n=e}r^=this.parray[1],n^=this.parray[0],e[0]=this._clean(n),e[1]=this._clean(r)},js.prototype.init=function(e){let t,r=0;for(this.parray=[],t=0;t=e.length&&(r=0);this.parray[t]=this.PARRAY[t]^n}for(this.sboxes=[],t=0;t<4;++t)for(this.sboxes[t]=[],r=0;r<256;++r)this.sboxes[t][r]=this.SBOXES[t][r];const n=[0,0];for(t=0;t>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=t+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=r+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=c+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=u+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=h+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=l+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=f+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=d+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=p+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=g+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=A+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=y+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=m+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=b+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=w+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=m^d^r^e;S=_<<1|_>>>31;k=S+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=b^p^c^t;Q=_<<1|_>>>31;k=Q+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=w^g^u^r;x=_<<1|_>>>31;k=x+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=S^A^h^c;P=_<<1|_>>>31;k=P+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Q^y^l^u;M=_<<1|_>>>31;k=M+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=x^m^f^h;U=_<<1|_>>>31;k=U+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=P^b^d^l;D=_<<1|_>>>31;k=D+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=M^w^p^f;R=_<<1|_>>>31;k=R+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=U^S^g^d;F=_<<1|_>>>31;k=F+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=D^Q^A^p;T=_<<1|_>>>31;k=T+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=R^x^y^g;q=_<<1|_>>>31;k=q+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=F^P^m^A;O=_<<1|_>>>31;k=O+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=T^M^b^y;K=_<<1|_>>>31;k=K+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=q^U^w^m;H=_<<1|_>>>31;k=H+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=O^D^S^b;N=_<<1|_>>>31;k=N+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=K^R^Q^w;L=_<<1|_>>>31;k=L+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=H^F^x^S;G=_<<1|_>>>31;k=G+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=N^T^P^Q;j=_<<1|_>>>31;k=j+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=L^q^M^x;z=_<<1|_>>>31;k=z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=G^O^U^P;W=_<<1|_>>>31;k=W+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=j^K^D^M;Z=_<<1|_>>>31;k=Z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=z^H^R^U;J=_<<1|_>>>31;k=J+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=W^N^F^D;V=_<<1|_>>>31;k=V+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Z^L^T^R;Y=_<<1|_>>>31;k=Y+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=J^G^q^F;$=_<<1|_>>>31;k=$+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=V^j^O^T;X=_<<1|_>>>31;k=X+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Y^z^K^q;ee=_<<1|_>>>31;k=ee+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=$^W^H^O;te=_<<1|_>>>31;k=te+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=X^Z^N^K;re=_<<1|_>>>31;k=re+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ee^J^L^H;ne=_<<1|_>>>31;k=ne+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=te^V^G^N;ie=_<<1|_>>>31;k=ie+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=re^Y^j^L;ae=_<<1|_>>>31;k=ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ne^$^z^G;oe=_<<1|_>>>31;k=oe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ie^X^W^j;se=_<<1|_>>>31;k=se+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ae^ee^Z^z;ce=_<<1|_>>>31;k=ce+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=oe^te^J^W;ue=_<<1|_>>>31;k=ue+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=se^re^V^Z;he=_<<1|_>>>31;k=he+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ce^ne^Y^J;le=_<<1|_>>>31;k=le+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ue^ie^$^V;fe=_<<1|_>>>31;k=fe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=he^ae^X^Y;de=_<<1|_>>>31;k=de+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=le^oe^ee^$;pe=_<<1|_>>>31;k=pe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=fe^se^te^X;ge=_<<1|_>>>31;k=ge+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=de^ce^re^ee;Ae=_<<1|_>>>31;k=Ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=pe^ue^ne^te;ye=_<<1|_>>>31;k=ye+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ge^he^ie^re;me=_<<1|_>>>31;k=me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ae^le^ae^ne;be=_<<1|_>>>31;k=be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ye^fe^oe^ie;we=_<<1|_>>>31;k=we+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=me^de^se^ae;ve=_<<1|_>>>31;k=ve+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=be^pe^ce^oe;Ie=_<<1|_>>>31;k=Ie+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=we^ge^ue^se;Ee=_<<1|_>>>31;k=Ee+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ve^Ae^he^ce;Be=_<<1|_>>>31;k=Be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ie^ye^le^ue;Ce=_<<1|_>>>31;k=Ce+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ee^me^fe^he;_e=_<<1|_>>>31;k=_e+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Be^be^de^le;ke=_<<1|_>>>31;k=ke+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ce^we^pe^fe;Se=_<<1|_>>>31;k=Se+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=_e^ve^ge^de;Qe=_<<1|_>>>31;k=Qe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ke^Ie^Ae^pe;xe=_<<1|_>>>31;k=xe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Se^Ee^ye^ge;Pe=_<<1|_>>>31;k=Pe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Qe^Be^me^Ae;Me=_<<1|_>>>31;k=Me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=xe^Ce^be^ye;Ue=_<<1|_>>>31;k=Ue+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Pe^_e^we^me;De=_<<1|_>>>31;k=De+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Me^ke^ve^be;Re=_<<1|_>>>31;k=Re+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ue^Se^Ie^we;Fe=_<<1|_>>>31;k=Fe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=De^Qe^Ee^ve;Te=_<<1|_>>>31;k=Te+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;n=n+v|0;i=i+I|0;a=a+E|0;o=o+B|0;s=s+C|0}function I(e){e=e|0;v(w[e|0]<<24|w[e|1]<<16|w[e|2]<<8|w[e|3],w[e|4]<<24|w[e|5]<<16|w[e|6]<<8|w[e|7],w[e|8]<<24|w[e|9]<<16|w[e|10]<<8|w[e|11],w[e|12]<<24|w[e|13]<<16|w[e|14]<<8|w[e|15],w[e|16]<<24|w[e|17]<<16|w[e|18]<<8|w[e|19],w[e|20]<<24|w[e|21]<<16|w[e|22]<<8|w[e|23],w[e|24]<<24|w[e|25]<<16|w[e|26]<<8|w[e|27],w[e|28]<<24|w[e|29]<<16|w[e|30]<<8|w[e|31],w[e|32]<<24|w[e|33]<<16|w[e|34]<<8|w[e|35],w[e|36]<<24|w[e|37]<<16|w[e|38]<<8|w[e|39],w[e|40]<<24|w[e|41]<<16|w[e|42]<<8|w[e|43],w[e|44]<<24|w[e|45]<<16|w[e|46]<<8|w[e|47],w[e|48]<<24|w[e|49]<<16|w[e|50]<<8|w[e|51],w[e|52]<<24|w[e|53]<<16|w[e|54]<<8|w[e|55],w[e|56]<<24|w[e|57]<<16|w[e|58]<<8|w[e|59],w[e|60]<<24|w[e|61]<<16|w[e|62]<<8|w[e|63])}function E(e){e=e|0;w[e|0]=n>>>24;w[e|1]=n>>>16&255;w[e|2]=n>>>8&255;w[e|3]=n&255;w[e|4]=i>>>24;w[e|5]=i>>>16&255;w[e|6]=i>>>8&255;w[e|7]=i&255;w[e|8]=a>>>24;w[e|9]=a>>>16&255;w[e|10]=a>>>8&255;w[e|11]=a&255;w[e|12]=o>>>24;w[e|13]=o>>>16&255;w[e|14]=o>>>8&255;w[e|15]=o&255;w[e|16]=s>>>24;w[e|17]=s>>>16&255;w[e|18]=s>>>8&255;w[e|19]=s&255}function B(){n=0x67452301;i=0xefcdab89;a=0x98badcfe;o=0x10325476;s=0xc3d2e1f0;c=u=0}function C(e,t,r,h,l,f,d){e=e|0;t=t|0;r=r|0;h=h|0;l=l|0;f=f|0;d=d|0;n=e;i=t;a=r;o=h;s=l;c=f;u=d}function _(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){I(e);e=e+64|0;t=t-64|0;r=r+64|0}c=c+r|0;if(c>>>0>>0)u=u+1|0;return r|0}function k(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=_(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;c=c+t|0;if(c>>>0>>0)u=u+1|0;w[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)w[e|i]=0x00;I(e);t=0;w[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)w[e|i]=0;w[e|56]=u>>>21&255;w[e|57]=u>>>13&255;w[e|58]=u>>>5&255;w[e|59]=u<<3&255|c>>>29;w[e|60]=c>>>21&255;w[e|61]=c>>>13&255;w[e|62]=c>>>5&255;w[e|63]=c<<3&255;I(e);if(~r)E(r);return n|0}function S(){n=h;i=l;a=f;o=d;s=p;c=64;u=0}function Q(){n=g;i=A;a=y;o=m;s=b;c=64;u=0}function x(e,t,r,w,I,E,C,_,k,S,Q,x,P,M,U,D){e=e|0;t=t|0;r=r|0;w=w|0;I=I|0;E=E|0;C=C|0;_=_|0;k=k|0;S=S|0;Q=Q|0;x=x|0;P=P|0;M=M|0;U=U|0;D=D|0;B();v(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,w^0x5c5c5c5c,I^0x5c5c5c5c,E^0x5c5c5c5c,C^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,S^0x5c5c5c5c,Q^0x5c5c5c5c,x^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,U^0x5c5c5c5c,D^0x5c5c5c5c);g=n;A=i;y=a;m=o;b=s;B();v(e^0x36363636,t^0x36363636,r^0x36363636,w^0x36363636,I^0x36363636,E^0x36363636,C^0x36363636,_^0x36363636,k^0x36363636,S^0x36363636,Q^0x36363636,x^0x36363636,P^0x36363636,M^0x36363636,U^0x36363636,D^0x36363636);h=n;l=i;f=a;d=o;p=s;c=64;u=0}function P(e,t,r){e=e|0;t=t|0;r=r|0;var c=0,u=0,h=0,l=0,f=0,d=0;if(e&63)return-1;if(~r)if(r&31)return-1;d=k(e,t,-1)|0;c=n,u=i,h=a,l=o,f=s;Q();v(c,u,h,l,f,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)E(r);return d|0}function M(e,t,r,c,u){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;var h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~u)if(u&31)return-1;w[e+t|0]=r>>>24;w[e+t+1|0]=r>>>16&255;w[e+t+2|0]=r>>>8&255;w[e+t+3|0]=r&255;P(e,t+4|0,-1)|0;h=g=n,l=A=i,f=y=a,d=m=o,p=b=s;c=c-1|0;while((c|0)>0){S();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;Q();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;h=h^n;l=l^i;f=f^a;d=d^o;p=p^s;c=c-1|0}n=h;i=l;a=f;o=d;s=p;if(~u)E(u);return 0}return{reset:B,init:C,process:_,finish:k,hmac_reset:S,hmac_init:x,hmac_finish:P,pbkdf2_generate_block:M}};class $s{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(null!==this.result)throw new _s("state must be reset before processing new data");const{asm:t,heap:r}=this.acquire_asm();let n=this.pos,i=this.len,a=0,o=e.length,s=0;for(;o>0;)s=Bs(r,n+i,e,a,o),i+=s,a+=s,o-=s,s=t.process(n,i),n+=s,i-=s,i||(n=0);return this.pos=n,this.len=i,this}finish(){if(null!==this.result)throw new _s("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const Xs=[],ec=[];class tc extends $s{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Xs.pop()||Es(),this.asm=ec.pop()||Ys({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Xs.push(this.heap),ec.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new tc).process(e).finish().result}}tc.NAME="sha1",tc.heap_pool=[],tc.asm_pool=[],tc.asm_function=Ys;const rc=[],nc=[];class ic extends $s{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=rc.pop()||Es(),this.asm=nc.pop()||function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=new e.Uint8Array(r);function x(e,t,r,l,f,d,p,g,A,y,m,b,w,v,I,E){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;w=w|0;v=v|0;I=I|0;E=E|0;var B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0;B=n;C=i;_=a;k=o;S=s;Q=c;x=u;P=h;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x428a2f98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x71374491|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb5c0fbcf|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xe9b5dba5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x3956c25b|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x59f111f1|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x923f82a4|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xab1c5ed5|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xd807aa98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x12835b01|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x243185be|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x550c7dc3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x72be5d74|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x80deb1fe|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x9bdc06a7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc19bf174|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xe49b69c1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xefbe4786|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x0fc19dc6|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x240ca1cc|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x2de92c6f|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4a7484aa|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5cb0a9dc|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x76f988da|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x983e5152|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa831c66d|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb00327c8|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xbf597fc7|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xc6e00bf3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd5a79147|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x06ca6351|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x14292967|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x27b70a85|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x2e1b2138|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x4d2c6dfc|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x53380d13|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x650a7354|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x766a0abb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x81c2c92e|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x92722c85|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xa2bfe8a1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa81a664b|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xc24b8b70|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xc76c51a3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xd192e819|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd6990624|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xf40e3585|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x106aa070|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x19a4c116|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x1e376c08|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x2748774c|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x34b0bcb5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x391c0cb3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4ed8aa4a|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5b9cca4f|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x682e6ff3|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x748f82ee|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x78a5636f|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x84c87814|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x8cc70208|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x90befffa|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xa4506ceb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xbef9a3f7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc67178f2|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;n=n+B|0;i=i+C|0;a=a+_|0;o=o+k|0;s=s+S|0;c=c+Q|0;u=u+x|0;h=h+P|0}function P(e){e=e|0;x(Q[e|0]<<24|Q[e|1]<<16|Q[e|2]<<8|Q[e|3],Q[e|4]<<24|Q[e|5]<<16|Q[e|6]<<8|Q[e|7],Q[e|8]<<24|Q[e|9]<<16|Q[e|10]<<8|Q[e|11],Q[e|12]<<24|Q[e|13]<<16|Q[e|14]<<8|Q[e|15],Q[e|16]<<24|Q[e|17]<<16|Q[e|18]<<8|Q[e|19],Q[e|20]<<24|Q[e|21]<<16|Q[e|22]<<8|Q[e|23],Q[e|24]<<24|Q[e|25]<<16|Q[e|26]<<8|Q[e|27],Q[e|28]<<24|Q[e|29]<<16|Q[e|30]<<8|Q[e|31],Q[e|32]<<24|Q[e|33]<<16|Q[e|34]<<8|Q[e|35],Q[e|36]<<24|Q[e|37]<<16|Q[e|38]<<8|Q[e|39],Q[e|40]<<24|Q[e|41]<<16|Q[e|42]<<8|Q[e|43],Q[e|44]<<24|Q[e|45]<<16|Q[e|46]<<8|Q[e|47],Q[e|48]<<24|Q[e|49]<<16|Q[e|50]<<8|Q[e|51],Q[e|52]<<24|Q[e|53]<<16|Q[e|54]<<8|Q[e|55],Q[e|56]<<24|Q[e|57]<<16|Q[e|58]<<8|Q[e|59],Q[e|60]<<24|Q[e|61]<<16|Q[e|62]<<8|Q[e|63])}function M(e){e=e|0;Q[e|0]=n>>>24;Q[e|1]=n>>>16&255;Q[e|2]=n>>>8&255;Q[e|3]=n&255;Q[e|4]=i>>>24;Q[e|5]=i>>>16&255;Q[e|6]=i>>>8&255;Q[e|7]=i&255;Q[e|8]=a>>>24;Q[e|9]=a>>>16&255;Q[e|10]=a>>>8&255;Q[e|11]=a&255;Q[e|12]=o>>>24;Q[e|13]=o>>>16&255;Q[e|14]=o>>>8&255;Q[e|15]=o&255;Q[e|16]=s>>>24;Q[e|17]=s>>>16&255;Q[e|18]=s>>>8&255;Q[e|19]=s&255;Q[e|20]=c>>>24;Q[e|21]=c>>>16&255;Q[e|22]=c>>>8&255;Q[e|23]=c&255;Q[e|24]=u>>>24;Q[e|25]=u>>>16&255;Q[e|26]=u>>>8&255;Q[e|27]=u&255;Q[e|28]=h>>>24;Q[e|29]=h>>>16&255;Q[e|30]=h>>>8&255;Q[e|31]=h&255}function U(){n=0x6a09e667;i=0xbb67ae85;a=0x3c6ef372;o=0xa54ff53a;s=0x510e527f;c=0x9b05688c;u=0x1f83d9ab;h=0x5be0cd19;l=f=0}function D(e,t,r,d,p,g,A,y,m,b){e=e|0;t=t|0;r=r|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;n=e;i=t;a=r;o=d;s=p;c=g;u=A;h=y;l=m;f=b}function R(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){P(e);e=e+64|0;t=t-64|0;r=r+64|0}l=l+r|0;if(l>>>0>>0)f=f+1|0;return r|0}function F(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=R(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;l=l+t|0;if(l>>>0>>0)f=f+1|0;Q[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)Q[e|i]=0x00;P(e);t=0;Q[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)Q[e|i]=0;Q[e|56]=f>>>21&255;Q[e|57]=f>>>13&255;Q[e|58]=f>>>5&255;Q[e|59]=f<<3&255|l>>>29;Q[e|60]=l>>>21&255;Q[e|61]=l>>>13&255;Q[e|62]=l>>>5&255;Q[e|63]=l<<3&255;P(e);if(~r)M(r);return n|0}function T(){n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;l=64;f=0}function q(){n=v;i=I;a=E;o=B;s=C;c=_;u=k;h=S;l=64;f=0}function O(e,t,r,Q,P,M,D,R,F,T,q,O,K,H,N,L){e=e|0;t=t|0;r=r|0;Q=Q|0;P=P|0;M=M|0;D=D|0;R=R|0;F=F|0;T=T|0;q=q|0;O=O|0;K=K|0;H=H|0;N=N|0;L=L|0;U();x(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,Q^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,D^0x5c5c5c5c,R^0x5c5c5c5c,F^0x5c5c5c5c,T^0x5c5c5c5c,q^0x5c5c5c5c,O^0x5c5c5c5c,K^0x5c5c5c5c,H^0x5c5c5c5c,N^0x5c5c5c5c,L^0x5c5c5c5c);v=n;I=i;E=a;B=o;C=s;_=c;k=u;S=h;U();x(e^0x36363636,t^0x36363636,r^0x36363636,Q^0x36363636,P^0x36363636,M^0x36363636,D^0x36363636,R^0x36363636,F^0x36363636,T^0x36363636,q^0x36363636,O^0x36363636,K^0x36363636,H^0x36363636,N^0x36363636,L^0x36363636);d=n;p=i;g=a;A=o;y=s;m=c;b=u;w=h;l=64;f=0}function K(e,t,r){e=e|0;t=t|0;r=r|0;var l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~r)if(r&31)return-1;b=F(e,t,-1)|0;l=n,f=i,d=a,p=o,g=s,A=c,y=u,m=h;q();x(l,f,d,p,g,A,y,m,0x80000000,0,0,0,0,0,0,768);if(~r)M(r);return b|0}function H(e,t,r,l,f){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;var d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0;if(e&63)return-1;if(~f)if(f&31)return-1;Q[e+t|0]=r>>>24;Q[e+t+1|0]=r>>>16&255;Q[e+t+2|0]=r>>>8&255;Q[e+t+3|0]=r&255;K(e,t+4|0,-1)|0;d=v=n,p=I=i,g=E=a,A=B=o,y=C=s,m=_=c,b=k=u,w=S=h;l=l-1|0;while((l|0)>0){T();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;q();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;d=d^n;p=p^i;g=g^a;A=A^o;y=y^s;m=m^c;b=b^u;w=w^h;l=l-1|0}n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;if(~f)M(f);return 0}return{reset:U,init:D,process:R,finish:F,hmac_reset:T,hmac_init:O,hmac_finish:K,pbkdf2_generate_block:H}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(rc.push(this.heap),nc.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new ic).process(e).finish().result}}ic.NAME="sha256";var ac=oc;function oc(e,t){if(!e)throw Error(t||"Assertion failed")}oc.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var sc=void 0!==ho?ho:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cc(e,t){return e(t={exports:{}},t.exports),t.exports}function uc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var hc=cc((function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}));function lc(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function fc(e){return 1===e.length?"0"+e:e}function dc(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var pc={inherits:hc,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>0}return a},split32:function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},sum64_hi:function(e,t,r,n){return(t+n>>>0>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,a,o,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},sum64_5_hi:function(e,t,r,n,i,a,o,s,c,u){var h=0,l=t;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,r,n,i,a,o,s,c,u){return t+n+a+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function gc(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Ac=gc;gc.prototype.update=function(e,t){if(e=pc.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=pc.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},Sc=function(e){return mc(e,17)^mc(e,19)^e>>>10},Qc=pc.sum32,xc=pc.sum32_4,Pc=pc.sum32_5,Mc=Ec,Uc=Bc,Dc=Cc,Rc=_c,Fc=kc,Tc=Sc,qc=yc.BlockHash,Oc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Kc(){if(!(this instanceof Kc))return new Kc;qc.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Oc,this.W=Array(64)}pc.inherits(Kc,qc);var Hc=Kc;function Nc(){if(!(this instanceof Nc))return new Nc;Hc.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Kc.blockSize=512,Kc.outSize=256,Kc.hmacStrength=192,Kc.padLength=64,Kc.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>32-i,r)}function Fu(e,t,r,n,i,a,o){return Ru(t&r|~t&n,e,t,i,a,o)}function Tu(e,t,r,n,i,a,o){return Ru(t&n|r&~n,e,t,i,a,o)}function qu(e,t,r,n,i,a,o){return Ru(t^r^n,e,t,i,a,o)}function Ou(e,t,r,n,i,a,o){return Ru(r^(t|~n),e,t,i,a,o)}function Ku(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}const Hu="0123456789abcdef".split("");function Nu(e){let t="",r=0;for(;r<4;r++)t+=Hu[e>>8*r+4&15]+Hu[e>>8*r&15];return t}function Lu(e,t){return e+t&4294967295}const Gu=rs.getWebCrypto(),ju=rs.getNodeCrypto(),zu=ju&&ju.getHashes();function Wu(e){if(ju&&zu.includes(e))return async function(t){const r=ju.createHash(e);return Go(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function Zu(e,t){return async function(r,n=hs){if(yo(r)&&(r=await Vo(r)),!rs.isStream(r)&&Gu&&t&&r.length>=n.minBytesForWebCrypto)return new Uint8Array(await Gu.digest(t,r));const i=e();return Go(r,(e=>{i.update(e)}),(()=>new Uint8Array(i.digest())))}}function Ju(e,t){return async function(r,n=hs){if(yo(r)&&(r=await Vo(r)),rs.isStream(r)){const t=new e;return Go(r,(e=>{t.process(e)}),(()=>t.finish().result))}return Gu&&t&&r.length>=n.minBytesForWebCrypto?new Uint8Array(await Gu.digest(t,r)):e.bytes(r)}}const Vu={md5:Wu("md5")||async function(e){const t=function(e){const t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)Du(r,Ku(e.substring(n-64,n)));e=e.substring(n-64);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n>2]|=e.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(Du(r,i),n=0;n<16;n++)i[n]=0;return i[14]=8*t,Du(r,i),r}(rs.uint8ArrayToString(e));return rs.hexToUint8Array(function(e){for(let t=0;tnew Uint8Array(a.update(e))))}(e,t,r,n);if(rs.isAES(e))return function(e,t,r,n,i){if(rs.getWebCrypto()&&24!==t.length&&!rs.isStream(r)&&r.length>=3e3*i.minBytesForWebCrypto)return async function(e,t,r,n){const i="AES-CBC",a=await eh.importKey("raw",t,{name:i},!1,["encrypt"]),{blockSize:o}=Xu(e),s=rs.concatUint8Array([new Uint8Array(o),r]),c=new Uint8Array(await eh.encrypt({name:i,iv:n},a,s)).subarray(0,r.length);return function(e,t){for(let r=0;ra.aes.AES_Encrypt_process(e)),(()=>a.aes.AES_Encrypt_finish()))}(e,t,r,n,i);const o=new(Xu(e))(t),s=o.blockSize,c=n.slice();let u=new Uint8Array;const h=e=>{e&&(u=rs.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,n=0;for(;e?u.length>=s:u.length;){const e=o.encrypt(c);for(r=0;rnew Uint8Array(a.update(e))))}(e,t,r,n);if(rs.isAES(e))return function(e,t,r,n){if(rs.isStream(r)){const e=new $u(t,n);return Go(r,(t=>e.aes.AES_Decrypt_process(t)),(()=>e.aes.AES_Decrypt_finish()))}return $u.decrypt(r,t,n)}(0,t,r,n);const a=new(Xu(e))(t),o=a.blockSize;let s=n,c=new Uint8Array;const u=e=>{e&&(c=rs.concatUint8Array([c,e]));const t=new Uint8Array(c.length);let r,n=0;for(;e?c.length>=o:c.length;){const e=a.encrypt(s);for(s=c.subarray(0,o),r=0;r48)throw new ks("illegal counter size");let e=Math.pow(2,r)-1;n.set_mask(0,0,e/4294967296|0,0|e)}else r=48,n.set_mask(0,0,65535,4294967295);if(void 0===e)throw Error("nonce is required");{let t=e.length;if(!t||t>16)throw new ks("illegal nonce size");let r=new DataView(new ArrayBuffer(16));new Uint8Array(r.buffer).set(e),n.set_nonce(r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12))}if(void 0!==t){if(t<0||t>=Math.pow(2,r))throw new ks("illegal counter value");n.set_counter(0,0,t/4294967296|0,0|t)}}}class oh{static encrypt(e,t,r=!0,n){return new oh(t,n,r).encrypt(e)}static decrypt(e,t,r=!0,n){return new oh(t,n,r).decrypt(e)}constructor(e,t,r=!0,n){this.aes=n||new Ps(e,t,r,"CBC")}encrypt(e){return Cs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Cs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const sh=rs.getWebCrypto(),ch=rs.getNodeCrypto(),uh=16;function hh(e,t){const r=e.length-uh;for(let n=0;n>3),17+(u>>3)),8-(7&u)).subarray(1),d=new Uint8Array(Bh),p=new Uint8Array(t.length+Ch);let g,A=0;for(g=0;g16)throw new ks("illegal tagSize value");const s=t.length||0,c=new Uint8Array(16);12!==s?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=s>>>29,o[12]=s>>>21&255,o[13]=s>>>13&255,o[14]=s>>>5&255,o[15]=s<<3&255,a.mac(vs.MAC.GCM,vs.HEAP_DATA,16),a.get_iv(vs.HEAP_DATA),a.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const u=new DataView(c.buffer);if(this.gamma0=u.getUint32(12),a.set_nonce(u.getUint32(0),u.getUint32(4),u.getUint32(8),0),a.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>Mh)throw new ks("illegal adata length");r.length?(this.adata=r,this._gcm_mac_process(r)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");a.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,r,n,i){return new Uh(t,r,n,i).encrypt(e)}static decrypt(e,t,r,n,i){return new Uh(t,r,n,i).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.aes.pos,s=this.aes.len,c=0,u=s+r&-16,h=0;if((a-1<<4)+s+r>Mh)throw new RangeError("counter overflow");const l=new Uint8Array(u);for(;r>0;)h=Bs(i,o+s,e,t,r),s+=h,t+=h,r-=h,h=n.cipher(vs.ENC.CTR,vs.HEAP_DATA+o,s),h=n.mac(vs.MAC.GCM,vs.HEAP_DATA+o,h),h&&l.set(i.subarray(o,o+h),c),a+=h>>>4,c+=h,h>>29,t[4]=u>>>21,t[5]=u>>>13&255,t[6]=u>>>5&255,t[7]=u<<3&255,t[8]=t[9]=t[10]=0,t[11]=h>>>29,t[12]=h>>>21&255,t[13]=h>>>13&255,t[14]=h>>>5&255,t[15]=h<<3&255,e.mac(vs.MAC.GCM,vs.HEAP_DATA,16),e.get_iv(vs.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(vs.ENC.CTR,vs.HEAP_DATA,16),s.set(t.subarray(0,n),o),this.counter=1,this.aes.pos=0,this.aes.len=0,s}AES_GCM_Decrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.tagSize,s=this.aes.pos,c=this.aes.len,u=0,h=c+r>o?c+r-o&-16:0,l=c+r-h,f=0;if((a-1<<4)+c+r>Mh)throw new RangeError("counter overflow");const d=new Uint8Array(h);for(;r>l;)f=Bs(i,s+c,e,t,r-l),c+=f,t+=f,r-=f,f=n.mac(vs.MAC.GCM,vs.HEAP_DATA+s,f),f=n.cipher(vs.DEC.CTR,vs.HEAP_DATA+s,f),f&&d.set(i.subarray(s,s+f),u),a+=f>>>4,u+=f,s=0,c=0;return r>0&&(c+=Bs(i,0,e,t,r)),this.counter=a,this.aes.pos=s,this.aes.len=c,d}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.tagSize,n=this.adata,i=this.counter,a=this.aes.pos,o=this.aes.len,s=o-r;if(o>>29,t[4]=l>>>21,t[5]=l>>>13&255,t[6]=l>>>5&255,t[7]=l<<3&255,t[8]=t[9]=t[10]=0,t[11]=f>>>29,t[12]=f>>>21&255,t[13]=f>>>13&255,t[14]=f>>>5&255,t[15]=f<<3&255,e.mac(vs.MAC.GCM,vs.HEAP_DATA,16),e.get_iv(vs.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(vs.ENC.CTR,vs.HEAP_DATA,16);let d=0;for(let e=0;e0;){for(a=Bs(r,0,e,n,i),n+=a,i-=a;15&a;)r[a++]=0;t.mac(vs.MAC.GCM,vs.HEAP_DATA,a)}}}const Dh=rs.getWebCrypto(),Rh=rs.getNodeCrypto(),Fh=rs.getNodeBuffer(),Th=16,qh="AES-GCM";async function Oh(e,t){if(e!==es.symmetric.aes128&&e!==es.symmetric.aes192&&e!==es.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(rs.getNodeCrypto())return{encrypt:async function(e,r,n=new Uint8Array){const i=new Rh.createCipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n);const a=Fh.concat([i.update(e),i.final(),i.getAuthTag()]);return new Uint8Array(a)},decrypt:async function(e,r,n=new Uint8Array){const i=new Rh.createDecipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n),i.setAuthTag(e.slice(e.length-Th,e.length));const a=Fh.concat([i.update(e.slice(0,e.length-Th)),i.final()]);return new Uint8Array(a)}};if(rs.getWebCrypto()&&24!==t.length){const e=await Dh.importKey("raw",t,{name:qh},!1,["encrypt","decrypt"]);return{encrypt:async function(r,n,i=new Uint8Array){if(!r.length)return Uh.encrypt(r,t,n,i);const a=await Dh.encrypt({name:qh,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)},decrypt:async function(r,n,i=new Uint8Array){if(r.length===Th)return Uh.decrypt(r,t,n,i);const a=await Dh.decrypt({name:qh,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)}}}return{encrypt:async function(e,r,n){return Uh.encrypt(e,t,r,n)},decrypt:async function(e,r,n){return Uh.decrypt(e,t,r,n)}}}Oh.getNonce=function(e,t){const r=e.slice();for(let e=0;e>>8)-1}(e,t,r,n)}function d(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function p(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function g(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function A(e,r){var n,i,a,o=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(p(s),p(s),p(s),i=0;i<2;i++){for(o[0]=s[0]-65517,n=1;n<15;n++)o[n]=s[n]-65535-(o[n-1]>>16&1),o[n-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,g(s,o,1-a)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function y(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return A(r,e),A(n,t),f(r,0,n,0)}function m(e){var t=new Uint8Array(32);return A(t,e),1&t[0]}function b(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function w(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function v(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function I(e,t,r){var n,i,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0,M=0,U=0,D=0,R=0,F=r[0],T=r[1],q=r[2],O=r[3],K=r[4],H=r[5],N=r[6],L=r[7],G=r[8],j=r[9],z=r[10],W=r[11],Z=r[12],J=r[13],V=r[14],Y=r[15];a+=(n=t[0])*F,o+=n*T,s+=n*q,c+=n*O,u+=n*K,h+=n*H,l+=n*N,f+=n*L,d+=n*G,p+=n*j,g+=n*z,A+=n*W,y+=n*Z,m+=n*J,b+=n*V,w+=n*Y,o+=(n=t[1])*F,s+=n*T,c+=n*q,u+=n*O,h+=n*K,l+=n*H,f+=n*N,d+=n*L,p+=n*G,g+=n*j,A+=n*z,y+=n*W,m+=n*Z,b+=n*J,w+=n*V,v+=n*Y,s+=(n=t[2])*F,c+=n*T,u+=n*q,h+=n*O,l+=n*K,f+=n*H,d+=n*N,p+=n*L,g+=n*G,A+=n*j,y+=n*z,m+=n*W,b+=n*Z,w+=n*J,v+=n*V,I+=n*Y,c+=(n=t[3])*F,u+=n*T,h+=n*q,l+=n*O,f+=n*K,d+=n*H,p+=n*N,g+=n*L,A+=n*G,y+=n*j,m+=n*z,b+=n*W,w+=n*Z,v+=n*J,I+=n*V,E+=n*Y,u+=(n=t[4])*F,h+=n*T,l+=n*q,f+=n*O,d+=n*K,p+=n*H,g+=n*N,A+=n*L,y+=n*G,m+=n*j,b+=n*z,w+=n*W,v+=n*Z,I+=n*J,E+=n*V,B+=n*Y,h+=(n=t[5])*F,l+=n*T,f+=n*q,d+=n*O,p+=n*K,g+=n*H,A+=n*N,y+=n*L,m+=n*G,b+=n*j,w+=n*z,v+=n*W,I+=n*Z,E+=n*J,B+=n*V,C+=n*Y,l+=(n=t[6])*F,f+=n*T,d+=n*q,p+=n*O,g+=n*K,A+=n*H,y+=n*N,m+=n*L,b+=n*G,w+=n*j,v+=n*z,I+=n*W,E+=n*Z,B+=n*J,C+=n*V,_+=n*Y,f+=(n=t[7])*F,d+=n*T,p+=n*q,g+=n*O,A+=n*K,y+=n*H,m+=n*N,b+=n*L,w+=n*G,v+=n*j,I+=n*z,E+=n*W,B+=n*Z,C+=n*J,_+=n*V,k+=n*Y,d+=(n=t[8])*F,p+=n*T,g+=n*q,A+=n*O,y+=n*K,m+=n*H,b+=n*N,w+=n*L,v+=n*G,I+=n*j,E+=n*z,B+=n*W,C+=n*Z,_+=n*J,k+=n*V,S+=n*Y,p+=(n=t[9])*F,g+=n*T,A+=n*q,y+=n*O,m+=n*K,b+=n*H,w+=n*N,v+=n*L,I+=n*G,E+=n*j,B+=n*z,C+=n*W,_+=n*Z,k+=n*J,S+=n*V,Q+=n*Y,g+=(n=t[10])*F,A+=n*T,y+=n*q,m+=n*O,b+=n*K,w+=n*H,v+=n*N,I+=n*L,E+=n*G,B+=n*j,C+=n*z,_+=n*W,k+=n*Z,S+=n*J,Q+=n*V,x+=n*Y,A+=(n=t[11])*F,y+=n*T,m+=n*q,b+=n*O,w+=n*K,v+=n*H,I+=n*N,E+=n*L,B+=n*G,C+=n*j,_+=n*z,k+=n*W,S+=n*Z,Q+=n*J,x+=n*V,P+=n*Y,y+=(n=t[12])*F,m+=n*T,b+=n*q,w+=n*O,v+=n*K,I+=n*H,E+=n*N,B+=n*L,C+=n*G,_+=n*j,k+=n*z,S+=n*W,Q+=n*Z,x+=n*J,P+=n*V,M+=n*Y,m+=(n=t[13])*F,b+=n*T,w+=n*q,v+=n*O,I+=n*K,E+=n*H,B+=n*N,C+=n*L,_+=n*G,k+=n*j,S+=n*z,Q+=n*W,x+=n*Z,P+=n*J,M+=n*V,U+=n*Y,b+=(n=t[14])*F,w+=n*T,v+=n*q,I+=n*O,E+=n*K,B+=n*H,C+=n*N,_+=n*L,k+=n*G,S+=n*j,Q+=n*z,x+=n*W,P+=n*Z,M+=n*J,U+=n*V,D+=n*Y,w+=(n=t[15])*F,o+=38*(I+=n*q),s+=38*(E+=n*O),c+=38*(B+=n*K),u+=38*(C+=n*H),h+=38*(_+=n*N),l+=38*(k+=n*L),f+=38*(S+=n*G),d+=38*(Q+=n*j),p+=38*(x+=n*z),g+=38*(P+=n*W),A+=38*(M+=n*Z),y+=38*(U+=n*J),m+=38*(D+=n*V),b+=38*(R+=n*Y),a=(n=(a+=38*(v+=n*T))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=A,e[12]=y,e[13]=m,e[14]=b,e[15]=w}function E(e,t){I(e,t,t)}function B(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)E(i,i),2!==n&&4!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function C(e,r,n){var i,a,s=new Uint8Array(32),c=new Float64Array(80),u=t(),h=t(),l=t(),f=t(),d=t(),p=t();for(a=0;a<31;a++)s[a]=r[a];for(s[31]=127&r[31]|64,s[0]&=248,b(c,n),a=0;a<16;a++)h[a]=c[a],f[a]=u[a]=l[a]=0;for(u[0]=f[0]=1,a=254;a>=0;--a)g(u,h,i=s[a>>>3]>>>(7&a)&1),g(l,f,i),w(d,u,l),v(u,u,l),w(l,h,f),v(h,h,f),E(f,d),E(p,u),I(u,l,u),I(l,h,d),w(d,u,l),v(u,u,l),E(h,u),v(l,f,p),I(u,l,o),w(u,u,f),I(l,l,u),I(u,f,p),I(f,h,c),E(h,d),g(u,h,i),g(l,f,i);for(a=0;a<16;a++)c[a+16]=u[a],c[a+32]=l[a],c[a+48]=h[a],c[a+64]=f[a];var y=c.subarray(32),m=c.subarray(16);return B(y,y),I(m,m,y),A(e,m),0}function _(e,t){return C(e,t,n)}function k(e,r){var n=t(),i=t(),a=t(),o=t(),s=t(),u=t(),h=t(),l=t(),f=t();v(n,e[1],e[0]),v(f,r[1],r[0]),I(n,n,f),w(i,e[0],e[1]),w(f,r[0],r[1]),I(i,i,f),I(a,e[3],r[3]),I(a,a,c),I(o,e[2],r[2]),w(o,o,o),v(s,i,n),v(u,o,a),w(h,o,a),w(l,i,n),I(e[0],s,u),I(e[1],l,h),I(e[2],h,u),I(e[3],s,l)}function S(e,t,r){var n;for(n=0;n<4;n++)g(e[n],t[n],r)}function Q(e,r){var n=t(),i=t(),a=t();B(a,r[2]),I(n,r[0],a),I(i,r[1],a),A(e,i),e[31]^=m(n)<<7}function x(e,t,r){var n,o;for(d(e[0],i),d(e[1],a),d(e[2],a),d(e[3],i),o=255;o>=0;--o)S(e,t,n=r[o/8|0]>>(7&o)&1),k(t,e),k(e,e),S(e,t,n)}function P(e,r){var n=[t(),t(),t(),t()];d(n[0],u),d(n[1],h),d(n[2],a),I(n[3],u,h),x(e,n,r)}function M(n,i,a){var o,s,c=[t(),t(),t(),t()];for(a||r(i,32),(o=e.hash(i.subarray(0,32)))[0]&=248,o[31]&=127,o[31]|=64,P(c,o),Q(n,c),s=0;s<32;s++)i[s+32]=n[s];return 0}var U=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function D(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>4)*U[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*U[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function R(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;D(e,r)}function F(e,r){var n=t(),o=t(),c=t(),u=t(),h=t(),f=t(),p=t();return d(e[2],a),b(e[1],r),E(c,e[1]),I(u,c,s),v(c,c,e[2]),w(u,e[2],u),E(h,u),E(f,h),I(p,f,h),I(n,p,c),I(n,n,u),function(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)E(i,i),1!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}(n,n),I(n,n,c),I(n,n,u),I(n,n,u),I(e[0],n,u),E(o,e[0]),I(o,o,u),y(o,c)&&I(e[0],e[0],l),E(o,e[0]),I(o,o,u),y(o,c)?-1:(m(e[0])===r[31]>>7&&v(e[0],i,e[0]),I(e[3],e[0],e[1]),0)}var T=64;function q(){for(var e=0;e=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return M(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(q(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;re&&(c.imod(a.leftShift(i)).iadd(a),u=c.mod(o).toNumber())}while(!await Wh(c,t,r));return c}async function Wh(e,t,r){return!(t&&!e.dec().gcd(t).isOne()||!await async function(e){const t=await rs.getBigInteger();return Zh.every((r=>0!==e.mod(new t(r))))}(e)||!await async function(e,t){const r=await rs.getBigInteger();return(t=t||new r(2)).modExp(e.dec(),e).isOne()}(e)||!await async function(e,t,r){const n=await rs.getBigInteger(),i=e.bitLength();t||(t=Math.max(1,i/48|0));const a=e.dec();let o=0;for(;!a.getBit(o);)o++;const s=e.rightShift(new n(o));for(;t>0;t--){let t,r=(await Gh(new n(2),a)).modExp(s,e);if(!r.isOne()&&!r.equal(a)){for(t=1;tt-11)throw Error("Message too long");const n=function(e){const t=new Uint8Array(e);let r=0;for(;r=8&!n;if(t)return rs.selectUint8Array(o,a,t);if(o)return a;throw Error("Decryption error")}async function $h(e,t,r){let n;if(t.length!==Yu.getHashByteLength(e))throw Error("Invalid hash length");const i=new Uint8Array(Jh[e].length);for(n=0;n{tl.generateKeyPair("rsa",r,((r,n,i)=>{r?t(r):e(nl.decode(i,"der"))}))}));return{n:n.modulus.toArrayLike(Uint8Array),e:n.publicExponent.toArrayLike(Uint8Array),d:n.privateExponent.toArrayLike(Uint8Array),p:n.prime2.toArrayLike(Uint8Array),q:n.prime1.toArrayLike(Uint8Array),u:n.coefficient.toArrayLike(Uint8Array)}}let r,n,i;do{n=await zh(e-(e>>1),t,40),r=await zh(e>>1,t,40),i=r.mul(n)}while(i.bitLength()!==e);const a=r.dec().imul(n.dec());return n.lt(r)&&([r,n]=[n,r]),{n:i.toUint8Array(),e:t.toUint8Array(),d:t.modInv(a).toUint8Array(),p:r.toUint8Array(),q:n.toUint8Array(),u:r.modInv(n).toUint8Array()}},validateParams:async function(e,t,r,n,i,a){const o=await rs.getBigInteger();if(e=new o(e),n=new o(n),i=new o(i),!n.mul(i).equal(e))return!1;const s=new o(2);if(a=new o(a),!n.mul(a).mod(i).isOne())return!1;t=new o(t),r=new o(r);const c=new o(Math.floor(e.bitLength()/3)),u=await Gh(s,s.leftShift(c)),h=u.mul(r).mul(t);return!(!h.mod(n.dec()).equal(u)||!h.mod(i.dec()).equal(u))}}),ol=Object.freeze({__proto__:null,encrypt:async function(e,t,r,n){const i=await rs.getBigInteger();t=new i(t),r=new i(r),n=new i(n);const a=new i(Vh(e,t.byteLength())),o=await Gh(new i(1),t.dec());return{c1:r.modExp(o,t).toUint8Array(),c2:n.modExp(o,t).imul(a).imod(t).toUint8Array()}},decrypt:async function(e,t,r,n,i){const a=await rs.getBigInteger();return e=new a(e),t=new a(t),r=new a(r),n=new a(n),Yh(e.modExp(n,r).modInv(r).imul(t).imod(r).toUint8Array("be",r.byteLength()),i)},validateParams:async function(e,t,r,n){const i=await rs.getBigInteger();e=new i(e),t=new i(t),r=new i(r);const a=new i(1);if(t.lte(a)||t.gte(e))return!1;const o=new i(e.bitLength()),s=new i(1023);if(o.lt(s))return!1;if(!t.modExp(e.dec(),e).isOne())return!1;let c=t;const u=new i(1),h=new i(2).leftShift(new i(17));for(;u.lt(h);){if(c=c.mul(t).imod(e),c.isOne())return!1;u.iinc()}n=new i(n);const l=new i(2),f=await Gh(l.leftShift(o.dec()),l.leftShift(o)),d=e.dec().imul(f).iadd(n);return!!r.equal(t.modExp(d,e))}});class sl{constructor(e){if(e instanceof sl)this.oid=e.oid;else if(rs.isArray(e)||rs.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return rs.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return rs.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(es.curve[e])return es.write(es.curve,e);throw Error("Unknown curve object identifier.")}}function cl(e,t){return e.keyPair({priv:t})}function ul(e,t){const r=e.keyPair({pub:t});if(!0!==r.validate().result)throw Error("Invalid elliptic public key");return r}async function hl(e){if(!hs.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:t}=await Promise.resolve().then((function(){return Rb}));return new t.ec(e)}function ll(e){let t,r=0;const n=e[0];return n<192?([r]=e,t=1):n<255?(r=(e[0]-192<<8)+e[1]+192,t=2):255===n&&(r=rs.readNumber(e.subarray(1,5)),t=5),{len:r,offset:t}}function fl(e){return e<192?new Uint8Array([e]):e>191&&e<8384?new Uint8Array([192+(e-192>>8),e-192&255]):rs.concatUint8Array([new Uint8Array([255]),rs.writeNumber(e,4)])}function dl(e){if(e<0||e>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+e])}function pl(e){return new Uint8Array([192|e])}function gl(e,t){return rs.concatUint8Array([pl(e),fl(t)])}function Al(e){return[es.packet.literalData,es.packet.compressedData,es.packet.symmetricallyEncryptedData,es.packet.symEncryptedIntegrityProtectedData,es.packet.aeadEncryptedData].includes(e)}async function yl(e,t){const r=Oo(e);let n,i;try{const a=await r.peekBytes(2);if(!a||a.length<2||0==(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const o=await r.readByte();let s,c,u=-1,h=-1;h=0,0!=(64&o)&&(h=1),h?u=63&o:(u=(63&o)>>2,c=3&o);const l=Al(u);let f,d=null;if(l){if("array"===rs.isStream(e)){const e=new Ao;n=Ko(e),d=e}else{const e=new Do;n=Ko(e.writable),d=e.readable}i=t({tag:u,packet:d})}else d=[];do{if(h){const e=await r.readByte();if(f=!1,e<192)s=e;else if(e>=192&&e<224)s=(e-192<<8)+await r.readByte()+192;else if(e>223&&e<255){if(s=1<<(31&e),f=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(c){case 0:s=await r.readByte();break;case 1:s=await r.readByte()<<8|await r.readByte();break;case 2:s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:s=1/0}if(s>0){let e=0;for(;;){n&&await n.ready;const{done:t,value:i}=await r.read();if(t){if(s===1/0)break;throw Error("Unexpected end of packet")}const a=s===1/0?i:i.subarray(0,s-e);if(n?await n.write(a):d.push(a),e+=i.length,e>=s){r.unshift(i.subarray(s-e+i.length));break}}}}while(f);const p=await r.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(d=rs.concatUint8Array(d),await t({tag:u,packet:d})),!p||!p.length}catch(e){if(n)return await n.abort(e),!0;throw e}finally{n&&await i,r.releaseLock()}}class ml extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,ml),this.name="UnsupportedError"}}class bl{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const wl=rs.getWebCrypto(),vl=rs.getNodeCrypto(),Il={p256:"P-256",p384:"P-384",p521:"P-521"},El=vl?vl.getCurves():[],Bl=vl?{secp256k1:El.includes("secp256k1")?"secp256k1":void 0,p256:El.includes("prime256v1")?"prime256v1":void 0,p384:El.includes("secp384r1")?"secp384r1":void 0,p521:El.includes("secp521r1")?"secp521r1":void 0,ed25519:El.includes("ED25519")?"ED25519":void 0,curve25519:El.includes("X25519")?"X25519":void 0,brainpoolP256r1:El.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:El.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:El.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Cl={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:es.publicKey.ecdsa,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:Bl.p256,web:Il.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:es.publicKey.ecdsa,hash:es.hash.sha384,cipher:es.symmetric.aes192,node:Bl.p384,web:Il.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:es.publicKey.ecdsa,hash:es.hash.sha512,cipher:es.symmetric.aes256,node:Bl.p521,web:Il.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:es.publicKey.ecdsa,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:Bl.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:es.publicKey.eddsaLegacy,hash:es.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:es.publicKey.ecdh,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:es.publicKey.ecdsa,hash:es.hash.sha256,cipher:es.symmetric.aes128,node:Bl.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:es.publicKey.ecdsa,hash:es.hash.sha384,cipher:es.symmetric.aes192,node:Bl.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:es.publicKey.ecdsa,hash:es.hash.sha512,cipher:es.symmetric.aes256,node:Bl.brainpoolP512r1,payloadSize:64}};class _l{constructor(e,t){try{(rs.isArray(e)||rs.isUint8Array(e))&&(e=new sl(e)),e instanceof sl&&(e=e.getName()),this.name=es.write(es.curve,e)}catch(e){throw new ml("Unknown curve")}t=t||Cl[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Cl[this.name],this.web=t.web&&Cl[this.name],this.payloadSize=t.payloadSize,this.web&&rs.getWebCrypto()?this.type="web":this.node&&rs.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(e){const t=await wl.generateKey({name:"ECDSA",namedCurve:Il[e]},!0,["sign","verify"]),r=await wl.exportKey("jwk",t.privateKey);return{publicKey:Sl(await wl.exportKey("jwk",t.publicKey)),privateKey:cs(r.d)}}(this.name)}catch(e){rs.printDebugError("Browser did not support generating ec key "+e.message);break}case"node":return async function(e){const t=vl.createECDH(Bl[e]);return await t.generateKeys(),{publicKey:new Uint8Array(t.getPublicKey()),privateKey:new Uint8Array(t.getPrivateKey())}}(this.name);case"curve25519":{const t=Lh(32);t[0]=127&t[0]|64,t[31]&=248;const r=t.slice().reverse();return e=Hh.box.keyPair.fromSecretKey(r),{publicKey:rs.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:t}}case"ed25519":{const e=Lh(32),t=Hh.sign.keyPair.fromSeed(e);return{publicKey:rs.concatUint8Array([new Uint8Array([64]),t.publicKey]),privateKey:e}}}const t=await hl(this.name);return e=await t.genKeyPair({entropy:rs.uint8ArrayToString(Lh(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function kl(e,t,r,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:e===es.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=t.getName();if(!i[a])return!1;if("curve25519"===a){n=n.slice().reverse();const{publicKey:e}=Hh.box.keyPair.fromSecretKey(n);r=new Uint8Array(r);const t=new Uint8Array([64,...e]);return!!rs.equalsUint8Array(t,r)}const o=await hl(a);try{r=ul(o,r).getPublic()}catch(e){return!1}return!!cl(o,n).getPublic().eq(r)}function Sl(e){const t=cs(e.x),r=cs(e.y),n=new Uint8Array(t.length+r.length+1);return n[0]=4,n.set(t,1),n.set(r,t.length+1),n}function Ql(e,t,r){const n=e,i=r.slice(1,n+1),a=r.slice(n+1,2*n+1);return{kty:"EC",crv:t,x:us(i,!0),y:us(a,!0),ext:!0}}function xl(e,t,r,n){const i=Ql(e,t,r);return i.d=us(n,!0),i}const Pl=rs.getWebCrypto(),Ml=rs.getNodeCrypto();async function Ul(e,t,r,n,i,a){const o=new _l(e);if(r&&!rs.isStream(r)){const a={publicKey:n,privateKey:i};switch(o.type){case"web":try{return await async function(e,t,r,n){const i=e.payloadSize,a=xl(e.payloadSize,Il[e.name],n.publicKey,n.privateKey),o=await Pl.importKey("jwk",a,{name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,e.hash)}},!1,["sign"]),s=new Uint8Array(await Pl.sign({name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,t)}},o,r));return{r:s.slice(0,i),s:s.slice(i,i<<1)}}(o,t,r,a)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;rs.printDebugError("Browser did not support signing: "+e.message)}break;case"node":{const e=await async function(e,t,r,n){const i=Ml.createSign(es.read(es.hash,t));i.write(r),i.end();const a=Tl.encode({version:1,parameters:e.oid,privateKey:Array.from(n.privateKey),publicKey:{unused:0,data:Array.from(n.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Fl.decode(i.sign(a),"der")}(o,t,r,a);return{r:e.r.toArrayLike(Uint8Array),s:e.s.toArrayLike(Uint8Array)}}}}return async function(e,t,r){const n=cl(await hl(e.name),r).sign(t);return{r:n.r.toArrayLike(Uint8Array),s:n.s.toArrayLike(Uint8Array)}}(o,a,i)}async function Dl(e,t,r,n,i,a){const o=new _l(e);if(n&&!rs.isStream(n))switch(o.type){case"web":try{return await async function(e,t,{r:r,s:n},i,a){const o=Ql(e.payloadSize,Il[e.name],a),s=await Pl.importKey("jwk",o,{name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,e.hash)}},!1,["verify"]),c=rs.concatUint8Array([r,n]).buffer;return Pl.verify({name:"ECDSA",namedCurve:Il[e.name],hash:{name:es.read(es.webHash,t)}},s,c,i)}(o,t,r,n,i)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;rs.printDebugError("Browser did not support verifying: "+e.message)}break;case"node":return async function(e,t,{r:r,s:n},i,a){const{default:o}=await Promise.resolve().then((function(){return Am})),s=Ml.createVerify(es.read(es.hash,t));s.write(i),s.end();const c=Ol.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:e.oid},subjectPublicKey:{unused:0,data:Array.from(a)}},"pem",{label:"PUBLIC KEY"}),u=Fl.encode({r:new o(r),s:new o(n)},"der");try{return s.verify(c,u)}catch(e){return!1}}(o,t,r,n,i)}return async function(e,t,r,n){return ul(await hl(e.name),n).verify(r,t)}(o,r,void 0===t?n:a,i)}const Rl=void 0,Fl=Ml?Rl.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,Tl=Ml?Rl.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,ql=Ml?Rl.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,Ol=Ml?Rl.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(ql),this.key("subjectPublicKey").bitstr())})):void 0;var Kl=Object.freeze({__proto__:null,sign:Ul,verify:Dl,validateParams:async function(e,t,r){const n=new _l(e);if(n.keyType!==es.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const n=Lh(8),i=es.hash.sha256,a=await Yu.digest(i,n);try{const o=await Ul(e,i,n,t,r,a);return await Dl(e,i,o,n,t,a)}catch(e){return!1}}default:return kl(es.publicKey.ecdsa,e,t,r)}}});Hh.hash=e=>new Uint8Array(iu().update(e).digest());var Hl=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){if(Yu.getHashByteLength(t)new Uint8Array(iu().update(e).digest());var Ll=Object.freeze({__proto__:null,generate:async function(e){if(e===es.publicKey.ed25519){const e=Lh(32),{publicKey:t}=Hh.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(e,t,r,n,i,a){if(Yu.getHashByteLength(t)=0;--e)for(let t=s-1;t>=0;--t)c[1]=s*e+(t+1),u[0]=a[0]^c[0],u[1]=a[1]^c[1],u[2]=o[2*t],u[3]=o[2*t+1],u=zl(r.decrypt(Wl(u))),a=u.subarray(0,2),o[2*t]=u[2],o[2*t+1]=u[3];if(a[0]===n[0]&&a[1]===n[1])return Wl(o);throw Error("Key Data Integrity failed")}function zl(e){const{length:t}=e,r=function(e){if(rs.isString(e)){const{length:t}=e,r=new ArrayBuffer(t),n=new Uint8Array(r);for(let r=0;r0){const r=e[t-1];if(r>=1){const n=e.subarray(t-r),i=new Uint8Array(r).fill(r);if(rs.equalsUint8Array(n,i))return e.subarray(0,t-r)}}throw Error("Invalid padding")}var Yl=Object.freeze({__proto__:null,encode:Jl,decode:Vl});const $l=rs.getWebCrypto(),Xl=rs.getNodeCrypto();function ef(e,t,r,n){return rs.concatUint8Array([t.write(),new Uint8Array([e]),r.write(),rs.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function tf(e,t,r,n,i=!1,a=!1){let o;if(i){for(o=0;o=0&&0===t[o];o--);t=t.subarray(0,o+1)}return(await Yu.digest(e,rs.concatUint8Array([new Uint8Array([0,0,0,1]),t,n]))).subarray(0,r)}async function rf(e,t,r,n){if(n.length!==e.payloadSize){const t=new Uint8Array(e.payloadSize);t.set(n,e.payloadSize-n.length),n=t}switch(e.type){case"curve25519":{const e=n.slice().reverse();return{secretKey:e,sharedKey:Hh.scalarMult(e,t.subarray(1))}}case"web":if(e.web&&rs.getWebCrypto())try{return await async function(e,t,r,n){const i=xl(e.payloadSize,e.web.web,r,n);let a=$l.importKey("jwk",i,{name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]);const o=Ql(e.payloadSize,e.web.web,t);let s=$l.importKey("jwk",o,{name:"ECDH",namedCurve:e.web.web},!0,[]);[a,s]=await Promise.all([a,s]);let c=$l.deriveBits({name:"ECDH",namedCurve:e.web.web,public:s},a,e.web.sharedSize),u=$l.exportKey("jwk",a);[c,u]=await Promise.all([c,u]);const h=new Uint8Array(c);return{secretKey:cs(u.d),sharedKey:h}}(e,t,r,n)}catch(e){rs.printDebugError(e)}break;case"node":return async function(e,t,r){const n=Xl.createECDH(e.node.node);n.setPrivateKey(r);const i=new Uint8Array(n.computeSecret(t));return{secretKey:new Uint8Array(n.getPrivateKey()),sharedKey:i}}(e,t,n)}return async function(e,t,r){const n=await hl(e.name);t=ul(n,t),r=cl(n,r);const i=new Uint8Array(r.getPrivate()),a=r.derive(t.getPublic()),o=n.curve.p.byteLength();return{secretKey:i,sharedKey:a.toArrayLike(Uint8Array,"be",o)}}(e,t,n)}var nf=Object.freeze({__proto__:null,validateParams:async function(e,t,r){return kl(es.publicKey.ecdh,e,t,r)},encrypt:async function(e,t,r,n,i){const a=Jl(r),o=new _l(e),{publicKey:s,sharedKey:c}=await async function(e,t){switch(e.type){case"curve25519":{const r=Lh(32),{secretKey:n,sharedKey:i}=await rf(e,t,null,r);let{publicKey:a}=Hh.box.keyPair.fromSecretKey(n);return a=rs.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(e.web&&rs.getWebCrypto())try{return await async function(e,t){const r=Ql(e.payloadSize,e.web.web,t);let n=$l.generateKey({name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]),i=$l.importKey("jwk",r,{name:"ECDH",namedCurve:e.web.web},!1,[]);[n,i]=await Promise.all([n,i]);let a=$l.deriveBits({name:"ECDH",namedCurve:e.web.web,public:i},n.privateKey,e.web.sharedSize),o=$l.exportKey("jwk",n.publicKey);[a,o]=await Promise.all([a,o]);const s=new Uint8Array(a);return{publicKey:new Uint8Array(Sl(o)),sharedKey:s}}(e,t)}catch(e){rs.printDebugError(e)}break;case"node":return async function(e,t){const r=Xl.createECDH(e.node.node);r.generateKeys();const n=new Uint8Array(r.computeSecret(t));return{publicKey:new Uint8Array(r.getPublicKey()),sharedKey:n}}(e,t)}return async function(e,t){const r=await hl(e.name),n=await e.genKeyPair();t=ul(r,t);const i=cl(r,n.privateKey),a=n.publicKey,o=i.derive(t.getPublic()),s=r.curve.p.byteLength();return{publicKey:a,sharedKey:o.toArrayLike(Uint8Array,"be",s)}}(e,t)}(o,n),u=ef(es.publicKey.ecdh,e,t,i),{keySize:h}=Xu(t.cipher);return{publicKey:s,wrappedKey:Gl(await tf(t.hash,c,h,u),a)}},decrypt:async function(e,t,r,n,i,a,o){const s=new _l(e),{sharedKey:c}=await rf(s,r,i,a),u=ef(es.publicKey.ecdh,e,t,o),{keySize:h}=Xu(t.cipher);let l;for(let r=0;r<3;r++)try{return Vl(jl(await tf(t.hash,c,h,u,1===r,2===r),n))}catch(e){l=e}throw l}});const af=rs.getWebCrypto(),of=rs.getNodeCrypto(),sf=of&&of.webcrypto&&of.webcrypto.subtle;async function cf(e,t,r,n,i){const a=es.read(es.webHash,e);if(!a)throw Error("Hash algo not supported with HKDF");if(af||sf){const e=af||sf,o=await e.importKey("raw",t,"HKDF",!1,["deriveBits"]),s=await e.deriveBits({name:"HKDF",hash:a,salt:r,info:n},o,8*i);return new Uint8Array(s)}if(of){const a=es.read(es.hash,e),o=(e,t)=>of.createHmac(a,e).update(t).digest(),s=o(r,t),c=s.length,u=Math.ceil(i/c),h=new Uint8Array(u*c),l=new Uint8Array(c+n.length+1);l.set(n,c);for(let e=0;e0?l:l.subarray(c));l.set(t,0),h.set(t,e*c)}return h.subarray(0,i)}throw Error("No HKDF implementation available")}const uf={x25519:rs.encodeUTF8("OpenPGP X25519")};var hf=Object.freeze({__proto__:null,generate:async function(e){if(e===es.publicKey.x25519){const e=Lh(32),{publicKey:t}=Hh.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(e,t,r){if(e===es.publicKey.x25519){const{publicKey:e}=Hh.box.keyPair.fromSecretKey(r);return rs.equalsUint8Array(t,e)}return!1},encrypt:async function(e,t,r){if(e===es.publicKey.x25519){const e=Lh(32),n=Hh.scalarMult(e,r),{publicKey:i}=Hh.box.keyPair.fromSecretKey(e),a=rs.concatUint8Array([i,r,n]),{keySize:o}=Xu(es.symmetric.aes128);return{ephemeralPublicKey:i,wrappedKey:Gl(await cf(es.hash.sha256,a,new Uint8Array,uf.x25519,o),t)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(e,t,r,n,i){if(e===es.publicKey.x25519){const e=Hh.scalarMult(i,t),a=rs.concatUint8Array([t,n,e]),{keySize:o}=Xu(es.symmetric.aes128);return jl(await cf(es.hash.sha256,a,new Uint8Array,uf.x25519,o),r)}throw Error("Unsupported ECDH algorithm")}}),lf=Object.freeze({__proto__:null,CurveWithOID:_l,ecdh:nf,ecdhX:hf,ecdsa:Kl,eddsaLegacy:Hl,eddsa:Ll,generate:async function(e){const t=await rs.getBigInteger();e=new _l(e);const r=await e.genKeyPair(),n=new t(r.publicKey).toUint8Array(),i=new t(r.privateKey).toUint8Array("be",e.payloadSize);return{oid:e.oid,Q:n,secret:i,hash:e.hash,cipher:e.cipher}},getPreferredHashAlgo:function(e){return Cl[es.write(es.curve,e.toHex())].hash}}),ff=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){const o=await rs.getBigInteger(),s=new o(1);let c,u,h,l;n=new o(n),i=new o(i),r=new o(r),a=new o(a),r=r.mod(n),a=a.mod(i);const f=new o(t.subarray(0,i.byteLength())).mod(i);for(;;){if(c=await Gh(s,i),u=r.modExp(c,n).imod(i),u.isZero())continue;const e=a.mul(u).imod(i);if(l=f.add(e).imod(i),h=c.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:u.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(e,t,r,n,i,a,o,s){const c=await rs.getBigInteger(),u=new c(0);if(t=new c(t),r=new c(r),a=new c(a),o=new c(o),i=new c(i),s=new c(s),t.lte(u)||t.gte(o)||r.lte(u)||r.gte(o))return rs.printDebug("invalid DSA Signature"),!1;const h=new c(n.subarray(0,o.byteLength())).imod(o),l=r.modInv(o);if(l.isZero())return rs.printDebug("invalid DSA Signature"),!1;i=i.mod(a),s=s.mod(a);const f=h.mul(l).imod(o),d=t.mul(l).imod(o),p=i.modExp(f,a),g=s.modExp(d,a);return p.mul(g).imod(a).imod(o).equal(t)},validateParams:async function(e,t,r,n,i){const a=await rs.getBigInteger();e=new a(e),t=new a(t),r=new a(r),n=new a(n);const o=new a(1);if(r.lte(o)||r.gte(e))return!1;if(!e.dec().mod(t).isZero())return!1;if(!r.modExp(t,e).isOne())return!1;const s=new a(t.bitLength()),c=new a(150);if(s.lt(c)||!await Wh(t,null,32))return!1;i=new a(i);const u=new a(2),h=await Gh(u.leftShift(s.dec()),u.leftShift(s)),l=t.mul(h).add(i);return!!n.equal(r.modExp(l,e))}}),df={rsa:al,elgamal:ol,elliptic:lf,dsa:ff,nacl:Hh},pf=Object.freeze({__proto__:null,parseSignatureParams:function(e,t){let r=0;switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:case es.publicKey.rsaSign:return{s:rs.readMPI(t.subarray(r))};case es.publicKey.dsa:case es.publicKey.ecdsa:{const e=rs.readMPI(t.subarray(r));return r+=e.length+2,{r:e,s:rs.readMPI(t.subarray(r))}}case es.publicKey.eddsaLegacy:{let e=rs.readMPI(t.subarray(r));r+=e.length+2,e=rs.leftPad(e,32);let n=rs.readMPI(t.subarray(r));return n=rs.leftPad(n,32),{r:e,s:n}}case es.publicKey.ed25519:{const e=t.subarray(r,r+64);return r+=e.length,{RS:e}}default:throw new ml("Unknown signature algorithm.")}},verify:async function(e,t,r,n,i,a){switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:case es.publicKey.rsaSign:{const{n:e,e:o}=n,s=rs.leftPad(r.s,e.length);return df.rsa.verify(t,i,s,e,o,a)}case es.publicKey.dsa:{const{g:e,p:i,q:o,y:s}=n,{r:c,s:u}=r;return df.dsa.verify(t,c,u,a,e,i,o,s)}case es.publicKey.ecdsa:{const{oid:e,Q:o}=n,s=new df.elliptic.CurveWithOID(e).payloadSize,c=rs.leftPad(r.r,s),u=rs.leftPad(r.s,s);return df.elliptic.ecdsa.verify(e,t,{r:c,s:u},i,o,a)}case es.publicKey.eddsaLegacy:{const{oid:e,Q:o}=n;return df.elliptic.eddsaLegacy.verify(e,t,r,i,o,a)}case es.publicKey.ed25519:{const{A:o}=n;return df.elliptic.eddsa.verify(e,t,r,i,o,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(e,t,r,n,i,a){if(!r||!n)throw Error("Missing key parameters");switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:case es.publicKey.rsaSign:{const{n:e,e:o}=r,{d:s,p:c,q:u,u:h}=n;return{s:await df.rsa.sign(t,i,e,o,s,c,u,h,a)}}case es.publicKey.dsa:{const{g:e,p:i,q:o}=r,{x:s}=n;return df.dsa.sign(t,a,e,i,o,s)}case es.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case es.publicKey.ecdsa:{const{oid:e,Q:o}=r,{d:s}=n;return df.elliptic.ecdsa.sign(e,t,i,o,s,a)}case es.publicKey.eddsaLegacy:{const{oid:e,Q:o}=r,{seed:s}=n;return df.elliptic.eddsaLegacy.sign(e,t,i,o,s,a)}case es.publicKey.ed25519:{const{A:o}=r,{seed:s}=n;return df.elliptic.eddsa.sign(e,t,i,o,s,a)}default:throw Error("Unknown signature algorithm.")}}});class gf{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return rs.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class Af{constructor(e){if(e){const{hash:t,cipher:r}=e;this.hash=t,this.cipher=r}else this.hash=null,this.cipher=null}read(e){if(e.length<4||3!==e[0]||1!==e[1])throw new ml("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class yf{static fromObject({wrappedKey:e,algorithm:t}){const r=new yf;return r.wrappedKey=e,r.algorithm=t,r}read(e){let t=0,r=e[t++];this.algorithm=r%2?e[t++]:null,r-=r%2,this.wrappedKey=e.subarray(t,t+r),t+=r}write(){return rs.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function mf(e){try{e.getName()}catch(e){throw new ml("Unknown curve OID")}}var bf=Object.freeze({__proto__:null,publicKeyEncrypt:async function(e,t,r,n,i){switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:{const{n:e,e:t}=r;return{c:await df.rsa.encrypt(n,e,t)}}case es.publicKey.elgamal:{const{p:e,g:t,y:i}=r;return df.elgamal.encrypt(n,e,t,i)}case es.publicKey.ecdh:{const{oid:e,Q:t,kdfParams:a}=r,{publicKey:o,wrappedKey:s}=await df.elliptic.ecdh.encrypt(e,a,n,t,i);return{V:o,C:new gf(s)}}case es.publicKey.x25519:{if(!rs.isAES(t))throw Error("X25519 keys can only encrypt AES session keys");const{A:i}=r,{ephemeralPublicKey:a,wrappedKey:o}=await df.elliptic.ecdhX.encrypt(e,n,i);return{ephemeralPublicKey:a,C:yf.fromObject({algorithm:t,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(e,t,r,n,i,a){switch(e){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaEncrypt:{const{c:e}=n,{n:i,e:o}=t,{d:s,p:c,q:u,u:h}=r;return df.rsa.decrypt(e,i,o,s,c,u,h,a)}case es.publicKey.elgamal:{const{c1:e,c2:i}=n,o=t.p,s=r.x;return df.elgamal.decrypt(e,i,o,s,a)}case es.publicKey.ecdh:{const{oid:e,Q:a,kdfParams:o}=t,{d:s}=r,{V:c,C:u}=n;return df.elliptic.ecdh.decrypt(e,o,c,u.data,a,s,i)}case es.publicKey.x25519:{const{A:i}=t,{k:a}=r,{ephemeralPublicKey:o,C:s}=n;if(!rs.isAES(s.algorithm))throw Error("AES session key expected");return df.elliptic.ecdhX.decrypt(e,o,s.wrappedKey,i,a)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(e,t){let r=0;switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=rs.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{n:e,e:n}}}case es.publicKey.dsa:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=rs.readMPI(t.subarray(r));r+=n.length+2;const i=rs.readMPI(t.subarray(r));r+=i.length+2;const a=rs.readMPI(t.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:e,q:n,g:i,y:a}}}case es.publicKey.elgamal:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=rs.readMPI(t.subarray(r));r+=n.length+2;const i=rs.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{p:e,g:n,y:i}}}case es.publicKey.ecdsa:{const e=new sl;r+=e.read(t),mf(e);const n=rs.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{oid:e,Q:n}}}case es.publicKey.eddsaLegacy:{const e=new sl;r+=e.read(t),mf(e);let n=rs.readMPI(t.subarray(r));return r+=n.length+2,n=rs.leftPad(n,33),{read:r,publicParams:{oid:e,Q:n}}}case es.publicKey.ecdh:{const e=new sl;r+=e.read(t),mf(e);const n=rs.readMPI(t.subarray(r));r+=n.length+2;const i=new Af;return r+=i.read(t.subarray(r)),{read:r,publicParams:{oid:e,Q:n,kdfParams:i}}}case es.publicKey.ed25519:case es.publicKey.x25519:{const e=t.subarray(r,r+32);return r+=e.length,{read:r,publicParams:{A:e}}}default:throw new ml("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(e,t,r){let n=0;switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:{const e=rs.readMPI(t.subarray(n));n+=e.length+2;const r=rs.readMPI(t.subarray(n));n+=r.length+2;const i=rs.readMPI(t.subarray(n));n+=i.length+2;const a=rs.readMPI(t.subarray(n));return n+=a.length+2,{read:n,privateParams:{d:e,p:r,q:i,u:a}}}case es.publicKey.dsa:case es.publicKey.elgamal:{const e=rs.readMPI(t.subarray(n));return n+=e.length+2,{read:n,privateParams:{x:e}}}case es.publicKey.ecdsa:case es.publicKey.ecdh:{const e=new _l(r.oid);let i=rs.readMPI(t.subarray(n));return n+=i.length+2,i=rs.leftPad(i,e.payloadSize),{read:n,privateParams:{d:i}}}case es.publicKey.eddsaLegacy:{const e=new _l(r.oid);let i=rs.readMPI(t.subarray(n));return n+=i.length+2,i=rs.leftPad(i,e.payloadSize),{read:n,privateParams:{seed:i}}}case es.publicKey.ed25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{seed:e}}}case es.publicKey.x25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{k:e}}}default:throw new ml("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(e,t){let r=0;switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:return{c:rs.readMPI(t.subarray(r))};case es.publicKey.elgamal:{const e=rs.readMPI(t.subarray(r));return r+=e.length+2,{c1:e,c2:rs.readMPI(t.subarray(r))}}case es.publicKey.ecdh:{const e=rs.readMPI(t.subarray(r));r+=e.length+2;const n=new gf;return n.read(t.subarray(r)),{V:e,C:n}}case es.publicKey.x25519:{const e=t.subarray(r,r+32);r+=e.length;const n=new yf;return n.read(t.subarray(r)),{ephemeralPublicKey:e,C:n}}default:throw new ml("Unknown public key encryption algorithm.")}},serializeParams:function(e,t){const r=new Set([es.publicKey.ed25519,es.publicKey.x25519]),n=Object.keys(t).map((n=>{const i=t[n];return rs.isUint8Array(i)?r.has(e)?i:rs.uint8ArrayToMPI(i):i.write()}));return rs.concatUint8Array(n)},generateParams:function(e,t,r){switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:return df.rsa.generate(t,65537).then((({n:e,e:t,d:r,p:n,q:i,u:a})=>({privateParams:{d:r,p:n,q:i,u:a},publicParams:{n:e,e:t}})));case es.publicKey.ecdsa:return df.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{d:r},publicParams:{oid:new sl(e),Q:t}})));case es.publicKey.eddsaLegacy:return df.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{seed:r},publicParams:{oid:new sl(e),Q:t}})));case es.publicKey.ecdh:return df.elliptic.generate(r).then((({oid:e,Q:t,secret:r,hash:n,cipher:i})=>({privateParams:{d:r},publicParams:{oid:new sl(e),Q:t,kdfParams:new Af({hash:n,cipher:i})}})));case es.publicKey.ed25519:return df.elliptic.eddsa.generate(e).then((({A:e,seed:t})=>({privateParams:{seed:t},publicParams:{A:e}})));case es.publicKey.x25519:return df.elliptic.ecdhX.generate(e).then((({A:e,k:t})=>({privateParams:{k:t},publicParams:{A:e}})));case es.publicKey.dsa:case es.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(e,t,r){if(!t||!r)throw Error("Missing key parameters");switch(e){case es.publicKey.rsaEncrypt:case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:{const{n:e,e:n}=t,{d:i,p:a,q:o,u:s}=r;return df.rsa.validateParams(e,n,i,a,o,s)}case es.publicKey.dsa:{const{p:e,q:n,g:i,y:a}=t,{x:o}=r;return df.dsa.validateParams(e,n,i,a,o)}case es.publicKey.elgamal:{const{p:e,g:n,y:i}=t,{x:a}=r;return df.elgamal.validateParams(e,n,i,a)}case es.publicKey.ecdsa:case es.publicKey.ecdh:{const n=df.elliptic[es.read(es.publicKey,e)],{oid:i,Q:a}=t,{d:o}=r;return n.validateParams(i,a,o)}case es.publicKey.eddsaLegacy:{const{Q:e,oid:n}=t,{seed:i}=r;return df.elliptic.eddsaLegacy.validateParams(n,e,i)}case es.publicKey.ed25519:{const{A:n}=t,{seed:i}=r;return df.elliptic.eddsa.validateParams(e,n,i)}case es.publicKey.x25519:{const{A:n}=t,{k:i}=r;return df.elliptic.ecdhX.validateParams(e,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(e){const{blockSize:t}=Xu(e),r=await Lh(t),n=new Uint8Array([r[r.length-2],r[r.length-1]]);return rs.concat([r,n])},generateSessionKey:function(e){const{keySize:t}=Xu(e);return Lh(t)},getAEADMode:function(e){const t=es.read(es.aead,e);return Kh[t]},getCipher:Xu,getPreferredCurveHashAlgo:function(e,t){switch(e){case es.publicKey.ecdsa:case es.publicKey.eddsaLegacy:return df.elliptic.getPreferredHashAlgo(t);case es.publicKey.ed25519:return df.elliptic.eddsa.getPreferredHashAlgo(e);default:throw Error("Unknown elliptic signing algo")}}});const wf={cipher:Vs,hash:Yu,mode:Kh,publicKey:df,signature:pf,random:jh,pkcs1:Xh,pkcs5:Yl,aesKW:Zl};Object.assign(wf,bf);var vf="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;const If={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(let a=0;a=0;)e[t]=0}const Pf=0,Mf=1,Uf=2,Df=29,Rf=256,Ff=Rf+1+Df,Tf=30,qf=19,Of=2*Ff+1,Kf=15,Hf=16,Nf=256,Lf=16,Gf=17,jf=18,zf=[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],Wf=[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],Zf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Jf=Array(2*(Ff+2));xf(Jf);const Vf=Array(2*Tf);xf(Vf);const Yf=Array(512);xf(Yf);const $f=Array(256);xf($f);const Xf=Array(Df);xf(Xf);const ed=Array(Tf);function td(e){return e<256?Yf[e]:Yf[256+(e>>>7)]}function rd(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function nd(e,t,r){e.bi_valid>Hf-r?(e.bi_buf|=t<>Hf-e.bi_valid,e.bi_valid+=r-Hf):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function od(e,t,r){const n=Array(Kf+1);let i,a,o=0;for(i=1;i<=Kf;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){const t=e[2*a+1];0!==t&&(e[2*a]=ad(n[t]++,t))}}function sd(e){let t;for(t=0;t8?rd(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ud(e,t,r,n){const i=2*t,a=2*r;return e[i]>1;o>=1;o--)hd(e,r,o);c=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hd(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*c]=r[2*o]+r[2*s],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=c,e.heap[1]=c++,hd(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,l,f,d,p,g=0;for(f=0;f<=Kf;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;uc&&(f=c,g++),r[2*h+1]=f,h>n||(e.bl_count[f]++,d=0,h>=s&&(d=o[h-s]),p=r[2*h],e.opt_len+=p*(f+d),a&&(e.static_len+=p*(i[2*h+1]+d)));if(0!==g){do{for(f=c-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(f=c;0!==f;f--)for(h=e.bl_count[f];0!==h;)l=e.heap[--u],l>n||(r[2*l+1]!==f&&(e.opt_len+=(f-r[2*l+1])*r[2*l],r[2*l+1]=f),h--)}}(e,t),od(r,u,e.bl_count)}function dd(e,t,r){let n,i,a=-1,o=t[1],s=0,c=7,u=4;for(0===o&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*($f[r]+Rf+1)]++,e.dyn_dtree[2*td(t)]++),e.last_lit===e.lit_bufsize-1}function yd(e,t,r,n){let i=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}const md=function(){let e;const t=[];for(let r=0;r<256;r++){e=r;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function bd(e,t,r,n){const i=md,a=n+r;e^=-1;for(let r=n;r>>8^i[255&(e^t[r])];return-1^e}const wd=3,vd=258,Id=vd+wd+1;function Ed(e){const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Cf(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Bd(e,t){(function(e,t,r,n){let i,a,o=0;e.level>0?(e.strm.data_type===Qf&&(e.strm.data_type=function(e){let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return kf;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Sf;for(t=32;t=3&&0===e.bl_tree[2*Zf[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?gd(e,t,r,n):e.strategy===_f||a===i?(nd(e,(Mf<<1)+(n?1:0),3),ld(e,Jf,Vf)):(nd(e,(Uf<<1)+(n?1:0),3),function(e,t,r,n){let i;for(nd(e,t-257,5),nd(e,r-1,5),nd(e,n-4,4),i=0;i=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ed(e.strm)}function Cd(e,t,r,n){let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,Cf(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=yd(e.adler,t,i,r):2===e.state.wrap&&(e.adler=bd(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function _d(e,t){let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-Id?e.strstart-(e.w_size-Id):0,u=e.window,h=e.w_mask,l=e.prev,f=e.strstart+vd;let d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,u[r+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=l[t&h])>c&&0!=--i);return o<=e.lookahead?o:e.lookahead}function kd(e){const t=e.w_size;let r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Id)){Cf(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);a+=t}if(0===e.strm.avail_in)break;if(n=Cd(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=wd)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=wd&&(e.ins_h=(e.ins_h<=wd)if(n=Ad(e,e.strstart-e.match_start,e.match_length-wd),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=wd){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=wd&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=wd-1)),e.prev_length>=wd&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-wd,n=Ad(e,e.strstart-1-e.prev_match,e.prev_length-wd),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(kd(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Bd(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-Id&&(Bd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Bd(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Bd(e,!1),e.strm.avail_out),1)})),new xd(4,4,8,4,Sd),new xd(4,5,16,8,Sd),new xd(4,6,32,32,Sd),new xd(4,4,16,16,Qd),new xd(8,16,32,32,Qd),new xd(8,16,128,128,Qd),new xd(8,32,128,256,Qd),new xd(32,128,258,1024,Qd),new xd(32,258,258,4096,Qd);try{String.fromCharCode.call(null,0)}catch(ho){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(ho){}const Pd=new Bf(256);for(let e=0;e<256;e++)Pd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Pd[254]=Pd[254]=1;var Md=[0,1,3,7,15,31,63,127,255],Ud=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Ud.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},Ud.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Md[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var n=r-e;t|=(this.curByte&Md[e]<>n,this.bitOffset+=e,e=0}}return t},Ud.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1},Ud.prototype.pi=function(){var e,t=new Uint8Array(6);for(e=0;e("00"+e.toString(16)).slice(-2))).join("")}(t)};var Dd=Ud,Rd=function(){};Rd.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Rd.prototype.read=function(e,t,r){for(var n=0;n>>0},this.updateCRC=function(t){e=e<<8^Fd[255&(e>>>24^t)]},this.updateCRCRun=function(t,r){for(;r-- >0;)e=e<<8^Fd[255&(e>>>24^t)]}}),qd=function(e,t){var r,n=e[t];for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},Od=-2,Kd=-3,Hd=-4,Nd=-5,Ld=-6,Gd=-7,jd={"-1":"Bad file checksum"};jd[Od]="Not bzip data",jd[Kd]="Unexpected input EOF",jd[Hd]="Unexpected output EOF",jd[Nd]="Data error",jd[Ld]="Out of memory",jd[Gd]="Obsolete (pre 0.9.5) bzip format not supported.";var zd=function(e,t){var r=jd[e]||"unknown error";t&&(r+=": "+t);var n=new TypeError(r);throw n.errorCode=e,n},Wd=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};Wd.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new Td,!0):(this.writeCount=-1,!1)},Wd.prototype._start_bunzip=function(e,t){var r=new Uint8Array(4);4===e.read(r,0,4)&&"BZh"===String.fromCharCode(r[0],r[1],r[2])||zd(Od,"bad magic");var n=r[3]-48;(n<1||n>9)&&zd(Od,"level out of range"),this.reader=new Dd(e),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},Wd.prototype._get_next_block=function(){var e,t,r,n=this.reader,i=n.pi();if("177245385090"===i)return!1;"314159265359"!==i&&zd(Od),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&zd(Gd);var a=n.read(24);a>this.dbufSize&&zd(Nd,"initial position out of bounds");var o=n.read(16),s=new Uint8Array(256),c=0;for(e=0;e<16;e++)if(o&1<<15-e){var u=16*e;for(r=n.read(16),t=0;t<16;t++)r&1<<15-t&&(s[c++]=u+t)}var h=n.read(3);(h<2||h>6)&&zd(Nd);var l=n.read(15);0===l&&zd(Nd);var f=new Uint8Array(256);for(e=0;e=h&&zd(Nd);d[e]=qd(f,t)}var p,g=c+2,A=[];for(t=0;t20)&&zd(Nd),n.read(1);)n.read(1)?o--:o++;b[e]=o}for(y=m=b[0],e=1;em?m=b[e]:b[e]=l&&zd(Nd),p=A[d[_++]]),e=p.minLen,t=n.read(e);e>p.maxLen&&zd(Nd),!(t<=p.limit[e]);e++)t=t<<1|n.read(1);((t-=p.base[e])<0||t>=258)&&zd(Nd);var S=p.permute[t];if(0!==S&&1!==S){if(B)for(B=0,C+o>this.dbufSize&&zd(Nd),I[E=s[f[0]]]+=o;o--;)k[C++]=E;if(S>c)break;C>=this.dbufSize&&zd(Nd),I[E=s[E=qd(f,e=S-1)]]++,k[C++]=E}else B||(B=1,o=0),o+=0===S?B:2*B,B<<=1}for((a<0||a>=C)&&zd(Nd),t=0,e=0;e<256;e++)r=t+I[e],I[e]=t,t=r;for(e=0;e>=8,P=-1),this.writePos=Q,this.writeCurrent=x,this.writeCount=C,this.writeRun=P,!0},Wd.prototype._read_bunzip=function(e,t){var r,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var u=this.writeRun;c;){for(c--,n=s,s=255&(o=a[o]),o>>=8,3==u++?(r=s,i=n,s=-1):(r=1,i=s),this.blockCRC.updateCRCRun(i,r);r--;)this.outputStream.writeByte(i),this.nextoutput++;s!=n&&(u=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&zd(Nd,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};const Zd=Symbol("verified"),Jd=new Set([es.signatureSubpacket.issuer,es.signatureSubpacket.issuerFingerprint,es.signatureSubpacket.embeddedSignature]);class Vd{static get tag(){return es.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new ws,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Zd]=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new ml(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=wf.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Yo((async()=>wf.serializeParams(this.publicKeyAlgorithm,await this.params))):wf.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),rs.concat(e)}async sign(e,t,r=new Date,n=!1){5===e.version?this.version=5:this.version=4;const i=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=rs.normalizeDate(r),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),i.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=rs.concat(i);const a=this.toHash(this.signatureType,t,n),o=await this.hash(this.signatureType,t,a,n);this.signedHashValue=Jo(zo(o),0,2);const s=async()=>wf.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,a,await Vo(o));rs.isStream(o)?this.params=s():(this.params=await s(),this[Zd]=!0)}writeHashedSubPackets(){const e=es.signatureSubpacket,t=[];let r;if(null===this.created)throw Error("Missing signature creation time");t.push(Yd(e.signatureCreationTime,!0,rs.writeDate(this.created))),null!==this.signatureExpirationTime&&t.push(Yd(e.signatureExpirationTime,!0,rs.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&t.push(Yd(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(r=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Yd(e.trustSignature,!0,r))),null!==this.regularExpression&&t.push(Yd(e.regularExpression,!0,this.regularExpression)),null!==this.revocable&&t.push(Yd(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&t.push(Yd(e.keyExpirationTime,!0,rs.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Yd(e.preferredSymmetricAlgorithms,!1,r))),null!==this.revocationKeyClass&&(r=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),r=rs.concat([r,this.revocationKeyFingerprint]),t.push(Yd(e.revocationKey,!1,r))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||t.push(Yd(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:n,value:i,humanReadable:a,critical:o})=>{r=[new Uint8Array([a?128:0,0,0,0])];const s=rs.encodeUTF8(n);r.push(rs.writeNumber(s.length,2)),r.push(rs.writeNumber(i.length,2)),r.push(s),r.push(i),r=rs.concat(r),t.push(Yd(e.notationData,o,r))})),null!==this.preferredHashAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Yd(e.preferredHashAlgorithms,!1,r))),null!==this.preferredCompressionAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Yd(e.preferredCompressionAlgorithms,!1,r))),null!==this.keyServerPreferences&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.keyServerPreferences)),t.push(Yd(e.keyServerPreferences,!1,r))),null!==this.preferredKeyServer&&t.push(Yd(e.preferredKeyServer,!1,rs.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&t.push(Yd(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&t.push(Yd(e.policyURI,!1,rs.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.keyFlags)),t.push(Yd(e.keyFlags,!0,r))),null!==this.signersUserID&&t.push(Yd(e.signersUserID,!1,rs.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(r=rs.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Yd(e.reasonForRevocation,!0,r))),null!==this.features&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.features)),t.push(Yd(e.features,!1,r))),null!==this.signatureTargetPublicKeyAlgorithm&&(r=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],r.push(rs.stringToUint8Array(this.signatureTargetHash)),r=rs.concat(r),t.push(Yd(e.signatureTarget,!0,r))),null!==this.embeddedSignature&&t.push(Yd(e.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=rs.concat(r),t.push(Yd(e.issuerFingerprint,5===this.version,r))),null!==this.preferredAEADAlgorithms&&(r=rs.stringToUint8Array(rs.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Yd(e.preferredAEADAlgorithms,!1,r)));const n=rs.concat(t),i=rs.writeNumber(n.length,2);return rs.concat([i,n])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach((t=>{e.push(fl(t.length)),e.push(t)}));const t=rs.concat(e),r=rs.writeNumber(t.length,2);return rs.concat([r,t])}readSubPacket(e,t=!0){let r=0;const n=!!(128&e[r]),i=127&e[r];if(t||(this.unhashedSubpackets.push(e.subarray(r,e.length)),Jd.has(i)))switch(r++,i){case es.signatureSubpacket.signatureCreationTime:this.created=rs.readDate(e.subarray(r,e.length));break;case es.signatureSubpacket.signatureExpirationTime:{const t=rs.readNumber(e.subarray(r,e.length));this.signatureNeverExpires=0===t,this.signatureExpirationTime=t;break}case es.signatureSubpacket.exportableCertification:this.exportable=1===e[r++];break;case es.signatureSubpacket.trustSignature:this.trustLevel=e[r++],this.trustAmount=e[r++];break;case es.signatureSubpacket.regularExpression:this.regularExpression=e[r];break;case es.signatureSubpacket.revocable:this.revocable=1===e[r++];break;case es.signatureSubpacket.keyExpirationTime:{const t=rs.readNumber(e.subarray(r,e.length));this.keyExpirationTime=t,this.keyNeverExpires=0===t;break}case es.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.revocationKey:this.revocationKeyClass=e[r++],this.revocationKeyAlgorithm=e[r++],this.revocationKeyFingerprint=e.subarray(r,r+20);break;case es.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(r,e.length));break;case es.signatureSubpacket.notationData:{const t=!!(128&e[r]);r+=4;const i=rs.readNumber(e.subarray(r,r+2));r+=2;const a=rs.readNumber(e.subarray(r,r+2));r+=2;const o=rs.decodeUTF8(e.subarray(r,r+i)),s=e.subarray(r+i,r+i+a);this.rawNotations.push({name:o,humanReadable:t,value:s,critical:n}),t&&(this.notations[o]=rs.decodeUTF8(s));break}case es.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==e[r++];break;case es.signatureSubpacket.policyURI:this.policyURI=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.signersUserID:this.signersUserID=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[r++],this.reasonForRevocationString=rs.decodeUTF8(e.subarray(r,e.length));break;case es.signatureSubpacket.features:this.features=[...e.subarray(r,e.length)];break;case es.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[r++],this.signatureTargetHashAlgorithm=e[r++];const t=wf.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=rs.uint8ArrayToString(e.subarray(r,r+t));break}case es.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Vd,this.embeddedSignature.read(e.subarray(r,e.length));break;case es.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[r++],this.issuerFingerprint=e.subarray(r,e.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case es.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(r,e.length)];break;default:{const e=Error("Unknown signature subpacket type "+i);if(n)throw e;rs.printDebug(e)}}}readSubPackets(e,t=!0,r){const n=rs.readNumber(e.subarray(0,2));let i=2;for(;i<2+n;){const n=ll(e.subarray(i,e.length));i+=n.offset,this.readSubPacket(e.subarray(i,i+n.len),t,r),i+=n.len}return i}toSign(e,t){const r=es.signature;switch(e){case r.binary:return null!==t.text?rs.encodeUTF8(t.getText(!0)):t.getBytes(!0);case r.text:{const e=t.getBytes(!0);return rs.canonicalizeEOL(e)}case r.standalone:return new Uint8Array(0);case r.certGeneric:case r.certPersona:case r.certCasual:case r.certPositive:case r.certRevocation:{let e,n;if(t.userID)n=180,e=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");n=209,e=t.userAttribute}const i=e.write();return rs.concat([this.toSign(r.key,t),new Uint8Array([n]),rs.writeNumber(i.length,4),i])}case r.subkeyBinding:case r.subkeyRevocation:case r.keyBinding:return rs.concat([this.toSign(r.key,t),this.toSign(r.key,{key:t.bind})]);case r.key:if(void 0===t.key)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case r.keyRevocation:return this.toSign(r.key,t);case r.timestamp:return new Uint8Array(0);case r.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let r=0;return Go(zo(this.signatureData),(e=>{r+=e.length}),(()=>{const n=[];return 5!==this.version||this.signatureType!==es.signature.binary&&this.signatureType!==es.signature.text||(t?n.push(new Uint8Array(6)):n.push(e.writeHeader())),n.push(new Uint8Array([this.version,255])),5===this.version&&n.push(new Uint8Array(4)),n.push(rs.writeNumber(r,4)),rs.concat(n)}))}toHash(e,t,r=!1){const n=this.toSign(e,t);return rs.concat([n,this.signatureData,this.calculateTrailer(t,r)])}async hash(e,t,r,n=!1){return r||(r=this.toHash(e,t,n)),wf.hash.digest(this.hashAlgorithm,r)}async verify(e,t,r,n=new Date,i=!1,a=hs){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===es.signature.binary||t===es.signature.text;if(!this[Zd]||o){let n,a;if(this.hashed?a=await this.hashed:(n=this.toHash(t,r,i),a=await this.hash(t,r,n)),a=await Vo(a),this.signedHashValue[0]!==a[0]||this.signedHashValue[1]!==a[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[Zd]=await wf.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,n,a),!this[Zd])throw Error("Signature verification failed")}const s=rs.normalizeDate(n);if(s&&this.created>s)throw Error("Signature creation time is in the future");if(s&&s>=this.getExpirationTime())throw Error("Signature is expired");if(a.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+es.read(es.hash,this.hashAlgorithm).toUpperCase());if(a.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[es.signature.binary,es.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+es.read(es.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:e,critical:t})=>{if(t&&a.knownNotations.indexOf(e)<0)throw Error("Unknown critical notation: "+e)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=rs.normalizeDate(e);return null!==t&&!(this.created<=t&&tVd.prototype.calculateTrailer.apply(await this.correspondingSig,e)))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==es.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function Xd(e,t){if(!t[e]){let r;try{r=es.read(es.packet,e)}catch(t){throw new ml("Unknown packet type with tag: "+e)}throw Error("Packet not allowed in this context: "+r)}return new t[e]}$d.prototype.hash=Vd.prototype.hash,$d.prototype.toHash=Vd.prototype.toHash,$d.prototype.toSign=Vd.prototype.toSign;class ep extends Array{static async fromBinary(e,t,r=hs){const n=new ep;return await n.read(e,t,r),n}async read(e,t,r=hs){r.additionalAllowedPackets.length&&(t={...t,...rs.constructAllowedPackets(r.additionalAllowedPackets)}),this.stream=jo(e,(async(e,n)=>{const i=Ko(n);try{for(;;)if(await i.ready,await yl(e,(async e=>{try{if(e.tag===es.packet.marker||e.tag===es.packet.trust)return;const n=Xd(e.tag,t);n.packets=new ep,n.fromStream=rs.isStream(e.packet),await n.read(e.packet,r),await i.write(n)}catch(t){const n=!r.ignoreUnsupportedPackets&&t instanceof ml,a=!(r.ignoreMalformedPackets||t instanceof ml);if(n||a||Al(e.tag))await i.abort(t);else{const t=new bl(e.tag,e.packet);await i.write(t)}rs.printDebugError(t)}})))return await i.ready,void await i.close()}catch(e){await i.abort(e)}}));const n=Oo(this.stream);for(;;){const{done:e,value:t}=await n.read();if(e?this.stream=null:this.push(t),e||Al(t.constructor.tag))break}n.releaseLock()}write(){const e=[];for(let t=0;t{if(t.push(e),i+=e.length,i>=a){const e=Math.min(Math.log(i)/Math.LN2|0,30),r=2**e,n=rs.concat([dl(e)].concat(t));return t=[n.subarray(1+r)],i=t[0].length,n.subarray(0,1+r)}}),(()=>rs.concat([fl(i)].concat(t)))))}else{if(rs.isStream(n)){let t=0;e.push(Go(zo(n),(e=>{t+=e.length}),(()=>gl(r,t))))}else e.push(gl(r,n.length));e.push(n)}}return rs.concat(e)}filterByTag(...e){const t=new ep,r=e=>t=>e===t;for(let n=0;nt.constructor.tag===e))}indexOfTag(...e){const t=[],r=this,n=e=>t=>e===t;for(let i=0;i>4)}read(e){let t=0;try{this.type=es.read(es.s2k,e[t++])}catch(e){throw new ml("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==rs.uint8ArrayToString(e.subarray(t,t+3)))throw new ml("Unknown s2k type.");if(t+=3,1001!==1e3+e[t++])throw new ml("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new ml("Unknown s2k type.")}return t}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...rs.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([es.write(es.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return rs.concatUint8Array(e)}async produceKey(e,t){e=rs.encodeUTF8(e);const r=[];let n=0,i=0;for(;n{this.privateParams[e].fill(0),delete this.privateParams[e]})),this.privateParams=null,this.isEncrypted=!0)}}async function sp(e,t,r){const{keySize:n}=wf.getCipher(r);return e.produceKey(t,n)}var cp=cc((function(e){!function(t){function r(e){function t(){return Ee0&&(t.semantic=" "),t}}function A(e,t){return function(){var n,a,s,u,h;for(u=r(),n=o("star"),s=0,h=void 0===t?0:t;null!==(a=e());)s+=1,c(n,a);return s>=h?n:(i(u),null)}}function y(e){return e.charCodeAt(0)>=128}function m(){return s("cr",h("\r")())}function b(){return s("crlf",l(m,I)())}function w(){return s("dquote",h('"')())}function v(){return s("htab",h("\t")())}function I(){return s("lf",h("\n")())}function E(){return s("sp",h(" ")())}function B(){return s("vchar",u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n})))}function C(){return s("wsp",f(E,v)())}function _(){var e=s("quoted-pair",f(l(h("\\"),f(B,C)),ne)());return null===e?null:(e.semantic=e.semantic[1],e)}function k(){return s("fws",f(ae,l(d(l(A(C),p(b))),A(C,1)))())}function S(){return s("ctext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=39||42<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),te)())}function Q(){return s("ccontent",f(S,_,x)())}function x(){return s("comment",l(h("("),A(l(d(k),Q)),d(k),h(")"))())}function P(){return s("cfws",f(l(A(l(d(k),x),1),d(k)),k)())}function M(){return s("atext",u((function(t){var r="a"<=t&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(t)>=0;return e.rfc6532&&(r=r||y(t)),r})))}function U(){return s("atom",l(g(d(P)),A(M,1),g(d(P)))())}function D(){var e,t;return null===(e=s("dot-atom-text",A(M,1)()))||null!==(t=A(l(h("."),A(M,1)))())&&c(e,t),e}function R(){return s("dot-atom",l(p(d(P)),D,p(d(P)))())}function F(){return s("qtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33===r||35<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),re)())}function T(){return s("qcontent",f(F,_)())}function q(){return s("quoted-string",l(p(d(P)),p(w),A(l(d(g(k)),T)),d(p(k)),p(w),p(d(P)))())}function O(){return s("word",f(U,q)())}function K(){return s("address",f(H,G)())}function H(){return s("mailbox",f(N,X)())}function N(){return s("name-addr",l(d(j),L)())}function L(){return s("angle-addr",f(l(p(d(P)),h("<"),X,h(">"),p(d(P))),oe)())}function G(){return s("group",l(j,h(":"),d(Z),h(";"),p(d(P)))())}function j(){return s("display-name",(null!==(e=s("phrase",f(ie,A(O,1))()))&&(e.semantic=function(e){return e.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(e.semantic)),e));var e}function z(){return s("mailbox-list",f(l(H,A(l(h(","),H))),ue)())}function W(){return s("address-list",f(l(K,A(l(h(","),K))),he)())}function Z(){return s("group-list",f(z,p(P),le)())}function J(){return s("local-part",f(fe,R,q)())}function V(){return s("dtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=90||94<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),pe)())}function Y(){return s("domain-literal",l(p(d(P)),h("["),A(l(d(k),V)),d(k),h("]"),p(d(P)))())}function $(){return s("domain",(t=f(de,R,Y)(),e.rejectTLD&&t&&t.semantic&&t.semantic.indexOf(".")<0?null:(t&&(t.semantic=t.semantic.replace(/\s+/g,"")),t)));var t}function X(){return s("addr-spec",l(J,h("@"),$)())}function ee(){return e.strict?null:s("obs-NO-WS-CTL",u((function(e){var t=e.charCodeAt(0);return 1<=t&&t<=8||11===t||12===t||14<=t&&t<=31||127===t})))}function te(){return e.strict?null:s("obs-ctext",ee())}function re(){return e.strict?null:s("obs-qtext",ee())}function ne(){return e.strict?null:s("obs-qp",l(h("\\"),f(h("\0"),ee,I,m))())}function ie(){return e.strict?null:e.atInDisplayName?s("obs-phrase",l(O,A(f(O,h("."),h("@"),g(P))))()):s("obs-phrase",l(O,A(f(O,h("."),g(P))))())}function ae(){return e.strict?null:s("obs-FWS",A(l(p(d(b)),C),1)())}function oe(){return e.strict?null:s("obs-angle-addr",l(p(d(P)),h("<"),se,X,h(">"),p(d(P)))())}function se(){return e.strict?null:s("obs-route",l(ce,h(":"))())}function ce(){return e.strict?null:s("obs-domain-list",l(A(f(p(P),h(","))),h("@"),$,A(l(h(","),p(d(P)),d(l(h("@"),$)))))())}function ue(){return e.strict?null:s("obs-mbox-list",l(A(l(p(d(P)),h(","))),H,A(l(h(","),d(l(H,p(P))))))())}function he(){return e.strict?null:s("obs-addr-list",l(A(l(p(d(P)),h(","))),K,A(l(h(","),d(l(K,p(P))))))())}function le(){return e.strict?null:s("obs-group-list",l(A(l(p(d(P)),h(",")),1),p(d(P)))())}function fe(){return e.strict?null:s("obs-local-part",l(O,A(l(h("."),O)))())}function de(){return e.strict?null:s("obs-domain",l(U,A(l(h("."),U)))())}function pe(){return e.strict?null:s("obs-dtext",f(ee,_)())}function ge(e,t){var r,n,i;if(null==t)return null;for(n=[t];n.length>0;){if((i=n.pop()).name===e)return i;for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r])}return null}function Ae(e,t){var r,n,i,a,o;if(null==t)return null;for(n=[t],a=[],o={},r=0;r0;)if((i=n.pop()).name in o)a.push(i);else for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}function ye(t){var r,n,i,a,o;if(null===t)return null;for(r=[],n=Ae(["group","mailbox"],t),i=0;i1?null:t.addresses&&t.addresses[0]:null}(o):e.simple?o&&o.addresses:o}function me(e){var t,r=ge("display-name",e),n=[],i=Ae(["mailbox"],e);for(t=0;t0;)for("cfws"===(i=n.pop()).name&&a.push(i),r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}(0,e),i=Ae(["comment"],e),a=ge("local-part",r),o=ge("domain",r);return{node:e,parts:{name:t,address:r,local:a,domain:o,comments:n},type:e.name,name:we(t),address:we(r),local:we(a),domain:we(o),comments:ve(i),groupName:we(e.groupName)}}function we(e){return null!=e?e.semantic:null}function ve(e){var t="";if(e)for(var r=0;r`),t.userID=r.join(" "),t}read(e,t=hs){const r=rs.decodeUTF8(e);if(r.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:e,address:t,comments:n}=cp.parseOneAddress({input:r,atInDisplayName:!0});this.comment=n.replace(/^\(|\)$/g,""),this.name=e,this.email=t}catch(e){}this.userID=r}write(){return rs.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class hp extends op{static get tag(){return es.packet.secretSubkey}constructor(e=new Date,t=hs){super(e,t)}}async function lp(e,t,r,n,i=new Date,a){let o,s;for(let c=e.length-1;c>=0;c--)try{(!o||e[c].created>=o.created)&&(await e[c].verify(t,r,n,i,void 0,a),o=e[c])}catch(e){s=e}if(!o)throw rs.wrapError(`Could not find valid ${es.read(es.signature,r)} signature in key ${t.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((e,t,r)=>t+" "+r.toLowerCase())),s);return o}function fp(e,t,r=new Date){const n=rs.normalizeDate(r);if(null!==n){const r=Ap(e,t);return!(e.created<=n&&ne.equals(i.issuerKeyID)))||i.revoked||!1,i.revoked):c.length>0}function Ap(e,t){let r;return!1===t.keyNeverExpires&&(r=e.created.getTime()+1e3*t.keyExpirationTime),r?new Date(r):1/0}function yp(e,t){const r=e.algorithm;return r!==es.publicKey.rsaEncrypt&&r!==es.publicKey.elgamal&&r!==es.publicKey.ecdh&&r!==es.publicKey.x25519&&(!t.keyFlags||0!=(t.keyFlags[0]&es.keyFlags.signData))}function mp(e,t){const r=e.algorithm;return r!==es.publicKey.dsa&&r!==es.publicKey.rsaSign&&r!==es.publicKey.ecdsa&&r!==es.publicKey.eddsaLegacy&&r!==es.publicKey.ed25519&&(!t.keyFlags||0!=(t.keyFlags[0]&es.keyFlags.encryptCommunication)||0!=(t.keyFlags[0]&es.keyFlags.encryptStorage))}function bp(e,t){return!!t.allowInsecureDecryptionWithSigningKeys||!e.keyFlags||0!=(e.keyFlags[0]&es.keyFlags.encryptCommunication)||0!=(e.keyFlags[0]&es.keyFlags.encryptStorage)}function wp(e,t){const r=es.write(es.publicKey,e.algorithm),n=e.getAlgorithmInfo();if(t.rejectPublicKeyAlgorithms.has(r))throw Error(n.algorithm+" keys are considered too weak.");switch(r){case es.publicKey.rsaEncryptSign:case es.publicKey.rsaSign:case es.publicKey.rsaEncrypt:if(n.bitse.getKeys(s).length>0));return 0===c.length?null:(await Promise.all(c.map((async t=>{const a=await t.getSigningKey(s,e.created,void 0,n);if(e.revoked||await i.isRevoked(e,a.keyPacket,r,n))throw Error("User certificate is revoked");try{await e.verify(a.keyPacket,es.signature.certGeneric,o,r,void 0,n)}catch(e){throw rs.wrapError("User certificate is invalid",e)}}))),!0)}async verifyAllCertifications(e,t=new Date,r){const n=this,i=this.selfCertifications.concat(this.otherCertifications);return Promise.all(i.map((async i=>({keyID:i.issuerKeyID,valid:await n.verifyCertificate(i,e,t,r).catch((()=>!1))}))))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const r=this,n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};let a;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const a=this.selfCertifications[o];if(a.revoked||await r.isRevoked(a,void 0,e,t))throw Error("Self-certification is revoked");try{await a.verify(n,es.signature.certGeneric,i,e,void 0,t)}catch(e){throw rs.wrapError("Self-certification is invalid",e)}return!0}catch(e){a=e}throw a}async update(e,t,r){const n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};await pp(e,this,"selfCertifications",t,(async function(e){try{return await e.verify(n,es.signature.certGeneric,i,t,!1,r),!0}catch(e){return!1}})),await pp(e,this,"otherCertifications",t),await pp(e,this,"revocationSignatures",t,(function(e){return gp(n,es.signature.certRevocation,i,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=es.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=hs){const a={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new vp(a.userID||a.userAttribute,this.mainKey);return o.revocationSignatures.push(await dp(a,null,e,{signatureType:es.signature.certRevocation,reasonForRevocationFlag:es.write(es.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}}class Ip{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new ep;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new Ip(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,r=new Date,n=hs){const i=this.mainKey.keyPacket;return gp(i,es.signature.subkeyRevocation,{key:i,bind:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verify(e=new Date,t=hs){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket},i=await lp(this.bindingSignatures,r,es.signature.subkeyBinding,n,e,t);if(i.revoked||await this.isRevoked(i,null,e,t))throw Error("Subkey is revoked");if(fp(this.keyPacket,i,e))throw Error("Subkey is expired");return i}async getExpirationTime(e=new Date,t=hs){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket};let i;try{i=await lp(this.bindingSignatures,r,es.signature.subkeyBinding,n,e,t)}catch(e){return null}const a=Ap(this.keyPacket,i),o=i.getExpirationTime();return ai.bindingSignatures[t].created&&(i.bindingSignatures[t]=e),!1;try{return await e.verify(n,es.signature.subkeyBinding,a,t,void 0,r),!0}catch(e){return!1}})),await pp(e,this,"revocationSignatures",t,(function(e){return gp(n,es.signature.subkeyRevocation,a,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=es.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=hs){const a={key:e,bind:this.keyPacket},o=new Ip(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await dp(a,null,e,{signatureType:es.signature.subkeyRevocation,reasonForRevocationFlag:es.write(es.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((e=>{Ip.prototype[e]=function(){return this.keyPacket[e]()}}));const Ep=rs.constructAllowedPackets([Vd]),Bp=new Set([es.packet.publicKey,es.packet.privateKey]),Cp=new Set([es.packet.publicKey,es.packet.privateKey,es.packet.publicSubkey,es.packet.privateSubkey]);class _p{packetListToStructure(e,t=new Set){let r,n,i,a;for(const o of e){if(o instanceof bl){Cp.has(o.tag)&&!a&&(a=Bp.has(o.tag)?Bp:Cp);continue}const e=o.constructor.tag;if(a){if(!a.has(e))continue;a=null}if(t.has(e))throw Error("Unexpected packet type: "+e);switch(e){case es.packet.publicKey:case es.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,n=this.getKeyID(),!n)throw Error("Missing Key ID");break;case es.packet.userID:case es.packet.userAttribute:r=new vp(o,this),this.users.push(r);break;case es.packet.publicSubkey:case es.packet.secretSubkey:r=null,i=new Ip(o,this),this.subkeys.push(i);break;case es.packet.signature:switch(o.signatureType){case es.signature.certGeneric:case es.signature.certPersona:case es.signature.certCasual:case es.signature.certPositive:if(!r){rs.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(n)?r.selfCertifications.push(o):r.otherCertifications.push(o);break;case es.signature.certRevocation:r?r.revocationSignatures.push(o):this.directSignatures.push(o);break;case es.signature.key:this.directSignatures.push(o);break;case es.signature.subkeyBinding:if(!i){rs.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}i.bindingSignatures.push(o);break;case es.signature.keyRevocation:this.revocationSignatures.push(o);break;case es.signature.subkeyRevocation:if(!i){rs.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}i.revocationSignatures.push(o)}}}}toPacketList(){const e=new ep;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map((t=>e.push(...t.toPacketList()))),this.subkeys.map((t=>e.push(...t.toPacketList()))),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach((e=>{if(e.keyPacket=Object.create(Object.getPrototypeOf(e.keyPacket),Object.getOwnPropertyDescriptors(e.keyPacket)),!e.keyPacket.isDecrypted())return;const t={};Object.keys(e.keyPacket.privateParams).forEach((r=>{t[r]=new Uint8Array(e.keyPacket.privateParams[r])})),e.keyPacket.privateParams=t})),t}getSubkeys(e=null){return this.subkeys.filter((t=>!e||t.getKeyID().equals(e,!0)))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map((e=>e.getKeyID()))}getUserIDs(){return this.users.map((e=>e.userID?e.userID.userID:null)).filter((e=>null!==e))}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,r={},n=hs){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await lp(r.bindingSignatures,i,es.signature.subkeyBinding,e,t,n);if(!yp(r.keyPacket,a))continue;if(!a.embeddedSignature)throw Error("Missing embedded signature");return await lp([a.embeddedSignature],r.keyPacket,es.signature.keyBinding,e,t,n),wp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&yp(i,a.selfCertification))return wp(i,n),this}catch(e){o=e}throw rs.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,r={},n=hs){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await lp(r.bindingSignatures,i,es.signature.subkeyBinding,e,t,n);if(mp(r.keyPacket,a))return wp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&mp(i,a.selfCertification))return wp(i,n),this}catch(e){o=e}throw rs.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,r=new Date,n=hs){return gp(this.keyPacket,es.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verifyPrimaryKey(e=new Date,t={},r=hs){const n=this.keyPacket;if(await this.isRevoked(null,null,e,r))throw Error("Primary key is revoked");const{selfCertification:i}=await this.getPrimaryUser(e,t,r);if(fp(n,i,e))throw Error("Primary key is expired");const a=await lp(this.directSignatures,n,es.signature.key,{key:n},e,r).catch((()=>{}));if(a&&fp(n,a,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=hs){let r;try{const{selfCertification:n}=await this.getPrimaryUser(null,e,t),i=Ap(this.keyPacket,n),a=n.getExpirationTime(),o=await lp(this.directSignatures,this.keyPacket,es.signature.key,{key:this.keyPacket},null,t).catch((()=>{}));if(o){const e=Ap(this.keyPacket,o);r=Math.min(i,a,e)}else r=ie.subkeys.some((e=>t.hasSameFingerprintAs(e))))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,r)}const n=this.clone();return await pp(e,n,"revocationSignatures",t,(i=>gp(n.keyPacket,es.signature.keyRevocation,n,[i],null,e.keyPacket,t,r))),await pp(e,n,"directSignatures",t),await Promise.all(e.users.map((async e=>{const i=n.users.filter((t=>e.userID&&e.userID.equals(t.userID)||e.userAttribute&&e.userAttribute.equals(t.userAttribute)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.users.push(t)}}))),await Promise.all(e.subkeys.map((async e=>{const i=n.subkeys.filter((t=>t.hasSameFingerprintAs(e)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.subkeys.push(t)}}))),n}async getRevocationCertificate(e=new Date,t=hs){const r={key:this.keyPacket},n=await lp(this.revocationSignatures,this.keyPacket,es.signature.keyRevocation,r,e,t),i=new ep;return i.push(n),bs(es.armor.publicKey,i.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,r=hs){const n=await ms(e,r),i=(await ep.fromBinary(n.data,Ep,r)).findPacket(es.packet.signature);if(!i||i.signatureType!==es.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!i.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await i.verify(this.keyPacket,es.signature.keyRevocation,{key:this.keyPacket},t,void 0,r)}catch(e){throw rs.wrapError("Could not verify revocation signature",e)}const a=this.clone();return a.revocationSignatures.push(i),a}async signPrimaryUser(e,t,r,n=hs){const{index:i,user:a}=await this.getPrimaryUser(t,r,n),o=await a.certify(e,t,n),s=this.clone();return s.users[i]=o,s}async signAllUsers(e,t=new Date,r=hs){const n=this.clone();return n.users=await Promise.all(this.users.map((function(n){return n.certify(e,t,r)}))),n}async verifyPrimaryUser(e,t=new Date,r,n=hs){const i=this.keyPacket,{user:a}=await this.getPrimaryUser(t,r,n);return e?await a.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await a.verify(t,n).catch((()=>!1))}]}async verifyAllUsers(e,t=new Date,r=hs){const n=this.keyPacket,i=[];return await Promise.all(this.users.map((async a=>{const o=e?await a.verifyAllCertifications(e,t,r):[{keyID:n.getKeyID(),valid:await a.verify(t,r).catch((()=>!1))}];i.push(...o.map((e=>({userID:a.userID?a.userID.userID:null,userAttribute:a.userAttribute,keyID:e.keyID,valid:e.valid}))))}))),i}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((e=>{_p.prototype[e]=Ip.prototype[e]}));class kp extends _p{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([es.packet.secretKey,es.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=hs){return bs(es.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class Sp extends kp{constructor(e){if(super(),this.packetListToStructure(e,new Set([es.packet.publicKey,es.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new ep,t=this.toPacketList();for(const r of t)switch(r.constructor.tag){case es.packet.secretKey:{const t=np.fromSecretKeyPacket(r);e.push(t);break}case es.packet.secretSubkey:{const t=ip.fromSecretSubkeyPacket(r);e.push(t);break}default:e.push(r)}return new kp(e)}armor(e=hs){return bs(es.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,r={},n=hs){const i=this.keyPacket,a=[];for(let r=0;re.isDecrypted()))}async validate(e=hs){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const r=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});r&&!r.keyPacket.isDummy()&&(t=r.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const e=this.getKeys(),t=e.map((e=>e.keyPacket.isDummy())).every(Boolean);if(t)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(e.map((async e=>e.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()}))}async revoke({flag:e=es.reasonForRevocation.noReason,string:t=""}={},r=new Date,n=hs){if(!this.isPrivate())throw Error("Need private key for revoking");const i={key:this.keyPacket},a=this.clone();return a.revocationSignatures.push(await dp(i,null,this.keyPacket,{signatureType:es.signature.keyRevocation,reasonForRevocationFlag:es.write(es.reasonForRevocation,e),reasonForRevocationString:t},r,void 0,void 0,void 0,n)),a}async addSubkey(e={}){const t={...hs,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1),await dp(i,null,t,a,r.date,void 0,void 0,void 0,n)}(i,r,e,t),o=this.toPacketList();return o.push(i,a),new Sp(o)}}const Qp=rs.constructAllowedPackets([np,ip,op,hp,up,ap,Vd]);async function xp({armoredKey:e,binaryKey:t,config:r,...n}){if(r={...hs,...r},!e&&!t)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!rs.isString(e))throw Error("readKey: options.armoredKey must be a string");if(t&&!rs.isUint8Array(t))throw Error("readKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(e){const{type:t,data:n}=await ms(e,r);if(t!==es.armor.publicKey&&t!==es.armor.privateKey)throw Error("Armored text not of type key");a=n}else a=t;return function(e){for(const t of e)switch(t.constructor.tag){case es.packet.secretKey:return new Sp(e);case es.packet.publicKey:return new kp(e)}throw Error("No key packet found")}(await ep.fromBinary(a,Qp,r))}Object.keys(hs).length;const Pp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function Mp(){}const Up="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Dp(e){return"object"==typeof e&&null!==e||"function"==typeof e}const Rp=Mp,Fp=Promise,Tp=Promise.prototype.then,qp=Promise.resolve.bind(Fp),Op=Promise.reject.bind(Fp);function Kp(e){return new Fp(e)}function Hp(e){return qp(e)}function Np(e){return Op(e)}function Lp(e,t,r){return Tp.call(e,t,r)}function Gp(e,t,r){Lp(Lp(e,t,r),void 0,Rp)}function jp(e,t){Gp(e,t)}function zp(e,t){Gp(e,void 0,t)}function Wp(e,t,r){return Lp(e,t,r)}function Zp(e){Lp(e,void 0,Rp)}const Jp=(()=>{const e=Up&&Up.queueMicrotask;if("function"==typeof e)return e;const t=Hp(void 0);return e=>Lp(t,e)})();function Vp(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Yp(e,t,r){try{return Hp(Vp(e,t,r))}catch(e){return Np(e)}}class $p{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let n=r+1;const i=e._elements,a=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}function Xp(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?ng(e):"closed"===t._state?function(e){ng(e),og(e)}(e):ig(e,t._storedError)}function eg(e,t){return Ry(e._ownerReadableStream,t)}function tg(e){"readable"===e._ownerReadableStream._state?ag(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){ig(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function rg(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function ng(e){e._closedPromise=Kp(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function ig(e,t){ng(e),ag(e,t)}function ag(e,t){void 0!==e._closedPromise_reject&&(Zp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function og(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const sg=Pp("[[AbortSteps]]"),cg=Pp("[[ErrorSteps]]"),ug=Pp("[[CancelSteps]]"),hg=Pp("[[PullSteps]]"),lg=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},fg=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function dg(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(t+" is not an object.");var r}function pg(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function gg(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function Ag(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function yg(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function mg(e){return Number(e)}function bg(e){return 0===e?0:e}function wg(e,t){const r=Number.MAX_SAFE_INTEGER;let n=Number(e);if(n=bg(n),!lg(n))throw new TypeError(t+" is not a finite number");if(n=function(e){return bg(fg(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return lg(n)&&0!==n?n:0}function vg(e,t){if(!Uy(e))throw new TypeError(t+" is not a ReadableStream.")}function Ig(e){return new kg(e)}function Eg(e,t){e._reader._readRequests.push(t)}function Bg(e,t,r){const n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Cg(e){return e._reader._readRequests.length}function _g(e){const t=e._reader;return void 0!==t&&!!Sg(t)}class kg{constructor(e){if(Ag(e,1,"ReadableStreamDefaultReader"),vg(e,"First parameter"),Dy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Xp(this,e),this._readRequests=new $p}get closed(){return Sg(this)?this._closedPromise:Np(xg("closed"))}cancel(e=void 0){return Sg(this)?void 0===this._ownerReadableStream?Np(rg("cancel")):eg(this,e):Np(xg("cancel"))}read(){if(!Sg(this))return Np(xg("read"));if(void 0===this._ownerReadableStream)return Np(rg("read from"));let e,t;const r=Kp(((r,n)=>{e=r,t=n}));return Qg(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!Sg(this))throw xg("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tg(this)}}}function Sg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Qg(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[hg](t)}function xg(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let Pg;Object.defineProperties(kg.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(kg.prototype,Pp.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Pp.asyncIterator&&(Pg={[Pp.asyncIterator](){return this}},Object.defineProperty(Pg,Pp.asyncIterator,{enumerable:!1}));class Mg{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Wp(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?Wp(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(void 0===e._ownerReadableStream)return Np(rg("iterate"));let t,r;const n=Kp(((e,n)=>{t=e,r=n}));return Qg(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,Jp((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,tg(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,tg(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(void 0===t._ownerReadableStream)return Np(rg("finish iterating"));if(!this._preventCancel){const r=eg(t,e);return tg(t),Wp(r,(()=>({value:e,done:!0})))}return tg(t),Hp({value:e,done:!0})}}const Ug={next(){return Dg(this)?this._asyncIteratorImpl.next():Np(Rg("next"))},return(e){return Dg(this)?this._asyncIteratorImpl.return(e):Np(Rg("return"))}};function Dg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Rg(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==Pg&&Object.setPrototypeOf(Ug,Pg);const Fg=Number.isNaN||function(e){return e!=e};function Tg(e){return!!function(e){return"number"==typeof e&&(!Fg(e)&&!(e<0))}(e)&&e!==1/0}function qg(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function Og(e,t,r){if(!Tg(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Kg(e){e._queue=new $p,e._queueTotalSize=0}function Hg(e){return e.slice()}class Ng{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!jg(this))throw oA("view");return this._view}respond(e){if(!jg(this))throw oA("respond");if(Ag(e,1,"respond"),e=wg(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!Tg(t=Number(t)))throw new RangeError("bytesWritten must be a finite");tA(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!jg(this))throw oA("respondWithNewView");if(Ag(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){const r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,tA(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Ng.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Ng.prototype,Pp.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Lg{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Gg(this))throw sA("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Ng.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}get desiredSize(){if(!Gg(this))throw sA("desiredSize");return aA(this)}close(){if(!Gg(this))throw sA("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);!function(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw iA(e,t),t}nA(e),Fy(t)}}(this)}enqueue(e){if(!Gg(this))throw sA("enqueue");if(Ag(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);!function(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const n=t.buffer,i=t.byteOffset,a=t.byteLength,o=n;_g(r)?0===Cg(r)?Jg(e,o,i,a):Bg(r,new Uint8Array(o,i,a),!1):hA(r)?(Jg(e,o,i,a),eA(e)):Jg(e,o,i,a),zg(e)}(this,e)}error(e=void 0){if(!Gg(this))throw sA("error");iA(this,e)}[ug](e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0),Kg(this);const t=this._cancelAlgorithm(e);return nA(this),t}[hg](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0){const t=this._queue.shift();this._queueTotalSize-=t.byteLength,$g(this);const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}const r=this._autoAllocateChunkSize;if(void 0!==r){let n;try{n=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const i={buffer:n,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}Eg(t,e),zg(this)}}function Gg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function jg(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function zg(e){const t=function(e){const t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(_g(t)&&Cg(t)>0)return!0;if(hA(t)&&uA(t)>0)return!0;return aA(e)>0}(e);t&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Gp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,zg(e))}),(t=>{iA(e,t)}))))}function Wg(e,t){let r=!1;"closed"===e._state&&(r=!0);const n=Zg(t);"default"===t.readerType?Bg(e,n,r):function(e,t,r){const n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Zg(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Jg(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Vg(e,t){const r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,o=a-a%r;let s=i,c=!1;o>n&&(s=o-t.bytesFilled,c=!0);const u=e._queue;for(;s>0;){const r=u.peek(),n=Math.min(s,r.byteLength),i=t.byteOffset+t.bytesFilled;h=t.buffer,l=i,f=r.buffer,d=r.byteOffset,p=n,new Uint8Array(h).set(new Uint8Array(f,d,p),l),r.byteLength===n?u.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,Yg(e,n,t),s-=n}var h,l,f,d,p;return c}function Yg(e,t,r){Xg(e),r.bytesFilled+=t}function $g(e){0===e._queueTotalSize&&e._closeRequested?(nA(e),Fy(e._controlledReadableByteStream)):zg(e)}function Xg(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function eA(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();Vg(e,t)&&(rA(e),Wg(e._controlledReadableByteStream,t))}}function tA(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;const r=e._controlledReadableByteStream;if(hA(r))for(;uA(r)>0;)Wg(r,rA(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Yg(e,t,r),r.bytesFilled0){const t=r.byteOffset+r.bytesFilled,i=r.buffer.slice(t-n,t);Jg(e,i,0,i.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,Wg(e._controlledReadableByteStream,r),eA(e)}(e,t,r);zg(e)}function rA(e){const t=e._pendingPullIntos.shift();return Xg(e),t}function nA(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function iA(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(function(e){Xg(e),e._pendingPullIntos=new $p}(e),Kg(e),nA(e),Ty(r,t))}function aA(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function oA(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function sA(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function cA(e,t){e._reader._readIntoRequests.push(t)}function uA(e){return e._reader._readIntoRequests.length}function hA(e){const t=e._reader;return void 0!==t&&!!fA(t)}Object.defineProperties(Lg.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Lg.prototype,Pp.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class lA{constructor(e){if(Ag(e,1,"ReadableStreamBYOBReader"),vg(e,"First parameter"),Dy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Gg(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Xp(this,e),this._readIntoRequests=new $p}get closed(){return fA(this)?this._closedPromise:Np(dA("closed"))}cancel(e=void 0){return fA(this)?void 0===this._ownerReadableStream?Np(rg("cancel")):eg(this,e):Np(dA("cancel"))}read(e){if(!fA(this))return Np(dA("read"));if(!ArrayBuffer.isView(e))return Np(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Np(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Np(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Np(rg("read from"));let t,r;const n=Kp(((e,n)=>{t=e,r=n}));return function(e,t,r){const n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){const n=e._controlledReadableByteStream;let i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);const a=t.constructor,o={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),void cA(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Vg(e,o)){const t=Zg(o);return $g(e),void r._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return iA(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(o),cA(n,r),zg(e)}else{const e=new a(o.buffer,o.byteOffset,0);r._closeSteps(e)}}(n._readableStreamController,t,r)}(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),n}releaseLock(){if(!fA(this))throw dA("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tg(this)}}}function fA(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function dA(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function pA(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Fg(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function gA(e){const{size:t}=e;return t||(()=>1)}function AA(e,t){dg(e,t);const r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:mg(r),size:void 0===n?void 0:yA(n,t+" has member 'size' that")}}function yA(e,t){return pg(e,t),t=>mg(e(t))}function mA(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function bA(e,t,r){return pg(e,r),()=>Yp(e,t,[])}function wA(e,t,r){return pg(e,r),r=>Vp(e,t,[r])}function vA(e,t,r){return pg(e,r),(r,n)=>Yp(e,t,[r,n])}function IA(e,t){if(!_A(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(lA.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(lA.prototype,Pp.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class EA{constructor(e={},t={}){void 0===e?e=null:gg(e,"First parameter");const r=AA(t,"Second parameter"),n=function(e,t){dg(e,t);const r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,a=null==e?void 0:e.type,o=null==e?void 0:e.write;return{abort:void 0===r?void 0:mA(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:bA(n,e,t+" has member 'close' that"),start:void 0===i?void 0:wA(i,e,t+" has member 'start' that"),write:void 0===o?void 0:vA(o,e,t+" has member 'write' that"),type:a}}(e,"First parameter");if(CA(this),void 0!==n.type)throw new RangeError("Invalid type is specified");const i=gA(r);!function(e,t,r,n){const i=Object.create(LA.prototype);let a=()=>{},o=()=>Hp(void 0),s=()=>Hp(void 0),c=()=>Hp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.write&&(o=e=>t.write(e,i)),void 0!==t.close&&(s=()=>t.close()),void 0!==t.abort&&(c=e=>t.abort(e)),GA(e,i,a,o,s,c,r,n)}(this,n,pA(r,1),i)}get locked(){if(!_A(this))throw YA("locked");return kA(this)}abort(e=void 0){return _A(this)?kA(this)?Np(new TypeError("Cannot abort a stream that already has a writer")):SA(this,e):Np(YA("abort"))}close(){return _A(this)?kA(this)?Np(new TypeError("Cannot close a stream that already has a writer")):UA(this)?Np(new TypeError("Cannot close an already-closing stream")):QA(this):Np(YA("close"))}getWriter(){if(!_A(this))throw YA("getWriter");return BA(this)}}function BA(e){return new FA(e)}function CA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new $p,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function _A(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function kA(e){return void 0!==e._writer}function SA(e,t){const r=e._state;if("closed"===r||"errored"===r)return Hp(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let n=!1;"erroring"===r&&(n=!0,t=void 0);const i=Kp(((r,i)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||PA(e,t),i}function QA(e){const t=e._state;if("closed"===t||"errored"===t)return Np(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Kp(((t,r)=>{const n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;var i;return void 0!==n&&e._backpressure&&"writable"===t&&cy(n),Og(i=e._writableStreamController,NA,0),WA(i),r}function xA(e,t){"writable"!==e._state?MA(e):PA(e,t)}function PA(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const n=e._writer;void 0!==n&&OA(n,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&MA(e)}function MA(e){e._state="errored",e._writableStreamController[cg]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new $p,void 0===e._pendingAbortRequest)return void DA(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void DA(e);Gp(e._writableStreamController[sg](r._reason),(()=>{r._resolve(),DA(e)}),(t=>{r._reject(t),DA(e)}))}function UA(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function DA(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&ry(t,e._storedError)}function RA(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){iy(e)}(r):cy(r)),e._backpressure=t}Object.defineProperties(EA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(EA.prototype,Pp.toStringTag,{value:"WritableStream",configurable:!0});class FA{constructor(e){if(Ag(e,1,"WritableStreamDefaultWriter"),IA(e,"First parameter"),kA(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!UA(e)&&e._backpressure?iy(this):oy(this),ey(this);else if("erroring"===t)ay(this,e._storedError),ey(this);else if("closed"===t)oy(this),ey(this),ny(this);else{const t=e._storedError;ay(this,t),ty(this,t)}}get closed(){return TA(this)?this._closedPromise:Np($A("closed"))}get desiredSize(){if(!TA(this))throw $A("desiredSize");if(void 0===this._ownerWritableStream)throw XA("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:zA(t._writableStreamController)}(this)}get ready(){return TA(this)?this._readyPromise:Np($A("ready"))}abort(e=void 0){return TA(this)?void 0===this._ownerWritableStream?Np(XA("abort")):function(e,t){return SA(e._ownerWritableStream,t)}(this,e):Np($A("abort"))}close(){if(!TA(this))return Np($A("close"));const e=this._ownerWritableStream;return void 0===e?Np(XA("close")):UA(e)?Np(new TypeError("Cannot close an already-closing stream")):qA(this)}releaseLock(){if(!TA(this))throw $A("releaseLock");void 0!==this._ownerWritableStream&&KA(this)}write(e=void 0){return TA(this)?void 0===this._ownerWritableStream?Np(XA("write to")):HA(this,e):Np($A("write"))}}function TA(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function qA(e){return QA(e._ownerWritableStream)}function OA(e,t){"pending"===e._readyPromiseState?sy(e,t):function(e,t){ay(e,t)}(e,t)}function KA(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");OA(e,r),function(e,t){"pending"===e._closedPromiseState?ry(e,t):function(e,t){ty(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function HA(e,t){const r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return ZA(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return Np(XA("write to"));const a=r._state;if("errored"===a)return Np(r._storedError);if(UA(r)||"closed"===a)return Np(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Np(r._storedError);const o=function(e){return Kp(((t,r)=>{const n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{Og(e,t,r)}catch(t){return void ZA(e,t)}const n=e._controlledWritableStream;UA(n)||"writable"!==n._state||RA(n,JA(e)),WA(e)}(n,t,i),o}Object.defineProperties(FA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(FA.prototype,Pp.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const NA={};class LA{constructor(){throw new TypeError("Illegal constructor")}error(e=void 0){if(!function(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&VA(this,e)}[sg](e){const t=this._abortAlgorithm(e);return jA(this),t}[cg](){Kg(this)}}function GA(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Kg(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;const c=JA(t);RA(e,c),Gp(Hp(r()),(()=>{t._started=!0,WA(t)}),(r=>{t._started=!0,xA(e,r)}))}function jA(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function zA(e){return e._strategyHWM-e._queueTotalSize}function WA(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void MA(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===NA?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),qg(e);const r=e._closeAlgorithm();jA(e),Gp(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&ny(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),xA(e,t)}(t,e)}))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r);Gp(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(qg(e),!UA(r)&&"writable"===t){const t=JA(e);RA(r,t)}WA(e)}),(t=>{"writable"===r._state&&jA(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,xA(e,t)}(r,t)}))}(e,r)}function ZA(e,t){"writable"===e._controlledWritableStream._state&&VA(e,t)}function JA(e){return zA(e)<=0}function VA(e,t){const r=e._controlledWritableStream;jA(e),PA(r,t)}function YA(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function $A(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function XA(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function ey(e){e._closedPromise=Kp(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function ty(e,t){ey(e),ry(e,t)}function ry(e,t){void 0!==e._closedPromise_reject&&(Zp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function ny(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function iy(e){e._readyPromise=Kp(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function ay(e,t){iy(e),sy(e,t)}function oy(e){iy(e),cy(e)}function sy(e,t){void 0!==e._readyPromise_reject&&(Zp(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function cy(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(LA.prototype,{error:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(LA.prototype,Pp.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const uy="undefined"!=typeof DOMException?DOMException:void 0,hy=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(uy)?uy:function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function ly(e,t,r,n,i,a){const o=Ig(e),s=BA(t);e._disturbed=!0;let c=!1,u=Hp(void 0);return Kp(((h,l)=>{let f;if(void 0!==a){if(f=()=>{const r=new hy("Aborted","AbortError"),a=[];n||a.push((()=>"writable"===t._state?SA(t,r):Hp(void 0))),i||a.push((()=>"readable"===e._state?Ry(e,r):Hp(void 0))),g((()=>Promise.all(a.map((e=>e())))),!0,r)},a.aborted)return void f();a.addEventListener("abort",f)}if(p(e,o._closedPromise,(e=>{n?A(!0,e):g((()=>SA(t,e)),!0,e)})),p(t,s._closedPromise,(t=>{i?A(!0,t):g((()=>Ry(e,t)),!0,t)})),function(e,t,r){"closed"===e._state?r():jp(t,r)}(e,o._closedPromise,(()=>{r?A():g((()=>function(e){const t=e._ownerWritableStream,r=t._state;return UA(t)||"closed"===r?Hp(void 0):"errored"===r?Np(t._storedError):qA(e)}(s)))})),UA(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");i?A(!0,t):g((()=>Ry(e,t)),!0,t)}function d(){const e=u;return Lp(u,(()=>e!==u?d():void 0))}function p(e,t,r){"errored"===e._state?r(e._storedError):zp(t,r)}function g(e,r,n){function i(){Gp(e(),(()=>y(r,n)),(e=>y(!0,e)))}c||(c=!0,"writable"!==t._state||UA(t)?i():jp(d(),i))}function A(e,r){c||(c=!0,"writable"!==t._state||UA(t)?y(e,r):jp(d(),(()=>y(e,r))))}function y(e,t){KA(s),tg(o),void 0!==a&&a.removeEventListener("abort",f),e?l(t):h(void 0)}Zp(Kp(((e,t)=>{!function r(n){n?e():Lp(c?Hp(!0):Lp(s._readyPromise,(()=>Kp(((e,t)=>{Qg(o,{_chunkSteps:t=>{u=Lp(HA(s,t),void 0,Mp),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class fy{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!dy(this))throw Ey("desiredSize");return wy(this)}close(){if(!dy(this))throw Ey("close");if(!vy(this))throw new TypeError("The stream is not in a state that permits close");yy(this)}enqueue(e=void 0){if(!dy(this))throw Ey("enqueue");if(!vy(this))throw new TypeError("The stream is not in a state that permits enqueue");return my(this,e)}error(e=void 0){if(!dy(this))throw Ey("error");by(this,e)}[ug](e){Kg(this);const t=this._cancelAlgorithm(e);return Ay(this),t}[hg](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=qg(this);this._closeRequested&&0===this._queue.length?(Ay(this),Fy(t)):py(this),e._chunkSteps(r)}else Eg(t,e),py(this)}}function dy(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function py(e){gy(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Gp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,py(e))}),(t=>{by(e,t)}))))}function gy(e){const t=e._controlledReadableStream;return!!vy(e)&&(!!e._started&&(!!(Dy(t)&&Cg(t)>0)||wy(e)>0))}function Ay(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function yy(e){if(!vy(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Ay(e),Fy(t))}function my(e,t){if(!vy(e))return;const r=e._controlledReadableStream;if(Dy(r)&&Cg(r)>0)Bg(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw by(e,t),t}try{Og(e,t,r)}catch(t){throw by(e,t),t}}py(e)}function by(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(Kg(e),Ay(e),Ty(r,t))}function wy(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function vy(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function Iy(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Kg(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,Gp(Hp(r()),(()=>{t._started=!0,py(t)}),(e=>{by(t,e)}))}function Ey(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function By(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function Cy(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function _y(e,t,r){return pg(e,r),r=>Vp(e,t,[r])}function ky(e,t){if("bytes"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Sy(e,t){if("byob"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Qy(e,t){dg(e,t);const r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!n,preventClose:!!i,signal:a}}Object.defineProperties(fy.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(fy.prototype,Pp.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class xy{constructor(e={},t={}){void 0===e?e=null:gg(e,"First parameter");const r=AA(t,"Second parameter"),n=function(e,t){dg(e,t);const r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,o=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:wg(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:By(i,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:Cy(a,r,t+" has member 'pull' that"),start:void 0===o?void 0:_y(o,r,t+" has member 'start' that"),type:void 0===s?void 0:ky(s,t+" has member 'type' that")}}(e,"First parameter");if(My(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){const n=Object.create(Lg.prototype);let i=()=>{},a=()=>Hp(void 0),o=()=>Hp(void 0);void 0!==t.start&&(i=()=>t.start(n)),void 0!==t.pull&&(a=()=>t.pull(n)),void 0!==t.cancel&&(o=e=>t.cancel(e));const s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Kg(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new $p,e._readableStreamController=t,Gp(Hp(r()),(()=>{t._started=!0,zg(t)}),(e=>{iA(t,e)}))}(e,n,i,a,o,r,s)}(this,n,pA(r,0))}else{const e=gA(r);!function(e,t,r,n){const i=Object.create(fy.prototype);let a=()=>{},o=()=>Hp(void 0),s=()=>Hp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.pull&&(o=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e)),Iy(e,i,a,o,s,r,n)}(this,n,pA(r,1),e)}}get locked(){if(!Uy(this))throw qy("locked");return Dy(this)}cancel(e=void 0){return Uy(this)?Dy(this)?Np(new TypeError("Cannot cancel a stream that already has a reader")):Ry(this,e):Np(qy("cancel"))}getReader(e=void 0){if(!Uy(this))throw qy("getReader");const t=function(e,t){dg(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:Sy(r,t+" has member 'mode' that")}}(e,"First parameter");return void 0===t.mode?Ig(this):function(e){return new lA(e)}(this)}pipeThrough(e,t={}){if(!Uy(this))throw qy("pipeThrough");Ag(e,1,"pipeThrough");const r=function(e,t){dg(e,t);const r=null==e?void 0:e.readable;yg(r,"readable","ReadableWritablePair"),vg(r,t+" has member 'readable' that");const n=null==e?void 0:e.writable;return yg(n,"writable","ReadableWritablePair"),IA(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=Qy(t,"Second parameter");if(Dy(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(kA(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Zp(ly(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!Uy(this))return Np(qy("pipeTo"));if(void 0===e)return Np("Parameter 1 is required in 'pipeTo'.");if(!_A(e))return Np(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Qy(t,"Second parameter")}catch(e){return Np(e)}return Dy(this)?Np(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):kA(e)?Np(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ly(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!Uy(this))throw qy("tee");const e=function(e,t){const r=Ig(e);let n,i,a,o,s,c=!1,u=!1,h=!1;const l=Kp((e=>{s=e}));function f(){return c||(c=!0,Qg(r,{_chunkSteps:e=>{Jp((()=>{c=!1;const t=e,r=e;u||my(a._readableStreamController,t),h||my(o._readableStreamController,r)}))},_closeSteps:()=>{c=!1,u||yy(a._readableStreamController),h||yy(o._readableStreamController),u&&h||s(void 0)},_errorSteps:()=>{c=!1}})),Hp(void 0)}function d(){}return a=Py(d,f,(function(t){if(u=!0,n=t,h){const t=Hg([n,i]),r=Ry(e,t);s(r)}return l})),o=Py(d,f,(function(t){if(h=!0,i=t,u){const t=Hg([n,i]),r=Ry(e,t);s(r)}return l})),zp(r._closedPromise,(e=>{by(a._readableStreamController,e),by(o._readableStreamController,e),u&&h||s(void 0)})),[a,o]}(this);return Hg(e)}values(e=void 0){if(!Uy(this))throw qy("values");return function(e,t){const r=Ig(e),n=new Mg(r,t),i=Object.create(Ug);return i._asyncIteratorImpl=n,i}(this,function(e,t){return dg(e,"First parameter"),{preventCancel:!!(null==e?void 0:e.preventCancel)}}(e).preventCancel)}}function Py(e,t,r,n=1,i=(()=>1)){const a=Object.create(xy.prototype);return My(a),Iy(a,Object.create(fy.prototype),e,t,r,n,i),a}function My(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Uy(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Dy(e){return void 0!==e._reader}function Ry(e,t){return e._disturbed=!0,"closed"===e._state?Hp(void 0):"errored"===e._state?Np(e._storedError):(Fy(e),Wp(e._readableStreamController[ug](t),Mp))}function Fy(e){e._state="closed";const t=e._reader;void 0!==t&&(og(t),Sg(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new $p))}function Ty(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(ag(r,t),Sg(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new $p):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new $p))}function qy(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Oy(e,t){dg(e,t);const r=null==e?void 0:e.highWaterMark;return yg(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:mg(r)}}Object.defineProperties(xy.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(xy.prototype,Pp.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Pp.asyncIterator&&Object.defineProperty(xy.prototype,Pp.asyncIterator,{value:xy.prototype.values,writable:!0,configurable:!0});const Ky=function(e){return e.byteLength};class Hy{constructor(e){Ag(e,1,"ByteLengthQueuingStrategy"),e=Oy(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ly(this))throw Ny("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ly(this))throw Ny("size");return Ky}}function Ny(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Ly(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(Hy.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Hy.prototype,Pp.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Gy=function(){return 1};class jy{constructor(e){Ag(e,1,"CountQueuingStrategy"),e=Oy(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Wy(this))throw zy("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Wy(this))throw zy("size");return Gy}}function zy(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Wy(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function Zy(e,t,r){return pg(e,r),r=>Yp(e,t,[r])}function Jy(e,t,r){return pg(e,r),r=>Vp(e,t,[r])}function Vy(e,t,r){return pg(e,r),(r,n)=>Yp(e,t,[r,n])}Object.defineProperties(jy.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(jy.prototype,Pp.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Yy{constructor(e={},t={},r={}){void 0===e&&(e=null);const n=AA(t,"Second parameter"),i=AA(r,"Third parameter"),a=function(e,t){dg(e,t);const r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,o=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Zy(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===i?void 0:Jy(i,e,t+" has member 'start' that"),transform:void 0===a?void 0:Vy(a,e,t+" has member 'transform' that"),writableType:o}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");const o=pA(i,0),s=gA(i),c=pA(n,1),u=gA(n);let h;!function(e,t,r,n,i,a){function o(){return t}e._writable=function(e,t,r,n,i=1,a=(()=>1)){const o=Object.create(EA.prototype);return CA(o),GA(o,Object.create(LA.prototype),e,t,r,n,i,a),o}(o,(function(t){return function(e,t){const r=e._transformStreamController;return e._backpressure?Wp(e._backpressureChangePromise,(()=>{const n=e._writable;if("erroring"===n._state)throw n._storedError;return om(r,t)})):om(r,t)}(e,t)}),(function(){return function(e){const t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return im(r),Wp(n,(()=>{if("errored"===t._state)throw t._storedError;yy(t._readableStreamController)}),(r=>{throw Xy(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return Xy(e,t),Hp(void 0)}(e,t)}),r,n),e._readable=Py(o,(function(){return function(e){return tm(e,!1),e._backpressureChangePromise}(e)}),(function(t){return em(e,t),Hp(void 0)}),i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,tm(e,!0),e._transformStreamController=void 0}(this,Kp((e=>{h=e})),c,u,o,s),function(e,t){const r=Object.create(rm.prototype);let n=e=>{try{return am(r,e),Hp(void 0)}catch(e){return Np(e)}},i=()=>Hp(void 0);void 0!==t.transform&&(n=e=>t.transform(e,r)),void 0!==t.flush&&(i=()=>t.flush(r)),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,a),void 0!==a.start?h(a.start(this._transformStreamController)):h(void 0)}get readable(){if(!$y(this))throw cm("readable");return this._readable}get writable(){if(!$y(this))throw cm("writable");return this._writable}}function $y(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Xy(e,t){by(e._readable._readableStreamController,t),em(e,t)}function em(e,t){im(e._transformStreamController),ZA(e._writable._writableStreamController,t),e._backpressure&&tm(e,!1)}function tm(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Kp((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(Yy.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(Yy.prototype,Pp.toStringTag,{value:"TransformStream",configurable:!0});class rm{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!nm(this))throw sm("desiredSize");return wy(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!nm(this))throw sm("enqueue");am(this,e)}error(e=void 0){if(!nm(this))throw sm("error");var t;t=e,Xy(this._controlledTransformStream,t)}terminate(){if(!nm(this))throw sm("terminate");!function(e){const t=e._controlledTransformStream;yy(t._readable._readableStreamController),em(t,new TypeError("TransformStream terminated"))}(this)}}function nm(e){return!!Dp(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function im(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function am(e,t){const r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!vy(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{my(n,t)}catch(e){throw em(r,e),r._readable._storedError}const i=function(e){return!gy(e)}(n);i!==r._backpressure&&tm(r,!0)}function om(e,t){return Wp(e._transformAlgorithm(t),void 0,(t=>{throw Xy(e._controlledTransformStream,t),t}))}function sm(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function cm(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(rm.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Pp.toStringTag&&Object.defineProperty(rm.prototype,Pp.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var um=function(e,t){return um=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},um(e,t) /*! ***************************************************************************** Copyright (c) Microsoft Corporation. diff --git a/dist/doip.fetchers.minimal.js b/dist/doip.fetchers.minimal.js index 84cb7f6..5a82683 100644 --- a/dist/doip.fetchers.minimal.js +++ b/dist/doip.fetchers.minimal.js @@ -5988,7 +5988,7 @@ var doipFetchers = (function (exports) { * doip.js library version * @constant {string} */ - const version = '2.0.1'; + const version = '2.1.0-rc.1'; /* Copyright 2022 Yarmo Mackenbach diff --git a/dist/doip.fetchers.minimal.min.js b/dist/doip.fetchers.minimal.min.js index 7874907..d2ec53e 100644 --- a/dist/doip.fetchers.minimal.min.js +++ b/dist/doip.fetchers.minimal.min.js @@ -1,4 +1,4 @@ -var doipFetchers=function(e){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:i}=Object,a=(o=Object.create(null),e=>{const t=n.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>a(t)===e),c=e=>t=>typeof t===e,{isArray:u}=Array,h=c("undefined");const l=s("ArrayBuffer");const f=c("string"),d=c("function"),p=c("number"),g=e=>null!==e&&"object"==typeof e,A=e=>{if("object"!==a(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=s("Date"),m=s("File"),b=s("Blob"),w=s("FileList"),v=s("URLSearchParams");function I(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n0;)if(n=r[i],t===n.toLowerCase())return n;return null}const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t,C=e=>!h(e)&&e!==B;const _=(k="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>k&&e instanceof k);var k;const S=s("HTMLFormElement"),Q=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),x=s("RegExp"),P=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};I(r,((r,i)=>{let a;!1!==(a=t(r,i,e))&&(n[i]=a||r)})),Object.defineProperties(e,n)},M="abcdefghijklmnopqrstuvwxyz",U="0123456789",D={DIGIT:U,ALPHA:M,ALPHA_DIGIT:M+M.toUpperCase()+U};const R=s("AsyncFunction");var F={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&d(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||d(e.append)&&("formdata"===(t=a(e))||"object"===t&&d(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:f,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:A,isUndefined:h,isDate:y,isFile:m,isBlob:b,isRegExp:x,isFunction:d,isStream:e=>g(e)&&d(e.pipe),isURLSearchParams:v,isTypedArray:_,isFileList:w,forEach:I,merge:function e(){const{caseless:t}=C(this)&&this||{},r={},n=(n,i)=>{const a=t&&E(r,i)||i;A(r[a])&&A(n)?r[a]=e(r[a],n):A(n)?r[a]=e({},n):u(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e(I(t,((t,i)=>{n&&d(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const c={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&i(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!p(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:S,hasOwnProperty:Q,hasOwnProp:Q,reduceDescriptors:P,freezeMethods:e=>{P(e,((t,r)=>{if(d(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];d(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:B,isContextDefined:C,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&d(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return I(e,((e,t)=>{const a=r(e,n+1);!h(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:R,isThenable:e=>e&&(g(e)||d(e))&&d(e.then)&&d(e.catch)},T=[],q=[],O="undefined"!=typeof Uint8Array?Uint8Array:Array,K=!1;function H(){K=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)T[t]=e[t],q[e.charCodeAt(t)]=t;q["-".charCodeAt(0)]=62,q["_".charCodeAt(0)]=63}function N(e,t,r){for(var n,i,a=[],o=t;o>18&63]+T[i>>12&63]+T[i>>6&63]+T[63&i]);return a.join("")}function L(e){var t;K||H();for(var r=e.length,n=r%3,i="",a=[],o=16383,s=0,c=r-n;sc?c:s+o));return 1===n?(t=e[r-1],i+=T[t>>2],i+=T[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=T[t>>10],i+=T[t>>4&63],i+=T[t<<2&63],i+="="),a.push(i),a.join("")}function G(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=e[t+l];for(l+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+l],l+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+l],l+=f,h-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)}function j(e,t,r,n,i,a){var o,s,c,u=8*a-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=h?(s=0,o=h):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*g}var z={}.toString,W=Array.isArray||function(e){return"[object Array]"==z.call(e)};Y.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT;var Z=J();function J(){return Y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function V(e,t){if(J()=J())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J().toString(16)+" bytes");return 0|e}function ne(e){return!(null==e||!e._isBuffer)}function ie(e,t){if(ne(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Pe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Me(e).length;default:if(n)return Pe(e).length;t=(""+t).toLowerCase(),n=!0}}function ae(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return we(this,t,r);case"utf8":case"utf-8":return Ae(this,t,r);case"ascii":return me(this,t,r);case"latin1":case"binary":return be(this,t,r);case"base64":return ge(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ve(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function oe(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function se(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Y.from(t,n)),ne(t))return 0===t.length?-1:ce(e,t,r,n,i);if("number"==typeof t)return t&=255,Y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ce(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ce(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){for(var l=!0,f=0;fi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function ge(e,t,r){return 0===t&&r===e.length?L(e):L(e.slice(t,r))}function Ae(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(h=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(h=c)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(e){var t=e.length;if(t<=ye)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},Y.prototype.compare=function(e,t,r,n,i){if(!ne(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),u=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return ue(this,e,t,r);case"utf8":case"utf-8":return he(this,e,t,r);case"ascii":return le(this,e,t,r);case"latin1":case"binary":return fe(this,e,t,r);case"base64":return de(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ye=4096;function me(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Ee(e,t,r,n,i,a){if(!ne(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Be(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Ce(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function _e(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ke(e,t,r,n,i){return i||_e(e,0,r,4),j(e,t,r,n,23,4),r+4}function Se(e,t,r,n,i){return i||_e(e,0,r,8),j(e,t,r,n,52,8),r+8}Y.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},Y.prototype.readUInt8=function(e,t){return t||Ie(e,1,this.length),this[e]},Y.prototype.readUInt16LE=function(e,t){return t||Ie(e,2,this.length),this[e]|this[e+1]<<8},Y.prototype.readUInt16BE=function(e,t){return t||Ie(e,2,this.length),this[e]<<8|this[e+1]},Y.prototype.readUInt32LE=function(e,t){return t||Ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Y.prototype.readUInt32BE=function(e,t){return t||Ie(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Y.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Ie(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},Y.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Ie(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Y.prototype.readInt8=function(e,t){return t||Ie(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Y.prototype.readInt16LE=function(e,t){t||Ie(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Y.prototype.readInt16BE=function(e,t){t||Ie(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Y.prototype.readInt32LE=function(e,t){return t||Ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Y.prototype.readInt32BE=function(e,t){return t||Ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Y.prototype.readFloatLE=function(e,t){return t||Ie(e,4,this.length),G(this,e,!0,23,4)},Y.prototype.readFloatBE=function(e,t){return t||Ie(e,4,this.length),G(this,e,!1,23,4)},Y.prototype.readDoubleLE=function(e,t){return t||Ie(e,8,this.length),G(this,e,!0,52,8)},Y.prototype.readDoubleBE=function(e,t){return t||Ie(e,8,this.length),G(this,e,!1,52,8)},Y.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Ee(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Y.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,1,255,0),Y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Y.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,65535,0),Y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Be(this,e,t,!0),t+2},Y.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,65535,0),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Be(this,e,t,!1),t+2},Y.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,4294967295,0),Y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Ce(this,e,t,!0),t+4},Y.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,4294967295,0),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ce(this,e,t,!1),t+4},Y.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Ee(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},Y.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Ee(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Y.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,1,127,-128),Y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Y.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,32767,-32768),Y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Be(this,e,t,!0),t+2},Y.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,32767,-32768),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Be(this,e,t,!1),t+2},Y.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,2147483647,-2147483648),Y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Ce(this,e,t,!0),t+4},Y.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ce(this,e,t,!1),t+4},Y.prototype.writeFloatLE=function(e,t,r){return ke(this,e,t,!0,r)},Y.prototype.writeFloatBE=function(e,t,r){return ke(this,e,t,!1,r)},Y.prototype.writeDoubleLE=function(e,t,r){return Se(this,e,t,!0,r)},Y.prototype.writeDoubleBE=function(e,t,r){return Se(this,e,t,!1,r)},Y.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Y.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Me(e){return function(e){var t,r,n,i,a,o;K||H();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new O(3*s/4-a),n=a>0?s-4:s;var c=0;for(t=0,r=0;t>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===a?(i=q[e.charCodeAt(t)]<<2|q[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===a&&(i=q[e.charCodeAt(t)]<<10|q[e.charCodeAt(t+1)]<<4|q[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Qe,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Ue(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function De(e){return null!=e&&(!!e._isBuffer||Re(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Re(e.slice(0,0))}(e))}function Re(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Fe=Object.freeze({__proto__:null,Buffer:Y,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),Y.alloc(+e)},isBuffer:De,kMaxLength:Z});function Te(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}F.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qe=Te.prototype,Oe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Oe[e]={value:e}})),Object.defineProperties(Te,Oe),Object.defineProperty(qe,"isAxiosError",{value:!0}),Te.from=(e,t,r,n,i,a)=>{const o=Object.create(qe);return F.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Te.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function Ke(e){return F.isPlainObject(e)||F.isArray(e)}function He(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,r){return e?e.concat(t).map((function(e,t){return e=He(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Le=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Ge(e,t,r){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=F.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!s&&F.isBlob(e))throw new Te("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Y.from(e):e}function u(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(F.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(Ke)}(e)||(F.isFileList(e)||F.endsWith(r,"[]"))&&(s=F.toArray(e)))return r=He(r),s.forEach((function(e,n){!F.isUndefined(e)&&null!==e&&t.append(!0===o?Ne([r],n,a):null===o?r:r+"[]",c(e))})),!1;return!!Ke(e)||(t.append(Ne(i,r,a),c(e)),!1)}const h=[],l=Object.assign(Le,{defaultVisitor:u,convertValue:c,isVisitable:Ke});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!F.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),F.forEach(r,(function(r,a){!0===(!(F.isUndefined(r)||null===r)&&i.call(t,r,F.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),h.pop()}}(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ze(e,t){this._pairs=[],e&&Ge(e,this,t)}const We=ze.prototype;function Ze(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Je(e,t,r){if(!t)return e;const n=r&&r.encode||Ze,i=r&&r.serialize;let a;if(a=i?i(t,r):F.isURLSearchParams(t)?t.toString():new ze(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}We.append=function(e,t){this._pairs.push([e,t])},We.toString=function(e){const t=e?function(t){return e.call(this,t,je)}:je;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Ve=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ye={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$e={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Xe="undefined"!=typeof window&&"undefined"!=typeof document,et=(tt="undefined"!=typeof navigator&&navigator.product,Xe&&["ReactNative","NativeScript","NS"].indexOf(tt)<0);var tt;const rt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var nt={...Object.freeze({__proto__:null,hasBrowserEnv:Xe,hasStandardBrowserEnv:et,hasStandardBrowserWebWorkerEnv:rt}),...$e};function it(e){function t(e,r,n,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&F.isArray(n)?n.length:a,s)return F.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&F.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&F.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const at={transitional:Ye,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=F.isObject(e);i&&F.isHTMLForm(e)&&(e=new FormData(e));if(F.isFormData(e))return n&&n?JSON.stringify(it(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ge(e,new nt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return nt.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=F.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ge(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||at.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&F.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw Te.from(e,Te.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nt.classes.FormData,Blob:nt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],(e=>{at.headers[e]={}}));var ot=at;const st=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ct=Symbol("internals");function ut(e){return e&&String(e).trim().toLowerCase()}function ht(e){return!1===e||null==e?e:F.isArray(e)?e.map(ht):String(e)}function lt(e,t,r,n,i){return F.isFunction(n)?n.call(this,t,r):(i&&(t=r),F.isString(t)?F.isString(n)?-1!==t.indexOf(n):F.isRegExp(n)?n.test(t):void 0:void 0)}class ft{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ut(t);if(!i)throw new Error("header name must be a non-empty string");const a=F.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=ht(e))}const a=(e,t)=>F.forEach(e,((e,r)=>i(e,r,t)));return F.isPlainObject(e)||e instanceof this.constructor?a(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&st[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ut(e)){const r=F.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(F.isFunction(t))return t.call(this,e,r);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ut(e)){const r=F.findKey(this,e);return!(!r||void 0===this[r]||t&&!lt(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ut(e)){const i=F.findKey(r,e);!i||t&&!lt(0,r[i],i,t)||(delete r[i],n=!0)}}return F.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!lt(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return F.forEach(this,((n,i)=>{const a=F.findKey(r,i);if(a)return t[a]=ht(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=ht(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return F.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&F.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ct]=this[ct]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ut(e);t[n]||(!function(e,t){const r=F.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return F.isArray(e)?e.forEach(n):n(e),this}}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(ft.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),F.freezeMethods(ft);var dt=ft;function pt(e,t){const r=this||ot,n=t||r,i=dt.from(n.headers);let a=n.data;return F.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function gt(e){return!(!e||!e.__CANCEL__)}function At(e,t,r){Te.call(this,null==e?"canceled":e,Te.ERR_CANCELED,t,r),this.name="CanceledError"}F.inherits(At,Te,{__CANCEL__:!0});var yt=nt.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];F.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),F.isString(n)&&o.push("path="+n),F.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function mt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var bt=nt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=F.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function wt(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=n[o];i||(i=c),r[a]=s,n[a]=c;let h=o,l=0;for(;h!==a;)l+=r[h++],h%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,c=n(s);r=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var vt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=dt.from(e.headers).normalize();let a,o,{responseType:s,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(F.isFormData(n))if(nt.hasStandardBrowserEnv||nt.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let h=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const l=mt(e.baseURL,e.url);function f(){if(!h)return;const n=dt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Te("Request failed with status code "+r.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),u()}),(function(e){r(e),u()}),{data:s&&"text"!==s&&"json"!==s?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}if(h.open(e.method.toUpperCase(),Je(l,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(f)},h.onabort=function(){h&&(r(new Te("Request aborted",Te.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new Te("Network Error",Te.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ye;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Te(t,n.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,e,h)),h=null},nt.hasStandardBrowserEnv&&(c&&F.isFunction(c)&&(c=c(e)),c||!1!==c&&bt(l))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&yt.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in h&&F.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),s&&"json"!==s&&(h.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",wt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",wt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{h&&(r(!t||t.type?new At(null,e,h):t),h.abort(),h=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);d&&-1===nt.protocols.indexOf(d)?r(new Te("Unsupported protocol "+d+":",Te.ERR_BAD_REQUEST,e)):h.send(n||null)}))};const It={http:null,xhr:vt};F.forEach(It,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Et=e=>`- ${e}`,Bt=e=>F.isFunction(e)||null===e||!1===e;var Ct=e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Te("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Et).join("\n"):" "+Et(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function _t(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new At(null,e)}function kt(e){_t(e),e.headers=dt.from(e.headers),e.data=pt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ct(e.adapter||ot.adapter)(e).then((function(t){return _t(e),t.data=pt.call(e,e.transformResponse,t),t.headers=dt.from(t.headers),t}),(function(t){return gt(t)||(_t(e),t&&t.response&&(t.response.data=pt.call(e,e.transformResponse,t.response),t.response.headers=dt.from(t.response.headers))),Promise.reject(t)}))}const St=e=>e instanceof dt?e.toJSON():e;function Qt(e,t){t=t||{};const r={};function n(e,t,r){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:r},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function i(e,t,r){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!F.isUndefined(t))return n(void 0,t)}function o(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(St(e),St(t),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=c[n]||i,o=a(e[n],t[n],n);F.isUndefined(o)&&a!==s||(r[n]=o)})),r}const xt="1.6.5",Pt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Pt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Mt={};Pt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.5] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new Te(n(i," has been removed"+(t?" in "+t:"")),Te.ERR_DEPRECATED);return t&&!Mt[i]&&(Mt[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Ut={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new Te("option "+a+" must be "+r,Te.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Te("Unknown option "+a,Te.ERR_BAD_OPTION)}},validators:Pt};const Dt=Ut.validators;class Rt{constructor(e){this.defaults=e,this.interceptors={request:new Ve,response:new Ve}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Qt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Ut.assertOptions(r,{silentJSONParsing:Dt.transitional(Dt.boolean),forcedJSONParsing:Dt.transitional(Dt.boolean),clarifyTimeoutError:Dt.transitional(Dt.boolean)},!1),null!=n&&(F.isFunction(n)?t.paramsSerializer={serialize:n}:Ut.assertOptions(n,{encode:Dt.function,serialize:Dt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&F.merge(i.common,i[t.method]);i&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=dt.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,l=0;if(!s){const e=[kt.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);l{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new At(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new Tt((function(t){e=t}));return{token:t,cancel:e}}}var qt=Tt;const Ot={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ot).forEach((([e,t])=>{Ot[t]=e}));var Kt=Ot;const Ht=function e(t){const n=new Ft(t),i=r(Ft.prototype.request,n);return F.extend(i,Ft.prototype,n,{allOwnKeys:!0}),F.extend(i,n,null,{allOwnKeys:!0}),i.create=function(r){return e(Qt(t,r))},i}(ot);Ht.Axios=Ft,Ht.CanceledError=At,Ht.CancelToken=qt,Ht.isCancel=gt,Ht.VERSION=xt,Ht.toFormData=Ge,Ht.AxiosError=Te,Ht.Cancel=Ht.CanceledError,Ht.all=function(e){return Promise.all(e)},Ht.spread=function(e){return function(t){return e.apply(null,t)}},Ht.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},Ht.mergeConfig=Qt,Ht.AxiosHeaders=dt,Ht.formToJSON=e=>it(F.isHTMLForm(e)?new FormData(e):e),Ht.getAdapter=Ct,Ht.HttpStatusCode=Kt,Ht.default=Ht;var Nt=Ht,Lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var zt={exports:{}},Wt={exports:{}};!function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var n=r(e);throw null===e?n="null":"object"===n&&(n=e.constructor.name),new TypeError("Expected a string but received a ".concat(n))}},e.exports=t.default,e.exports.default=t.default}(Wt,Wt.exports);var Zt=Wt.exports,Jt={exports:{}},Vt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(Vt,Vt.exports);var Yt=Vt.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),o=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(o))return!1;if(/\s/.test(o))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(o))return!1;return i.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var r=i(Zt),n=i(Yt);function i(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(Jt,Jt.exports);var $t=Jt.exports,Xt=Gt($t),er={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,n.default)(t),r=String(r),!r)return e(t,4)||e(t,6);if("4"===r)return o.test(t);if("6"===r)return c.test(t);return!1};var r,n=(r=Zt)&&r.__esModule?r:{default:r};var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(i,"[.]){3}").concat(i),o=new RegExp("^".concat(a,"$")),s="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(a,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(a,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(a,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(a,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(a,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(a,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(a,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(er,er.exports);var tr=er.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,a.default)(t,c)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var o,l,f,d,p,g,A,y;if(A=e.split("#"),e=A.shift(),A=e.split("?"),e=A.shift(),(A=e.split("://")).length>1){if(o=A.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(o))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;A[0]=e.slice(2)}}if(""===(e=A.join("://")))return!1;if(A=e.split("/"),""===(e=A.shift())&&!t.require_host)return!0;if((A=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===A[0])return!1;if((l=A.shift()).indexOf(":")>=0&&l.split(":").length>2)return!1;var m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(l.split(":"),2),b=m[0],w=m[1];if(""===b&&""===w)return!1}d=A.join("@"),g=null,y=null;var v=d.match(u);v?(f="",y=v[1],g=v[2]||null):(f=(A=d.split(":")).shift(),A.length&&(g=A.join(":")));if(null!==g&&g.length>0){if(p=parseInt(g,10),!/^[0-9]+$/.test(g)||p<=0||p>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return h(f,t.host_whitelist);if(""===f&&!t.require_host)return!0;if(!((0,i.default)(f)||(0,n.default)(f,t)||y&&(0,i.default)(y,6)))return!1;if(f=f||y,t.host_blacklist&&h(f,t.host_blacklist))return!1;return!0};var r=o(Zt),n=o($t),i=o(tr),a=o(Yt);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)for(var r=1;r{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:5e3)})),i=new Promise(((r,n)=>{(async()=>{let i=!1;try{rr(t.claims.activitypub.url),i=!0}catch(e){}const a=new Date,{host:o,pathname:s,search:c}=new URL(e.url),u={host:o,date:a.toUTCString(),accept:"application/activity+json","User-Agent":`doipjs/${Fr}`};if(i&&Dr){const e=`(request-target): get ${s}${c}\nhost: ${o}\ndate: ${a.toUTCString()}`,r=Rr.createSign("SHA256");r.write(e),r.end();const n=r.sign(t.claims.activitypub.privateKey.replace(/\\n/g,"\n"),"base64");u.signature=`keyId="${t.claims.activitypub.url}#main-key",headers="(request-target) host date",signature="${n}",algorithm="rsa-sha256"`}Nt.get(e.url,{headers:u}).then((e=>e.data)).then((e=>{r(e)})).catch((e=>{n(e)}))})()}));return Promise.race([i,n]).finally((()=>{clearTimeout(r)}))}var qr=Object.freeze({__proto__:null,fn:Tr,timeout:5e3}),Or=crypto;const Kr=e=>e instanceof CryptoKey;var Hr=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await Or.subtle.digest(r,t))};const Nr=new TextEncoder,Lr=new TextDecoder;const Gr=e=>(e=>{let t=e;"string"==typeof t&&(t=Nr.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=Lr.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;ee.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}function rn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var nn=(e,...t)=>rn("Key must be ",e,...t);function an(e,t,...r){return rn(`Key for the ${e} algorithm must be `,t,...r)}var on=e=>Kr(e);const sn=["CryptoKey"];var cn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function un(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var hn=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Zr(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Zr('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),a=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return Or.subtle.importKey("raw",jr(e.k),...a);const o={...e};return delete o.alg,delete o.use,Or.subtle.importKey("jwk",o,...a)};var ln=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!on(t))throw new TypeError(an(e,t,...sn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${sn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!on(t))throw new TypeError(an(e,t,...sn));if("secret"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};var fn=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};var dn=async(e,t,r,n)=>{const i=await function(e,t,r){if(Kr(t))return tn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(nn(t,...sn));return Or.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(nn(t,...sn,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,i);const a=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new Zr(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,i.algorithm);try{return await Or.subtle.verify(a,i,r,n)}catch(e){return!1}};async function pn(e,t,r){var n;if(!un(e))throw new Jr("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Jr('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Jr("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Jr("JWS Payload missing");if("string"!=typeof e.signature)throw new Jr("JWS Signature missing or incorrect type");if(void 0!==e.header&&!un(e.header))throw new Jr("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=jr(e.protected);i=JSON.parse(Lr.decode(t))}catch(e){throw new Jr("JWS Protected Header is invalid")}if(!cn(i,e.header))throw new Jr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...i,...e.header},o=function(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!a.has(t))throw new Zr(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(Jr,new Map([["b64",!0]]),null==r?void 0:r.crit,i,a);let s=!0;if(o.has("b64")&&(s=i.b64,"boolean"!=typeof s))throw new Jr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=a;if("string"!=typeof c||!c)throw new Jr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const u=r&&fn("algorithms",r.algorithms);if(u&&!u.has(c))throw new Wr('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof e.payload)throw new Jr("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Jr("JWS Payload must be a string or an Uint8Array instance");let h=!1;"function"==typeof t&&(t=await t(i,e),h=!0),ln(c,t,"verify");const l=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(Nr.encode(null!==(n=e.protected)&&void 0!==n?n:""),Nr.encode("."),"string"==typeof e.payload?Nr.encode(e.payload):e.payload);let f;try{f=jr(e.signature)}catch(e){throw new Jr("Failed to base64url decode the signature")}if(!await dn(c,t,f,l))throw new Yr;let d;if(s)try{d=jr(e.payload)}catch(e){throw new Jr("Failed to base64url decode the payload")}else d="string"==typeof e.payload?Nr.encode(e.payload):e.payload;const p={payload:d};return void 0!==e.protected&&(p.protectedHeader=i),void 0!==e.header&&(p.unprotectedHeader=e.header),h?{...p,key:t}:p}const gn=(e,t)=>{if("string"!=typeof e||!e)throw new Vr(`${t} missing or invalid`)};const An=jr;function yn(e,t,r){var n;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var i=0;i=8&&(s-=8,o[u++]=255&c>>s)}if(s>=t.bits||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o}function mn(e,t,r){void 0===r&&(r={});for(var n=r.pad,i=void 0===n||n,a=(1<t.bits;)s-=t.bits,o+=t.chars[a&c>>s];if(s&&(o+=t.chars[a&c<1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,zn.default)(e);var n=e,i=r.ignore;if(i)if(i instanceof RegExp)n=n.replace(i,"");else{if("string"!=typeof i)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(i.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(t in Wn.alphanumeric)return Wn.alphanumeric[t].test(n);throw new Error("Invalid locale '".concat(t,"'"))};En.locales=void 0;var jn,zn=(jn=Zt)&&jn.__esModule?jn:{default:jn},Wn=Bn;var Zn=Object.keys(Wn.alphanumeric);En.locales=Zn;var Jn={exports:{}};(function(e){e.exports.is_uri=r,e.exports.is_http_uri=n,e.exports.is_https_uri=i,e.exports.is_web_uri=a,e.exports.isUri=r,e.exports.isHttpUri=n,e.exports.isHttpsUri=i,e.exports.isWebUri=a;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function r(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var r,n,i,a,o,s="",c="";if(s=(r=t(e))[1],n=r[2],i=r[3],a=r[4],o=r[5],s&&s.length&&i.length>=0){if(n&&n.length){if(0!==i.length&&!/^\//.test(i))return}else if(/^\/\//.test(i))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(s.toLowerCase()))return c+=s+":",n&&n.length&&(c+="//"+n),c+=i,a&&a.length&&(c+="?"+a),o&&o.length&&(c+="#"+o),c}}}function n(e,n){if(r(e)){var i,a,o,s,c="",u="",h="",l="";if(c=(i=t(e))[1],u=i[2],a=i[3],o=i[4],s=i[5],c){if(n){if("https"!=c.toLowerCase())return}else if("http"!=c.toLowerCase())return;if(u)return/:(\d+)$/.test(u)&&(h=u.match(/:(\d+)$/)[0],u=u.replace(/:\d+$/,"")),l+=c+":",l+="//"+u,h&&(l+=h),l+=a,o&&o.length&&(l+="?"+o),s&&s.length&&(l+="#"+s),l}}}function i(e){return n(e,!0)}function a(e){return n(e)||i(e)}})(Jn);var Vn=Jn.exports;const Yn=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},{hasOwnProperty:$n}=Object.prototype,{propertyIsEnumerable:Xn}=Object,ei=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),ti=Lt,ri={concatArrays:!1,ignoreUndefined:!1},ni=e=>{const t=[];for(const r in e)$n.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)Xn.call(e,n)&&t.push(n)}return t};function ii(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return ni(e).forEach((r=>{ei(t,r,ii(e[r]))})),t}(e):Yn(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return ni(e).forEach((r=>{ei(t,r,ii(e[r]))})),t}(e):e}const ai=(e,t,r,n)=>(r.forEach((r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?ei(e,r,si(e[r],t[r],n)):ei(e,r,ii(t[r])))})),e),oi=(e,t,r)=>{let n=e.slice(0,0),i=0;return[e,t].forEach((t=>{const a=[];for(let r=0;r!a.includes(e))),r)})),n};function si(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?oi(e,t,r):Yn(t)&&Yn(e)?ai(e,t,ni(t),r):ii(t)}var ci=function(...e){const t=si(ii(ri),this!==ti&&this||{},ri);let r={_:{}};for(const n of e)if(void 0!==n){if(!Yn(n))throw new TypeError("`"+n+"` is not an Option Object");r=si(r,{_:n},t)}return r._},ui=Gt(ci);const hi="adaptive",li="always",fi="never",di="activitypub",pi="aspe",gi="dns",Ai="graphql",yi="http",mi="irc",bi="matrix",wi="openpgp",vi="telegram",Ii="xmpp",Ei="plain",Bi="html",Ci="xml",_i="none",ki="nocors",Si="granted",Qi="server",xi="json",Pi="text",Mi="uri",Ui="fingerprint",Di="contains",Ri="equals",Fi="oneof",Ti=100,qi=101,Oi=200,Ki=201,Hi=301,Ni=401,Li={ASP:"asp",OPENPGP:"openpgp"},Gi={EDDSA:"eddsa",ES256:"es256",OPENPGP:"openpgp",UNKNOWN:"unknown",NONE:"none"},ji={PEM:"pem",JWK:"jwk",ARMORED_PGP:"armored_pgp",NONE:"none"},zi="none",Wi="hkp",Zi="wkd";class Ji{constructor(e,t){this.identifier=null,this.name=e,this.email=null,this.description=null,this.avatarUrl=null,this.themeColor=null,this.claims=t,this.isRevoked=!1}static fromJSON(e,t){let r,n;if("object"==typeof e&&t){if(2!==t)throw new Error("Invalid persona version");if(n=function(e){const t=e.claims.map((e=>sS.fromJSON(e))),r=new Ji(e.name,t);return r.identifier=e.identifier,r.email=e.email,r.description=e.description,r.avatarUrl=e.avatarUrl,r.themeColor=e.avatarUrl,r.isRevoked=e.isRevoked,r}(e),n instanceof Error)throw n;r=n}return r}setIdentifier(e){this.identifier=e}setDescription(e){this.description=e}setEmailAddress(e){this.email=e}setAvatarUrl(e){this.avatarUrl=e}addClaim(e){this.claims.push(e)}revoke(){this.isRevoked=!0}toJSON(){return{identifier:this.identifier,name:this.name,email:this.email,description:this.description,avatarUrl:this.avatarUrl,themeColor:this.themeColor,isRevoked:this.isRevoked,claims:this.claims.map((e=>e.toJSON()))}}}class Vi{constructor(e,t,r){this.profileVersion=2,this.profileType=e,this.identifier=t,this.personas=r||[],this.primaryPersonaIndex=r.length>0?0:-1,this.publicKey={keyType:Gi.NONE,fingerprint:null,encoding:ji.NONE,encodedKey:null,key:null,fetch:{method:zi,query:null,resolvedUrl:null}},this.verifiers=[]}static fromJSON(e){let t,r;if("object"==typeof e&&"profileVersion"in e){if(2!==e.profileVersion)throw new Error("Invalid profile version");if(r=function(e){if(!("profileVersion"in e)||2!==e.profileVersion)return new Error("Invalid profile");const t=e.personas.map((e=>Ji.fromJSON(e,2))),r=new Vi(e.profileType,e.identifier,t);return r.primaryPersonaIndex=e.primaryPersonaIndex,r.publicKey=e.publicKey,r.verifiers=e.verifiers,r}(e),r instanceof Error)throw r;t=r}return t}addVerifier(e,t){this.verifiers.push({name:e,url:t})}toJSON(){return{profileVersion:this.profileVersion,profileType:this.profileType,identifier:this.identifier,personas:this.personas.map((e=>e.toJSON())),primaryPersonaIndex:this.primaryPersonaIndex,publicKey:{keyType:this.publicKey.keyType,fingerprint:this.publicKey.fingerprint,encoding:this.publicKey.encoding,encodedKey:this.publicKey.encodedKey,fetch:{method:this.publicKey.fetch.method,query:this.publicKey.fetch.query,resolvedUrl:this.publicKey.fetch.resolvedUrl}},verifiers:this.verifiers}}}class Yi{constructor(e){this.about=e.about,this.profile=e.profile,this.claim=e.claim,this.proof=e.proof}toJSON(){return{about:this.about,profile:this.profile,claim:this.claim,proof:this.proof}}}const $i=/^aspe:([a-zA-Z0-9.\-_]*):([a-zA-Z0-9]*)/;var Xi=Object.freeze({__proto__:null,processURI:function(e){const t=e.match($i);return Xt(t[1])?new Yi({about:{id:"aspe",name:"ASPE"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:$i.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:pi,accessRestriction:_i,data:{aspeUri:e}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["claims"]}]}}):null},reURI:$i,tests:[{uri:"aspe:domain.tld:abc123def456",shouldMatch:!0},{uri:"aspe:domain.tld",shouldMatch:!1},{uri:"dns:domain.tld",shouldMatch:!1},{uri:"https://domain.tld",shouldMatch:!1}]});const ea=/^openpgp4fpr:(?:0x)?([a-zA-Z0-9.\-_]*)/,ta=/^https:\/\/(.*)\/.well-known\/openpgpkey\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/,ra=/^https:\/\/(openpgpkey.*)\/.well-known\/openpgpkey\/(.*)\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/;var na=Object.freeze({__proto__:null,processURI:function(e){let t=null,r=null,n=null;ea.test(e)&&(t=ea,r=Wi,n=e.match(t)),!r&&ra.test(e)&&(t=ra,r=Zi,n=e.match(t)),!r&&ta.test(e)&&(t=ta,r=Zi,n=e.match(t));let i=null;switch(r){case Wi:i=new Yi({about:{id:"openpgp",name:"OpenPGP"},profile:{display:`openpgp4fpr:${n[1]}`,uri:`https://keys.openpgp.org/search?q=${n[1]}`,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,fetcher:wi,accessRestriction:_i,data:{url:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,protocol:Wi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["notations","proof@ariadne.id"]}]}});break;case Zi:i=new Yi({about:{id:"openpgp",name:"OpenPGP"},profile:{display:"unknown fingerprint",uri:e,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:wi,accessRestriction:_i,data:{url:e,protocol:Zi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["notations","proof@ariadne.id"]}]}})}return i},reURI:/^(.*)/,tests:[{uri:"openpgp4fpr:123456789",shouldMatch:!0},{uri:"openpgp4fpr:abcdef123",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/123abc456def?l=name",shouldMatch:!0}]});const ia=/^dns:([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var aa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ia);return new Yi({about:{id:"dns",name:"DNS"},profile:{display:t[1],uri:`https://${t[1]}`,qr:null},claim:{uriRegularExpression:ia.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:gi,accessRestriction:Qi,data:{domain:t[1]}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["records","txt"]}]}})},reURI:ia,tests:[{uri:"dns:domain.org",shouldMatch:!0},{uri:"dns:domain.org?type=TXT",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const oa=/^irc:\/\/(.*)\/([a-zA-Z0-9\-[\]\\`_^{|}]*)/;var sa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(oa);return new Yi({about:{id:"irc",name:"IRC"},profile:{display:`${t[1]}/${t[2]}`,uri:e,qr:null},claim:{uriRegularExpression:oa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:mi,accessRestriction:Qi,data:{domain:t[1],nick:t[2]}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:[]}]}})},reURI:oa,tests:[{uri:"irc://chat.ircserver.org/Alice1",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice?param=123",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice_bob",shouldMatch:!0},{uri:"https://chat.ircserver.org/alice",shouldMatch:!1}]});const ca=/^xmpp:([a-zA-Z0-9.\-_]*)@([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var ua=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ca);return new Yi({about:{id:"xmpp",name:"XMPP",homepage:"https://xmpp.org"},profile:{display:`${t[1]}@${t[2]}`,uri:e,qr:e},claim:{uriRegularExpression:ca.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:Ii,accessRestriction:Qi,data:{id:`${t[1]}@${t[2]}`}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:[]}]}})},reURI:ca,tests:[{uri:"xmpp:alice@domain.org",shouldMatch:!0},{uri:"xmpp:alice@domain.org?omemo-sid-123456789=A1B2C3D4E5F6G7H8I9",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const ha=/^matrix:u\/(?:@)?([^@:]*:[^?]*)(\?.*)?/;var la=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ha);if(!t[2])return null;const r=new URLSearchParams(t[2]);if(!r.has("org.keyoxide.e")||!r.has("org.keyoxide.r"))return null;const n=`${"!"!==r.get("org.keyoxide.r")[0]?"!":""}${r.get("org.keyoxide.r")}`,i=`${"$"!==r.get("org.keyoxide.e")[0]?"$":""}${r.get("org.keyoxide.e")}`,a=`https://matrix.to/#/@${t[1]}`,o=`https://matrix.to/#/${n}/${i}`;return new Yi({about:{id:"matrix",name:"Matrix",homepage:"https://matrix.org"},profile:{display:`@${t[1]}`,uri:a,qr:null},claim:{uriRegularExpression:ha.toString(),uriIsAmbiguous:!1},proof:{request:{uri:o,fetcher:bi,accessRestriction:Si,data:{eventId:i,roomId:n}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["content","body"]}]}})},reURI:ha,tests:[{uri:"matrix:u/alice:matrix.domain.org?org.keyoxide.r=123:domain.org&org.keyoxide.e=123",shouldMatch:!0},{uri:"matrix:u/alice:matrix.domain.org",shouldMatch:!0},{uri:"matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123",shouldMatch:!0},{uri:"xmpp:alice@domain.org",shouldMatch:!1},{uri:"https://domain.org/@alice",shouldMatch:!1}]});const fa=/https:\/\/t.me\/([A-Za-z0-9_]{5,32})\?proof=([A-Za-z0-9_]{5,32})/;var da=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(fa);return new Yi({about:{id:"telegram",name:"Telegram",homepage:"https://telegram.org"},profile:{display:`@${t[1]}`,uri:`https://t.me/${t[1]}`,qr:`https://t.me/${t[1]}`},claim:{uriRegularExpression:fa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://t.me/${t[2]}`,fetcher:vi,accessRestriction:Si,data:{user:t[1],chat:t[2]}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["text"]}]}})},reURI:fa,tests:[{uri:"https://t.me/alice?proof=foobar",shouldMatch:!0},{uri:"https://t.me/complex_user_1234?proof=complex_chat_1234",shouldMatch:!0},{uri:"https://t.me/foobar",shouldMatch:!1},{uri:"https://t.me/foobar?proof=",shouldMatch:!1},{uri:"https://t.me/?proof=foobar",shouldMatch:!1}]});const pa=/^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;var ga=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(pa),r=new URLSearchParams;return r.set("url",t[0]),r.set("omit_script","1"),new Yi({about:{id:"twitter",name:"Twitter",homepage:"https://twitter.com"},profile:{display:`@${t[1]}`,uri:`https://twitter.com/${t[1]}`,qr:null},claim:{uriRegularExpression:pa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://publish.twitter.com/oembed?${r}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["html"]}]}})},reURI:pa,tests:[{uri:"https://twitter.com/alice/status/1234567890123456789",shouldMatch:!0},{uri:"https://twitter.com/alice/status/1234567890123456789/",shouldMatch:!0},{uri:"https://domain.org/alice/status/1234567890123456789",shouldMatch:!1}]});const Aa=/^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;var ya=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Aa);return new Yi({about:{id:"reddit",name:"Reddit",homepage:"https://reddit.com"},profile:{display:t[1],uri:`https://www.reddit.com/user/${t[1]}`,qr:null},claim:{uriRegularExpression:Aa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://www.reddit.com/user/${t[1]}/comments/${t[2]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["data","children","data","selftext"]}]}})},reURI:Aa,tests:[{uri:"https://www.reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://www.reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://domain.org/user/Alice/comments/123456/post",shouldMatch:!1}]});const ma=/^https:\/\/liberapay\.com\/(.*)\/?/;var ba=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ma);return new Yi({about:{id:"liberapay",name:"Liberapay",homepage:"https://liberapay.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:ma.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:`https://liberapay.com/${t[1]}/public.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["statements","content"]}]}})},reURI:ma,tests:[{uri:"https://liberapay.com/alice",shouldMatch:!0},{uri:"https://liberapay.com/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const wa=/^https:\/\/lichess\.org\/@\/(.*)\/?/;var va=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(wa);return new Yi({about:{id:"lichess",name:"Lichess",homepage:"https://lichess.org"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:wa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lichess.org/api/user/${t[1]}`,fetcher:yi,accessRestriction:_i,data:{url:`https://lichess.org/api/user/${t[1]}`,format:xi}},response:{format:xi},target:[{format:Ui,encoding:Ei,relation:Di,path:["profile","links"]}]}})},reURI:wa,tests:[{uri:"https://lichess.org/@/Alice",shouldMatch:!0},{uri:"https://lichess.org/@/Alice/",shouldMatch:!0},{uri:"https://domain.org/@/Alice",shouldMatch:!1}]});const Ia=/^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;var Ea=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ia);return new Yi({about:{id:"hackernews",name:"Hacker News",homepage:"https://news.ycombinator.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ia.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,fetcher:yi,accessRestriction:ki,data:{url:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Bi,relation:Di,path:["about"]}]}})},reURI:Ia,tests:[{uri:"https://news.ycombinator.com/user?id=Alice",shouldMatch:!0},{uri:"https://news.ycombinator.com/user?id=Alice/",shouldMatch:!0},{uri:"https://domain.org/user?id=Alice",shouldMatch:!1}]});const Ba=/^https:\/\/lobste\.rs\/(?:~|u\/)(.*)\/?/;var Ca=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ba);return new Yi({about:{id:"lobsters",name:"Lobsters",homepage:"https://lobste.rs"},profile:{display:t[1],uri:`https://lobste.rs/~${t[1]}`,qr:null},claim:{uriRegularExpression:Ba.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lobste.rs/~${t[1]}.json`,fetcher:yi,accessRestriction:ki,data:{url:`https://lobste.rs/~${t[1]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["about"]}]}})},reURI:Ba,tests:[{uri:"https://lobste.rs/~Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice/",shouldMatch:!0},{uri:"https://domain.org/~Alice",shouldMatch:!1},{uri:"https://domain.org/u/Alice",shouldMatch:!1}]});const _a=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var ka=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(_a);return new Yi({about:{id:"forem",name:"Forem",homepage:"https://www.forem.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:_a.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/api/articles/${t[2]}/${t[3]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["body_markdown"]}]}})},reURI:_a,tests:[{uri:"https://domain.org/alice/post",shouldMatch:!0},{uri:"https://domain.org/alice/post/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Sa=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;const Qa={validate:async(e,t,r)=>{const n=`https://${new URL(e.proof.request.uri).hostname}/api/forgejo/v1/version`,i=await Lw({url:n,format:xi});return i&&"version"in i}};var xa=Object.freeze({__proto__:null,functions:Qa,processURI:function(e){const t=e.match(Sa);return new Yi({about:{id:"forgejo",name:"Forgejo",homepage:"https://forgejo.org"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Sa.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["description"]}]}})},reURI:Sa,tests:[{uri:"https://domain.org/alice/forgejo_proof",shouldMatch:!0},{uri:"https://domain.org/alice/forgejo_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Pa=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var Ma=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Pa);return new Yi({about:{id:"gitea",name:"Gitea",homepage:"https://about.gitea.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Pa.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["description"]}]}})},reURI:Pa,tests:[{uri:"https://domain.org/alice/gitea_proof",shouldMatch:!0},{uri:"https://domain.org/alice/gitea_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Ua=/^https:\/\/(.*)\/(.*)\/gitlab_proof\/?/;var Da=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ua);return new Yi({about:{id:"gitlab",name:"GitLab",homepage:"https://about.gitlab.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Ua.toString(),uriIsAmbiguous:!0},proof:{request:{fetcher:yi,accessRestriction:_i,data:{url:`https://${t[1]}/api/v4/projects/${t[2]}%2Fgitlab_proof`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["description"]}]}})},reURI:Ua,tests:[{uri:"https://gitlab.domain.org/alice/gitlab_proof",shouldMatch:!0},{uri:"https://gitlab.domain.org/alice/gitlab_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]});const Ra=/^https:\/\/gist\.github\.com\/(.*)\/(.*)\/?/;var Fa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ra);return new Yi({about:{id:"github",name:"GitHub",homepage:"https://github.com"},profile:{display:t[1],uri:`https://github.com/${t[1]}`,qr:null},claim:{uriRegularExpression:Ra.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:`https://api.github.com/gists/${t[2]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["files","proof.md","content"]},{format:Mi,encoding:Ei,relation:Di,path:["files","openpgp.md","content"]}]}})},reURI:Ra,tests:[{uri:"https://gist.github.com/Alice/123456789",shouldMatch:!0},{uri:"https://gist.github.com/Alice/123456789/",shouldMatch:!0},{uri:"https://domain.org/Alice/123456789",shouldMatch:!1}]});const Ta=/^https:\/\/(.*)\/?/;const qa={postprocess:async(e,t,r)=>{switch(t.result.type){case"Note":{e.profile.uri=t.result.attributedTo,e.profile.display=t.result.attributedTo;const n=await Tr({url:t.result.attributedTo},r).catch((e=>null));n&&(e.profile.display=`@${n.preferredUsername}@${new URL(e.proof.request.uri).hostname}`);break}case"Person":e.profile.display=`@${t.result.preferredUsername}@${new URL(e.proof.request.uri).hostname}`}const n=await Oa(new URL(e.proof.request.uri).hostname);return n&&(e.about.name=n.software.name,e.about.id=n.software.name,e.about.homepage=n.software.homepage),{claimData:e,proofData:t}}},Oa=async e=>{const t=await fetch(`https://${e}/.well-known/nodeinfo`).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).catch((e=>null));if(!t)return null;{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:e.software.homepage||"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}};var Ka=Object.freeze({__proto__:null,functions:qa,processURI:function(e){return new Yi({about:{id:"activitypub",name:"ActivityPub",homepage:"https://activitypub.rocks"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:Ta.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:di,accessRestriction:_i,data:{url:e}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["summary"]},{format:Mi,encoding:Ei,relation:Di,path:["attachment","value"]},{format:Mi,encoding:Ei,relation:Di,path:["content"]}]}})},reURI:Ta,tests:[{uri:"https://domain.org",shouldMatch:!0},{uri:"https://domain.org/@/alice/",shouldMatch:!0},{uri:"https://domain.org/@alice",shouldMatch:!0},{uri:"https://domain.org/@alice/123456",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/123456",shouldMatch:!0},{uri:"http://domain.org/alice",shouldMatch:!1}]});const Ha=/^https:\/\/(.*)\/u\/(.*)\/?/;var Na=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ha);return new Yi({about:{id:"discourse",name:"Discourse",homepage:"https://www.discourse.org"},profile:{display:`${t[2]}@${t[1]}`,uri:e,qr:null},claim:{uriRegularExpression:Ha.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/u/${t[2]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["user","bio_raw"]}]}})},reURI:Ha,tests:[{uri:"https://domain.org/u/alice",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const La=/^https:\/\/(.*)/;var Ga=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(La);return new Yi({about:{id:"owncast",name:"Owncast",homepage:"https://owncast.online"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:La.toString(),uriIsAmbiguous:!0},proof:{request:{uri:`${e}/api/config`,fetcher:yi,accessRestriction:_i,data:{url:`${e}/api/config`,format:xi}},response:{format:xi},target:[{format:Ui,encoding:Ei,relation:Di,path:["socialHandles","url"]}]}})},reURI:La,tests:[{uri:"https://live.domain.org",shouldMatch:!0},{uri:"https://live.domain.org/",shouldMatch:!0},{uri:"https://domain.org/live",shouldMatch:!0},{uri:"https://domain.org/live/",shouldMatch:!0}]});const ja=/^https:\/\/(.*(?:askubuntu|mathoverflow|serverfault|stackapps|stackoverflow|superuser)|.+\.stackexchange)\.com\/users\/(\d+)/,za=/\.stackexchange$/;var Wa=Object.freeze({__proto__:null,processURI:function(e){const[,t,r]=e.match(ja),n=t.replace(za,"");return new Yi({about:{id:"stackexchange",name:"Stack Exchange",homepage:"https://stackexchange.com"},profile:{display:`${r}@${n}`,uri:e,qr:null},claim:{uriRegularExpression:ja.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://${t}.com/users/${r}?tab=profile`,fetcher:yi,accessRestriction:_i,data:{url:`https://api.stackexchange.com/2.3/users/${r}?site=${n}&filter=!AH)b5JqVyImf`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["items","about_me"]}]}})},reURI:ja,tests:[{uri:"https://stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234?tab=topactivity",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice?tab=profile",shouldMatch:!0},{uri:"https://meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://serverfault.com/users/1234",shouldMatch:!0},{uri:"https://meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://gaming.meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://stackexchange.com/users/1234",shouldMatch:!1},{uri:"https://domain.com/users/1234",shouldMatch:!1},{uri:"https://meta.domain.com/users/1234",shouldMatch:!1}]});const Za=/^https:\/\/keybase.io\/(.*)\/?/;var Ja=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Za);return new Yi({about:{id:"keybase",name:"keybase",homepage:"https://keybase.io"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Za.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,fetcher:yi,accessRestriction:ki,data:{url:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,format:xi}},response:{format:xi},target:[{format:Ui,encoding:Ei,relation:Di,path:["them","public_keys","primary","key_fingerprint"]}]}})},reURI:Za,tests:[{uri:"https://keybase.io/Alice",shouldMatch:!0},{uri:"https://keybase.io/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const Va=/^https:\/\/opencollective\.com\/(.*)\/?/;var Ya=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Va);return new Yi({about:{id:"opencollective",name:"Open Collective",homepage:"https://opencollective.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Va.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:Ai,accessRestriction:ki,data:{url:"https://api.opencollective.com/graphql/v2",query:`{ "query": "query { account(slug: \\"${t[1]}\\") { longDescription } }" }`}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["data","account","longDescription"]}]}})},reURI:Va,tests:[{uri:"https://opencollective.com/Alice",shouldMatch:!0},{uri:"https://opencollective.com/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const $a=/^https:\/\/orcid\.org\/(.*)\/?/;var Xa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match($a);return new Yi({about:{id:"orcid",name:"ORCiD",homepage:"https://orcid.org/"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:$a.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:e,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["person","biography","content"]},{format:Mi,encoding:Ei,relation:Ri,path:["person","researcher-urls","researcher-url","url","value"]},{format:Mi,encoding:Ei,relation:Ri,path:["person","keywords","keyword","content"]}]}})},reURI:$a,tests:[{uri:"https://orcid.org/0000-0000-0000-0000",shouldMatch:!0},{uri:"https://orcid.org/0000-0000-0000-0000/",shouldMatch:!0},{uri:"https://domain.org/0000-0000-0000-0000",shouldMatch:!1}]});const eo=/^https:\/\/pronouns\.cc\/@(.*)\/?/;var to=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(eo);return new Yi({about:{id:"pronounscc",name:"pronouns.cc",homepage:"https://pronouns.cc"},profile:{display:`@${t[1]}`,uri:`https://pronouns.cc/@${t[1]}`,qr:null},claim:{uriRegularExpression:eo.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://pronouns.cc/api/v1/users/${t[1]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["links"]},{format:Mi,encoding:Ei,relation:Di,path:["bio"]}]}})},reURI:eo,tests:[{uri:"https://pronouns.cc/@Alice",shouldMatch:!0},{uri:"https://pronouns.cc/@Alice/",shouldMatch:!0},{uri:"https://pronouns.cc/Alice",shouldMatch:!1},{uri:"https://pronouns.cc/Alice/",shouldMatch:!1}]});const ro=/^https:\/\/(?:discord\.gg|discord\.com\/invite)\/(.+)/;var no=Object.freeze({__proto__:null,functions:{postprocess:async(e,t,r)=>(e.profile.display=t.result.inviter.username,{claimData:e,proofData:t})},processURI:function(e){const t=e.match(ro);return new Yi({about:{id:"discord",name:"Discord",homepage:"https://discord.com"},profile:{display:"Unknown username",uri:null,qr:null},claim:{uriRegularExpression:ro.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://discord.com/api/v10/invites/${t[1]}`,fetcher:yi,accessRestriction:ki,data:{url:`https://discord.com/api/v10/invites/${t[1]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["guild","description"]},{format:Mi,encoding:Ei,relation:Di,path:["guild","name"]}]}})},reURI:ro,tests:[{uri:"https://discord.com/invite/AbCdEf",shouldMatch:!0},{uri:"https://discord.com/invite/AbCdEfGh",shouldMatch:!0},{uri:"https://discord.gg/AbCdEf",shouldMatch:!0},{uri:"https://discord.gg/AbCdEfGh",shouldMatch:!0},{uri:"https://domain.com/invite/AbCdEf",shouldMatch:!1},{uri:"https://domain.gg/AbCdEf",shouldMatch:!1},{uri:"https://discord.com/invite/",shouldMatch:!1},{uri:"https://discord.gg/",shouldMatch:!1}]});const io=/^https:\/\/bsky\.app\/profile\/([^/]+)(?:\/?$|\/post\/([^/]+)\/?)/;var ao=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(io),r=new URLSearchParams;return t[2]?r.set("uri",`at://${t[1]}/app.bsky.feed.post/${t[2]}`):r.set("actor",t[1]),new Yi({about:{id:"bsky",name:"Bluesky",homepage:"https://bsky.app"},profile:{display:`@${t[1]}`,uri:`https://bsky.app/profile/${t[1]}`,qr:null},claim:{uriRegularExpression:io.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:t[2]?`https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?${r}`:`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?${r}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:t[2]?["thread","post","record","text"]:["description"]}]}})},reURI:io,tests:[{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/post/",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/profile/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/post/a1b2c3d4e5/",shouldMatch:!1}]});const oo=/^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;const so={aspe:Xi,openpgp:na,dns:aa,irc:sa,xmpp:ua,matrix:la,telegram:da,twitter:ga,reddit:ya,liberapay:ba,lichess:va,hackernews:Ea,lobsters:Ca,forem:ka,forgejo:xa,gitea:Ma,gitlab:Da,github:Fa,activitypub:Ka,discourse:Na,owncast:Ga,stackexchange:Wa,keybase:Ja,opencollective:Ya,orcid:Xa,pronounscc:to,discord:no,bsky:ao,sourcehut:Object.freeze({__proto__:null,processURI:function(e){const[,t,r,,n]=e.match(oo);return new Yi({about:{id:"sourcehut",name:"SourceHut",homepage:"https://sourcehut.org"},profile:{display:t,uri:`https://sr.ht/~${t}`,qr:null},claim:{uriRegularExpression:oo.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:`https://git.sr.ht/~${t}/${r}/blob/${n??"main"}/proof.md`,format:Pi}},response:{format:Pi},target:[{format:Mi,encoding:Ei,relation:Di,path:[]}]}})},reURI:oo,tests:[{uri:"https://git.sr.ht/~alice/sourcehut_proof",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/keyoxide_proof/",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/proof_repo/tree/master",shouldMatch:!0},{uri:"https://domain.org/alice/keyoxide_proof",shouldMatch:!1}]})},co=Object.keys(so),uo="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ho=Symbol("doneWritingPromise"),lo=Symbol("doneWritingResolve"),fo=Symbol("doneWritingReject"),po=Symbol("readingIndex");class go extends Array{constructor(){super(),this[ho]=new Promise(((e,t)=>{this[lo]=e,this[fo]=t})),this[ho].catch((()=>{}))}}function Ao(e){return e&&e.getReader&&Array.isArray(e)}function yo(e){if(!Ao(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}go.prototype.getReader=function(){return void 0===this[po]&&(this[po]=0),{read:async()=>(await this[ho],this[po]===this.length?{value:void 0,done:!0}:{value:this[this[po]++],done:!1})}},go.prototype.readToEnd=async function(e){await this[ho];const t=e(this.slice(this[po]));return this.length=0,t},go.prototype.clone=function(){const e=new go;return e[ho]=this[ho].then((()=>{e.push(...this)})),e},yo.prototype.write=async function(e){this.stream.push(e)},yo.prototype.close=async function(){this.stream[lo]()},yo.prototype.abort=async function(e){return this.stream[fo](e),e},yo.prototype.releaseLock=function(){};const mo="object"==typeof uo.process&&"object"==typeof uo.process.versions,bo=mo&&void 0;function wo(e){return Ao(e)?"array":uo.ReadableStream&&uo.ReadableStream.prototype.isPrototypeOf(e)?"web":Po&&Po.prototype.isPrototypeOf(e)?"ponyfill":bo&&bo.prototype.isPrototypeOf(e)?"node":!(!e||!e.getReader)&&"web-like"}function vo(e){return Uint8Array.prototype.isPrototypeOf(e)}function Io(e){if(1===e.length)return e[0];let t=0;for(let r=0;r{t||(Eo.isBuffer(n)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),r.enqueue(n),e.pause())})),e.on("end",(()=>{t||r.close()})),e.on("error",(e=>r.error(e)))},pull(){e.resume()},cancel(r){t=!0,e.destroy(r)}})};class e extends Bo{constructor(e,t){super(t),this._reader=qo(e)}async _read(e){try{for(;;){const{done:e,value:t}=await this._reader.read();if(e){this.push(null);break}if(!this.push(t))break}}catch(e){this.destroy(e)}}async _destroy(e,t){this._reader.cancel(e).then(t,t)}}_o=function(t,r){return new e(t,r)}}const ko=new WeakSet,So=Symbol("externalBuffer");function Qo(e){if(this.stream=e,e[So]&&(this[So]=e[So].slice()),Ao(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let t=wo(e);if("node"===t&&(e=Co(e)),t){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let r=!1;this._read=async()=>r||ko.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{ko.add(e)}catch(e){}}}Qo.prototype.read=async function(){return this[So]&&this[So].length?{done:!1,value:this[So].shift()}:this._read()},Qo.prototype.releaseLock=function(){this[So]&&(this.stream[So]=this[So]),this._releaseLock()},Qo.prototype.cancel=function(e){return this._cancel(e)},Qo.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:n}=await this.read();if(n+="",r)return t.length?To(t):void 0;const i=n.indexOf("\n")+1;i&&(e=To(t.concat(n.substr(0,i))),t=[]),i!==n.length&&t.push(n.substr(i))}return this.unshift(...t),e},Qo.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(Zo(t,1)),r},Qo.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:n,value:i}=await this.read();if(n)return t.length?To(t):void 0;if(t.push(i),r+=i.length,r>=e){const r=To(t);return this.unshift(Zo(r,e)),Zo(r,0,e)}}},Qo.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},Qo.prototype.unshift=function(...e){this[So]||(this[So]=[]),1===e.length&&vo(e[0])&&this[So].length&&e[0].length&&this[So][0].byteOffset>=e[0].length?this[So][0]=new Uint8Array(this[So][0].buffer,this[So][0].byteOffset-e[0].length,this[So][0].byteLength+e[0].length):this[So].unshift(...e.filter((e=>e&&e.length)))},Qo.prototype.readToEnd=async function(e=To){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};let xo,{ReadableStream:Po,WritableStream:Mo,TransformStream:Uo}=uo;const Do=mo&&void 0;function Ro(e){let t=wo(e);return"node"===t?Co(e):"web"===t&&xo?xo(e):t?e:new Po({start(t){t.enqueue(e),t.close()}})}function Fo(e){if(wo(e))return e;const t=new go;return(async()=>{const r=Oo(t);await r.write(e),await r.close()})(),t}function To(e){return e.some((e=>wo(e)&&!Ao(e)))?function(e){e=e.map(Ro);const t=No((async function(e){await Promise.all(n.map((t=>async function(e,t){if(wo(e)){if(e.cancel)return e.cancel(t);if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}(t,e))))}));let r=Promise.resolve();const n=e.map(((n,i)=>Go(n,((n,a)=>(r=r.then((()=>Ko(n,t.writable,{preventClose:i!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>Ao(e)))?function(e){const t=new go;let r=Promise.resolve();return e.forEach(((n,i)=>(r=r.then((()=>Ko(n,t,{preventClose:i!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):Do&&Do.isBuffer(e[0])?Do.concat(e):Io(e)}function qo(e){return new Qo(e)}function Oo(e){return new yo(e)}async function Ko(e,t,{preventClose:r=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(wo(e)&&!Ao(e)){e=Ro(e);try{if(e[So]){const r=Oo(t);for(let t=0;t{t=e})),t=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function Lo(e,t=(()=>{}),r=(()=>{})){if(Ao(e)){const n=new go;return(async()=>{const i=Oo(n);try{const n=await Jo(e),a=t(n),o=r();let s;s=void 0!==a&&void 0!==o?To([a,o]):void 0!==a?a:o,await i.write(s),await i.close()}catch(e){await i.abort(e)}})(),n}if(wo(e))return Ho(e,{async transform(e,r){try{const n=await t(e);void 0!==n&&r.enqueue(n)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const n=t(e),i=r();return void 0!==n&&void 0!==i?To([n,i]):void 0!==n?n:i}function Go(e,t){if(wo(e)&&!Ao(e)){let r;const n=new Uo({start(e){r=e}}),i=Ko(e,n.writable),a=No((async function(e){r.error(e),await i,await new Promise(setTimeout)}));return t(n.readable,a.writable),a.readable}e=Fo(e);const r=new go;return t(e,r),r}function jo(e){if(Ao(e))return e.clone();if(wo(e)){const t=function(e){if(Ao(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(wo(e)){const t=Ro(e).tee();return t[0][So]=t[1][So]=e[So],t}return[Zo(e),Zo(e)]}(e);return Wo(e,t[0]),t[1]}return Zo(e)}function zo(e){return Ao(e)?jo(e):wo(e)?new Po({start(t){const r=Go(e,(async(e,r)=>{const n=qo(e),i=Oo(r);try{for(;;){await i.ready;const{done:r,value:a}=await n.read();if(r){try{t.close()}catch(e){}return void await i.close()}try{t.enqueue(a)}catch(e){}await i.write(a)}}catch(e){t.error(e),await i.abort(e)}}));Wo(e,r)}}):Zo(e)}function Wo(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,n])=>{"constructor"!==r&&(n.value?n.value=n.value.bind(t):n.get=n.get.bind(t),Object.defineProperty(e,r,n))}))}function Zo(e,t=0,r=1/0){if(Ao(e))throw Error("Not implemented");if(wo(e)){if(t>=0&&r>=0){let n=0;return Ho(e,{transform(e,i){n=t&&i.enqueue(Zo(e,Math.max(t-n,0),r-n)),n+=e.length):i.terminate()}})}if(t<0&&(r<0||r===1/0)){let n=[];return Lo(e,(e=>{e.length>=-t?n=[e]:n.push(e)}),(()=>Zo(To(n),t,r)))}if(0===t&&r<0){let n;return Lo(e,(e=>{const i=n?To([n,e]):e;if(i.length>=-r)return n=Zo(i,r),Zo(i,t,r);n=i}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),Vo((async()=>Zo(await Jo(e),t,r)))}return e[So]&&(e=To(e[So].concat([e]))),!vo(e)||Do&&Do.isBuffer(e)?e.slice(t,r):(r===1/0&&(r=e.length),e.subarray(t,r))}async function Jo(e,t=To){return Ao(e)?e.readToEnd(t):wo(e)?qo(e).readToEnd(t):e}function Vo(e){const t=new go;return(async()=>{const r=Oo(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}class Yo{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,r=Array(t.length);for(let e=0;eBigInt(0);){const e=r&BigInt(1);r>>=BigInt(1);const a=i*n%t.value;i=e?a:i,n=n*n%t.value}return new Yo(i)}modInv(e){const{gcd:t,x:r}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return r.add(e).mod(e)}_egcd(e){let t=BigInt(0),r=BigInt(1),n=BigInt(1),i=BigInt(0),a=this.value;for(e=e.value;e!==BigInt(0);){const o=a/e;let s=t;t=n-o*t,n=s,s=r,r=i-o*r,i=s,s=e,e=a%e,a=s}return{x:new Yo(n),y:new Yo(i),gcd:new Yo(a)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const r=e;e=t%e,t=r}return new Yo(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new Yo(0),t=new Yo(1),r=new Yo(-1),n=this.isNegative()?r:e;let i=1;const a=this.clone();for(;!a.irightShift(t).equal(n);)i++;return i}byteLength(){const e=new Yo(0),t=new Yo(-1),r=this.isNegative()?t:e,n=new Yo(8);let i=1;const a=this.clone();for(;!a.irightShift(n).equal(r);)i++;return i}toUint8Array(e="be",t){let r=this.value.toString(16);r.length%2==1&&(r="0"+r);const n=r.length/2,i=new Uint8Array(t||n),a=t?t-n:0;let o=0;for(;o{e[$o][r]=t}))),void 0!==e[$o][t])return e[$o][t];throw Error("Invalid enum value.")}};const es=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),ts={isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return e instanceof Array},isUint8Array:vo,isStream:wo,readNumber:function(e){let t=0;for(let r=0;r>8*(t-n-1)&255;return r},readDate:function(e){const t=ts.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return ts.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=7+(e[0]<<8|e[1])>>>3;return e.subarray(2,2+t)},leftPad(e,t){const r=new Uint8Array(t),n=t-e.length;return r.set(e,n),r},uint8ArrayToMPI:function(e){const t=ts.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),n=new Uint8Array([(65280&t)>>8,255&t]);return ts.concatUint8Array([n,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t>1);for(let r=0;r>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t=[],r=e.length;let n,i=0;for(;i{if(!ts.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;rr("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return Lo(e,r,(()=>r(new Uint8Array,!0)))},concat:To,concatUint8Array:Io,equalsUint8Array:function(e,t){if(!ts.isUint8Array(e)||!ts.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let n=0;n>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){return void 0!==uo&&uo.crypto&&uo.crypto.subtle},getBigInteger:async function(){if("undefined"!=typeof BigInt)return Yo;{const{default:e}=await Promise.resolve().then((function(){return mm}));return e}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return"undefined"!=typeof navigator?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(e){return!!ts.isString(e)&&/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(e)},canonicalizeEOL:function(e){let t=!1;return Lo(e,(e=>{let r;t&&(e=ts.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const n=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&n.push(r);if(!n.length)return e;const i=new Uint8Array(e.length+n.length);let a=0;for(let t=0;tt?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return Lo(e,(e=>{let r;13===(e=t&&10!==e[0]?ts.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let n=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const i=r-(10===e[r]?1:0);t&&e.copyWithin(n,t,i),n+=i-t}return e.subarray(0,n)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let n;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){n=e}}))),r(n)}))},selectUint8Array:function(e,t,r){const n=Math.max(t.length,r.length),i=new Uint8Array(n);let a=0;for(let n=0;n{t=ts.concatUint8Array([t,e]);const r=[],n=Math.floor(t.length/45),i=45*n,a=ns(t.subarray(0,i));for(let e=0;et.length?ns(t)+"\n":""))}function os(e){let t="";return Lo(e,(e=>{t+=e;let r=0;const n=[" ","\t","\r","\n"];for(let e=0;e0&&(i-r)%4!=0;i--)n.includes(t[i])&&r--;const a=is(t.substr(0,i));return t=t.substr(i),a}),(()=>is(t)))}function ss(e){return os(e.replace(/-/g,"+").replace(/_/g,"/"))}function cs(e,t){let r=as(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}rs?(ns=e=>rs.from(e).toString("base64"),is=e=>{const t=rs.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(ns=e=>btoa(ts.uint8ArrayToString(e)),is=e=>ts.stringToUint8Array(atob(e)));var us={preferredHashAlgorithm:Xo.hash.sha256,preferredSymmetricAlgorithm:Xo.symmetric.aes256,preferredCompressionAlgorithm:Xo.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:Xo.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([Xo.symmetric.aes128,Xo.symmetric.aes192,Xo.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([Xo.hash.md5,Xo.hash.ripemd]),rejectMessageHashAlgorithms:new Set([Xo.hash.md5,Xo.hash.ripemd,Xo.hash.sha1]),rejectPublicKeyAlgorithms:new Set([Xo.publicKey.elgamal,Xo.publicKey.dsa]),rejectCurves:new Set([Xo.curve.secp256k1])};function hs(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?Xo.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?Xo.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?Xo.armor.signed:/MESSAGE/.test(t[1])?Xo.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?Xo.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?Xo.armor.privateKey:/SIGNATURE/.test(t[1])?Xo.armor.signature:void 0}function ls(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function fs(e){return as(function(e){let t=13501623;return Lo(e,(e=>{const r=ps?Math.floor(e.length/4):0,n=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e>24&255]^ds[1][t>>16&255]^ds[2][t>>8&255]^ds[3][t>>0&255];for(let n=4*r;n>8^ds[0][255&t^e[n]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e))}const ds=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);ds[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)ds[1][e]=ds[0][e]>>8^ds[0][255&ds[0][e]];for(let e=0;e<=255;e++)ds[2][e]=ds[1][e]>>8^ds[0][255&ds[1][e]];for(let e=0;e<=255;e++)ds[3][e]=ds[2][e]>>8^ds[0][255&ds[2][e]];const ps=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function gs(e){for(let t=0;t=0&&n!==e.length-1&&(t=e.slice(0,n),r=e.slice(n+1).substr(0,4)),{body:t,checksum:r}}function ys(e,t=us){return new Promise((async(r,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let o;const s=[];let c,u,h,l=s,f=[],d=os(Go(e,(async(e,t)=>{const p=qo(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=ts.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),o)if(c)u||2!==o||(i.test(e)?(f=f.join("\r\n"),u=!0,gs(l),l=[],c=!1):f.push(e.replace(/^- /,"")));else if(i.test(e)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(e)){if(gs(l),c=!0,u||2!==o){r({text:f,data:d,headers:s,type:o});break}}else l.push(e);else i.test(e)&&(o=hs(e))}}catch(e){return void n(e)}const g=Oo(t);try{for(;;){await g.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=ts.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(i);if(1===t.length)throw Error("Misformed armored text");const n=As(t[0].slice(0,-1));h=n.checksum,await g.write(n.body);break}await g.write(r)}await g.ready,await g.close()}catch(e){await g.abort(e)}})));d=Go(d,(async(e,r)=>{const n=Jo(fs(zo(e)));n.catch((()=>{})),await Ko(e,r,{preventClose:!0});const i=Oo(r);try{const e=(await n).replace("\n","");if(h!==e&&(h||t.checksumRequired))throw Error("Ascii armor integrity check failed");await i.ready,await i.close()}catch(e){await i.abort(e)}}))}catch(e){n(e)}})).then((async e=>(Ao(e.data)&&(e.data=await Jo(e.data)),e)))}function ms(e,t,r,n,i,a=us){let o,s;e===Xo.armor.signed&&(o=t.text,s=t.hash,t=t.data);const c=zo(t),u=[];switch(e){case Xo.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+n+"-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP MESSAGE, PART "+r+"/"+n+"-----\n");break;case Xo.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case Xo.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push("Hash: "+s+"\n\n"),u.push(o.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP SIGNATURE-----\n");break;case Xo.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP MESSAGE-----\n");break;case Xo.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case Xo.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case Xo.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP SIGNATURE-----\n")}return ts.concat(u)}class bs{constructor(){this.bytes=""}read(e){return this.bytes=ts.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return ts.stringToUint8Array(this.bytes)}toHex(){return ts.uint8ArrayToHex(ts.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new bs;return t.read(ts.hexToUint8Array(e)),t}static wildcard(){const e=new bs;return e.read(new Uint8Array(8)),e}}var ws=function(){var e,t,r=!1;function n(r,n){var i=e[(t[r]+t[n])%255];return 0!==r&&0!==n||(i=0),i}var i,a,o,s,c=!1;function u(){function u(r){var n,i,a;for(i=a=function(r){var n=e[255-t[r]];return 0===r&&(n=0),n}(r),n=0;n<4;n++)a^=i=255&(i<<1|i>>>7);return 99^a}r||function(){e=[],t=[];var n,i,a=1;for(n=0;n<255;n++)e[n]=a,i=128&a,a<<=1,a&=255,128===i&&(a^=27),a^=e[n],t[e[n]]=n;e[255]=e[0],t[0]=0,r=!0}(),i=[],a=[],o=[[],[],[],[]],s=[[],[],[],[]];for(var h=0;h<256;h++){var l=u(h);i[h]=l,a[l]=h,o[0][h]=n(2,l)<<24|l<<16|l<<8|n(3,l),s[0][l]=n(14,h)<<24|n(9,h)<<16|n(13,h)<<8|n(11,h);for(var f=1;f<4;f++)o[f][h]=o[f-1][h]>>>8|o[f-1][h]<<24,s[f][l]=s[f-1][l]>>>8|s[f-1][l]<<24}c=!0}var h=function(e,t){c||u();var r=new Uint32Array(t);r.set(i,512),r.set(a,768);for(var n=0;n<4;n++)r.set(o[n],4096+1024*n>>2),r.set(s[n],8192+1024*n>>2);var h=function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0;var B=new e.Uint32Array(r),C=new e.Uint8Array(r);function _(e,t,r,s,c,u,h,l){e=e|0;t=t|0;r=r|0;s=s|0;c=c|0;u=u|0;h=h|0;l=l|0;var f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;f=r|0x400,d=r|0x800,p=r|0xc00;c=c^B[(e|0)>>2],u=u^B[(e|4)>>2],h=h^B[(e|8)>>2],l=l^B[(e|12)>>2];for(b=16;(b|0)<=s<<4;b=b+16|0){g=B[(r|c>>22&1020)>>2]^B[(f|u>>14&1020)>>2]^B[(d|h>>6&1020)>>2]^B[(p|l<<2&1020)>>2]^B[(e|b|0)>>2],A=B[(r|u>>22&1020)>>2]^B[(f|h>>14&1020)>>2]^B[(d|l>>6&1020)>>2]^B[(p|c<<2&1020)>>2]^B[(e|b|4)>>2],y=B[(r|h>>22&1020)>>2]^B[(f|l>>14&1020)>>2]^B[(d|c>>6&1020)>>2]^B[(p|u<<2&1020)>>2]^B[(e|b|8)>>2],m=B[(r|l>>22&1020)>>2]^B[(f|c>>14&1020)>>2]^B[(d|u>>6&1020)>>2]^B[(p|h<<2&1020)>>2]^B[(e|b|12)>>2];c=g,u=A,h=y,l=m}n=B[(t|c>>22&1020)>>2]<<24^B[(t|u>>14&1020)>>2]<<16^B[(t|h>>6&1020)>>2]<<8^B[(t|l<<2&1020)>>2]^B[(e|b|0)>>2],i=B[(t|u>>22&1020)>>2]<<24^B[(t|h>>14&1020)>>2]<<16^B[(t|l>>6&1020)>>2]<<8^B[(t|c<<2&1020)>>2]^B[(e|b|4)>>2],a=B[(t|h>>22&1020)>>2]<<24^B[(t|l>>14&1020)>>2]<<16^B[(t|c>>6&1020)>>2]<<8^B[(t|u<<2&1020)>>2]^B[(e|b|8)>>2],o=B[(t|l>>22&1020)>>2]<<24^B[(t|c>>14&1020)>>2]<<16^B[(t|u>>6&1020)>>2]<<8^B[(t|h<<2&1020)>>2]^B[(e|b|12)>>2]}function k(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;_(0x0000,0x0800,0x1000,E,e,t,r,n)}function S(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0;_(0x0400,0x0c00,0x2000,E,e,n,r,t);a=i,i=o,o=a}function Q(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s^e,c^t,u^r,h^l);s=n,c=i,u=a,h=o}function x(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;var f=0;_(0x0400,0x0c00,0x2000,E,e,l,r,t);f=i,i=o,o=f;n=n^s,i=i^c,a=a^u,o=o^h;s=e,c=t,u=r,h=l}function P(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n=n^e,c=i=i^t,u=a=a^r,h=o=o^l}function M(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);n=n^e,i=i^t,a=a^r,o=o^l;s=e,c=t,u=r,h=l}function U(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n,c=i,u=a,h=o;n=n^e,i=i^t,a=a^r,o=o^l}function D(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;_(0x0000,0x0800,0x1000,E,l,f,d,p);p=~m&p|m&p+1;d=~y&d|y&d+((p|0)==0);f=~A&f|A&f+((d|0)==0);l=~g&l|g&l+((f|0)==0);n=n^e;i=i^t;a=a^r;o=o^s}function R(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0,o=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0;e=e^s,t=t^c,r=r^u,n=n^h;i=b|0,a=w|0,o=v|0,l=I|0;for(;(A|0)<128;A=A+1|0){if(i>>>31){f=f^e,d=d^t,p=p^r,g=g^n}i=i<<1|a>>>31,a=a<<1|o>>>31,o=o<<1|l>>>31,l=l<<1;y=n&1;n=n>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(y)e=e^0xe1000000}s=f,c=d,u=p,h=g}function F(e){e=e|0;E=e}function T(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;n=e,i=t,a=r,o=s}function q(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;s=e,c=t,u=r,h=n}function O(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;l=e,f=t,d=r,p=n}function K(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;g=e,A=t,y=r,m=n}function H(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;p=~m&p|m&n,d=~y&d|y&r,f=~A&f|A&t,l=~g&l|g&e}function N(e){e=e|0;if(e&15)return-1;C[e|0]=n>>>24,C[e|1]=n>>>16&255,C[e|2]=n>>>8&255,C[e|3]=n&255,C[e|4]=i>>>24,C[e|5]=i>>>16&255,C[e|6]=i>>>8&255,C[e|7]=i&255,C[e|8]=a>>>24,C[e|9]=a>>>16&255,C[e|10]=a>>>8&255,C[e|11]=a&255,C[e|12]=o>>>24,C[e|13]=o>>>16&255,C[e|14]=o>>>8&255,C[e|15]=o&255;return 16}function L(e){e=e|0;if(e&15)return-1;C[e|0]=s>>>24,C[e|1]=s>>>16&255,C[e|2]=s>>>8&255,C[e|3]=s&255,C[e|4]=c>>>24,C[e|5]=c>>>16&255,C[e|6]=c>>>8&255,C[e|7]=c&255,C[e|8]=u>>>24,C[e|9]=u>>>16&255,C[e|10]=u>>>8&255,C[e|11]=u&255,C[e|12]=h>>>24,C[e|13]=h>>>16&255,C[e|14]=h>>>8&255,C[e|15]=h&255;return 16}function G(){k(0,0,0,0);b=n,w=i,v=a,I=o}function j(e,t,r){e=e|0;t=t|0;r=r|0;var s=0;if(t&15)return-1;while((r|0)>=16){W[e&7](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);C[t|0]=n>>>24,C[t|1]=n>>>16&255,C[t|2]=n>>>8&255,C[t|3]=n&255,C[t|4]=i>>>24,C[t|5]=i>>>16&255,C[t|6]=i>>>8&255,C[t|7]=i&255,C[t|8]=a>>>24,C[t|9]=a>>>16&255,C[t|10]=a>>>8&255,C[t|11]=a&255,C[t|12]=o>>>24,C[t|13]=o>>>16&255,C[t|14]=o>>>8&255,C[t|15]=o&255;s=s+16|0,t=t+16|0,r=r-16|0}return s|0}function z(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){Z[e&1](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);n=n+16|0,t=t+16|0,r=r-16|0}return n|0}var W=[k,S,Q,x,P,M,U,D];var Z=[Q,R];return{set_rounds:F,set_state:T,set_iv:q,set_nonce:O,set_mask:K,set_counter:H,get_state:N,get_iv:L,gcm_init:G,cipher:j,mac:z}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},e,t);return h.set_key=function(e,t,n,a,o,c,u,l,f){var d=r.subarray(0,60),p=r.subarray(256,316);d.set([t,n,a,o,c,u,l,f]);for(var g=e,A=1;g<4*e+28;g++){var y=d[g-1];(g%e==0||8===e&&g%e==4)&&(y=i[y>>>24]<<24^i[y>>>16&255]<<16^i[y>>>8&255]<<8^i[255&y]),g%e==0&&(y=y<<8^y>>>24^A<<24,A=A<<1^(128&A?27:0)),d[g]=d[g-e]^y}for(var m=0;m=g-4?y:s[0][i[y>>>24]]^s[1][i[y>>>16&255]]^s[2][i[y>>>8&255]]^s[3][i[255&y]];h.set_rounds(e+5)},h};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function vs(e){return e instanceof Uint8Array}function Is(e,t){const r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return e||new Uint8Array(new ArrayBuffer(r))}function Es(e,t,r,n,i){const a=e.length-t,o=ae+t.length),0),r=new Uint8Array(t);let n=0;for(let t=0;t>2,i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12),n>16?i.getUint32(16):0,n>16?i.getUint32(20):0,n>24?i.getUint32(24):0,n>24?i.getUint32(28):0),void 0!==t){if(16!==t.length)throw new _s("illegal iv size");let e=new DataView(t.buffer,t.byteOffset,t.byteLength);r.set_iv(e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12))}else r.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!vs(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),n=ws.ENC[this.mode],i=ws.HEAP_DATA,a=this.pos,o=this.len,s=0,c=e.length||0,u=0,h=0,l=new Uint8Array(o+c&-16);for(;c>0;)h=Es(t,a+o,e,s,c),o+=h,s+=h,c-=h,h=r.cipher(n,i+a,o),h&&l.set(t.subarray(a,a+h),u),u+=h,h0;)f=Es(t,a+o,e,s,c),o+=f,s+=f,c-=f,f=r.cipher(n,i+a,o-(c?0:l)),f&&d.set(t.subarray(a,a+f),u),u+=f,f0){if(a%16){if(this.hasOwnProperty("padding"))throw new _s("data length must be a multiple of the block size");a+=16-a%16}if(t.cipher(r,n+i,a),this.hasOwnProperty("padding")&&this.padding){let t=e[i+o-1];if(t<1||t>16||t>o)throw new ks("bad padding");let r=0;for(let n=t;n>1;n--)r|=t^e[i+o-n];if(r)throw new ks("bad padding");o-=t}}const s=new Uint8Array(o);return o>0&&s.set(e.subarray(i,i+o)),this.pos=0,this.len=0,this.release_asm(),s}}class Ps{static encrypt(e,t,r=!1){return new Ps(t,r).encrypt(e)}static decrypt(e,t,r=!1){return new Ps(t,r).decrypt(e)}constructor(e,t=!1,r){this.aes=r||new xs(e,void 0,t,"ECB")}encrypt(e){return Bs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Bs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Ms(e){const t=function(e){const t=new Ps(e);this.encrypt=function(e){return t.encrypt(e)},this.decrypt=function(e){return t.decrypt(e)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=e/8,t}function Us(e,t,r,n,i,a){const o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],c=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let p,g,A,y,m,b,w,v,I,E,B,C,_,k,S=0,Q=t.length;const x=32===e.length?3:9;v=3===x?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(e,t){const r=8-e.length%8;let n;if(2===t&&r<8)n=32;else if(1===t)n=r;else{if(t||!(r<8)){if(8===r)return e;throw Error("des: invalid padding")}n=0}const i=new Uint8Array(e.length+r);for(let t=0;t>>4^w),w^=A,b^=A<<4,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,b=b<<1|b>>>31,w=w<<1|w>>>31,g=0;g>>4|w<<28)^e[p+1],A=b,b=w,w=A^(s[y>>>24&63]|u[y>>>16&63]|l[y>>>8&63]|d[63&y]|o[m>>>24&63]|c[m>>>16&63]|h[m>>>8&63]|f[63&m]);A=b,b=w,w=A}b=b>>>1|b<<31,w=w>>>1|w<<31,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=252645135&(b>>>4^w),w^=A,b^=A<<4,1===n&&(r?(I=b,B=w):(b^=E,w^=C)),P[M++]=b>>>24,P[M++]=b>>>16&255,P[M++]=b>>>8&255,P[M++]=255&b,P[M++]=w>>>24,P[M++]=w>>>16&255,P[M++]=w>>>8&255,P[M++]=255&w}return r||(P=function(e,t){let r,n=null;if(2===t)r=32;else if(1===t)n=e[e.length-1];else{if(t)throw Error("des: invalid padding");r=0}if(!n){for(n=1;e[e.length-n]===r;)n++;n--}return e.subarray(0,e.length-n)}(P,a)),P}function Ds(e){const t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],p=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length>8?3:1,A=Array(32*g),y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let m,b,w,v=0,I=0;for(let E=0;E>>4^E),E^=w,g^=w<<4,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=858993459&(g>>>2^E),E^=w,g^=w<<2,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=16711935&(E>>>8^g),g^=w,E^=w<<8,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=g<<8|E>>>20&240,g=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=w;for(let e=0;e<16;e++)y[e]?(g=g<<2|g>>>26,E=E<<2|E>>>26):(g=g<<1|g>>>27,E=E<<1|E>>>27),g&=-15,E&=-15,m=t[g>>>28]|r[g>>>24&15]|n[g>>>20&15]|i[g>>>16&15]|a[g>>>12&15]|o[g>>>8&15]|s[g>>>4&15],b=c[E>>>28]|u[E>>>24&15]|h[E>>>20&15]|l[E>>>16&15]|f[E>>>12&15]|d[E>>>8&15]|p[E>>>4&15],w=65535&(b>>>16^m),A[I++]=m^w,A[I++]=b^w<<16}return A}function Rs(e){this.key=[];for(let t=0;t<3;t++)this.key.push(new Uint8Array(e.subarray(8*t,8*t+8)));this.encrypt=function(e){return Us(Ds(this.key[2]),Us(Ds(this.key[1]),Us(Ds(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Fs(){this.BlockSize=8,this.KeySize=16,this.setKey=function(e){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),e.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(e),!0},this.reset=function(){for(let e=0;e<16;e++)this.masking[e]=0,this.rotate[e]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>>16&255,t[a+6]=s>>>8&255,t[a+7]=255&s}return t},this.decrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>16&255,t[a+6]=s>>8&255,t[a+7]=255&s}return t};const e=[,,,,];e[0]=[,,,,],e[0][0]=[4,0,13,15,12,14,8],e[0][1]=[5,2,16,18,17,19,10],e[0][2]=[6,3,23,22,21,20,9],e[0][3]=[7,1,26,25,27,24,11],e[1]=[,,,,],e[1][0]=[0,6,21,23,20,22,16],e[1][1]=[1,4,0,2,1,3,18],e[1][2]=[2,5,7,6,5,4,17],e[1][3]=[3,7,10,9,11,8,19],e[2]=[,,,,],e[2][0]=[4,0,13,15,12,14,8],e[2][1]=[5,2,16,18,17,19,10],e[2][2]=[6,3,23,22,21,20,9],e[2][3]=[7,1,26,25,27,24,11],e[3]=[,,,,],e[3][0]=[0,6,21,23,20,22,16],e[3][1]=[1,4,0,2,1,3,18],e[3][2]=[2,5,7,6,5,4,17],e[3][3]=[3,7,10,9,11,8,19];const t=[,,,,];function r(e,t,r){const n=t+e,i=n<>>32-r;return(a[0][i>>>24]^a[1][i>>>16&255])-a[2][i>>>8&255]+a[3][255&i]}function n(e,t,r){const n=t^e,i=n<>>32-r;return a[0][i>>>24]-a[1][i>>>16&255]+a[2][i>>>8&255]^a[3][255&i]}function i(e,t,r){const n=t-e,i=n<>>32-r;return(a[0][i>>>24]+a[1][i>>>16&255]^a[2][i>>>8&255])-a[3][255&i]}t[0]=[,,,,],t[0][0]=[24,25,23,22,18],t[0][1]=[26,27,21,20,22],t[0][2]=[28,29,19,18,25],t[0][3]=[30,31,17,16,28],t[1]=[,,,,],t[1][0]=[3,2,12,13,8],t[1][1]=[1,0,14,15,13],t[1][2]=[7,6,8,9,3],t[1][3]=[5,4,10,11,7],t[2]=[,,,,],t[2][0]=[19,18,28,29,25],t[2][1]=[17,16,30,31,28],t[2][2]=[23,22,24,25,18],t[2][3]=[21,20,26,27,22],t[3]=[,,,,],t[3][0]=[8,9,7,6,3],t[3][1]=[10,11,5,4,7],t[3][2]=[12,13,3,2,8],t[3][3]=[14,15,1,0,13],this.keySchedule=function(r){const n=[,,,,,,,,],i=Array(32);let o;for(let e=0;e<4;e++)o=4*e,n[e]=r[o]<<24|r[o+1]<<16|r[o+2]<<8|r[o+3];const s=[6,7,4,5];let c,u=0;for(let r=0;r<2;r++)for(let r=0;r<4;r++){for(o=0;o<4;o++){const t=e[r][o];c=n[t[1]],c^=a[4][n[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=a[5][n[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=a[6][n[t[4]>>>2]>>>24-8*(3&t[4])&255],c^=a[7][n[t[5]>>>2]>>>24-8*(3&t[5])&255],c^=a[s[o]][n[t[6]>>>2]>>>24-8*(3&t[6])&255],n[t[0]]=c}for(o=0;o<4;o++){const e=t[r][o];c=a[4][n[e[0]>>>2]>>>24-8*(3&e[0])&255],c^=a[5][n[e[1]>>>2]>>>24-8*(3&e[1])&255],c^=a[6][n[e[2]>>>2]>>>24-8*(3&e[2])&255],c^=a[7][n[e[3]>>>2]>>>24-8*(3&e[3])&255],c^=a[4+o][n[e[4]>>>2]>>>24-8*(3&e[4])&255],i[u]=c,u++}}for(let e=0;e<16;e++)this.masking[e]=i[e],this.rotate[e]=31&i[16+e]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Ts(e){this.cast5=new Fs,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Rs.keySize=Rs.prototype.keySize=24,Rs.blockSize=Rs.prototype.blockSize=8,Ts.blockSize=Ts.prototype.blockSize=8,Ts.keySize=Ts.prototype.keySize=16;const qs=4294967295;function Os(e,t){return(e<>>32-t)&qs}function Ks(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Hs(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function Ns(e,t){return e>>>8*t&255}function Ls(e){this.tf=function(){let e=null,t=null,r=-1,n=[],i=[[],[],[],[]];function a(e){return i[0][Ns(e,0)]^i[1][Ns(e,1)]^i[2][Ns(e,2)]^i[3][Ns(e,3)]}function o(e){return i[0][Ns(e,3)]^i[1][Ns(e,0)]^i[2][Ns(e,1)]^i[3][Ns(e,2)]}function s(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Os(t[2]^r+i+n[4*e+8]&qs,31),t[3]=Os(t[3],1)^r+2*i+n[4*e+9]&qs,r=a(t[2]),i=o(t[3]),t[0]=Os(t[0]^r+i+n[4*e+10]&qs,31),t[1]=Os(t[1],1)^r+2*i+n[4*e+11]&qs}function c(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Os(t[2],1)^r+i+n[4*e+10]&qs,t[3]=Os(t[3]^r+2*i+n[4*e+11]&qs,31),r=a(t[2]),i=o(t[3]),t[0]=Os(t[0],1)^r+i+n[4*e+8]&qs,t[1]=Os(t[1]^r+2*i+n[4*e+9]&qs,31)}return{name:"twofish",blocksize:16,open:function(t){let r,a,o,s,c;e=t;const u=[],h=[],l=[];let f;const d=[];let p,g,A;const y=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],m=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],b=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],w=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],v=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],I=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],E=[[],[]],B=[[],[],[],[]];function C(e){return e^e>>2^[0,90,180,238][3&e]}function _(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function k(e,t){let r,n,i;for(r=0;r<8;r++)n=t>>>24,t=t<<8&qs|e>>>24,e=e<<8&qs,i=n<<1,128&n&&(i^=333),t^=n^i<<16,i^=n>>>1,1&n&&(i^=166),t^=i<<24|i<<8;return t}function S(e,t){const r=t>>4,n=15&t,i=y[e][r^n],a=m[e][v[n]^I[r]];return w[e][v[a]^I[i]]<<4|b[e][i^a]}function Q(e,t){let r=Ns(e,0),n=Ns(e,1),i=Ns(e,2),a=Ns(e,3);switch(f){case 4:r=E[1][r]^Ns(t[3],0),n=E[0][n]^Ns(t[3],1),i=E[0][i]^Ns(t[3],2),a=E[1][a]^Ns(t[3],3);case 3:r=E[1][r]^Ns(t[2],0),n=E[1][n]^Ns(t[2],1),i=E[0][i]^Ns(t[2],2),a=E[0][a]^Ns(t[2],3);case 2:r=E[0][E[0][r]^Ns(t[1],0)]^Ns(t[0],0),n=E[0][E[1][n]^Ns(t[1],1)]^Ns(t[0],1),i=E[1][E[0][i]^Ns(t[1],2)]^Ns(t[0],2),a=E[1][E[1][a]^Ns(t[1],3)]^Ns(t[0],3)}return B[0][r]^B[1][n]^B[2][i]^B[3][a]}for(e=e.slice(0,32),r=e.length;16!==r&&24!==r&&32!==r;)e[r++]=0;for(r=0;r>2]=Ks(e,r);for(r=0;r<256;r++)E[0][r]=S(0,r),E[1][r]=S(1,r);for(r=0;r<256;r++)p=E[1][r],g=C(p),A=_(p),B[0][r]=p+(g<<8)+(A<<16)+(A<<24),B[2][r]=g+(A<<8)+(p<<16)+(A<<24),p=E[0][r],g=C(p),A=_(p),B[1][r]=A+(A<<8)+(g<<16)+(p<<24),B[3][r]=g+(p<<8)+(A<<16)+(g<<24);for(f=l.length/2,r=0;r=0;e--)c(e,a);Hs(t,r,a[2]^n[0]),Hs(t,r+4,a[3]^n[1]),Hs(t,r+8,a[0]^n[2]),Hs(t,r+12,a[1]^n[3]),r+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Gs(){}function js(e){this.bf=new Gs,this.bf.init(e),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Ls.keySize=Ls.prototype.keySize=32,Ls.blockSize=Ls.prototype.blockSize=16,Gs.prototype.BLOCKSIZE=8,Gs.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Gs.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Gs.prototype.NN=16,Gs.prototype._clean=function(e){return e<0&&(e=2147483648+(2147483647&e)),e},Gs.prototype._F=function(e){let t;const r=255&e,n=255&(e>>>=8),i=255&(e>>>=8),a=255&(e>>>=8);return t=this.sboxes[0][a]+this.sboxes[1][i],t^=this.sboxes[2][n],t+=this.sboxes[3][r],t},Gs.prototype._encryptBlock=function(e){let t,r=e[0],n=e[1];for(t=0;t>>24-8*t&255,i[t+n]=r[1]>>>24-8*t&255;return i},Gs.prototype._decryptBlock=function(e){let t,r=e[0],n=e[1];for(t=this.NN+1;t>1;--t){r^=this.parray[t],n=this._F(r)^n;const e=r;r=n,n=e}r^=this.parray[1],n^=this.parray[0],e[0]=this._clean(n),e[1]=this._clean(r)},Gs.prototype.init=function(e){let t,r=0;for(this.parray=[],t=0;t=e.length&&(r=0);this.parray[t]=this.PARRAY[t]^n}for(this.sboxes=[],t=0;t<4;++t)for(this.sboxes[t]=[],r=0;r<256;++r)this.sboxes[t][r]=this.SBOXES[t][r];const n=[0,0];for(t=0;t>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=t+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=r+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=c+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=u+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=h+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=l+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=f+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=d+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=p+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=g+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=A+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=y+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=m+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=b+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=w+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=m^d^r^e;S=_<<1|_>>>31;k=S+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=b^p^c^t;Q=_<<1|_>>>31;k=Q+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=w^g^u^r;x=_<<1|_>>>31;k=x+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=S^A^h^c;P=_<<1|_>>>31;k=P+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Q^y^l^u;M=_<<1|_>>>31;k=M+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=x^m^f^h;U=_<<1|_>>>31;k=U+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=P^b^d^l;D=_<<1|_>>>31;k=D+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=M^w^p^f;R=_<<1|_>>>31;k=R+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=U^S^g^d;F=_<<1|_>>>31;k=F+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=D^Q^A^p;T=_<<1|_>>>31;k=T+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=R^x^y^g;q=_<<1|_>>>31;k=q+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=F^P^m^A;O=_<<1|_>>>31;k=O+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=T^M^b^y;K=_<<1|_>>>31;k=K+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=q^U^w^m;H=_<<1|_>>>31;k=H+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=O^D^S^b;N=_<<1|_>>>31;k=N+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=K^R^Q^w;L=_<<1|_>>>31;k=L+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=H^F^x^S;G=_<<1|_>>>31;k=G+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=N^T^P^Q;j=_<<1|_>>>31;k=j+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=L^q^M^x;z=_<<1|_>>>31;k=z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=G^O^U^P;W=_<<1|_>>>31;k=W+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=j^K^D^M;Z=_<<1|_>>>31;k=Z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=z^H^R^U;J=_<<1|_>>>31;k=J+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=W^N^F^D;V=_<<1|_>>>31;k=V+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Z^L^T^R;Y=_<<1|_>>>31;k=Y+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=J^G^q^F;$=_<<1|_>>>31;k=$+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=V^j^O^T;X=_<<1|_>>>31;k=X+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Y^z^K^q;ee=_<<1|_>>>31;k=ee+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=$^W^H^O;te=_<<1|_>>>31;k=te+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=X^Z^N^K;re=_<<1|_>>>31;k=re+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ee^J^L^H;ne=_<<1|_>>>31;k=ne+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=te^V^G^N;ie=_<<1|_>>>31;k=ie+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=re^Y^j^L;ae=_<<1|_>>>31;k=ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ne^$^z^G;oe=_<<1|_>>>31;k=oe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ie^X^W^j;se=_<<1|_>>>31;k=se+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ae^ee^Z^z;ce=_<<1|_>>>31;k=ce+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=oe^te^J^W;ue=_<<1|_>>>31;k=ue+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=se^re^V^Z;he=_<<1|_>>>31;k=he+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ce^ne^Y^J;le=_<<1|_>>>31;k=le+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ue^ie^$^V;fe=_<<1|_>>>31;k=fe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=he^ae^X^Y;de=_<<1|_>>>31;k=de+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=le^oe^ee^$;pe=_<<1|_>>>31;k=pe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=fe^se^te^X;ge=_<<1|_>>>31;k=ge+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=de^ce^re^ee;Ae=_<<1|_>>>31;k=Ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=pe^ue^ne^te;ye=_<<1|_>>>31;k=ye+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ge^he^ie^re;me=_<<1|_>>>31;k=me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ae^le^ae^ne;be=_<<1|_>>>31;k=be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ye^fe^oe^ie;we=_<<1|_>>>31;k=we+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=me^de^se^ae;ve=_<<1|_>>>31;k=ve+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=be^pe^ce^oe;Ie=_<<1|_>>>31;k=Ie+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=we^ge^ue^se;Ee=_<<1|_>>>31;k=Ee+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ve^Ae^he^ce;Be=_<<1|_>>>31;k=Be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ie^ye^le^ue;Ce=_<<1|_>>>31;k=Ce+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ee^me^fe^he;_e=_<<1|_>>>31;k=_e+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Be^be^de^le;ke=_<<1|_>>>31;k=ke+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ce^we^pe^fe;Se=_<<1|_>>>31;k=Se+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=_e^ve^ge^de;Qe=_<<1|_>>>31;k=Qe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ke^Ie^Ae^pe;xe=_<<1|_>>>31;k=xe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Se^Ee^ye^ge;Pe=_<<1|_>>>31;k=Pe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Qe^Be^me^Ae;Me=_<<1|_>>>31;k=Me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=xe^Ce^be^ye;Ue=_<<1|_>>>31;k=Ue+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Pe^_e^we^me;De=_<<1|_>>>31;k=De+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Me^ke^ve^be;Re=_<<1|_>>>31;k=Re+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ue^Se^Ie^we;Fe=_<<1|_>>>31;k=Fe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=De^Qe^Ee^ve;Te=_<<1|_>>>31;k=Te+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;n=n+v|0;i=i+I|0;a=a+E|0;o=o+B|0;s=s+C|0}function I(e){e=e|0;v(w[e|0]<<24|w[e|1]<<16|w[e|2]<<8|w[e|3],w[e|4]<<24|w[e|5]<<16|w[e|6]<<8|w[e|7],w[e|8]<<24|w[e|9]<<16|w[e|10]<<8|w[e|11],w[e|12]<<24|w[e|13]<<16|w[e|14]<<8|w[e|15],w[e|16]<<24|w[e|17]<<16|w[e|18]<<8|w[e|19],w[e|20]<<24|w[e|21]<<16|w[e|22]<<8|w[e|23],w[e|24]<<24|w[e|25]<<16|w[e|26]<<8|w[e|27],w[e|28]<<24|w[e|29]<<16|w[e|30]<<8|w[e|31],w[e|32]<<24|w[e|33]<<16|w[e|34]<<8|w[e|35],w[e|36]<<24|w[e|37]<<16|w[e|38]<<8|w[e|39],w[e|40]<<24|w[e|41]<<16|w[e|42]<<8|w[e|43],w[e|44]<<24|w[e|45]<<16|w[e|46]<<8|w[e|47],w[e|48]<<24|w[e|49]<<16|w[e|50]<<8|w[e|51],w[e|52]<<24|w[e|53]<<16|w[e|54]<<8|w[e|55],w[e|56]<<24|w[e|57]<<16|w[e|58]<<8|w[e|59],w[e|60]<<24|w[e|61]<<16|w[e|62]<<8|w[e|63])}function E(e){e=e|0;w[e|0]=n>>>24;w[e|1]=n>>>16&255;w[e|2]=n>>>8&255;w[e|3]=n&255;w[e|4]=i>>>24;w[e|5]=i>>>16&255;w[e|6]=i>>>8&255;w[e|7]=i&255;w[e|8]=a>>>24;w[e|9]=a>>>16&255;w[e|10]=a>>>8&255;w[e|11]=a&255;w[e|12]=o>>>24;w[e|13]=o>>>16&255;w[e|14]=o>>>8&255;w[e|15]=o&255;w[e|16]=s>>>24;w[e|17]=s>>>16&255;w[e|18]=s>>>8&255;w[e|19]=s&255}function B(){n=0x67452301;i=0xefcdab89;a=0x98badcfe;o=0x10325476;s=0xc3d2e1f0;c=u=0}function C(e,t,r,h,l,f,d){e=e|0;t=t|0;r=r|0;h=h|0;l=l|0;f=f|0;d=d|0;n=e;i=t;a=r;o=h;s=l;c=f;u=d}function _(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){I(e);e=e+64|0;t=t-64|0;r=r+64|0}c=c+r|0;if(c>>>0>>0)u=u+1|0;return r|0}function k(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=_(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;c=c+t|0;if(c>>>0>>0)u=u+1|0;w[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)w[e|i]=0x00;I(e);t=0;w[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)w[e|i]=0;w[e|56]=u>>>21&255;w[e|57]=u>>>13&255;w[e|58]=u>>>5&255;w[e|59]=u<<3&255|c>>>29;w[e|60]=c>>>21&255;w[e|61]=c>>>13&255;w[e|62]=c>>>5&255;w[e|63]=c<<3&255;I(e);if(~r)E(r);return n|0}function S(){n=h;i=l;a=f;o=d;s=p;c=64;u=0}function Q(){n=g;i=A;a=y;o=m;s=b;c=64;u=0}function x(e,t,r,w,I,E,C,_,k,S,Q,x,P,M,U,D){e=e|0;t=t|0;r=r|0;w=w|0;I=I|0;E=E|0;C=C|0;_=_|0;k=k|0;S=S|0;Q=Q|0;x=x|0;P=P|0;M=M|0;U=U|0;D=D|0;B();v(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,w^0x5c5c5c5c,I^0x5c5c5c5c,E^0x5c5c5c5c,C^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,S^0x5c5c5c5c,Q^0x5c5c5c5c,x^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,U^0x5c5c5c5c,D^0x5c5c5c5c);g=n;A=i;y=a;m=o;b=s;B();v(e^0x36363636,t^0x36363636,r^0x36363636,w^0x36363636,I^0x36363636,E^0x36363636,C^0x36363636,_^0x36363636,k^0x36363636,S^0x36363636,Q^0x36363636,x^0x36363636,P^0x36363636,M^0x36363636,U^0x36363636,D^0x36363636);h=n;l=i;f=a;d=o;p=s;c=64;u=0}function P(e,t,r){e=e|0;t=t|0;r=r|0;var c=0,u=0,h=0,l=0,f=0,d=0;if(e&63)return-1;if(~r)if(r&31)return-1;d=k(e,t,-1)|0;c=n,u=i,h=a,l=o,f=s;Q();v(c,u,h,l,f,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)E(r);return d|0}function M(e,t,r,c,u){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;var h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~u)if(u&31)return-1;w[e+t|0]=r>>>24;w[e+t+1|0]=r>>>16&255;w[e+t+2|0]=r>>>8&255;w[e+t+3|0]=r&255;P(e,t+4|0,-1)|0;h=g=n,l=A=i,f=y=a,d=m=o,p=b=s;c=c-1|0;while((c|0)>0){S();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;Q();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;h=h^n;l=l^i;f=f^a;d=d^o;p=p^s;c=c-1|0}n=h;i=l;a=f;o=d;s=p;if(~u)E(u);return 0}return{reset:B,init:C,process:_,finish:k,hmac_reset:S,hmac_init:x,hmac_finish:P,pbkdf2_generate_block:M}};class Ys{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(null!==this.result)throw new Cs("state must be reset before processing new data");const{asm:t,heap:r}=this.acquire_asm();let n=this.pos,i=this.len,a=0,o=e.length,s=0;for(;o>0;)s=Es(r,n+i,e,a,o),i+=s,a+=s,o-=s,s=t.process(n,i),n+=s,i-=s,i||(n=0);return this.pos=n,this.len=i,this}finish(){if(null!==this.result)throw new Cs("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const $s=[],Xs=[];class ec extends Ys{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=$s.pop()||Is(),this.asm=Xs.pop()||Vs({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&($s.push(this.heap),Xs.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new ec).process(e).finish().result}}ec.NAME="sha1",ec.heap_pool=[],ec.asm_pool=[],ec.asm_function=Vs;const tc=[],rc=[];class nc extends Ys{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=tc.pop()||Is(),this.asm=rc.pop()||function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=new e.Uint8Array(r);function x(e,t,r,l,f,d,p,g,A,y,m,b,w,v,I,E){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;w=w|0;v=v|0;I=I|0;E=E|0;var B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0;B=n;C=i;_=a;k=o;S=s;Q=c;x=u;P=h;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x428a2f98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x71374491|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb5c0fbcf|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xe9b5dba5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x3956c25b|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x59f111f1|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x923f82a4|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xab1c5ed5|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xd807aa98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x12835b01|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x243185be|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x550c7dc3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x72be5d74|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x80deb1fe|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x9bdc06a7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc19bf174|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xe49b69c1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xefbe4786|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x0fc19dc6|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x240ca1cc|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x2de92c6f|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4a7484aa|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5cb0a9dc|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x76f988da|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x983e5152|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa831c66d|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb00327c8|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xbf597fc7|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xc6e00bf3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd5a79147|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x06ca6351|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x14292967|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x27b70a85|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x2e1b2138|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x4d2c6dfc|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x53380d13|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x650a7354|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x766a0abb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x81c2c92e|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x92722c85|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xa2bfe8a1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa81a664b|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xc24b8b70|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xc76c51a3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xd192e819|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd6990624|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xf40e3585|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x106aa070|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x19a4c116|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x1e376c08|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x2748774c|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x34b0bcb5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x391c0cb3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4ed8aa4a|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5b9cca4f|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x682e6ff3|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x748f82ee|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x78a5636f|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x84c87814|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x8cc70208|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x90befffa|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xa4506ceb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xbef9a3f7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc67178f2|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;n=n+B|0;i=i+C|0;a=a+_|0;o=o+k|0;s=s+S|0;c=c+Q|0;u=u+x|0;h=h+P|0}function P(e){e=e|0;x(Q[e|0]<<24|Q[e|1]<<16|Q[e|2]<<8|Q[e|3],Q[e|4]<<24|Q[e|5]<<16|Q[e|6]<<8|Q[e|7],Q[e|8]<<24|Q[e|9]<<16|Q[e|10]<<8|Q[e|11],Q[e|12]<<24|Q[e|13]<<16|Q[e|14]<<8|Q[e|15],Q[e|16]<<24|Q[e|17]<<16|Q[e|18]<<8|Q[e|19],Q[e|20]<<24|Q[e|21]<<16|Q[e|22]<<8|Q[e|23],Q[e|24]<<24|Q[e|25]<<16|Q[e|26]<<8|Q[e|27],Q[e|28]<<24|Q[e|29]<<16|Q[e|30]<<8|Q[e|31],Q[e|32]<<24|Q[e|33]<<16|Q[e|34]<<8|Q[e|35],Q[e|36]<<24|Q[e|37]<<16|Q[e|38]<<8|Q[e|39],Q[e|40]<<24|Q[e|41]<<16|Q[e|42]<<8|Q[e|43],Q[e|44]<<24|Q[e|45]<<16|Q[e|46]<<8|Q[e|47],Q[e|48]<<24|Q[e|49]<<16|Q[e|50]<<8|Q[e|51],Q[e|52]<<24|Q[e|53]<<16|Q[e|54]<<8|Q[e|55],Q[e|56]<<24|Q[e|57]<<16|Q[e|58]<<8|Q[e|59],Q[e|60]<<24|Q[e|61]<<16|Q[e|62]<<8|Q[e|63])}function M(e){e=e|0;Q[e|0]=n>>>24;Q[e|1]=n>>>16&255;Q[e|2]=n>>>8&255;Q[e|3]=n&255;Q[e|4]=i>>>24;Q[e|5]=i>>>16&255;Q[e|6]=i>>>8&255;Q[e|7]=i&255;Q[e|8]=a>>>24;Q[e|9]=a>>>16&255;Q[e|10]=a>>>8&255;Q[e|11]=a&255;Q[e|12]=o>>>24;Q[e|13]=o>>>16&255;Q[e|14]=o>>>8&255;Q[e|15]=o&255;Q[e|16]=s>>>24;Q[e|17]=s>>>16&255;Q[e|18]=s>>>8&255;Q[e|19]=s&255;Q[e|20]=c>>>24;Q[e|21]=c>>>16&255;Q[e|22]=c>>>8&255;Q[e|23]=c&255;Q[e|24]=u>>>24;Q[e|25]=u>>>16&255;Q[e|26]=u>>>8&255;Q[e|27]=u&255;Q[e|28]=h>>>24;Q[e|29]=h>>>16&255;Q[e|30]=h>>>8&255;Q[e|31]=h&255}function U(){n=0x6a09e667;i=0xbb67ae85;a=0x3c6ef372;o=0xa54ff53a;s=0x510e527f;c=0x9b05688c;u=0x1f83d9ab;h=0x5be0cd19;l=f=0}function D(e,t,r,d,p,g,A,y,m,b){e=e|0;t=t|0;r=r|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;n=e;i=t;a=r;o=d;s=p;c=g;u=A;h=y;l=m;f=b}function R(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){P(e);e=e+64|0;t=t-64|0;r=r+64|0}l=l+r|0;if(l>>>0>>0)f=f+1|0;return r|0}function F(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=R(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;l=l+t|0;if(l>>>0>>0)f=f+1|0;Q[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)Q[e|i]=0x00;P(e);t=0;Q[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)Q[e|i]=0;Q[e|56]=f>>>21&255;Q[e|57]=f>>>13&255;Q[e|58]=f>>>5&255;Q[e|59]=f<<3&255|l>>>29;Q[e|60]=l>>>21&255;Q[e|61]=l>>>13&255;Q[e|62]=l>>>5&255;Q[e|63]=l<<3&255;P(e);if(~r)M(r);return n|0}function T(){n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;l=64;f=0}function q(){n=v;i=I;a=E;o=B;s=C;c=_;u=k;h=S;l=64;f=0}function O(e,t,r,Q,P,M,D,R,F,T,q,O,K,H,N,L){e=e|0;t=t|0;r=r|0;Q=Q|0;P=P|0;M=M|0;D=D|0;R=R|0;F=F|0;T=T|0;q=q|0;O=O|0;K=K|0;H=H|0;N=N|0;L=L|0;U();x(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,Q^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,D^0x5c5c5c5c,R^0x5c5c5c5c,F^0x5c5c5c5c,T^0x5c5c5c5c,q^0x5c5c5c5c,O^0x5c5c5c5c,K^0x5c5c5c5c,H^0x5c5c5c5c,N^0x5c5c5c5c,L^0x5c5c5c5c);v=n;I=i;E=a;B=o;C=s;_=c;k=u;S=h;U();x(e^0x36363636,t^0x36363636,r^0x36363636,Q^0x36363636,P^0x36363636,M^0x36363636,D^0x36363636,R^0x36363636,F^0x36363636,T^0x36363636,q^0x36363636,O^0x36363636,K^0x36363636,H^0x36363636,N^0x36363636,L^0x36363636);d=n;p=i;g=a;A=o;y=s;m=c;b=u;w=h;l=64;f=0}function K(e,t,r){e=e|0;t=t|0;r=r|0;var l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~r)if(r&31)return-1;b=F(e,t,-1)|0;l=n,f=i,d=a,p=o,g=s,A=c,y=u,m=h;q();x(l,f,d,p,g,A,y,m,0x80000000,0,0,0,0,0,0,768);if(~r)M(r);return b|0}function H(e,t,r,l,f){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;var d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0;if(e&63)return-1;if(~f)if(f&31)return-1;Q[e+t|0]=r>>>24;Q[e+t+1|0]=r>>>16&255;Q[e+t+2|0]=r>>>8&255;Q[e+t+3|0]=r&255;K(e,t+4|0,-1)|0;d=v=n,p=I=i,g=E=a,A=B=o,y=C=s,m=_=c,b=k=u,w=S=h;l=l-1|0;while((l|0)>0){T();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;q();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;d=d^n;p=p^i;g=g^a;A=A^o;y=y^s;m=m^c;b=b^u;w=w^h;l=l-1|0}n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;if(~f)M(f);return 0}return{reset:U,init:D,process:R,finish:F,hmac_reset:T,hmac_init:O,hmac_finish:K,pbkdf2_generate_block:H}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(tc.push(this.heap),rc.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new nc).process(e).finish().result}}nc.NAME="sha256";var ic=ac;function ac(e,t){if(!e)throw Error(t||"Assertion failed")}ac.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var oc=void 0!==uo?uo:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sc(e,t){return e(t={exports:{}},t.exports),t.exports}function cc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var uc=sc((function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}));function hc(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function lc(e){return 1===e.length?"0"+e:e}function fc(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var dc={inherits:uc,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>0}return a},split32:function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},sum64_hi:function(e,t,r,n){return(t+n>>>0>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,a,o,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},sum64_5_hi:function(e,t,r,n,i,a,o,s,c,u){var h=0,l=t;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,r,n,i,a,o,s,c,u){return t+n+a+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function pc(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var gc=pc;pc.prototype.update=function(e,t){if(e=dc.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=dc.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},kc=function(e){return yc(e,17)^yc(e,19)^e>>>10},Sc=dc.sum32,Qc=dc.sum32_4,xc=dc.sum32_5,Pc=Ic,Mc=Ec,Uc=Bc,Dc=Cc,Rc=_c,Fc=kc,Tc=Ac.BlockHash,qc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Oc(){if(!(this instanceof Oc))return new Oc;Tc.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=qc,this.W=Array(64)}dc.inherits(Oc,Tc);var Kc=Oc;function Hc(){if(!(this instanceof Hc))return new Hc;Kc.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Oc.blockSize=512,Oc.outSize=256,Oc.hmacStrength=192,Oc.padLength=64,Oc.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>32-i,r)}function Ru(e,t,r,n,i,a,o){return Du(t&r|~t&n,e,t,i,a,o)}function Fu(e,t,r,n,i,a,o){return Du(t&n|r&~n,e,t,i,a,o)}function Tu(e,t,r,n,i,a,o){return Du(t^r^n,e,t,i,a,o)}function qu(e,t,r,n,i,a,o){return Du(r^(t|~n),e,t,i,a,o)}function Ou(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}const Ku="0123456789abcdef".split("");function Hu(e){let t="",r=0;for(;r<4;r++)t+=Ku[e>>8*r+4&15]+Ku[e>>8*r&15];return t}function Nu(e,t){return e+t&4294967295}const Lu=ts.getWebCrypto(),Gu=ts.getNodeCrypto(),ju=Gu&&Gu.getHashes();function zu(e){if(Gu&&ju.includes(e))return async function(t){const r=Gu.createHash(e);return Lo(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function Wu(e,t){return async function(r,n=us){if(Ao(r)&&(r=await Jo(r)),!ts.isStream(r)&&Lu&&t&&r.length>=n.minBytesForWebCrypto)return new Uint8Array(await Lu.digest(t,r));const i=e();return Lo(r,(e=>{i.update(e)}),(()=>new Uint8Array(i.digest())))}}function Zu(e,t){return async function(r,n=us){if(Ao(r)&&(r=await Jo(r)),ts.isStream(r)){const t=new e;return Lo(r,(e=>{t.process(e)}),(()=>t.finish().result))}return Lu&&t&&r.length>=n.minBytesForWebCrypto?new Uint8Array(await Lu.digest(t,r)):e.bytes(r)}}const Ju={md5:zu("md5")||async function(e){const t=function(e){const t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)Uu(r,Ou(e.substring(n-64,n)));e=e.substring(n-64);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n>2]|=e.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(Uu(r,i),n=0;n<16;n++)i[n]=0;return i[14]=8*t,Uu(r,i),r}(ts.uint8ArrayToString(e));return ts.hexToUint8Array(function(e){for(let t=0;tnew Uint8Array(a.update(e))))}(e,t,r,n);if(ts.isAES(e))return function(e,t,r,n,i){if(ts.getWebCrypto()&&24!==t.length&&!ts.isStream(r)&&r.length>=3e3*i.minBytesForWebCrypto)return async function(e,t,r,n){const i="AES-CBC",a=await Xu.importKey("raw",t,{name:i},!1,["encrypt"]),{blockSize:o}=$u(e),s=ts.concatUint8Array([new Uint8Array(o),r]),c=new Uint8Array(await Xu.encrypt({name:i,iv:n},a,s)).subarray(0,r.length);return function(e,t){for(let r=0;ra.aes.AES_Encrypt_process(e)),(()=>a.aes.AES_Encrypt_finish()))}(e,t,r,n,i);const o=new($u(e))(t),s=o.blockSize,c=n.slice();let u=new Uint8Array;const h=e=>{e&&(u=ts.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,n=0;for(;e?u.length>=s:u.length;){const e=o.encrypt(c);for(r=0;rnew Uint8Array(a.update(e))))}(e,t,r,n);if(ts.isAES(e))return function(e,t,r,n){if(ts.isStream(r)){const e=new Yu(t,n);return Lo(r,(t=>e.aes.AES_Decrypt_process(t)),(()=>e.aes.AES_Decrypt_finish()))}return Yu.decrypt(r,t,n)}(0,t,r,n);const a=new($u(e))(t),o=a.blockSize;let s=n,c=new Uint8Array;const u=e=>{e&&(c=ts.concatUint8Array([c,e]));const t=new Uint8Array(c.length);let r,n=0;for(;e?c.length>=o:c.length;){const e=a.encrypt(s);for(s=c.subarray(0,o),r=0;r48)throw new _s("illegal counter size");let e=Math.pow(2,r)-1;n.set_mask(0,0,e/4294967296|0,0|e)}else r=48,n.set_mask(0,0,65535,4294967295);if(void 0===e)throw Error("nonce is required");{let t=e.length;if(!t||t>16)throw new _s("illegal nonce size");let r=new DataView(new ArrayBuffer(16));new Uint8Array(r.buffer).set(e),n.set_nonce(r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12))}if(void 0!==t){if(t<0||t>=Math.pow(2,r))throw new _s("illegal counter value");n.set_counter(0,0,t/4294967296|0,0|t)}}}class ah{static encrypt(e,t,r=!0,n){return new ah(t,n,r).encrypt(e)}static decrypt(e,t,r=!0,n){return new ah(t,n,r).decrypt(e)}constructor(e,t,r=!0,n){this.aes=n||new xs(e,t,r,"CBC")}encrypt(e){return Bs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Bs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const oh=ts.getWebCrypto(),sh=ts.getNodeCrypto(),ch=16;function uh(e,t){const r=e.length-ch;for(let n=0;n>3),17+(u>>3)),8-(7&u)).subarray(1),d=new Uint8Array(Eh),p=new Uint8Array(t.length+Bh);let g,A=0;for(g=0;g16)throw new _s("illegal tagSize value");const s=t.length||0,c=new Uint8Array(16);12!==s?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=s>>>29,o[12]=s>>>21&255,o[13]=s>>>13&255,o[14]=s>>>5&255,o[15]=s<<3&255,a.mac(ws.MAC.GCM,ws.HEAP_DATA,16),a.get_iv(ws.HEAP_DATA),a.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const u=new DataView(c.buffer);if(this.gamma0=u.getUint32(12),a.set_nonce(u.getUint32(0),u.getUint32(4),u.getUint32(8),0),a.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>Ph)throw new _s("illegal adata length");r.length?(this.adata=r,this._gcm_mac_process(r)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");a.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,r,n,i){return new Mh(t,r,n,i).encrypt(e)}static decrypt(e,t,r,n,i){return new Mh(t,r,n,i).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.aes.pos,s=this.aes.len,c=0,u=s+r&-16,h=0;if((a-1<<4)+s+r>Ph)throw new RangeError("counter overflow");const l=new Uint8Array(u);for(;r>0;)h=Es(i,o+s,e,t,r),s+=h,t+=h,r-=h,h=n.cipher(ws.ENC.CTR,ws.HEAP_DATA+o,s),h=n.mac(ws.MAC.GCM,ws.HEAP_DATA+o,h),h&&l.set(i.subarray(o,o+h),c),a+=h>>>4,c+=h,h>>29,t[4]=u>>>21,t[5]=u>>>13&255,t[6]=u>>>5&255,t[7]=u<<3&255,t[8]=t[9]=t[10]=0,t[11]=h>>>29,t[12]=h>>>21&255,t[13]=h>>>13&255,t[14]=h>>>5&255,t[15]=h<<3&255,e.mac(ws.MAC.GCM,ws.HEAP_DATA,16),e.get_iv(ws.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ws.ENC.CTR,ws.HEAP_DATA,16),s.set(t.subarray(0,n),o),this.counter=1,this.aes.pos=0,this.aes.len=0,s}AES_GCM_Decrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.tagSize,s=this.aes.pos,c=this.aes.len,u=0,h=c+r>o?c+r-o&-16:0,l=c+r-h,f=0;if((a-1<<4)+c+r>Ph)throw new RangeError("counter overflow");const d=new Uint8Array(h);for(;r>l;)f=Es(i,s+c,e,t,r-l),c+=f,t+=f,r-=f,f=n.mac(ws.MAC.GCM,ws.HEAP_DATA+s,f),f=n.cipher(ws.DEC.CTR,ws.HEAP_DATA+s,f),f&&d.set(i.subarray(s,s+f),u),a+=f>>>4,u+=f,s=0,c=0;return r>0&&(c+=Es(i,0,e,t,r)),this.counter=a,this.aes.pos=s,this.aes.len=c,d}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.tagSize,n=this.adata,i=this.counter,a=this.aes.pos,o=this.aes.len,s=o-r;if(o>>29,t[4]=l>>>21,t[5]=l>>>13&255,t[6]=l>>>5&255,t[7]=l<<3&255,t[8]=t[9]=t[10]=0,t[11]=f>>>29,t[12]=f>>>21&255,t[13]=f>>>13&255,t[14]=f>>>5&255,t[15]=f<<3&255,e.mac(ws.MAC.GCM,ws.HEAP_DATA,16),e.get_iv(ws.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ws.ENC.CTR,ws.HEAP_DATA,16);let d=0;for(let e=0;e0;){for(a=Es(r,0,e,n,i),n+=a,i-=a;15&a;)r[a++]=0;t.mac(ws.MAC.GCM,ws.HEAP_DATA,a)}}}const Uh=ts.getWebCrypto(),Dh=ts.getNodeCrypto(),Rh=ts.getNodeBuffer(),Fh=16,Th="AES-GCM";async function qh(e,t){if(e!==Xo.symmetric.aes128&&e!==Xo.symmetric.aes192&&e!==Xo.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(ts.getNodeCrypto())return{encrypt:async function(e,r,n=new Uint8Array){const i=new Dh.createCipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n);const a=Rh.concat([i.update(e),i.final(),i.getAuthTag()]);return new Uint8Array(a)},decrypt:async function(e,r,n=new Uint8Array){const i=new Dh.createDecipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n),i.setAuthTag(e.slice(e.length-Fh,e.length));const a=Rh.concat([i.update(e.slice(0,e.length-Fh)),i.final()]);return new Uint8Array(a)}};if(ts.getWebCrypto()&&24!==t.length){const e=await Uh.importKey("raw",t,{name:Th},!1,["encrypt","decrypt"]);return{encrypt:async function(r,n,i=new Uint8Array){if(!r.length)return Mh.encrypt(r,t,n,i);const a=await Uh.encrypt({name:Th,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)},decrypt:async function(r,n,i=new Uint8Array){if(r.length===Fh)return Mh.decrypt(r,t,n,i);const a=await Uh.decrypt({name:Th,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)}}}return{encrypt:async function(e,r,n){return Mh.encrypt(e,t,r,n)},decrypt:async function(e,r,n){return Mh.decrypt(e,t,r,n)}}}qh.getNonce=function(e,t){const r=e.slice();for(let e=0;e>>8)-1}(e,t,r,n)}function d(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function p(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function g(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function A(e,r){var n,i,a,o=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(p(s),p(s),p(s),i=0;i<2;i++){for(o[0]=s[0]-65517,n=1;n<15;n++)o[n]=s[n]-65535-(o[n-1]>>16&1),o[n-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,g(s,o,1-a)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function y(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return A(r,e),A(n,t),f(r,0,n,0)}function m(e){var t=new Uint8Array(32);return A(t,e),1&t[0]}function b(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function w(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function v(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function I(e,t,r){var n,i,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0,M=0,U=0,D=0,R=0,F=r[0],T=r[1],q=r[2],O=r[3],K=r[4],H=r[5],N=r[6],L=r[7],G=r[8],j=r[9],z=r[10],W=r[11],Z=r[12],J=r[13],V=r[14],Y=r[15];a+=(n=t[0])*F,o+=n*T,s+=n*q,c+=n*O,u+=n*K,h+=n*H,l+=n*N,f+=n*L,d+=n*G,p+=n*j,g+=n*z,A+=n*W,y+=n*Z,m+=n*J,b+=n*V,w+=n*Y,o+=(n=t[1])*F,s+=n*T,c+=n*q,u+=n*O,h+=n*K,l+=n*H,f+=n*N,d+=n*L,p+=n*G,g+=n*j,A+=n*z,y+=n*W,m+=n*Z,b+=n*J,w+=n*V,v+=n*Y,s+=(n=t[2])*F,c+=n*T,u+=n*q,h+=n*O,l+=n*K,f+=n*H,d+=n*N,p+=n*L,g+=n*G,A+=n*j,y+=n*z,m+=n*W,b+=n*Z,w+=n*J,v+=n*V,I+=n*Y,c+=(n=t[3])*F,u+=n*T,h+=n*q,l+=n*O,f+=n*K,d+=n*H,p+=n*N,g+=n*L,A+=n*G,y+=n*j,m+=n*z,b+=n*W,w+=n*Z,v+=n*J,I+=n*V,E+=n*Y,u+=(n=t[4])*F,h+=n*T,l+=n*q,f+=n*O,d+=n*K,p+=n*H,g+=n*N,A+=n*L,y+=n*G,m+=n*j,b+=n*z,w+=n*W,v+=n*Z,I+=n*J,E+=n*V,B+=n*Y,h+=(n=t[5])*F,l+=n*T,f+=n*q,d+=n*O,p+=n*K,g+=n*H,A+=n*N,y+=n*L,m+=n*G,b+=n*j,w+=n*z,v+=n*W,I+=n*Z,E+=n*J,B+=n*V,C+=n*Y,l+=(n=t[6])*F,f+=n*T,d+=n*q,p+=n*O,g+=n*K,A+=n*H,y+=n*N,m+=n*L,b+=n*G,w+=n*j,v+=n*z,I+=n*W,E+=n*Z,B+=n*J,C+=n*V,_+=n*Y,f+=(n=t[7])*F,d+=n*T,p+=n*q,g+=n*O,A+=n*K,y+=n*H,m+=n*N,b+=n*L,w+=n*G,v+=n*j,I+=n*z,E+=n*W,B+=n*Z,C+=n*J,_+=n*V,k+=n*Y,d+=(n=t[8])*F,p+=n*T,g+=n*q,A+=n*O,y+=n*K,m+=n*H,b+=n*N,w+=n*L,v+=n*G,I+=n*j,E+=n*z,B+=n*W,C+=n*Z,_+=n*J,k+=n*V,S+=n*Y,p+=(n=t[9])*F,g+=n*T,A+=n*q,y+=n*O,m+=n*K,b+=n*H,w+=n*N,v+=n*L,I+=n*G,E+=n*j,B+=n*z,C+=n*W,_+=n*Z,k+=n*J,S+=n*V,Q+=n*Y,g+=(n=t[10])*F,A+=n*T,y+=n*q,m+=n*O,b+=n*K,w+=n*H,v+=n*N,I+=n*L,E+=n*G,B+=n*j,C+=n*z,_+=n*W,k+=n*Z,S+=n*J,Q+=n*V,x+=n*Y,A+=(n=t[11])*F,y+=n*T,m+=n*q,b+=n*O,w+=n*K,v+=n*H,I+=n*N,E+=n*L,B+=n*G,C+=n*j,_+=n*z,k+=n*W,S+=n*Z,Q+=n*J,x+=n*V,P+=n*Y,y+=(n=t[12])*F,m+=n*T,b+=n*q,w+=n*O,v+=n*K,I+=n*H,E+=n*N,B+=n*L,C+=n*G,_+=n*j,k+=n*z,S+=n*W,Q+=n*Z,x+=n*J,P+=n*V,M+=n*Y,m+=(n=t[13])*F,b+=n*T,w+=n*q,v+=n*O,I+=n*K,E+=n*H,B+=n*N,C+=n*L,_+=n*G,k+=n*j,S+=n*z,Q+=n*W,x+=n*Z,P+=n*J,M+=n*V,U+=n*Y,b+=(n=t[14])*F,w+=n*T,v+=n*q,I+=n*O,E+=n*K,B+=n*H,C+=n*N,_+=n*L,k+=n*G,S+=n*j,Q+=n*z,x+=n*W,P+=n*Z,M+=n*J,U+=n*V,D+=n*Y,w+=(n=t[15])*F,o+=38*(I+=n*q),s+=38*(E+=n*O),c+=38*(B+=n*K),u+=38*(C+=n*H),h+=38*(_+=n*N),l+=38*(k+=n*L),f+=38*(S+=n*G),d+=38*(Q+=n*j),p+=38*(x+=n*z),g+=38*(P+=n*W),A+=38*(M+=n*Z),y+=38*(U+=n*J),m+=38*(D+=n*V),b+=38*(R+=n*Y),a=(n=(a+=38*(v+=n*T))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=A,e[12]=y,e[13]=m,e[14]=b,e[15]=w}function E(e,t){I(e,t,t)}function B(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)E(i,i),2!==n&&4!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function C(e,r,n){var i,a,s=new Uint8Array(32),c=new Float64Array(80),u=t(),h=t(),l=t(),f=t(),d=t(),p=t();for(a=0;a<31;a++)s[a]=r[a];for(s[31]=127&r[31]|64,s[0]&=248,b(c,n),a=0;a<16;a++)h[a]=c[a],f[a]=u[a]=l[a]=0;for(u[0]=f[0]=1,a=254;a>=0;--a)g(u,h,i=s[a>>>3]>>>(7&a)&1),g(l,f,i),w(d,u,l),v(u,u,l),w(l,h,f),v(h,h,f),E(f,d),E(p,u),I(u,l,u),I(l,h,d),w(d,u,l),v(u,u,l),E(h,u),v(l,f,p),I(u,l,o),w(u,u,f),I(l,l,u),I(u,f,p),I(f,h,c),E(h,d),g(u,h,i),g(l,f,i);for(a=0;a<16;a++)c[a+16]=u[a],c[a+32]=l[a],c[a+48]=h[a],c[a+64]=f[a];var y=c.subarray(32),m=c.subarray(16);return B(y,y),I(m,m,y),A(e,m),0}function _(e,t){return C(e,t,n)}function k(e,r){var n=t(),i=t(),a=t(),o=t(),s=t(),u=t(),h=t(),l=t(),f=t();v(n,e[1],e[0]),v(f,r[1],r[0]),I(n,n,f),w(i,e[0],e[1]),w(f,r[0],r[1]),I(i,i,f),I(a,e[3],r[3]),I(a,a,c),I(o,e[2],r[2]),w(o,o,o),v(s,i,n),v(u,o,a),w(h,o,a),w(l,i,n),I(e[0],s,u),I(e[1],l,h),I(e[2],h,u),I(e[3],s,l)}function S(e,t,r){var n;for(n=0;n<4;n++)g(e[n],t[n],r)}function Q(e,r){var n=t(),i=t(),a=t();B(a,r[2]),I(n,r[0],a),I(i,r[1],a),A(e,i),e[31]^=m(n)<<7}function x(e,t,r){var n,o;for(d(e[0],i),d(e[1],a),d(e[2],a),d(e[3],i),o=255;o>=0;--o)S(e,t,n=r[o/8|0]>>(7&o)&1),k(t,e),k(e,e),S(e,t,n)}function P(e,r){var n=[t(),t(),t(),t()];d(n[0],u),d(n[1],h),d(n[2],a),I(n[3],u,h),x(e,n,r)}function M(n,i,a){var o,s,c=[t(),t(),t(),t()];for(a||r(i,32),(o=e.hash(i.subarray(0,32)))[0]&=248,o[31]&=127,o[31]|=64,P(c,o),Q(n,c),s=0;s<32;s++)i[s+32]=n[s];return 0}var U=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function D(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>4)*U[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*U[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function R(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;D(e,r)}function F(e,r){var n=t(),o=t(),c=t(),u=t(),h=t(),f=t(),p=t();return d(e[2],a),b(e[1],r),E(c,e[1]),I(u,c,s),v(c,c,e[2]),w(u,e[2],u),E(h,u),E(f,h),I(p,f,h),I(n,p,c),I(n,n,u),function(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)E(i,i),1!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}(n,n),I(n,n,c),I(n,n,u),I(n,n,u),I(e[0],n,u),E(o,e[0]),I(o,o,u),y(o,c)&&I(e[0],e[0],l),E(o,e[0]),I(o,o,u),y(o,c)?-1:(m(e[0])===r[31]>>7&&v(e[0],i,e[0]),I(e[3],e[0],e[1]),0)}var T=64;function q(){for(var e=0;e=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return M(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(q(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;re&&(c.imod(a.leftShift(i)).iadd(a),u=c.mod(o).toNumber())}while(!await zh(c,t,r));return c}async function zh(e,t,r){return!(t&&!e.dec().gcd(t).isOne()||!await async function(e){const t=await ts.getBigInteger();return Wh.every((r=>0!==e.mod(new t(r))))}(e)||!await async function(e,t){const r=await ts.getBigInteger();return(t=t||new r(2)).modExp(e.dec(),e).isOne()}(e)||!await async function(e,t,r){const n=await ts.getBigInteger(),i=e.bitLength();t||(t=Math.max(1,i/48|0));const a=e.dec();let o=0;for(;!a.getBit(o);)o++;const s=e.rightShift(new n(o));for(;t>0;t--){let t,r=(await Lh(new n(2),a)).modExp(s,e);if(!r.isOne()&&!r.equal(a)){for(t=1;tt-11)throw Error("Message too long");const n=function(e){const t=new Uint8Array(e);let r=0;for(;r=8&!n;if(t)return ts.selectUint8Array(o,a,t);if(o)return a;throw Error("Decryption error")}async function Yh(e,t,r){let n;if(t.length!==Vu.getHashByteLength(e))throw Error("Invalid hash length");const i=new Uint8Array(Zh[e].length);for(n=0;n{el.generateKeyPair("rsa",r,((r,n,i)=>{r?t(r):e(rl.decode(i,"der"))}))}));return{n:n.modulus.toArrayLike(Uint8Array),e:n.publicExponent.toArrayLike(Uint8Array),d:n.privateExponent.toArrayLike(Uint8Array),p:n.prime2.toArrayLike(Uint8Array),q:n.prime1.toArrayLike(Uint8Array),u:n.coefficient.toArrayLike(Uint8Array)}}let r,n,i;do{n=await jh(e-(e>>1),t,40),r=await jh(e>>1,t,40),i=r.mul(n)}while(i.bitLength()!==e);const a=r.dec().imul(n.dec());return n.lt(r)&&([r,n]=[n,r]),{n:i.toUint8Array(),e:t.toUint8Array(),d:t.modInv(a).toUint8Array(),p:r.toUint8Array(),q:n.toUint8Array(),u:r.modInv(n).toUint8Array()}},validateParams:async function(e,t,r,n,i,a){const o=await ts.getBigInteger();if(e=new o(e),n=new o(n),i=new o(i),!n.mul(i).equal(e))return!1;const s=new o(2);if(a=new o(a),!n.mul(a).mod(i).isOne())return!1;t=new o(t),r=new o(r);const c=new o(Math.floor(e.bitLength()/3)),u=await Lh(s,s.leftShift(c)),h=u.mul(r).mul(t);return!(!h.mod(n.dec()).equal(u)||!h.mod(i.dec()).equal(u))}}),al=Object.freeze({__proto__:null,encrypt:async function(e,t,r,n){const i=await ts.getBigInteger();t=new i(t),r=new i(r),n=new i(n);const a=new i(Jh(e,t.byteLength())),o=await Lh(new i(1),t.dec());return{c1:r.modExp(o,t).toUint8Array(),c2:n.modExp(o,t).imul(a).imod(t).toUint8Array()}},decrypt:async function(e,t,r,n,i){const a=await ts.getBigInteger();return e=new a(e),t=new a(t),r=new a(r),n=new a(n),Vh(e.modExp(n,r).modInv(r).imul(t).imod(r).toUint8Array("be",r.byteLength()),i)},validateParams:async function(e,t,r,n){const i=await ts.getBigInteger();e=new i(e),t=new i(t),r=new i(r);const a=new i(1);if(t.lte(a)||t.gte(e))return!1;const o=new i(e.bitLength()),s=new i(1023);if(o.lt(s))return!1;if(!t.modExp(e.dec(),e).isOne())return!1;let c=t;const u=new i(1),h=new i(2).leftShift(new i(17));for(;u.lt(h);){if(c=c.mul(t).imod(e),c.isOne())return!1;u.iinc()}n=new i(n);const l=new i(2),f=await Lh(l.leftShift(o.dec()),l.leftShift(o)),d=e.dec().imul(f).iadd(n);return!!r.equal(t.modExp(d,e))}});class ol{constructor(e){if(e instanceof ol)this.oid=e.oid;else if(ts.isArray(e)||ts.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return ts.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return ts.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(Xo.curve[e])return Xo.write(Xo.curve,e);throw Error("Unknown curve object identifier.")}}function sl(e,t){return e.keyPair({priv:t})}function cl(e,t){const r=e.keyPair({pub:t});if(!0!==r.validate().result)throw Error("Invalid elliptic public key");return r}async function ul(e){if(!us.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:t}=await Promise.resolve().then((function(){return Db}));return new t.ec(e)}function hl(e){let t,r=0;const n=e[0];return n<192?([r]=e,t=1):n<255?(r=(e[0]-192<<8)+e[1]+192,t=2):255===n&&(r=ts.readNumber(e.subarray(1,5)),t=5),{len:r,offset:t}}function ll(e){return e<192?new Uint8Array([e]):e>191&&e<8384?new Uint8Array([192+(e-192>>8),e-192&255]):ts.concatUint8Array([new Uint8Array([255]),ts.writeNumber(e,4)])}function fl(e){if(e<0||e>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+e])}function dl(e){return new Uint8Array([192|e])}function pl(e,t){return ts.concatUint8Array([dl(e),ll(t)])}function gl(e){return[Xo.packet.literalData,Xo.packet.compressedData,Xo.packet.symmetricallyEncryptedData,Xo.packet.symEncryptedIntegrityProtectedData,Xo.packet.aeadEncryptedData].includes(e)}async function Al(e,t){const r=qo(e);let n,i;try{const a=await r.peekBytes(2);if(!a||a.length<2||0==(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const o=await r.readByte();let s,c,u=-1,h=-1;h=0,0!=(64&o)&&(h=1),h?u=63&o:(u=(63&o)>>2,c=3&o);const l=gl(u);let f,d=null;if(l){if("array"===ts.isStream(e)){const e=new go;n=Oo(e),d=e}else{const e=new Uo;n=Oo(e.writable),d=e.readable}i=t({tag:u,packet:d})}else d=[];do{if(h){const e=await r.readByte();if(f=!1,e<192)s=e;else if(e>=192&&e<224)s=(e-192<<8)+await r.readByte()+192;else if(e>223&&e<255){if(s=1<<(31&e),f=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(c){case 0:s=await r.readByte();break;case 1:s=await r.readByte()<<8|await r.readByte();break;case 2:s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:s=1/0}if(s>0){let e=0;for(;;){n&&await n.ready;const{done:t,value:i}=await r.read();if(t){if(s===1/0)break;throw Error("Unexpected end of packet")}const a=s===1/0?i:i.subarray(0,s-e);if(n?await n.write(a):d.push(a),e+=i.length,e>=s){r.unshift(i.subarray(s-e+i.length));break}}}}while(f);const p=await r.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(d=ts.concatUint8Array(d),await t({tag:u,packet:d})),!p||!p.length}catch(e){if(n)return await n.abort(e),!0;throw e}finally{n&&await i,r.releaseLock()}}class yl extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,yl),this.name="UnsupportedError"}}class ml{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const bl=ts.getWebCrypto(),wl=ts.getNodeCrypto(),vl={p256:"P-256",p384:"P-384",p521:"P-521"},Il=wl?wl.getCurves():[],El=wl?{secp256k1:Il.includes("secp256k1")?"secp256k1":void 0,p256:Il.includes("prime256v1")?"prime256v1":void 0,p384:Il.includes("secp384r1")?"secp384r1":void 0,p521:Il.includes("secp521r1")?"secp521r1":void 0,ed25519:Il.includes("ED25519")?"ED25519":void 0,curve25519:Il.includes("X25519")?"X25519":void 0,brainpoolP256r1:Il.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:Il.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:Il.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Bl={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:El.p256,web:vl.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha384,cipher:Xo.symmetric.aes192,node:El.p384,web:vl.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha512,cipher:Xo.symmetric.aes256,node:El.p521,web:vl.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:El.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:Xo.publicKey.eddsaLegacy,hash:Xo.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:Xo.publicKey.ecdh,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:El.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha384,cipher:Xo.symmetric.aes192,node:El.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha512,cipher:Xo.symmetric.aes256,node:El.brainpoolP512r1,payloadSize:64}};class Cl{constructor(e,t){try{(ts.isArray(e)||ts.isUint8Array(e))&&(e=new ol(e)),e instanceof ol&&(e=e.getName()),this.name=Xo.write(Xo.curve,e)}catch(e){throw new yl("Unknown curve")}t=t||Bl[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Bl[this.name],this.web=t.web&&Bl[this.name],this.payloadSize=t.payloadSize,this.web&&ts.getWebCrypto()?this.type="web":this.node&&ts.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(e){const t=await bl.generateKey({name:"ECDSA",namedCurve:vl[e]},!0,["sign","verify"]),r=await bl.exportKey("jwk",t.privateKey);return{publicKey:kl(await bl.exportKey("jwk",t.publicKey)),privateKey:ss(r.d)}}(this.name)}catch(e){ts.printDebugError("Browser did not support generating ec key "+e.message);break}case"node":return async function(e){const t=wl.createECDH(El[e]);return await t.generateKeys(),{publicKey:new Uint8Array(t.getPublicKey()),privateKey:new Uint8Array(t.getPrivateKey())}}(this.name);case"curve25519":{const t=Nh(32);t[0]=127&t[0]|64,t[31]&=248;const r=t.slice().reverse();return e=Kh.box.keyPair.fromSecretKey(r),{publicKey:ts.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:t}}case"ed25519":{const e=Nh(32),t=Kh.sign.keyPair.fromSeed(e);return{publicKey:ts.concatUint8Array([new Uint8Array([64]),t.publicKey]),privateKey:e}}}const t=await ul(this.name);return e=await t.genKeyPair({entropy:ts.uint8ArrayToString(Nh(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function _l(e,t,r,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:e===Xo.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=t.getName();if(!i[a])return!1;if("curve25519"===a){n=n.slice().reverse();const{publicKey:e}=Kh.box.keyPair.fromSecretKey(n);r=new Uint8Array(r);const t=new Uint8Array([64,...e]);return!!ts.equalsUint8Array(t,r)}const o=await ul(a);try{r=cl(o,r).getPublic()}catch(e){return!1}return!!sl(o,n).getPublic().eq(r)}function kl(e){const t=ss(e.x),r=ss(e.y),n=new Uint8Array(t.length+r.length+1);return n[0]=4,n.set(t,1),n.set(r,t.length+1),n}function Sl(e,t,r){const n=e,i=r.slice(1,n+1),a=r.slice(n+1,2*n+1);return{kty:"EC",crv:t,x:cs(i,!0),y:cs(a,!0),ext:!0}}function Ql(e,t,r,n){const i=Sl(e,t,r);return i.d=cs(n,!0),i}const xl=ts.getWebCrypto(),Pl=ts.getNodeCrypto();async function Ml(e,t,r,n,i,a){const o=new Cl(e);if(r&&!ts.isStream(r)){const a={publicKey:n,privateKey:i};switch(o.type){case"web":try{return await async function(e,t,r,n){const i=e.payloadSize,a=Ql(e.payloadSize,vl[e.name],n.publicKey,n.privateKey),o=await xl.importKey("jwk",a,{name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,e.hash)}},!1,["sign"]),s=new Uint8Array(await xl.sign({name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,t)}},o,r));return{r:s.slice(0,i),s:s.slice(i,i<<1)}}(o,t,r,a)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;ts.printDebugError("Browser did not support signing: "+e.message)}break;case"node":{const e=await async function(e,t,r,n){const i=Pl.createSign(Xo.read(Xo.hash,t));i.write(r),i.end();const a=Fl.encode({version:1,parameters:e.oid,privateKey:Array.from(n.privateKey),publicKey:{unused:0,data:Array.from(n.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Rl.decode(i.sign(a),"der")}(o,t,r,a);return{r:e.r.toArrayLike(Uint8Array),s:e.s.toArrayLike(Uint8Array)}}}}return async function(e,t,r){const n=sl(await ul(e.name),r).sign(t);return{r:n.r.toArrayLike(Uint8Array),s:n.s.toArrayLike(Uint8Array)}}(o,a,i)}async function Ul(e,t,r,n,i,a){const o=new Cl(e);if(n&&!ts.isStream(n))switch(o.type){case"web":try{return await async function(e,t,{r:r,s:n},i,a){const o=Sl(e.payloadSize,vl[e.name],a),s=await xl.importKey("jwk",o,{name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,e.hash)}},!1,["verify"]),c=ts.concatUint8Array([r,n]).buffer;return xl.verify({name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,t)}},s,c,i)}(o,t,r,n,i)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;ts.printDebugError("Browser did not support verifying: "+e.message)}break;case"node":return async function(e,t,{r:r,s:n},i,a){const{default:o}=await Promise.resolve().then((function(){return gm})),s=Pl.createVerify(Xo.read(Xo.hash,t));s.write(i),s.end();const c=ql.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:e.oid},subjectPublicKey:{unused:0,data:Array.from(a)}},"pem",{label:"PUBLIC KEY"}),u=Rl.encode({r:new o(r),s:new o(n)},"der");try{return s.verify(c,u)}catch(e){return!1}}(o,t,r,n,i)}return async function(e,t,r,n){return cl(await ul(e.name),n).verify(r,t)}(o,r,void 0===t?n:a,i)}const Dl=void 0,Rl=Pl?Dl.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,Fl=Pl?Dl.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,Tl=Pl?Dl.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,ql=Pl?Dl.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Tl),this.key("subjectPublicKey").bitstr())})):void 0;var Ol=Object.freeze({__proto__:null,sign:Ml,verify:Ul,validateParams:async function(e,t,r){const n=new Cl(e);if(n.keyType!==Xo.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const n=Nh(8),i=Xo.hash.sha256,a=await Vu.digest(i,n);try{const o=await Ml(e,i,n,t,r,a);return await Ul(e,i,o,n,t,a)}catch(e){return!1}}default:return _l(Xo.publicKey.ecdsa,e,t,r)}}});Kh.hash=e=>new Uint8Array(nu().update(e).digest());var Kl=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){if(Vu.getHashByteLength(t)new Uint8Array(nu().update(e).digest());var Nl=Object.freeze({__proto__:null,generate:async function(e){if(e===Xo.publicKey.ed25519){const e=Nh(32),{publicKey:t}=Kh.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(e,t,r,n,i,a){if(Vu.getHashByteLength(t)=0;--e)for(let t=s-1;t>=0;--t)c[1]=s*e+(t+1),u[0]=a[0]^c[0],u[1]=a[1]^c[1],u[2]=o[2*t],u[3]=o[2*t+1],u=jl(r.decrypt(zl(u))),a=u.subarray(0,2),o[2*t]=u[2],o[2*t+1]=u[3];if(a[0]===n[0]&&a[1]===n[1])return zl(o);throw Error("Key Data Integrity failed")}function jl(e){const{length:t}=e,r=function(e){if(ts.isString(e)){const{length:t}=e,r=new ArrayBuffer(t),n=new Uint8Array(r);for(let r=0;r0){const r=e[t-1];if(r>=1){const n=e.subarray(t-r),i=new Uint8Array(r).fill(r);if(ts.equalsUint8Array(n,i))return e.subarray(0,t-r)}}throw Error("Invalid padding")}var Vl=Object.freeze({__proto__:null,encode:Zl,decode:Jl});const Yl=ts.getWebCrypto(),$l=ts.getNodeCrypto();function Xl(e,t,r,n){return ts.concatUint8Array([t.write(),new Uint8Array([e]),r.write(),ts.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function ef(e,t,r,n,i=!1,a=!1){let o;if(i){for(o=0;o=0&&0===t[o];o--);t=t.subarray(0,o+1)}return(await Vu.digest(e,ts.concatUint8Array([new Uint8Array([0,0,0,1]),t,n]))).subarray(0,r)}async function tf(e,t,r,n){if(n.length!==e.payloadSize){const t=new Uint8Array(e.payloadSize);t.set(n,e.payloadSize-n.length),n=t}switch(e.type){case"curve25519":{const e=n.slice().reverse();return{secretKey:e,sharedKey:Kh.scalarMult(e,t.subarray(1))}}case"web":if(e.web&&ts.getWebCrypto())try{return await async function(e,t,r,n){const i=Ql(e.payloadSize,e.web.web,r,n);let a=Yl.importKey("jwk",i,{name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]);const o=Sl(e.payloadSize,e.web.web,t);let s=Yl.importKey("jwk",o,{name:"ECDH",namedCurve:e.web.web},!0,[]);[a,s]=await Promise.all([a,s]);let c=Yl.deriveBits({name:"ECDH",namedCurve:e.web.web,public:s},a,e.web.sharedSize),u=Yl.exportKey("jwk",a);[c,u]=await Promise.all([c,u]);const h=new Uint8Array(c);return{secretKey:ss(u.d),sharedKey:h}}(e,t,r,n)}catch(e){ts.printDebugError(e)}break;case"node":return async function(e,t,r){const n=$l.createECDH(e.node.node);n.setPrivateKey(r);const i=new Uint8Array(n.computeSecret(t));return{secretKey:new Uint8Array(n.getPrivateKey()),sharedKey:i}}(e,t,n)}return async function(e,t,r){const n=await ul(e.name);t=cl(n,t),r=sl(n,r);const i=new Uint8Array(r.getPrivate()),a=r.derive(t.getPublic()),o=n.curve.p.byteLength();return{secretKey:i,sharedKey:a.toArrayLike(Uint8Array,"be",o)}}(e,t,n)}var rf=Object.freeze({__proto__:null,validateParams:async function(e,t,r){return _l(Xo.publicKey.ecdh,e,t,r)},encrypt:async function(e,t,r,n,i){const a=Zl(r),o=new Cl(e),{publicKey:s,sharedKey:c}=await async function(e,t){switch(e.type){case"curve25519":{const r=Nh(32),{secretKey:n,sharedKey:i}=await tf(e,t,null,r);let{publicKey:a}=Kh.box.keyPair.fromSecretKey(n);return a=ts.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(e.web&&ts.getWebCrypto())try{return await async function(e,t){const r=Sl(e.payloadSize,e.web.web,t);let n=Yl.generateKey({name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]),i=Yl.importKey("jwk",r,{name:"ECDH",namedCurve:e.web.web},!1,[]);[n,i]=await Promise.all([n,i]);let a=Yl.deriveBits({name:"ECDH",namedCurve:e.web.web,public:i},n.privateKey,e.web.sharedSize),o=Yl.exportKey("jwk",n.publicKey);[a,o]=await Promise.all([a,o]);const s=new Uint8Array(a);return{publicKey:new Uint8Array(kl(o)),sharedKey:s}}(e,t)}catch(e){ts.printDebugError(e)}break;case"node":return async function(e,t){const r=$l.createECDH(e.node.node);r.generateKeys();const n=new Uint8Array(r.computeSecret(t));return{publicKey:new Uint8Array(r.getPublicKey()),sharedKey:n}}(e,t)}return async function(e,t){const r=await ul(e.name),n=await e.genKeyPair();t=cl(r,t);const i=sl(r,n.privateKey),a=n.publicKey,o=i.derive(t.getPublic()),s=r.curve.p.byteLength();return{publicKey:a,sharedKey:o.toArrayLike(Uint8Array,"be",s)}}(e,t)}(o,n),u=Xl(Xo.publicKey.ecdh,e,t,i),{keySize:h}=$u(t.cipher);return{publicKey:s,wrappedKey:Ll(await ef(t.hash,c,h,u),a)}},decrypt:async function(e,t,r,n,i,a,o){const s=new Cl(e),{sharedKey:c}=await tf(s,r,i,a),u=Xl(Xo.publicKey.ecdh,e,t,o),{keySize:h}=$u(t.cipher);let l;for(let r=0;r<3;r++)try{return Jl(Gl(await ef(t.hash,c,h,u,1===r,2===r),n))}catch(e){l=e}throw l}});const nf=ts.getWebCrypto(),af=ts.getNodeCrypto(),of=af&&af.webcrypto&&af.webcrypto.subtle;async function sf(e,t,r,n,i){const a=Xo.read(Xo.webHash,e);if(!a)throw Error("Hash algo not supported with HKDF");if(nf||of){const e=nf||of,o=await e.importKey("raw",t,"HKDF",!1,["deriveBits"]),s=await e.deriveBits({name:"HKDF",hash:a,salt:r,info:n},o,8*i);return new Uint8Array(s)}if(af){const a=Xo.read(Xo.hash,e),o=(e,t)=>af.createHmac(a,e).update(t).digest(),s=o(r,t),c=s.length,u=Math.ceil(i/c),h=new Uint8Array(u*c),l=new Uint8Array(c+n.length+1);l.set(n,c);for(let e=0;e0?l:l.subarray(c));l.set(t,0),h.set(t,e*c)}return h.subarray(0,i)}throw Error("No HKDF implementation available")}const cf={x25519:ts.encodeUTF8("OpenPGP X25519")};var uf=Object.freeze({__proto__:null,generate:async function(e){if(e===Xo.publicKey.x25519){const e=Nh(32),{publicKey:t}=Kh.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(e,t,r){if(e===Xo.publicKey.x25519){const{publicKey:e}=Kh.box.keyPair.fromSecretKey(r);return ts.equalsUint8Array(t,e)}return!1},encrypt:async function(e,t,r){if(e===Xo.publicKey.x25519){const e=Nh(32),n=Kh.scalarMult(e,r),{publicKey:i}=Kh.box.keyPair.fromSecretKey(e),a=ts.concatUint8Array([i,r,n]),{keySize:o}=$u(Xo.symmetric.aes128);return{ephemeralPublicKey:i,wrappedKey:Ll(await sf(Xo.hash.sha256,a,new Uint8Array,cf.x25519,o),t)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(e,t,r,n,i){if(e===Xo.publicKey.x25519){const e=Kh.scalarMult(i,t),a=ts.concatUint8Array([t,n,e]),{keySize:o}=$u(Xo.symmetric.aes128);return Gl(await sf(Xo.hash.sha256,a,new Uint8Array,cf.x25519,o),r)}throw Error("Unsupported ECDH algorithm")}}),hf=Object.freeze({__proto__:null,CurveWithOID:Cl,ecdh:rf,ecdhX:uf,ecdsa:Ol,eddsaLegacy:Kl,eddsa:Nl,generate:async function(e){const t=await ts.getBigInteger();e=new Cl(e);const r=await e.genKeyPair(),n=new t(r.publicKey).toUint8Array(),i=new t(r.privateKey).toUint8Array("be",e.payloadSize);return{oid:e.oid,Q:n,secret:i,hash:e.hash,cipher:e.cipher}},getPreferredHashAlgo:function(e){return Bl[Xo.write(Xo.curve,e.toHex())].hash}}),lf=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){const o=await ts.getBigInteger(),s=new o(1);let c,u,h,l;n=new o(n),i=new o(i),r=new o(r),a=new o(a),r=r.mod(n),a=a.mod(i);const f=new o(t.subarray(0,i.byteLength())).mod(i);for(;;){if(c=await Lh(s,i),u=r.modExp(c,n).imod(i),u.isZero())continue;const e=a.mul(u).imod(i);if(l=f.add(e).imod(i),h=c.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:u.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(e,t,r,n,i,a,o,s){const c=await ts.getBigInteger(),u=new c(0);if(t=new c(t),r=new c(r),a=new c(a),o=new c(o),i=new c(i),s=new c(s),t.lte(u)||t.gte(o)||r.lte(u)||r.gte(o))return ts.printDebug("invalid DSA Signature"),!1;const h=new c(n.subarray(0,o.byteLength())).imod(o),l=r.modInv(o);if(l.isZero())return ts.printDebug("invalid DSA Signature"),!1;i=i.mod(a),s=s.mod(a);const f=h.mul(l).imod(o),d=t.mul(l).imod(o),p=i.modExp(f,a),g=s.modExp(d,a);return p.mul(g).imod(a).imod(o).equal(t)},validateParams:async function(e,t,r,n,i){const a=await ts.getBigInteger();e=new a(e),t=new a(t),r=new a(r),n=new a(n);const o=new a(1);if(r.lte(o)||r.gte(e))return!1;if(!e.dec().mod(t).isZero())return!1;if(!r.modExp(t,e).isOne())return!1;const s=new a(t.bitLength()),c=new a(150);if(s.lt(c)||!await zh(t,null,32))return!1;i=new a(i);const u=new a(2),h=await Lh(u.leftShift(s.dec()),u.leftShift(s)),l=t.mul(h).add(i);return!!n.equal(r.modExp(l,e))}}),ff={rsa:il,elgamal:al,elliptic:hf,dsa:lf,nacl:Kh},df=Object.freeze({__proto__:null,parseSignatureParams:function(e,t){let r=0;switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaSign:return{s:ts.readMPI(t.subarray(r))};case Xo.publicKey.dsa:case Xo.publicKey.ecdsa:{const e=ts.readMPI(t.subarray(r));return r+=e.length+2,{r:e,s:ts.readMPI(t.subarray(r))}}case Xo.publicKey.eddsaLegacy:{let e=ts.readMPI(t.subarray(r));r+=e.length+2,e=ts.leftPad(e,32);let n=ts.readMPI(t.subarray(r));return n=ts.leftPad(n,32),{r:e,s:n}}case Xo.publicKey.ed25519:{const e=t.subarray(r,r+64);return r+=e.length,{RS:e}}default:throw new yl("Unknown signature algorithm.")}},verify:async function(e,t,r,n,i,a){switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaSign:{const{n:e,e:o}=n,s=ts.leftPad(r.s,e.length);return ff.rsa.verify(t,i,s,e,o,a)}case Xo.publicKey.dsa:{const{g:e,p:i,q:o,y:s}=n,{r:c,s:u}=r;return ff.dsa.verify(t,c,u,a,e,i,o,s)}case Xo.publicKey.ecdsa:{const{oid:e,Q:o}=n,s=new ff.elliptic.CurveWithOID(e).payloadSize,c=ts.leftPad(r.r,s),u=ts.leftPad(r.s,s);return ff.elliptic.ecdsa.verify(e,t,{r:c,s:u},i,o,a)}case Xo.publicKey.eddsaLegacy:{const{oid:e,Q:o}=n;return ff.elliptic.eddsaLegacy.verify(e,t,r,i,o,a)}case Xo.publicKey.ed25519:{const{A:o}=n;return ff.elliptic.eddsa.verify(e,t,r,i,o,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(e,t,r,n,i,a){if(!r||!n)throw Error("Missing key parameters");switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaSign:{const{n:e,e:o}=r,{d:s,p:c,q:u,u:h}=n;return{s:await ff.rsa.sign(t,i,e,o,s,c,u,h,a)}}case Xo.publicKey.dsa:{const{g:e,p:i,q:o}=r,{x:s}=n;return ff.dsa.sign(t,a,e,i,o,s)}case Xo.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case Xo.publicKey.ecdsa:{const{oid:e,Q:o}=r,{d:s}=n;return ff.elliptic.ecdsa.sign(e,t,i,o,s,a)}case Xo.publicKey.eddsaLegacy:{const{oid:e,Q:o}=r,{seed:s}=n;return ff.elliptic.eddsaLegacy.sign(e,t,i,o,s,a)}case Xo.publicKey.ed25519:{const{A:o}=r,{seed:s}=n;return ff.elliptic.eddsa.sign(e,t,i,o,s,a)}default:throw Error("Unknown signature algorithm.")}}});class pf{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return ts.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class gf{constructor(e){if(e){const{hash:t,cipher:r}=e;this.hash=t,this.cipher=r}else this.hash=null,this.cipher=null}read(e){if(e.length<4||3!==e[0]||1!==e[1])throw new yl("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class Af{static fromObject({wrappedKey:e,algorithm:t}){const r=new Af;return r.wrappedKey=e,r.algorithm=t,r}read(e){let t=0,r=e[t++];this.algorithm=r%2?e[t++]:null,r-=r%2,this.wrappedKey=e.subarray(t,t+r),t+=r}write(){return ts.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function yf(e){try{e.getName()}catch(e){throw new yl("Unknown curve OID")}}var mf=Object.freeze({__proto__:null,publicKeyEncrypt:async function(e,t,r,n,i){switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:{const{n:e,e:t}=r;return{c:await ff.rsa.encrypt(n,e,t)}}case Xo.publicKey.elgamal:{const{p:e,g:t,y:i}=r;return ff.elgamal.encrypt(n,e,t,i)}case Xo.publicKey.ecdh:{const{oid:e,Q:t,kdfParams:a}=r,{publicKey:o,wrappedKey:s}=await ff.elliptic.ecdh.encrypt(e,a,n,t,i);return{V:o,C:new pf(s)}}case Xo.publicKey.x25519:{if(!ts.isAES(t))throw Error("X25519 keys can only encrypt AES session keys");const{A:i}=r,{ephemeralPublicKey:a,wrappedKey:o}=await ff.elliptic.ecdhX.encrypt(e,n,i);return{ephemeralPublicKey:a,C:Af.fromObject({algorithm:t,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(e,t,r,n,i,a){switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:{const{c:e}=n,{n:i,e:o}=t,{d:s,p:c,q:u,u:h}=r;return ff.rsa.decrypt(e,i,o,s,c,u,h,a)}case Xo.publicKey.elgamal:{const{c1:e,c2:i}=n,o=t.p,s=r.x;return ff.elgamal.decrypt(e,i,o,s,a)}case Xo.publicKey.ecdh:{const{oid:e,Q:a,kdfParams:o}=t,{d:s}=r,{V:c,C:u}=n;return ff.elliptic.ecdh.decrypt(e,o,c,u.data,a,s,i)}case Xo.publicKey.x25519:{const{A:i}=t,{k:a}=r,{ephemeralPublicKey:o,C:s}=n;if(!ts.isAES(s.algorithm))throw Error("AES session key expected");return ff.elliptic.ecdhX.decrypt(e,o,s.wrappedKey,i,a)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(e,t){let r=0;switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=ts.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{n:e,e:n}}}case Xo.publicKey.dsa:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=ts.readMPI(t.subarray(r));r+=n.length+2;const i=ts.readMPI(t.subarray(r));r+=i.length+2;const a=ts.readMPI(t.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:e,q:n,g:i,y:a}}}case Xo.publicKey.elgamal:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=ts.readMPI(t.subarray(r));r+=n.length+2;const i=ts.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{p:e,g:n,y:i}}}case Xo.publicKey.ecdsa:{const e=new ol;r+=e.read(t),yf(e);const n=ts.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{oid:e,Q:n}}}case Xo.publicKey.eddsaLegacy:{const e=new ol;r+=e.read(t),yf(e);let n=ts.readMPI(t.subarray(r));return r+=n.length+2,n=ts.leftPad(n,33),{read:r,publicParams:{oid:e,Q:n}}}case Xo.publicKey.ecdh:{const e=new ol;r+=e.read(t),yf(e);const n=ts.readMPI(t.subarray(r));r+=n.length+2;const i=new gf;return r+=i.read(t.subarray(r)),{read:r,publicParams:{oid:e,Q:n,kdfParams:i}}}case Xo.publicKey.ed25519:case Xo.publicKey.x25519:{const e=t.subarray(r,r+32);return r+=e.length,{read:r,publicParams:{A:e}}}default:throw new yl("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(e,t,r){let n=0;switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:{const e=ts.readMPI(t.subarray(n));n+=e.length+2;const r=ts.readMPI(t.subarray(n));n+=r.length+2;const i=ts.readMPI(t.subarray(n));n+=i.length+2;const a=ts.readMPI(t.subarray(n));return n+=a.length+2,{read:n,privateParams:{d:e,p:r,q:i,u:a}}}case Xo.publicKey.dsa:case Xo.publicKey.elgamal:{const e=ts.readMPI(t.subarray(n));return n+=e.length+2,{read:n,privateParams:{x:e}}}case Xo.publicKey.ecdsa:case Xo.publicKey.ecdh:{const e=new Cl(r.oid);let i=ts.readMPI(t.subarray(n));return n+=i.length+2,i=ts.leftPad(i,e.payloadSize),{read:n,privateParams:{d:i}}}case Xo.publicKey.eddsaLegacy:{const e=new Cl(r.oid);let i=ts.readMPI(t.subarray(n));return n+=i.length+2,i=ts.leftPad(i,e.payloadSize),{read:n,privateParams:{seed:i}}}case Xo.publicKey.ed25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{seed:e}}}case Xo.publicKey.x25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{k:e}}}default:throw new yl("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(e,t){let r=0;switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:return{c:ts.readMPI(t.subarray(r))};case Xo.publicKey.elgamal:{const e=ts.readMPI(t.subarray(r));return r+=e.length+2,{c1:e,c2:ts.readMPI(t.subarray(r))}}case Xo.publicKey.ecdh:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=new pf;return n.read(t.subarray(r)),{V:e,C:n}}case Xo.publicKey.x25519:{const e=t.subarray(r,r+32);r+=e.length;const n=new Af;return n.read(t.subarray(r)),{ephemeralPublicKey:e,C:n}}default:throw new yl("Unknown public key encryption algorithm.")}},serializeParams:function(e,t){const r=new Set([Xo.publicKey.ed25519,Xo.publicKey.x25519]),n=Object.keys(t).map((n=>{const i=t[n];return ts.isUint8Array(i)?r.has(e)?i:ts.uint8ArrayToMPI(i):i.write()}));return ts.concatUint8Array(n)},generateParams:function(e,t,r){switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:return ff.rsa.generate(t,65537).then((({n:e,e:t,d:r,p:n,q:i,u:a})=>({privateParams:{d:r,p:n,q:i,u:a},publicParams:{n:e,e:t}})));case Xo.publicKey.ecdsa:return ff.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{d:r},publicParams:{oid:new ol(e),Q:t}})));case Xo.publicKey.eddsaLegacy:return ff.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{seed:r},publicParams:{oid:new ol(e),Q:t}})));case Xo.publicKey.ecdh:return ff.elliptic.generate(r).then((({oid:e,Q:t,secret:r,hash:n,cipher:i})=>({privateParams:{d:r},publicParams:{oid:new ol(e),Q:t,kdfParams:new gf({hash:n,cipher:i})}})));case Xo.publicKey.ed25519:return ff.elliptic.eddsa.generate(e).then((({A:e,seed:t})=>({privateParams:{seed:t},publicParams:{A:e}})));case Xo.publicKey.x25519:return ff.elliptic.ecdhX.generate(e).then((({A:e,k:t})=>({privateParams:{k:t},publicParams:{A:e}})));case Xo.publicKey.dsa:case Xo.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(e,t,r){if(!t||!r)throw Error("Missing key parameters");switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:{const{n:e,e:n}=t,{d:i,p:a,q:o,u:s}=r;return ff.rsa.validateParams(e,n,i,a,o,s)}case Xo.publicKey.dsa:{const{p:e,q:n,g:i,y:a}=t,{x:o}=r;return ff.dsa.validateParams(e,n,i,a,o)}case Xo.publicKey.elgamal:{const{p:e,g:n,y:i}=t,{x:a}=r;return ff.elgamal.validateParams(e,n,i,a)}case Xo.publicKey.ecdsa:case Xo.publicKey.ecdh:{const n=ff.elliptic[Xo.read(Xo.publicKey,e)],{oid:i,Q:a}=t,{d:o}=r;return n.validateParams(i,a,o)}case Xo.publicKey.eddsaLegacy:{const{Q:e,oid:n}=t,{seed:i}=r;return ff.elliptic.eddsaLegacy.validateParams(n,e,i)}case Xo.publicKey.ed25519:{const{A:n}=t,{seed:i}=r;return ff.elliptic.eddsa.validateParams(e,n,i)}case Xo.publicKey.x25519:{const{A:n}=t,{k:i}=r;return ff.elliptic.ecdhX.validateParams(e,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(e){const{blockSize:t}=$u(e),r=await Nh(t),n=new Uint8Array([r[r.length-2],r[r.length-1]]);return ts.concat([r,n])},generateSessionKey:function(e){const{keySize:t}=$u(e);return Nh(t)},getAEADMode:function(e){const t=Xo.read(Xo.aead,e);return Oh[t]},getCipher:$u,getPreferredCurveHashAlgo:function(e,t){switch(e){case Xo.publicKey.ecdsa:case Xo.publicKey.eddsaLegacy:return ff.elliptic.getPreferredHashAlgo(t);case Xo.publicKey.ed25519:return ff.elliptic.eddsa.getPreferredHashAlgo(e);default:throw Error("Unknown elliptic signing algo")}}});const bf={cipher:Js,hash:Vu,mode:Oh,publicKey:ff,signature:df,random:Gh,pkcs1:$h,pkcs5:Vl,aesKW:Wl};Object.assign(bf,mf);var wf="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;const vf={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(let a=0;a=0;)e[t]=0}const xf=0,Pf=1,Mf=2,Uf=29,Df=256,Rf=Df+1+Uf,Ff=30,Tf=19,qf=2*Rf+1,Of=15,Kf=16,Hf=256,Nf=16,Lf=17,Gf=18,jf=[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],zf=[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],Wf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Zf=Array(2*(Rf+2));Qf(Zf);const Jf=Array(2*Ff);Qf(Jf);const Vf=Array(512);Qf(Vf);const Yf=Array(256);Qf(Yf);const $f=Array(Uf);Qf($f);const Xf=Array(Ff);function ed(e){return e<256?Vf[e]:Vf[256+(e>>>7)]}function td(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function rd(e,t,r){e.bi_valid>Kf-r?(e.bi_buf|=t<>Kf-e.bi_valid,e.bi_valid+=r-Kf):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function ad(e,t,r){const n=Array(Of+1);let i,a,o=0;for(i=1;i<=Of;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){const t=e[2*a+1];0!==t&&(e[2*a]=id(n[t]++,t))}}function od(e){let t;for(t=0;t8?td(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function cd(e,t,r,n){const i=2*t,a=2*r;return e[i]>1;o>=1;o--)ud(e,r,o);c=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ud(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*c]=r[2*o]+r[2*s],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=c,e.heap[1]=c++,ud(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,l,f,d,p,g=0;for(f=0;f<=Of;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;uc&&(f=c,g++),r[2*h+1]=f,h>n||(e.bl_count[f]++,d=0,h>=s&&(d=o[h-s]),p=r[2*h],e.opt_len+=p*(f+d),a&&(e.static_len+=p*(i[2*h+1]+d)));if(0!==g){do{for(f=c-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(f=c;0!==f;f--)for(h=e.bl_count[f];0!==h;)l=e.heap[--u],l>n||(r[2*l+1]!==f&&(e.opt_len+=(f-r[2*l+1])*r[2*l],r[2*l+1]=f),h--)}}(e,t),ad(r,u,e.bl_count)}function fd(e,t,r){let n,i,a=-1,o=t[1],s=0,c=7,u=4;for(0===o&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Yf[r]+Df+1)]++,e.dyn_dtree[2*ed(t)]++),e.last_lit===e.lit_bufsize-1}function Ad(e,t,r,n){let i=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}const yd=function(){let e;const t=[];for(let r=0;r<256;r++){e=r;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function md(e,t,r,n){const i=yd,a=n+r;e^=-1;for(let r=n;r>>8^i[255&(e^t[r])];return-1^e}const bd=3,wd=258,vd=wd+bd+1;function Id(e){const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Bf(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Ed(e,t){(function(e,t,r,n){let i,a,o=0;e.level>0?(e.strm.data_type===Sf&&(e.strm.data_type=function(e){let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return _f;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return kf;for(t=32;t=3&&0===e.bl_tree[2*Wf[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?pd(e,t,r,n):e.strategy===Cf||a===i?(rd(e,(Pf<<1)+(n?1:0),3),hd(e,Zf,Jf)):(rd(e,(Mf<<1)+(n?1:0),3),function(e,t,r,n){let i;for(rd(e,t-257,5),rd(e,r-1,5),rd(e,n-4,4),i=0;i=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Id(e.strm)}function Bd(e,t,r,n){let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,Bf(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=Ad(e.adler,t,i,r):2===e.state.wrap&&(e.adler=md(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function Cd(e,t){let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-vd?e.strstart-(e.w_size-vd):0,u=e.window,h=e.w_mask,l=e.prev,f=e.strstart+wd;let d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,u[r+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=l[t&h])>c&&0!=--i);return o<=e.lookahead?o:e.lookahead}function _d(e){const t=e.w_size;let r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-vd)){Bf(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);a+=t}if(0===e.strm.avail_in)break;if(n=Bd(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=bd)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=bd&&(e.ins_h=(e.ins_h<=bd)if(n=gd(e,e.strstart-e.match_start,e.match_length-bd),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=bd){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=bd&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=bd-1)),e.prev_length>=bd&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-bd,n=gd(e,e.strstart-1-e.prev_match,e.prev_length-bd),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_d(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Ed(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-vd&&(Ed(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Ed(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Ed(e,!1),e.strm.avail_out),1)})),new Qd(4,4,8,4,kd),new Qd(4,5,16,8,kd),new Qd(4,6,32,32,kd),new Qd(4,4,16,16,Sd),new Qd(8,16,32,32,Sd),new Qd(8,16,128,128,Sd),new Qd(8,32,128,256,Sd),new Qd(32,128,258,1024,Sd),new Qd(32,258,258,4096,Sd);try{String.fromCharCode.call(null,0)}catch(uo){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(uo){}const xd=new Ef(256);for(let e=0;e<256;e++)xd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;xd[254]=xd[254]=1;var Pd=[0,1,3,7,15,31,63,127,255],Md=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Md.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},Md.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Pd[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var n=r-e;t|=(this.curByte&Pd[e]<>n,this.bitOffset+=e,e=0}}return t},Md.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1},Md.prototype.pi=function(){var e,t=new Uint8Array(6);for(e=0;e("00"+e.toString(16)).slice(-2))).join("")}(t)};var Ud=Md,Dd=function(){};Dd.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Dd.prototype.read=function(e,t,r){for(var n=0;n>>0},this.updateCRC=function(t){e=e<<8^Rd[255&(e>>>24^t)]},this.updateCRCRun=function(t,r){for(;r-- >0;)e=e<<8^Rd[255&(e>>>24^t)]}}),Td=function(e,t){var r,n=e[t];for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},qd=-2,Od=-3,Kd=-4,Hd=-5,Nd=-6,Ld=-7,Gd={"-1":"Bad file checksum"};Gd[qd]="Not bzip data",Gd[Od]="Unexpected input EOF",Gd[Kd]="Unexpected output EOF",Gd[Hd]="Data error",Gd[Nd]="Out of memory",Gd[Ld]="Obsolete (pre 0.9.5) bzip format not supported.";var jd=function(e,t){var r=Gd[e]||"unknown error";t&&(r+=": "+t);var n=new TypeError(r);throw n.errorCode=e,n},zd=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};zd.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new Fd,!0):(this.writeCount=-1,!1)},zd.prototype._start_bunzip=function(e,t){var r=new Uint8Array(4);4===e.read(r,0,4)&&"BZh"===String.fromCharCode(r[0],r[1],r[2])||jd(qd,"bad magic");var n=r[3]-48;(n<1||n>9)&&jd(qd,"level out of range"),this.reader=new Ud(e),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},zd.prototype._get_next_block=function(){var e,t,r,n=this.reader,i=n.pi();if("177245385090"===i)return!1;"314159265359"!==i&&jd(qd),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&jd(Ld);var a=n.read(24);a>this.dbufSize&&jd(Hd,"initial position out of bounds");var o=n.read(16),s=new Uint8Array(256),c=0;for(e=0;e<16;e++)if(o&1<<15-e){var u=16*e;for(r=n.read(16),t=0;t<16;t++)r&1<<15-t&&(s[c++]=u+t)}var h=n.read(3);(h<2||h>6)&&jd(Hd);var l=n.read(15);0===l&&jd(Hd);var f=new Uint8Array(256);for(e=0;e=h&&jd(Hd);d[e]=Td(f,t)}var p,g=c+2,A=[];for(t=0;t20)&&jd(Hd),n.read(1);)n.read(1)?o--:o++;b[e]=o}for(y=m=b[0],e=1;em?m=b[e]:b[e]=l&&jd(Hd),p=A[d[_++]]),e=p.minLen,t=n.read(e);e>p.maxLen&&jd(Hd),!(t<=p.limit[e]);e++)t=t<<1|n.read(1);((t-=p.base[e])<0||t>=258)&&jd(Hd);var S=p.permute[t];if(0!==S&&1!==S){if(B)for(B=0,C+o>this.dbufSize&&jd(Hd),I[E=s[f[0]]]+=o;o--;)k[C++]=E;if(S>c)break;C>=this.dbufSize&&jd(Hd),I[E=s[E=Td(f,e=S-1)]]++,k[C++]=E}else B||(B=1,o=0),o+=0===S?B:2*B,B<<=1}for((a<0||a>=C)&&jd(Hd),t=0,e=0;e<256;e++)r=t+I[e],I[e]=t,t=r;for(e=0;e>=8,P=-1),this.writePos=Q,this.writeCurrent=x,this.writeCount=C,this.writeRun=P,!0},zd.prototype._read_bunzip=function(e,t){var r,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var u=this.writeRun;c;){for(c--,n=s,s=255&(o=a[o]),o>>=8,3==u++?(r=s,i=n,s=-1):(r=1,i=s),this.blockCRC.updateCRCRun(i,r);r--;)this.outputStream.writeByte(i),this.nextoutput++;s!=n&&(u=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&jd(Hd,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};const Wd=Symbol("verified"),Zd=new Set([Xo.signatureSubpacket.issuer,Xo.signatureSubpacket.issuerFingerprint,Xo.signatureSubpacket.embeddedSignature]);class Jd{static get tag(){return Xo.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new bs,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Wd]=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new yl(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=bf.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Vo((async()=>bf.serializeParams(this.publicKeyAlgorithm,await this.params))):bf.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),ts.concat(e)}async sign(e,t,r=new Date,n=!1){5===e.version?this.version=5:this.version=4;const i=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=ts.normalizeDate(r),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),i.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=ts.concat(i);const a=this.toHash(this.signatureType,t,n),o=await this.hash(this.signatureType,t,a,n);this.signedHashValue=Zo(jo(o),0,2);const s=async()=>bf.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,a,await Jo(o));ts.isStream(o)?this.params=s():(this.params=await s(),this[Wd]=!0)}writeHashedSubPackets(){const e=Xo.signatureSubpacket,t=[];let r;if(null===this.created)throw Error("Missing signature creation time");t.push(Vd(e.signatureCreationTime,!0,ts.writeDate(this.created))),null!==this.signatureExpirationTime&&t.push(Vd(e.signatureExpirationTime,!0,ts.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&t.push(Vd(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(r=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Vd(e.trustSignature,!0,r))),null!==this.regularExpression&&t.push(Vd(e.regularExpression,!0,this.regularExpression)),null!==this.revocable&&t.push(Vd(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&t.push(Vd(e.keyExpirationTime,!0,ts.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Vd(e.preferredSymmetricAlgorithms,!1,r))),null!==this.revocationKeyClass&&(r=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),r=ts.concat([r,this.revocationKeyFingerprint]),t.push(Vd(e.revocationKey,!1,r))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||t.push(Vd(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:n,value:i,humanReadable:a,critical:o})=>{r=[new Uint8Array([a?128:0,0,0,0])];const s=ts.encodeUTF8(n);r.push(ts.writeNumber(s.length,2)),r.push(ts.writeNumber(i.length,2)),r.push(s),r.push(i),r=ts.concat(r),t.push(Vd(e.notationData,o,r))})),null!==this.preferredHashAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Vd(e.preferredHashAlgorithms,!1,r))),null!==this.preferredCompressionAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Vd(e.preferredCompressionAlgorithms,!1,r))),null!==this.keyServerPreferences&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.keyServerPreferences)),t.push(Vd(e.keyServerPreferences,!1,r))),null!==this.preferredKeyServer&&t.push(Vd(e.preferredKeyServer,!1,ts.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&t.push(Vd(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&t.push(Vd(e.policyURI,!1,ts.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.keyFlags)),t.push(Vd(e.keyFlags,!0,r))),null!==this.signersUserID&&t.push(Vd(e.signersUserID,!1,ts.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(r=ts.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Vd(e.reasonForRevocation,!0,r))),null!==this.features&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.features)),t.push(Vd(e.features,!1,r))),null!==this.signatureTargetPublicKeyAlgorithm&&(r=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],r.push(ts.stringToUint8Array(this.signatureTargetHash)),r=ts.concat(r),t.push(Vd(e.signatureTarget,!0,r))),null!==this.embeddedSignature&&t.push(Vd(e.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=ts.concat(r),t.push(Vd(e.issuerFingerprint,5===this.version,r))),null!==this.preferredAEADAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Vd(e.preferredAEADAlgorithms,!1,r)));const n=ts.concat(t),i=ts.writeNumber(n.length,2);return ts.concat([i,n])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach((t=>{e.push(ll(t.length)),e.push(t)}));const t=ts.concat(e),r=ts.writeNumber(t.length,2);return ts.concat([r,t])}readSubPacket(e,t=!0){let r=0;const n=!!(128&e[r]),i=127&e[r];if(t||(this.unhashedSubpackets.push(e.subarray(r,e.length)),Zd.has(i)))switch(r++,i){case Xo.signatureSubpacket.signatureCreationTime:this.created=ts.readDate(e.subarray(r,e.length));break;case Xo.signatureSubpacket.signatureExpirationTime:{const t=ts.readNumber(e.subarray(r,e.length));this.signatureNeverExpires=0===t,this.signatureExpirationTime=t;break}case Xo.signatureSubpacket.exportableCertification:this.exportable=1===e[r++];break;case Xo.signatureSubpacket.trustSignature:this.trustLevel=e[r++],this.trustAmount=e[r++];break;case Xo.signatureSubpacket.regularExpression:this.regularExpression=e[r];break;case Xo.signatureSubpacket.revocable:this.revocable=1===e[r++];break;case Xo.signatureSubpacket.keyExpirationTime:{const t=ts.readNumber(e.subarray(r,e.length));this.keyExpirationTime=t,this.keyNeverExpires=0===t;break}case Xo.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.revocationKey:this.revocationKeyClass=e[r++],this.revocationKeyAlgorithm=e[r++],this.revocationKeyFingerprint=e.subarray(r,r+20);break;case Xo.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(r,e.length));break;case Xo.signatureSubpacket.notationData:{const t=!!(128&e[r]);r+=4;const i=ts.readNumber(e.subarray(r,r+2));r+=2;const a=ts.readNumber(e.subarray(r,r+2));r+=2;const o=ts.decodeUTF8(e.subarray(r,r+i)),s=e.subarray(r+i,r+i+a);this.rawNotations.push({name:o,humanReadable:t,value:s,critical:n}),t&&(this.notations[o]=ts.decodeUTF8(s));break}case Xo.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==e[r++];break;case Xo.signatureSubpacket.policyURI:this.policyURI=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.signersUserID:this.signersUserID=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[r++],this.reasonForRevocationString=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.features:this.features=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[r++],this.signatureTargetHashAlgorithm=e[r++];const t=bf.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=ts.uint8ArrayToString(e.subarray(r,r+t));break}case Xo.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Jd,this.embeddedSignature.read(e.subarray(r,e.length));break;case Xo.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[r++],this.issuerFingerprint=e.subarray(r,e.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case Xo.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(r,e.length)];break;default:{const e=Error("Unknown signature subpacket type "+i);if(n)throw e;ts.printDebug(e)}}}readSubPackets(e,t=!0,r){const n=ts.readNumber(e.subarray(0,2));let i=2;for(;i<2+n;){const n=hl(e.subarray(i,e.length));i+=n.offset,this.readSubPacket(e.subarray(i,i+n.len),t,r),i+=n.len}return i}toSign(e,t){const r=Xo.signature;switch(e){case r.binary:return null!==t.text?ts.encodeUTF8(t.getText(!0)):t.getBytes(!0);case r.text:{const e=t.getBytes(!0);return ts.canonicalizeEOL(e)}case r.standalone:return new Uint8Array(0);case r.certGeneric:case r.certPersona:case r.certCasual:case r.certPositive:case r.certRevocation:{let e,n;if(t.userID)n=180,e=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");n=209,e=t.userAttribute}const i=e.write();return ts.concat([this.toSign(r.key,t),new Uint8Array([n]),ts.writeNumber(i.length,4),i])}case r.subkeyBinding:case r.subkeyRevocation:case r.keyBinding:return ts.concat([this.toSign(r.key,t),this.toSign(r.key,{key:t.bind})]);case r.key:if(void 0===t.key)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case r.keyRevocation:return this.toSign(r.key,t);case r.timestamp:return new Uint8Array(0);case r.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let r=0;return Lo(jo(this.signatureData),(e=>{r+=e.length}),(()=>{const n=[];return 5!==this.version||this.signatureType!==Xo.signature.binary&&this.signatureType!==Xo.signature.text||(t?n.push(new Uint8Array(6)):n.push(e.writeHeader())),n.push(new Uint8Array([this.version,255])),5===this.version&&n.push(new Uint8Array(4)),n.push(ts.writeNumber(r,4)),ts.concat(n)}))}toHash(e,t,r=!1){const n=this.toSign(e,t);return ts.concat([n,this.signatureData,this.calculateTrailer(t,r)])}async hash(e,t,r,n=!1){return r||(r=this.toHash(e,t,n)),bf.hash.digest(this.hashAlgorithm,r)}async verify(e,t,r,n=new Date,i=!1,a=us){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===Xo.signature.binary||t===Xo.signature.text;if(!this[Wd]||o){let n,a;if(this.hashed?a=await this.hashed:(n=this.toHash(t,r,i),a=await this.hash(t,r,n)),a=await Jo(a),this.signedHashValue[0]!==a[0]||this.signedHashValue[1]!==a[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[Wd]=await bf.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,n,a),!this[Wd])throw Error("Signature verification failed")}const s=ts.normalizeDate(n);if(s&&this.created>s)throw Error("Signature creation time is in the future");if(s&&s>=this.getExpirationTime())throw Error("Signature is expired");if(a.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+Xo.read(Xo.hash,this.hashAlgorithm).toUpperCase());if(a.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[Xo.signature.binary,Xo.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+Xo.read(Xo.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:e,critical:t})=>{if(t&&a.knownNotations.indexOf(e)<0)throw Error("Unknown critical notation: "+e)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=ts.normalizeDate(e);return null!==t&&!(this.created<=t&&tJd.prototype.calculateTrailer.apply(await this.correspondingSig,e)))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==Xo.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function $d(e,t){if(!t[e]){let r;try{r=Xo.read(Xo.packet,e)}catch(t){throw new yl("Unknown packet type with tag: "+e)}throw Error("Packet not allowed in this context: "+r)}return new t[e]}Yd.prototype.hash=Jd.prototype.hash,Yd.prototype.toHash=Jd.prototype.toHash,Yd.prototype.toSign=Jd.prototype.toSign;class Xd extends Array{static async fromBinary(e,t,r=us){const n=new Xd;return await n.read(e,t,r),n}async read(e,t,r=us){r.additionalAllowedPackets.length&&(t={...t,...ts.constructAllowedPackets(r.additionalAllowedPackets)}),this.stream=Go(e,(async(e,n)=>{const i=Oo(n);try{for(;;)if(await i.ready,await Al(e,(async e=>{try{if(e.tag===Xo.packet.marker||e.tag===Xo.packet.trust)return;const n=$d(e.tag,t);n.packets=new Xd,n.fromStream=ts.isStream(e.packet),await n.read(e.packet,r),await i.write(n)}catch(t){const n=!r.ignoreUnsupportedPackets&&t instanceof yl,a=!(r.ignoreMalformedPackets||t instanceof yl);if(n||a||gl(e.tag))await i.abort(t);else{const t=new ml(e.tag,e.packet);await i.write(t)}ts.printDebugError(t)}})))return await i.ready,void await i.close()}catch(e){await i.abort(e)}}));const n=qo(this.stream);for(;;){const{done:e,value:t}=await n.read();if(e?this.stream=null:this.push(t),e||gl(t.constructor.tag))break}n.releaseLock()}write(){const e=[];for(let t=0;t{if(t.push(e),i+=e.length,i>=a){const e=Math.min(Math.log(i)/Math.LN2|0,30),r=2**e,n=ts.concat([fl(e)].concat(t));return t=[n.subarray(1+r)],i=t[0].length,n.subarray(0,1+r)}}),(()=>ts.concat([ll(i)].concat(t)))))}else{if(ts.isStream(n)){let t=0;e.push(Lo(jo(n),(e=>{t+=e.length}),(()=>pl(r,t))))}else e.push(pl(r,n.length));e.push(n)}}return ts.concat(e)}filterByTag(...e){const t=new Xd,r=e=>t=>e===t;for(let n=0;nt.constructor.tag===e))}indexOfTag(...e){const t=[],r=this,n=e=>t=>e===t;for(let i=0;i>4)}read(e){let t=0;try{this.type=Xo.read(Xo.s2k,e[t++])}catch(e){throw new yl("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==ts.uint8ArrayToString(e.subarray(t,t+3)))throw new yl("Unknown s2k type.");if(t+=3,1001!==1e3+e[t++])throw new yl("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new yl("Unknown s2k type.")}return t}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...ts.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([Xo.write(Xo.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return ts.concatUint8Array(e)}async produceKey(e,t){e=ts.encodeUTF8(e);const r=[];let n=0,i=0;for(;n{this.privateParams[e].fill(0),delete this.privateParams[e]})),this.privateParams=null,this.isEncrypted=!0)}}async function op(e,t,r){const{keySize:n}=bf.getCipher(r);return e.produceKey(t,n)}var sp=sc((function(e){!function(t){function r(e){function t(){return Ee0&&(t.semantic=" "),t}}function A(e,t){return function(){var n,a,s,u,h;for(u=r(),n=o("star"),s=0,h=void 0===t?0:t;null!==(a=e());)s+=1,c(n,a);return s>=h?n:(i(u),null)}}function y(e){return e.charCodeAt(0)>=128}function m(){return s("cr",h("\r")())}function b(){return s("crlf",l(m,I)())}function w(){return s("dquote",h('"')())}function v(){return s("htab",h("\t")())}function I(){return s("lf",h("\n")())}function E(){return s("sp",h(" ")())}function B(){return s("vchar",u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n})))}function C(){return s("wsp",f(E,v)())}function _(){var e=s("quoted-pair",f(l(h("\\"),f(B,C)),ne)());return null===e?null:(e.semantic=e.semantic[1],e)}function k(){return s("fws",f(ae,l(d(l(A(C),p(b))),A(C,1)))())}function S(){return s("ctext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=39||42<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),te)())}function Q(){return s("ccontent",f(S,_,x)())}function x(){return s("comment",l(h("("),A(l(d(k),Q)),d(k),h(")"))())}function P(){return s("cfws",f(l(A(l(d(k),x),1),d(k)),k)())}function M(){return s("atext",u((function(t){var r="a"<=t&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(t)>=0;return e.rfc6532&&(r=r||y(t)),r})))}function U(){return s("atom",l(g(d(P)),A(M,1),g(d(P)))())}function D(){var e,t;return null===(e=s("dot-atom-text",A(M,1)()))||null!==(t=A(l(h("."),A(M,1)))())&&c(e,t),e}function R(){return s("dot-atom",l(p(d(P)),D,p(d(P)))())}function F(){return s("qtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33===r||35<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),re)())}function T(){return s("qcontent",f(F,_)())}function q(){return s("quoted-string",l(p(d(P)),p(w),A(l(d(g(k)),T)),d(p(k)),p(w),p(d(P)))())}function O(){return s("word",f(U,q)())}function K(){return s("address",f(H,G)())}function H(){return s("mailbox",f(N,X)())}function N(){return s("name-addr",l(d(j),L)())}function L(){return s("angle-addr",f(l(p(d(P)),h("<"),X,h(">"),p(d(P))),oe)())}function G(){return s("group",l(j,h(":"),d(Z),h(";"),p(d(P)))())}function j(){return s("display-name",(null!==(e=s("phrase",f(ie,A(O,1))()))&&(e.semantic=function(e){return e.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(e.semantic)),e));var e}function z(){return s("mailbox-list",f(l(H,A(l(h(","),H))),ue)())}function W(){return s("address-list",f(l(K,A(l(h(","),K))),he)())}function Z(){return s("group-list",f(z,p(P),le)())}function J(){return s("local-part",f(fe,R,q)())}function V(){return s("dtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=90||94<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),pe)())}function Y(){return s("domain-literal",l(p(d(P)),h("["),A(l(d(k),V)),d(k),h("]"),p(d(P)))())}function $(){return s("domain",(t=f(de,R,Y)(),e.rejectTLD&&t&&t.semantic&&t.semantic.indexOf(".")<0?null:(t&&(t.semantic=t.semantic.replace(/\s+/g,"")),t)));var t}function X(){return s("addr-spec",l(J,h("@"),$)())}function ee(){return e.strict?null:s("obs-NO-WS-CTL",u((function(e){var t=e.charCodeAt(0);return 1<=t&&t<=8||11===t||12===t||14<=t&&t<=31||127===t})))}function te(){return e.strict?null:s("obs-ctext",ee())}function re(){return e.strict?null:s("obs-qtext",ee())}function ne(){return e.strict?null:s("obs-qp",l(h("\\"),f(h("\0"),ee,I,m))())}function ie(){return e.strict?null:e.atInDisplayName?s("obs-phrase",l(O,A(f(O,h("."),h("@"),g(P))))()):s("obs-phrase",l(O,A(f(O,h("."),g(P))))())}function ae(){return e.strict?null:s("obs-FWS",A(l(p(d(b)),C),1)())}function oe(){return e.strict?null:s("obs-angle-addr",l(p(d(P)),h("<"),se,X,h(">"),p(d(P)))())}function se(){return e.strict?null:s("obs-route",l(ce,h(":"))())}function ce(){return e.strict?null:s("obs-domain-list",l(A(f(p(P),h(","))),h("@"),$,A(l(h(","),p(d(P)),d(l(h("@"),$)))))())}function ue(){return e.strict?null:s("obs-mbox-list",l(A(l(p(d(P)),h(","))),H,A(l(h(","),d(l(H,p(P))))))())}function he(){return e.strict?null:s("obs-addr-list",l(A(l(p(d(P)),h(","))),K,A(l(h(","),d(l(K,p(P))))))())}function le(){return e.strict?null:s("obs-group-list",l(A(l(p(d(P)),h(",")),1),p(d(P)))())}function fe(){return e.strict?null:s("obs-local-part",l(O,A(l(h("."),O)))())}function de(){return e.strict?null:s("obs-domain",l(U,A(l(h("."),U)))())}function pe(){return e.strict?null:s("obs-dtext",f(ee,_)())}function ge(e,t){var r,n,i;if(null==t)return null;for(n=[t];n.length>0;){if((i=n.pop()).name===e)return i;for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r])}return null}function Ae(e,t){var r,n,i,a,o;if(null==t)return null;for(n=[t],a=[],o={},r=0;r0;)if((i=n.pop()).name in o)a.push(i);else for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}function ye(t){var r,n,i,a,o;if(null===t)return null;for(r=[],n=Ae(["group","mailbox"],t),i=0;i1?null:t.addresses&&t.addresses[0]:null}(o):e.simple?o&&o.addresses:o}function me(e){var t,r=ge("display-name",e),n=[],i=Ae(["mailbox"],e);for(t=0;t0;)for("cfws"===(i=n.pop()).name&&a.push(i),r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}(0,e),i=Ae(["comment"],e),a=ge("local-part",r),o=ge("domain",r);return{node:e,parts:{name:t,address:r,local:a,domain:o,comments:n},type:e.name,name:we(t),address:we(r),local:we(a),domain:we(o),comments:ve(i),groupName:we(e.groupName)}}function we(e){return null!=e?e.semantic:null}function ve(e){var t="";if(e)for(var r=0;r`),t.userID=r.join(" "),t}read(e,t=us){const r=ts.decodeUTF8(e);if(r.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:e,address:t,comments:n}=sp.parseOneAddress({input:r,atInDisplayName:!0});this.comment=n.replace(/^\(|\)$/g,""),this.name=e,this.email=t}catch(e){}this.userID=r}write(){return ts.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class up extends ap{static get tag(){return Xo.packet.secretSubkey}constructor(e=new Date,t=us){super(e,t)}}async function hp(e,t,r,n,i=new Date,a){let o,s;for(let c=e.length-1;c>=0;c--)try{(!o||e[c].created>=o.created)&&(await e[c].verify(t,r,n,i,void 0,a),o=e[c])}catch(e){s=e}if(!o)throw ts.wrapError(`Could not find valid ${Xo.read(Xo.signature,r)} signature in key ${t.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((e,t,r)=>t+" "+r.toLowerCase())),s);return o}function lp(e,t,r=new Date){const n=ts.normalizeDate(r);if(null!==n){const r=gp(e,t);return!(e.created<=n&&ne.equals(i.issuerKeyID)))||i.revoked||!1,i.revoked):c.length>0}function gp(e,t){let r;return!1===t.keyNeverExpires&&(r=e.created.getTime()+1e3*t.keyExpirationTime),r?new Date(r):1/0}function Ap(e,t){const r=e.algorithm;return r!==Xo.publicKey.rsaEncrypt&&r!==Xo.publicKey.elgamal&&r!==Xo.publicKey.ecdh&&r!==Xo.publicKey.x25519&&(!t.keyFlags||0!=(t.keyFlags[0]&Xo.keyFlags.signData))}function yp(e,t){const r=e.algorithm;return r!==Xo.publicKey.dsa&&r!==Xo.publicKey.rsaSign&&r!==Xo.publicKey.ecdsa&&r!==Xo.publicKey.eddsaLegacy&&r!==Xo.publicKey.ed25519&&(!t.keyFlags||0!=(t.keyFlags[0]&Xo.keyFlags.encryptCommunication)||0!=(t.keyFlags[0]&Xo.keyFlags.encryptStorage))}function mp(e,t){return!!t.allowInsecureDecryptionWithSigningKeys||!e.keyFlags||0!=(e.keyFlags[0]&Xo.keyFlags.encryptCommunication)||0!=(e.keyFlags[0]&Xo.keyFlags.encryptStorage)}function bp(e,t){const r=Xo.write(Xo.publicKey,e.algorithm),n=e.getAlgorithmInfo();if(t.rejectPublicKeyAlgorithms.has(r))throw Error(n.algorithm+" keys are considered too weak.");switch(r){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:case Xo.publicKey.rsaEncrypt:if(n.bitse.getKeys(s).length>0));return 0===c.length?null:(await Promise.all(c.map((async t=>{const a=await t.getSigningKey(s,e.created,void 0,n);if(e.revoked||await i.isRevoked(e,a.keyPacket,r,n))throw Error("User certificate is revoked");try{await e.verify(a.keyPacket,Xo.signature.certGeneric,o,r,void 0,n)}catch(e){throw ts.wrapError("User certificate is invalid",e)}}))),!0)}async verifyAllCertifications(e,t=new Date,r){const n=this,i=this.selfCertifications.concat(this.otherCertifications);return Promise.all(i.map((async i=>({keyID:i.issuerKeyID,valid:await n.verifyCertificate(i,e,t,r).catch((()=>!1))}))))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const r=this,n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};let a;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const a=this.selfCertifications[o];if(a.revoked||await r.isRevoked(a,void 0,e,t))throw Error("Self-certification is revoked");try{await a.verify(n,Xo.signature.certGeneric,i,e,void 0,t)}catch(e){throw ts.wrapError("Self-certification is invalid",e)}return!0}catch(e){a=e}throw a}async update(e,t,r){const n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};await dp(e,this,"selfCertifications",t,(async function(e){try{return await e.verify(n,Xo.signature.certGeneric,i,t,!1,r),!0}catch(e){return!1}})),await dp(e,this,"otherCertifications",t),await dp(e,this,"revocationSignatures",t,(function(e){return pp(n,Xo.signature.certRevocation,i,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=Xo.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=us){const a={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new wp(a.userID||a.userAttribute,this.mainKey);return o.revocationSignatures.push(await fp(a,null,e,{signatureType:Xo.signature.certRevocation,reasonForRevocationFlag:Xo.write(Xo.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}}class vp{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Xd;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new vp(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,r=new Date,n=us){const i=this.mainKey.keyPacket;return pp(i,Xo.signature.subkeyRevocation,{key:i,bind:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verify(e=new Date,t=us){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket},i=await hp(this.bindingSignatures,r,Xo.signature.subkeyBinding,n,e,t);if(i.revoked||await this.isRevoked(i,null,e,t))throw Error("Subkey is revoked");if(lp(this.keyPacket,i,e))throw Error("Subkey is expired");return i}async getExpirationTime(e=new Date,t=us){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket};let i;try{i=await hp(this.bindingSignatures,r,Xo.signature.subkeyBinding,n,e,t)}catch(e){return null}const a=gp(this.keyPacket,i),o=i.getExpirationTime();return ai.bindingSignatures[t].created&&(i.bindingSignatures[t]=e),!1;try{return await e.verify(n,Xo.signature.subkeyBinding,a,t,void 0,r),!0}catch(e){return!1}})),await dp(e,this,"revocationSignatures",t,(function(e){return pp(n,Xo.signature.subkeyRevocation,a,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=Xo.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=us){const a={key:e,bind:this.keyPacket},o=new vp(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await fp(a,null,e,{signatureType:Xo.signature.subkeyRevocation,reasonForRevocationFlag:Xo.write(Xo.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((e=>{vp.prototype[e]=function(){return this.keyPacket[e]()}}));const Ip=ts.constructAllowedPackets([Jd]),Ep=new Set([Xo.packet.publicKey,Xo.packet.privateKey]),Bp=new Set([Xo.packet.publicKey,Xo.packet.privateKey,Xo.packet.publicSubkey,Xo.packet.privateSubkey]);class Cp{packetListToStructure(e,t=new Set){let r,n,i,a;for(const o of e){if(o instanceof ml){Bp.has(o.tag)&&!a&&(a=Ep.has(o.tag)?Ep:Bp);continue}const e=o.constructor.tag;if(a){if(!a.has(e))continue;a=null}if(t.has(e))throw Error("Unexpected packet type: "+e);switch(e){case Xo.packet.publicKey:case Xo.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,n=this.getKeyID(),!n)throw Error("Missing Key ID");break;case Xo.packet.userID:case Xo.packet.userAttribute:r=new wp(o,this),this.users.push(r);break;case Xo.packet.publicSubkey:case Xo.packet.secretSubkey:r=null,i=new vp(o,this),this.subkeys.push(i);break;case Xo.packet.signature:switch(o.signatureType){case Xo.signature.certGeneric:case Xo.signature.certPersona:case Xo.signature.certCasual:case Xo.signature.certPositive:if(!r){ts.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(n)?r.selfCertifications.push(o):r.otherCertifications.push(o);break;case Xo.signature.certRevocation:r?r.revocationSignatures.push(o):this.directSignatures.push(o);break;case Xo.signature.key:this.directSignatures.push(o);break;case Xo.signature.subkeyBinding:if(!i){ts.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}i.bindingSignatures.push(o);break;case Xo.signature.keyRevocation:this.revocationSignatures.push(o);break;case Xo.signature.subkeyRevocation:if(!i){ts.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}i.revocationSignatures.push(o)}}}}toPacketList(){const e=new Xd;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map((t=>e.push(...t.toPacketList()))),this.subkeys.map((t=>e.push(...t.toPacketList()))),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach((e=>{if(e.keyPacket=Object.create(Object.getPrototypeOf(e.keyPacket),Object.getOwnPropertyDescriptors(e.keyPacket)),!e.keyPacket.isDecrypted())return;const t={};Object.keys(e.keyPacket.privateParams).forEach((r=>{t[r]=new Uint8Array(e.keyPacket.privateParams[r])})),e.keyPacket.privateParams=t})),t}getSubkeys(e=null){return this.subkeys.filter((t=>!e||t.getKeyID().equals(e,!0)))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map((e=>e.getKeyID()))}getUserIDs(){return this.users.map((e=>e.userID?e.userID.userID:null)).filter((e=>null!==e))}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,r={},n=us){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await hp(r.bindingSignatures,i,Xo.signature.subkeyBinding,e,t,n);if(!Ap(r.keyPacket,a))continue;if(!a.embeddedSignature)throw Error("Missing embedded signature");return await hp([a.embeddedSignature],r.keyPacket,Xo.signature.keyBinding,e,t,n),bp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&Ap(i,a.selfCertification))return bp(i,n),this}catch(e){o=e}throw ts.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,r={},n=us){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await hp(r.bindingSignatures,i,Xo.signature.subkeyBinding,e,t,n);if(yp(r.keyPacket,a))return bp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&yp(i,a.selfCertification))return bp(i,n),this}catch(e){o=e}throw ts.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,r=new Date,n=us){return pp(this.keyPacket,Xo.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verifyPrimaryKey(e=new Date,t={},r=us){const n=this.keyPacket;if(await this.isRevoked(null,null,e,r))throw Error("Primary key is revoked");const{selfCertification:i}=await this.getPrimaryUser(e,t,r);if(lp(n,i,e))throw Error("Primary key is expired");const a=await hp(this.directSignatures,n,Xo.signature.key,{key:n},e,r).catch((()=>{}));if(a&&lp(n,a,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=us){let r;try{const{selfCertification:n}=await this.getPrimaryUser(null,e,t),i=gp(this.keyPacket,n),a=n.getExpirationTime(),o=await hp(this.directSignatures,this.keyPacket,Xo.signature.key,{key:this.keyPacket},null,t).catch((()=>{}));if(o){const e=gp(this.keyPacket,o);r=Math.min(i,a,e)}else r=ie.subkeys.some((e=>t.hasSameFingerprintAs(e))))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,r)}const n=this.clone();return await dp(e,n,"revocationSignatures",t,(i=>pp(n.keyPacket,Xo.signature.keyRevocation,n,[i],null,e.keyPacket,t,r))),await dp(e,n,"directSignatures",t),await Promise.all(e.users.map((async e=>{const i=n.users.filter((t=>e.userID&&e.userID.equals(t.userID)||e.userAttribute&&e.userAttribute.equals(t.userAttribute)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.users.push(t)}}))),await Promise.all(e.subkeys.map((async e=>{const i=n.subkeys.filter((t=>t.hasSameFingerprintAs(e)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.subkeys.push(t)}}))),n}async getRevocationCertificate(e=new Date,t=us){const r={key:this.keyPacket},n=await hp(this.revocationSignatures,this.keyPacket,Xo.signature.keyRevocation,r,e,t),i=new Xd;return i.push(n),ms(Xo.armor.publicKey,i.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,r=us){const n=await ys(e,r),i=(await Xd.fromBinary(n.data,Ip,r)).findPacket(Xo.packet.signature);if(!i||i.signatureType!==Xo.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!i.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await i.verify(this.keyPacket,Xo.signature.keyRevocation,{key:this.keyPacket},t,void 0,r)}catch(e){throw ts.wrapError("Could not verify revocation signature",e)}const a=this.clone();return a.revocationSignatures.push(i),a}async signPrimaryUser(e,t,r,n=us){const{index:i,user:a}=await this.getPrimaryUser(t,r,n),o=await a.certify(e,t,n),s=this.clone();return s.users[i]=o,s}async signAllUsers(e,t=new Date,r=us){const n=this.clone();return n.users=await Promise.all(this.users.map((function(n){return n.certify(e,t,r)}))),n}async verifyPrimaryUser(e,t=new Date,r,n=us){const i=this.keyPacket,{user:a}=await this.getPrimaryUser(t,r,n);return e?await a.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await a.verify(t,n).catch((()=>!1))}]}async verifyAllUsers(e,t=new Date,r=us){const n=this.keyPacket,i=[];return await Promise.all(this.users.map((async a=>{const o=e?await a.verifyAllCertifications(e,t,r):[{keyID:n.getKeyID(),valid:await a.verify(t,r).catch((()=>!1))}];i.push(...o.map((e=>({userID:a.userID?a.userID.userID:null,userAttribute:a.userAttribute,keyID:e.keyID,valid:e.valid}))))}))),i}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((e=>{Cp.prototype[e]=vp.prototype[e]}));class _p extends Cp{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([Xo.packet.secretKey,Xo.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=us){return ms(Xo.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class kp extends _p{constructor(e){if(super(),this.packetListToStructure(e,new Set([Xo.packet.publicKey,Xo.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Xd,t=this.toPacketList();for(const r of t)switch(r.constructor.tag){case Xo.packet.secretKey:{const t=rp.fromSecretKeyPacket(r);e.push(t);break}case Xo.packet.secretSubkey:{const t=np.fromSecretSubkeyPacket(r);e.push(t);break}default:e.push(r)}return new _p(e)}armor(e=us){return ms(Xo.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,r={},n=us){const i=this.keyPacket,a=[];for(let r=0;re.isDecrypted()))}async validate(e=us){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const r=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});r&&!r.keyPacket.isDummy()&&(t=r.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const e=this.getKeys(),t=e.map((e=>e.keyPacket.isDummy())).every(Boolean);if(t)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(e.map((async e=>e.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()}))}async revoke({flag:e=Xo.reasonForRevocation.noReason,string:t=""}={},r=new Date,n=us){if(!this.isPrivate())throw Error("Need private key for revoking");const i={key:this.keyPacket},a=this.clone();return a.revocationSignatures.push(await fp(i,null,this.keyPacket,{signatureType:Xo.signature.keyRevocation,reasonForRevocationFlag:Xo.write(Xo.reasonForRevocation,e),reasonForRevocationString:t},r,void 0,void 0,void 0,n)),a}async addSubkey(e={}){const t={...us,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1),await fp(i,null,t,a,r.date,void 0,void 0,void 0,n)}(i,r,e,t),o=this.toPacketList();return o.push(i,a),new kp(o)}}const Sp=ts.constructAllowedPackets([rp,np,ap,up,cp,ip,Jd]);async function Qp({armoredKey:e,binaryKey:t,config:r,...n}){if(r={...us,...r},!e&&!t)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!ts.isString(e))throw Error("readKey: options.armoredKey must be a string");if(t&&!ts.isUint8Array(t))throw Error("readKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(e){const{type:t,data:n}=await ys(e,r);if(t!==Xo.armor.publicKey&&t!==Xo.armor.privateKey)throw Error("Armored text not of type key");a=n}else a=t;return function(e){for(const t of e)switch(t.constructor.tag){case Xo.packet.secretKey:return new kp(e);case Xo.packet.publicKey:return new _p(e)}throw Error("No key packet found")}(await Xd.fromBinary(a,Sp,r))}Object.keys(us).length;const xp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function Pp(){}const Mp="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Up(e){return"object"==typeof e&&null!==e||"function"==typeof e}const Dp=Pp,Rp=Promise,Fp=Promise.prototype.then,Tp=Promise.resolve.bind(Rp),qp=Promise.reject.bind(Rp);function Op(e){return new Rp(e)}function Kp(e){return Tp(e)}function Hp(e){return qp(e)}function Np(e,t,r){return Fp.call(e,t,r)}function Lp(e,t,r){Np(Np(e,t,r),void 0,Dp)}function Gp(e,t){Lp(e,t)}function jp(e,t){Lp(e,void 0,t)}function zp(e,t,r){return Np(e,t,r)}function Wp(e){Np(e,void 0,Dp)}const Zp=(()=>{const e=Mp&&Mp.queueMicrotask;if("function"==typeof e)return e;const t=Kp(void 0);return e=>Np(t,e)})();function Jp(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Vp(e,t,r){try{return Kp(Jp(e,t,r))}catch(e){return Hp(e)}}class Yp{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let n=r+1;const i=e._elements,a=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}function $p(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?rg(e):"closed"===t._state?function(e){rg(e),ag(e)}(e):ng(e,t._storedError)}function Xp(e,t){return Dy(e._ownerReadableStream,t)}function eg(e){"readable"===e._ownerReadableStream._state?ig(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){ng(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function tg(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function rg(e){e._closedPromise=Op(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function ng(e,t){rg(e),ig(e,t)}function ig(e,t){void 0!==e._closedPromise_reject&&(Wp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ag(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const og=xp("[[AbortSteps]]"),sg=xp("[[ErrorSteps]]"),cg=xp("[[CancelSteps]]"),ug=xp("[[PullSteps]]"),hg=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},lg=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function fg(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(t+" is not an object.");var r}function dg(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function pg(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function gg(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function Ag(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function yg(e){return Number(e)}function mg(e){return 0===e?0:e}function bg(e,t){const r=Number.MAX_SAFE_INTEGER;let n=Number(e);if(n=mg(n),!hg(n))throw new TypeError(t+" is not a finite number");if(n=function(e){return mg(lg(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return hg(n)&&0!==n?n:0}function wg(e,t){if(!My(e))throw new TypeError(t+" is not a ReadableStream.")}function vg(e){return new _g(e)}function Ig(e,t){e._reader._readRequests.push(t)}function Eg(e,t,r){const n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Bg(e){return e._reader._readRequests.length}function Cg(e){const t=e._reader;return void 0!==t&&!!kg(t)}class _g{constructor(e){if(gg(e,1,"ReadableStreamDefaultReader"),wg(e,"First parameter"),Uy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");$p(this,e),this._readRequests=new Yp}get closed(){return kg(this)?this._closedPromise:Hp(Qg("closed"))}cancel(e=void 0){return kg(this)?void 0===this._ownerReadableStream?Hp(tg("cancel")):Xp(this,e):Hp(Qg("cancel"))}read(){if(!kg(this))return Hp(Qg("read"));if(void 0===this._ownerReadableStream)return Hp(tg("read from"));let e,t;const r=Op(((r,n)=>{e=r,t=n}));return Sg(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!kg(this))throw Qg("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");eg(this)}}}function kg(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Sg(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[ug](t)}function Qg(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let xg;Object.defineProperties(_g.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(_g.prototype,xp.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof xp.asyncIterator&&(xg={[xp.asyncIterator](){return this}},Object.defineProperty(xg,xp.asyncIterator,{enumerable:!1}));class Pg{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?zp(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?zp(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(void 0===e._ownerReadableStream)return Hp(tg("iterate"));let t,r;const n=Op(((e,n)=>{t=e,r=n}));return Sg(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,Zp((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,eg(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,eg(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(void 0===t._ownerReadableStream)return Hp(tg("finish iterating"));if(!this._preventCancel){const r=Xp(t,e);return eg(t),zp(r,(()=>({value:e,done:!0})))}return eg(t),Kp({value:e,done:!0})}}const Mg={next(){return Ug(this)?this._asyncIteratorImpl.next():Hp(Dg("next"))},return(e){return Ug(this)?this._asyncIteratorImpl.return(e):Hp(Dg("return"))}};function Ug(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Dg(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==xg&&Object.setPrototypeOf(Mg,xg);const Rg=Number.isNaN||function(e){return e!=e};function Fg(e){return!!function(e){return"number"==typeof e&&(!Rg(e)&&!(e<0))}(e)&&e!==1/0}function Tg(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function qg(e,t,r){if(!Fg(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Og(e){e._queue=new Yp,e._queueTotalSize=0}function Kg(e){return e.slice()}class Hg{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Gg(this))throw aA("view");return this._view}respond(e){if(!Gg(this))throw aA("respond");if(gg(e,1,"respond"),e=bg(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!Fg(t=Number(t)))throw new RangeError("bytesWritten must be a finite");eA(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!Gg(this))throw aA("respondWithNewView");if(gg(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){const r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,eA(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Hg.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Hg.prototype,xp.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Ng{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Lg(this))throw oA("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Hg.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}get desiredSize(){if(!Lg(this))throw oA("desiredSize");return iA(this)}close(){if(!Lg(this))throw oA("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);!function(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw nA(e,t),t}rA(e),Ry(t)}}(this)}enqueue(e){if(!Lg(this))throw oA("enqueue");if(gg(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);!function(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const n=t.buffer,i=t.byteOffset,a=t.byteLength,o=n;Cg(r)?0===Bg(r)?Zg(e,o,i,a):Eg(r,new Uint8Array(o,i,a),!1):uA(r)?(Zg(e,o,i,a),Xg(e)):Zg(e,o,i,a),jg(e)}(this,e)}error(e=void 0){if(!Lg(this))throw oA("error");nA(this,e)}[cg](e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0),Og(this);const t=this._cancelAlgorithm(e);return rA(this),t}[ug](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0){const t=this._queue.shift();this._queueTotalSize-=t.byteLength,Yg(this);const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}const r=this._autoAllocateChunkSize;if(void 0!==r){let n;try{n=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const i={buffer:n,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}Ig(t,e),jg(this)}}function Lg(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Gg(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function jg(e){const t=function(e){const t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(Cg(t)&&Bg(t)>0)return!0;if(uA(t)&&cA(t)>0)return!0;return iA(e)>0}(e);t&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Lp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,jg(e))}),(t=>{nA(e,t)}))))}function zg(e,t){let r=!1;"closed"===e._state&&(r=!0);const n=Wg(t);"default"===t.readerType?Eg(e,n,r):function(e,t,r){const n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Wg(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Zg(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Jg(e,t){const r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,o=a-a%r;let s=i,c=!1;o>n&&(s=o-t.bytesFilled,c=!0);const u=e._queue;for(;s>0;){const r=u.peek(),n=Math.min(s,r.byteLength),i=t.byteOffset+t.bytesFilled;h=t.buffer,l=i,f=r.buffer,d=r.byteOffset,p=n,new Uint8Array(h).set(new Uint8Array(f,d,p),l),r.byteLength===n?u.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,Vg(e,n,t),s-=n}var h,l,f,d,p;return c}function Vg(e,t,r){$g(e),r.bytesFilled+=t}function Yg(e){0===e._queueTotalSize&&e._closeRequested?(rA(e),Ry(e._controlledReadableByteStream)):jg(e)}function $g(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Xg(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();Jg(e,t)&&(tA(e),zg(e._controlledReadableByteStream,t))}}function eA(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;const r=e._controlledReadableByteStream;if(uA(r))for(;cA(r)>0;)zg(r,tA(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Vg(e,t,r),r.bytesFilled0){const t=r.byteOffset+r.bytesFilled,i=r.buffer.slice(t-n,t);Zg(e,i,0,i.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,zg(e._controlledReadableByteStream,r),Xg(e)}(e,t,r);jg(e)}function tA(e){const t=e._pendingPullIntos.shift();return $g(e),t}function rA(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function nA(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(function(e){$g(e),e._pendingPullIntos=new Yp}(e),Og(e),rA(e),Fy(r,t))}function iA(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function aA(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function oA(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function sA(e,t){e._reader._readIntoRequests.push(t)}function cA(e){return e._reader._readIntoRequests.length}function uA(e){const t=e._reader;return void 0!==t&&!!lA(t)}Object.defineProperties(Ng.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Ng.prototype,xp.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class hA{constructor(e){if(gg(e,1,"ReadableStreamBYOBReader"),wg(e,"First parameter"),Uy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Lg(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");$p(this,e),this._readIntoRequests=new Yp}get closed(){return lA(this)?this._closedPromise:Hp(fA("closed"))}cancel(e=void 0){return lA(this)?void 0===this._ownerReadableStream?Hp(tg("cancel")):Xp(this,e):Hp(fA("cancel"))}read(e){if(!lA(this))return Hp(fA("read"));if(!ArrayBuffer.isView(e))return Hp(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Hp(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Hp(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Hp(tg("read from"));let t,r;const n=Op(((e,n)=>{t=e,r=n}));return function(e,t,r){const n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){const n=e._controlledReadableByteStream;let i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);const a=t.constructor,o={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),void sA(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Jg(e,o)){const t=Wg(o);return Yg(e),void r._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return nA(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(o),sA(n,r),jg(e)}else{const e=new a(o.buffer,o.byteOffset,0);r._closeSteps(e)}}(n._readableStreamController,t,r)}(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),n}releaseLock(){if(!lA(this))throw fA("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");eg(this)}}}function lA(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function fA(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function dA(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Rg(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function pA(e){const{size:t}=e;return t||(()=>1)}function gA(e,t){fg(e,t);const r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:yg(r),size:void 0===n?void 0:AA(n,t+" has member 'size' that")}}function AA(e,t){return dg(e,t),t=>yg(e(t))}function yA(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function mA(e,t,r){return dg(e,r),()=>Vp(e,t,[])}function bA(e,t,r){return dg(e,r),r=>Jp(e,t,[r])}function wA(e,t,r){return dg(e,r),(r,n)=>Vp(e,t,[r,n])}function vA(e,t){if(!CA(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(hA.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(hA.prototype,xp.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class IA{constructor(e={},t={}){void 0===e?e=null:pg(e,"First parameter");const r=gA(t,"Second parameter"),n=function(e,t){fg(e,t);const r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,a=null==e?void 0:e.type,o=null==e?void 0:e.write;return{abort:void 0===r?void 0:yA(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:mA(n,e,t+" has member 'close' that"),start:void 0===i?void 0:bA(i,e,t+" has member 'start' that"),write:void 0===o?void 0:wA(o,e,t+" has member 'write' that"),type:a}}(e,"First parameter");if(BA(this),void 0!==n.type)throw new RangeError("Invalid type is specified");const i=pA(r);!function(e,t,r,n){const i=Object.create(NA.prototype);let a=()=>{},o=()=>Kp(void 0),s=()=>Kp(void 0),c=()=>Kp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.write&&(o=e=>t.write(e,i)),void 0!==t.close&&(s=()=>t.close()),void 0!==t.abort&&(c=e=>t.abort(e)),LA(e,i,a,o,s,c,r,n)}(this,n,dA(r,1),i)}get locked(){if(!CA(this))throw VA("locked");return _A(this)}abort(e=void 0){return CA(this)?_A(this)?Hp(new TypeError("Cannot abort a stream that already has a writer")):kA(this,e):Hp(VA("abort"))}close(){return CA(this)?_A(this)?Hp(new TypeError("Cannot close a stream that already has a writer")):MA(this)?Hp(new TypeError("Cannot close an already-closing stream")):SA(this):Hp(VA("close"))}getWriter(){if(!CA(this))throw VA("getWriter");return EA(this)}}function EA(e){return new RA(e)}function BA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Yp,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function CA(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function _A(e){return void 0!==e._writer}function kA(e,t){const r=e._state;if("closed"===r||"errored"===r)return Kp(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let n=!1;"erroring"===r&&(n=!0,t=void 0);const i=Op(((r,i)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||xA(e,t),i}function SA(e){const t=e._state;if("closed"===t||"errored"===t)return Hp(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Op(((t,r)=>{const n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;var i;return void 0!==n&&e._backpressure&&"writable"===t&&sy(n),qg(i=e._writableStreamController,HA,0),zA(i),r}function QA(e,t){"writable"!==e._state?PA(e):xA(e,t)}function xA(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const n=e._writer;void 0!==n&&qA(n,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&PA(e)}function PA(e){e._state="errored",e._writableStreamController[sg]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new Yp,void 0===e._pendingAbortRequest)return void UA(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void UA(e);Lp(e._writableStreamController[og](r._reason),(()=>{r._resolve(),UA(e)}),(t=>{r._reject(t),UA(e)}))}function MA(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function UA(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&ty(t,e._storedError)}function DA(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){ny(e)}(r):sy(r)),e._backpressure=t}Object.defineProperties(IA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(IA.prototype,xp.toStringTag,{value:"WritableStream",configurable:!0});class RA{constructor(e){if(gg(e,1,"WritableStreamDefaultWriter"),vA(e,"First parameter"),_A(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!MA(e)&&e._backpressure?ny(this):ay(this),XA(this);else if("erroring"===t)iy(this,e._storedError),XA(this);else if("closed"===t)ay(this),XA(this),ry(this);else{const t=e._storedError;iy(this,t),ey(this,t)}}get closed(){return FA(this)?this._closedPromise:Hp(YA("closed"))}get desiredSize(){if(!FA(this))throw YA("desiredSize");if(void 0===this._ownerWritableStream)throw $A("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:jA(t._writableStreamController)}(this)}get ready(){return FA(this)?this._readyPromise:Hp(YA("ready"))}abort(e=void 0){return FA(this)?void 0===this._ownerWritableStream?Hp($A("abort")):function(e,t){return kA(e._ownerWritableStream,t)}(this,e):Hp(YA("abort"))}close(){if(!FA(this))return Hp(YA("close"));const e=this._ownerWritableStream;return void 0===e?Hp($A("close")):MA(e)?Hp(new TypeError("Cannot close an already-closing stream")):TA(this)}releaseLock(){if(!FA(this))throw YA("releaseLock");void 0!==this._ownerWritableStream&&OA(this)}write(e=void 0){return FA(this)?void 0===this._ownerWritableStream?Hp($A("write to")):KA(this,e):Hp(YA("write"))}}function FA(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function TA(e){return SA(e._ownerWritableStream)}function qA(e,t){"pending"===e._readyPromiseState?oy(e,t):function(e,t){iy(e,t)}(e,t)}function OA(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");qA(e,r),function(e,t){"pending"===e._closedPromiseState?ty(e,t):function(e,t){ey(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function KA(e,t){const r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return WA(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return Hp($A("write to"));const a=r._state;if("errored"===a)return Hp(r._storedError);if(MA(r)||"closed"===a)return Hp(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Hp(r._storedError);const o=function(e){return Op(((t,r)=>{const n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{qg(e,t,r)}catch(t){return void WA(e,t)}const n=e._controlledWritableStream;MA(n)||"writable"!==n._state||DA(n,ZA(e)),zA(e)}(n,t,i),o}Object.defineProperties(RA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(RA.prototype,xp.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const HA={};class NA{constructor(){throw new TypeError("Illegal constructor")}error(e=void 0){if(!function(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&JA(this,e)}[og](e){const t=this._abortAlgorithm(e);return GA(this),t}[sg](){Og(this)}}function LA(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Og(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;const c=ZA(t);DA(e,c),Lp(Kp(r()),(()=>{t._started=!0,zA(t)}),(r=>{t._started=!0,QA(e,r)}))}function GA(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function jA(e){return e._strategyHWM-e._queueTotalSize}function zA(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void PA(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===HA?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),Tg(e);const r=e._closeAlgorithm();GA(e),Lp(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&ry(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),QA(e,t)}(t,e)}))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r);Lp(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(Tg(e),!MA(r)&&"writable"===t){const t=ZA(e);DA(r,t)}zA(e)}),(t=>{"writable"===r._state&&GA(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,QA(e,t)}(r,t)}))}(e,r)}function WA(e,t){"writable"===e._controlledWritableStream._state&&JA(e,t)}function ZA(e){return jA(e)<=0}function JA(e,t){const r=e._controlledWritableStream;GA(e),xA(r,t)}function VA(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function YA(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function $A(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function XA(e){e._closedPromise=Op(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function ey(e,t){XA(e),ty(e,t)}function ty(e,t){void 0!==e._closedPromise_reject&&(Wp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function ry(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function ny(e){e._readyPromise=Op(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function iy(e,t){ny(e),oy(e,t)}function ay(e){ny(e),sy(e)}function oy(e,t){void 0!==e._readyPromise_reject&&(Wp(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function sy(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(NA.prototype,{error:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(NA.prototype,xp.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const cy="undefined"!=typeof DOMException?DOMException:void 0,uy=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(cy)?cy:function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function hy(e,t,r,n,i,a){const o=vg(e),s=EA(t);e._disturbed=!0;let c=!1,u=Kp(void 0);return Op(((h,l)=>{let f;if(void 0!==a){if(f=()=>{const r=new uy("Aborted","AbortError"),a=[];n||a.push((()=>"writable"===t._state?kA(t,r):Kp(void 0))),i||a.push((()=>"readable"===e._state?Dy(e,r):Kp(void 0))),g((()=>Promise.all(a.map((e=>e())))),!0,r)},a.aborted)return void f();a.addEventListener("abort",f)}if(p(e,o._closedPromise,(e=>{n?A(!0,e):g((()=>kA(t,e)),!0,e)})),p(t,s._closedPromise,(t=>{i?A(!0,t):g((()=>Dy(e,t)),!0,t)})),function(e,t,r){"closed"===e._state?r():Gp(t,r)}(e,o._closedPromise,(()=>{r?A():g((()=>function(e){const t=e._ownerWritableStream,r=t._state;return MA(t)||"closed"===r?Kp(void 0):"errored"===r?Hp(t._storedError):TA(e)}(s)))})),MA(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");i?A(!0,t):g((()=>Dy(e,t)),!0,t)}function d(){const e=u;return Np(u,(()=>e!==u?d():void 0))}function p(e,t,r){"errored"===e._state?r(e._storedError):jp(t,r)}function g(e,r,n){function i(){Lp(e(),(()=>y(r,n)),(e=>y(!0,e)))}c||(c=!0,"writable"!==t._state||MA(t)?i():Gp(d(),i))}function A(e,r){c||(c=!0,"writable"!==t._state||MA(t)?y(e,r):Gp(d(),(()=>y(e,r))))}function y(e,t){OA(s),eg(o),void 0!==a&&a.removeEventListener("abort",f),e?l(t):h(void 0)}Wp(Op(((e,t)=>{!function r(n){n?e():Np(c?Kp(!0):Np(s._readyPromise,(()=>Op(((e,t)=>{Sg(o,{_chunkSteps:t=>{u=Np(KA(s,t),void 0,Pp),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class ly{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!fy(this))throw Iy("desiredSize");return by(this)}close(){if(!fy(this))throw Iy("close");if(!wy(this))throw new TypeError("The stream is not in a state that permits close");Ay(this)}enqueue(e=void 0){if(!fy(this))throw Iy("enqueue");if(!wy(this))throw new TypeError("The stream is not in a state that permits enqueue");return yy(this,e)}error(e=void 0){if(!fy(this))throw Iy("error");my(this,e)}[cg](e){Og(this);const t=this._cancelAlgorithm(e);return gy(this),t}[ug](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=Tg(this);this._closeRequested&&0===this._queue.length?(gy(this),Ry(t)):dy(this),e._chunkSteps(r)}else Ig(t,e),dy(this)}}function fy(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function dy(e){py(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Lp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,dy(e))}),(t=>{my(e,t)}))))}function py(e){const t=e._controlledReadableStream;return!!wy(e)&&(!!e._started&&(!!(Uy(t)&&Bg(t)>0)||by(e)>0))}function gy(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ay(e){if(!wy(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(gy(e),Ry(t))}function yy(e,t){if(!wy(e))return;const r=e._controlledReadableStream;if(Uy(r)&&Bg(r)>0)Eg(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw my(e,t),t}try{qg(e,t,r)}catch(t){throw my(e,t),t}}dy(e)}function my(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(Og(e),gy(e),Fy(r,t))}function by(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function wy(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function vy(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Og(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,Lp(Kp(r()),(()=>{t._started=!0,dy(t)}),(e=>{my(t,e)}))}function Iy(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function Ey(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function By(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function Cy(e,t,r){return dg(e,r),r=>Jp(e,t,[r])}function _y(e,t){if("bytes"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function ky(e,t){if("byob"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Sy(e,t){fg(e,t);const r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!n,preventClose:!!i,signal:a}}Object.defineProperties(ly.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(ly.prototype,xp.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class Qy{constructor(e={},t={}){void 0===e?e=null:pg(e,"First parameter");const r=gA(t,"Second parameter"),n=function(e,t){fg(e,t);const r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,o=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:bg(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:Ey(i,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:By(a,r,t+" has member 'pull' that"),start:void 0===o?void 0:Cy(o,r,t+" has member 'start' that"),type:void 0===s?void 0:_y(s,t+" has member 'type' that")}}(e,"First parameter");if(Py(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){const n=Object.create(Ng.prototype);let i=()=>{},a=()=>Kp(void 0),o=()=>Kp(void 0);void 0!==t.start&&(i=()=>t.start(n)),void 0!==t.pull&&(a=()=>t.pull(n)),void 0!==t.cancel&&(o=e=>t.cancel(e));const s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Og(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new Yp,e._readableStreamController=t,Lp(Kp(r()),(()=>{t._started=!0,jg(t)}),(e=>{nA(t,e)}))}(e,n,i,a,o,r,s)}(this,n,dA(r,0))}else{const e=pA(r);!function(e,t,r,n){const i=Object.create(ly.prototype);let a=()=>{},o=()=>Kp(void 0),s=()=>Kp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.pull&&(o=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e)),vy(e,i,a,o,s,r,n)}(this,n,dA(r,1),e)}}get locked(){if(!My(this))throw Ty("locked");return Uy(this)}cancel(e=void 0){return My(this)?Uy(this)?Hp(new TypeError("Cannot cancel a stream that already has a reader")):Dy(this,e):Hp(Ty("cancel"))}getReader(e=void 0){if(!My(this))throw Ty("getReader");const t=function(e,t){fg(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:ky(r,t+" has member 'mode' that")}}(e,"First parameter");return void 0===t.mode?vg(this):function(e){return new hA(e)}(this)}pipeThrough(e,t={}){if(!My(this))throw Ty("pipeThrough");gg(e,1,"pipeThrough");const r=function(e,t){fg(e,t);const r=null==e?void 0:e.readable;Ag(r,"readable","ReadableWritablePair"),wg(r,t+" has member 'readable' that");const n=null==e?void 0:e.writable;return Ag(n,"writable","ReadableWritablePair"),vA(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=Sy(t,"Second parameter");if(Uy(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(_A(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Wp(hy(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!My(this))return Hp(Ty("pipeTo"));if(void 0===e)return Hp("Parameter 1 is required in 'pipeTo'.");if(!CA(e))return Hp(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Sy(t,"Second parameter")}catch(e){return Hp(e)}return Uy(this)?Hp(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):_A(e)?Hp(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):hy(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!My(this))throw Ty("tee");const e=function(e,t){const r=vg(e);let n,i,a,o,s,c=!1,u=!1,h=!1;const l=Op((e=>{s=e}));function f(){return c||(c=!0,Sg(r,{_chunkSteps:e=>{Zp((()=>{c=!1;const t=e,r=e;u||yy(a._readableStreamController,t),h||yy(o._readableStreamController,r)}))},_closeSteps:()=>{c=!1,u||Ay(a._readableStreamController),h||Ay(o._readableStreamController),u&&h||s(void 0)},_errorSteps:()=>{c=!1}})),Kp(void 0)}function d(){}return a=xy(d,f,(function(t){if(u=!0,n=t,h){const t=Kg([n,i]),r=Dy(e,t);s(r)}return l})),o=xy(d,f,(function(t){if(h=!0,i=t,u){const t=Kg([n,i]),r=Dy(e,t);s(r)}return l})),jp(r._closedPromise,(e=>{my(a._readableStreamController,e),my(o._readableStreamController,e),u&&h||s(void 0)})),[a,o]}(this);return Kg(e)}values(e=void 0){if(!My(this))throw Ty("values");return function(e,t){const r=vg(e),n=new Pg(r,t),i=Object.create(Mg);return i._asyncIteratorImpl=n,i}(this,function(e,t){return fg(e,"First parameter"),{preventCancel:!!(null==e?void 0:e.preventCancel)}}(e).preventCancel)}}function xy(e,t,r,n=1,i=(()=>1)){const a=Object.create(Qy.prototype);return Py(a),vy(a,Object.create(ly.prototype),e,t,r,n,i),a}function Py(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function My(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Uy(e){return void 0!==e._reader}function Dy(e,t){return e._disturbed=!0,"closed"===e._state?Kp(void 0):"errored"===e._state?Hp(e._storedError):(Ry(e),zp(e._readableStreamController[cg](t),Pp))}function Ry(e){e._state="closed";const t=e._reader;void 0!==t&&(ag(t),kg(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new Yp))}function Fy(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(ig(r,t),kg(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new Yp):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new Yp))}function Ty(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function qy(e,t){fg(e,t);const r=null==e?void 0:e.highWaterMark;return Ag(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:yg(r)}}Object.defineProperties(Qy.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Qy.prototype,xp.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof xp.asyncIterator&&Object.defineProperty(Qy.prototype,xp.asyncIterator,{value:Qy.prototype.values,writable:!0,configurable:!0});const Oy=function(e){return e.byteLength};class Ky{constructor(e){gg(e,1,"ByteLengthQueuingStrategy"),e=qy(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ny(this))throw Hy("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ny(this))throw Hy("size");return Oy}}function Hy(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Ny(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(Ky.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Ky.prototype,xp.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Ly=function(){return 1};class Gy{constructor(e){gg(e,1,"CountQueuingStrategy"),e=qy(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!zy(this))throw jy("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!zy(this))throw jy("size");return Ly}}function jy(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function zy(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function Wy(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function Zy(e,t,r){return dg(e,r),r=>Jp(e,t,[r])}function Jy(e,t,r){return dg(e,r),(r,n)=>Vp(e,t,[r,n])}Object.defineProperties(Gy.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Gy.prototype,xp.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Vy{constructor(e={},t={},r={}){void 0===e&&(e=null);const n=gA(t,"Second parameter"),i=gA(r,"Third parameter"),a=function(e,t){fg(e,t);const r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,o=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Wy(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===i?void 0:Zy(i,e,t+" has member 'start' that"),transform:void 0===a?void 0:Jy(a,e,t+" has member 'transform' that"),writableType:o}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");const o=dA(i,0),s=pA(i),c=dA(n,1),u=pA(n);let h;!function(e,t,r,n,i,a){function o(){return t}e._writable=function(e,t,r,n,i=1,a=(()=>1)){const o=Object.create(IA.prototype);return BA(o),LA(o,Object.create(NA.prototype),e,t,r,n,i,a),o}(o,(function(t){return function(e,t){const r=e._transformStreamController;return e._backpressure?zp(e._backpressureChangePromise,(()=>{const n=e._writable;if("erroring"===n._state)throw n._storedError;return am(r,t)})):am(r,t)}(e,t)}),(function(){return function(e){const t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return nm(r),zp(n,(()=>{if("errored"===t._state)throw t._storedError;Ay(t._readableStreamController)}),(r=>{throw $y(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return $y(e,t),Kp(void 0)}(e,t)}),r,n),e._readable=xy(o,(function(){return function(e){return em(e,!1),e._backpressureChangePromise}(e)}),(function(t){return Xy(e,t),Kp(void 0)}),i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,em(e,!0),e._transformStreamController=void 0}(this,Op((e=>{h=e})),c,u,o,s),function(e,t){const r=Object.create(tm.prototype);let n=e=>{try{return im(r,e),Kp(void 0)}catch(e){return Hp(e)}},i=()=>Kp(void 0);void 0!==t.transform&&(n=e=>t.transform(e,r)),void 0!==t.flush&&(i=()=>t.flush(r)),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,a),void 0!==a.start?h(a.start(this._transformStreamController)):h(void 0)}get readable(){if(!Yy(this))throw sm("readable");return this._readable}get writable(){if(!Yy(this))throw sm("writable");return this._writable}}function Yy(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function $y(e,t){my(e._readable._readableStreamController,t),Xy(e,t)}function Xy(e,t){nm(e._transformStreamController),WA(e._writable._writableStreamController,t),e._backpressure&&em(e,!1)}function em(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Op((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(Vy.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Vy.prototype,xp.toStringTag,{value:"TransformStream",configurable:!0});class tm{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!rm(this))throw om("desiredSize");return by(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!rm(this))throw om("enqueue");im(this,e)}error(e=void 0){if(!rm(this))throw om("error");var t;t=e,$y(this._controlledTransformStream,t)}terminate(){if(!rm(this))throw om("terminate");!function(e){const t=e._controlledTransformStream;Ay(t._readable._readableStreamController),Xy(t,new TypeError("TransformStream terminated"))}(this)}}function rm(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function nm(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function im(e,t){const r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!wy(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{yy(n,t)}catch(e){throw Xy(r,e),r._readable._storedError}const i=function(e){return!py(e)}(n);i!==r._backpressure&&em(r,!0)}function am(e,t){return zp(e._transformAlgorithm(t),void 0,(t=>{throw $y(e._controlledTransformStream,t),t}))}function om(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function sm(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(tm.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(tm.prototype,xp.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var cm=function(e,t){return cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},cm(e,t) +var doipFetchers=function(e){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:i}=Object,a=(o=Object.create(null),e=>{const t=n.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>a(t)===e),c=e=>t=>typeof t===e,{isArray:u}=Array,h=c("undefined");const l=s("ArrayBuffer");const f=c("string"),d=c("function"),p=c("number"),g=e=>null!==e&&"object"==typeof e,A=e=>{if("object"!==a(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=s("Date"),m=s("File"),b=s("Blob"),w=s("FileList"),v=s("URLSearchParams");function I(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n0;)if(n=r[i],t===n.toLowerCase())return n;return null}const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t,C=e=>!h(e)&&e!==B;const _=(k="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>k&&e instanceof k);var k;const S=s("HTMLFormElement"),Q=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),x=s("RegExp"),P=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};I(r,((r,i)=>{let a;!1!==(a=t(r,i,e))&&(n[i]=a||r)})),Object.defineProperties(e,n)},M="abcdefghijklmnopqrstuvwxyz",U="0123456789",D={DIGIT:U,ALPHA:M,ALPHA_DIGIT:M+M.toUpperCase()+U};const R=s("AsyncFunction");var F={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&d(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||d(e.append)&&("formdata"===(t=a(e))||"object"===t&&d(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:f,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:A,isUndefined:h,isDate:y,isFile:m,isBlob:b,isRegExp:x,isFunction:d,isStream:e=>g(e)&&d(e.pipe),isURLSearchParams:v,isTypedArray:_,isFileList:w,forEach:I,merge:function e(){const{caseless:t}=C(this)&&this||{},r={},n=(n,i)=>{const a=t&&E(r,i)||i;A(r[a])&&A(n)?r[a]=e(r[a],n):A(n)?r[a]=e({},n):u(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e(I(t,((t,i)=>{n&&d(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const c={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&i(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!p(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:S,hasOwnProperty:Q,hasOwnProp:Q,reduceDescriptors:P,freezeMethods:e=>{P(e,((t,r)=>{if(d(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];d(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:B,isContextDefined:C,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&d(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return I(e,((e,t)=>{const a=r(e,n+1);!h(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:R,isThenable:e=>e&&(g(e)||d(e))&&d(e.then)&&d(e.catch)},T=[],q=[],O="undefined"!=typeof Uint8Array?Uint8Array:Array,K=!1;function H(){K=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)T[t]=e[t],q[e.charCodeAt(t)]=t;q["-".charCodeAt(0)]=62,q["_".charCodeAt(0)]=63}function N(e,t,r){for(var n,i,a=[],o=t;o>18&63]+T[i>>12&63]+T[i>>6&63]+T[63&i]);return a.join("")}function L(e){var t;K||H();for(var r=e.length,n=r%3,i="",a=[],o=16383,s=0,c=r-n;sc?c:s+o));return 1===n?(t=e[r-1],i+=T[t>>2],i+=T[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=T[t>>10],i+=T[t>>4&63],i+=T[t<<2&63],i+="="),a.push(i),a.join("")}function G(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=e[t+l];for(l+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+l],l+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+l],l+=f,h-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)}function j(e,t,r,n,i,a){var o,s,c,u=8*a-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=h?(s=0,o=h):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*g}var z={}.toString,W=Array.isArray||function(e){return"[object Array]"==z.call(e)};Y.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT;var Z=J();function J(){return Y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function V(e,t){if(J()=J())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J().toString(16)+" bytes");return 0|e}function ne(e){return!(null==e||!e._isBuffer)}function ie(e,t){if(ne(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Pe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Me(e).length;default:if(n)return Pe(e).length;t=(""+t).toLowerCase(),n=!0}}function ae(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return we(this,t,r);case"utf8":case"utf-8":return Ae(this,t,r);case"ascii":return me(this,t,r);case"latin1":case"binary":return be(this,t,r);case"base64":return ge(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ve(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function oe(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function se(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Y.from(t,n)),ne(t))return 0===t.length?-1:ce(e,t,r,n,i);if("number"==typeof t)return t&=255,Y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ce(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ce(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){for(var l=!0,f=0;fi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function ge(e,t,r){return 0===t&&r===e.length?L(e):L(e.slice(t,r))}function Ae(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(h=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(h=c)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(e){var t=e.length;if(t<=ye)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},Y.prototype.compare=function(e,t,r,n,i){if(!ne(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),u=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return ue(this,e,t,r);case"utf8":case"utf-8":return he(this,e,t,r);case"ascii":return le(this,e,t,r);case"latin1":case"binary":return fe(this,e,t,r);case"base64":return de(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ye=4096;function me(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Ee(e,t,r,n,i,a){if(!ne(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Be(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Ce(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function _e(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ke(e,t,r,n,i){return i||_e(e,0,r,4),j(e,t,r,n,23,4),r+4}function Se(e,t,r,n,i){return i||_e(e,0,r,8),j(e,t,r,n,52,8),r+8}Y.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},Y.prototype.readUInt8=function(e,t){return t||Ie(e,1,this.length),this[e]},Y.prototype.readUInt16LE=function(e,t){return t||Ie(e,2,this.length),this[e]|this[e+1]<<8},Y.prototype.readUInt16BE=function(e,t){return t||Ie(e,2,this.length),this[e]<<8|this[e+1]},Y.prototype.readUInt32LE=function(e,t){return t||Ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Y.prototype.readUInt32BE=function(e,t){return t||Ie(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Y.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Ie(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},Y.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Ie(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Y.prototype.readInt8=function(e,t){return t||Ie(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Y.prototype.readInt16LE=function(e,t){t||Ie(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Y.prototype.readInt16BE=function(e,t){t||Ie(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Y.prototype.readInt32LE=function(e,t){return t||Ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Y.prototype.readInt32BE=function(e,t){return t||Ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Y.prototype.readFloatLE=function(e,t){return t||Ie(e,4,this.length),G(this,e,!0,23,4)},Y.prototype.readFloatBE=function(e,t){return t||Ie(e,4,this.length),G(this,e,!1,23,4)},Y.prototype.readDoubleLE=function(e,t){return t||Ie(e,8,this.length),G(this,e,!0,52,8)},Y.prototype.readDoubleBE=function(e,t){return t||Ie(e,8,this.length),G(this,e,!1,52,8)},Y.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Ee(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Y.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,1,255,0),Y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Y.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,65535,0),Y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Be(this,e,t,!0),t+2},Y.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,65535,0),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Be(this,e,t,!1),t+2},Y.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,4294967295,0),Y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Ce(this,e,t,!0),t+4},Y.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,4294967295,0),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ce(this,e,t,!1),t+4},Y.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Ee(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},Y.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Ee(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Y.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,1,127,-128),Y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Y.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,32767,-32768),Y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Be(this,e,t,!0),t+2},Y.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,2,32767,-32768),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Be(this,e,t,!1),t+2},Y.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,2147483647,-2147483648),Y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Ce(this,e,t,!0),t+4},Y.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Ee(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ce(this,e,t,!1),t+4},Y.prototype.writeFloatLE=function(e,t,r){return ke(this,e,t,!0,r)},Y.prototype.writeFloatBE=function(e,t,r){return ke(this,e,t,!1,r)},Y.prototype.writeDoubleLE=function(e,t,r){return Se(this,e,t,!0,r)},Y.prototype.writeDoubleBE=function(e,t,r){return Se(this,e,t,!1,r)},Y.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Y.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Me(e){return function(e){var t,r,n,i,a,o;K||H();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new O(3*s/4-a),n=a>0?s-4:s;var c=0;for(t=0,r=0;t>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===a?(i=q[e.charCodeAt(t)]<<2|q[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===a&&(i=q[e.charCodeAt(t)]<<10|q[e.charCodeAt(t+1)]<<4|q[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Qe,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Ue(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function De(e){return null!=e&&(!!e._isBuffer||Re(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Re(e.slice(0,0))}(e))}function Re(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Fe=Object.freeze({__proto__:null,Buffer:Y,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),Y.alloc(+e)},isBuffer:De,kMaxLength:Z});function Te(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}F.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qe=Te.prototype,Oe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Oe[e]={value:e}})),Object.defineProperties(Te,Oe),Object.defineProperty(qe,"isAxiosError",{value:!0}),Te.from=(e,t,r,n,i,a)=>{const o=Object.create(qe);return F.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Te.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function Ke(e){return F.isPlainObject(e)||F.isArray(e)}function He(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,r){return e?e.concat(t).map((function(e,t){return e=He(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Le=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Ge(e,t,r){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=F.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!s&&F.isBlob(e))throw new Te("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Y.from(e):e}function u(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(F.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(Ke)}(e)||(F.isFileList(e)||F.endsWith(r,"[]"))&&(s=F.toArray(e)))return r=He(r),s.forEach((function(e,n){!F.isUndefined(e)&&null!==e&&t.append(!0===o?Ne([r],n,a):null===o?r:r+"[]",c(e))})),!1;return!!Ke(e)||(t.append(Ne(i,r,a),c(e)),!1)}const h=[],l=Object.assign(Le,{defaultVisitor:u,convertValue:c,isVisitable:Ke});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!F.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),F.forEach(r,(function(r,a){!0===(!(F.isUndefined(r)||null===r)&&i.call(t,r,F.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),h.pop()}}(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ze(e,t){this._pairs=[],e&&Ge(e,this,t)}const We=ze.prototype;function Ze(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Je(e,t,r){if(!t)return e;const n=r&&r.encode||Ze,i=r&&r.serialize;let a;if(a=i?i(t,r):F.isURLSearchParams(t)?t.toString():new ze(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}We.append=function(e,t){this._pairs.push([e,t])},We.toString=function(e){const t=e?function(t){return e.call(this,t,je)}:je;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Ve=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ye={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$e={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Xe="undefined"!=typeof window&&"undefined"!=typeof document,et=(tt="undefined"!=typeof navigator&&navigator.product,Xe&&["ReactNative","NativeScript","NS"].indexOf(tt)<0);var tt;const rt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var nt={...Object.freeze({__proto__:null,hasBrowserEnv:Xe,hasStandardBrowserEnv:et,hasStandardBrowserWebWorkerEnv:rt}),...$e};function it(e){function t(e,r,n,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&F.isArray(n)?n.length:a,s)return F.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&F.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&F.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const at={transitional:Ye,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=F.isObject(e);i&&F.isHTMLForm(e)&&(e=new FormData(e));if(F.isFormData(e))return n&&n?JSON.stringify(it(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ge(e,new nt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return nt.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=F.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ge(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||at.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&F.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw Te.from(e,Te.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nt.classes.FormData,Blob:nt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],(e=>{at.headers[e]={}}));var ot=at;const st=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ct=Symbol("internals");function ut(e){return e&&String(e).trim().toLowerCase()}function ht(e){return!1===e||null==e?e:F.isArray(e)?e.map(ht):String(e)}function lt(e,t,r,n,i){return F.isFunction(n)?n.call(this,t,r):(i&&(t=r),F.isString(t)?F.isString(n)?-1!==t.indexOf(n):F.isRegExp(n)?n.test(t):void 0:void 0)}class ft{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ut(t);if(!i)throw new Error("header name must be a non-empty string");const a=F.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=ht(e))}const a=(e,t)=>F.forEach(e,((e,r)=>i(e,r,t)));return F.isPlainObject(e)||e instanceof this.constructor?a(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&st[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ut(e)){const r=F.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(F.isFunction(t))return t.call(this,e,r);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ut(e)){const r=F.findKey(this,e);return!(!r||void 0===this[r]||t&&!lt(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ut(e)){const i=F.findKey(r,e);!i||t&&!lt(0,r[i],i,t)||(delete r[i],n=!0)}}return F.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!lt(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return F.forEach(this,((n,i)=>{const a=F.findKey(r,i);if(a)return t[a]=ht(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=ht(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return F.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&F.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ct]=this[ct]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ut(e);t[n]||(!function(e,t){const r=F.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return F.isArray(e)?e.forEach(n):n(e),this}}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(ft.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),F.freezeMethods(ft);var dt=ft;function pt(e,t){const r=this||ot,n=t||r,i=dt.from(n.headers);let a=n.data;return F.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function gt(e){return!(!e||!e.__CANCEL__)}function At(e,t,r){Te.call(this,null==e?"canceled":e,Te.ERR_CANCELED,t,r),this.name="CanceledError"}F.inherits(At,Te,{__CANCEL__:!0});var yt=nt.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];F.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),F.isString(n)&&o.push("path="+n),F.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function mt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var bt=nt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=F.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function wt(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=n[o];i||(i=c),r[a]=s,n[a]=c;let h=o,l=0;for(;h!==a;)l+=r[h++],h%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,c=n(s);r=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var vt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=dt.from(e.headers).normalize();let a,o,{responseType:s,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(F.isFormData(n))if(nt.hasStandardBrowserEnv||nt.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let h=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const l=mt(e.baseURL,e.url);function f(){if(!h)return;const n=dt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Te("Request failed with status code "+r.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),u()}),(function(e){r(e),u()}),{data:s&&"text"!==s&&"json"!==s?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}if(h.open(e.method.toUpperCase(),Je(l,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(f)},h.onabort=function(){h&&(r(new Te("Request aborted",Te.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new Te("Network Error",Te.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ye;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Te(t,n.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,e,h)),h=null},nt.hasStandardBrowserEnv&&(c&&F.isFunction(c)&&(c=c(e)),c||!1!==c&&bt(l))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&yt.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in h&&F.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),s&&"json"!==s&&(h.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",wt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",wt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{h&&(r(!t||t.type?new At(null,e,h):t),h.abort(),h=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);d&&-1===nt.protocols.indexOf(d)?r(new Te("Unsupported protocol "+d+":",Te.ERR_BAD_REQUEST,e)):h.send(n||null)}))};const It={http:null,xhr:vt};F.forEach(It,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Et=e=>`- ${e}`,Bt=e=>F.isFunction(e)||null===e||!1===e;var Ct=e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Te("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Et).join("\n"):" "+Et(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function _t(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new At(null,e)}function kt(e){_t(e),e.headers=dt.from(e.headers),e.data=pt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ct(e.adapter||ot.adapter)(e).then((function(t){return _t(e),t.data=pt.call(e,e.transformResponse,t),t.headers=dt.from(t.headers),t}),(function(t){return gt(t)||(_t(e),t&&t.response&&(t.response.data=pt.call(e,e.transformResponse,t.response),t.response.headers=dt.from(t.response.headers))),Promise.reject(t)}))}const St=e=>e instanceof dt?e.toJSON():e;function Qt(e,t){t=t||{};const r={};function n(e,t,r){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:r},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function i(e,t,r){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!F.isUndefined(t))return n(void 0,t)}function o(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(St(e),St(t),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=c[n]||i,o=a(e[n],t[n],n);F.isUndefined(o)&&a!==s||(r[n]=o)})),r}const xt="1.6.5",Pt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Pt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Mt={};Pt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.5] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new Te(n(i," has been removed"+(t?" in "+t:"")),Te.ERR_DEPRECATED);return t&&!Mt[i]&&(Mt[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Ut={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new Te("option "+a+" must be "+r,Te.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Te("Unknown option "+a,Te.ERR_BAD_OPTION)}},validators:Pt};const Dt=Ut.validators;class Rt{constructor(e){this.defaults=e,this.interceptors={request:new Ve,response:new Ve}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Qt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Ut.assertOptions(r,{silentJSONParsing:Dt.transitional(Dt.boolean),forcedJSONParsing:Dt.transitional(Dt.boolean),clarifyTimeoutError:Dt.transitional(Dt.boolean)},!1),null!=n&&(F.isFunction(n)?t.paramsSerializer={serialize:n}:Ut.assertOptions(n,{encode:Dt.function,serialize:Dt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&F.merge(i.common,i[t.method]);i&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=dt.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,l=0;if(!s){const e=[kt.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);l{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new At(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new Tt((function(t){e=t}));return{token:t,cancel:e}}}var qt=Tt;const Ot={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ot).forEach((([e,t])=>{Ot[t]=e}));var Kt=Ot;const Ht=function e(t){const n=new Ft(t),i=r(Ft.prototype.request,n);return F.extend(i,Ft.prototype,n,{allOwnKeys:!0}),F.extend(i,n,null,{allOwnKeys:!0}),i.create=function(r){return e(Qt(t,r))},i}(ot);Ht.Axios=Ft,Ht.CanceledError=At,Ht.CancelToken=qt,Ht.isCancel=gt,Ht.VERSION=xt,Ht.toFormData=Ge,Ht.AxiosError=Te,Ht.Cancel=Ht.CanceledError,Ht.all=function(e){return Promise.all(e)},Ht.spread=function(e){return function(t){return e.apply(null,t)}},Ht.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},Ht.mergeConfig=Qt,Ht.AxiosHeaders=dt,Ht.formToJSON=e=>it(F.isHTMLForm(e)?new FormData(e):e),Ht.getAdapter=Ct,Ht.HttpStatusCode=Kt,Ht.default=Ht;var Nt=Ht,Lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var zt={exports:{}},Wt={exports:{}};!function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var n=r(e);throw null===e?n="null":"object"===n&&(n=e.constructor.name),new TypeError("Expected a string but received a ".concat(n))}},e.exports=t.default,e.exports.default=t.default}(Wt,Wt.exports);var Zt=Wt.exports,Jt={exports:{}},Vt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(Vt,Vt.exports);var Yt=Vt.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),o=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(o))return!1;if(/\s/.test(o))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(o))return!1;return i.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var r=i(Zt),n=i(Yt);function i(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(Jt,Jt.exports);var $t=Jt.exports,Xt=Gt($t),er={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,n.default)(t),r=String(r),!r)return e(t,4)||e(t,6);if("4"===r)return o.test(t);if("6"===r)return c.test(t);return!1};var r,n=(r=Zt)&&r.__esModule?r:{default:r};var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(i,"[.]){3}").concat(i),o=new RegExp("^".concat(a,"$")),s="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(a,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(a,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(a,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(a,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(a,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(a,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(a,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(er,er.exports);var tr=er.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,a.default)(t,c)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var o,l,f,d,p,g,A,y;if(A=e.split("#"),e=A.shift(),A=e.split("?"),e=A.shift(),(A=e.split("://")).length>1){if(o=A.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(o))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;A[0]=e.slice(2)}}if(""===(e=A.join("://")))return!1;if(A=e.split("/"),""===(e=A.shift())&&!t.require_host)return!0;if((A=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===A[0])return!1;if((l=A.shift()).indexOf(":")>=0&&l.split(":").length>2)return!1;var m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(l.split(":"),2),b=m[0],w=m[1];if(""===b&&""===w)return!1}d=A.join("@"),g=null,y=null;var v=d.match(u);v?(f="",y=v[1],g=v[2]||null):(f=(A=d.split(":")).shift(),A.length&&(g=A.join(":")));if(null!==g&&g.length>0){if(p=parseInt(g,10),!/^[0-9]+$/.test(g)||p<=0||p>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return h(f,t.host_whitelist);if(""===f&&!t.require_host)return!0;if(!((0,i.default)(f)||(0,n.default)(f,t)||y&&(0,i.default)(y,6)))return!1;if(f=f||y,t.host_blacklist&&h(f,t.host_blacklist))return!1;return!0};var r=o(Zt),n=o($t),i=o(tr),a=o(Yt);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)for(var r=1;r{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:5e3)})),i=new Promise(((r,n)=>{(async()=>{let i=!1;try{rr(t.claims.activitypub.url),i=!0}catch(e){}const a=new Date,{host:o,pathname:s,search:c}=new URL(e.url),u={host:o,date:a.toUTCString(),accept:"application/activity+json","User-Agent":`doipjs/${Fr}`};if(i&&Dr){const e=`(request-target): get ${s}${c}\nhost: ${o}\ndate: ${a.toUTCString()}`,r=Rr.createSign("SHA256");r.write(e),r.end();const n=r.sign(t.claims.activitypub.privateKey.replace(/\\n/g,"\n"),"base64");u.signature=`keyId="${t.claims.activitypub.url}#main-key",headers="(request-target) host date",signature="${n}",algorithm="rsa-sha256"`}Nt.get(e.url,{headers:u}).then((e=>e.data)).then((e=>{r(e)})).catch((e=>{n(e)}))})()}));return Promise.race([i,n]).finally((()=>{clearTimeout(r)}))}var qr=Object.freeze({__proto__:null,fn:Tr,timeout:5e3}),Or=crypto;const Kr=e=>e instanceof CryptoKey;var Hr=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await Or.subtle.digest(r,t))};const Nr=new TextEncoder,Lr=new TextDecoder;const Gr=e=>(e=>{let t=e;"string"==typeof t&&(t=Nr.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=Lr.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;ee.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}function rn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var nn=(e,...t)=>rn("Key must be ",e,...t);function an(e,t,...r){return rn(`Key for the ${e} algorithm must be `,t,...r)}var on=e=>Kr(e);const sn=["CryptoKey"];var cn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function un(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var hn=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Zr(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Zr('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Zr('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),a=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return Or.subtle.importKey("raw",jr(e.k),...a);const o={...e};return delete o.alg,delete o.use,Or.subtle.importKey("jwk",o,...a)};var ln=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!on(t))throw new TypeError(an(e,t,...sn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${sn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!on(t))throw new TypeError(an(e,t,...sn));if("secret"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${sn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};var fn=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};var dn=async(e,t,r,n)=>{const i=await function(e,t,r){if(Kr(t))return tn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(nn(t,...sn));return Or.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(nn(t,...sn,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,i);const a=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new Zr(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,i.algorithm);try{return await Or.subtle.verify(a,i,r,n)}catch(e){return!1}};async function pn(e,t,r){var n;if(!un(e))throw new Jr("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Jr('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Jr("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Jr("JWS Payload missing");if("string"!=typeof e.signature)throw new Jr("JWS Signature missing or incorrect type");if(void 0!==e.header&&!un(e.header))throw new Jr("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=jr(e.protected);i=JSON.parse(Lr.decode(t))}catch(e){throw new Jr("JWS Protected Header is invalid")}if(!cn(i,e.header))throw new Jr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...i,...e.header},o=function(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!a.has(t))throw new Zr(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(Jr,new Map([["b64",!0]]),null==r?void 0:r.crit,i,a);let s=!0;if(o.has("b64")&&(s=i.b64,"boolean"!=typeof s))throw new Jr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=a;if("string"!=typeof c||!c)throw new Jr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const u=r&&fn("algorithms",r.algorithms);if(u&&!u.has(c))throw new Wr('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof e.payload)throw new Jr("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Jr("JWS Payload must be a string or an Uint8Array instance");let h=!1;"function"==typeof t&&(t=await t(i,e),h=!0),ln(c,t,"verify");const l=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(Nr.encode(null!==(n=e.protected)&&void 0!==n?n:""),Nr.encode("."),"string"==typeof e.payload?Nr.encode(e.payload):e.payload);let f;try{f=jr(e.signature)}catch(e){throw new Jr("Failed to base64url decode the signature")}if(!await dn(c,t,f,l))throw new Yr;let d;if(s)try{d=jr(e.payload)}catch(e){throw new Jr("Failed to base64url decode the payload")}else d="string"==typeof e.payload?Nr.encode(e.payload):e.payload;const p={payload:d};return void 0!==e.protected&&(p.protectedHeader=i),void 0!==e.header&&(p.unprotectedHeader=e.header),h?{...p,key:t}:p}const gn=(e,t)=>{if("string"!=typeof e||!e)throw new Vr(`${t} missing or invalid`)};const An=jr;function yn(e,t,r){var n;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var i=0;i=8&&(s-=8,o[u++]=255&c>>s)}if(s>=t.bits||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o}function mn(e,t,r){void 0===r&&(r={});for(var n=r.pad,i=void 0===n||n,a=(1<t.bits;)s-=t.bits,o+=t.chars[a&c>>s];if(s&&(o+=t.chars[a&c<1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,zn.default)(e);var n=e,i=r.ignore;if(i)if(i instanceof RegExp)n=n.replace(i,"");else{if("string"!=typeof i)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(i.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(t in Wn.alphanumeric)return Wn.alphanumeric[t].test(n);throw new Error("Invalid locale '".concat(t,"'"))};En.locales=void 0;var jn,zn=(jn=Zt)&&jn.__esModule?jn:{default:jn},Wn=Bn;var Zn=Object.keys(Wn.alphanumeric);En.locales=Zn;var Jn={exports:{}};(function(e){e.exports.is_uri=r,e.exports.is_http_uri=n,e.exports.is_https_uri=i,e.exports.is_web_uri=a,e.exports.isUri=r,e.exports.isHttpUri=n,e.exports.isHttpsUri=i,e.exports.isWebUri=a;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function r(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var r,n,i,a,o,s="",c="";if(s=(r=t(e))[1],n=r[2],i=r[3],a=r[4],o=r[5],s&&s.length&&i.length>=0){if(n&&n.length){if(0!==i.length&&!/^\//.test(i))return}else if(/^\/\//.test(i))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(s.toLowerCase()))return c+=s+":",n&&n.length&&(c+="//"+n),c+=i,a&&a.length&&(c+="?"+a),o&&o.length&&(c+="#"+o),c}}}function n(e,n){if(r(e)){var i,a,o,s,c="",u="",h="",l="";if(c=(i=t(e))[1],u=i[2],a=i[3],o=i[4],s=i[5],c){if(n){if("https"!=c.toLowerCase())return}else if("http"!=c.toLowerCase())return;if(u)return/:(\d+)$/.test(u)&&(h=u.match(/:(\d+)$/)[0],u=u.replace(/:\d+$/,"")),l+=c+":",l+="//"+u,h&&(l+=h),l+=a,o&&o.length&&(l+="?"+o),s&&s.length&&(l+="#"+s),l}}}function i(e){return n(e,!0)}function a(e){return n(e)||i(e)}})(Jn);var Vn=Jn.exports;const Yn=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},{hasOwnProperty:$n}=Object.prototype,{propertyIsEnumerable:Xn}=Object,ei=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),ti=Lt,ri={concatArrays:!1,ignoreUndefined:!1},ni=e=>{const t=[];for(const r in e)$n.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)Xn.call(e,n)&&t.push(n)}return t};function ii(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return ni(e).forEach((r=>{ei(t,r,ii(e[r]))})),t}(e):Yn(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return ni(e).forEach((r=>{ei(t,r,ii(e[r]))})),t}(e):e}const ai=(e,t,r,n)=>(r.forEach((r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?ei(e,r,si(e[r],t[r],n)):ei(e,r,ii(t[r])))})),e),oi=(e,t,r)=>{let n=e.slice(0,0),i=0;return[e,t].forEach((t=>{const a=[];for(let r=0;r!a.includes(e))),r)})),n};function si(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?oi(e,t,r):Yn(t)&&Yn(e)?ai(e,t,ni(t),r):ii(t)}var ci=function(...e){const t=si(ii(ri),this!==ti&&this||{},ri);let r={_:{}};for(const n of e)if(void 0!==n){if(!Yn(n))throw new TypeError("`"+n+"` is not an Option Object");r=si(r,{_:n},t)}return r._},ui=Gt(ci);const hi="adaptive",li="always",fi="never",di="activitypub",pi="aspe",gi="dns",Ai="graphql",yi="http",mi="irc",bi="matrix",wi="openpgp",vi="telegram",Ii="xmpp",Ei="plain",Bi="html",Ci="xml",_i="none",ki="nocors",Si="granted",Qi="server",xi="json",Pi="text",Mi="uri",Ui="fingerprint",Di="contains",Ri="equals",Fi="oneof",Ti=100,qi=101,Oi=200,Ki=201,Hi=301,Ni=401,Li={ASP:"asp",OPENPGP:"openpgp"},Gi={EDDSA:"eddsa",ES256:"es256",OPENPGP:"openpgp",UNKNOWN:"unknown",NONE:"none"},ji={PEM:"pem",JWK:"jwk",ARMORED_PGP:"armored_pgp",NONE:"none"},zi="none",Wi="hkp",Zi="wkd";class Ji{constructor(e,t){this.identifier=null,this.name=e,this.email=null,this.description=null,this.avatarUrl=null,this.themeColor=null,this.claims=t,this.isRevoked=!1}static fromJSON(e,t){let r,n;if("object"==typeof e&&t){if(2!==t)throw new Error("Invalid persona version");if(n=function(e){const t=e.claims.map((e=>sS.fromJSON(e))),r=new Ji(e.name,t);return r.identifier=e.identifier,r.email=e.email,r.description=e.description,r.avatarUrl=e.avatarUrl,r.themeColor=e.avatarUrl,r.isRevoked=e.isRevoked,r}(e),n instanceof Error)throw n;r=n}return r}setIdentifier(e){this.identifier=e}setDescription(e){this.description=e}setEmailAddress(e){this.email=e}setAvatarUrl(e){this.avatarUrl=e}addClaim(e){this.claims.push(e)}revoke(){this.isRevoked=!0}toJSON(){return{identifier:this.identifier,name:this.name,email:this.email,description:this.description,avatarUrl:this.avatarUrl,themeColor:this.themeColor,isRevoked:this.isRevoked,claims:this.claims.map((e=>e.toJSON()))}}}class Vi{constructor(e,t,r){this.profileVersion=2,this.profileType=e,this.identifier=t,this.personas=r||[],this.primaryPersonaIndex=r.length>0?0:-1,this.publicKey={keyType:Gi.NONE,fingerprint:null,encoding:ji.NONE,encodedKey:null,key:null,fetch:{method:zi,query:null,resolvedUrl:null}},this.verifiers=[]}static fromJSON(e){let t,r;if("object"==typeof e&&"profileVersion"in e){if(2!==e.profileVersion)throw new Error("Invalid profile version");if(r=function(e){if(!("profileVersion"in e)||2!==e.profileVersion)return new Error("Invalid profile");const t=e.personas.map((e=>Ji.fromJSON(e,2))),r=new Vi(e.profileType,e.identifier,t);return r.primaryPersonaIndex=e.primaryPersonaIndex,r.publicKey=e.publicKey,r.verifiers=e.verifiers,r}(e),r instanceof Error)throw r;t=r}return t}addVerifier(e,t){this.verifiers.push({name:e,url:t})}toJSON(){return{profileVersion:this.profileVersion,profileType:this.profileType,identifier:this.identifier,personas:this.personas.map((e=>e.toJSON())),primaryPersonaIndex:this.primaryPersonaIndex,publicKey:{keyType:this.publicKey.keyType,fingerprint:this.publicKey.fingerprint,encoding:this.publicKey.encoding,encodedKey:this.publicKey.encodedKey,fetch:{method:this.publicKey.fetch.method,query:this.publicKey.fetch.query,resolvedUrl:this.publicKey.fetch.resolvedUrl}},verifiers:this.verifiers}}}class Yi{constructor(e){this.about=e.about,this.profile=e.profile,this.claim=e.claim,this.proof=e.proof}toJSON(){return{about:this.about,profile:this.profile,claim:this.claim,proof:this.proof}}}const $i=/^aspe:([a-zA-Z0-9.\-_]*):([a-zA-Z0-9]*)/;var Xi=Object.freeze({__proto__:null,processURI:function(e){const t=e.match($i);return Xt(t[1])?new Yi({about:{id:"aspe",name:"ASPE"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:$i.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:pi,accessRestriction:_i,data:{aspeUri:e}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["claims"]}]}}):null},reURI:$i,tests:[{uri:"aspe:domain.tld:abc123def456",shouldMatch:!0},{uri:"aspe:domain.tld",shouldMatch:!1},{uri:"dns:domain.tld",shouldMatch:!1},{uri:"https://domain.tld",shouldMatch:!1}]});const ea=/^openpgp4fpr:(?:0x)?([a-zA-Z0-9.\-_]*)/,ta=/^https:\/\/(.*)\/.well-known\/openpgpkey\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/,ra=/^https:\/\/(openpgpkey.*)\/.well-known\/openpgpkey\/(.*)\/hu\/([a-zA-Z0-9]*)(?:\?l=(.*))?/;var na=Object.freeze({__proto__:null,processURI:function(e){let t=null,r=null,n=null;ea.test(e)&&(t=ea,r=Wi,n=e.match(t)),!r&&ra.test(e)&&(t=ra,r=Zi,n=e.match(t)),!r&&ta.test(e)&&(t=ta,r=Zi,n=e.match(t));let i=null;switch(r){case Wi:i=new Yi({about:{id:"openpgp",name:"OpenPGP"},profile:{display:`openpgp4fpr:${n[1]}`,uri:`https://keys.openpgp.org/search?q=${n[1]}`,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,fetcher:wi,accessRestriction:_i,data:{url:`https://keys.openpgp.org/vks/v1/by-fingerprint/${n[1].toUpperCase()}`,protocol:Wi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["notations","proof@ariadne.id"]}]}});break;case Zi:i=new Yi({about:{id:"openpgp",name:"OpenPGP"},profile:{display:"unknown fingerprint",uri:e,qr:null},claim:{uriRegularExpression:t.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:wi,accessRestriction:_i,data:{url:e,protocol:Zi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["notations","proof@ariadne.id"]}]}})}return i},reURI:/^(.*)/,tests:[{uri:"openpgp4fpr:123456789",shouldMatch:!0},{uri:"openpgp4fpr:abcdef123",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/domain.tld/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/hu/123abc456def",shouldMatch:!0},{uri:"https://domain.tld",shouldMatch:!0},{uri:"https://openpgpkey.domain.tld/.well-known/openpgpkey/hu/123abc456def?l=name",shouldMatch:!0},{uri:"https://domain.tld/.well-known/openpgpkey/123abc456def?l=name",shouldMatch:!0}]});const ia=/^dns:([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var aa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ia);return new Yi({about:{id:"dns",name:"DNS"},profile:{display:t[1],uri:`https://${t[1]}`,qr:null},claim:{uriRegularExpression:ia.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:gi,accessRestriction:Qi,data:{domain:t[1]}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["records","txt"]}]}})},reURI:ia,tests:[{uri:"dns:domain.org",shouldMatch:!0},{uri:"dns:domain.org?type=TXT",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const oa=/^irc:\/\/(.*)\/([a-zA-Z0-9\-[\]\\`_^{|}]*)/;var sa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(oa);return new Yi({about:{id:"irc",name:"IRC"},profile:{display:`${t[1]}/${t[2]}`,uri:e,qr:null},claim:{uriRegularExpression:oa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:mi,accessRestriction:Qi,data:{domain:t[1],nick:t[2]}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:[]}]}})},reURI:oa,tests:[{uri:"irc://chat.ircserver.org/Alice1",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice?param=123",shouldMatch:!0},{uri:"irc://chat.ircserver.org/alice_bob",shouldMatch:!0},{uri:"https://chat.ircserver.org/alice",shouldMatch:!1}]});const ca=/^xmpp:([a-zA-Z0-9.\-_]*)@([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;var ua=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ca);return new Yi({about:{id:"xmpp",name:"XMPP",homepage:"https://xmpp.org"},profile:{display:`${t[1]}@${t[2]}`,uri:e,qr:e},claim:{uriRegularExpression:ca.toString(),uriIsAmbiguous:!1},proof:{request:{uri:null,fetcher:Ii,accessRestriction:Qi,data:{id:`${t[1]}@${t[2]}`}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:[]}]}})},reURI:ca,tests:[{uri:"xmpp:alice@domain.org",shouldMatch:!0},{uri:"xmpp:alice@domain.org?omemo-sid-123456789=A1B2C3D4E5F6G7H8I9",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]});const ha=/^matrix:u\/(?:@)?([^@:]*:[^?]*)(\?.*)?/;var la=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ha);if(!t[2])return null;const r=new URLSearchParams(t[2]);if(!r.has("org.keyoxide.e")||!r.has("org.keyoxide.r"))return null;const n=`${"!"!==r.get("org.keyoxide.r")[0]?"!":""}${r.get("org.keyoxide.r")}`,i=`${"$"!==r.get("org.keyoxide.e")[0]?"$":""}${r.get("org.keyoxide.e")}`,a=`https://matrix.to/#/@${t[1]}`,o=`https://matrix.to/#/${n}/${i}`;return new Yi({about:{id:"matrix",name:"Matrix",homepage:"https://matrix.org"},profile:{display:`@${t[1]}`,uri:a,qr:null},claim:{uriRegularExpression:ha.toString(),uriIsAmbiguous:!1},proof:{request:{uri:o,fetcher:bi,accessRestriction:Si,data:{eventId:i,roomId:n}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["content","body"]}]}})},reURI:ha,tests:[{uri:"matrix:u/alice:matrix.domain.org?org.keyoxide.r=123:domain.org&org.keyoxide.e=123",shouldMatch:!0},{uri:"matrix:u/alice:matrix.domain.org",shouldMatch:!0},{uri:"matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123",shouldMatch:!0},{uri:"xmpp:alice@domain.org",shouldMatch:!1},{uri:"https://domain.org/@alice",shouldMatch:!1}]});const fa=/https:\/\/t.me\/([A-Za-z0-9_]{5,32})\?proof=([A-Za-z0-9_]{5,32})/;var da=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(fa);return new Yi({about:{id:"telegram",name:"Telegram",homepage:"https://telegram.org"},profile:{display:`@${t[1]}`,uri:`https://t.me/${t[1]}`,qr:`https://t.me/${t[1]}`},claim:{uriRegularExpression:fa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://t.me/${t[2]}`,fetcher:vi,accessRestriction:Si,data:{user:t[1],chat:t[2]}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["text"]}]}})},reURI:fa,tests:[{uri:"https://t.me/alice?proof=foobar",shouldMatch:!0},{uri:"https://t.me/complex_user_1234?proof=complex_chat_1234",shouldMatch:!0},{uri:"https://t.me/foobar",shouldMatch:!1},{uri:"https://t.me/foobar?proof=",shouldMatch:!1},{uri:"https://t.me/?proof=foobar",shouldMatch:!1}]});const pa=/^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;var ga=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(pa),r=new URLSearchParams;return r.set("url",t[0]),r.set("omit_script","1"),new Yi({about:{id:"twitter",name:"Twitter",homepage:"https://twitter.com"},profile:{display:`@${t[1]}`,uri:`https://twitter.com/${t[1]}`,qr:null},claim:{uriRegularExpression:pa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://publish.twitter.com/oembed?${r}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["html"]}]}})},reURI:pa,tests:[{uri:"https://twitter.com/alice/status/1234567890123456789",shouldMatch:!0},{uri:"https://twitter.com/alice/status/1234567890123456789/",shouldMatch:!0},{uri:"https://domain.org/alice/status/1234567890123456789",shouldMatch:!1}]});const Aa=/^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;var ya=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Aa);return new Yi({about:{id:"reddit",name:"Reddit",homepage:"https://reddit.com"},profile:{display:t[1],uri:`https://www.reddit.com/user/${t[1]}`,qr:null},claim:{uriRegularExpression:Aa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://www.reddit.com/user/${t[1]}/comments/${t[2]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["data","children","data","selftext"]}]}})},reURI:Aa,tests:[{uri:"https://www.reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://www.reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://domain.org/user/Alice/comments/123456/post",shouldMatch:!1}]});const ma=/^https:\/\/liberapay\.com\/(.*)\/?/;var ba=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(ma);return new Yi({about:{id:"liberapay",name:"Liberapay",homepage:"https://liberapay.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:ma.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:`https://liberapay.com/${t[1]}/public.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["statements","content"]}]}})},reURI:ma,tests:[{uri:"https://liberapay.com/alice",shouldMatch:!0},{uri:"https://liberapay.com/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const wa=/^https:\/\/lichess\.org\/@\/(.*)\/?/;var va=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(wa);return new Yi({about:{id:"lichess",name:"Lichess",homepage:"https://lichess.org"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:wa.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lichess.org/api/user/${t[1]}`,fetcher:yi,accessRestriction:_i,data:{url:`https://lichess.org/api/user/${t[1]}`,format:xi}},response:{format:xi},target:[{format:Ui,encoding:Ei,relation:Di,path:["profile","links"]}]}})},reURI:wa,tests:[{uri:"https://lichess.org/@/Alice",shouldMatch:!0},{uri:"https://lichess.org/@/Alice/",shouldMatch:!0},{uri:"https://domain.org/@/Alice",shouldMatch:!1}]});const Ia=/^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;var Ea=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ia);return new Yi({about:{id:"hackernews",name:"Hacker News",homepage:"https://news.ycombinator.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Ia.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,fetcher:yi,accessRestriction:ki,data:{url:`https://hacker-news.firebaseio.com/v0/user/${t[1]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Bi,relation:Di,path:["about"]}]}})},reURI:Ia,tests:[{uri:"https://news.ycombinator.com/user?id=Alice",shouldMatch:!0},{uri:"https://news.ycombinator.com/user?id=Alice/",shouldMatch:!0},{uri:"https://domain.org/user?id=Alice",shouldMatch:!1}]});const Ba=/^https:\/\/lobste\.rs\/(?:~|u\/)(.*)\/?/;var Ca=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ba);return new Yi({about:{id:"lobsters",name:"Lobsters",homepage:"https://lobste.rs"},profile:{display:t[1],uri:`https://lobste.rs/~${t[1]}`,qr:null},claim:{uriRegularExpression:Ba.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://lobste.rs/~${t[1]}.json`,fetcher:yi,accessRestriction:ki,data:{url:`https://lobste.rs/~${t[1]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["about"]}]}})},reURI:Ba,tests:[{uri:"https://lobste.rs/~Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice/",shouldMatch:!0},{uri:"https://domain.org/~Alice",shouldMatch:!1},{uri:"https://domain.org/u/Alice",shouldMatch:!1}]});const _a=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var ka=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(_a);return new Yi({about:{id:"forem",name:"Forem",homepage:"https://www.forem.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:_a.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/api/articles/${t[2]}/${t[3]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["body_markdown"]}]}})},reURI:_a,tests:[{uri:"https://domain.org/alice/post",shouldMatch:!0},{uri:"https://domain.org/alice/post/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Sa=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;const Qa={validate:async(e,t,r)=>{const n=`https://${new URL(e.proof.request.uri).hostname}/api/forgejo/v1/version`,i=await Lw({url:n,format:xi});return i&&"version"in i}};var xa=Object.freeze({__proto__:null,functions:Qa,processURI:function(e){const t=e.match(Sa);return new Yi({about:{id:"forgejo",name:"Forgejo",homepage:"https://forgejo.org"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Sa.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["description"]}]}})},reURI:Sa,tests:[{uri:"https://domain.org/alice/forgejo_proof",shouldMatch:!0},{uri:"https://domain.org/alice/forgejo_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Pa=/^https:\/\/(.*)\/(.*)\/(.*)\/?/;var Ma=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Pa);return new Yi({about:{id:"gitea",name:"Gitea",homepage:"https://about.gitea.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Pa.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/api/v1/repos/${t[2]}/${t[3]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["description"]}]}})},reURI:Pa,tests:[{uri:"https://domain.org/alice/gitea_proof",shouldMatch:!0},{uri:"https://domain.org/alice/gitea_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const Ua=/^https:\/\/(.*)\/(.*)\/gitlab_proof\/?/;var Da=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ua);return new Yi({about:{id:"gitlab",name:"GitLab",homepage:"https://about.gitlab.com"},profile:{display:`${t[2]}@${t[1]}`,uri:`https://${t[1]}/${t[2]}`,qr:null},claim:{uriRegularExpression:Ua.toString(),uriIsAmbiguous:!0},proof:{request:{fetcher:yi,accessRestriction:_i,data:{url:`https://${t[1]}/api/v4/projects/${t[2]}%2Fgitlab_proof`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Ri,path:["description"]}]}})},reURI:Ua,tests:[{uri:"https://gitlab.domain.org/alice/gitlab_proof",shouldMatch:!0},{uri:"https://gitlab.domain.org/alice/gitlab_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]});const Ra=/^https:\/\/gist\.github\.com\/(.*)\/(.*)\/?/;var Fa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ra);return new Yi({about:{id:"github",name:"GitHub",homepage:"https://github.com"},profile:{display:t[1],uri:`https://github.com/${t[1]}`,qr:null},claim:{uriRegularExpression:Ra.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:`https://api.github.com/gists/${t[2]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["files","proof.md","content"]},{format:Mi,encoding:Ei,relation:Di,path:["files","openpgp.md","content"]}]}})},reURI:Ra,tests:[{uri:"https://gist.github.com/Alice/123456789",shouldMatch:!0},{uri:"https://gist.github.com/Alice/123456789/",shouldMatch:!0},{uri:"https://domain.org/Alice/123456789",shouldMatch:!1}]});const Ta=/^https:\/\/(.*)\/?/;const qa={postprocess:async(e,t,r)=>{switch(t.result.type){case"Note":{e.profile.uri=t.result.attributedTo,e.profile.display=t.result.attributedTo;const n=await Tr({url:t.result.attributedTo},r).catch((e=>null));n&&(e.profile.display=`@${n.preferredUsername}@${new URL(e.proof.request.uri).hostname}`);break}case"Person":e.profile.display=`@${t.result.preferredUsername}@${new URL(e.proof.request.uri).hostname}`}const n=await Oa(new URL(e.proof.request.uri).hostname);return n&&(e.about.name=n.software.name,e.about.id=n.software.name,e.about.homepage=n.software.homepage),{claimData:e,proofData:t}}},Oa=async e=>{const t=await fetch(`https://${e}/.well-known/nodeinfo`).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).catch((e=>null));if(!t)return null;{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:e.software.homepage||"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/2.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.1"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}{const e=t.links.find((e=>"http://nodeinfo.diaspora.software/ns/schema/1.0"===e.rel));if(e)return await fetch(e.href).then((e=>{if(200!==e.status)throw new Error("HTTP Status was not 200");return e.json()})).then((e=>({software:{name:e.software.name,version:e.software.version,homepage:"https://activitypub.rocks"}}))).catch((e=>null))}};var Ka=Object.freeze({__proto__:null,functions:qa,processURI:function(e){return new Yi({about:{id:"activitypub",name:"ActivityPub",homepage:"https://activitypub.rocks"},profile:{display:e,uri:e,qr:null},claim:{uriRegularExpression:Ta.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:di,accessRestriction:_i,data:{url:e}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["summary"]},{format:Mi,encoding:Ei,relation:Di,path:["attachment","value"]},{format:Mi,encoding:Ei,relation:Di,path:["content"]}]}})},reURI:Ta,tests:[{uri:"https://domain.org",shouldMatch:!0},{uri:"https://domain.org/@/alice/",shouldMatch:!0},{uri:"https://domain.org/@alice",shouldMatch:!0},{uri:"https://domain.org/@alice/123456",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/",shouldMatch:!0},{uri:"https://domain.org/users/alice/123456",shouldMatch:!0},{uri:"http://domain.org/alice",shouldMatch:!1}]});const Ha=/^https:\/\/(.*)\/u\/(.*)\/?/;var Na=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Ha);return new Yi({about:{id:"discourse",name:"Discourse",homepage:"https://www.discourse.org"},profile:{display:`${t[2]}@${t[1]}`,uri:e,qr:null},claim:{uriRegularExpression:Ha.toString().toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://${t[1]}/u/${t[2]}.json`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["user","bio_raw"]}]}})},reURI:Ha,tests:[{uri:"https://domain.org/u/alice",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]});const La=/^https:\/\/(.*)/;var Ga=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(La);return new Yi({about:{id:"owncast",name:"Owncast",homepage:"https://owncast.online"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:La.toString(),uriIsAmbiguous:!0},proof:{request:{uri:`${e}/api/config`,fetcher:yi,accessRestriction:_i,data:{url:`${e}/api/config`,format:xi}},response:{format:xi},target:[{format:Ui,encoding:Ei,relation:Di,path:["socialHandles","url"]}]}})},reURI:La,tests:[{uri:"https://live.domain.org",shouldMatch:!0},{uri:"https://live.domain.org/",shouldMatch:!0},{uri:"https://domain.org/live",shouldMatch:!0},{uri:"https://domain.org/live/",shouldMatch:!0}]});const ja=/^https:\/\/(.*(?:askubuntu|mathoverflow|serverfault|stackapps|stackoverflow|superuser)|.+\.stackexchange)\.com\/users\/(\d+)/,za=/\.stackexchange$/;var Wa=Object.freeze({__proto__:null,processURI:function(e){const[,t,r]=e.match(ja),n=t.replace(za,"");return new Yi({about:{id:"stackexchange",name:"Stack Exchange",homepage:"https://stackexchange.com"},profile:{display:`${r}@${n}`,uri:e,qr:null},claim:{uriRegularExpression:ja.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://${t}.com/users/${r}?tab=profile`,fetcher:yi,accessRestriction:_i,data:{url:`https://api.stackexchange.com/2.3/users/${r}?site=${n}&filter=!AH)b5JqVyImf`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["items","about_me"]}]}})},reURI:ja,tests:[{uri:"https://stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234?tab=topactivity",shouldMatch:!0},{uri:"https://stackoverflow.com/users/1234/alice?tab=profile",shouldMatch:!0},{uri:"https://meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://pt.meta.stackoverflow.com/users/1234",shouldMatch:!0},{uri:"https://serverfault.com/users/1234",shouldMatch:!0},{uri:"https://meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://gaming.meta.stackexchange.com/users/1234",shouldMatch:!0},{uri:"https://stackexchange.com/users/1234",shouldMatch:!1},{uri:"https://domain.com/users/1234",shouldMatch:!1},{uri:"https://meta.domain.com/users/1234",shouldMatch:!1}]});const Za=/^https:\/\/keybase.io\/(.*)\/?/;var Ja=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Za);return new Yi({about:{id:"keybase",name:"keybase",homepage:"https://keybase.io"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Za.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,fetcher:yi,accessRestriction:ki,data:{url:`https://keybase.io/_/api/1.0/user/lookup.json?username=${t[1]}`,format:xi}},response:{format:xi},target:[{format:Ui,encoding:Ei,relation:Di,path:["them","public_keys","primary","key_fingerprint"]}]}})},reURI:Za,tests:[{uri:"https://keybase.io/Alice",shouldMatch:!0},{uri:"https://keybase.io/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const Va=/^https:\/\/opencollective\.com\/(.*)\/?/;var Ya=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(Va);return new Yi({about:{id:"opencollective",name:"Open Collective",homepage:"https://opencollective.com"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:Va.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:Ai,accessRestriction:ki,data:{url:"https://api.opencollective.com/graphql/v2",query:`{ "query": "query { account(slug: \\"${t[1]}\\") { longDescription } }" }`}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["data","account","longDescription"]}]}})},reURI:Va,tests:[{uri:"https://opencollective.com/Alice",shouldMatch:!0},{uri:"https://opencollective.com/Alice/",shouldMatch:!0},{uri:"https://domain.org/Alice",shouldMatch:!1}]});const $a=/^https:\/\/orcid\.org\/(.*)\/?/;var Xa=Object.freeze({__proto__:null,processURI:function(e){const t=e.match($a);return new Yi({about:{id:"orcid",name:"ORCiD",homepage:"https://orcid.org/"},profile:{display:t[1],uri:e,qr:null},claim:{uriRegularExpression:$a.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:e,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["person","biography","content"]},{format:Mi,encoding:Ei,relation:Ri,path:["person","researcher-urls","researcher-url","url","value"]},{format:Mi,encoding:Ei,relation:Ri,path:["person","keywords","keyword","content"]}]}})},reURI:$a,tests:[{uri:"https://orcid.org/0000-0000-0000-0000",shouldMatch:!0},{uri:"https://orcid.org/0000-0000-0000-0000/",shouldMatch:!0},{uri:"https://domain.org/0000-0000-0000-0000",shouldMatch:!1}]});const eo=/^https:\/\/pronouns\.cc\/@(.*)\/?/;var to=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(eo);return new Yi({about:{id:"pronounscc",name:"pronouns.cc",homepage:"https://pronouns.cc"},profile:{display:`@${t[1]}`,uri:`https://pronouns.cc/@${t[1]}`,qr:null},claim:{uriRegularExpression:eo.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:`https://pronouns.cc/api/v1/users/${t[1]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["links"]},{format:Mi,encoding:Ei,relation:Di,path:["bio"]}]}})},reURI:eo,tests:[{uri:"https://pronouns.cc/@Alice",shouldMatch:!0},{uri:"https://pronouns.cc/@Alice/",shouldMatch:!0},{uri:"https://pronouns.cc/Alice",shouldMatch:!1},{uri:"https://pronouns.cc/Alice/",shouldMatch:!1}]});const ro=/^https:\/\/(?:discord\.gg|discord\.com\/invite)\/(.+)/;var no=Object.freeze({__proto__:null,functions:{postprocess:async(e,t,r)=>(e.profile.display=t.result.inviter.username,{claimData:e,proofData:t})},processURI:function(e){const t=e.match(ro);return new Yi({about:{id:"discord",name:"Discord",homepage:"https://discord.com"},profile:{display:"Unknown username",uri:null,qr:null},claim:{uriRegularExpression:ro.toString(),uriIsAmbiguous:!1},proof:{request:{uri:`https://discord.com/api/v10/invites/${t[1]}`,fetcher:yi,accessRestriction:ki,data:{url:`https://discord.com/api/v10/invites/${t[1]}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:["guild","description"]},{format:Mi,encoding:Ei,relation:Di,path:["guild","name"]}]}})},reURI:ro,tests:[{uri:"https://discord.com/invite/AbCdEf",shouldMatch:!0},{uri:"https://discord.com/invite/AbCdEfGh",shouldMatch:!0},{uri:"https://discord.gg/AbCdEf",shouldMatch:!0},{uri:"https://discord.gg/AbCdEfGh",shouldMatch:!0},{uri:"https://domain.com/invite/AbCdEf",shouldMatch:!1},{uri:"https://domain.gg/AbCdEf",shouldMatch:!1},{uri:"https://discord.com/invite/",shouldMatch:!1},{uri:"https://discord.gg/",shouldMatch:!1}]});const io=/^https:\/\/bsky\.app\/profile\/([^/]+)(?:\/?$|\/post\/([^/]+)\/?)/;var ao=Object.freeze({__proto__:null,processURI:function(e){const t=e.match(io),r=new URLSearchParams;return t[2]?r.set("uri",`at://${t[1]}/app.bsky.feed.post/${t[2]}`):r.set("actor",t[1]),new Yi({about:{id:"bsky",name:"Bluesky",homepage:"https://bsky.app"},profile:{display:`@${t[1]}`,uri:`https://bsky.app/profile/${t[1]}`,qr:null},claim:{uriRegularExpression:io.toString(),uriIsAmbiguous:!0},proof:{request:{uri:e,fetcher:yi,accessRestriction:ki,data:{url:t[2]?`https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?${r}`:`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?${r}`,format:xi}},response:{format:xi},target:[{format:Mi,encoding:Ei,relation:Di,path:t[2]?["thread","post","record","text"]:["description"]}]}})},reURI:io,tests:[{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post/123456789/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.example.org/",shouldMatch:!0},{uri:"https://bsky.app/profile/alice.bsky.social/post",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/post/",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/alice.bsky.social/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/alice.example.org/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/profile/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/profile/post/a1b2c3d4e5/",shouldMatch:!1},{uri:"https://bsky.app/post/123456789",shouldMatch:!1},{uri:"https://bsky.app/post/a1b2c3d4e5/",shouldMatch:!1}]});const oo=/^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;const so={aspe:Xi,openpgp:na,dns:aa,irc:sa,xmpp:ua,matrix:la,telegram:da,twitter:ga,reddit:ya,liberapay:ba,lichess:va,hackernews:Ea,lobsters:Ca,forem:ka,forgejo:xa,gitea:Ma,gitlab:Da,github:Fa,activitypub:Ka,discourse:Na,owncast:Ga,stackexchange:Wa,keybase:Ja,opencollective:Ya,orcid:Xa,pronounscc:to,discord:no,bsky:ao,sourcehut:Object.freeze({__proto__:null,processURI:function(e){const[,t,r,,n]=e.match(oo);return new Yi({about:{id:"sourcehut",name:"SourceHut",homepage:"https://sourcehut.org"},profile:{display:t,uri:`https://sr.ht/~${t}`,qr:null},claim:{uriRegularExpression:oo.toString(),uriIsAmbiguous:!1},proof:{request:{uri:e,fetcher:yi,accessRestriction:_i,data:{url:`https://git.sr.ht/~${t}/${r}/blob/${n??"main"}/proof.md`,format:Pi}},response:{format:Pi},target:[{format:Mi,encoding:Ei,relation:Di,path:[]}]}})},reURI:oo,tests:[{uri:"https://git.sr.ht/~alice/sourcehut_proof",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/keyoxide_proof/",shouldMatch:!0},{uri:"https://git.sr.ht/~alice/proof_repo/tree/master",shouldMatch:!0},{uri:"https://domain.org/alice/keyoxide_proof",shouldMatch:!1}]})},co=Object.keys(so),uo="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ho=Symbol("doneWritingPromise"),lo=Symbol("doneWritingResolve"),fo=Symbol("doneWritingReject"),po=Symbol("readingIndex");class go extends Array{constructor(){super(),this[ho]=new Promise(((e,t)=>{this[lo]=e,this[fo]=t})),this[ho].catch((()=>{}))}}function Ao(e){return e&&e.getReader&&Array.isArray(e)}function yo(e){if(!Ao(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}go.prototype.getReader=function(){return void 0===this[po]&&(this[po]=0),{read:async()=>(await this[ho],this[po]===this.length?{value:void 0,done:!0}:{value:this[this[po]++],done:!1})}},go.prototype.readToEnd=async function(e){await this[ho];const t=e(this.slice(this[po]));return this.length=0,t},go.prototype.clone=function(){const e=new go;return e[ho]=this[ho].then((()=>{e.push(...this)})),e},yo.prototype.write=async function(e){this.stream.push(e)},yo.prototype.close=async function(){this.stream[lo]()},yo.prototype.abort=async function(e){return this.stream[fo](e),e},yo.prototype.releaseLock=function(){};const mo="object"==typeof uo.process&&"object"==typeof uo.process.versions,bo=mo&&void 0;function wo(e){return Ao(e)?"array":uo.ReadableStream&&uo.ReadableStream.prototype.isPrototypeOf(e)?"web":Po&&Po.prototype.isPrototypeOf(e)?"ponyfill":bo&&bo.prototype.isPrototypeOf(e)?"node":!(!e||!e.getReader)&&"web-like"}function vo(e){return Uint8Array.prototype.isPrototypeOf(e)}function Io(e){if(1===e.length)return e[0];let t=0;for(let r=0;r{t||(Eo.isBuffer(n)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),r.enqueue(n),e.pause())})),e.on("end",(()=>{t||r.close()})),e.on("error",(e=>r.error(e)))},pull(){e.resume()},cancel(r){t=!0,e.destroy(r)}})};class e extends Bo{constructor(e,t){super(t),this._reader=qo(e)}async _read(e){try{for(;;){const{done:e,value:t}=await this._reader.read();if(e){this.push(null);break}if(!this.push(t))break}}catch(e){this.destroy(e)}}async _destroy(e,t){this._reader.cancel(e).then(t,t)}}_o=function(t,r){return new e(t,r)}}const ko=new WeakSet,So=Symbol("externalBuffer");function Qo(e){if(this.stream=e,e[So]&&(this[So]=e[So].slice()),Ao(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let t=wo(e);if("node"===t&&(e=Co(e)),t){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let r=!1;this._read=async()=>r||ko.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{ko.add(e)}catch(e){}}}Qo.prototype.read=async function(){return this[So]&&this[So].length?{done:!1,value:this[So].shift()}:this._read()},Qo.prototype.releaseLock=function(){this[So]&&(this.stream[So]=this[So]),this._releaseLock()},Qo.prototype.cancel=function(e){return this._cancel(e)},Qo.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:n}=await this.read();if(n+="",r)return t.length?To(t):void 0;const i=n.indexOf("\n")+1;i&&(e=To(t.concat(n.substr(0,i))),t=[]),i!==n.length&&t.push(n.substr(i))}return this.unshift(...t),e},Qo.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(Zo(t,1)),r},Qo.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:n,value:i}=await this.read();if(n)return t.length?To(t):void 0;if(t.push(i),r+=i.length,r>=e){const r=To(t);return this.unshift(Zo(r,e)),Zo(r,0,e)}}},Qo.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},Qo.prototype.unshift=function(...e){this[So]||(this[So]=[]),1===e.length&&vo(e[0])&&this[So].length&&e[0].length&&this[So][0].byteOffset>=e[0].length?this[So][0]=new Uint8Array(this[So][0].buffer,this[So][0].byteOffset-e[0].length,this[So][0].byteLength+e[0].length):this[So].unshift(...e.filter((e=>e&&e.length)))},Qo.prototype.readToEnd=async function(e=To){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};let xo,{ReadableStream:Po,WritableStream:Mo,TransformStream:Uo}=uo;const Do=mo&&void 0;function Ro(e){let t=wo(e);return"node"===t?Co(e):"web"===t&&xo?xo(e):t?e:new Po({start(t){t.enqueue(e),t.close()}})}function Fo(e){if(wo(e))return e;const t=new go;return(async()=>{const r=Oo(t);await r.write(e),await r.close()})(),t}function To(e){return e.some((e=>wo(e)&&!Ao(e)))?function(e){e=e.map(Ro);const t=No((async function(e){await Promise.all(n.map((t=>async function(e,t){if(wo(e)){if(e.cancel)return e.cancel(t);if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}(t,e))))}));let r=Promise.resolve();const n=e.map(((n,i)=>Go(n,((n,a)=>(r=r.then((()=>Ko(n,t.writable,{preventClose:i!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>Ao(e)))?function(e){const t=new go;let r=Promise.resolve();return e.forEach(((n,i)=>(r=r.then((()=>Ko(n,t,{preventClose:i!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):Do&&Do.isBuffer(e[0])?Do.concat(e):Io(e)}function qo(e){return new Qo(e)}function Oo(e){return new yo(e)}async function Ko(e,t,{preventClose:r=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(wo(e)&&!Ao(e)){e=Ro(e);try{if(e[So]){const r=Oo(t);for(let t=0;t{t=e})),t=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function Lo(e,t=(()=>{}),r=(()=>{})){if(Ao(e)){const n=new go;return(async()=>{const i=Oo(n);try{const n=await Jo(e),a=t(n),o=r();let s;s=void 0!==a&&void 0!==o?To([a,o]):void 0!==a?a:o,await i.write(s),await i.close()}catch(e){await i.abort(e)}})(),n}if(wo(e))return Ho(e,{async transform(e,r){try{const n=await t(e);void 0!==n&&r.enqueue(n)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const n=t(e),i=r();return void 0!==n&&void 0!==i?To([n,i]):void 0!==n?n:i}function Go(e,t){if(wo(e)&&!Ao(e)){let r;const n=new Uo({start(e){r=e}}),i=Ko(e,n.writable),a=No((async function(e){r.error(e),await i,await new Promise(setTimeout)}));return t(n.readable,a.writable),a.readable}e=Fo(e);const r=new go;return t(e,r),r}function jo(e){if(Ao(e))return e.clone();if(wo(e)){const t=function(e){if(Ao(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(wo(e)){const t=Ro(e).tee();return t[0][So]=t[1][So]=e[So],t}return[Zo(e),Zo(e)]}(e);return Wo(e,t[0]),t[1]}return Zo(e)}function zo(e){return Ao(e)?jo(e):wo(e)?new Po({start(t){const r=Go(e,(async(e,r)=>{const n=qo(e),i=Oo(r);try{for(;;){await i.ready;const{done:r,value:a}=await n.read();if(r){try{t.close()}catch(e){}return void await i.close()}try{t.enqueue(a)}catch(e){}await i.write(a)}}catch(e){t.error(e),await i.abort(e)}}));Wo(e,r)}}):Zo(e)}function Wo(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,n])=>{"constructor"!==r&&(n.value?n.value=n.value.bind(t):n.get=n.get.bind(t),Object.defineProperty(e,r,n))}))}function Zo(e,t=0,r=1/0){if(Ao(e))throw Error("Not implemented");if(wo(e)){if(t>=0&&r>=0){let n=0;return Ho(e,{transform(e,i){n=t&&i.enqueue(Zo(e,Math.max(t-n,0),r-n)),n+=e.length):i.terminate()}})}if(t<0&&(r<0||r===1/0)){let n=[];return Lo(e,(e=>{e.length>=-t?n=[e]:n.push(e)}),(()=>Zo(To(n),t,r)))}if(0===t&&r<0){let n;return Lo(e,(e=>{const i=n?To([n,e]):e;if(i.length>=-r)return n=Zo(i,r),Zo(i,t,r);n=i}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),Vo((async()=>Zo(await Jo(e),t,r)))}return e[So]&&(e=To(e[So].concat([e]))),!vo(e)||Do&&Do.isBuffer(e)?e.slice(t,r):(r===1/0&&(r=e.length),e.subarray(t,r))}async function Jo(e,t=To){return Ao(e)?e.readToEnd(t):wo(e)?qo(e).readToEnd(t):e}function Vo(e){const t=new go;return(async()=>{const r=Oo(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}class Yo{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,r=Array(t.length);for(let e=0;eBigInt(0);){const e=r&BigInt(1);r>>=BigInt(1);const a=i*n%t.value;i=e?a:i,n=n*n%t.value}return new Yo(i)}modInv(e){const{gcd:t,x:r}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return r.add(e).mod(e)}_egcd(e){let t=BigInt(0),r=BigInt(1),n=BigInt(1),i=BigInt(0),a=this.value;for(e=e.value;e!==BigInt(0);){const o=a/e;let s=t;t=n-o*t,n=s,s=r,r=i-o*r,i=s,s=e,e=a%e,a=s}return{x:new Yo(n),y:new Yo(i),gcd:new Yo(a)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const r=e;e=t%e,t=r}return new Yo(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new Yo(0),t=new Yo(1),r=new Yo(-1),n=this.isNegative()?r:e;let i=1;const a=this.clone();for(;!a.irightShift(t).equal(n);)i++;return i}byteLength(){const e=new Yo(0),t=new Yo(-1),r=this.isNegative()?t:e,n=new Yo(8);let i=1;const a=this.clone();for(;!a.irightShift(n).equal(r);)i++;return i}toUint8Array(e="be",t){let r=this.value.toString(16);r.length%2==1&&(r="0"+r);const n=r.length/2,i=new Uint8Array(t||n),a=t?t-n:0;let o=0;for(;o{e[$o][r]=t}))),void 0!==e[$o][t])return e[$o][t];throw Error("Invalid enum value.")}};const es=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),ts={isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return e instanceof Array},isUint8Array:vo,isStream:wo,readNumber:function(e){let t=0;for(let r=0;r>8*(t-n-1)&255;return r},readDate:function(e){const t=ts.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return ts.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=7+(e[0]<<8|e[1])>>>3;return e.subarray(2,2+t)},leftPad(e,t){const r=new Uint8Array(t),n=t-e.length;return r.set(e,n),r},uint8ArrayToMPI:function(e){const t=ts.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),n=new Uint8Array([(65280&t)>>8,255&t]);return ts.concatUint8Array([n,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t>1);for(let r=0;r>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t=[],r=e.length;let n,i=0;for(;i{if(!ts.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;rr("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return Lo(e,r,(()=>r(new Uint8Array,!0)))},concat:To,concatUint8Array:Io,equalsUint8Array:function(e,t){if(!ts.isUint8Array(e)||!ts.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let n=0;n>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){return void 0!==uo&&uo.crypto&&uo.crypto.subtle},getBigInteger:async function(){if("undefined"!=typeof BigInt)return Yo;{const{default:e}=await Promise.resolve().then((function(){return mm}));return e}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return"undefined"!=typeof navigator?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(e){return!!ts.isString(e)&&/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(e)},canonicalizeEOL:function(e){let t=!1;return Lo(e,(e=>{let r;t&&(e=ts.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const n=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&n.push(r);if(!n.length)return e;const i=new Uint8Array(e.length+n.length);let a=0;for(let t=0;tt?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return Lo(e,(e=>{let r;13===(e=t&&10!==e[0]?ts.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let n=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const i=r-(10===e[r]?1:0);t&&e.copyWithin(n,t,i),n+=i-t}return e.subarray(0,n)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let n;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){n=e}}))),r(n)}))},selectUint8Array:function(e,t,r){const n=Math.max(t.length,r.length),i=new Uint8Array(n);let a=0;for(let n=0;n{t=ts.concatUint8Array([t,e]);const r=[],n=Math.floor(t.length/45),i=45*n,a=ns(t.subarray(0,i));for(let e=0;et.length?ns(t)+"\n":""))}function os(e){let t="";return Lo(e,(e=>{t+=e;let r=0;const n=[" ","\t","\r","\n"];for(let e=0;e0&&(i-r)%4!=0;i--)n.includes(t[i])&&r--;const a=is(t.substr(0,i));return t=t.substr(i),a}),(()=>is(t)))}function ss(e){return os(e.replace(/-/g,"+").replace(/_/g,"/"))}function cs(e,t){let r=as(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}rs?(ns=e=>rs.from(e).toString("base64"),is=e=>{const t=rs.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(ns=e=>btoa(ts.uint8ArrayToString(e)),is=e=>ts.stringToUint8Array(atob(e)));var us={preferredHashAlgorithm:Xo.hash.sha256,preferredSymmetricAlgorithm:Xo.symmetric.aes256,preferredCompressionAlgorithm:Xo.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:Xo.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([Xo.symmetric.aes128,Xo.symmetric.aes192,Xo.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([Xo.hash.md5,Xo.hash.ripemd]),rejectMessageHashAlgorithms:new Set([Xo.hash.md5,Xo.hash.ripemd,Xo.hash.sha1]),rejectPublicKeyAlgorithms:new Set([Xo.publicKey.elgamal,Xo.publicKey.dsa]),rejectCurves:new Set([Xo.curve.secp256k1])};function hs(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?Xo.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?Xo.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?Xo.armor.signed:/MESSAGE/.test(t[1])?Xo.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?Xo.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?Xo.armor.privateKey:/SIGNATURE/.test(t[1])?Xo.armor.signature:void 0}function ls(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function fs(e){return as(function(e){let t=13501623;return Lo(e,(e=>{const r=ps?Math.floor(e.length/4):0,n=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e>24&255]^ds[1][t>>16&255]^ds[2][t>>8&255]^ds[3][t>>0&255];for(let n=4*r;n>8^ds[0][255&t^e[n]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e))}const ds=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);ds[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)ds[1][e]=ds[0][e]>>8^ds[0][255&ds[0][e]];for(let e=0;e<=255;e++)ds[2][e]=ds[1][e]>>8^ds[0][255&ds[1][e]];for(let e=0;e<=255;e++)ds[3][e]=ds[2][e]>>8^ds[0][255&ds[2][e]];const ps=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function gs(e){for(let t=0;t=0&&n!==e.length-1&&(t=e.slice(0,n),r=e.slice(n+1).substr(0,4)),{body:t,checksum:r}}function ys(e,t=us){return new Promise((async(r,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let o;const s=[];let c,u,h,l=s,f=[],d=os(Go(e,(async(e,t)=>{const p=qo(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=ts.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),o)if(c)u||2!==o||(i.test(e)?(f=f.join("\r\n"),u=!0,gs(l),l=[],c=!1):f.push(e.replace(/^- /,"")));else if(i.test(e)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(e)){if(gs(l),c=!0,u||2!==o){r({text:f,data:d,headers:s,type:o});break}}else l.push(e);else i.test(e)&&(o=hs(e))}}catch(e){return void n(e)}const g=Oo(t);try{for(;;){await g.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=ts.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(i);if(1===t.length)throw Error("Misformed armored text");const n=As(t[0].slice(0,-1));h=n.checksum,await g.write(n.body);break}await g.write(r)}await g.ready,await g.close()}catch(e){await g.abort(e)}})));d=Go(d,(async(e,r)=>{const n=Jo(fs(zo(e)));n.catch((()=>{})),await Ko(e,r,{preventClose:!0});const i=Oo(r);try{const e=(await n).replace("\n","");if(h!==e&&(h||t.checksumRequired))throw Error("Ascii armor integrity check failed");await i.ready,await i.close()}catch(e){await i.abort(e)}}))}catch(e){n(e)}})).then((async e=>(Ao(e.data)&&(e.data=await Jo(e.data)),e)))}function ms(e,t,r,n,i,a=us){let o,s;e===Xo.armor.signed&&(o=t.text,s=t.hash,t=t.data);const c=zo(t),u=[];switch(e){case Xo.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+n+"-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP MESSAGE, PART "+r+"/"+n+"-----\n");break;case Xo.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case Xo.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push("Hash: "+s+"\n\n"),u.push(o.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP SIGNATURE-----\n");break;case Xo.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP MESSAGE-----\n");break;case Xo.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case Xo.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case Xo.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(ls(i,a)),u.push(as(t)),u.push("=",fs(c)),u.push("-----END PGP SIGNATURE-----\n")}return ts.concat(u)}class bs{constructor(){this.bytes=""}read(e){return this.bytes=ts.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return ts.stringToUint8Array(this.bytes)}toHex(){return ts.uint8ArrayToHex(ts.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new bs;return t.read(ts.hexToUint8Array(e)),t}static wildcard(){const e=new bs;return e.read(new Uint8Array(8)),e}}var ws=function(){var e,t,r=!1;function n(r,n){var i=e[(t[r]+t[n])%255];return 0!==r&&0!==n||(i=0),i}var i,a,o,s,c=!1;function u(){function u(r){var n,i,a;for(i=a=function(r){var n=e[255-t[r]];return 0===r&&(n=0),n}(r),n=0;n<4;n++)a^=i=255&(i<<1|i>>>7);return 99^a}r||function(){e=[],t=[];var n,i,a=1;for(n=0;n<255;n++)e[n]=a,i=128&a,a<<=1,a&=255,128===i&&(a^=27),a^=e[n],t[e[n]]=n;e[255]=e[0],t[0]=0,r=!0}(),i=[],a=[],o=[[],[],[],[]],s=[[],[],[],[]];for(var h=0;h<256;h++){var l=u(h);i[h]=l,a[l]=h,o[0][h]=n(2,l)<<24|l<<16|l<<8|n(3,l),s[0][l]=n(14,h)<<24|n(9,h)<<16|n(13,h)<<8|n(11,h);for(var f=1;f<4;f++)o[f][h]=o[f-1][h]>>>8|o[f-1][h]<<24,s[f][l]=s[f-1][l]>>>8|s[f-1][l]<<24}c=!0}var h=function(e,t){c||u();var r=new Uint32Array(t);r.set(i,512),r.set(a,768);for(var n=0;n<4;n++)r.set(o[n],4096+1024*n>>2),r.set(s[n],8192+1024*n>>2);var h=function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0;var B=new e.Uint32Array(r),C=new e.Uint8Array(r);function _(e,t,r,s,c,u,h,l){e=e|0;t=t|0;r=r|0;s=s|0;c=c|0;u=u|0;h=h|0;l=l|0;var f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;f=r|0x400,d=r|0x800,p=r|0xc00;c=c^B[(e|0)>>2],u=u^B[(e|4)>>2],h=h^B[(e|8)>>2],l=l^B[(e|12)>>2];for(b=16;(b|0)<=s<<4;b=b+16|0){g=B[(r|c>>22&1020)>>2]^B[(f|u>>14&1020)>>2]^B[(d|h>>6&1020)>>2]^B[(p|l<<2&1020)>>2]^B[(e|b|0)>>2],A=B[(r|u>>22&1020)>>2]^B[(f|h>>14&1020)>>2]^B[(d|l>>6&1020)>>2]^B[(p|c<<2&1020)>>2]^B[(e|b|4)>>2],y=B[(r|h>>22&1020)>>2]^B[(f|l>>14&1020)>>2]^B[(d|c>>6&1020)>>2]^B[(p|u<<2&1020)>>2]^B[(e|b|8)>>2],m=B[(r|l>>22&1020)>>2]^B[(f|c>>14&1020)>>2]^B[(d|u>>6&1020)>>2]^B[(p|h<<2&1020)>>2]^B[(e|b|12)>>2];c=g,u=A,h=y,l=m}n=B[(t|c>>22&1020)>>2]<<24^B[(t|u>>14&1020)>>2]<<16^B[(t|h>>6&1020)>>2]<<8^B[(t|l<<2&1020)>>2]^B[(e|b|0)>>2],i=B[(t|u>>22&1020)>>2]<<24^B[(t|h>>14&1020)>>2]<<16^B[(t|l>>6&1020)>>2]<<8^B[(t|c<<2&1020)>>2]^B[(e|b|4)>>2],a=B[(t|h>>22&1020)>>2]<<24^B[(t|l>>14&1020)>>2]<<16^B[(t|c>>6&1020)>>2]<<8^B[(t|u<<2&1020)>>2]^B[(e|b|8)>>2],o=B[(t|l>>22&1020)>>2]<<24^B[(t|c>>14&1020)>>2]<<16^B[(t|u>>6&1020)>>2]<<8^B[(t|h<<2&1020)>>2]^B[(e|b|12)>>2]}function k(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;_(0x0000,0x0800,0x1000,E,e,t,r,n)}function S(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0;_(0x0400,0x0c00,0x2000,E,e,n,r,t);a=i,i=o,o=a}function Q(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s^e,c^t,u^r,h^l);s=n,c=i,u=a,h=o}function x(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;var f=0;_(0x0400,0x0c00,0x2000,E,e,l,r,t);f=i,i=o,o=f;n=n^s,i=i^c,a=a^u,o=o^h;s=e,c=t,u=r,h=l}function P(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n=n^e,c=i=i^t,u=a=a^r,h=o=o^l}function M(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);n=n^e,i=i^t,a=a^r,o=o^l;s=e,c=t,u=r,h=l}function U(e,t,r,l){e=e|0;t=t|0;r=r|0;l=l|0;_(0x0000,0x0800,0x1000,E,s,c,u,h);s=n,c=i,u=a,h=o;n=n^e,i=i^t,a=a^r,o=o^l}function D(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;_(0x0000,0x0800,0x1000,E,l,f,d,p);p=~m&p|m&p+1;d=~y&d|y&d+((p|0)==0);f=~A&f|A&f+((d|0)==0);l=~g&l|g&l+((f|0)==0);n=n^e;i=i^t;a=a^r;o=o^s}function R(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0,o=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0;e=e^s,t=t^c,r=r^u,n=n^h;i=b|0,a=w|0,o=v|0,l=I|0;for(;(A|0)<128;A=A+1|0){if(i>>>31){f=f^e,d=d^t,p=p^r,g=g^n}i=i<<1|a>>>31,a=a<<1|o>>>31,o=o<<1|l>>>31,l=l<<1;y=n&1;n=n>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(y)e=e^0xe1000000}s=f,c=d,u=p,h=g}function F(e){e=e|0;E=e}function T(e,t,r,s){e=e|0;t=t|0;r=r|0;s=s|0;n=e,i=t,a=r,o=s}function q(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;s=e,c=t,u=r,h=n}function O(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;l=e,f=t,d=r,p=n}function K(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;g=e,A=t,y=r,m=n}function H(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;p=~m&p|m&n,d=~y&d|y&r,f=~A&f|A&t,l=~g&l|g&e}function N(e){e=e|0;if(e&15)return-1;C[e|0]=n>>>24,C[e|1]=n>>>16&255,C[e|2]=n>>>8&255,C[e|3]=n&255,C[e|4]=i>>>24,C[e|5]=i>>>16&255,C[e|6]=i>>>8&255,C[e|7]=i&255,C[e|8]=a>>>24,C[e|9]=a>>>16&255,C[e|10]=a>>>8&255,C[e|11]=a&255,C[e|12]=o>>>24,C[e|13]=o>>>16&255,C[e|14]=o>>>8&255,C[e|15]=o&255;return 16}function L(e){e=e|0;if(e&15)return-1;C[e|0]=s>>>24,C[e|1]=s>>>16&255,C[e|2]=s>>>8&255,C[e|3]=s&255,C[e|4]=c>>>24,C[e|5]=c>>>16&255,C[e|6]=c>>>8&255,C[e|7]=c&255,C[e|8]=u>>>24,C[e|9]=u>>>16&255,C[e|10]=u>>>8&255,C[e|11]=u&255,C[e|12]=h>>>24,C[e|13]=h>>>16&255,C[e|14]=h>>>8&255,C[e|15]=h&255;return 16}function G(){k(0,0,0,0);b=n,w=i,v=a,I=o}function j(e,t,r){e=e|0;t=t|0;r=r|0;var s=0;if(t&15)return-1;while((r|0)>=16){W[e&7](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);C[t|0]=n>>>24,C[t|1]=n>>>16&255,C[t|2]=n>>>8&255,C[t|3]=n&255,C[t|4]=i>>>24,C[t|5]=i>>>16&255,C[t|6]=i>>>8&255,C[t|7]=i&255,C[t|8]=a>>>24,C[t|9]=a>>>16&255,C[t|10]=a>>>8&255,C[t|11]=a&255,C[t|12]=o>>>24,C[t|13]=o>>>16&255,C[t|14]=o>>>8&255,C[t|15]=o&255;s=s+16|0,t=t+16|0,r=r-16|0}return s|0}function z(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){Z[e&1](C[t|0]<<24|C[t|1]<<16|C[t|2]<<8|C[t|3],C[t|4]<<24|C[t|5]<<16|C[t|6]<<8|C[t|7],C[t|8]<<24|C[t|9]<<16|C[t|10]<<8|C[t|11],C[t|12]<<24|C[t|13]<<16|C[t|14]<<8|C[t|15]);n=n+16|0,t=t+16|0,r=r-16|0}return n|0}var W=[k,S,Q,x,P,M,U,D];var Z=[Q,R];return{set_rounds:F,set_state:T,set_iv:q,set_nonce:O,set_mask:K,set_counter:H,get_state:N,get_iv:L,gcm_init:G,cipher:j,mac:z}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},e,t);return h.set_key=function(e,t,n,a,o,c,u,l,f){var d=r.subarray(0,60),p=r.subarray(256,316);d.set([t,n,a,o,c,u,l,f]);for(var g=e,A=1;g<4*e+28;g++){var y=d[g-1];(g%e==0||8===e&&g%e==4)&&(y=i[y>>>24]<<24^i[y>>>16&255]<<16^i[y>>>8&255]<<8^i[255&y]),g%e==0&&(y=y<<8^y>>>24^A<<24,A=A<<1^(128&A?27:0)),d[g]=d[g-e]^y}for(var m=0;m=g-4?y:s[0][i[y>>>24]]^s[1][i[y>>>16&255]]^s[2][i[y>>>8&255]]^s[3][i[255&y]];h.set_rounds(e+5)},h};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function vs(e){return e instanceof Uint8Array}function Is(e,t){const r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return e||new Uint8Array(new ArrayBuffer(r))}function Es(e,t,r,n,i){const a=e.length-t,o=ae+t.length),0),r=new Uint8Array(t);let n=0;for(let t=0;t>2,i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12),n>16?i.getUint32(16):0,n>16?i.getUint32(20):0,n>24?i.getUint32(24):0,n>24?i.getUint32(28):0),void 0!==t){if(16!==t.length)throw new _s("illegal iv size");let e=new DataView(t.buffer,t.byteOffset,t.byteLength);r.set_iv(e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12))}else r.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!vs(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),n=ws.ENC[this.mode],i=ws.HEAP_DATA,a=this.pos,o=this.len,s=0,c=e.length||0,u=0,h=0,l=new Uint8Array(o+c&-16);for(;c>0;)h=Es(t,a+o,e,s,c),o+=h,s+=h,c-=h,h=r.cipher(n,i+a,o),h&&l.set(t.subarray(a,a+h),u),u+=h,h0;)f=Es(t,a+o,e,s,c),o+=f,s+=f,c-=f,f=r.cipher(n,i+a,o-(c?0:l)),f&&d.set(t.subarray(a,a+f),u),u+=f,f0){if(a%16){if(this.hasOwnProperty("padding"))throw new _s("data length must be a multiple of the block size");a+=16-a%16}if(t.cipher(r,n+i,a),this.hasOwnProperty("padding")&&this.padding){let t=e[i+o-1];if(t<1||t>16||t>o)throw new ks("bad padding");let r=0;for(let n=t;n>1;n--)r|=t^e[i+o-n];if(r)throw new ks("bad padding");o-=t}}const s=new Uint8Array(o);return o>0&&s.set(e.subarray(i,i+o)),this.pos=0,this.len=0,this.release_asm(),s}}class Ps{static encrypt(e,t,r=!1){return new Ps(t,r).encrypt(e)}static decrypt(e,t,r=!1){return new Ps(t,r).decrypt(e)}constructor(e,t=!1,r){this.aes=r||new xs(e,void 0,t,"ECB")}encrypt(e){return Bs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Bs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Ms(e){const t=function(e){const t=new Ps(e);this.encrypt=function(e){return t.encrypt(e)},this.decrypt=function(e){return t.decrypt(e)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=e/8,t}function Us(e,t,r,n,i,a){const o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],c=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let p,g,A,y,m,b,w,v,I,E,B,C,_,k,S=0,Q=t.length;const x=32===e.length?3:9;v=3===x?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(e,t){const r=8-e.length%8;let n;if(2===t&&r<8)n=32;else if(1===t)n=r;else{if(t||!(r<8)){if(8===r)return e;throw Error("des: invalid padding")}n=0}const i=new Uint8Array(e.length+r);for(let t=0;t>>4^w),w^=A,b^=A<<4,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,b=b<<1|b>>>31,w=w<<1|w>>>31,g=0;g>>4|w<<28)^e[p+1],A=b,b=w,w=A^(s[y>>>24&63]|u[y>>>16&63]|l[y>>>8&63]|d[63&y]|o[m>>>24&63]|c[m>>>16&63]|h[m>>>8&63]|f[63&m]);A=b,b=w,w=A}b=b>>>1|b<<31,w=w>>>1|w<<31,A=1431655765&(b>>>1^w),w^=A,b^=A<<1,A=16711935&(w>>>8^b),b^=A,w^=A<<8,A=858993459&(w>>>2^b),b^=A,w^=A<<2,A=65535&(b>>>16^w),w^=A,b^=A<<16,A=252645135&(b>>>4^w),w^=A,b^=A<<4,1===n&&(r?(I=b,B=w):(b^=E,w^=C)),P[M++]=b>>>24,P[M++]=b>>>16&255,P[M++]=b>>>8&255,P[M++]=255&b,P[M++]=w>>>24,P[M++]=w>>>16&255,P[M++]=w>>>8&255,P[M++]=255&w}return r||(P=function(e,t){let r,n=null;if(2===t)r=32;else if(1===t)n=e[e.length-1];else{if(t)throw Error("des: invalid padding");r=0}if(!n){for(n=1;e[e.length-n]===r;)n++;n--}return e.subarray(0,e.length-n)}(P,a)),P}function Ds(e){const t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],p=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length>8?3:1,A=Array(32*g),y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let m,b,w,v=0,I=0;for(let E=0;E>>4^E),E^=w,g^=w<<4,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=858993459&(g>>>2^E),E^=w,g^=w<<2,w=65535&(E>>>-16^g),g^=w,E^=w<<-16,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=16711935&(E>>>8^g),g^=w,E^=w<<8,w=1431655765&(g>>>1^E),E^=w,g^=w<<1,w=g<<8|E>>>20&240,g=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=w;for(let e=0;e<16;e++)y[e]?(g=g<<2|g>>>26,E=E<<2|E>>>26):(g=g<<1|g>>>27,E=E<<1|E>>>27),g&=-15,E&=-15,m=t[g>>>28]|r[g>>>24&15]|n[g>>>20&15]|i[g>>>16&15]|a[g>>>12&15]|o[g>>>8&15]|s[g>>>4&15],b=c[E>>>28]|u[E>>>24&15]|h[E>>>20&15]|l[E>>>16&15]|f[E>>>12&15]|d[E>>>8&15]|p[E>>>4&15],w=65535&(b>>>16^m),A[I++]=m^w,A[I++]=b^w<<16}return A}function Rs(e){this.key=[];for(let t=0;t<3;t++)this.key.push(new Uint8Array(e.subarray(8*t,8*t+8)));this.encrypt=function(e){return Us(Ds(this.key[2]),Us(Ds(this.key[1]),Us(Ds(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Fs(){this.BlockSize=8,this.KeySize=16,this.setKey=function(e){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),e.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(e),!0},this.reset=function(){for(let e=0;e<16;e++)this.masking[e]=0,this.rotate[e]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>>16&255,t[a+6]=s>>>8&255,t[a+7]=255&s}return t},this.decrypt=function(e){const t=Array(e.length);for(let a=0;a>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=s>>>24&255,t[a+5]=s>>16&255,t[a+6]=s>>8&255,t[a+7]=255&s}return t};const e=[,,,,];e[0]=[,,,,],e[0][0]=[4,0,13,15,12,14,8],e[0][1]=[5,2,16,18,17,19,10],e[0][2]=[6,3,23,22,21,20,9],e[0][3]=[7,1,26,25,27,24,11],e[1]=[,,,,],e[1][0]=[0,6,21,23,20,22,16],e[1][1]=[1,4,0,2,1,3,18],e[1][2]=[2,5,7,6,5,4,17],e[1][3]=[3,7,10,9,11,8,19],e[2]=[,,,,],e[2][0]=[4,0,13,15,12,14,8],e[2][1]=[5,2,16,18,17,19,10],e[2][2]=[6,3,23,22,21,20,9],e[2][3]=[7,1,26,25,27,24,11],e[3]=[,,,,],e[3][0]=[0,6,21,23,20,22,16],e[3][1]=[1,4,0,2,1,3,18],e[3][2]=[2,5,7,6,5,4,17],e[3][3]=[3,7,10,9,11,8,19];const t=[,,,,];function r(e,t,r){const n=t+e,i=n<>>32-r;return(a[0][i>>>24]^a[1][i>>>16&255])-a[2][i>>>8&255]+a[3][255&i]}function n(e,t,r){const n=t^e,i=n<>>32-r;return a[0][i>>>24]-a[1][i>>>16&255]+a[2][i>>>8&255]^a[3][255&i]}function i(e,t,r){const n=t-e,i=n<>>32-r;return(a[0][i>>>24]+a[1][i>>>16&255]^a[2][i>>>8&255])-a[3][255&i]}t[0]=[,,,,],t[0][0]=[24,25,23,22,18],t[0][1]=[26,27,21,20,22],t[0][2]=[28,29,19,18,25],t[0][3]=[30,31,17,16,28],t[1]=[,,,,],t[1][0]=[3,2,12,13,8],t[1][1]=[1,0,14,15,13],t[1][2]=[7,6,8,9,3],t[1][3]=[5,4,10,11,7],t[2]=[,,,,],t[2][0]=[19,18,28,29,25],t[2][1]=[17,16,30,31,28],t[2][2]=[23,22,24,25,18],t[2][3]=[21,20,26,27,22],t[3]=[,,,,],t[3][0]=[8,9,7,6,3],t[3][1]=[10,11,5,4,7],t[3][2]=[12,13,3,2,8],t[3][3]=[14,15,1,0,13],this.keySchedule=function(r){const n=[,,,,,,,,],i=Array(32);let o;for(let e=0;e<4;e++)o=4*e,n[e]=r[o]<<24|r[o+1]<<16|r[o+2]<<8|r[o+3];const s=[6,7,4,5];let c,u=0;for(let r=0;r<2;r++)for(let r=0;r<4;r++){for(o=0;o<4;o++){const t=e[r][o];c=n[t[1]],c^=a[4][n[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=a[5][n[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=a[6][n[t[4]>>>2]>>>24-8*(3&t[4])&255],c^=a[7][n[t[5]>>>2]>>>24-8*(3&t[5])&255],c^=a[s[o]][n[t[6]>>>2]>>>24-8*(3&t[6])&255],n[t[0]]=c}for(o=0;o<4;o++){const e=t[r][o];c=a[4][n[e[0]>>>2]>>>24-8*(3&e[0])&255],c^=a[5][n[e[1]>>>2]>>>24-8*(3&e[1])&255],c^=a[6][n[e[2]>>>2]>>>24-8*(3&e[2])&255],c^=a[7][n[e[3]>>>2]>>>24-8*(3&e[3])&255],c^=a[4+o][n[e[4]>>>2]>>>24-8*(3&e[4])&255],i[u]=c,u++}}for(let e=0;e<16;e++)this.masking[e]=i[e],this.rotate[e]=31&i[16+e]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Ts(e){this.cast5=new Fs,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Rs.keySize=Rs.prototype.keySize=24,Rs.blockSize=Rs.prototype.blockSize=8,Ts.blockSize=Ts.prototype.blockSize=8,Ts.keySize=Ts.prototype.keySize=16;const qs=4294967295;function Os(e,t){return(e<>>32-t)&qs}function Ks(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Hs(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function Ns(e,t){return e>>>8*t&255}function Ls(e){this.tf=function(){let e=null,t=null,r=-1,n=[],i=[[],[],[],[]];function a(e){return i[0][Ns(e,0)]^i[1][Ns(e,1)]^i[2][Ns(e,2)]^i[3][Ns(e,3)]}function o(e){return i[0][Ns(e,3)]^i[1][Ns(e,0)]^i[2][Ns(e,1)]^i[3][Ns(e,2)]}function s(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Os(t[2]^r+i+n[4*e+8]&qs,31),t[3]=Os(t[3],1)^r+2*i+n[4*e+9]&qs,r=a(t[2]),i=o(t[3]),t[0]=Os(t[0]^r+i+n[4*e+10]&qs,31),t[1]=Os(t[1],1)^r+2*i+n[4*e+11]&qs}function c(e,t){let r=a(t[0]),i=o(t[1]);t[2]=Os(t[2],1)^r+i+n[4*e+10]&qs,t[3]=Os(t[3]^r+2*i+n[4*e+11]&qs,31),r=a(t[2]),i=o(t[3]),t[0]=Os(t[0],1)^r+i+n[4*e+8]&qs,t[1]=Os(t[1]^r+2*i+n[4*e+9]&qs,31)}return{name:"twofish",blocksize:16,open:function(t){let r,a,o,s,c;e=t;const u=[],h=[],l=[];let f;const d=[];let p,g,A;const y=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],m=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],b=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],w=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],v=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],I=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],E=[[],[]],B=[[],[],[],[]];function C(e){return e^e>>2^[0,90,180,238][3&e]}function _(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function k(e,t){let r,n,i;for(r=0;r<8;r++)n=t>>>24,t=t<<8&qs|e>>>24,e=e<<8&qs,i=n<<1,128&n&&(i^=333),t^=n^i<<16,i^=n>>>1,1&n&&(i^=166),t^=i<<24|i<<8;return t}function S(e,t){const r=t>>4,n=15&t,i=y[e][r^n],a=m[e][v[n]^I[r]];return w[e][v[a]^I[i]]<<4|b[e][i^a]}function Q(e,t){let r=Ns(e,0),n=Ns(e,1),i=Ns(e,2),a=Ns(e,3);switch(f){case 4:r=E[1][r]^Ns(t[3],0),n=E[0][n]^Ns(t[3],1),i=E[0][i]^Ns(t[3],2),a=E[1][a]^Ns(t[3],3);case 3:r=E[1][r]^Ns(t[2],0),n=E[1][n]^Ns(t[2],1),i=E[0][i]^Ns(t[2],2),a=E[0][a]^Ns(t[2],3);case 2:r=E[0][E[0][r]^Ns(t[1],0)]^Ns(t[0],0),n=E[0][E[1][n]^Ns(t[1],1)]^Ns(t[0],1),i=E[1][E[0][i]^Ns(t[1],2)]^Ns(t[0],2),a=E[1][E[1][a]^Ns(t[1],3)]^Ns(t[0],3)}return B[0][r]^B[1][n]^B[2][i]^B[3][a]}for(e=e.slice(0,32),r=e.length;16!==r&&24!==r&&32!==r;)e[r++]=0;for(r=0;r>2]=Ks(e,r);for(r=0;r<256;r++)E[0][r]=S(0,r),E[1][r]=S(1,r);for(r=0;r<256;r++)p=E[1][r],g=C(p),A=_(p),B[0][r]=p+(g<<8)+(A<<16)+(A<<24),B[2][r]=g+(A<<8)+(p<<16)+(A<<24),p=E[0][r],g=C(p),A=_(p),B[1][r]=A+(A<<8)+(g<<16)+(p<<24),B[3][r]=g+(p<<8)+(A<<16)+(g<<24);for(f=l.length/2,r=0;r=0;e--)c(e,a);Hs(t,r,a[2]^n[0]),Hs(t,r+4,a[3]^n[1]),Hs(t,r+8,a[0]^n[2]),Hs(t,r+12,a[1]^n[3]),r+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Gs(){}function js(e){this.bf=new Gs,this.bf.init(e),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Ls.keySize=Ls.prototype.keySize=32,Ls.blockSize=Ls.prototype.blockSize=16,Gs.prototype.BLOCKSIZE=8,Gs.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Gs.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Gs.prototype.NN=16,Gs.prototype._clean=function(e){return e<0&&(e=2147483648+(2147483647&e)),e},Gs.prototype._F=function(e){let t;const r=255&e,n=255&(e>>>=8),i=255&(e>>>=8),a=255&(e>>>=8);return t=this.sboxes[0][a]+this.sboxes[1][i],t^=this.sboxes[2][n],t+=this.sboxes[3][r],t},Gs.prototype._encryptBlock=function(e){let t,r=e[0],n=e[1];for(t=0;t>>24-8*t&255,i[t+n]=r[1]>>>24-8*t&255;return i},Gs.prototype._decryptBlock=function(e){let t,r=e[0],n=e[1];for(t=this.NN+1;t>1;--t){r^=this.parray[t],n=this._F(r)^n;const e=r;r=n,n=e}r^=this.parray[1],n^=this.parray[0],e[0]=this._clean(n),e[1]=this._clean(r)},Gs.prototype.init=function(e){let t,r=0;for(this.parray=[],t=0;t=e.length&&(r=0);this.parray[t]=this.PARRAY[t]^n}for(this.sboxes=[],t=0;t<4;++t)for(this.sboxes[t]=[],r=0;r<256;++r)this.sboxes[t][r]=this.SBOXES[t][r];const n=[0,0];for(t=0;t>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=t+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=r+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=c+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=u+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=h+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=l+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=f+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=d+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=p+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=g+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=A+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=y+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=m+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=b+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;k=w+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=m^d^r^e;S=_<<1|_>>>31;k=S+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=b^p^c^t;Q=_<<1|_>>>31;k=Q+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=w^g^u^r;x=_<<1|_>>>31;k=x+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=S^A^h^c;P=_<<1|_>>>31;k=P+(v<<5|v>>>27)+C+(I&E|~I&B)+0x5a827999|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Q^y^l^u;M=_<<1|_>>>31;k=M+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=x^m^f^h;U=_<<1|_>>>31;k=U+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=P^b^d^l;D=_<<1|_>>>31;k=D+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=M^w^p^f;R=_<<1|_>>>31;k=R+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=U^S^g^d;F=_<<1|_>>>31;k=F+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=D^Q^A^p;T=_<<1|_>>>31;k=T+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=R^x^y^g;q=_<<1|_>>>31;k=q+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=F^P^m^A;O=_<<1|_>>>31;k=O+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=T^M^b^y;K=_<<1|_>>>31;k=K+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=q^U^w^m;H=_<<1|_>>>31;k=H+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=O^D^S^b;N=_<<1|_>>>31;k=N+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=K^R^Q^w;L=_<<1|_>>>31;k=L+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=H^F^x^S;G=_<<1|_>>>31;k=G+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=N^T^P^Q;j=_<<1|_>>>31;k=j+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=L^q^M^x;z=_<<1|_>>>31;k=z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=G^O^U^P;W=_<<1|_>>>31;k=W+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=j^K^D^M;Z=_<<1|_>>>31;k=Z+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=z^H^R^U;J=_<<1|_>>>31;k=J+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=W^N^F^D;V=_<<1|_>>>31;k=V+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Z^L^T^R;Y=_<<1|_>>>31;k=Y+(v<<5|v>>>27)+C+(I^E^B)+0x6ed9eba1|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=J^G^q^F;$=_<<1|_>>>31;k=$+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=V^j^O^T;X=_<<1|_>>>31;k=X+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Y^z^K^q;ee=_<<1|_>>>31;k=ee+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=$^W^H^O;te=_<<1|_>>>31;k=te+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=X^Z^N^K;re=_<<1|_>>>31;k=re+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ee^J^L^H;ne=_<<1|_>>>31;k=ne+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=te^V^G^N;ie=_<<1|_>>>31;k=ie+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=re^Y^j^L;ae=_<<1|_>>>31;k=ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ne^$^z^G;oe=_<<1|_>>>31;k=oe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ie^X^W^j;se=_<<1|_>>>31;k=se+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ae^ee^Z^z;ce=_<<1|_>>>31;k=ce+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=oe^te^J^W;ue=_<<1|_>>>31;k=ue+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=se^re^V^Z;he=_<<1|_>>>31;k=he+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ce^ne^Y^J;le=_<<1|_>>>31;k=le+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ue^ie^$^V;fe=_<<1|_>>>31;k=fe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=he^ae^X^Y;de=_<<1|_>>>31;k=de+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=le^oe^ee^$;pe=_<<1|_>>>31;k=pe+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=fe^se^te^X;ge=_<<1|_>>>31;k=ge+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=de^ce^re^ee;Ae=_<<1|_>>>31;k=Ae+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=pe^ue^ne^te;ye=_<<1|_>>>31;k=ye+(v<<5|v>>>27)+C+(I&E|I&B|E&B)-0x70e44324|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ge^he^ie^re;me=_<<1|_>>>31;k=me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ae^le^ae^ne;be=_<<1|_>>>31;k=be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ye^fe^oe^ie;we=_<<1|_>>>31;k=we+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=me^de^se^ae;ve=_<<1|_>>>31;k=ve+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=be^pe^ce^oe;Ie=_<<1|_>>>31;k=Ie+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=we^ge^ue^se;Ee=_<<1|_>>>31;k=Ee+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ve^Ae^he^ce;Be=_<<1|_>>>31;k=Be+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ie^ye^le^ue;Ce=_<<1|_>>>31;k=Ce+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ee^me^fe^he;_e=_<<1|_>>>31;k=_e+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Be^be^de^le;ke=_<<1|_>>>31;k=ke+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ce^we^pe^fe;Se=_<<1|_>>>31;k=Se+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=_e^ve^ge^de;Qe=_<<1|_>>>31;k=Qe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=ke^Ie^Ae^pe;xe=_<<1|_>>>31;k=xe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Se^Ee^ye^ge;Pe=_<<1|_>>>31;k=Pe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Qe^Be^me^Ae;Me=_<<1|_>>>31;k=Me+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=xe^Ce^be^ye;Ue=_<<1|_>>>31;k=Ue+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Pe^_e^we^me;De=_<<1|_>>>31;k=De+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Me^ke^ve^be;Re=_<<1|_>>>31;k=Re+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=Ue^Se^Ie^we;Fe=_<<1|_>>>31;k=Fe+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;_=De^Qe^Ee^ve;Te=_<<1|_>>>31;k=Te+(v<<5|v>>>27)+C+(I^E^B)-0x359d3e2a|0;C=B;B=E;E=I<<30|I>>>2;I=v;v=k;n=n+v|0;i=i+I|0;a=a+E|0;o=o+B|0;s=s+C|0}function I(e){e=e|0;v(w[e|0]<<24|w[e|1]<<16|w[e|2]<<8|w[e|3],w[e|4]<<24|w[e|5]<<16|w[e|6]<<8|w[e|7],w[e|8]<<24|w[e|9]<<16|w[e|10]<<8|w[e|11],w[e|12]<<24|w[e|13]<<16|w[e|14]<<8|w[e|15],w[e|16]<<24|w[e|17]<<16|w[e|18]<<8|w[e|19],w[e|20]<<24|w[e|21]<<16|w[e|22]<<8|w[e|23],w[e|24]<<24|w[e|25]<<16|w[e|26]<<8|w[e|27],w[e|28]<<24|w[e|29]<<16|w[e|30]<<8|w[e|31],w[e|32]<<24|w[e|33]<<16|w[e|34]<<8|w[e|35],w[e|36]<<24|w[e|37]<<16|w[e|38]<<8|w[e|39],w[e|40]<<24|w[e|41]<<16|w[e|42]<<8|w[e|43],w[e|44]<<24|w[e|45]<<16|w[e|46]<<8|w[e|47],w[e|48]<<24|w[e|49]<<16|w[e|50]<<8|w[e|51],w[e|52]<<24|w[e|53]<<16|w[e|54]<<8|w[e|55],w[e|56]<<24|w[e|57]<<16|w[e|58]<<8|w[e|59],w[e|60]<<24|w[e|61]<<16|w[e|62]<<8|w[e|63])}function E(e){e=e|0;w[e|0]=n>>>24;w[e|1]=n>>>16&255;w[e|2]=n>>>8&255;w[e|3]=n&255;w[e|4]=i>>>24;w[e|5]=i>>>16&255;w[e|6]=i>>>8&255;w[e|7]=i&255;w[e|8]=a>>>24;w[e|9]=a>>>16&255;w[e|10]=a>>>8&255;w[e|11]=a&255;w[e|12]=o>>>24;w[e|13]=o>>>16&255;w[e|14]=o>>>8&255;w[e|15]=o&255;w[e|16]=s>>>24;w[e|17]=s>>>16&255;w[e|18]=s>>>8&255;w[e|19]=s&255}function B(){n=0x67452301;i=0xefcdab89;a=0x98badcfe;o=0x10325476;s=0xc3d2e1f0;c=u=0}function C(e,t,r,h,l,f,d){e=e|0;t=t|0;r=r|0;h=h|0;l=l|0;f=f|0;d=d|0;n=e;i=t;a=r;o=h;s=l;c=f;u=d}function _(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){I(e);e=e+64|0;t=t-64|0;r=r+64|0}c=c+r|0;if(c>>>0>>0)u=u+1|0;return r|0}function k(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=_(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;c=c+t|0;if(c>>>0>>0)u=u+1|0;w[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)w[e|i]=0x00;I(e);t=0;w[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)w[e|i]=0;w[e|56]=u>>>21&255;w[e|57]=u>>>13&255;w[e|58]=u>>>5&255;w[e|59]=u<<3&255|c>>>29;w[e|60]=c>>>21&255;w[e|61]=c>>>13&255;w[e|62]=c>>>5&255;w[e|63]=c<<3&255;I(e);if(~r)E(r);return n|0}function S(){n=h;i=l;a=f;o=d;s=p;c=64;u=0}function Q(){n=g;i=A;a=y;o=m;s=b;c=64;u=0}function x(e,t,r,w,I,E,C,_,k,S,Q,x,P,M,U,D){e=e|0;t=t|0;r=r|0;w=w|0;I=I|0;E=E|0;C=C|0;_=_|0;k=k|0;S=S|0;Q=Q|0;x=x|0;P=P|0;M=M|0;U=U|0;D=D|0;B();v(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,w^0x5c5c5c5c,I^0x5c5c5c5c,E^0x5c5c5c5c,C^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,S^0x5c5c5c5c,Q^0x5c5c5c5c,x^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,U^0x5c5c5c5c,D^0x5c5c5c5c);g=n;A=i;y=a;m=o;b=s;B();v(e^0x36363636,t^0x36363636,r^0x36363636,w^0x36363636,I^0x36363636,E^0x36363636,C^0x36363636,_^0x36363636,k^0x36363636,S^0x36363636,Q^0x36363636,x^0x36363636,P^0x36363636,M^0x36363636,U^0x36363636,D^0x36363636);h=n;l=i;f=a;d=o;p=s;c=64;u=0}function P(e,t,r){e=e|0;t=t|0;r=r|0;var c=0,u=0,h=0,l=0,f=0,d=0;if(e&63)return-1;if(~r)if(r&31)return-1;d=k(e,t,-1)|0;c=n,u=i,h=a,l=o,f=s;Q();v(c,u,h,l,f,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)E(r);return d|0}function M(e,t,r,c,u){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;var h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~u)if(u&31)return-1;w[e+t|0]=r>>>24;w[e+t+1|0]=r>>>16&255;w[e+t+2|0]=r>>>8&255;w[e+t+3|0]=r&255;P(e,t+4|0,-1)|0;h=g=n,l=A=i,f=y=a,d=m=o,p=b=s;c=c-1|0;while((c|0)>0){S();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;Q();v(g,A,y,m,b,0x80000000,0,0,0,0,0,0,0,0,0,672);g=n,A=i,y=a,m=o,b=s;h=h^n;l=l^i;f=f^a;d=d^o;p=p^s;c=c-1|0}n=h;i=l;a=f;o=d;s=p;if(~u)E(u);return 0}return{reset:B,init:C,process:_,finish:k,hmac_reset:S,hmac_init:x,hmac_finish:P,pbkdf2_generate_block:M}};class Ys{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(null!==this.result)throw new Cs("state must be reset before processing new data");const{asm:t,heap:r}=this.acquire_asm();let n=this.pos,i=this.len,a=0,o=e.length,s=0;for(;o>0;)s=Es(r,n+i,e,a,o),i+=s,a+=s,o-=s,s=t.process(n,i),n+=s,i-=s,i||(n=0);return this.pos=n,this.len=i,this}finish(){if(null!==this.result)throw new Cs("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const $s=[],Xs=[];class ec extends Ys{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=$s.pop()||Is(),this.asm=Xs.pop()||Vs({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&($s.push(this.heap),Xs.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new ec).process(e).finish().result}}ec.NAME="sha1",ec.heap_pool=[],ec.asm_pool=[],ec.asm_function=Vs;const tc=[],rc=[];class nc extends Ys{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=tc.pop()||Is(),this.asm=rc.pop()||function(e,t,r){"use asm";var n=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=new e.Uint8Array(r);function x(e,t,r,l,f,d,p,g,A,y,m,b,w,v,I,E){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;w=w|0;v=v|0;I=I|0;E=E|0;var B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0;B=n;C=i;_=a;k=o;S=s;Q=c;x=u;P=h;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x428a2f98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x71374491|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb5c0fbcf|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xe9b5dba5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x3956c25b|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x59f111f1|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x923f82a4|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xab1c5ed5|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xd807aa98|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x12835b01|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x243185be|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x550c7dc3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x72be5d74|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x80deb1fe|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x9bdc06a7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc19bf174|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xe49b69c1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xefbe4786|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x0fc19dc6|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x240ca1cc|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x2de92c6f|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4a7484aa|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5cb0a9dc|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x76f988da|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x983e5152|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa831c66d|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xb00327c8|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xbf597fc7|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xc6e00bf3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd5a79147|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x06ca6351|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x14292967|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x27b70a85|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x2e1b2138|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x4d2c6dfc|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x53380d13|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x650a7354|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x766a0abb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x81c2c92e|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x92722c85|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0xa2bfe8a1|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0xa81a664b|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0xc24b8b70|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0xc76c51a3|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0xd192e819|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xd6990624|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xf40e3585|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x106aa070|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(I>>>17^I>>>19^I>>>10^I<<15^I<<13)+e+y|0;P=e+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x19a4c116|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(E>>>17^E>>>19^E>>>10^E<<15^E<<13)+t+m|0;x=t+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x1e376c08|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;r=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+b|0;Q=r+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x2748774c|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+l+w|0;S=l+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x34b0bcb5|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+f+v|0;k=f+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x391c0cb3|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;d=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+I|0;_=d+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0x4ed8aa4a|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;p=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+p+E|0;C=p+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0x5b9cca4f|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;g=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+g+e|0;B=g+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0x682e6ff3|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;A=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+A+t|0;P=A+P+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(x^S&(Q^x))+0x748f82ee|0;k=k+P|0;P=P+(B&C^_&(B^C))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;y=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+y+r|0;x=y+x+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(Q^k&(S^Q))+0x78a5636f|0;_=_+x|0;x=x+(P&B^C&(P^B))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;m=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+m+l|0;Q=m+Q+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(S^_&(k^S))+0x84c87814|0;C=C+Q|0;Q=Q+(x&P^B&(x^P))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0;b=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+f|0;S=b+S+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(k^C&(_^k))+0x8cc70208|0;B=B+S|0;S=S+(Q&x^P&(Q^x))+(Q>>>2^Q>>>13^Q>>>22^Q<<30^Q<<19^Q<<10)|0;w=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+w+d|0;k=w+k+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(_^B&(C^_))+0x90befffa|0;P=P+k|0;k=k+(S&Q^x&(S^Q))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;v=(I>>>7^I>>>18^I>>>3^I<<25^I<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+v+p|0;_=v+_+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(C^P&(B^C))+0xa4506ceb|0;x=x+_|0;_=_+(k&S^Q&(k^S))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;I=(E>>>7^E>>>18^E>>>3^E<<25^E<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+I+g|0;C=I+C+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(P^B))+0xbef9a3f7|0;Q=Q+C|0;C=C+(_&k^S&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;E=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+E+A|0;B=E+B+(Q>>>6^Q>>>11^Q>>>25^Q<<26^Q<<21^Q<<7)+(P^Q&(x^P))+0xc67178f2|0;S=S+B|0;B=B+(C&_^k&(C^_))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;n=n+B|0;i=i+C|0;a=a+_|0;o=o+k|0;s=s+S|0;c=c+Q|0;u=u+x|0;h=h+P|0}function P(e){e=e|0;x(Q[e|0]<<24|Q[e|1]<<16|Q[e|2]<<8|Q[e|3],Q[e|4]<<24|Q[e|5]<<16|Q[e|6]<<8|Q[e|7],Q[e|8]<<24|Q[e|9]<<16|Q[e|10]<<8|Q[e|11],Q[e|12]<<24|Q[e|13]<<16|Q[e|14]<<8|Q[e|15],Q[e|16]<<24|Q[e|17]<<16|Q[e|18]<<8|Q[e|19],Q[e|20]<<24|Q[e|21]<<16|Q[e|22]<<8|Q[e|23],Q[e|24]<<24|Q[e|25]<<16|Q[e|26]<<8|Q[e|27],Q[e|28]<<24|Q[e|29]<<16|Q[e|30]<<8|Q[e|31],Q[e|32]<<24|Q[e|33]<<16|Q[e|34]<<8|Q[e|35],Q[e|36]<<24|Q[e|37]<<16|Q[e|38]<<8|Q[e|39],Q[e|40]<<24|Q[e|41]<<16|Q[e|42]<<8|Q[e|43],Q[e|44]<<24|Q[e|45]<<16|Q[e|46]<<8|Q[e|47],Q[e|48]<<24|Q[e|49]<<16|Q[e|50]<<8|Q[e|51],Q[e|52]<<24|Q[e|53]<<16|Q[e|54]<<8|Q[e|55],Q[e|56]<<24|Q[e|57]<<16|Q[e|58]<<8|Q[e|59],Q[e|60]<<24|Q[e|61]<<16|Q[e|62]<<8|Q[e|63])}function M(e){e=e|0;Q[e|0]=n>>>24;Q[e|1]=n>>>16&255;Q[e|2]=n>>>8&255;Q[e|3]=n&255;Q[e|4]=i>>>24;Q[e|5]=i>>>16&255;Q[e|6]=i>>>8&255;Q[e|7]=i&255;Q[e|8]=a>>>24;Q[e|9]=a>>>16&255;Q[e|10]=a>>>8&255;Q[e|11]=a&255;Q[e|12]=o>>>24;Q[e|13]=o>>>16&255;Q[e|14]=o>>>8&255;Q[e|15]=o&255;Q[e|16]=s>>>24;Q[e|17]=s>>>16&255;Q[e|18]=s>>>8&255;Q[e|19]=s&255;Q[e|20]=c>>>24;Q[e|21]=c>>>16&255;Q[e|22]=c>>>8&255;Q[e|23]=c&255;Q[e|24]=u>>>24;Q[e|25]=u>>>16&255;Q[e|26]=u>>>8&255;Q[e|27]=u&255;Q[e|28]=h>>>24;Q[e|29]=h>>>16&255;Q[e|30]=h>>>8&255;Q[e|31]=h&255}function U(){n=0x6a09e667;i=0xbb67ae85;a=0x3c6ef372;o=0xa54ff53a;s=0x510e527f;c=0x9b05688c;u=0x1f83d9ab;h=0x5be0cd19;l=f=0}function D(e,t,r,d,p,g,A,y,m,b){e=e|0;t=t|0;r=r|0;d=d|0;p=p|0;g=g|0;A=A|0;y=y|0;m=m|0;b=b|0;n=e;i=t;a=r;o=d;s=p;c=g;u=A;h=y;l=m;f=b}function R(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){P(e);e=e+64|0;t=t-64|0;r=r+64|0}l=l+r|0;if(l>>>0>>0)f=f+1|0;return r|0}function F(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=R(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;l=l+t|0;if(l>>>0>>0)f=f+1|0;Q[e|t]=0x80;if((t|0)>=56){for(i=t+1|0;(i|0)<64;i=i+1|0)Q[e|i]=0x00;P(e);t=0;Q[e|0]=0}for(i=t+1|0;(i|0)<59;i=i+1|0)Q[e|i]=0;Q[e|56]=f>>>21&255;Q[e|57]=f>>>13&255;Q[e|58]=f>>>5&255;Q[e|59]=f<<3&255|l>>>29;Q[e|60]=l>>>21&255;Q[e|61]=l>>>13&255;Q[e|62]=l>>>5&255;Q[e|63]=l<<3&255;P(e);if(~r)M(r);return n|0}function T(){n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;l=64;f=0}function q(){n=v;i=I;a=E;o=B;s=C;c=_;u=k;h=S;l=64;f=0}function O(e,t,r,Q,P,M,D,R,F,T,q,O,K,H,N,L){e=e|0;t=t|0;r=r|0;Q=Q|0;P=P|0;M=M|0;D=D|0;R=R|0;F=F|0;T=T|0;q=q|0;O=O|0;K=K|0;H=H|0;N=N|0;L=L|0;U();x(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,Q^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,D^0x5c5c5c5c,R^0x5c5c5c5c,F^0x5c5c5c5c,T^0x5c5c5c5c,q^0x5c5c5c5c,O^0x5c5c5c5c,K^0x5c5c5c5c,H^0x5c5c5c5c,N^0x5c5c5c5c,L^0x5c5c5c5c);v=n;I=i;E=a;B=o;C=s;_=c;k=u;S=h;U();x(e^0x36363636,t^0x36363636,r^0x36363636,Q^0x36363636,P^0x36363636,M^0x36363636,D^0x36363636,R^0x36363636,F^0x36363636,T^0x36363636,q^0x36363636,O^0x36363636,K^0x36363636,H^0x36363636,N^0x36363636,L^0x36363636);d=n;p=i;g=a;A=o;y=s;m=c;b=u;w=h;l=64;f=0}function K(e,t,r){e=e|0;t=t|0;r=r|0;var l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0;if(e&63)return-1;if(~r)if(r&31)return-1;b=F(e,t,-1)|0;l=n,f=i,d=a,p=o,g=s,A=c,y=u,m=h;q();x(l,f,d,p,g,A,y,m,0x80000000,0,0,0,0,0,0,768);if(~r)M(r);return b|0}function H(e,t,r,l,f){e=e|0;t=t|0;r=r|0;l=l|0;f=f|0;var d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0;if(e&63)return-1;if(~f)if(f&31)return-1;Q[e+t|0]=r>>>24;Q[e+t+1|0]=r>>>16&255;Q[e+t+2|0]=r>>>8&255;Q[e+t+3|0]=r&255;K(e,t+4|0,-1)|0;d=v=n,p=I=i,g=E=a,A=B=o,y=C=s,m=_=c,b=k=u,w=S=h;l=l-1|0;while((l|0)>0){T();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;q();x(v,I,E,B,C,_,k,S,0x80000000,0,0,0,0,0,0,768);v=n,I=i,E=a,B=o,C=s,_=c,k=u,S=h;d=d^n;p=p^i;g=g^a;A=A^o;y=y^s;m=m^c;b=b^u;w=w^h;l=l-1|0}n=d;i=p;a=g;o=A;s=y;c=m;u=b;h=w;if(~f)M(f);return 0}return{reset:U,init:D,process:R,finish:F,hmac_reset:T,hmac_init:O,hmac_finish:K,pbkdf2_generate_block:H}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(tc.push(this.heap),rc.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new nc).process(e).finish().result}}nc.NAME="sha256";var ic=ac;function ac(e,t){if(!e)throw Error(t||"Assertion failed")}ac.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var oc=void 0!==uo?uo:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sc(e,t){return e(t={exports:{}},t.exports),t.exports}function cc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var uc=sc((function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}));function hc(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function lc(e){return 1===e.length?"0"+e:e}function fc(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var dc={inherits:uc,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>0}return a},split32:function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},sum64_hi:function(e,t,r,n){return(t+n>>>0>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,a,o,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},sum64_5_hi:function(e,t,r,n,i,a,o,s,c,u){var h=0,l=t;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,r,n,i,a,o,s,c,u){return t+n+a+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function pc(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var gc=pc;pc.prototype.update=function(e,t){if(e=dc.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=dc.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},kc=function(e){return yc(e,17)^yc(e,19)^e>>>10},Sc=dc.sum32,Qc=dc.sum32_4,xc=dc.sum32_5,Pc=Ic,Mc=Ec,Uc=Bc,Dc=Cc,Rc=_c,Fc=kc,Tc=Ac.BlockHash,qc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Oc(){if(!(this instanceof Oc))return new Oc;Tc.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=qc,this.W=Array(64)}dc.inherits(Oc,Tc);var Kc=Oc;function Hc(){if(!(this instanceof Hc))return new Hc;Kc.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Oc.blockSize=512,Oc.outSize=256,Oc.hmacStrength=192,Oc.padLength=64,Oc.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>32-i,r)}function Ru(e,t,r,n,i,a,o){return Du(t&r|~t&n,e,t,i,a,o)}function Fu(e,t,r,n,i,a,o){return Du(t&n|r&~n,e,t,i,a,o)}function Tu(e,t,r,n,i,a,o){return Du(t^r^n,e,t,i,a,o)}function qu(e,t,r,n,i,a,o){return Du(r^(t|~n),e,t,i,a,o)}function Ou(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}const Ku="0123456789abcdef".split("");function Hu(e){let t="",r=0;for(;r<4;r++)t+=Ku[e>>8*r+4&15]+Ku[e>>8*r&15];return t}function Nu(e,t){return e+t&4294967295}const Lu=ts.getWebCrypto(),Gu=ts.getNodeCrypto(),ju=Gu&&Gu.getHashes();function zu(e){if(Gu&&ju.includes(e))return async function(t){const r=Gu.createHash(e);return Lo(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function Wu(e,t){return async function(r,n=us){if(Ao(r)&&(r=await Jo(r)),!ts.isStream(r)&&Lu&&t&&r.length>=n.minBytesForWebCrypto)return new Uint8Array(await Lu.digest(t,r));const i=e();return Lo(r,(e=>{i.update(e)}),(()=>new Uint8Array(i.digest())))}}function Zu(e,t){return async function(r,n=us){if(Ao(r)&&(r=await Jo(r)),ts.isStream(r)){const t=new e;return Lo(r,(e=>{t.process(e)}),(()=>t.finish().result))}return Lu&&t&&r.length>=n.minBytesForWebCrypto?new Uint8Array(await Lu.digest(t,r)):e.bytes(r)}}const Ju={md5:zu("md5")||async function(e){const t=function(e){const t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)Uu(r,Ou(e.substring(n-64,n)));e=e.substring(n-64);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n>2]|=e.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(Uu(r,i),n=0;n<16;n++)i[n]=0;return i[14]=8*t,Uu(r,i),r}(ts.uint8ArrayToString(e));return ts.hexToUint8Array(function(e){for(let t=0;tnew Uint8Array(a.update(e))))}(e,t,r,n);if(ts.isAES(e))return function(e,t,r,n,i){if(ts.getWebCrypto()&&24!==t.length&&!ts.isStream(r)&&r.length>=3e3*i.minBytesForWebCrypto)return async function(e,t,r,n){const i="AES-CBC",a=await Xu.importKey("raw",t,{name:i},!1,["encrypt"]),{blockSize:o}=$u(e),s=ts.concatUint8Array([new Uint8Array(o),r]),c=new Uint8Array(await Xu.encrypt({name:i,iv:n},a,s)).subarray(0,r.length);return function(e,t){for(let r=0;ra.aes.AES_Encrypt_process(e)),(()=>a.aes.AES_Encrypt_finish()))}(e,t,r,n,i);const o=new($u(e))(t),s=o.blockSize,c=n.slice();let u=new Uint8Array;const h=e=>{e&&(u=ts.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,n=0;for(;e?u.length>=s:u.length;){const e=o.encrypt(c);for(r=0;rnew Uint8Array(a.update(e))))}(e,t,r,n);if(ts.isAES(e))return function(e,t,r,n){if(ts.isStream(r)){const e=new Yu(t,n);return Lo(r,(t=>e.aes.AES_Decrypt_process(t)),(()=>e.aes.AES_Decrypt_finish()))}return Yu.decrypt(r,t,n)}(0,t,r,n);const a=new($u(e))(t),o=a.blockSize;let s=n,c=new Uint8Array;const u=e=>{e&&(c=ts.concatUint8Array([c,e]));const t=new Uint8Array(c.length);let r,n=0;for(;e?c.length>=o:c.length;){const e=a.encrypt(s);for(s=c.subarray(0,o),r=0;r48)throw new _s("illegal counter size");let e=Math.pow(2,r)-1;n.set_mask(0,0,e/4294967296|0,0|e)}else r=48,n.set_mask(0,0,65535,4294967295);if(void 0===e)throw Error("nonce is required");{let t=e.length;if(!t||t>16)throw new _s("illegal nonce size");let r=new DataView(new ArrayBuffer(16));new Uint8Array(r.buffer).set(e),n.set_nonce(r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12))}if(void 0!==t){if(t<0||t>=Math.pow(2,r))throw new _s("illegal counter value");n.set_counter(0,0,t/4294967296|0,0|t)}}}class ah{static encrypt(e,t,r=!0,n){return new ah(t,n,r).encrypt(e)}static decrypt(e,t,r=!0,n){return new ah(t,n,r).decrypt(e)}constructor(e,t,r=!0,n){this.aes=n||new xs(e,t,r,"CBC")}encrypt(e){return Bs(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Bs(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const oh=ts.getWebCrypto(),sh=ts.getNodeCrypto(),ch=16;function uh(e,t){const r=e.length-ch;for(let n=0;n>3),17+(u>>3)),8-(7&u)).subarray(1),d=new Uint8Array(Eh),p=new Uint8Array(t.length+Bh);let g,A=0;for(g=0;g16)throw new _s("illegal tagSize value");const s=t.length||0,c=new Uint8Array(16);12!==s?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=s>>>29,o[12]=s>>>21&255,o[13]=s>>>13&255,o[14]=s>>>5&255,o[15]=s<<3&255,a.mac(ws.MAC.GCM,ws.HEAP_DATA,16),a.get_iv(ws.HEAP_DATA),a.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const u=new DataView(c.buffer);if(this.gamma0=u.getUint32(12),a.set_nonce(u.getUint32(0),u.getUint32(4),u.getUint32(8),0),a.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>Ph)throw new _s("illegal adata length");r.length?(this.adata=r,this._gcm_mac_process(r)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");a.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,r,n,i){return new Mh(t,r,n,i).encrypt(e)}static decrypt(e,t,r,n,i){return new Mh(t,r,n,i).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.aes.pos,s=this.aes.len,c=0,u=s+r&-16,h=0;if((a-1<<4)+s+r>Ph)throw new RangeError("counter overflow");const l=new Uint8Array(u);for(;r>0;)h=Es(i,o+s,e,t,r),s+=h,t+=h,r-=h,h=n.cipher(ws.ENC.CTR,ws.HEAP_DATA+o,s),h=n.mac(ws.MAC.GCM,ws.HEAP_DATA+o,h),h&&l.set(i.subarray(o,o+h),c),a+=h>>>4,c+=h,h>>29,t[4]=u>>>21,t[5]=u>>>13&255,t[6]=u>>>5&255,t[7]=u<<3&255,t[8]=t[9]=t[10]=0,t[11]=h>>>29,t[12]=h>>>21&255,t[13]=h>>>13&255,t[14]=h>>>5&255,t[15]=h<<3&255,e.mac(ws.MAC.GCM,ws.HEAP_DATA,16),e.get_iv(ws.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ws.ENC.CTR,ws.HEAP_DATA,16),s.set(t.subarray(0,n),o),this.counter=1,this.aes.pos=0,this.aes.len=0,s}AES_GCM_Decrypt_process(e){let t=0,r=e.length||0,{asm:n,heap:i}=this.aes.acquire_asm(),a=this.counter,o=this.tagSize,s=this.aes.pos,c=this.aes.len,u=0,h=c+r>o?c+r-o&-16:0,l=c+r-h,f=0;if((a-1<<4)+c+r>Ph)throw new RangeError("counter overflow");const d=new Uint8Array(h);for(;r>l;)f=Es(i,s+c,e,t,r-l),c+=f,t+=f,r-=f,f=n.mac(ws.MAC.GCM,ws.HEAP_DATA+s,f),f=n.cipher(ws.DEC.CTR,ws.HEAP_DATA+s,f),f&&d.set(i.subarray(s,s+f),u),a+=f>>>4,u+=f,s=0,c=0;return r>0&&(c+=Es(i,0,e,t,r)),this.counter=a,this.aes.pos=s,this.aes.len=c,d}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.tagSize,n=this.adata,i=this.counter,a=this.aes.pos,o=this.aes.len,s=o-r;if(o>>29,t[4]=l>>>21,t[5]=l>>>13&255,t[6]=l>>>5&255,t[7]=l<<3&255,t[8]=t[9]=t[10]=0,t[11]=f>>>29,t[12]=f>>>21&255,t[13]=f>>>13&255,t[14]=f>>>5&255,t[15]=f<<3&255,e.mac(ws.MAC.GCM,ws.HEAP_DATA,16),e.get_iv(ws.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ws.ENC.CTR,ws.HEAP_DATA,16);let d=0;for(let e=0;e0;){for(a=Es(r,0,e,n,i),n+=a,i-=a;15&a;)r[a++]=0;t.mac(ws.MAC.GCM,ws.HEAP_DATA,a)}}}const Uh=ts.getWebCrypto(),Dh=ts.getNodeCrypto(),Rh=ts.getNodeBuffer(),Fh=16,Th="AES-GCM";async function qh(e,t){if(e!==Xo.symmetric.aes128&&e!==Xo.symmetric.aes192&&e!==Xo.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(ts.getNodeCrypto())return{encrypt:async function(e,r,n=new Uint8Array){const i=new Dh.createCipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n);const a=Rh.concat([i.update(e),i.final(),i.getAuthTag()]);return new Uint8Array(a)},decrypt:async function(e,r,n=new Uint8Array){const i=new Dh.createDecipheriv("aes-"+8*t.length+"-gcm",t,r);i.setAAD(n),i.setAuthTag(e.slice(e.length-Fh,e.length));const a=Rh.concat([i.update(e.slice(0,e.length-Fh)),i.final()]);return new Uint8Array(a)}};if(ts.getWebCrypto()&&24!==t.length){const e=await Uh.importKey("raw",t,{name:Th},!1,["encrypt","decrypt"]);return{encrypt:async function(r,n,i=new Uint8Array){if(!r.length)return Mh.encrypt(r,t,n,i);const a=await Uh.encrypt({name:Th,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)},decrypt:async function(r,n,i=new Uint8Array){if(r.length===Fh)return Mh.decrypt(r,t,n,i);const a=await Uh.decrypt({name:Th,iv:n,additionalData:i,tagLength:128},e,r);return new Uint8Array(a)}}}return{encrypt:async function(e,r,n){return Mh.encrypt(e,t,r,n)},decrypt:async function(e,r,n){return Mh.decrypt(e,t,r,n)}}}qh.getNonce=function(e,t){const r=e.slice();for(let e=0;e>>8)-1}(e,t,r,n)}function d(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function p(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function g(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function A(e,r){var n,i,a,o=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(p(s),p(s),p(s),i=0;i<2;i++){for(o[0]=s[0]-65517,n=1;n<15;n++)o[n]=s[n]-65535-(o[n-1]>>16&1),o[n-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,g(s,o,1-a)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function y(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return A(r,e),A(n,t),f(r,0,n,0)}function m(e){var t=new Uint8Array(32);return A(t,e),1&t[0]}function b(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function w(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function v(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function I(e,t,r){var n,i,a=0,o=0,s=0,c=0,u=0,h=0,l=0,f=0,d=0,p=0,g=0,A=0,y=0,m=0,b=0,w=0,v=0,I=0,E=0,B=0,C=0,_=0,k=0,S=0,Q=0,x=0,P=0,M=0,U=0,D=0,R=0,F=r[0],T=r[1],q=r[2],O=r[3],K=r[4],H=r[5],N=r[6],L=r[7],G=r[8],j=r[9],z=r[10],W=r[11],Z=r[12],J=r[13],V=r[14],Y=r[15];a+=(n=t[0])*F,o+=n*T,s+=n*q,c+=n*O,u+=n*K,h+=n*H,l+=n*N,f+=n*L,d+=n*G,p+=n*j,g+=n*z,A+=n*W,y+=n*Z,m+=n*J,b+=n*V,w+=n*Y,o+=(n=t[1])*F,s+=n*T,c+=n*q,u+=n*O,h+=n*K,l+=n*H,f+=n*N,d+=n*L,p+=n*G,g+=n*j,A+=n*z,y+=n*W,m+=n*Z,b+=n*J,w+=n*V,v+=n*Y,s+=(n=t[2])*F,c+=n*T,u+=n*q,h+=n*O,l+=n*K,f+=n*H,d+=n*N,p+=n*L,g+=n*G,A+=n*j,y+=n*z,m+=n*W,b+=n*Z,w+=n*J,v+=n*V,I+=n*Y,c+=(n=t[3])*F,u+=n*T,h+=n*q,l+=n*O,f+=n*K,d+=n*H,p+=n*N,g+=n*L,A+=n*G,y+=n*j,m+=n*z,b+=n*W,w+=n*Z,v+=n*J,I+=n*V,E+=n*Y,u+=(n=t[4])*F,h+=n*T,l+=n*q,f+=n*O,d+=n*K,p+=n*H,g+=n*N,A+=n*L,y+=n*G,m+=n*j,b+=n*z,w+=n*W,v+=n*Z,I+=n*J,E+=n*V,B+=n*Y,h+=(n=t[5])*F,l+=n*T,f+=n*q,d+=n*O,p+=n*K,g+=n*H,A+=n*N,y+=n*L,m+=n*G,b+=n*j,w+=n*z,v+=n*W,I+=n*Z,E+=n*J,B+=n*V,C+=n*Y,l+=(n=t[6])*F,f+=n*T,d+=n*q,p+=n*O,g+=n*K,A+=n*H,y+=n*N,m+=n*L,b+=n*G,w+=n*j,v+=n*z,I+=n*W,E+=n*Z,B+=n*J,C+=n*V,_+=n*Y,f+=(n=t[7])*F,d+=n*T,p+=n*q,g+=n*O,A+=n*K,y+=n*H,m+=n*N,b+=n*L,w+=n*G,v+=n*j,I+=n*z,E+=n*W,B+=n*Z,C+=n*J,_+=n*V,k+=n*Y,d+=(n=t[8])*F,p+=n*T,g+=n*q,A+=n*O,y+=n*K,m+=n*H,b+=n*N,w+=n*L,v+=n*G,I+=n*j,E+=n*z,B+=n*W,C+=n*Z,_+=n*J,k+=n*V,S+=n*Y,p+=(n=t[9])*F,g+=n*T,A+=n*q,y+=n*O,m+=n*K,b+=n*H,w+=n*N,v+=n*L,I+=n*G,E+=n*j,B+=n*z,C+=n*W,_+=n*Z,k+=n*J,S+=n*V,Q+=n*Y,g+=(n=t[10])*F,A+=n*T,y+=n*q,m+=n*O,b+=n*K,w+=n*H,v+=n*N,I+=n*L,E+=n*G,B+=n*j,C+=n*z,_+=n*W,k+=n*Z,S+=n*J,Q+=n*V,x+=n*Y,A+=(n=t[11])*F,y+=n*T,m+=n*q,b+=n*O,w+=n*K,v+=n*H,I+=n*N,E+=n*L,B+=n*G,C+=n*j,_+=n*z,k+=n*W,S+=n*Z,Q+=n*J,x+=n*V,P+=n*Y,y+=(n=t[12])*F,m+=n*T,b+=n*q,w+=n*O,v+=n*K,I+=n*H,E+=n*N,B+=n*L,C+=n*G,_+=n*j,k+=n*z,S+=n*W,Q+=n*Z,x+=n*J,P+=n*V,M+=n*Y,m+=(n=t[13])*F,b+=n*T,w+=n*q,v+=n*O,I+=n*K,E+=n*H,B+=n*N,C+=n*L,_+=n*G,k+=n*j,S+=n*z,Q+=n*W,x+=n*Z,P+=n*J,M+=n*V,U+=n*Y,b+=(n=t[14])*F,w+=n*T,v+=n*q,I+=n*O,E+=n*K,B+=n*H,C+=n*N,_+=n*L,k+=n*G,S+=n*j,Q+=n*z,x+=n*W,P+=n*Z,M+=n*J,U+=n*V,D+=n*Y,w+=(n=t[15])*F,o+=38*(I+=n*q),s+=38*(E+=n*O),c+=38*(B+=n*K),u+=38*(C+=n*H),h+=38*(_+=n*N),l+=38*(k+=n*L),f+=38*(S+=n*G),d+=38*(Q+=n*j),p+=38*(x+=n*z),g+=38*(P+=n*W),A+=38*(M+=n*Z),y+=38*(U+=n*J),m+=38*(D+=n*V),b+=38*(R+=n*Y),a=(n=(a+=38*(v+=n*T))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=A,e[12]=y,e[13]=m,e[14]=b,e[15]=w}function E(e,t){I(e,t,t)}function B(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)E(i,i),2!==n&&4!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function C(e,r,n){var i,a,s=new Uint8Array(32),c=new Float64Array(80),u=t(),h=t(),l=t(),f=t(),d=t(),p=t();for(a=0;a<31;a++)s[a]=r[a];for(s[31]=127&r[31]|64,s[0]&=248,b(c,n),a=0;a<16;a++)h[a]=c[a],f[a]=u[a]=l[a]=0;for(u[0]=f[0]=1,a=254;a>=0;--a)g(u,h,i=s[a>>>3]>>>(7&a)&1),g(l,f,i),w(d,u,l),v(u,u,l),w(l,h,f),v(h,h,f),E(f,d),E(p,u),I(u,l,u),I(l,h,d),w(d,u,l),v(u,u,l),E(h,u),v(l,f,p),I(u,l,o),w(u,u,f),I(l,l,u),I(u,f,p),I(f,h,c),E(h,d),g(u,h,i),g(l,f,i);for(a=0;a<16;a++)c[a+16]=u[a],c[a+32]=l[a],c[a+48]=h[a],c[a+64]=f[a];var y=c.subarray(32),m=c.subarray(16);return B(y,y),I(m,m,y),A(e,m),0}function _(e,t){return C(e,t,n)}function k(e,r){var n=t(),i=t(),a=t(),o=t(),s=t(),u=t(),h=t(),l=t(),f=t();v(n,e[1],e[0]),v(f,r[1],r[0]),I(n,n,f),w(i,e[0],e[1]),w(f,r[0],r[1]),I(i,i,f),I(a,e[3],r[3]),I(a,a,c),I(o,e[2],r[2]),w(o,o,o),v(s,i,n),v(u,o,a),w(h,o,a),w(l,i,n),I(e[0],s,u),I(e[1],l,h),I(e[2],h,u),I(e[3],s,l)}function S(e,t,r){var n;for(n=0;n<4;n++)g(e[n],t[n],r)}function Q(e,r){var n=t(),i=t(),a=t();B(a,r[2]),I(n,r[0],a),I(i,r[1],a),A(e,i),e[31]^=m(n)<<7}function x(e,t,r){var n,o;for(d(e[0],i),d(e[1],a),d(e[2],a),d(e[3],i),o=255;o>=0;--o)S(e,t,n=r[o/8|0]>>(7&o)&1),k(t,e),k(e,e),S(e,t,n)}function P(e,r){var n=[t(),t(),t(),t()];d(n[0],u),d(n[1],h),d(n[2],a),I(n[3],u,h),x(e,n,r)}function M(n,i,a){var o,s,c=[t(),t(),t(),t()];for(a||r(i,32),(o=e.hash(i.subarray(0,32)))[0]&=248,o[31]&=127,o[31]|=64,P(c,o),Q(n,c),s=0;s<32;s++)i[s+32]=n[s];return 0}var U=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function D(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>4)*U[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*U[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function R(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;D(e,r)}function F(e,r){var n=t(),o=t(),c=t(),u=t(),h=t(),f=t(),p=t();return d(e[2],a),b(e[1],r),E(c,e[1]),I(u,c,s),v(c,c,e[2]),w(u,e[2],u),E(h,u),E(f,h),I(p,f,h),I(n,p,c),I(n,n,u),function(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)E(i,i),1!==n&&I(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}(n,n),I(n,n,c),I(n,n,u),I(n,n,u),I(e[0],n,u),E(o,e[0]),I(o,o,u),y(o,c)&&I(e[0],e[0],l),E(o,e[0]),I(o,o,u),y(o,c)?-1:(m(e[0])===r[31]>>7&&v(e[0],i,e[0]),I(e[3],e[0],e[1]),0)}var T=64;function q(){for(var e=0;e=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return M(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(q(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;re&&(c.imod(a.leftShift(i)).iadd(a),u=c.mod(o).toNumber())}while(!await zh(c,t,r));return c}async function zh(e,t,r){return!(t&&!e.dec().gcd(t).isOne()||!await async function(e){const t=await ts.getBigInteger();return Wh.every((r=>0!==e.mod(new t(r))))}(e)||!await async function(e,t){const r=await ts.getBigInteger();return(t=t||new r(2)).modExp(e.dec(),e).isOne()}(e)||!await async function(e,t,r){const n=await ts.getBigInteger(),i=e.bitLength();t||(t=Math.max(1,i/48|0));const a=e.dec();let o=0;for(;!a.getBit(o);)o++;const s=e.rightShift(new n(o));for(;t>0;t--){let t,r=(await Lh(new n(2),a)).modExp(s,e);if(!r.isOne()&&!r.equal(a)){for(t=1;tt-11)throw Error("Message too long");const n=function(e){const t=new Uint8Array(e);let r=0;for(;r=8&!n;if(t)return ts.selectUint8Array(o,a,t);if(o)return a;throw Error("Decryption error")}async function Yh(e,t,r){let n;if(t.length!==Vu.getHashByteLength(e))throw Error("Invalid hash length");const i=new Uint8Array(Zh[e].length);for(n=0;n{el.generateKeyPair("rsa",r,((r,n,i)=>{r?t(r):e(rl.decode(i,"der"))}))}));return{n:n.modulus.toArrayLike(Uint8Array),e:n.publicExponent.toArrayLike(Uint8Array),d:n.privateExponent.toArrayLike(Uint8Array),p:n.prime2.toArrayLike(Uint8Array),q:n.prime1.toArrayLike(Uint8Array),u:n.coefficient.toArrayLike(Uint8Array)}}let r,n,i;do{n=await jh(e-(e>>1),t,40),r=await jh(e>>1,t,40),i=r.mul(n)}while(i.bitLength()!==e);const a=r.dec().imul(n.dec());return n.lt(r)&&([r,n]=[n,r]),{n:i.toUint8Array(),e:t.toUint8Array(),d:t.modInv(a).toUint8Array(),p:r.toUint8Array(),q:n.toUint8Array(),u:r.modInv(n).toUint8Array()}},validateParams:async function(e,t,r,n,i,a){const o=await ts.getBigInteger();if(e=new o(e),n=new o(n),i=new o(i),!n.mul(i).equal(e))return!1;const s=new o(2);if(a=new o(a),!n.mul(a).mod(i).isOne())return!1;t=new o(t),r=new o(r);const c=new o(Math.floor(e.bitLength()/3)),u=await Lh(s,s.leftShift(c)),h=u.mul(r).mul(t);return!(!h.mod(n.dec()).equal(u)||!h.mod(i.dec()).equal(u))}}),al=Object.freeze({__proto__:null,encrypt:async function(e,t,r,n){const i=await ts.getBigInteger();t=new i(t),r=new i(r),n=new i(n);const a=new i(Jh(e,t.byteLength())),o=await Lh(new i(1),t.dec());return{c1:r.modExp(o,t).toUint8Array(),c2:n.modExp(o,t).imul(a).imod(t).toUint8Array()}},decrypt:async function(e,t,r,n,i){const a=await ts.getBigInteger();return e=new a(e),t=new a(t),r=new a(r),n=new a(n),Vh(e.modExp(n,r).modInv(r).imul(t).imod(r).toUint8Array("be",r.byteLength()),i)},validateParams:async function(e,t,r,n){const i=await ts.getBigInteger();e=new i(e),t=new i(t),r=new i(r);const a=new i(1);if(t.lte(a)||t.gte(e))return!1;const o=new i(e.bitLength()),s=new i(1023);if(o.lt(s))return!1;if(!t.modExp(e.dec(),e).isOne())return!1;let c=t;const u=new i(1),h=new i(2).leftShift(new i(17));for(;u.lt(h);){if(c=c.mul(t).imod(e),c.isOne())return!1;u.iinc()}n=new i(n);const l=new i(2),f=await Lh(l.leftShift(o.dec()),l.leftShift(o)),d=e.dec().imul(f).iadd(n);return!!r.equal(t.modExp(d,e))}});class ol{constructor(e){if(e instanceof ol)this.oid=e.oid;else if(ts.isArray(e)||ts.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return ts.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return ts.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(Xo.curve[e])return Xo.write(Xo.curve,e);throw Error("Unknown curve object identifier.")}}function sl(e,t){return e.keyPair({priv:t})}function cl(e,t){const r=e.keyPair({pub:t});if(!0!==r.validate().result)throw Error("Invalid elliptic public key");return r}async function ul(e){if(!us.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:t}=await Promise.resolve().then((function(){return Db}));return new t.ec(e)}function hl(e){let t,r=0;const n=e[0];return n<192?([r]=e,t=1):n<255?(r=(e[0]-192<<8)+e[1]+192,t=2):255===n&&(r=ts.readNumber(e.subarray(1,5)),t=5),{len:r,offset:t}}function ll(e){return e<192?new Uint8Array([e]):e>191&&e<8384?new Uint8Array([192+(e-192>>8),e-192&255]):ts.concatUint8Array([new Uint8Array([255]),ts.writeNumber(e,4)])}function fl(e){if(e<0||e>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+e])}function dl(e){return new Uint8Array([192|e])}function pl(e,t){return ts.concatUint8Array([dl(e),ll(t)])}function gl(e){return[Xo.packet.literalData,Xo.packet.compressedData,Xo.packet.symmetricallyEncryptedData,Xo.packet.symEncryptedIntegrityProtectedData,Xo.packet.aeadEncryptedData].includes(e)}async function Al(e,t){const r=qo(e);let n,i;try{const a=await r.peekBytes(2);if(!a||a.length<2||0==(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const o=await r.readByte();let s,c,u=-1,h=-1;h=0,0!=(64&o)&&(h=1),h?u=63&o:(u=(63&o)>>2,c=3&o);const l=gl(u);let f,d=null;if(l){if("array"===ts.isStream(e)){const e=new go;n=Oo(e),d=e}else{const e=new Uo;n=Oo(e.writable),d=e.readable}i=t({tag:u,packet:d})}else d=[];do{if(h){const e=await r.readByte();if(f=!1,e<192)s=e;else if(e>=192&&e<224)s=(e-192<<8)+await r.readByte()+192;else if(e>223&&e<255){if(s=1<<(31&e),f=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(c){case 0:s=await r.readByte();break;case 1:s=await r.readByte()<<8|await r.readByte();break;case 2:s=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:s=1/0}if(s>0){let e=0;for(;;){n&&await n.ready;const{done:t,value:i}=await r.read();if(t){if(s===1/0)break;throw Error("Unexpected end of packet")}const a=s===1/0?i:i.subarray(0,s-e);if(n?await n.write(a):d.push(a),e+=i.length,e>=s){r.unshift(i.subarray(s-e+i.length));break}}}}while(f);const p=await r.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(d=ts.concatUint8Array(d),await t({tag:u,packet:d})),!p||!p.length}catch(e){if(n)return await n.abort(e),!0;throw e}finally{n&&await i,r.releaseLock()}}class yl extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,yl),this.name="UnsupportedError"}}class ml{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const bl=ts.getWebCrypto(),wl=ts.getNodeCrypto(),vl={p256:"P-256",p384:"P-384",p521:"P-521"},Il=wl?wl.getCurves():[],El=wl?{secp256k1:Il.includes("secp256k1")?"secp256k1":void 0,p256:Il.includes("prime256v1")?"prime256v1":void 0,p384:Il.includes("secp384r1")?"secp384r1":void 0,p521:Il.includes("secp521r1")?"secp521r1":void 0,ed25519:Il.includes("ED25519")?"ED25519":void 0,curve25519:Il.includes("X25519")?"X25519":void 0,brainpoolP256r1:Il.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:Il.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:Il.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Bl={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:El.p256,web:vl.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha384,cipher:Xo.symmetric.aes192,node:El.p384,web:vl.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha512,cipher:Xo.symmetric.aes256,node:El.p521,web:vl.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:El.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:Xo.publicKey.eddsaLegacy,hash:Xo.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:Xo.publicKey.ecdh,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha256,cipher:Xo.symmetric.aes128,node:El.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha384,cipher:Xo.symmetric.aes192,node:El.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:Xo.publicKey.ecdsa,hash:Xo.hash.sha512,cipher:Xo.symmetric.aes256,node:El.brainpoolP512r1,payloadSize:64}};class Cl{constructor(e,t){try{(ts.isArray(e)||ts.isUint8Array(e))&&(e=new ol(e)),e instanceof ol&&(e=e.getName()),this.name=Xo.write(Xo.curve,e)}catch(e){throw new yl("Unknown curve")}t=t||Bl[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Bl[this.name],this.web=t.web&&Bl[this.name],this.payloadSize=t.payloadSize,this.web&&ts.getWebCrypto()?this.type="web":this.node&&ts.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(e){const t=await bl.generateKey({name:"ECDSA",namedCurve:vl[e]},!0,["sign","verify"]),r=await bl.exportKey("jwk",t.privateKey);return{publicKey:kl(await bl.exportKey("jwk",t.publicKey)),privateKey:ss(r.d)}}(this.name)}catch(e){ts.printDebugError("Browser did not support generating ec key "+e.message);break}case"node":return async function(e){const t=wl.createECDH(El[e]);return await t.generateKeys(),{publicKey:new Uint8Array(t.getPublicKey()),privateKey:new Uint8Array(t.getPrivateKey())}}(this.name);case"curve25519":{const t=Nh(32);t[0]=127&t[0]|64,t[31]&=248;const r=t.slice().reverse();return e=Kh.box.keyPair.fromSecretKey(r),{publicKey:ts.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:t}}case"ed25519":{const e=Nh(32),t=Kh.sign.keyPair.fromSeed(e);return{publicKey:ts.concatUint8Array([new Uint8Array([64]),t.publicKey]),privateKey:e}}}const t=await ul(this.name);return e=await t.genKeyPair({entropy:ts.uint8ArrayToString(Nh(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function _l(e,t,r,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:e===Xo.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=t.getName();if(!i[a])return!1;if("curve25519"===a){n=n.slice().reverse();const{publicKey:e}=Kh.box.keyPair.fromSecretKey(n);r=new Uint8Array(r);const t=new Uint8Array([64,...e]);return!!ts.equalsUint8Array(t,r)}const o=await ul(a);try{r=cl(o,r).getPublic()}catch(e){return!1}return!!sl(o,n).getPublic().eq(r)}function kl(e){const t=ss(e.x),r=ss(e.y),n=new Uint8Array(t.length+r.length+1);return n[0]=4,n.set(t,1),n.set(r,t.length+1),n}function Sl(e,t,r){const n=e,i=r.slice(1,n+1),a=r.slice(n+1,2*n+1);return{kty:"EC",crv:t,x:cs(i,!0),y:cs(a,!0),ext:!0}}function Ql(e,t,r,n){const i=Sl(e,t,r);return i.d=cs(n,!0),i}const xl=ts.getWebCrypto(),Pl=ts.getNodeCrypto();async function Ml(e,t,r,n,i,a){const o=new Cl(e);if(r&&!ts.isStream(r)){const a={publicKey:n,privateKey:i};switch(o.type){case"web":try{return await async function(e,t,r,n){const i=e.payloadSize,a=Ql(e.payloadSize,vl[e.name],n.publicKey,n.privateKey),o=await xl.importKey("jwk",a,{name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,e.hash)}},!1,["sign"]),s=new Uint8Array(await xl.sign({name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,t)}},o,r));return{r:s.slice(0,i),s:s.slice(i,i<<1)}}(o,t,r,a)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;ts.printDebugError("Browser did not support signing: "+e.message)}break;case"node":{const e=await async function(e,t,r,n){const i=Pl.createSign(Xo.read(Xo.hash,t));i.write(r),i.end();const a=Fl.encode({version:1,parameters:e.oid,privateKey:Array.from(n.privateKey),publicKey:{unused:0,data:Array.from(n.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Rl.decode(i.sign(a),"der")}(o,t,r,a);return{r:e.r.toArrayLike(Uint8Array),s:e.s.toArrayLike(Uint8Array)}}}}return async function(e,t,r){const n=sl(await ul(e.name),r).sign(t);return{r:n.r.toArrayLike(Uint8Array),s:n.s.toArrayLike(Uint8Array)}}(o,a,i)}async function Ul(e,t,r,n,i,a){const o=new Cl(e);if(n&&!ts.isStream(n))switch(o.type){case"web":try{return await async function(e,t,{r:r,s:n},i,a){const o=Sl(e.payloadSize,vl[e.name],a),s=await xl.importKey("jwk",o,{name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,e.hash)}},!1,["verify"]),c=ts.concatUint8Array([r,n]).buffer;return xl.verify({name:"ECDSA",namedCurve:vl[e.name],hash:{name:Xo.read(Xo.webHash,t)}},s,c,i)}(o,t,r,n,i)}catch(e){if("p521"!==o.name&&("DataError"===e.name||"OperationError"===e.name))throw e;ts.printDebugError("Browser did not support verifying: "+e.message)}break;case"node":return async function(e,t,{r:r,s:n},i,a){const{default:o}=await Promise.resolve().then((function(){return gm})),s=Pl.createVerify(Xo.read(Xo.hash,t));s.write(i),s.end();const c=ql.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:e.oid},subjectPublicKey:{unused:0,data:Array.from(a)}},"pem",{label:"PUBLIC KEY"}),u=Rl.encode({r:new o(r),s:new o(n)},"der");try{return s.verify(c,u)}catch(e){return!1}}(o,t,r,n,i)}return async function(e,t,r,n){return cl(await ul(e.name),n).verify(r,t)}(o,r,void 0===t?n:a,i)}const Dl=void 0,Rl=Pl?Dl.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,Fl=Pl?Dl.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,Tl=Pl?Dl.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,ql=Pl?Dl.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Tl),this.key("subjectPublicKey").bitstr())})):void 0;var Ol=Object.freeze({__proto__:null,sign:Ml,verify:Ul,validateParams:async function(e,t,r){const n=new Cl(e);if(n.keyType!==Xo.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const n=Nh(8),i=Xo.hash.sha256,a=await Vu.digest(i,n);try{const o=await Ml(e,i,n,t,r,a);return await Ul(e,i,o,n,t,a)}catch(e){return!1}}default:return _l(Xo.publicKey.ecdsa,e,t,r)}}});Kh.hash=e=>new Uint8Array(nu().update(e).digest());var Kl=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){if(Vu.getHashByteLength(t)new Uint8Array(nu().update(e).digest());var Nl=Object.freeze({__proto__:null,generate:async function(e){if(e===Xo.publicKey.ed25519){const e=Nh(32),{publicKey:t}=Kh.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(e,t,r,n,i,a){if(Vu.getHashByteLength(t)=0;--e)for(let t=s-1;t>=0;--t)c[1]=s*e+(t+1),u[0]=a[0]^c[0],u[1]=a[1]^c[1],u[2]=o[2*t],u[3]=o[2*t+1],u=jl(r.decrypt(zl(u))),a=u.subarray(0,2),o[2*t]=u[2],o[2*t+1]=u[3];if(a[0]===n[0]&&a[1]===n[1])return zl(o);throw Error("Key Data Integrity failed")}function jl(e){const{length:t}=e,r=function(e){if(ts.isString(e)){const{length:t}=e,r=new ArrayBuffer(t),n=new Uint8Array(r);for(let r=0;r0){const r=e[t-1];if(r>=1){const n=e.subarray(t-r),i=new Uint8Array(r).fill(r);if(ts.equalsUint8Array(n,i))return e.subarray(0,t-r)}}throw Error("Invalid padding")}var Vl=Object.freeze({__proto__:null,encode:Zl,decode:Jl});const Yl=ts.getWebCrypto(),$l=ts.getNodeCrypto();function Xl(e,t,r,n){return ts.concatUint8Array([t.write(),new Uint8Array([e]),r.write(),ts.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function ef(e,t,r,n,i=!1,a=!1){let o;if(i){for(o=0;o=0&&0===t[o];o--);t=t.subarray(0,o+1)}return(await Vu.digest(e,ts.concatUint8Array([new Uint8Array([0,0,0,1]),t,n]))).subarray(0,r)}async function tf(e,t,r,n){if(n.length!==e.payloadSize){const t=new Uint8Array(e.payloadSize);t.set(n,e.payloadSize-n.length),n=t}switch(e.type){case"curve25519":{const e=n.slice().reverse();return{secretKey:e,sharedKey:Kh.scalarMult(e,t.subarray(1))}}case"web":if(e.web&&ts.getWebCrypto())try{return await async function(e,t,r,n){const i=Ql(e.payloadSize,e.web.web,r,n);let a=Yl.importKey("jwk",i,{name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]);const o=Sl(e.payloadSize,e.web.web,t);let s=Yl.importKey("jwk",o,{name:"ECDH",namedCurve:e.web.web},!0,[]);[a,s]=await Promise.all([a,s]);let c=Yl.deriveBits({name:"ECDH",namedCurve:e.web.web,public:s},a,e.web.sharedSize),u=Yl.exportKey("jwk",a);[c,u]=await Promise.all([c,u]);const h=new Uint8Array(c);return{secretKey:ss(u.d),sharedKey:h}}(e,t,r,n)}catch(e){ts.printDebugError(e)}break;case"node":return async function(e,t,r){const n=$l.createECDH(e.node.node);n.setPrivateKey(r);const i=new Uint8Array(n.computeSecret(t));return{secretKey:new Uint8Array(n.getPrivateKey()),sharedKey:i}}(e,t,n)}return async function(e,t,r){const n=await ul(e.name);t=cl(n,t),r=sl(n,r);const i=new Uint8Array(r.getPrivate()),a=r.derive(t.getPublic()),o=n.curve.p.byteLength();return{secretKey:i,sharedKey:a.toArrayLike(Uint8Array,"be",o)}}(e,t,n)}var rf=Object.freeze({__proto__:null,validateParams:async function(e,t,r){return _l(Xo.publicKey.ecdh,e,t,r)},encrypt:async function(e,t,r,n,i){const a=Zl(r),o=new Cl(e),{publicKey:s,sharedKey:c}=await async function(e,t){switch(e.type){case"curve25519":{const r=Nh(32),{secretKey:n,sharedKey:i}=await tf(e,t,null,r);let{publicKey:a}=Kh.box.keyPair.fromSecretKey(n);return a=ts.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(e.web&&ts.getWebCrypto())try{return await async function(e,t){const r=Sl(e.payloadSize,e.web.web,t);let n=Yl.generateKey({name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]),i=Yl.importKey("jwk",r,{name:"ECDH",namedCurve:e.web.web},!1,[]);[n,i]=await Promise.all([n,i]);let a=Yl.deriveBits({name:"ECDH",namedCurve:e.web.web,public:i},n.privateKey,e.web.sharedSize),o=Yl.exportKey("jwk",n.publicKey);[a,o]=await Promise.all([a,o]);const s=new Uint8Array(a);return{publicKey:new Uint8Array(kl(o)),sharedKey:s}}(e,t)}catch(e){ts.printDebugError(e)}break;case"node":return async function(e,t){const r=$l.createECDH(e.node.node);r.generateKeys();const n=new Uint8Array(r.computeSecret(t));return{publicKey:new Uint8Array(r.getPublicKey()),sharedKey:n}}(e,t)}return async function(e,t){const r=await ul(e.name),n=await e.genKeyPair();t=cl(r,t);const i=sl(r,n.privateKey),a=n.publicKey,o=i.derive(t.getPublic()),s=r.curve.p.byteLength();return{publicKey:a,sharedKey:o.toArrayLike(Uint8Array,"be",s)}}(e,t)}(o,n),u=Xl(Xo.publicKey.ecdh,e,t,i),{keySize:h}=$u(t.cipher);return{publicKey:s,wrappedKey:Ll(await ef(t.hash,c,h,u),a)}},decrypt:async function(e,t,r,n,i,a,o){const s=new Cl(e),{sharedKey:c}=await tf(s,r,i,a),u=Xl(Xo.publicKey.ecdh,e,t,o),{keySize:h}=$u(t.cipher);let l;for(let r=0;r<3;r++)try{return Jl(Gl(await ef(t.hash,c,h,u,1===r,2===r),n))}catch(e){l=e}throw l}});const nf=ts.getWebCrypto(),af=ts.getNodeCrypto(),of=af&&af.webcrypto&&af.webcrypto.subtle;async function sf(e,t,r,n,i){const a=Xo.read(Xo.webHash,e);if(!a)throw Error("Hash algo not supported with HKDF");if(nf||of){const e=nf||of,o=await e.importKey("raw",t,"HKDF",!1,["deriveBits"]),s=await e.deriveBits({name:"HKDF",hash:a,salt:r,info:n},o,8*i);return new Uint8Array(s)}if(af){const a=Xo.read(Xo.hash,e),o=(e,t)=>af.createHmac(a,e).update(t).digest(),s=o(r,t),c=s.length,u=Math.ceil(i/c),h=new Uint8Array(u*c),l=new Uint8Array(c+n.length+1);l.set(n,c);for(let e=0;e0?l:l.subarray(c));l.set(t,0),h.set(t,e*c)}return h.subarray(0,i)}throw Error("No HKDF implementation available")}const cf={x25519:ts.encodeUTF8("OpenPGP X25519")};var uf=Object.freeze({__proto__:null,generate:async function(e){if(e===Xo.publicKey.x25519){const e=Nh(32),{publicKey:t}=Kh.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(e,t,r){if(e===Xo.publicKey.x25519){const{publicKey:e}=Kh.box.keyPair.fromSecretKey(r);return ts.equalsUint8Array(t,e)}return!1},encrypt:async function(e,t,r){if(e===Xo.publicKey.x25519){const e=Nh(32),n=Kh.scalarMult(e,r),{publicKey:i}=Kh.box.keyPair.fromSecretKey(e),a=ts.concatUint8Array([i,r,n]),{keySize:o}=$u(Xo.symmetric.aes128);return{ephemeralPublicKey:i,wrappedKey:Ll(await sf(Xo.hash.sha256,a,new Uint8Array,cf.x25519,o),t)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(e,t,r,n,i){if(e===Xo.publicKey.x25519){const e=Kh.scalarMult(i,t),a=ts.concatUint8Array([t,n,e]),{keySize:o}=$u(Xo.symmetric.aes128);return Gl(await sf(Xo.hash.sha256,a,new Uint8Array,cf.x25519,o),r)}throw Error("Unsupported ECDH algorithm")}}),hf=Object.freeze({__proto__:null,CurveWithOID:Cl,ecdh:rf,ecdhX:uf,ecdsa:Ol,eddsaLegacy:Kl,eddsa:Nl,generate:async function(e){const t=await ts.getBigInteger();e=new Cl(e);const r=await e.genKeyPair(),n=new t(r.publicKey).toUint8Array(),i=new t(r.privateKey).toUint8Array("be",e.payloadSize);return{oid:e.oid,Q:n,secret:i,hash:e.hash,cipher:e.cipher}},getPreferredHashAlgo:function(e){return Bl[Xo.write(Xo.curve,e.toHex())].hash}}),lf=Object.freeze({__proto__:null,sign:async function(e,t,r,n,i,a){const o=await ts.getBigInteger(),s=new o(1);let c,u,h,l;n=new o(n),i=new o(i),r=new o(r),a=new o(a),r=r.mod(n),a=a.mod(i);const f=new o(t.subarray(0,i.byteLength())).mod(i);for(;;){if(c=await Lh(s,i),u=r.modExp(c,n).imod(i),u.isZero())continue;const e=a.mul(u).imod(i);if(l=f.add(e).imod(i),h=c.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:u.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(e,t,r,n,i,a,o,s){const c=await ts.getBigInteger(),u=new c(0);if(t=new c(t),r=new c(r),a=new c(a),o=new c(o),i=new c(i),s=new c(s),t.lte(u)||t.gte(o)||r.lte(u)||r.gte(o))return ts.printDebug("invalid DSA Signature"),!1;const h=new c(n.subarray(0,o.byteLength())).imod(o),l=r.modInv(o);if(l.isZero())return ts.printDebug("invalid DSA Signature"),!1;i=i.mod(a),s=s.mod(a);const f=h.mul(l).imod(o),d=t.mul(l).imod(o),p=i.modExp(f,a),g=s.modExp(d,a);return p.mul(g).imod(a).imod(o).equal(t)},validateParams:async function(e,t,r,n,i){const a=await ts.getBigInteger();e=new a(e),t=new a(t),r=new a(r),n=new a(n);const o=new a(1);if(r.lte(o)||r.gte(e))return!1;if(!e.dec().mod(t).isZero())return!1;if(!r.modExp(t,e).isOne())return!1;const s=new a(t.bitLength()),c=new a(150);if(s.lt(c)||!await zh(t,null,32))return!1;i=new a(i);const u=new a(2),h=await Lh(u.leftShift(s.dec()),u.leftShift(s)),l=t.mul(h).add(i);return!!n.equal(r.modExp(l,e))}}),ff={rsa:il,elgamal:al,elliptic:hf,dsa:lf,nacl:Kh},df=Object.freeze({__proto__:null,parseSignatureParams:function(e,t){let r=0;switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaSign:return{s:ts.readMPI(t.subarray(r))};case Xo.publicKey.dsa:case Xo.publicKey.ecdsa:{const e=ts.readMPI(t.subarray(r));return r+=e.length+2,{r:e,s:ts.readMPI(t.subarray(r))}}case Xo.publicKey.eddsaLegacy:{let e=ts.readMPI(t.subarray(r));r+=e.length+2,e=ts.leftPad(e,32);let n=ts.readMPI(t.subarray(r));return n=ts.leftPad(n,32),{r:e,s:n}}case Xo.publicKey.ed25519:{const e=t.subarray(r,r+64);return r+=e.length,{RS:e}}default:throw new yl("Unknown signature algorithm.")}},verify:async function(e,t,r,n,i,a){switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaSign:{const{n:e,e:o}=n,s=ts.leftPad(r.s,e.length);return ff.rsa.verify(t,i,s,e,o,a)}case Xo.publicKey.dsa:{const{g:e,p:i,q:o,y:s}=n,{r:c,s:u}=r;return ff.dsa.verify(t,c,u,a,e,i,o,s)}case Xo.publicKey.ecdsa:{const{oid:e,Q:o}=n,s=new ff.elliptic.CurveWithOID(e).payloadSize,c=ts.leftPad(r.r,s),u=ts.leftPad(r.s,s);return ff.elliptic.ecdsa.verify(e,t,{r:c,s:u},i,o,a)}case Xo.publicKey.eddsaLegacy:{const{oid:e,Q:o}=n;return ff.elliptic.eddsaLegacy.verify(e,t,r,i,o,a)}case Xo.publicKey.ed25519:{const{A:o}=n;return ff.elliptic.eddsa.verify(e,t,r,i,o,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(e,t,r,n,i,a){if(!r||!n)throw Error("Missing key parameters");switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaSign:{const{n:e,e:o}=r,{d:s,p:c,q:u,u:h}=n;return{s:await ff.rsa.sign(t,i,e,o,s,c,u,h,a)}}case Xo.publicKey.dsa:{const{g:e,p:i,q:o}=r,{x:s}=n;return ff.dsa.sign(t,a,e,i,o,s)}case Xo.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case Xo.publicKey.ecdsa:{const{oid:e,Q:o}=r,{d:s}=n;return ff.elliptic.ecdsa.sign(e,t,i,o,s,a)}case Xo.publicKey.eddsaLegacy:{const{oid:e,Q:o}=r,{seed:s}=n;return ff.elliptic.eddsaLegacy.sign(e,t,i,o,s,a)}case Xo.publicKey.ed25519:{const{A:o}=r,{seed:s}=n;return ff.elliptic.eddsa.sign(e,t,i,o,s,a)}default:throw Error("Unknown signature algorithm.")}}});class pf{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return ts.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class gf{constructor(e){if(e){const{hash:t,cipher:r}=e;this.hash=t,this.cipher=r}else this.hash=null,this.cipher=null}read(e){if(e.length<4||3!==e[0]||1!==e[1])throw new yl("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class Af{static fromObject({wrappedKey:e,algorithm:t}){const r=new Af;return r.wrappedKey=e,r.algorithm=t,r}read(e){let t=0,r=e[t++];this.algorithm=r%2?e[t++]:null,r-=r%2,this.wrappedKey=e.subarray(t,t+r),t+=r}write(){return ts.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function yf(e){try{e.getName()}catch(e){throw new yl("Unknown curve OID")}}var mf=Object.freeze({__proto__:null,publicKeyEncrypt:async function(e,t,r,n,i){switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:{const{n:e,e:t}=r;return{c:await ff.rsa.encrypt(n,e,t)}}case Xo.publicKey.elgamal:{const{p:e,g:t,y:i}=r;return ff.elgamal.encrypt(n,e,t,i)}case Xo.publicKey.ecdh:{const{oid:e,Q:t,kdfParams:a}=r,{publicKey:o,wrappedKey:s}=await ff.elliptic.ecdh.encrypt(e,a,n,t,i);return{V:o,C:new pf(s)}}case Xo.publicKey.x25519:{if(!ts.isAES(t))throw Error("X25519 keys can only encrypt AES session keys");const{A:i}=r,{ephemeralPublicKey:a,wrappedKey:o}=await ff.elliptic.ecdhX.encrypt(e,n,i);return{ephemeralPublicKey:a,C:Af.fromObject({algorithm:t,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(e,t,r,n,i,a){switch(e){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaEncrypt:{const{c:e}=n,{n:i,e:o}=t,{d:s,p:c,q:u,u:h}=r;return ff.rsa.decrypt(e,i,o,s,c,u,h,a)}case Xo.publicKey.elgamal:{const{c1:e,c2:i}=n,o=t.p,s=r.x;return ff.elgamal.decrypt(e,i,o,s,a)}case Xo.publicKey.ecdh:{const{oid:e,Q:a,kdfParams:o}=t,{d:s}=r,{V:c,C:u}=n;return ff.elliptic.ecdh.decrypt(e,o,c,u.data,a,s,i)}case Xo.publicKey.x25519:{const{A:i}=t,{k:a}=r,{ephemeralPublicKey:o,C:s}=n;if(!ts.isAES(s.algorithm))throw Error("AES session key expected");return ff.elliptic.ecdhX.decrypt(e,o,s.wrappedKey,i,a)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(e,t){let r=0;switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=ts.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{n:e,e:n}}}case Xo.publicKey.dsa:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=ts.readMPI(t.subarray(r));r+=n.length+2;const i=ts.readMPI(t.subarray(r));r+=i.length+2;const a=ts.readMPI(t.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:e,q:n,g:i,y:a}}}case Xo.publicKey.elgamal:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=ts.readMPI(t.subarray(r));r+=n.length+2;const i=ts.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{p:e,g:n,y:i}}}case Xo.publicKey.ecdsa:{const e=new ol;r+=e.read(t),yf(e);const n=ts.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{oid:e,Q:n}}}case Xo.publicKey.eddsaLegacy:{const e=new ol;r+=e.read(t),yf(e);let n=ts.readMPI(t.subarray(r));return r+=n.length+2,n=ts.leftPad(n,33),{read:r,publicParams:{oid:e,Q:n}}}case Xo.publicKey.ecdh:{const e=new ol;r+=e.read(t),yf(e);const n=ts.readMPI(t.subarray(r));r+=n.length+2;const i=new gf;return r+=i.read(t.subarray(r)),{read:r,publicParams:{oid:e,Q:n,kdfParams:i}}}case Xo.publicKey.ed25519:case Xo.publicKey.x25519:{const e=t.subarray(r,r+32);return r+=e.length,{read:r,publicParams:{A:e}}}default:throw new yl("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(e,t,r){let n=0;switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:{const e=ts.readMPI(t.subarray(n));n+=e.length+2;const r=ts.readMPI(t.subarray(n));n+=r.length+2;const i=ts.readMPI(t.subarray(n));n+=i.length+2;const a=ts.readMPI(t.subarray(n));return n+=a.length+2,{read:n,privateParams:{d:e,p:r,q:i,u:a}}}case Xo.publicKey.dsa:case Xo.publicKey.elgamal:{const e=ts.readMPI(t.subarray(n));return n+=e.length+2,{read:n,privateParams:{x:e}}}case Xo.publicKey.ecdsa:case Xo.publicKey.ecdh:{const e=new Cl(r.oid);let i=ts.readMPI(t.subarray(n));return n+=i.length+2,i=ts.leftPad(i,e.payloadSize),{read:n,privateParams:{d:i}}}case Xo.publicKey.eddsaLegacy:{const e=new Cl(r.oid);let i=ts.readMPI(t.subarray(n));return n+=i.length+2,i=ts.leftPad(i,e.payloadSize),{read:n,privateParams:{seed:i}}}case Xo.publicKey.ed25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{seed:e}}}case Xo.publicKey.x25519:{const e=t.subarray(n,n+32);return n+=e.length,{read:n,privateParams:{k:e}}}default:throw new yl("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(e,t){let r=0;switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:return{c:ts.readMPI(t.subarray(r))};case Xo.publicKey.elgamal:{const e=ts.readMPI(t.subarray(r));return r+=e.length+2,{c1:e,c2:ts.readMPI(t.subarray(r))}}case Xo.publicKey.ecdh:{const e=ts.readMPI(t.subarray(r));r+=e.length+2;const n=new pf;return n.read(t.subarray(r)),{V:e,C:n}}case Xo.publicKey.x25519:{const e=t.subarray(r,r+32);r+=e.length;const n=new Af;return n.read(t.subarray(r)),{ephemeralPublicKey:e,C:n}}default:throw new yl("Unknown public key encryption algorithm.")}},serializeParams:function(e,t){const r=new Set([Xo.publicKey.ed25519,Xo.publicKey.x25519]),n=Object.keys(t).map((n=>{const i=t[n];return ts.isUint8Array(i)?r.has(e)?i:ts.uint8ArrayToMPI(i):i.write()}));return ts.concatUint8Array(n)},generateParams:function(e,t,r){switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:return ff.rsa.generate(t,65537).then((({n:e,e:t,d:r,p:n,q:i,u:a})=>({privateParams:{d:r,p:n,q:i,u:a},publicParams:{n:e,e:t}})));case Xo.publicKey.ecdsa:return ff.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{d:r},publicParams:{oid:new ol(e),Q:t}})));case Xo.publicKey.eddsaLegacy:return ff.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{seed:r},publicParams:{oid:new ol(e),Q:t}})));case Xo.publicKey.ecdh:return ff.elliptic.generate(r).then((({oid:e,Q:t,secret:r,hash:n,cipher:i})=>({privateParams:{d:r},publicParams:{oid:new ol(e),Q:t,kdfParams:new gf({hash:n,cipher:i})}})));case Xo.publicKey.ed25519:return ff.elliptic.eddsa.generate(e).then((({A:e,seed:t})=>({privateParams:{seed:t},publicParams:{A:e}})));case Xo.publicKey.x25519:return ff.elliptic.ecdhX.generate(e).then((({A:e,k:t})=>({privateParams:{k:t},publicParams:{A:e}})));case Xo.publicKey.dsa:case Xo.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(e,t,r){if(!t||!r)throw Error("Missing key parameters");switch(e){case Xo.publicKey.rsaEncrypt:case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:{const{n:e,e:n}=t,{d:i,p:a,q:o,u:s}=r;return ff.rsa.validateParams(e,n,i,a,o,s)}case Xo.publicKey.dsa:{const{p:e,q:n,g:i,y:a}=t,{x:o}=r;return ff.dsa.validateParams(e,n,i,a,o)}case Xo.publicKey.elgamal:{const{p:e,g:n,y:i}=t,{x:a}=r;return ff.elgamal.validateParams(e,n,i,a)}case Xo.publicKey.ecdsa:case Xo.publicKey.ecdh:{const n=ff.elliptic[Xo.read(Xo.publicKey,e)],{oid:i,Q:a}=t,{d:o}=r;return n.validateParams(i,a,o)}case Xo.publicKey.eddsaLegacy:{const{Q:e,oid:n}=t,{seed:i}=r;return ff.elliptic.eddsaLegacy.validateParams(n,e,i)}case Xo.publicKey.ed25519:{const{A:n}=t,{seed:i}=r;return ff.elliptic.eddsa.validateParams(e,n,i)}case Xo.publicKey.x25519:{const{A:n}=t,{k:i}=r;return ff.elliptic.ecdhX.validateParams(e,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(e){const{blockSize:t}=$u(e),r=await Nh(t),n=new Uint8Array([r[r.length-2],r[r.length-1]]);return ts.concat([r,n])},generateSessionKey:function(e){const{keySize:t}=$u(e);return Nh(t)},getAEADMode:function(e){const t=Xo.read(Xo.aead,e);return Oh[t]},getCipher:$u,getPreferredCurveHashAlgo:function(e,t){switch(e){case Xo.publicKey.ecdsa:case Xo.publicKey.eddsaLegacy:return ff.elliptic.getPreferredHashAlgo(t);case Xo.publicKey.ed25519:return ff.elliptic.eddsa.getPreferredHashAlgo(e);default:throw Error("Unknown elliptic signing algo")}}});const bf={cipher:Js,hash:Vu,mode:Oh,publicKey:ff,signature:df,random:Gh,pkcs1:$h,pkcs5:Vl,aesKW:Wl};Object.assign(bf,mf);var wf="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;const vf={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(let a=0;a=0;)e[t]=0}const xf=0,Pf=1,Mf=2,Uf=29,Df=256,Rf=Df+1+Uf,Ff=30,Tf=19,qf=2*Rf+1,Of=15,Kf=16,Hf=256,Nf=16,Lf=17,Gf=18,jf=[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],zf=[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],Wf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Zf=Array(2*(Rf+2));Qf(Zf);const Jf=Array(2*Ff);Qf(Jf);const Vf=Array(512);Qf(Vf);const Yf=Array(256);Qf(Yf);const $f=Array(Uf);Qf($f);const Xf=Array(Ff);function ed(e){return e<256?Vf[e]:Vf[256+(e>>>7)]}function td(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function rd(e,t,r){e.bi_valid>Kf-r?(e.bi_buf|=t<>Kf-e.bi_valid,e.bi_valid+=r-Kf):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function ad(e,t,r){const n=Array(Of+1);let i,a,o=0;for(i=1;i<=Of;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){const t=e[2*a+1];0!==t&&(e[2*a]=id(n[t]++,t))}}function od(e){let t;for(t=0;t8?td(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function cd(e,t,r,n){const i=2*t,a=2*r;return e[i]>1;o>=1;o--)ud(e,r,o);c=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ud(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*c]=r[2*o]+r[2*s],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=c,e.heap[1]=c++,ud(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,l,f,d,p,g=0;for(f=0;f<=Of;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;uc&&(f=c,g++),r[2*h+1]=f,h>n||(e.bl_count[f]++,d=0,h>=s&&(d=o[h-s]),p=r[2*h],e.opt_len+=p*(f+d),a&&(e.static_len+=p*(i[2*h+1]+d)));if(0!==g){do{for(f=c-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(f=c;0!==f;f--)for(h=e.bl_count[f];0!==h;)l=e.heap[--u],l>n||(r[2*l+1]!==f&&(e.opt_len+=(f-r[2*l+1])*r[2*l],r[2*l+1]=f),h--)}}(e,t),ad(r,u,e.bl_count)}function fd(e,t,r){let n,i,a=-1,o=t[1],s=0,c=7,u=4;for(0===o&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Yf[r]+Df+1)]++,e.dyn_dtree[2*ed(t)]++),e.last_lit===e.lit_bufsize-1}function Ad(e,t,r,n){let i=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}const yd=function(){let e;const t=[];for(let r=0;r<256;r++){e=r;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function md(e,t,r,n){const i=yd,a=n+r;e^=-1;for(let r=n;r>>8^i[255&(e^t[r])];return-1^e}const bd=3,wd=258,vd=wd+bd+1;function Id(e){const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Bf(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Ed(e,t){(function(e,t,r,n){let i,a,o=0;e.level>0?(e.strm.data_type===Sf&&(e.strm.data_type=function(e){let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return _f;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return kf;for(t=32;t=3&&0===e.bl_tree[2*Wf[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?pd(e,t,r,n):e.strategy===Cf||a===i?(rd(e,(Pf<<1)+(n?1:0),3),hd(e,Zf,Jf)):(rd(e,(Mf<<1)+(n?1:0),3),function(e,t,r,n){let i;for(rd(e,t-257,5),rd(e,r-1,5),rd(e,n-4,4),i=0;i=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Id(e.strm)}function Bd(e,t,r,n){let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,Bf(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=Ad(e.adler,t,i,r):2===e.state.wrap&&(e.adler=md(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function Cd(e,t){let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-vd?e.strstart-(e.w_size-vd):0,u=e.window,h=e.w_mask,l=e.prev,f=e.strstart+wd;let d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,u[r+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=l[t&h])>c&&0!=--i);return o<=e.lookahead?o:e.lookahead}function _d(e){const t=e.w_size;let r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-vd)){Bf(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);a+=t}if(0===e.strm.avail_in)break;if(n=Bd(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=bd)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=bd&&(e.ins_h=(e.ins_h<=bd)if(n=gd(e,e.strstart-e.match_start,e.match_length-bd),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=bd){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=bd&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=bd-1)),e.prev_length>=bd&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-bd,n=gd(e,e.strstart-1-e.prev_match,e.prev_length-bd),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_d(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Ed(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-vd&&(Ed(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Ed(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Ed(e,!1),e.strm.avail_out),1)})),new Qd(4,4,8,4,kd),new Qd(4,5,16,8,kd),new Qd(4,6,32,32,kd),new Qd(4,4,16,16,Sd),new Qd(8,16,32,32,Sd),new Qd(8,16,128,128,Sd),new Qd(8,32,128,256,Sd),new Qd(32,128,258,1024,Sd),new Qd(32,258,258,4096,Sd);try{String.fromCharCode.call(null,0)}catch(uo){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(uo){}const xd=new Ef(256);for(let e=0;e<256;e++)xd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;xd[254]=xd[254]=1;var Pd=[0,1,3,7,15,31,63,127,255],Md=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Md.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},Md.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Pd[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var n=r-e;t|=(this.curByte&Pd[e]<>n,this.bitOffset+=e,e=0}}return t},Md.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1},Md.prototype.pi=function(){var e,t=new Uint8Array(6);for(e=0;e("00"+e.toString(16)).slice(-2))).join("")}(t)};var Ud=Md,Dd=function(){};Dd.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Dd.prototype.read=function(e,t,r){for(var n=0;n>>0},this.updateCRC=function(t){e=e<<8^Rd[255&(e>>>24^t)]},this.updateCRCRun=function(t,r){for(;r-- >0;)e=e<<8^Rd[255&(e>>>24^t)]}}),Td=function(e,t){var r,n=e[t];for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},qd=-2,Od=-3,Kd=-4,Hd=-5,Nd=-6,Ld=-7,Gd={"-1":"Bad file checksum"};Gd[qd]="Not bzip data",Gd[Od]="Unexpected input EOF",Gd[Kd]="Unexpected output EOF",Gd[Hd]="Data error",Gd[Nd]="Out of memory",Gd[Ld]="Obsolete (pre 0.9.5) bzip format not supported.";var jd=function(e,t){var r=Gd[e]||"unknown error";t&&(r+=": "+t);var n=new TypeError(r);throw n.errorCode=e,n},zd=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};zd.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new Fd,!0):(this.writeCount=-1,!1)},zd.prototype._start_bunzip=function(e,t){var r=new Uint8Array(4);4===e.read(r,0,4)&&"BZh"===String.fromCharCode(r[0],r[1],r[2])||jd(qd,"bad magic");var n=r[3]-48;(n<1||n>9)&&jd(qd,"level out of range"),this.reader=new Ud(e),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},zd.prototype._get_next_block=function(){var e,t,r,n=this.reader,i=n.pi();if("177245385090"===i)return!1;"314159265359"!==i&&jd(qd),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&jd(Ld);var a=n.read(24);a>this.dbufSize&&jd(Hd,"initial position out of bounds");var o=n.read(16),s=new Uint8Array(256),c=0;for(e=0;e<16;e++)if(o&1<<15-e){var u=16*e;for(r=n.read(16),t=0;t<16;t++)r&1<<15-t&&(s[c++]=u+t)}var h=n.read(3);(h<2||h>6)&&jd(Hd);var l=n.read(15);0===l&&jd(Hd);var f=new Uint8Array(256);for(e=0;e=h&&jd(Hd);d[e]=Td(f,t)}var p,g=c+2,A=[];for(t=0;t20)&&jd(Hd),n.read(1);)n.read(1)?o--:o++;b[e]=o}for(y=m=b[0],e=1;em?m=b[e]:b[e]=l&&jd(Hd),p=A[d[_++]]),e=p.minLen,t=n.read(e);e>p.maxLen&&jd(Hd),!(t<=p.limit[e]);e++)t=t<<1|n.read(1);((t-=p.base[e])<0||t>=258)&&jd(Hd);var S=p.permute[t];if(0!==S&&1!==S){if(B)for(B=0,C+o>this.dbufSize&&jd(Hd),I[E=s[f[0]]]+=o;o--;)k[C++]=E;if(S>c)break;C>=this.dbufSize&&jd(Hd),I[E=s[E=Td(f,e=S-1)]]++,k[C++]=E}else B||(B=1,o=0),o+=0===S?B:2*B,B<<=1}for((a<0||a>=C)&&jd(Hd),t=0,e=0;e<256;e++)r=t+I[e],I[e]=t,t=r;for(e=0;e>=8,P=-1),this.writePos=Q,this.writeCurrent=x,this.writeCount=C,this.writeRun=P,!0},zd.prototype._read_bunzip=function(e,t){var r,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var u=this.writeRun;c;){for(c--,n=s,s=255&(o=a[o]),o>>=8,3==u++?(r=s,i=n,s=-1):(r=1,i=s),this.blockCRC.updateCRCRun(i,r);r--;)this.outputStream.writeByte(i),this.nextoutput++;s!=n&&(u=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&jd(Hd,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};const Wd=Symbol("verified"),Zd=new Set([Xo.signatureSubpacket.issuer,Xo.signatureSubpacket.issuerFingerprint,Xo.signatureSubpacket.embeddedSignature]);class Jd{static get tag(){return Xo.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new bs,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Wd]=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new yl(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=bf.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Vo((async()=>bf.serializeParams(this.publicKeyAlgorithm,await this.params))):bf.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),ts.concat(e)}async sign(e,t,r=new Date,n=!1){5===e.version?this.version=5:this.version=4;const i=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=ts.normalizeDate(r),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),i.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=ts.concat(i);const a=this.toHash(this.signatureType,t,n),o=await this.hash(this.signatureType,t,a,n);this.signedHashValue=Zo(jo(o),0,2);const s=async()=>bf.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,a,await Jo(o));ts.isStream(o)?this.params=s():(this.params=await s(),this[Wd]=!0)}writeHashedSubPackets(){const e=Xo.signatureSubpacket,t=[];let r;if(null===this.created)throw Error("Missing signature creation time");t.push(Vd(e.signatureCreationTime,!0,ts.writeDate(this.created))),null!==this.signatureExpirationTime&&t.push(Vd(e.signatureExpirationTime,!0,ts.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&t.push(Vd(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(r=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Vd(e.trustSignature,!0,r))),null!==this.regularExpression&&t.push(Vd(e.regularExpression,!0,this.regularExpression)),null!==this.revocable&&t.push(Vd(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&t.push(Vd(e.keyExpirationTime,!0,ts.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Vd(e.preferredSymmetricAlgorithms,!1,r))),null!==this.revocationKeyClass&&(r=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),r=ts.concat([r,this.revocationKeyFingerprint]),t.push(Vd(e.revocationKey,!1,r))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||t.push(Vd(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:n,value:i,humanReadable:a,critical:o})=>{r=[new Uint8Array([a?128:0,0,0,0])];const s=ts.encodeUTF8(n);r.push(ts.writeNumber(s.length,2)),r.push(ts.writeNumber(i.length,2)),r.push(s),r.push(i),r=ts.concat(r),t.push(Vd(e.notationData,o,r))})),null!==this.preferredHashAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Vd(e.preferredHashAlgorithms,!1,r))),null!==this.preferredCompressionAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Vd(e.preferredCompressionAlgorithms,!1,r))),null!==this.keyServerPreferences&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.keyServerPreferences)),t.push(Vd(e.keyServerPreferences,!1,r))),null!==this.preferredKeyServer&&t.push(Vd(e.preferredKeyServer,!1,ts.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&t.push(Vd(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&t.push(Vd(e.policyURI,!1,ts.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.keyFlags)),t.push(Vd(e.keyFlags,!0,r))),null!==this.signersUserID&&t.push(Vd(e.signersUserID,!1,ts.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(r=ts.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Vd(e.reasonForRevocation,!0,r))),null!==this.features&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.features)),t.push(Vd(e.features,!1,r))),null!==this.signatureTargetPublicKeyAlgorithm&&(r=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],r.push(ts.stringToUint8Array(this.signatureTargetHash)),r=ts.concat(r),t.push(Vd(e.signatureTarget,!0,r))),null!==this.embeddedSignature&&t.push(Vd(e.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=ts.concat(r),t.push(Vd(e.issuerFingerprint,5===this.version,r))),null!==this.preferredAEADAlgorithms&&(r=ts.stringToUint8Array(ts.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Vd(e.preferredAEADAlgorithms,!1,r)));const n=ts.concat(t),i=ts.writeNumber(n.length,2);return ts.concat([i,n])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach((t=>{e.push(ll(t.length)),e.push(t)}));const t=ts.concat(e),r=ts.writeNumber(t.length,2);return ts.concat([r,t])}readSubPacket(e,t=!0){let r=0;const n=!!(128&e[r]),i=127&e[r];if(t||(this.unhashedSubpackets.push(e.subarray(r,e.length)),Zd.has(i)))switch(r++,i){case Xo.signatureSubpacket.signatureCreationTime:this.created=ts.readDate(e.subarray(r,e.length));break;case Xo.signatureSubpacket.signatureExpirationTime:{const t=ts.readNumber(e.subarray(r,e.length));this.signatureNeverExpires=0===t,this.signatureExpirationTime=t;break}case Xo.signatureSubpacket.exportableCertification:this.exportable=1===e[r++];break;case Xo.signatureSubpacket.trustSignature:this.trustLevel=e[r++],this.trustAmount=e[r++];break;case Xo.signatureSubpacket.regularExpression:this.regularExpression=e[r];break;case Xo.signatureSubpacket.revocable:this.revocable=1===e[r++];break;case Xo.signatureSubpacket.keyExpirationTime:{const t=ts.readNumber(e.subarray(r,e.length));this.keyExpirationTime=t,this.keyNeverExpires=0===t;break}case Xo.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.revocationKey:this.revocationKeyClass=e[r++],this.revocationKeyAlgorithm=e[r++],this.revocationKeyFingerprint=e.subarray(r,r+20);break;case Xo.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(r,e.length));break;case Xo.signatureSubpacket.notationData:{const t=!!(128&e[r]);r+=4;const i=ts.readNumber(e.subarray(r,r+2));r+=2;const a=ts.readNumber(e.subarray(r,r+2));r+=2;const o=ts.decodeUTF8(e.subarray(r,r+i)),s=e.subarray(r+i,r+i+a);this.rawNotations.push({name:o,humanReadable:t,value:s,critical:n}),t&&(this.notations[o]=ts.decodeUTF8(s));break}case Xo.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==e[r++];break;case Xo.signatureSubpacket.policyURI:this.policyURI=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.signersUserID:this.signersUserID=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[r++],this.reasonForRevocationString=ts.decodeUTF8(e.subarray(r,e.length));break;case Xo.signatureSubpacket.features:this.features=[...e.subarray(r,e.length)];break;case Xo.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[r++],this.signatureTargetHashAlgorithm=e[r++];const t=bf.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=ts.uint8ArrayToString(e.subarray(r,r+t));break}case Xo.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Jd,this.embeddedSignature.read(e.subarray(r,e.length));break;case Xo.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[r++],this.issuerFingerprint=e.subarray(r,e.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case Xo.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(r,e.length)];break;default:{const e=Error("Unknown signature subpacket type "+i);if(n)throw e;ts.printDebug(e)}}}readSubPackets(e,t=!0,r){const n=ts.readNumber(e.subarray(0,2));let i=2;for(;i<2+n;){const n=hl(e.subarray(i,e.length));i+=n.offset,this.readSubPacket(e.subarray(i,i+n.len),t,r),i+=n.len}return i}toSign(e,t){const r=Xo.signature;switch(e){case r.binary:return null!==t.text?ts.encodeUTF8(t.getText(!0)):t.getBytes(!0);case r.text:{const e=t.getBytes(!0);return ts.canonicalizeEOL(e)}case r.standalone:return new Uint8Array(0);case r.certGeneric:case r.certPersona:case r.certCasual:case r.certPositive:case r.certRevocation:{let e,n;if(t.userID)n=180,e=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");n=209,e=t.userAttribute}const i=e.write();return ts.concat([this.toSign(r.key,t),new Uint8Array([n]),ts.writeNumber(i.length,4),i])}case r.subkeyBinding:case r.subkeyRevocation:case r.keyBinding:return ts.concat([this.toSign(r.key,t),this.toSign(r.key,{key:t.bind})]);case r.key:if(void 0===t.key)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case r.keyRevocation:return this.toSign(r.key,t);case r.timestamp:return new Uint8Array(0);case r.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let r=0;return Lo(jo(this.signatureData),(e=>{r+=e.length}),(()=>{const n=[];return 5!==this.version||this.signatureType!==Xo.signature.binary&&this.signatureType!==Xo.signature.text||(t?n.push(new Uint8Array(6)):n.push(e.writeHeader())),n.push(new Uint8Array([this.version,255])),5===this.version&&n.push(new Uint8Array(4)),n.push(ts.writeNumber(r,4)),ts.concat(n)}))}toHash(e,t,r=!1){const n=this.toSign(e,t);return ts.concat([n,this.signatureData,this.calculateTrailer(t,r)])}async hash(e,t,r,n=!1){return r||(r=this.toHash(e,t,n)),bf.hash.digest(this.hashAlgorithm,r)}async verify(e,t,r,n=new Date,i=!1,a=us){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===Xo.signature.binary||t===Xo.signature.text;if(!this[Wd]||o){let n,a;if(this.hashed?a=await this.hashed:(n=this.toHash(t,r,i),a=await this.hash(t,r,n)),a=await Jo(a),this.signedHashValue[0]!==a[0]||this.signedHashValue[1]!==a[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[Wd]=await bf.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,n,a),!this[Wd])throw Error("Signature verification failed")}const s=ts.normalizeDate(n);if(s&&this.created>s)throw Error("Signature creation time is in the future");if(s&&s>=this.getExpirationTime())throw Error("Signature is expired");if(a.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+Xo.read(Xo.hash,this.hashAlgorithm).toUpperCase());if(a.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[Xo.signature.binary,Xo.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+Xo.read(Xo.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:e,critical:t})=>{if(t&&a.knownNotations.indexOf(e)<0)throw Error("Unknown critical notation: "+e)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=ts.normalizeDate(e);return null!==t&&!(this.created<=t&&tJd.prototype.calculateTrailer.apply(await this.correspondingSig,e)))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==Xo.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function $d(e,t){if(!t[e]){let r;try{r=Xo.read(Xo.packet,e)}catch(t){throw new yl("Unknown packet type with tag: "+e)}throw Error("Packet not allowed in this context: "+r)}return new t[e]}Yd.prototype.hash=Jd.prototype.hash,Yd.prototype.toHash=Jd.prototype.toHash,Yd.prototype.toSign=Jd.prototype.toSign;class Xd extends Array{static async fromBinary(e,t,r=us){const n=new Xd;return await n.read(e,t,r),n}async read(e,t,r=us){r.additionalAllowedPackets.length&&(t={...t,...ts.constructAllowedPackets(r.additionalAllowedPackets)}),this.stream=Go(e,(async(e,n)=>{const i=Oo(n);try{for(;;)if(await i.ready,await Al(e,(async e=>{try{if(e.tag===Xo.packet.marker||e.tag===Xo.packet.trust)return;const n=$d(e.tag,t);n.packets=new Xd,n.fromStream=ts.isStream(e.packet),await n.read(e.packet,r),await i.write(n)}catch(t){const n=!r.ignoreUnsupportedPackets&&t instanceof yl,a=!(r.ignoreMalformedPackets||t instanceof yl);if(n||a||gl(e.tag))await i.abort(t);else{const t=new ml(e.tag,e.packet);await i.write(t)}ts.printDebugError(t)}})))return await i.ready,void await i.close()}catch(e){await i.abort(e)}}));const n=qo(this.stream);for(;;){const{done:e,value:t}=await n.read();if(e?this.stream=null:this.push(t),e||gl(t.constructor.tag))break}n.releaseLock()}write(){const e=[];for(let t=0;t{if(t.push(e),i+=e.length,i>=a){const e=Math.min(Math.log(i)/Math.LN2|0,30),r=2**e,n=ts.concat([fl(e)].concat(t));return t=[n.subarray(1+r)],i=t[0].length,n.subarray(0,1+r)}}),(()=>ts.concat([ll(i)].concat(t)))))}else{if(ts.isStream(n)){let t=0;e.push(Lo(jo(n),(e=>{t+=e.length}),(()=>pl(r,t))))}else e.push(pl(r,n.length));e.push(n)}}return ts.concat(e)}filterByTag(...e){const t=new Xd,r=e=>t=>e===t;for(let n=0;nt.constructor.tag===e))}indexOfTag(...e){const t=[],r=this,n=e=>t=>e===t;for(let i=0;i>4)}read(e){let t=0;try{this.type=Xo.read(Xo.s2k,e[t++])}catch(e){throw new yl("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==ts.uint8ArrayToString(e.subarray(t,t+3)))throw new yl("Unknown s2k type.");if(t+=3,1001!==1e3+e[t++])throw new yl("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new yl("Unknown s2k type.")}return t}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...ts.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([Xo.write(Xo.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return ts.concatUint8Array(e)}async produceKey(e,t){e=ts.encodeUTF8(e);const r=[];let n=0,i=0;for(;n{this.privateParams[e].fill(0),delete this.privateParams[e]})),this.privateParams=null,this.isEncrypted=!0)}}async function op(e,t,r){const{keySize:n}=bf.getCipher(r);return e.produceKey(t,n)}var sp=sc((function(e){!function(t){function r(e){function t(){return Ee0&&(t.semantic=" "),t}}function A(e,t){return function(){var n,a,s,u,h;for(u=r(),n=o("star"),s=0,h=void 0===t?0:t;null!==(a=e());)s+=1,c(n,a);return s>=h?n:(i(u),null)}}function y(e){return e.charCodeAt(0)>=128}function m(){return s("cr",h("\r")())}function b(){return s("crlf",l(m,I)())}function w(){return s("dquote",h('"')())}function v(){return s("htab",h("\t")())}function I(){return s("lf",h("\n")())}function E(){return s("sp",h(" ")())}function B(){return s("vchar",u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n})))}function C(){return s("wsp",f(E,v)())}function _(){var e=s("quoted-pair",f(l(h("\\"),f(B,C)),ne)());return null===e?null:(e.semantic=e.semantic[1],e)}function k(){return s("fws",f(ae,l(d(l(A(C),p(b))),A(C,1)))())}function S(){return s("ctext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=39||42<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),te)())}function Q(){return s("ccontent",f(S,_,x)())}function x(){return s("comment",l(h("("),A(l(d(k),Q)),d(k),h(")"))())}function P(){return s("cfws",f(l(A(l(d(k),x),1),d(k)),k)())}function M(){return s("atext",u((function(t){var r="a"<=t&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(t)>=0;return e.rfc6532&&(r=r||y(t)),r})))}function U(){return s("atom",l(g(d(P)),A(M,1),g(d(P)))())}function D(){var e,t;return null===(e=s("dot-atom-text",A(M,1)()))||null!==(t=A(l(h("."),A(M,1)))())&&c(e,t),e}function R(){return s("dot-atom",l(p(d(P)),D,p(d(P)))())}function F(){return s("qtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33===r||35<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),re)())}function T(){return s("qcontent",f(F,_)())}function q(){return s("quoted-string",l(p(d(P)),p(w),A(l(d(g(k)),T)),d(p(k)),p(w),p(d(P)))())}function O(){return s("word",f(U,q)())}function K(){return s("address",f(H,G)())}function H(){return s("mailbox",f(N,X)())}function N(){return s("name-addr",l(d(j),L)())}function L(){return s("angle-addr",f(l(p(d(P)),h("<"),X,h(">"),p(d(P))),oe)())}function G(){return s("group",l(j,h(":"),d(Z),h(";"),p(d(P)))())}function j(){return s("display-name",(null!==(e=s("phrase",f(ie,A(O,1))()))&&(e.semantic=function(e){return e.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(e.semantic)),e));var e}function z(){return s("mailbox-list",f(l(H,A(l(h(","),H))),ue)())}function W(){return s("address-list",f(l(K,A(l(h(","),K))),he)())}function Z(){return s("group-list",f(z,p(P),le)())}function J(){return s("local-part",f(fe,R,q)())}function V(){return s("dtext",f((function(){return u((function(t){var r=t.charCodeAt(0),n=33<=r&&r<=90||94<=r&&r<=126;return e.rfc6532&&(n=n||y(t)),n}))}),pe)())}function Y(){return s("domain-literal",l(p(d(P)),h("["),A(l(d(k),V)),d(k),h("]"),p(d(P)))())}function $(){return s("domain",(t=f(de,R,Y)(),e.rejectTLD&&t&&t.semantic&&t.semantic.indexOf(".")<0?null:(t&&(t.semantic=t.semantic.replace(/\s+/g,"")),t)));var t}function X(){return s("addr-spec",l(J,h("@"),$)())}function ee(){return e.strict?null:s("obs-NO-WS-CTL",u((function(e){var t=e.charCodeAt(0);return 1<=t&&t<=8||11===t||12===t||14<=t&&t<=31||127===t})))}function te(){return e.strict?null:s("obs-ctext",ee())}function re(){return e.strict?null:s("obs-qtext",ee())}function ne(){return e.strict?null:s("obs-qp",l(h("\\"),f(h("\0"),ee,I,m))())}function ie(){return e.strict?null:e.atInDisplayName?s("obs-phrase",l(O,A(f(O,h("."),h("@"),g(P))))()):s("obs-phrase",l(O,A(f(O,h("."),g(P))))())}function ae(){return e.strict?null:s("obs-FWS",A(l(p(d(b)),C),1)())}function oe(){return e.strict?null:s("obs-angle-addr",l(p(d(P)),h("<"),se,X,h(">"),p(d(P)))())}function se(){return e.strict?null:s("obs-route",l(ce,h(":"))())}function ce(){return e.strict?null:s("obs-domain-list",l(A(f(p(P),h(","))),h("@"),$,A(l(h(","),p(d(P)),d(l(h("@"),$)))))())}function ue(){return e.strict?null:s("obs-mbox-list",l(A(l(p(d(P)),h(","))),H,A(l(h(","),d(l(H,p(P))))))())}function he(){return e.strict?null:s("obs-addr-list",l(A(l(p(d(P)),h(","))),K,A(l(h(","),d(l(K,p(P))))))())}function le(){return e.strict?null:s("obs-group-list",l(A(l(p(d(P)),h(",")),1),p(d(P)))())}function fe(){return e.strict?null:s("obs-local-part",l(O,A(l(h("."),O)))())}function de(){return e.strict?null:s("obs-domain",l(U,A(l(h("."),U)))())}function pe(){return e.strict?null:s("obs-dtext",f(ee,_)())}function ge(e,t){var r,n,i;if(null==t)return null;for(n=[t];n.length>0;){if((i=n.pop()).name===e)return i;for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r])}return null}function Ae(e,t){var r,n,i,a,o;if(null==t)return null;for(n=[t],a=[],o={},r=0;r0;)if((i=n.pop()).name in o)a.push(i);else for(r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}function ye(t){var r,n,i,a,o;if(null===t)return null;for(r=[],n=Ae(["group","mailbox"],t),i=0;i1?null:t.addresses&&t.addresses[0]:null}(o):e.simple?o&&o.addresses:o}function me(e){var t,r=ge("display-name",e),n=[],i=Ae(["mailbox"],e);for(t=0;t0;)for("cfws"===(i=n.pop()).name&&a.push(i),r=i.children.length-1;r>=0;r-=1)n.push(i.children[r]);return a}(0,e),i=Ae(["comment"],e),a=ge("local-part",r),o=ge("domain",r);return{node:e,parts:{name:t,address:r,local:a,domain:o,comments:n},type:e.name,name:we(t),address:we(r),local:we(a),domain:we(o),comments:ve(i),groupName:we(e.groupName)}}function we(e){return null!=e?e.semantic:null}function ve(e){var t="";if(e)for(var r=0;r`),t.userID=r.join(" "),t}read(e,t=us){const r=ts.decodeUTF8(e);if(r.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:e,address:t,comments:n}=sp.parseOneAddress({input:r,atInDisplayName:!0});this.comment=n.replace(/^\(|\)$/g,""),this.name=e,this.email=t}catch(e){}this.userID=r}write(){return ts.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class up extends ap{static get tag(){return Xo.packet.secretSubkey}constructor(e=new Date,t=us){super(e,t)}}async function hp(e,t,r,n,i=new Date,a){let o,s;for(let c=e.length-1;c>=0;c--)try{(!o||e[c].created>=o.created)&&(await e[c].verify(t,r,n,i,void 0,a),o=e[c])}catch(e){s=e}if(!o)throw ts.wrapError(`Could not find valid ${Xo.read(Xo.signature,r)} signature in key ${t.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((e,t,r)=>t+" "+r.toLowerCase())),s);return o}function lp(e,t,r=new Date){const n=ts.normalizeDate(r);if(null!==n){const r=gp(e,t);return!(e.created<=n&&ne.equals(i.issuerKeyID)))||i.revoked||!1,i.revoked):c.length>0}function gp(e,t){let r;return!1===t.keyNeverExpires&&(r=e.created.getTime()+1e3*t.keyExpirationTime),r?new Date(r):1/0}function Ap(e,t){const r=e.algorithm;return r!==Xo.publicKey.rsaEncrypt&&r!==Xo.publicKey.elgamal&&r!==Xo.publicKey.ecdh&&r!==Xo.publicKey.x25519&&(!t.keyFlags||0!=(t.keyFlags[0]&Xo.keyFlags.signData))}function yp(e,t){const r=e.algorithm;return r!==Xo.publicKey.dsa&&r!==Xo.publicKey.rsaSign&&r!==Xo.publicKey.ecdsa&&r!==Xo.publicKey.eddsaLegacy&&r!==Xo.publicKey.ed25519&&(!t.keyFlags||0!=(t.keyFlags[0]&Xo.keyFlags.encryptCommunication)||0!=(t.keyFlags[0]&Xo.keyFlags.encryptStorage))}function mp(e,t){return!!t.allowInsecureDecryptionWithSigningKeys||!e.keyFlags||0!=(e.keyFlags[0]&Xo.keyFlags.encryptCommunication)||0!=(e.keyFlags[0]&Xo.keyFlags.encryptStorage)}function bp(e,t){const r=Xo.write(Xo.publicKey,e.algorithm),n=e.getAlgorithmInfo();if(t.rejectPublicKeyAlgorithms.has(r))throw Error(n.algorithm+" keys are considered too weak.");switch(r){case Xo.publicKey.rsaEncryptSign:case Xo.publicKey.rsaSign:case Xo.publicKey.rsaEncrypt:if(n.bitse.getKeys(s).length>0));return 0===c.length?null:(await Promise.all(c.map((async t=>{const a=await t.getSigningKey(s,e.created,void 0,n);if(e.revoked||await i.isRevoked(e,a.keyPacket,r,n))throw Error("User certificate is revoked");try{await e.verify(a.keyPacket,Xo.signature.certGeneric,o,r,void 0,n)}catch(e){throw ts.wrapError("User certificate is invalid",e)}}))),!0)}async verifyAllCertifications(e,t=new Date,r){const n=this,i=this.selfCertifications.concat(this.otherCertifications);return Promise.all(i.map((async i=>({keyID:i.issuerKeyID,valid:await n.verifyCertificate(i,e,t,r).catch((()=>!1))}))))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const r=this,n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};let a;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const a=this.selfCertifications[o];if(a.revoked||await r.isRevoked(a,void 0,e,t))throw Error("Self-certification is revoked");try{await a.verify(n,Xo.signature.certGeneric,i,e,void 0,t)}catch(e){throw ts.wrapError("Self-certification is invalid",e)}return!0}catch(e){a=e}throw a}async update(e,t,r){const n=this.mainKey.keyPacket,i={userID:this.userID,userAttribute:this.userAttribute,key:n};await dp(e,this,"selfCertifications",t,(async function(e){try{return await e.verify(n,Xo.signature.certGeneric,i,t,!1,r),!0}catch(e){return!1}})),await dp(e,this,"otherCertifications",t),await dp(e,this,"revocationSignatures",t,(function(e){return pp(n,Xo.signature.certRevocation,i,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=Xo.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=us){const a={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new wp(a.userID||a.userAttribute,this.mainKey);return o.revocationSignatures.push(await fp(a,null,e,{signatureType:Xo.signature.certRevocation,reasonForRevocationFlag:Xo.write(Xo.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}}class vp{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Xd;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new vp(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,r=new Date,n=us){const i=this.mainKey.keyPacket;return pp(i,Xo.signature.subkeyRevocation,{key:i,bind:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verify(e=new Date,t=us){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket},i=await hp(this.bindingSignatures,r,Xo.signature.subkeyBinding,n,e,t);if(i.revoked||await this.isRevoked(i,null,e,t))throw Error("Subkey is revoked");if(lp(this.keyPacket,i,e))throw Error("Subkey is expired");return i}async getExpirationTime(e=new Date,t=us){const r=this.mainKey.keyPacket,n={key:r,bind:this.keyPacket};let i;try{i=await hp(this.bindingSignatures,r,Xo.signature.subkeyBinding,n,e,t)}catch(e){return null}const a=gp(this.keyPacket,i),o=i.getExpirationTime();return ai.bindingSignatures[t].created&&(i.bindingSignatures[t]=e),!1;try{return await e.verify(n,Xo.signature.subkeyBinding,a,t,void 0,r),!0}catch(e){return!1}})),await dp(e,this,"revocationSignatures",t,(function(e){return pp(n,Xo.signature.subkeyRevocation,a,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=Xo.reasonForRevocation.noReason,string:r=""}={},n=new Date,i=us){const a={key:e,bind:this.keyPacket},o=new vp(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await fp(a,null,e,{signatureType:Xo.signature.subkeyRevocation,reasonForRevocationFlag:Xo.write(Xo.reasonForRevocation,t),reasonForRevocationString:r},n,void 0,void 0,!1,i)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((e=>{vp.prototype[e]=function(){return this.keyPacket[e]()}}));const Ip=ts.constructAllowedPackets([Jd]),Ep=new Set([Xo.packet.publicKey,Xo.packet.privateKey]),Bp=new Set([Xo.packet.publicKey,Xo.packet.privateKey,Xo.packet.publicSubkey,Xo.packet.privateSubkey]);class Cp{packetListToStructure(e,t=new Set){let r,n,i,a;for(const o of e){if(o instanceof ml){Bp.has(o.tag)&&!a&&(a=Ep.has(o.tag)?Ep:Bp);continue}const e=o.constructor.tag;if(a){if(!a.has(e))continue;a=null}if(t.has(e))throw Error("Unexpected packet type: "+e);switch(e){case Xo.packet.publicKey:case Xo.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,n=this.getKeyID(),!n)throw Error("Missing Key ID");break;case Xo.packet.userID:case Xo.packet.userAttribute:r=new wp(o,this),this.users.push(r);break;case Xo.packet.publicSubkey:case Xo.packet.secretSubkey:r=null,i=new vp(o,this),this.subkeys.push(i);break;case Xo.packet.signature:switch(o.signatureType){case Xo.signature.certGeneric:case Xo.signature.certPersona:case Xo.signature.certCasual:case Xo.signature.certPositive:if(!r){ts.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(n)?r.selfCertifications.push(o):r.otherCertifications.push(o);break;case Xo.signature.certRevocation:r?r.revocationSignatures.push(o):this.directSignatures.push(o);break;case Xo.signature.key:this.directSignatures.push(o);break;case Xo.signature.subkeyBinding:if(!i){ts.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}i.bindingSignatures.push(o);break;case Xo.signature.keyRevocation:this.revocationSignatures.push(o);break;case Xo.signature.subkeyRevocation:if(!i){ts.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}i.revocationSignatures.push(o)}}}}toPacketList(){const e=new Xd;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map((t=>e.push(...t.toPacketList()))),this.subkeys.map((t=>e.push(...t.toPacketList()))),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach((e=>{if(e.keyPacket=Object.create(Object.getPrototypeOf(e.keyPacket),Object.getOwnPropertyDescriptors(e.keyPacket)),!e.keyPacket.isDecrypted())return;const t={};Object.keys(e.keyPacket.privateParams).forEach((r=>{t[r]=new Uint8Array(e.keyPacket.privateParams[r])})),e.keyPacket.privateParams=t})),t}getSubkeys(e=null){return this.subkeys.filter((t=>!e||t.getKeyID().equals(e,!0)))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map((e=>e.getKeyID()))}getUserIDs(){return this.users.map((e=>e.userID?e.userID.userID:null)).filter((e=>null!==e))}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,r={},n=us){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await hp(r.bindingSignatures,i,Xo.signature.subkeyBinding,e,t,n);if(!Ap(r.keyPacket,a))continue;if(!a.embeddedSignature)throw Error("Missing embedded signature");return await hp([a.embeddedSignature],r.keyPacket,Xo.signature.keyBinding,e,t,n),bp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&Ap(i,a.selfCertification))return bp(i,n),this}catch(e){o=e}throw ts.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,r={},n=us){await this.verifyPrimaryKey(t,r,n);const i=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let o;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,n);const e={key:i,bind:r.keyPacket},a=await hp(r.bindingSignatures,i,Xo.signature.subkeyBinding,e,t,n);if(yp(r.keyPacket,a))return bp(r.keyPacket,n),r}catch(e){o=e}try{const a=await this.getPrimaryUser(t,r,n);if((!e||i.getKeyID().equals(e))&&yp(i,a.selfCertification))return bp(i,n),this}catch(e){o=e}throw ts.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,r=new Date,n=us){return pp(this.keyPacket,Xo.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,r,n)}async verifyPrimaryKey(e=new Date,t={},r=us){const n=this.keyPacket;if(await this.isRevoked(null,null,e,r))throw Error("Primary key is revoked");const{selfCertification:i}=await this.getPrimaryUser(e,t,r);if(lp(n,i,e))throw Error("Primary key is expired");const a=await hp(this.directSignatures,n,Xo.signature.key,{key:n},e,r).catch((()=>{}));if(a&&lp(n,a,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=us){let r;try{const{selfCertification:n}=await this.getPrimaryUser(null,e,t),i=gp(this.keyPacket,n),a=n.getExpirationTime(),o=await hp(this.directSignatures,this.keyPacket,Xo.signature.key,{key:this.keyPacket},null,t).catch((()=>{}));if(o){const e=gp(this.keyPacket,o);r=Math.min(i,a,e)}else r=ie.subkeys.some((e=>t.hasSameFingerprintAs(e))))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,r)}const n=this.clone();return await dp(e,n,"revocationSignatures",t,(i=>pp(n.keyPacket,Xo.signature.keyRevocation,n,[i],null,e.keyPacket,t,r))),await dp(e,n,"directSignatures",t),await Promise.all(e.users.map((async e=>{const i=n.users.filter((t=>e.userID&&e.userID.equals(t.userID)||e.userAttribute&&e.userAttribute.equals(t.userAttribute)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.users.push(t)}}))),await Promise.all(e.subkeys.map((async e=>{const i=n.subkeys.filter((t=>t.hasSameFingerprintAs(e)));if(i.length>0)await Promise.all(i.map((n=>n.update(e,t,r))));else{const t=e.clone();t.mainKey=n,n.subkeys.push(t)}}))),n}async getRevocationCertificate(e=new Date,t=us){const r={key:this.keyPacket},n=await hp(this.revocationSignatures,this.keyPacket,Xo.signature.keyRevocation,r,e,t),i=new Xd;return i.push(n),ms(Xo.armor.publicKey,i.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,r=us){const n=await ys(e,r),i=(await Xd.fromBinary(n.data,Ip,r)).findPacket(Xo.packet.signature);if(!i||i.signatureType!==Xo.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!i.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await i.verify(this.keyPacket,Xo.signature.keyRevocation,{key:this.keyPacket},t,void 0,r)}catch(e){throw ts.wrapError("Could not verify revocation signature",e)}const a=this.clone();return a.revocationSignatures.push(i),a}async signPrimaryUser(e,t,r,n=us){const{index:i,user:a}=await this.getPrimaryUser(t,r,n),o=await a.certify(e,t,n),s=this.clone();return s.users[i]=o,s}async signAllUsers(e,t=new Date,r=us){const n=this.clone();return n.users=await Promise.all(this.users.map((function(n){return n.certify(e,t,r)}))),n}async verifyPrimaryUser(e,t=new Date,r,n=us){const i=this.keyPacket,{user:a}=await this.getPrimaryUser(t,r,n);return e?await a.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await a.verify(t,n).catch((()=>!1))}]}async verifyAllUsers(e,t=new Date,r=us){const n=this.keyPacket,i=[];return await Promise.all(this.users.map((async a=>{const o=e?await a.verifyAllCertifications(e,t,r):[{keyID:n.getKeyID(),valid:await a.verify(t,r).catch((()=>!1))}];i.push(...o.map((e=>({userID:a.userID?a.userID.userID:null,userAttribute:a.userAttribute,keyID:e.keyID,valid:e.valid}))))}))),i}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((e=>{Cp.prototype[e]=vp.prototype[e]}));class _p extends Cp{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([Xo.packet.secretKey,Xo.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=us){return ms(Xo.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class kp extends _p{constructor(e){if(super(),this.packetListToStructure(e,new Set([Xo.packet.publicKey,Xo.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Xd,t=this.toPacketList();for(const r of t)switch(r.constructor.tag){case Xo.packet.secretKey:{const t=rp.fromSecretKeyPacket(r);e.push(t);break}case Xo.packet.secretSubkey:{const t=np.fromSecretSubkeyPacket(r);e.push(t);break}default:e.push(r)}return new _p(e)}armor(e=us){return ms(Xo.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,r={},n=us){const i=this.keyPacket,a=[];for(let r=0;re.isDecrypted()))}async validate(e=us){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const r=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});r&&!r.keyPacket.isDummy()&&(t=r.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const e=this.getKeys(),t=e.map((e=>e.keyPacket.isDummy())).every(Boolean);if(t)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(e.map((async e=>e.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()}))}async revoke({flag:e=Xo.reasonForRevocation.noReason,string:t=""}={},r=new Date,n=us){if(!this.isPrivate())throw Error("Need private key for revoking");const i={key:this.keyPacket},a=this.clone();return a.revocationSignatures.push(await fp(i,null,this.keyPacket,{signatureType:Xo.signature.keyRevocation,reasonForRevocationFlag:Xo.write(Xo.reasonForRevocation,e),reasonForRevocationString:t},r,void 0,void 0,void 0,n)),a}async addSubkey(e={}){const t={...us,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1),await fp(i,null,t,a,r.date,void 0,void 0,void 0,n)}(i,r,e,t),o=this.toPacketList();return o.push(i,a),new kp(o)}}const Sp=ts.constructAllowedPackets([rp,np,ap,up,cp,ip,Jd]);async function Qp({armoredKey:e,binaryKey:t,config:r,...n}){if(r={...us,...r},!e&&!t)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!ts.isString(e))throw Error("readKey: options.armoredKey must be a string");if(t&&!ts.isUint8Array(t))throw Error("readKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(e){const{type:t,data:n}=await ys(e,r);if(t!==Xo.armor.publicKey&&t!==Xo.armor.privateKey)throw Error("Armored text not of type key");a=n}else a=t;return function(e){for(const t of e)switch(t.constructor.tag){case Xo.packet.secretKey:return new kp(e);case Xo.packet.publicKey:return new _p(e)}throw Error("No key packet found")}(await Xd.fromBinary(a,Sp,r))}Object.keys(us).length;const xp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function Pp(){}const Mp="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Up(e){return"object"==typeof e&&null!==e||"function"==typeof e}const Dp=Pp,Rp=Promise,Fp=Promise.prototype.then,Tp=Promise.resolve.bind(Rp),qp=Promise.reject.bind(Rp);function Op(e){return new Rp(e)}function Kp(e){return Tp(e)}function Hp(e){return qp(e)}function Np(e,t,r){return Fp.call(e,t,r)}function Lp(e,t,r){Np(Np(e,t,r),void 0,Dp)}function Gp(e,t){Lp(e,t)}function jp(e,t){Lp(e,void 0,t)}function zp(e,t,r){return Np(e,t,r)}function Wp(e){Np(e,void 0,Dp)}const Zp=(()=>{const e=Mp&&Mp.queueMicrotask;if("function"==typeof e)return e;const t=Kp(void 0);return e=>Np(t,e)})();function Jp(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Vp(e,t,r){try{return Kp(Jp(e,t,r))}catch(e){return Hp(e)}}class Yp{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let n=r+1;const i=e._elements,a=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}function $p(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?rg(e):"closed"===t._state?function(e){rg(e),ag(e)}(e):ng(e,t._storedError)}function Xp(e,t){return Dy(e._ownerReadableStream,t)}function eg(e){"readable"===e._ownerReadableStream._state?ig(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){ng(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function tg(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function rg(e){e._closedPromise=Op(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function ng(e,t){rg(e),ig(e,t)}function ig(e,t){void 0!==e._closedPromise_reject&&(Wp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ag(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const og=xp("[[AbortSteps]]"),sg=xp("[[ErrorSteps]]"),cg=xp("[[CancelSteps]]"),ug=xp("[[PullSteps]]"),hg=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},lg=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function fg(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(t+" is not an object.");var r}function dg(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function pg(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function gg(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function Ag(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function yg(e){return Number(e)}function mg(e){return 0===e?0:e}function bg(e,t){const r=Number.MAX_SAFE_INTEGER;let n=Number(e);if(n=mg(n),!hg(n))throw new TypeError(t+" is not a finite number");if(n=function(e){return mg(lg(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return hg(n)&&0!==n?n:0}function wg(e,t){if(!My(e))throw new TypeError(t+" is not a ReadableStream.")}function vg(e){return new _g(e)}function Ig(e,t){e._reader._readRequests.push(t)}function Eg(e,t,r){const n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Bg(e){return e._reader._readRequests.length}function Cg(e){const t=e._reader;return void 0!==t&&!!kg(t)}class _g{constructor(e){if(gg(e,1,"ReadableStreamDefaultReader"),wg(e,"First parameter"),Uy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");$p(this,e),this._readRequests=new Yp}get closed(){return kg(this)?this._closedPromise:Hp(Qg("closed"))}cancel(e=void 0){return kg(this)?void 0===this._ownerReadableStream?Hp(tg("cancel")):Xp(this,e):Hp(Qg("cancel"))}read(){if(!kg(this))return Hp(Qg("read"));if(void 0===this._ownerReadableStream)return Hp(tg("read from"));let e,t;const r=Op(((r,n)=>{e=r,t=n}));return Sg(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!kg(this))throw Qg("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");eg(this)}}}function kg(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Sg(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[ug](t)}function Qg(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let xg;Object.defineProperties(_g.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(_g.prototype,xp.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof xp.asyncIterator&&(xg={[xp.asyncIterator](){return this}},Object.defineProperty(xg,xp.asyncIterator,{enumerable:!1}));class Pg{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?zp(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?zp(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(void 0===e._ownerReadableStream)return Hp(tg("iterate"));let t,r;const n=Op(((e,n)=>{t=e,r=n}));return Sg(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,Zp((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,eg(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,eg(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(void 0===t._ownerReadableStream)return Hp(tg("finish iterating"));if(!this._preventCancel){const r=Xp(t,e);return eg(t),zp(r,(()=>({value:e,done:!0})))}return eg(t),Kp({value:e,done:!0})}}const Mg={next(){return Ug(this)?this._asyncIteratorImpl.next():Hp(Dg("next"))},return(e){return Ug(this)?this._asyncIteratorImpl.return(e):Hp(Dg("return"))}};function Ug(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Dg(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==xg&&Object.setPrototypeOf(Mg,xg);const Rg=Number.isNaN||function(e){return e!=e};function Fg(e){return!!function(e){return"number"==typeof e&&(!Rg(e)&&!(e<0))}(e)&&e!==1/0}function Tg(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function qg(e,t,r){if(!Fg(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Og(e){e._queue=new Yp,e._queueTotalSize=0}function Kg(e){return e.slice()}class Hg{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Gg(this))throw aA("view");return this._view}respond(e){if(!Gg(this))throw aA("respond");if(gg(e,1,"respond"),e=bg(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!Fg(t=Number(t)))throw new RangeError("bytesWritten must be a finite");eA(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!Gg(this))throw aA("respondWithNewView");if(gg(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){const r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,eA(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Hg.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Hg.prototype,xp.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Ng{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Lg(this))throw oA("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Hg.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}get desiredSize(){if(!Lg(this))throw oA("desiredSize");return iA(this)}close(){if(!Lg(this))throw oA("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);!function(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw nA(e,t),t}rA(e),Ry(t)}}(this)}enqueue(e){if(!Lg(this))throw oA("enqueue");if(gg(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);!function(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const n=t.buffer,i=t.byteOffset,a=t.byteLength,o=n;Cg(r)?0===Bg(r)?Zg(e,o,i,a):Eg(r,new Uint8Array(o,i,a),!1):uA(r)?(Zg(e,o,i,a),Xg(e)):Zg(e,o,i,a),jg(e)}(this,e)}error(e=void 0){if(!Lg(this))throw oA("error");nA(this,e)}[cg](e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0),Og(this);const t=this._cancelAlgorithm(e);return rA(this),t}[ug](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0){const t=this._queue.shift();this._queueTotalSize-=t.byteLength,Yg(this);const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}const r=this._autoAllocateChunkSize;if(void 0!==r){let n;try{n=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const i={buffer:n,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}Ig(t,e),jg(this)}}function Lg(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Gg(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function jg(e){const t=function(e){const t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(Cg(t)&&Bg(t)>0)return!0;if(uA(t)&&cA(t)>0)return!0;return iA(e)>0}(e);t&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Lp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,jg(e))}),(t=>{nA(e,t)}))))}function zg(e,t){let r=!1;"closed"===e._state&&(r=!0);const n=Wg(t);"default"===t.readerType?Eg(e,n,r):function(e,t,r){const n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Wg(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Zg(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Jg(e,t){const r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,o=a-a%r;let s=i,c=!1;o>n&&(s=o-t.bytesFilled,c=!0);const u=e._queue;for(;s>0;){const r=u.peek(),n=Math.min(s,r.byteLength),i=t.byteOffset+t.bytesFilled;h=t.buffer,l=i,f=r.buffer,d=r.byteOffset,p=n,new Uint8Array(h).set(new Uint8Array(f,d,p),l),r.byteLength===n?u.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,Vg(e,n,t),s-=n}var h,l,f,d,p;return c}function Vg(e,t,r){$g(e),r.bytesFilled+=t}function Yg(e){0===e._queueTotalSize&&e._closeRequested?(rA(e),Ry(e._controlledReadableByteStream)):jg(e)}function $g(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Xg(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();Jg(e,t)&&(tA(e),zg(e._controlledReadableByteStream,t))}}function eA(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;const r=e._controlledReadableByteStream;if(uA(r))for(;cA(r)>0;)zg(r,tA(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Vg(e,t,r),r.bytesFilled0){const t=r.byteOffset+r.bytesFilled,i=r.buffer.slice(t-n,t);Zg(e,i,0,i.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,zg(e._controlledReadableByteStream,r),Xg(e)}(e,t,r);jg(e)}function tA(e){const t=e._pendingPullIntos.shift();return $g(e),t}function rA(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function nA(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(function(e){$g(e),e._pendingPullIntos=new Yp}(e),Og(e),rA(e),Fy(r,t))}function iA(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function aA(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function oA(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function sA(e,t){e._reader._readIntoRequests.push(t)}function cA(e){return e._reader._readIntoRequests.length}function uA(e){const t=e._reader;return void 0!==t&&!!lA(t)}Object.defineProperties(Ng.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Ng.prototype,xp.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class hA{constructor(e){if(gg(e,1,"ReadableStreamBYOBReader"),wg(e,"First parameter"),Uy(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Lg(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");$p(this,e),this._readIntoRequests=new Yp}get closed(){return lA(this)?this._closedPromise:Hp(fA("closed"))}cancel(e=void 0){return lA(this)?void 0===this._ownerReadableStream?Hp(tg("cancel")):Xp(this,e):Hp(fA("cancel"))}read(e){if(!lA(this))return Hp(fA("read"));if(!ArrayBuffer.isView(e))return Hp(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Hp(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Hp(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Hp(tg("read from"));let t,r;const n=Op(((e,n)=>{t=e,r=n}));return function(e,t,r){const n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){const n=e._controlledReadableByteStream;let i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);const a=t.constructor,o={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),void sA(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Jg(e,o)){const t=Wg(o);return Yg(e),void r._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return nA(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(o),sA(n,r),jg(e)}else{const e=new a(o.buffer,o.byteOffset,0);r._closeSteps(e)}}(n._readableStreamController,t,r)}(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),n}releaseLock(){if(!lA(this))throw fA("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");eg(this)}}}function lA(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function fA(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function dA(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Rg(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function pA(e){const{size:t}=e;return t||(()=>1)}function gA(e,t){fg(e,t);const r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:yg(r),size:void 0===n?void 0:AA(n,t+" has member 'size' that")}}function AA(e,t){return dg(e,t),t=>yg(e(t))}function yA(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function mA(e,t,r){return dg(e,r),()=>Vp(e,t,[])}function bA(e,t,r){return dg(e,r),r=>Jp(e,t,[r])}function wA(e,t,r){return dg(e,r),(r,n)=>Vp(e,t,[r,n])}function vA(e,t){if(!CA(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(hA.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(hA.prototype,xp.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class IA{constructor(e={},t={}){void 0===e?e=null:pg(e,"First parameter");const r=gA(t,"Second parameter"),n=function(e,t){fg(e,t);const r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,a=null==e?void 0:e.type,o=null==e?void 0:e.write;return{abort:void 0===r?void 0:yA(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:mA(n,e,t+" has member 'close' that"),start:void 0===i?void 0:bA(i,e,t+" has member 'start' that"),write:void 0===o?void 0:wA(o,e,t+" has member 'write' that"),type:a}}(e,"First parameter");if(BA(this),void 0!==n.type)throw new RangeError("Invalid type is specified");const i=pA(r);!function(e,t,r,n){const i=Object.create(NA.prototype);let a=()=>{},o=()=>Kp(void 0),s=()=>Kp(void 0),c=()=>Kp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.write&&(o=e=>t.write(e,i)),void 0!==t.close&&(s=()=>t.close()),void 0!==t.abort&&(c=e=>t.abort(e)),LA(e,i,a,o,s,c,r,n)}(this,n,dA(r,1),i)}get locked(){if(!CA(this))throw VA("locked");return _A(this)}abort(e=void 0){return CA(this)?_A(this)?Hp(new TypeError("Cannot abort a stream that already has a writer")):kA(this,e):Hp(VA("abort"))}close(){return CA(this)?_A(this)?Hp(new TypeError("Cannot close a stream that already has a writer")):MA(this)?Hp(new TypeError("Cannot close an already-closing stream")):SA(this):Hp(VA("close"))}getWriter(){if(!CA(this))throw VA("getWriter");return EA(this)}}function EA(e){return new RA(e)}function BA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Yp,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function CA(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function _A(e){return void 0!==e._writer}function kA(e,t){const r=e._state;if("closed"===r||"errored"===r)return Kp(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let n=!1;"erroring"===r&&(n=!0,t=void 0);const i=Op(((r,i)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||xA(e,t),i}function SA(e){const t=e._state;if("closed"===t||"errored"===t)return Hp(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Op(((t,r)=>{const n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;var i;return void 0!==n&&e._backpressure&&"writable"===t&&sy(n),qg(i=e._writableStreamController,HA,0),zA(i),r}function QA(e,t){"writable"!==e._state?PA(e):xA(e,t)}function xA(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const n=e._writer;void 0!==n&&qA(n,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&PA(e)}function PA(e){e._state="errored",e._writableStreamController[sg]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new Yp,void 0===e._pendingAbortRequest)return void UA(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void UA(e);Lp(e._writableStreamController[og](r._reason),(()=>{r._resolve(),UA(e)}),(t=>{r._reject(t),UA(e)}))}function MA(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function UA(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&ty(t,e._storedError)}function DA(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){ny(e)}(r):sy(r)),e._backpressure=t}Object.defineProperties(IA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(IA.prototype,xp.toStringTag,{value:"WritableStream",configurable:!0});class RA{constructor(e){if(gg(e,1,"WritableStreamDefaultWriter"),vA(e,"First parameter"),_A(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!MA(e)&&e._backpressure?ny(this):ay(this),XA(this);else if("erroring"===t)iy(this,e._storedError),XA(this);else if("closed"===t)ay(this),XA(this),ry(this);else{const t=e._storedError;iy(this,t),ey(this,t)}}get closed(){return FA(this)?this._closedPromise:Hp(YA("closed"))}get desiredSize(){if(!FA(this))throw YA("desiredSize");if(void 0===this._ownerWritableStream)throw $A("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:jA(t._writableStreamController)}(this)}get ready(){return FA(this)?this._readyPromise:Hp(YA("ready"))}abort(e=void 0){return FA(this)?void 0===this._ownerWritableStream?Hp($A("abort")):function(e,t){return kA(e._ownerWritableStream,t)}(this,e):Hp(YA("abort"))}close(){if(!FA(this))return Hp(YA("close"));const e=this._ownerWritableStream;return void 0===e?Hp($A("close")):MA(e)?Hp(new TypeError("Cannot close an already-closing stream")):TA(this)}releaseLock(){if(!FA(this))throw YA("releaseLock");void 0!==this._ownerWritableStream&&OA(this)}write(e=void 0){return FA(this)?void 0===this._ownerWritableStream?Hp($A("write to")):KA(this,e):Hp(YA("write"))}}function FA(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function TA(e){return SA(e._ownerWritableStream)}function qA(e,t){"pending"===e._readyPromiseState?oy(e,t):function(e,t){iy(e,t)}(e,t)}function OA(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");qA(e,r),function(e,t){"pending"===e._closedPromiseState?ty(e,t):function(e,t){ey(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function KA(e,t){const r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return WA(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return Hp($A("write to"));const a=r._state;if("errored"===a)return Hp(r._storedError);if(MA(r)||"closed"===a)return Hp(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Hp(r._storedError);const o=function(e){return Op(((t,r)=>{const n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{qg(e,t,r)}catch(t){return void WA(e,t)}const n=e._controlledWritableStream;MA(n)||"writable"!==n._state||DA(n,ZA(e)),zA(e)}(n,t,i),o}Object.defineProperties(RA.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(RA.prototype,xp.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const HA={};class NA{constructor(){throw new TypeError("Illegal constructor")}error(e=void 0){if(!function(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&JA(this,e)}[og](e){const t=this._abortAlgorithm(e);return GA(this),t}[sg](){Og(this)}}function LA(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Og(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;const c=ZA(t);DA(e,c),Lp(Kp(r()),(()=>{t._started=!0,zA(t)}),(r=>{t._started=!0,QA(e,r)}))}function GA(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function jA(e){return e._strategyHWM-e._queueTotalSize}function zA(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void PA(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===HA?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),Tg(e);const r=e._closeAlgorithm();GA(e),Lp(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&ry(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),QA(e,t)}(t,e)}))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r);Lp(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(Tg(e),!MA(r)&&"writable"===t){const t=ZA(e);DA(r,t)}zA(e)}),(t=>{"writable"===r._state&&GA(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,QA(e,t)}(r,t)}))}(e,r)}function WA(e,t){"writable"===e._controlledWritableStream._state&&JA(e,t)}function ZA(e){return jA(e)<=0}function JA(e,t){const r=e._controlledWritableStream;GA(e),xA(r,t)}function VA(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function YA(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function $A(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function XA(e){e._closedPromise=Op(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function ey(e,t){XA(e),ty(e,t)}function ty(e,t){void 0!==e._closedPromise_reject&&(Wp(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function ry(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function ny(e){e._readyPromise=Op(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function iy(e,t){ny(e),oy(e,t)}function ay(e){ny(e),sy(e)}function oy(e,t){void 0!==e._readyPromise_reject&&(Wp(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function sy(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(NA.prototype,{error:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(NA.prototype,xp.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const cy="undefined"!=typeof DOMException?DOMException:void 0,uy=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(cy)?cy:function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function hy(e,t,r,n,i,a){const o=vg(e),s=EA(t);e._disturbed=!0;let c=!1,u=Kp(void 0);return Op(((h,l)=>{let f;if(void 0!==a){if(f=()=>{const r=new uy("Aborted","AbortError"),a=[];n||a.push((()=>"writable"===t._state?kA(t,r):Kp(void 0))),i||a.push((()=>"readable"===e._state?Dy(e,r):Kp(void 0))),g((()=>Promise.all(a.map((e=>e())))),!0,r)},a.aborted)return void f();a.addEventListener("abort",f)}if(p(e,o._closedPromise,(e=>{n?A(!0,e):g((()=>kA(t,e)),!0,e)})),p(t,s._closedPromise,(t=>{i?A(!0,t):g((()=>Dy(e,t)),!0,t)})),function(e,t,r){"closed"===e._state?r():Gp(t,r)}(e,o._closedPromise,(()=>{r?A():g((()=>function(e){const t=e._ownerWritableStream,r=t._state;return MA(t)||"closed"===r?Kp(void 0):"errored"===r?Hp(t._storedError):TA(e)}(s)))})),MA(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");i?A(!0,t):g((()=>Dy(e,t)),!0,t)}function d(){const e=u;return Np(u,(()=>e!==u?d():void 0))}function p(e,t,r){"errored"===e._state?r(e._storedError):jp(t,r)}function g(e,r,n){function i(){Lp(e(),(()=>y(r,n)),(e=>y(!0,e)))}c||(c=!0,"writable"!==t._state||MA(t)?i():Gp(d(),i))}function A(e,r){c||(c=!0,"writable"!==t._state||MA(t)?y(e,r):Gp(d(),(()=>y(e,r))))}function y(e,t){OA(s),eg(o),void 0!==a&&a.removeEventListener("abort",f),e?l(t):h(void 0)}Wp(Op(((e,t)=>{!function r(n){n?e():Np(c?Kp(!0):Np(s._readyPromise,(()=>Op(((e,t)=>{Sg(o,{_chunkSteps:t=>{u=Np(KA(s,t),void 0,Pp),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class ly{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!fy(this))throw Iy("desiredSize");return by(this)}close(){if(!fy(this))throw Iy("close");if(!wy(this))throw new TypeError("The stream is not in a state that permits close");Ay(this)}enqueue(e=void 0){if(!fy(this))throw Iy("enqueue");if(!wy(this))throw new TypeError("The stream is not in a state that permits enqueue");return yy(this,e)}error(e=void 0){if(!fy(this))throw Iy("error");my(this,e)}[cg](e){Og(this);const t=this._cancelAlgorithm(e);return gy(this),t}[ug](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=Tg(this);this._closeRequested&&0===this._queue.length?(gy(this),Ry(t)):dy(this),e._chunkSteps(r)}else Ig(t,e),dy(this)}}function fy(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function dy(e){py(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Lp(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,dy(e))}),(t=>{my(e,t)}))))}function py(e){const t=e._controlledReadableStream;return!!wy(e)&&(!!e._started&&(!!(Uy(t)&&Bg(t)>0)||by(e)>0))}function gy(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ay(e){if(!wy(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(gy(e),Ry(t))}function yy(e,t){if(!wy(e))return;const r=e._controlledReadableStream;if(Uy(r)&&Bg(r)>0)Eg(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw my(e,t),t}try{qg(e,t,r)}catch(t){throw my(e,t),t}}dy(e)}function my(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(Og(e),gy(e),Fy(r,t))}function by(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function wy(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function vy(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Og(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,Lp(Kp(r()),(()=>{t._started=!0,dy(t)}),(e=>{my(t,e)}))}function Iy(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function Ey(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function By(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function Cy(e,t,r){return dg(e,r),r=>Jp(e,t,[r])}function _y(e,t){if("bytes"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function ky(e,t){if("byob"!=(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Sy(e,t){fg(e,t);const r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!n,preventClose:!!i,signal:a}}Object.defineProperties(ly.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(ly.prototype,xp.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class Qy{constructor(e={},t={}){void 0===e?e=null:pg(e,"First parameter");const r=gA(t,"Second parameter"),n=function(e,t){fg(e,t);const r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,o=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:bg(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:Ey(i,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:By(a,r,t+" has member 'pull' that"),start:void 0===o?void 0:Cy(o,r,t+" has member 'start' that"),type:void 0===s?void 0:_y(s,t+" has member 'type' that")}}(e,"First parameter");if(Py(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){const n=Object.create(Ng.prototype);let i=()=>{},a=()=>Kp(void 0),o=()=>Kp(void 0);void 0!==t.start&&(i=()=>t.start(n)),void 0!==t.pull&&(a=()=>t.pull(n)),void 0!==t.cancel&&(o=e=>t.cancel(e));const s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Og(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new Yp,e._readableStreamController=t,Lp(Kp(r()),(()=>{t._started=!0,jg(t)}),(e=>{nA(t,e)}))}(e,n,i,a,o,r,s)}(this,n,dA(r,0))}else{const e=pA(r);!function(e,t,r,n){const i=Object.create(ly.prototype);let a=()=>{},o=()=>Kp(void 0),s=()=>Kp(void 0);void 0!==t.start&&(a=()=>t.start(i)),void 0!==t.pull&&(o=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e)),vy(e,i,a,o,s,r,n)}(this,n,dA(r,1),e)}}get locked(){if(!My(this))throw Ty("locked");return Uy(this)}cancel(e=void 0){return My(this)?Uy(this)?Hp(new TypeError("Cannot cancel a stream that already has a reader")):Dy(this,e):Hp(Ty("cancel"))}getReader(e=void 0){if(!My(this))throw Ty("getReader");const t=function(e,t){fg(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:ky(r,t+" has member 'mode' that")}}(e,"First parameter");return void 0===t.mode?vg(this):function(e){return new hA(e)}(this)}pipeThrough(e,t={}){if(!My(this))throw Ty("pipeThrough");gg(e,1,"pipeThrough");const r=function(e,t){fg(e,t);const r=null==e?void 0:e.readable;Ag(r,"readable","ReadableWritablePair"),wg(r,t+" has member 'readable' that");const n=null==e?void 0:e.writable;return Ag(n,"writable","ReadableWritablePair"),vA(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=Sy(t,"Second parameter");if(Uy(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(_A(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Wp(hy(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!My(this))return Hp(Ty("pipeTo"));if(void 0===e)return Hp("Parameter 1 is required in 'pipeTo'.");if(!CA(e))return Hp(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Sy(t,"Second parameter")}catch(e){return Hp(e)}return Uy(this)?Hp(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):_A(e)?Hp(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):hy(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!My(this))throw Ty("tee");const e=function(e,t){const r=vg(e);let n,i,a,o,s,c=!1,u=!1,h=!1;const l=Op((e=>{s=e}));function f(){return c||(c=!0,Sg(r,{_chunkSteps:e=>{Zp((()=>{c=!1;const t=e,r=e;u||yy(a._readableStreamController,t),h||yy(o._readableStreamController,r)}))},_closeSteps:()=>{c=!1,u||Ay(a._readableStreamController),h||Ay(o._readableStreamController),u&&h||s(void 0)},_errorSteps:()=>{c=!1}})),Kp(void 0)}function d(){}return a=xy(d,f,(function(t){if(u=!0,n=t,h){const t=Kg([n,i]),r=Dy(e,t);s(r)}return l})),o=xy(d,f,(function(t){if(h=!0,i=t,u){const t=Kg([n,i]),r=Dy(e,t);s(r)}return l})),jp(r._closedPromise,(e=>{my(a._readableStreamController,e),my(o._readableStreamController,e),u&&h||s(void 0)})),[a,o]}(this);return Kg(e)}values(e=void 0){if(!My(this))throw Ty("values");return function(e,t){const r=vg(e),n=new Pg(r,t),i=Object.create(Mg);return i._asyncIteratorImpl=n,i}(this,function(e,t){return fg(e,"First parameter"),{preventCancel:!!(null==e?void 0:e.preventCancel)}}(e).preventCancel)}}function xy(e,t,r,n=1,i=(()=>1)){const a=Object.create(Qy.prototype);return Py(a),vy(a,Object.create(ly.prototype),e,t,r,n,i),a}function Py(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function My(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Uy(e){return void 0!==e._reader}function Dy(e,t){return e._disturbed=!0,"closed"===e._state?Kp(void 0):"errored"===e._state?Hp(e._storedError):(Ry(e),zp(e._readableStreamController[cg](t),Pp))}function Ry(e){e._state="closed";const t=e._reader;void 0!==t&&(ag(t),kg(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new Yp))}function Fy(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(ig(r,t),kg(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new Yp):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new Yp))}function Ty(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function qy(e,t){fg(e,t);const r=null==e?void 0:e.highWaterMark;return Ag(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:yg(r)}}Object.defineProperties(Qy.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Qy.prototype,xp.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof xp.asyncIterator&&Object.defineProperty(Qy.prototype,xp.asyncIterator,{value:Qy.prototype.values,writable:!0,configurable:!0});const Oy=function(e){return e.byteLength};class Ky{constructor(e){gg(e,1,"ByteLengthQueuingStrategy"),e=qy(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ny(this))throw Hy("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ny(this))throw Hy("size");return Oy}}function Hy(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Ny(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(Ky.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Ky.prototype,xp.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Ly=function(){return 1};class Gy{constructor(e){gg(e,1,"CountQueuingStrategy"),e=qy(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!zy(this))throw jy("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!zy(this))throw jy("size");return Ly}}function jy(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function zy(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function Wy(e,t,r){return dg(e,r),r=>Vp(e,t,[r])}function Zy(e,t,r){return dg(e,r),r=>Jp(e,t,[r])}function Jy(e,t,r){return dg(e,r),(r,n)=>Vp(e,t,[r,n])}Object.defineProperties(Gy.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Gy.prototype,xp.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Vy{constructor(e={},t={},r={}){void 0===e&&(e=null);const n=gA(t,"Second parameter"),i=gA(r,"Third parameter"),a=function(e,t){fg(e,t);const r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,o=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Wy(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===i?void 0:Zy(i,e,t+" has member 'start' that"),transform:void 0===a?void 0:Jy(a,e,t+" has member 'transform' that"),writableType:o}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");const o=dA(i,0),s=pA(i),c=dA(n,1),u=pA(n);let h;!function(e,t,r,n,i,a){function o(){return t}e._writable=function(e,t,r,n,i=1,a=(()=>1)){const o=Object.create(IA.prototype);return BA(o),LA(o,Object.create(NA.prototype),e,t,r,n,i,a),o}(o,(function(t){return function(e,t){const r=e._transformStreamController;return e._backpressure?zp(e._backpressureChangePromise,(()=>{const n=e._writable;if("erroring"===n._state)throw n._storedError;return am(r,t)})):am(r,t)}(e,t)}),(function(){return function(e){const t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return nm(r),zp(n,(()=>{if("errored"===t._state)throw t._storedError;Ay(t._readableStreamController)}),(r=>{throw $y(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return $y(e,t),Kp(void 0)}(e,t)}),r,n),e._readable=xy(o,(function(){return function(e){return em(e,!1),e._backpressureChangePromise}(e)}),(function(t){return Xy(e,t),Kp(void 0)}),i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,em(e,!0),e._transformStreamController=void 0}(this,Op((e=>{h=e})),c,u,o,s),function(e,t){const r=Object.create(tm.prototype);let n=e=>{try{return im(r,e),Kp(void 0)}catch(e){return Hp(e)}},i=()=>Kp(void 0);void 0!==t.transform&&(n=e=>t.transform(e,r)),void 0!==t.flush&&(i=()=>t.flush(r)),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,a),void 0!==a.start?h(a.start(this._transformStreamController)):h(void 0)}get readable(){if(!Yy(this))throw sm("readable");return this._readable}get writable(){if(!Yy(this))throw sm("writable");return this._writable}}function Yy(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function $y(e,t){my(e._readable._readableStreamController,t),Xy(e,t)}function Xy(e,t){nm(e._transformStreamController),WA(e._writable._writableStreamController,t),e._backpressure&&em(e,!1)}function em(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Op((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(Vy.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(Vy.prototype,xp.toStringTag,{value:"TransformStream",configurable:!0});class tm{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!rm(this))throw om("desiredSize");return by(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!rm(this))throw om("enqueue");im(this,e)}error(e=void 0){if(!rm(this))throw om("error");var t;t=e,$y(this._controlledTransformStream,t)}terminate(){if(!rm(this))throw om("terminate");!function(e){const t=e._controlledTransformStream;Ay(t._readable._readableStreamController),Xy(t,new TypeError("TransformStream terminated"))}(this)}}function rm(e){return!!Up(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function nm(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function im(e,t){const r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!wy(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{yy(n,t)}catch(e){throw Xy(r,e),r._readable._storedError}const i=function(e){return!py(e)}(n);i!==r._backpressure&&em(r,!0)}function am(e,t){return zp(e._transformAlgorithm(t),void 0,(t=>{throw $y(e._controlledTransformStream,t),t}))}function om(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function sm(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(tm.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof xp.toStringTag&&Object.defineProperty(tm.prototype,xp.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var cm=function(e,t){return cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},cm(e,t) /*! ***************************************************************************** Copyright (c) Microsoft Corporation. diff --git a/package.json b/package.json index 7c37594..0914da4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doipjs", - "version": "2.0.1", + "version": "2.1.0-rc.1", "description": "Decentralized Online Identity Proofs library in Node.js", "type": "module", "main": "./src/index.js", diff --git a/src/constants.js b/src/constants.js index ef44c1a..4e85468 100644 --- a/src/constants.js +++ b/src/constants.js @@ -22,4 +22,4 @@ limitations under the License. * doip.js library version * @constant {string} */ -export const version = '2.0.1' +export const version = '2.1.0-rc.1'