const Jh="modulepreload",ic={},td="/",ri=function(e,r){return!r||r.length===0?e():Promise.all(r.map(i=>{if(i=`${td}${i}`,i in ic)return;ic[i]=!0;const n=i.endsWith(".css"),a=n?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const s=document.createElement("link");if(s.rel=n?"stylesheet":Jh,n||(s.as="script",s.crossOrigin=""),s.href=i,document.head.appendChild(s),n)return new Promise((o,u)=>{s.addEventListener("load",o),s.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())},Ye=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Mn=Symbol("doneWritingPromise"),_u=Symbol("doneWritingResolve"),ku=Symbol("doneWritingReject"),ta=Symbol("readingIndex");class Rr extends Array{constructor(){super(),this[Mn]=new Promise((e,r)=>{this[_u]=e,this[ku]=r}),this[Mn].catch(()=>{})}}function ce(t){return t&&t.getReader&&Array.isArray(t)}function oa(t){if(!ce(t)){const e=t.getWriter(),r=e.releaseLock;return e.releaseLock=()=>{e.closed.catch(function(){}),r.call(e)},e}this.stream=t}Rr.prototype.getReader=function(){return this[ta]===void 0&&(this[ta]=0),{read:async()=>(await this[Mn],this[ta]===this.length?{value:void 0,done:!0}:{value:this[this[ta]++],done:!1})}},Rr.prototype.readToEnd=async function(t){await this[Mn];const e=t(this.slice(this[ta]));return this.length=0,e},Rr.prototype.clone=function(){const t=new Rr;return t[Mn]=this[Mn].then(()=>{t.push(...this)}),t},oa.prototype.write=async function(t){this.stream.push(t)},oa.prototype.close=async function(){this.stream[_u]()},oa.prototype.abort=async function(t){return this.stream[ku](t),t},oa.prototype.releaseLock=function(){};const Mo=typeof Ye.process=="object"&&typeof Ye.process.versions=="object",nc=Mo&&void 0;function je(t){return ce(t)?"array":Ye.ReadableStream&&Ye.ReadableStream.prototype.isPrototypeOf(t)?"web":oi&&oi.prototype.isPrototypeOf(t)?"ponyfill":nc&&nc.prototype.isPrototypeOf(t)?"node":!(!t||!t.getReader)&&"web-like"}function Co(t){return Uint8Array.prototype.isPrototypeOf(t)}function Au(t){if(t.length===1)return t[0];let e=0;for(let n=0;n{r||(ed.isBuffer(n)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),i.enqueue(n),e.pause())}),e.on("end",()=>{r||i.close()}),e.on("error",n=>i.error(n))},pull(){e.resume()},cancel(i){r=!0,e.destroy(i)}})};class t extends ac{constructor(r,i){super(i),this._reader=Nr(r)}async _read(r){try{for(;;){const{done:i,value:n}=await this._reader.read();if(i){this.push(null);break}if(!this.push(n)||this._cancelling){this._reading=!1;break}}}catch(i){this.emit("error",i)}}_destroy(r){this._reader.cancel(r)}}b1=function(e,r){return new t(e,r)}}const sc=new WeakSet,ee=Symbol("externalBuffer");function kr(t){if(this.stream=t,t[ee]&&(this[ee]=t[ee].slice()),ce(t)){const i=t.getReader();return this._read=i.read.bind(i),this._releaseLock=()=>{},void(this._cancel=()=>{})}let e=je(t);if(e==="node"&&(t=Do(t)),e){const i=t.getReader();return this._read=i.read.bind(i),this._releaseLock=()=>{i.closed.catch(function(){}),i.releaseLock()},void(this._cancel=i.cancel.bind(i))}let r=!1;this._read=async()=>r||sc.has(t)?{value:void 0,done:!0}:(r=!0,{value:t,done:!1}),this._releaseLock=()=>{if(r)try{sc.add(t)}catch{}}}kr.prototype.read=async function(){return this[ee]&&this[ee].length?{done:!1,value:this[ee].shift()}:this._read()},kr.prototype.releaseLock=function(){this[ee]&&(this.stream[ee]=this[ee]),this._releaseLock()},kr.prototype.cancel=function(t){return this._cancel(t)},kr.prototype.readLine=async function(){let t,e=[];for(;!t;){let{done:r,value:i}=await this.read();if(i+="",r)return e.length?Ne(e):void 0;const n=i.indexOf(` `)+1;n&&(t=Ne(e.concat(i.substr(0,n))),e=[]),n!==i.length&&e.push(i.substr(n))}return this.unshift(...e),t},kr.prototype.readByte=async function(){const{done:t,value:e}=await this.read();if(t)return;const r=e[0];return this.unshift(Se(e,1)),r},kr.prototype.readBytes=async function(t){const e=[];let r=0;for(;;){const{done:i,value:n}=await this.read();if(i)return e.length?Ne(e):void 0;if(e.push(n),r+=n.length,r>=t){const a=Ne(e);return this.unshift(Se(a,t)),Se(a,0,t)}}},kr.prototype.peekBytes=async function(t){const e=await this.readBytes(t);return this.unshift(e),e},kr.prototype.unshift=function(...t){this[ee]||(this[ee]=[]),t.length===1&&Co(t[0])&&this[ee].length&&t[0].length&&this[ee][0].byteOffset>=t[0].length?this[ee][0]=new Uint8Array(this[ee][0].buffer,this[ee][0].byteOffset-t[0].length,this[ee][0].byteLength+t[0].length):this[ee].unshift(...t.filter(e=>e&&e.length))},kr.prototype.readToEnd=async function(t=Ne){const e=[];for(;;){const{done:r,value:i}=await this.read();if(r)break;e.push(i)}return t(e)};let U0,Su,{ReadableStream:oi,WritableStream:Eu,TransformStream:$n}=Ye;async function Pu(){if($n)return;const[t,e]=await Promise.all([ri(()=>Promise.resolve().then(function(){return l6}),void 0),ri(()=>Promise.resolve().then(function(){return _6}),void 0)]);({ReadableStream:oi,WritableStream:Eu,TransformStream:$n}=t);const{createReadableStreamWrapper:r}=e;Ye.ReadableStream&&oi!==Ye.ReadableStream&&(U0=r(oi),Su=r(Ye.ReadableStream))}const ka=Mo&&void 0;function Ga(t){let e=je(t);return e==="node"?Do(t):e==="web"&&U0?U0(t):e?t:new oi({start(r){r.enqueue(t),r.close()}})}function xu(t){if(je(t))return t;const e=new Rr;return(async()=>{const r=We(e);await r.write(t),await r.close()})(),e}function Ne(t){return t.some(e=>je(e)&&!ce(e))?function(e){e=e.map(Ga);const r=Cu(async function(a){await Promise.all(n.map(s=>B0(s,a)))});let i=Promise.resolve();const n=e.map((a,s)=>ci(a,(o,u)=>(i=i.then(()=>Fi(o,r.writable,{preventClose:s!==e.length-1})),i)));return r.readable}(t):t.some(e=>ce(e))?function(e){const r=new Rr;let i=Promise.resolve();return e.forEach((n,a)=>(i=i.then(()=>Fi(n,r,{preventClose:a!==e.length-1})),i)),r}(t):typeof t[0]=="string"?t.join(""):ka&&ka.isBuffer(t[0])?ka.concat(t):Au(t)}function Nr(t){return new kr(t)}function We(t){return new oa(t)}async function Fi(t,e,{preventClose:r=!1,preventAbort:i=!1,preventCancel:n=!1}={}){if(je(t)&&!ce(t)){t=Ga(t);try{if(t[ee]){const o=We(e);for(let u=0;u{e=a}),e=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function oe(t,e=()=>{},r=()=>{}){if(ce(t)){const a=new Rr;return(async()=>{const s=We(a);try{const o=await he(t),u=e(o),c=r();let h;h=u!==void 0&&c!==void 0?Ne([u,c]):u!==void 0?u:c,await s.write(h),await s.close()}catch(o){await s.abort(o)}})(),a}if(je(t))return Mu(t,{async transform(a,s){try{const o=await e(a);o!==void 0&&s.enqueue(o)}catch(o){s.error(o)}},async flush(a){try{const s=await r();s!==void 0&&a.enqueue(s)}catch(s){a.error(s)}}});const i=e(t),n=r();return i!==void 0&&n!==void 0?Ne([i,n]):i!==void 0?i:n}function ci(t,e){if(je(t)&&!ce(t)){let i;const n=new $n({start(o){i=o}}),a=Fi(t,n.writable),s=Cu(async function(o){i.error(o),await a,await new Promise(setTimeout)});return e(n.readable,s.writable),s.readable}t=xu(t);const r=new Rr;return e(t,r),r}function Ko(t,e){let r;const i=ci(t,(n,a)=>{const s=Nr(n);s.remainder=()=>(s.releaseLock(),Fi(n,a),i),r=e(s)});return r}function pn(t){if(ce(t))return t.clone();if(je(t)){const e=function(r){if(ce(r))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(je(r)){const i=Ga(r).tee();return i[0][ee]=i[1][ee]=r[ee],i}return[Se(r),Se(r)]}(t);return Du(t,e[0]),e[1]}return Se(t)}function Un(t){return ce(t)?pn(t):je(t)?new oi({start(e){const r=ci(t,async(i,n)=>{const a=Nr(i),s=We(n);try{for(;;){await s.ready;const{done:o,value:u}=await a.read();if(o){try{e.close()}catch{}return void await s.close()}try{e.enqueue(u)}catch{}await s.write(u)}}catch(o){e.error(o),await s.abort(o)}});Du(t,r)}}):Se(t)}function Du(t,e){Object.entries(Object.getOwnPropertyDescriptors(t.constructor.prototype)).forEach(([r,i])=>{r!=="constructor"&&(i.value?i.value=i.value.bind(e):i.get=i.get.bind(e),Object.defineProperty(t,r,i))})}function Se(t,e=0,r=1/0){if(ce(t))throw Error("Not implemented");if(je(t)){if(e>=0&&r>=0){let i=0;return Mu(t,{transform(n,a){i=e&&a.enqueue(Se(n,Math.max(e-i,0),r-i)),i+=n.length):a.terminate()}})}if(e<0&&(r<0||r===1/0)){let i=[];return oe(t,n=>{n.length>=-e?i=[n]:i.push(n)},()=>Se(Ne(i),e,r))}if(e===0&&r<0){let i;return oe(t,n=>{const a=i?Ne([i,n]):n;if(a.length>=-r)return i=Se(a,r),Se(a,e,r);i=a})}return console.warn(`stream.slice(input, ${e}, ${r}) not implemented efficiently.`),Ni(async()=>Se(await he(t),e,r))}return t[ee]&&(t=Ne(t[ee].concat([t]))),!Co(t)||ka&&ka.isBuffer(t)?t.slice(e,r):(r===1/0&&(r=t.length),t.subarray(e,r))}async function he(t,e=Ne){return ce(t)?t.readToEnd(e):je(t)?Nr(t).readToEnd(e):t}async function B0(t,e){if(je(t)){if(t.cancel)return t.cancel(e);if(t.destroy)return t.destroy(e),await new Promise(setTimeout),e}}function Ni(t){const e=new Rr;return(async()=>{const r=We(e);try{await r.write(await t()),await r.close()}catch(i){await r.abort(i)}})(),e}const Ku="3.7.5",rd=Ku,id=typeof atob=="function",nd=typeof btoa=="function",Zn=typeof Buffer=="function",oc=typeof TextDecoder=="function"?new TextDecoder:void 0,cc=typeof TextEncoder=="function"?new TextEncoder:void 0,ca=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),cs=(t=>{let e={};return ca.forEach((r,i)=>e[r]=i),e})(),ad=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ke=String.fromCharCode.bind(String),uc=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),Ru=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),Iu=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),Uu=t=>{let e,r,i,n,a="";const s=t.length%3;for(let o=0;o255||(i=t.charCodeAt(o++))>255||(n=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|i<<8|n,a+=ca[e>>18&63]+ca[e>>12&63]+ca[e>>6&63]+ca[63&e]}return s?a.slice(0,s-3)+"===".substring(s):a},m1=nd?t=>btoa(t):Zn?t=>Buffer.from(t,"binary").toString("base64"):Uu,T0=Zn?t=>Buffer.from(t).toString("base64"):t=>{let e=[];for(let r=0,i=t.length;re?Ru(T0(t)):T0(t),sd=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?ke(192|e>>>6)+ke(128|63&e):ke(224|e>>>12&15)+ke(128|e>>>6&63)+ke(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return ke(240|e>>>18&7)+ke(128|e>>>12&63)+ke(128|e>>>6&63)+ke(128|63&e)},od=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Bu=t=>t.replace(od,sd),hc=Zn?t=>Buffer.from(t,"utf8").toString("base64"):cc?t=>T0(cc.encode(t)):t=>m1(Bu(t)),Bn=(t,e=!1)=>e?Ru(hc(t)):hc(t),dc=t=>Bn(t,!0),cd=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ud=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return ke(55296+(e>>>10))+ke(56320+(1023&e));case 3:return ke((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return ke((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},Tu=t=>t.replace(cd,ud),zu=t=>{if(t=t.replace(/\s+/g,""),!ad.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let e,r,i,n="";for(let a=0;a>16&255):i===64?ke(e>>16&255,e>>8&255):ke(e>>16&255,e>>8&255,255&e);return n},g1=id?t=>atob(Iu(t)):Zn?t=>Buffer.from(t,"base64").toString("binary"):zu,qu=Zn?t=>uc(Buffer.from(t,"base64")):t=>uc(g1(t).split("").map(e=>e.charCodeAt(0))),Fu=t=>qu(Ou(t)),hd=Zn?t=>Buffer.from(t,"base64").toString("utf8"):oc?t=>oc.decode(qu(t)):t=>Tu(g1(t)),Ou=t=>Iu(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),z0=t=>hd(Ou(t)),$u=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),fc=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,$u(r));t("fromBase64",function(){return z0(this)}),t("toBase64",function(e){return Bn(this,e)}),t("toBase64URI",function(){return Bn(this,!0)}),t("toBase64URL",function(){return Bn(this,!0)}),t("toUint8Array",function(){return Fu(this)})},lc=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,$u(r));t("toBase64",function(e){return Rs(this,e)}),t("toBase64URI",function(){return Rs(this,!0)}),t("toBase64URL",function(){return Rs(this,!0)})},pc={version:Ku,VERSION:rd,atob:g1,atobPolyfill:zu,btoa:m1,btoaPolyfill:Uu,fromBase64:z0,toBase64:Bn,encode:Bn,encodeURI:dc,encodeURL:dc,utob:Bu,btou:Tu,decode:z0,isValid:t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:Rs,toUint8Array:Fu,extendString:fc,extendUint8Array:lc,extendBuiltins:()=>{fc(),lc()}};class Be{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const r=e,i=Array(r.length);for(let n=0;nBigInt(0);){const s=i&BigInt(1);i>>=BigInt(1);const o=a*n%r.value;a=s?o:a,n=n*n%r.value}return new Be(a)}modInv(e){const{gcd:r,x:i}=this._egcd(e);if(!r.isOne())throw Error("Inverse does not exist");return i.add(e).mod(e)}_egcd(e){let r=BigInt(0),i=BigInt(1),n=BigInt(1),a=BigInt(0),s=this.value;for(e=e.value;e!==BigInt(0);){const o=s/e;let u=r;r=n-o*r,n=u,u=i,i=a-o*i,a=u,u=e,e=s%e,s=u}return{x:new Be(n),y:new Be(a),gcd:new Be(s)}}gcd(e){let r=this.value;for(e=e.value;e!==BigInt(0);){const i=e;e=r%e,r=i}return new Be(r)}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 Be(0),r=new Be(1),i=new Be(-1),n=this.isNegative()?i:e;let a=1;const s=this.clone();for(;!s.irightShift(r).equal(n);)a++;return a}byteLength(){const e=new Be(0),r=new Be(-1),i=this.isNegative()?r:e,n=new Be(8);let a=1;const s=this.clone();for(;!s.irightShift(n).equal(i);)a++;return a}toUint8Array(e="be",r){let i=this.value.toString(16);i.length%2==1&&(i="0"+i);const n=i.length/2,a=new Uint8Array(r||n),s=r?r-n:0;let o=0;for(;otypeof BigInt!="undefined",yc=(()=>{try{return!1}catch{}return!1})(),M={isString:function(t){return typeof t=="string"||t instanceof String},isArray:function(t){return t instanceof Array},isUint8Array:Co,isStream:je,readNumber:function(t){let e=0;for(let r=0;r>8*(e-i-1)&255;return r},readDate:function(t){const e=M.readNumber(t);return new Date(1e3*e)},writeDate:function(t){const e=Math.floor(t.getTime()/1e3);return M.writeNumber(e,4)},normalizeDate:function(t=Date.now()){return t===null||t===1/0?t:new Date(1e3*Math.floor(+t/1e3))},readMPI:function(t){const e=(t[0]<<8|t[1])+7>>>3;return t.subarray(2,2+e)},leftPad(t,e){const r=new Uint8Array(e),i=e-t.length;return r.set(t,i),r},uint8ArrayToMPI:function(t){const e=M.uint8ArrayBitLength(t);if(e===0)throw Error("Zero MPI");const r=t.subarray(t.length-Math.ceil(e/8)),i=new Uint8Array([(65280&e)>>8,255&e]);return M.concatUint8Array([i,r])},uint8ArrayBitLength:function(t){let e;for(e=0;e>1);for(let r=0;r>1;r++)e[r]=parseInt(t.substr(r<<1,2),16);return e},uint8ArrayToHex:function(t){const e=[],r=t.length;let i,n=0;for(;n{if(!M.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const r=new Uint8Array(e.length);for(let i=0;ir("",!0))},decodeUTF8:function(t){const e=new TextDecoder("utf-8");function r(i,n=!1){return e.decode(i,{stream:!n})}return oe(t,r,()=>r(new Uint8Array,!0))},concat:Ne,concatUint8Array:Au,equalsUint8Array:function(t,e){if(!M.isUint8Array(t)||!M.isUint8Array(e))throw Error("Data must be in the form of a Uint8Array");if(t.length!==e.length)return!1;for(let r=0;r>>16;return r!==0&&(t=r,e+=16),r=t>>8,r!==0&&(t=r,e+=8),r=t>>4,r!==0&&(t=r,e+=4),r=t>>2,r!==0&&(t=r,e+=2),r=t>>1,r!==0&&(t=r,e+=1),e},double:function(t){const e=new Uint8Array(t.length),r=t.length-1;for(let i=0;i>7;return e[r]=t[r]<<1^135*(t[0]>>7),e},shiftRight:function(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]>>=e,r>0&&(t[r]|=t[r-1]<<8-e);return t},getWebCrypto:function(){return Ye!==void 0&&Ye.crypto&&Ye.crypto.subtle},getBigInteger:async function(){if(dd())return Be;{const{default:t}=await ri(()=>Promise.resolve().then(function(){return k6}),void 0);return t}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return typeof navigator!="undefined"?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(t){return M.isString(t)?/^(([^<>()[\]\\.,;:\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,}|xn--[a-zA-Z\-0-9]+)))$/.test(t):!1},canonicalizeEOL:function(t){let e=!1;return oe(t,r=>{let i;e&&(r=M.concatUint8Array([new Uint8Array([13]),r])),r[r.length-1]===13?(e=!0,r=r.subarray(0,-1)):e=!1;const n=[];for(let o=0;i=r.indexOf(10,o)+1,i;o=i)r[i-2]!==13&&n.push(i);if(!n.length)return r;const a=new Uint8Array(r.length+n.length);let s=0;for(let o=0;oe?new Uint8Array([13]):void 0)},nativeEOL:function(t){let e=!1;return oe(t,r=>{let i;(r=e&&r[0]!==10?M.concatUint8Array([new Uint8Array([13]),r]):new Uint8Array(r))[r.length-1]===13?(e=!0,r=r.subarray(0,-1)):e=!1;let n=0;for(let a=0;a!==r.length;a=i){i=r.indexOf(13,a)+1,i||(i=r.length);const s=i-(r[i]===10?1:0);a&&r.copyWithin(n,a,s),n+=s-a}return r.subarray(0,n)},()=>e?new Uint8Array([13]):void 0)},removeTrailingSpaces:function(t){return t.split(` `).map(e=>{let r=e.length-1;for(;r>=0&&(e[r]===" "||e[r]===" "||e[r]==="\r");r--);return e.substr(0,r+1)}).join(` `)},wrapError:function(t,e){if(!e)return Error(t);try{e.message=t+": "+e.message}catch{}return e},constructAllowedPackets:function(t){const e={};return t.forEach(r=>{if(!r.tag)throw Error("Invalid input: expected a packet class");e[r.tag]=r}),e},anyPromise:function(t){return new Promise(async(e,r)=>{let i;await Promise.all(t.map(async n=>{try{e(await n)}catch(a){i=a}})),r(i)})},selectUint8Array:function(t,e,r){const i=Math.max(e.length,r.length),n=new Uint8Array(i);let a=0;for(let s=0;s{e=M.concatUint8Array([e,r]);const i=[],n=Math.floor(e.length/45),a=45*n,s=js(e.subarray(0,a));for(let o=0;oe.length?js(e)+` `:"")}function Lu(t){let e="";return oe(t,r=>{e+=r;let i=0;const n=[" "," ","\r",` `];for(let o=0;o0&&(a-i)%4!=0;a--)n.includes(e[a])&&i--;const s=Ws(e.substr(0,a));return e=e.substr(a),s},()=>Ws(e))}function Jr(t){return Lu(t.replace(/-/g,"+").replace(/_/g,"/"))}function Ve(t,e){let r=Yr(t).replace(/[\r\n]/g,"");return e&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}t0?(js=t=>t0.from(t).toString("base64"),Ws=t=>{const e=t0.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(js=t=>pc.btoa(M.uint8ArrayToString(t)),Ws=t=>M.stringToUint8Array(pc.atob(t)));const ea=Symbol("byValue");var v={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsa:22,aedh:23,aedsa:24},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(t,e){if(typeof e=="number"&&(e=this.read(t,e)),t[e]!==void 0)return t[e];throw Error("Invalid enum value.")},read:function(t,e){if(t[ea]||(t[ea]=[],Object.entries(t).forEach(([r,i])=>{t[ea][i]=r})),t[ea][e]!==void 0)return t[ea][e];throw Error("Invalid enum value.")}},vt={preferredHashAlgorithm:v.hash.sha256,preferredSymmetricAlgorithm:v.symmetric.aes256,preferredCompressionAlgorithm:v.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:v.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([v.symmetric.aes128,v.symmetric.aes192,v.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.7.0-1",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([v.hash.md5,v.hash.ripemd]),rejectMessageHashAlgorithms:new Set([v.hash.md5,v.hash.ripemd,v.hash.sha1]),rejectPublicKeyAlgorithms:new Set([v.publicKey.elgamal,v.publicKey.dsa]),rejectCurves:new Set([v.curve.secp256k1])};function fd(t){const e=t.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!e)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?v.armor.multipartSection:/MESSAGE, PART \d+/.test(e[1])?v.armor.multipartLast:/SIGNED MESSAGE/.test(e[1])?v.armor.signed:/MESSAGE/.test(e[1])?v.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?v.armor.publicKey:/PRIVATE KEY BLOCK/.test(e[1])?v.armor.privateKey:/SIGNATURE/.test(e[1])?v.armor.signature:void 0}function Gi(t,e){let r="";return e.showVersion&&(r+="Version: "+e.versionString+` `),e.showComment&&(r+="Comment: "+e.commentString+` `),t&&(r+="Comment: "+t+` `),r+=` `,r}function _i(t){return Yr(function(e){let r=13501623;return oe(e,i=>{const n=ld?Math.floor(i.length/4):0,a=new Uint32Array(i.buffer,i.byteOffset,n);for(let s=0;s>24&255]^ge[1][r>>16&255]^ge[2][r>>8&255]^ge[3][r>>0&255];for(let s=4*n;s>8^ge[0][255&r^i[s]]},()=>new Uint8Array([r,r>>8,r>>16]))}(t))}const ge=[Array(255),Array(255),Array(255),Array(255)];for(let t=0;t<=255;t++){let e=t<<16;for(let r=0;r<8;r++)e=e<<1^((8388608&e)!=0?8801531:0);ge[0][t]=(16711680&e)>>16|65280&e|(255&e)<<16}for(let t=0;t<=255;t++)ge[1][t]=ge[0][t]>>8^ge[0][255&ge[0][t]];for(let t=0;t<=255;t++)ge[2][t]=ge[1][t]>>8^ge[0][255&ge[1][t]];for(let t=0;t<=255;t++)ge[3][t]=ge[2][t]>>8^ge[0][255&ge[2][t]];const ld=function(){const t=new ArrayBuffer(2);return new DataView(t).setInt16(0,255,!0),new Int16Array(t)[0]===255}();function bc(t){for(let e=0;e=0&&i!==t.length-1&&(e=t.slice(0,i),r=t.slice(i+1).substr(0,4)),{body:e,checksum:r}}function Va(t,e=vt){return new Promise(async(r,i)=>{try{const n=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let u,c,h,f=o,m=[],b=Lu(ci(t,async(K,I)=>{const U=Nr(K);try{for(;;){let Q=await U.readLine();if(Q===void 0)throw Error("Misformed armored text");if(Q=M.removeTrailingSpaces(Q.replace(/[\r\n]/g,"")),s)if(u)c||s!==2||(n.test(Q)?(m=m.join(`\r `),c=!0,bc(f),f=[],u=!1):m.push(Q.replace(/^- /,"")));else if(n.test(Q)&&i(Error("Mandatory blank line missing between armor headers and armor data")),a.test(Q)){if(bc(f),u=!0,c||s!==2){r({text:m,data:b,headers:o,type:s});break}}else f.push(Q);else n.test(Q)&&(s=fd(Q))}}catch(Q){return void i(Q)}const G=We(I);try{for(;;){await G.ready;const{done:Q,value:Y}=await U.read();if(Q)throw Error("Misformed armored text");const R=Y+"";if(R.indexOf("=")!==-1||R.indexOf("-")!==-1){let J=await U.readToEnd();J.length||(J=""),J=R+J,J=M.removeTrailingSpaces(J.replace(/\r/g,""));const V=J.split(n);if(V.length===1)throw Error("Misformed armored text");const X=pd(V[0].slice(0,-1));h=X.checksum,await G.write(X.body);break}await G.write(R)}await G.ready,await G.close()}catch(Q){await G.abort(Q)}}));b=ci(b,async(K,I)=>{const U=he(_i(Un(K)));U.catch(()=>{}),await Fi(K,I,{preventClose:!0});const G=We(I);try{const Q=(await U).replace(` `,"");if(h!==Q&&(h||e.checksumRequired))throw Error("Ascii armor integrity check failed");await G.ready,await G.close()}catch(Q){await G.abort(Q)}})}catch(n){i(n)}}).then(async r=>(ce(r.data)&&(r.data=await he(r.data)),r))}function Za(t,e,r,i,n,a=vt){let s,o;t===v.armor.signed&&(s=e.text,o=e.hash,e=e.data);const u=Un(e),c=[];switch(t){case v.armor.multipartSection:c.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+i+`----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push("-----END PGP MESSAGE, PART "+r+"/"+i+`----- `);break;case v.armor.multipartLast:c.push("-----BEGIN PGP MESSAGE, PART "+r+`----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push("-----END PGP MESSAGE, PART "+r+`----- `);break;case v.armor.signed:c.push(`-----BEGIN PGP SIGNED MESSAGE----- `),c.push("Hash: "+o+` `),c.push(s.replace(/^-/gm,"- -")),c.push(` -----BEGIN PGP SIGNATURE----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push(`-----END PGP SIGNATURE----- `);break;case v.armor.message:c.push(`-----BEGIN PGP MESSAGE----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push(`-----END PGP MESSAGE----- `);break;case v.armor.publicKey:c.push(`-----BEGIN PGP PUBLIC KEY BLOCK----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push(`-----END PGP PUBLIC KEY BLOCK----- `);break;case v.armor.privateKey:c.push(`-----BEGIN PGP PRIVATE KEY BLOCK----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push(`-----END PGP PRIVATE KEY BLOCK----- `);break;case v.armor.signature:c.push(`-----BEGIN PGP SIGNATURE----- `),c.push(Gi(n,a)),c.push(Yr(e)),c.push("=",_i(u)),c.push(`-----END PGP SIGNATURE----- `)}return M.concat(c)}class Oi{constructor(){this.bytes=""}read(e){this.bytes=M.uint8ArrayToString(e.subarray(0,8))}write(){return M.stringToUint8Array(this.bytes)}toHex(){return M.uint8ArrayToHex(M.stringToUint8Array(this.bytes))}equals(e,r=!1){return r&&(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 r=new Oi;return r.read(M.hexToUint8Array(e)),r}static wildcard(){const e=new Oi;return e.read(new Uint8Array(8)),e}}var $t=function(){var t,e,r=!1;function i(f,m){var b=t[(e[f]+e[m])%255];return f!==0&&m!==0||(b=0),b}var n,a,s,o,u=!1;function c(){function f(I){var U,G,Q;for(G=Q=function(Y){var R=t[255-e[Y]];return Y===0&&(R=0),R}(I),U=0;U<4;U++)Q^=G=255&(G<<1|G>>>7);return Q^=99}r||function(){t=[],e=[];var I,U,G=1;for(I=0;I<255;I++)t[I]=G,U=128&G,G<<=1,G&=255,U===128&&(G^=27),G^=t[I],e[t[I]]=I;t[255]=t[0],e[0]=0,r=!0}(),n=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var m=0;m<256;m++){var b=f(m);n[m]=b,a[b]=m,s[0][m]=i(2,b)<<24|b<<16|b<<8|i(3,b),o[0][b]=i(14,m)<<24|i(9,m)<<16|i(13,m)<<8|i(11,m);for(var K=1;K<4;K++)s[K][m]=s[K-1][m]>>>8|s[K-1][m]<<24,o[K][b]=o[K-1][b]>>>8|o[K-1][b]<<24}u=!0}var h=function(f,m){u||c();var b=new Uint32Array(m);b.set(n,512),b.set(a,768);for(var K=0;K<4;K++)b.set(s[K],4096+1024*K>>2),b.set(o[K],8192+1024*K>>2);var I=function(U,G,Q){var Y=0,R=0,J=0,V=0,X=0,d=0,y=0,_=0,g=0,p=0,E=0,D=0,nt=0,st=0,q=0,rt=0,ct=0,lt=0,ut=0,dt=0,wt=0,mt=new U.Uint32Array(Q),B=new U.Uint8Array(Q);function Z(P,S,bt,ht,Pt,Lt,Dt,Ct){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Pt=Pt|0,Lt=Lt|0,Dt=Dt|0,Ct=Ct|0;var Xt=0,zt=0,Ot=0,ue=0,Mt=0,Rt=0,Nt=0,Et=0;for(Xt=bt|1024,zt=bt|2048,Ot=bt|3072,Pt=Pt^mt[(P|0)>>2],Lt=Lt^mt[(P|4)>>2],Dt=Dt^mt[(P|8)>>2],Ct=Ct^mt[(P|12)>>2],Et=16;(Et|0)<=ht<<4;Et=Et+16|0)ue=mt[(bt|Pt>>22&1020)>>2]^mt[(Xt|Lt>>14&1020)>>2]^mt[(zt|Dt>>6&1020)>>2]^mt[(Ot|Ct<<2&1020)>>2]^mt[(P|Et|0)>>2],Mt=mt[(bt|Lt>>22&1020)>>2]^mt[(Xt|Dt>>14&1020)>>2]^mt[(zt|Ct>>6&1020)>>2]^mt[(Ot|Pt<<2&1020)>>2]^mt[(P|Et|4)>>2],Rt=mt[(bt|Dt>>22&1020)>>2]^mt[(Xt|Ct>>14&1020)>>2]^mt[(zt|Pt>>6&1020)>>2]^mt[(Ot|Lt<<2&1020)>>2]^mt[(P|Et|8)>>2],Nt=mt[(bt|Ct>>22&1020)>>2]^mt[(Xt|Pt>>14&1020)>>2]^mt[(zt|Lt>>6&1020)>>2]^mt[(Ot|Dt<<2&1020)>>2]^mt[(P|Et|12)>>2],Pt=ue,Lt=Mt,Dt=Rt,Ct=Nt;Y=mt[(S|Pt>>22&1020)>>2]<<24^mt[(S|Lt>>14&1020)>>2]<<16^mt[(S|Dt>>6&1020)>>2]<<8^mt[(S|Ct<<2&1020)>>2]^mt[(P|Et|0)>>2],R=mt[(S|Lt>>22&1020)>>2]<<24^mt[(S|Dt>>14&1020)>>2]<<16^mt[(S|Ct>>6&1020)>>2]<<8^mt[(S|Pt<<2&1020)>>2]^mt[(P|Et|4)>>2],J=mt[(S|Dt>>22&1020)>>2]<<24^mt[(S|Ct>>14&1020)>>2]<<16^mt[(S|Pt>>6&1020)>>2]<<8^mt[(S|Lt<<2&1020)>>2]^mt[(P|Et|8)>>2],V=mt[(S|Ct>>22&1020)>>2]<<24^mt[(S|Pt>>14&1020)>>2]<<16^mt[(S|Lt>>6&1020)>>2]<<8^mt[(S|Dt<<2&1020)>>2]^mt[(P|Et|12)>>2]}function x(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Z(0,2048,4096,wt,P,S,bt,ht)}function l(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0;var Pt=0;Z(1024,3072,8192,wt,P,ht,bt,S),Pt=R,R=V,V=Pt}function z(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Z(0,2048,4096,wt,X^P,d^S,y^bt,_^ht),X=Y,d=R,y=J,_=V}function et(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0;var Pt=0;Z(1024,3072,8192,wt,P,ht,bt,S),Pt=R,R=V,V=Pt,Y=Y^X,R=R^d,J=J^y,V=V^_,X=P,d=S,y=bt,_=ht}function tt(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Z(0,2048,4096,wt,X,d,y,_),X=Y=Y^P,d=R=R^S,y=J=J^bt,_=V=V^ht}function it(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Z(0,2048,4096,wt,X,d,y,_),Y=Y^P,R=R^S,J=J^bt,V=V^ht,X=P,d=S,y=bt,_=ht}function k(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Z(0,2048,4096,wt,X,d,y,_),X=Y,d=R,y=J,_=V,Y=Y^P,R=R^S,J=J^bt,V=V^ht}function w(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Z(0,2048,4096,wt,g,p,E,D),D=~rt&D|rt&D+1,E=~q&E|q&E+((D|0)==0),p=~st&p|st&p+((E|0)==0),g=~nt&g|nt&g+((p|0)==0),Y=Y^P,R=R^S,J=J^bt,V=V^ht}function A(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0;var Pt=0,Lt=0,Dt=0,Ct=0,Xt=0,zt=0,Ot=0,ue=0,Mt=0,Rt=0;for(P=P^X,S=S^d,bt=bt^y,ht=ht^_,Pt=ct|0,Lt=lt|0,Dt=ut|0,Ct=dt|0;(Mt|0)<128;Mt=Mt+1|0)Pt>>>31&&(Xt=Xt^P,zt=zt^S,Ot=Ot^bt,ue=ue^ht),Pt=Pt<<1|Lt>>>31,Lt=Lt<<1|Dt>>>31,Dt=Dt<<1|Ct>>>31,Ct=Ct<<1,Rt=ht&1,ht=ht>>>1|bt<<31,bt=bt>>>1|S<<31,S=S>>>1|P<<31,P=P>>>1,Rt&&(P=P^3774873600);X=Xt,d=zt,y=Ot,_=ue}function C(P){P=P|0,wt=P}function $(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,Y=P,R=S,J=bt,V=ht}function T(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,X=P,d=S,y=bt,_=ht}function W(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,g=P,p=S,E=bt,D=ht}function yt(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,nt=P,st=S,q=bt,rt=ht}function ft(P,S,bt,ht){P=P|0,S=S|0,bt=bt|0,ht=ht|0,D=~rt&D|rt&ht,E=~q&E|q&bt,p=~st&p|st&S,g=~nt&g|nt&P}function gt(P){return P=P|0,P&15?-1:(B[P|0]=Y>>>24,B[P|1]=Y>>>16&255,B[P|2]=Y>>>8&255,B[P|3]=Y&255,B[P|4]=R>>>24,B[P|5]=R>>>16&255,B[P|6]=R>>>8&255,B[P|7]=R&255,B[P|8]=J>>>24,B[P|9]=J>>>16&255,B[P|10]=J>>>8&255,B[P|11]=J&255,B[P|12]=V>>>24,B[P|13]=V>>>16&255,B[P|14]=V>>>8&255,B[P|15]=V&255,16)}function O(P){return P=P|0,P&15?-1:(B[P|0]=X>>>24,B[P|1]=X>>>16&255,B[P|2]=X>>>8&255,B[P|3]=X&255,B[P|4]=d>>>24,B[P|5]=d>>>16&255,B[P|6]=d>>>8&255,B[P|7]=d&255,B[P|8]=y>>>24,B[P|9]=y>>>16&255,B[P|10]=y>>>8&255,B[P|11]=y&255,B[P|12]=_>>>24,B[P|13]=_>>>16&255,B[P|14]=_>>>8&255,B[P|15]=_&255,16)}function F(){x(0,0,0,0),ct=Y,lt=R,ut=J,dt=V}function j(P,S,bt){P=P|0,S=S|0,bt=bt|0;var ht=0;if(S&15)return-1;for(;(bt|0)>=16;)N[P&7](B[S|0]<<24|B[S|1]<<16|B[S|2]<<8|B[S|3],B[S|4]<<24|B[S|5]<<16|B[S|6]<<8|B[S|7],B[S|8]<<24|B[S|9]<<16|B[S|10]<<8|B[S|11],B[S|12]<<24|B[S|13]<<16|B[S|14]<<8|B[S|15]),B[S|0]=Y>>>24,B[S|1]=Y>>>16&255,B[S|2]=Y>>>8&255,B[S|3]=Y&255,B[S|4]=R>>>24,B[S|5]=R>>>16&255,B[S|6]=R>>>8&255,B[S|7]=R&255,B[S|8]=J>>>24,B[S|9]=J>>>16&255,B[S|10]=J>>>8&255,B[S|11]=J&255,B[S|12]=V>>>24,B[S|13]=V>>>16&255,B[S|14]=V>>>8&255,B[S|15]=V&255,ht=ht+16|0,S=S+16|0,bt=bt-16|0;return ht|0}function L(P,S,bt){P=P|0,S=S|0,bt=bt|0;var ht=0;if(S&15)return-1;for(;(bt|0)>=16;)H[P&1](B[S|0]<<24|B[S|1]<<16|B[S|2]<<8|B[S|3],B[S|4]<<24|B[S|5]<<16|B[S|6]<<8|B[S|7],B[S|8]<<24|B[S|9]<<16|B[S|10]<<8|B[S|11],B[S|12]<<24|B[S|13]<<16|B[S|14]<<8|B[S|15]),ht=ht+16|0,S=S+16|0,bt=bt-16|0;return ht|0}var N=[x,l,z,et,tt,it,k,w],H=[z,A];return{set_rounds:C,set_state:$,set_iv:T,set_nonce:W,set_mask:yt,set_counter:ft,get_state:gt,get_iv:O,gcm_init:F,cipher:j,mac:L}}({Uint8Array,Uint32Array},f,m);return I.set_key=function(U,G,Q,Y,R,J,V,X,d){var y=b.subarray(0,60),_=b.subarray(256,316);y.set([G,Q,Y,R,J,V,X,d]);for(var g=U,p=1;g<4*U+28;g++){var E=y[g-1];(g%U==0||U===8&&g%U==4)&&(E=n[E>>>24]<<24^n[E>>>16&255]<<16^n[E>>>8&255]<<8^n[255&E]),g%U==0&&(E=E<<8^E>>>24^p<<24,p=p<<1^(128&p?27:0)),y[g]=y[g-U]^E}for(var D=0;D=g-4?E:o[0][n[E>>>24]]^o[1][n[E>>>16&255]]^o[2][n[E>>>8&255]]^o[3][n[255&E]];I.set_rounds(U+5)},I};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 mc(t){return t instanceof Uint8Array}function w1(t,e){const r=t?t.byteLength:e||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return t=t||new Uint8Array(new ArrayBuffer(r))}function rn(t,e,r,i,n){const a=t.length-e,s=an+a.length,0),r=new Uint8Array(e);let i=0;for(let n=0;n>2,a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12),n>16?a.getUint32(16):0,n>16?a.getUint32(20):0,n>24?a.getUint32(24):0,n>24?a.getUint32(28):0),r!==void 0){if(r.length!==16)throw new ii("illegal iv size");let s=new DataView(r.buffer,r.byteOffset,r.byteLength);i.set_iv(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}else i.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!mc(e))throw new TypeError("data isn't of expected type");let{heap:r,asm:i}=this.acquire_asm(),n=$t.ENC[this.mode],a=$t.HEAP_DATA,s=this.pos,o=this.len,u=0,c=e.length||0,h=0,f=0,m=new Uint8Array(o+c&-16);for(;c>0;)f=rn(r,s+o,e,u,c),o+=f,u+=f,c-=f,f=i.cipher(n,a+s,o),f&&m.set(r.subarray(s,s+f),h),h+=f,f0;)b=rn(r,s+o,e,u,c),o+=b,u+=b,c-=b,b=i.cipher(n,a+s,o-(c?0:m)),b&&K.set(r.subarray(s,s+b),h),h+=b,b0){if(s%16){if(this.hasOwnProperty("padding"))throw new ii("data length must be a multiple of the block size");s+=16-s%16}if(r.cipher(i,n+a,s),this.hasOwnProperty("padding")&&this.padding){let c=e[a+o-1];if(c<1||c>16||c>o)throw new F0("bad padding");let h=0;for(let f=c;f>1;f--)h|=c^e[a+o-f];if(h)throw new F0("bad padding");o-=c}}const u=new Uint8Array(o);return o>0&&u.set(e.subarray(a,a+o)),this.pos=0,this.len=0,this.release_asm(),u}}class Hs{static encrypt(e,r,i=!1){return new Hs(r,i).encrypt(e)}static decrypt(e,r,i=!1){return new Hs(r,i).decrypt(e)}constructor(e,r=!1,i){this.aes=i||new Ya(e,void 0,r,"ECB")}encrypt(e){return $i(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return $i(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function v1(t){const e=function(r){const i=new Hs(r);this.encrypt=function(n){return i.encrypt(n)},this.decrypt=function(n){return i.decrypt(n)}};return e.blockSize=e.prototype.blockSize=16,e.keySize=e.prototype.keySize=t/8,e}function Aa(t,e,r,i,n,a){const s=[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],o=[-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],u=[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],c=[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],f=[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],m=[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],b=[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 K,I,U,G,Q,Y,R,J,V,X,d,y,_,g,p=0,E=e.length;const D=t.length===32?3:9;J=D===3?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&&(e=function(q,rt){const ct=8-q.length%8;let lt;if(rt===2&&ct<8)lt=32;else if(rt===1)lt=ct;else{if(rt||!(ct<8)){if(ct===8)return q;throw Error("des: invalid padding")}lt=0}const ut=new Uint8Array(q.length+ct);for(let dt=0;dt>>4^R),R^=U,Y^=U<<4,U=65535&(Y>>>16^R),R^=U,Y^=U<<16,U=858993459&(R>>>2^Y),Y^=U,R^=U<<2,U=16711935&(R>>>8^Y),Y^=U,R^=U<<8,U=1431655765&(Y>>>1^R),R^=U,Y^=U<<1,Y=Y<<1|Y>>>31,R=R<<1|R>>>31,I=0;I>>4|R<<28)^t[K+1],U=Y,Y=R,R=U^(o[G>>>24&63]|c[G>>>16&63]|f[G>>>8&63]|b[63&G]|s[Q>>>24&63]|u[Q>>>16&63]|h[Q>>>8&63]|m[63&Q]);U=Y,Y=R,R=U}Y=Y>>>1|Y<<31,R=R>>>1|R<<31,U=1431655765&(Y>>>1^R),R^=U,Y^=U<<1,U=16711935&(R>>>8^Y),Y^=U,R^=U<<8,U=858993459&(R>>>2^Y),Y^=U,R^=U<<2,U=65535&(Y>>>16^R),R^=U,Y^=U<<16,U=252645135&(Y>>>4^R),R^=U,Y^=U<<4,i===1&&(r?(V=Y,d=R):(Y^=X,R^=y)),nt[st++]=Y>>>24,nt[st++]=Y>>>16&255,nt[st++]=Y>>>8&255,nt[st++]=255&Y,nt[st++]=R>>>24,nt[st++]=R>>>16&255,nt[st++]=R>>>8&255,nt[st++]=255&R}return r||(nt=function(q,rt){let ct,lt=null;if(rt===2)ct=32;else if(rt===1)lt=q[q.length-1];else{if(rt)throw Error("des: invalid padding");ct=0}if(!lt){for(lt=1;q[q.length-lt]===ct;)lt++;lt--}return q.subarray(0,q.length-lt)}(nt,a)),nt}function Sa(t){const e=[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],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[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],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[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],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],b=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],K=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],I=t.length>8?3:1,U=Array(32*I),G=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Q,Y,R,J=0,V=0;for(let X=0;X>>4^y),y^=R,d^=R<<4,R=65535&(y>>>-16^d),d^=R,y^=R<<-16,R=858993459&(d>>>2^y),y^=R,d^=R<<2,R=65535&(y>>>-16^d),d^=R,y^=R<<-16,R=1431655765&(d>>>1^y),y^=R,d^=R<<1,R=16711935&(y>>>8^d),d^=R,y^=R<<8,R=1431655765&(d>>>1^y),y^=R,d^=R<<1,R=d<<8|y>>>20&240,d=y<<24|y<<8&16711680|y>>>8&65280|y>>>24&240,y=R;for(let _=0;_<16;_++)G[_]?(d=d<<2|d>>>26,y=y<<2|y>>>26):(d=d<<1|d>>>27,y=y<<1|y>>>27),d&=-15,y&=-15,Q=e[d>>>28]|r[d>>>24&15]|i[d>>>20&15]|n[d>>>16&15]|a[d>>>12&15]|s[d>>>8&15]|o[d>>>4&15],Y=u[y>>>28]|c[y>>>24&15]|h[y>>>20&15]|f[y>>>16&15]|m[y>>>12&15]|b[y>>>8&15]|K[y>>>4&15],R=65535&(Y>>>16^Q),U[V++]=Q^R,U[V++]=Y^R<<16}return U}function ua(t){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(t.subarray(8*e,8*e+8)));this.encrypt=function(e){return Aa(Sa(this.key[2]),Aa(Sa(this.key[1]),Aa(Sa(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function yd(){this.BlockSize=8,this.KeySize=16,this.setKey=function(s){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),s.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(s),!0},this.reset=function(){for(let s=0;s<16;s++)this.masking[s]=0,this.rotate[s]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=f>>>16&255,o[u+2]=f>>>8&255,o[u+3]=255&f,o[u+4]=h>>>24&255,o[u+5]=h>>>16&255,o[u+6]=h>>>8&255,o[u+7]=255&h}return o},this.decrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=f>>>16&255,o[u+2]=f>>>8&255,o[u+3]=255&f,o[u+4]=h>>>24&255,o[u+5]=h>>16&255,o[u+6]=h>>8&255,o[u+7]=255&h}return o};const t=[,,,,];t[0]=[,,,,],t[0][0]=[4,0,13,15,12,14,8],t[0][1]=[5,2,16,18,17,19,10],t[0][2]=[6,3,23,22,21,20,9],t[0][3]=[7,1,26,25,27,24,11],t[1]=[,,,,],t[1][0]=[0,6,21,23,20,22,16],t[1][1]=[1,4,0,2,1,3,18],t[1][2]=[2,5,7,6,5,4,17],t[1][3]=[3,7,10,9,11,8,19],t[2]=[,,,,],t[2][0]=[4,0,13,15,12,14,8],t[2][1]=[5,2,16,18,17,19,10],t[2][2]=[6,3,23,22,21,20,9],t[2][3]=[7,1,26,25,27,24,11],t[3]=[,,,,],t[3][0]=[0,6,21,23,20,22,16],t[3][1]=[1,4,0,2,1,3,18],t[3][2]=[2,5,7,6,5,4,17],t[3][3]=[3,7,10,9,11,8,19];const e=[,,,,];function r(s,o,u){const c=o+s,h=c<>>32-u;return(a[0][h>>>24]^a[1][h>>>16&255])-a[2][h>>>8&255]+a[3][255&h]}function i(s,o,u){const c=o^s,h=c<>>32-u;return a[0][h>>>24]-a[1][h>>>16&255]+a[2][h>>>8&255]^a[3][255&h]}function n(s,o,u){const c=o-s,h=c<>>32-u;return(a[0][h>>>24]+a[1][h>>>16&255]^a[2][h>>>8&255])-a[3][255&h]}e[0]=[,,,,],e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=[,,,,],e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=[,,,,],e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=[,,,,],e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(s){const o=[,,,,,,,,],u=Array(32);let c;for(let b=0;b<4;b++)c=4*b,o[b]=s[c]<<24|s[c+1]<<16|s[c+2]<<8|s[c+3];const h=[6,7,4,5];let f,m=0;for(let b=0;b<2;b++)for(let K=0;K<4;K++){for(c=0;c<4;c++){const I=t[K][c];f=o[I[1]],f^=a[4][o[I[2]>>>2]>>>24-8*(3&I[2])&255],f^=a[5][o[I[3]>>>2]>>>24-8*(3&I[3])&255],f^=a[6][o[I[4]>>>2]>>>24-8*(3&I[4])&255],f^=a[7][o[I[5]>>>2]>>>24-8*(3&I[5])&255],f^=a[h[c]][o[I[6]>>>2]>>>24-8*(3&I[6])&255],o[I[0]]=f}for(c=0;c<4;c++){const I=e[K][c];f=a[4][o[I[0]>>>2]>>>24-8*(3&I[0])&255],f^=a[5][o[I[1]>>>2]>>>24-8*(3&I[1])&255],f^=a[6][o[I[2]>>>2]>>>24-8*(3&I[2])&255],f^=a[7][o[I[3]>>>2]>>>24-8*(3&I[3])&255],f^=a[4+c][o[I[4]>>>2]>>>24-8*(3&I[4])&255],u[m]=f,m++}}for(let b=0;b<16;b++)this.masking[b]=u[b],this.rotate[b]=31&u[16+b]};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 ha(t){this.cast5=new yd,this.cast5.setKey(t),this.encrypt=function(e){return this.cast5.encrypt(e)}}ua.keySize=ua.prototype.keySize=24,ua.blockSize=ua.prototype.blockSize=8,ha.blockSize=ha.prototype.blockSize=8,ha.keySize=ha.prototype.keySize=16;const Je=4294967295;function wr(t,e){return(t<>>32-e)&Je}function Gr(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function wi(t,e,r){t.splice(e,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function qt(t,e){return t>>>8*e&255}function da(t){this.tf=function(){let e=null,r=null,i=-1,n=[],a=[[],[],[],[]];function s(h){return a[0][qt(h,0)]^a[1][qt(h,1)]^a[2][qt(h,2)]^a[3][qt(h,3)]}function o(h){return a[0][qt(h,3)]^a[1][qt(h,0)]^a[2][qt(h,1)]^a[3][qt(h,2)]}function u(h,f){let m=s(f[0]),b=o(f[1]);f[2]=wr(f[2]^m+b+n[4*h+8]&Je,31),f[3]=wr(f[3],1)^m+2*b+n[4*h+9]&Je,m=s(f[2]),b=o(f[3]),f[0]=wr(f[0]^m+b+n[4*h+10]&Je,31),f[1]=wr(f[1],1)^m+2*b+n[4*h+11]&Je}function c(h,f){let m=s(f[0]),b=o(f[1]);f[2]=wr(f[2],1)^m+b+n[4*h+10]&Je,f[3]=wr(f[3]^m+2*b+n[4*h+11]&Je,31),m=s(f[2]),b=o(f[3]),f[0]=wr(f[0],1)^m+b+n[4*h+8]&Je,f[1]=wr(f[1]^m+2*b+n[4*h+9]&Je,31)}return{name:"twofish",blocksize:16,open:function(h){let f,m,b,K,I;e=h;const U=[],G=[],Q=[];let Y;const R=[];let J,V,X;const d=[[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]],y=[[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]],_=[[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]],g=[[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]],p=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],E=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],D=[[],[]],nt=[[],[],[],[]];function st(ut){return ut^ut>>2^[0,90,180,238][3&ut]}function q(ut){return ut^ut>>1^ut>>2^[0,238,180,90][3&ut]}function rt(ut,dt){let wt,mt,B;for(wt=0;wt<8;wt++)mt=dt>>>24,dt=dt<<8&Je|ut>>>24,ut=ut<<8&Je,B=mt<<1,128&mt&&(B^=333),dt^=mt^B<<16,B^=mt>>>1,1&mt&&(B^=166),dt^=B<<24|B<<8;return dt}function ct(ut,dt){const wt=dt>>4,mt=15&dt,B=d[ut][wt^mt],Z=y[ut][p[mt]^E[wt]];return g[ut][p[Z]^E[B]]<<4|_[ut][B^Z]}function lt(ut,dt){let wt=qt(ut,0),mt=qt(ut,1),B=qt(ut,2),Z=qt(ut,3);switch(Y){case 4:wt=D[1][wt]^qt(dt[3],0),mt=D[0][mt]^qt(dt[3],1),B=D[0][B]^qt(dt[3],2),Z=D[1][Z]^qt(dt[3],3);case 3:wt=D[1][wt]^qt(dt[2],0),mt=D[1][mt]^qt(dt[2],1),B=D[0][B]^qt(dt[2],2),Z=D[0][Z]^qt(dt[2],3);case 2:wt=D[0][D[0][wt]^qt(dt[1],0)]^qt(dt[0],0),mt=D[0][D[1][mt]^qt(dt[1],1)]^qt(dt[0],1),B=D[1][D[0][B]^qt(dt[1],2)]^qt(dt[0],2),Z=D[1][D[1][Z]^qt(dt[1],3)]^qt(dt[0],3)}return nt[0][wt]^nt[1][mt]^nt[2][B]^nt[3][Z]}for(e=e.slice(0,32),f=e.length;f!==16&&f!==24&&f!==32;)e[f++]=0;for(f=0;f>2]=Gr(e,f);for(f=0;f<256;f++)D[0][f]=ct(0,f),D[1][f]=ct(1,f);for(f=0;f<256;f++)J=D[1][f],V=st(J),X=q(J),nt[0][f]=J+(V<<8)+(X<<16)+(X<<24),nt[2][f]=V+(X<<8)+(J<<16)+(X<<24),J=D[0][f],V=st(J),X=q(J),nt[1][f]=X+(X<<8)+(V<<16)+(J<<24),nt[3][f]=V+(J<<8)+(X<<16)+(V<<24);for(Y=Q.length/2,f=0;f=0;b--)c(b,m);wi(r,i,m[2]^n[0]),wi(r,i+4,m[3]^n[1]),wi(r,i+8,m[0]^n[2]),wi(r,i+12,m[1]^n[3]),i+=16},finalize:function(){return r}}}(),this.tf.open(Array.from(t),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function nr(){}function fa(t){this.bf=new nr,this.bf.init(t),this.encrypt=function(e){return this.bf.encryptBlock(e)}}da.keySize=da.prototype.keySize=32,da.blockSize=da.prototype.blockSize=16,nr.prototype.BLOCKSIZE=8,nr.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]],nr.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],nr.prototype.NN=16,nr.prototype._clean=function(t){return t<0&&(t=(2147483647&t)+2147483648),t},nr.prototype._F=function(t){let e;const r=255&t,i=255&(t>>>=8),n=255&(t>>>=8),a=255&(t>>>=8);return e=this.sboxes[0][a]+this.sboxes[1][n],e^=this.sboxes[2][i],e+=this.sboxes[3][r],e},nr.prototype._encryptBlock=function(t){let e,r=t[0],i=t[1];for(e=0;e>>24-8*e&255,n[e+i]=r[1]>>>24-8*e&255;return n},nr.prototype._decryptBlock=function(t){let e,r=t[0],i=t[1];for(e=this.NN+1;e>1;--e){r^=this.parray[e],i=this._F(r)^i;const n=r;r=i,i=n}r^=this.parray[1],i^=this.parray[0],t[0]=this._clean(i),t[1]=this._clean(r)},nr.prototype.init=function(t){let e,r=0;for(this.parray=[],e=0;e=t.length&&(r=0);this.parray[e]=this.PARRAY[e]^n}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],r=0;r<256;++r)this.sboxes[e][r]=this.SBOXES[e][r];const i=[0,0];for(e=0;e>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=rt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=ct+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=lt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=ut+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=dt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=wt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=mt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=B+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=Z+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=x+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=l+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=z+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=et+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=tt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,W=it+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=et^B^ct^q,yt=T<<1|T>>>31,W=yt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=tt^Z^lt^rt,ft=T<<1|T>>>31,W=ft+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=it^x^ut^ct,gt=T<<1|T>>>31,W=gt+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=yt^l^dt^lt,O=T<<1|T>>>31,W=O+(k<<5|k>>>27)+$+(w&A|~w&C)+1518500249|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=ft^z^wt^ut,F=T<<1|T>>>31,W=F+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=gt^et^mt^dt,j=T<<1|T>>>31,W=j+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=O^tt^B^wt,L=T<<1|T>>>31,W=L+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=F^it^Z^mt,N=T<<1|T>>>31,W=N+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=j^yt^x^B,H=T<<1|T>>>31,W=H+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=L^ft^l^Z,P=T<<1|T>>>31,W=P+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=N^gt^z^x,S=T<<1|T>>>31,W=S+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=H^O^et^l,bt=T<<1|T>>>31,W=bt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=P^F^tt^z,ht=T<<1|T>>>31,W=ht+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=S^j^it^et,Pt=T<<1|T>>>31,W=Pt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=bt^L^yt^tt,Lt=T<<1|T>>>31,W=Lt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=ht^N^ft^it,Dt=T<<1|T>>>31,W=Dt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Pt^H^gt^yt,Ct=T<<1|T>>>31,W=Ct+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Lt^P^O^ft,Xt=T<<1|T>>>31,W=Xt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Dt^S^F^gt,zt=T<<1|T>>>31,W=zt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Ct^bt^j^O,Ot=T<<1|T>>>31,W=Ot+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Xt^ht^L^F,ue=T<<1|T>>>31,W=ue+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=zt^Pt^N^j,Mt=T<<1|T>>>31,W=Mt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Ot^Lt^H^L,Rt=T<<1|T>>>31,W=Rt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=ue^Dt^P^N,Nt=T<<1|T>>>31,W=Nt+(k<<5|k>>>27)+$+(w^A^C)+1859775393|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Mt^Ct^S^H,Et=T<<1|T>>>31,W=Et+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Rt^Xt^bt^P,Bt=T<<1|T>>>31,W=Bt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Nt^zt^ht^S,Zt=T<<1|T>>>31,W=Zt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Et^Ot^Pt^bt,It=T<<1|T>>>31,W=It+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Bt^ue^Lt^ht,at=T<<1|T>>>31,W=at+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Zt^Mt^Dt^Pt,ot=T<<1|T>>>31,W=ot+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=It^Rt^Ct^Lt,pt=T<<1|T>>>31,W=pt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=at^Nt^Xt^Dt,_t=T<<1|T>>>31,W=_t+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=ot^Et^zt^Ct,Kt=T<<1|T>>>31,W=Kt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=pt^Bt^Ot^Xt,xt=T<<1|T>>>31,W=xt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=_t^Zt^ue^zt,St=T<<1|T>>>31,W=St+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Kt^It^Mt^Ot,Ht=T<<1|T>>>31,W=Ht+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=xt^at^Rt^ue,Tt=T<<1|T>>>31,W=Tt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=St^ot^Nt^Mt,Gt=T<<1|T>>>31,W=Gt+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Ht^pt^Et^Rt,Ie=T<<1|T>>>31,W=Ie+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Tt^_t^Bt^Nt,Ue=T<<1|T>>>31,W=Ue+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Gt^Kt^Zt^Et,Fe=T<<1|T>>>31,W=Fe+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Ie^xt^It^Bt,fr=T<<1|T>>>31,W=fr+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Ue^St^at^Zt,lr=T<<1|T>>>31,W=lr+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Fe^Ht^ot^It,pr=T<<1|T>>>31,W=pr+(k<<5|k>>>27)+$+(w&A|w&C|A&C)-1894007588|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=fr^Tt^pt^at,yr=T<<1|T>>>31,W=yr+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=lr^Gt^_t^ot,br=T<<1|T>>>31,W=br+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=pr^Ie^Kt^pt,mr=T<<1|T>>>31,W=mr+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=yr^Ue^xt^_t,gr=T<<1|T>>>31,W=gr+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=br^Fe^St^Kt,Wr=T<<1|T>>>31,W=Wr+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=mr^fr^Ht^xt,Hr=T<<1|T>>>31,W=Hr+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=gr^lr^Tt^St,li=T<<1|T>>>31,W=li+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Wr^pr^Gt^Ht,pi=T<<1|T>>>31,W=pi+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Hr^yr^Ie^Tt,yi=T<<1|T>>>31,W=yi+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=li^br^Ue^Gt,bi=T<<1|T>>>31,W=bi+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=pi^mr^Fe^Ie,mi=T<<1|T>>>31,W=mi+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=yi^gr^fr^Ue,gi=T<<1|T>>>31,W=gi+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=bi^Wr^lr^Fe,Hi=T<<1|T>>>31,W=Hi+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=mi^Hr^pr^fr,Yo=T<<1|T>>>31,W=Yo+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=gi^li^yr^lr,Qo=T<<1|T>>>31,W=Qo+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Hi^pi^br^pr,Xo=T<<1|T>>>31,W=Xo+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Yo^yi^mr^yr,Jo=T<<1|T>>>31,W=Jo+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Qo^bi^gr^br,tc=T<<1|T>>>31,W=tc+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Xo^mi^Wr^mr,ec=T<<1|T>>>31,W=ec+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,T=Jo^gi^Hr^gr,rc=T<<1|T>>>31,W=rc+(k<<5|k>>>27)+$+(w^A^C)-899497514|0,$=C,C=A,A=w<<30|w>>>2,w=k,k=W,i=i+k|0,n=n+w|0,a=a+A|0,s=s+C|0,o=o+$|0}function V(q){q=q|0,J(R[q|0]<<24|R[q|1]<<16|R[q|2]<<8|R[q|3],R[q|4]<<24|R[q|5]<<16|R[q|6]<<8|R[q|7],R[q|8]<<24|R[q|9]<<16|R[q|10]<<8|R[q|11],R[q|12]<<24|R[q|13]<<16|R[q|14]<<8|R[q|15],R[q|16]<<24|R[q|17]<<16|R[q|18]<<8|R[q|19],R[q|20]<<24|R[q|21]<<16|R[q|22]<<8|R[q|23],R[q|24]<<24|R[q|25]<<16|R[q|26]<<8|R[q|27],R[q|28]<<24|R[q|29]<<16|R[q|30]<<8|R[q|31],R[q|32]<<24|R[q|33]<<16|R[q|34]<<8|R[q|35],R[q|36]<<24|R[q|37]<<16|R[q|38]<<8|R[q|39],R[q|40]<<24|R[q|41]<<16|R[q|42]<<8|R[q|43],R[q|44]<<24|R[q|45]<<16|R[q|46]<<8|R[q|47],R[q|48]<<24|R[q|49]<<16|R[q|50]<<8|R[q|51],R[q|52]<<24|R[q|53]<<16|R[q|54]<<8|R[q|55],R[q|56]<<24|R[q|57]<<16|R[q|58]<<8|R[q|59],R[q|60]<<24|R[q|61]<<16|R[q|62]<<8|R[q|63])}function X(q){q=q|0,R[q|0]=i>>>24,R[q|1]=i>>>16&255,R[q|2]=i>>>8&255,R[q|3]=i&255,R[q|4]=n>>>24,R[q|5]=n>>>16&255,R[q|6]=n>>>8&255,R[q|7]=n&255,R[q|8]=a>>>24,R[q|9]=a>>>16&255,R[q|10]=a>>>8&255,R[q|11]=a&255,R[q|12]=s>>>24,R[q|13]=s>>>16&255,R[q|14]=s>>>8&255,R[q|15]=s&255,R[q|16]=o>>>24,R[q|17]=o>>>16&255,R[q|18]=o>>>8&255,R[q|19]=o&255}function d(){i=1732584193,n=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function y(q,rt,ct,lt,ut,dt,wt){q=q|0,rt=rt|0,ct=ct|0,lt=lt|0,ut=ut|0,dt=dt|0,wt=wt|0,i=q,n=rt,a=ct,s=lt,o=ut,u=dt,c=wt}function _(q,rt){q=q|0,rt=rt|0;var ct=0;if(q&63)return-1;for(;(rt|0)>=64;)V(q),q=q+64|0,rt=rt-64|0,ct=ct+64|0;return u=u+ct|0,u>>>0>>0&&(c=c+1|0),ct|0}function g(q,rt,ct){q=q|0,rt=rt|0,ct=ct|0;var lt=0,ut=0;if(q&63||~ct&&ct&31)return-1;if((rt|0)>=64){if(lt=_(q,rt)|0,(lt|0)==-1)return-1;q=q+lt|0,rt=rt-lt|0}if(lt=lt+rt|0,u=u+rt|0,u>>>0>>0&&(c=c+1|0),R[q|rt]=128,(rt|0)>=56){for(ut=rt+1|0;(ut|0)<64;ut=ut+1|0)R[q|ut]=0;V(q),rt=0,R[q|0]=0}for(ut=rt+1|0;(ut|0)<59;ut=ut+1|0)R[q|ut]=0;return R[q|56]=c>>>21&255,R[q|57]=c>>>13&255,R[q|58]=c>>>5&255,R[q|59]=c<<3&255|u>>>29,R[q|60]=u>>>21&255,R[q|61]=u>>>13&255,R[q|62]=u>>>5&255,R[q|63]=u<<3&255,V(q),~ct&&X(ct),lt|0}function p(){i=h,n=f,a=m,s=b,o=K,u=64,c=0}function E(){i=I,n=U,a=G,s=Q,o=Y,u=64,c=0}function D(q,rt,ct,lt,ut,dt,wt,mt,B,Z,x,l,z,et,tt,it){q=q|0,rt=rt|0,ct=ct|0,lt=lt|0,ut=ut|0,dt=dt|0,wt=wt|0,mt=mt|0,B=B|0,Z=Z|0,x=x|0,l=l|0,z=z|0,et=et|0,tt=tt|0,it=it|0,d(),J(q^1549556828,rt^1549556828,ct^1549556828,lt^1549556828,ut^1549556828,dt^1549556828,wt^1549556828,mt^1549556828,B^1549556828,Z^1549556828,x^1549556828,l^1549556828,z^1549556828,et^1549556828,tt^1549556828,it^1549556828),I=i,U=n,G=a,Q=s,Y=o,d(),J(q^909522486,rt^909522486,ct^909522486,lt^909522486,ut^909522486,dt^909522486,wt^909522486,mt^909522486,B^909522486,Z^909522486,x^909522486,l^909522486,z^909522486,et^909522486,tt^909522486,it^909522486),h=i,f=n,m=a,b=s,K=o,u=64,c=0}function nt(q,rt,ct){q=q|0,rt=rt|0,ct=ct|0;var lt=0,ut=0,dt=0,wt=0,mt=0,B=0;return q&63||~ct&&ct&31?-1:(B=g(q,rt,-1)|0,lt=i,ut=n,dt=a,wt=s,mt=o,E(),J(lt,ut,dt,wt,mt,2147483648,0,0,0,0,0,0,0,0,0,672),~ct&&X(ct),B|0)}function st(q,rt,ct,lt,ut){q=q|0,rt=rt|0,ct=ct|0,lt=lt|0,ut=ut|0;var dt=0,wt=0,mt=0,B=0,Z=0,x=0,l=0,z=0,et=0,tt=0;if(q&63||~ut&&ut&31)return-1;for(R[q+rt|0]=ct>>>24,R[q+rt+1|0]=ct>>>16&255,R[q+rt+2|0]=ct>>>8&255,R[q+rt+3|0]=ct&255,nt(q,rt+4|0,-1)|0,dt=x=i,wt=l=n,mt=z=a,B=et=s,Z=tt=o,lt=lt-1|0;(lt|0)>0;)p(),J(x,l,z,et,tt,2147483648,0,0,0,0,0,0,0,0,0,672),x=i,l=n,z=a,et=s,tt=o,E(),J(x,l,z,et,tt,2147483648,0,0,0,0,0,0,0,0,0,672),x=i,l=n,z=a,et=s,tt=o,dt=dt^i,wt=wt^n,mt=mt^a,B=B^s,Z=Z^o,lt=lt-1|0;return i=dt,n=wt,a=mt,s=B,o=Z,~ut&&X(ut),0}return{reset:d,init:y,process:_,finish:g,hmac_reset:p,hmac_init:D,hmac_finish:nt,pbkdf2_generate_block:st}};class ju{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(this.result!==null)throw new q0("state must be reset before processing new data");const{asm:r,heap:i}=this.acquire_asm();let n=this.pos,a=this.len,s=0,o=e.length,u=0;for(;o>0;)u=rn(i,n+a,e,s,o),a+=u,s+=u,o-=u,u=r.process(n,a),n+=u,a-=u,a||(n=0);return this.pos=n,this.len=a,this}finish(){if(this.result!==null)throw new q0("state must be reset before processing new data");const{asm:e,heap:r}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(r.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const vc=[],_c=[];class nn extends ju{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=vc.pop()||w1(),this.asm=_c.pop()||Nu({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(vc.push(this.heap),_c.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new nn().process(e).finish().result}}nn.NAME="sha1",nn.heap_pool=[],nn.asm_pool=[],nn.asm_function=Nu;const kc=[],Ac=[];class Ro extends ju{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=kc.pop()||w1(),this.asm=Ac.pop()||function(e,r,i){var n=0,a=0,s=0,o=0,u=0,c=0,h=0,f=0,m=0,b=0,K=0,I=0,U=0,G=0,Q=0,Y=0,R=0,J=0,V=0,X=0,d=0,y=0,_=0,g=0,p=0,E=0,D=new e.Uint8Array(i);function nt(x,l,z,et,tt,it,k,w,A,C,$,T,W,yt,ft,gt){x=x|0,l=l|0,z=z|0,et=et|0,tt=tt|0,it=it|0,k=k|0,w=w|0,A=A|0,C=C|0,$=$|0,T=T|0,W=W|0,yt=yt|0,ft=ft|0,gt=gt|0;var O=0,F=0,j=0,L=0,N=0,H=0,P=0,S=0;O=n,F=a,j=s,L=o,N=u,H=c,P=h,S=f,S=x+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+1116352408|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,P=l+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+1899447441|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,H=z+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+3049323471|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,N=et+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+3921009573|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,L=tt+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+961987163|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,j=it+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+1508970993|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,F=k+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+2453635748|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,O=w+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+2870763221|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,S=A+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+3624381080|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,P=C+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+310598401|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,H=$+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+607225278|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,N=T+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+1426881987|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,L=W+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+1925078388|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,j=yt+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+2162078206|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,F=ft+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+2614888103|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,O=gt+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+3248222580|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,x=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(ft>>>17^ft>>>19^ft>>>10^ft<<15^ft<<13)+x+C|0,S=x+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+3835390401|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,l=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(gt>>>17^gt>>>19^gt>>>10^gt<<15^gt<<13)+l+$|0,P=l+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+4022224774|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,z=(et>>>7^et>>>18^et>>>3^et<<25^et<<14)+(x>>>17^x>>>19^x>>>10^x<<15^x<<13)+z+T|0,H=z+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+264347078|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,et=(tt>>>7^tt>>>18^tt>>>3^tt<<25^tt<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+et+W|0,N=et+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+604807628|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,tt=(it>>>7^it>>>18^it>>>3^it<<25^it<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+tt+yt|0,L=tt+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+770255983|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,it=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(et>>>17^et>>>19^et>>>10^et<<15^et<<13)+it+ft|0,j=it+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+1249150122|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,k=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(tt>>>17^tt>>>19^tt>>>10^tt<<15^tt<<13)+k+gt|0,F=k+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+1555081692|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(it>>>17^it>>>19^it>>>10^it<<15^it<<13)+w+x|0,O=w+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+1996064986|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,A=(C>>>7^C>>>18^C>>>3^C<<25^C<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+A+l|0,S=A+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+2554220882|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,C=($>>>7^$>>>18^$>>>3^$<<25^$<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+C+z|0,P=C+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+2821834349|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,$=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+$+et|0,H=$+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+2952996808|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,T=(W>>>7^W>>>18^W>>>3^W<<25^W<<14)+(C>>>17^C>>>19^C>>>10^C<<15^C<<13)+T+tt|0,N=T+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+3210313671|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,W=(yt>>>7^yt>>>18^yt>>>3^yt<<25^yt<<14)+($>>>17^$>>>19^$>>>10^$<<15^$<<13)+W+it|0,L=W+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+3336571891|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,yt=(ft>>>7^ft>>>18^ft>>>3^ft<<25^ft<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+yt+k|0,j=yt+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+3584528711|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,ft=(gt>>>7^gt>>>18^gt>>>3^gt<<25^gt<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+ft+w|0,F=ft+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+113926993|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,gt=(x>>>7^x>>>18^x>>>3^x<<25^x<<14)+(yt>>>17^yt>>>19^yt>>>10^yt<<15^yt<<13)+gt+A|0,O=gt+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+338241895|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,x=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(ft>>>17^ft>>>19^ft>>>10^ft<<15^ft<<13)+x+C|0,S=x+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+666307205|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,l=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(gt>>>17^gt>>>19^gt>>>10^gt<<15^gt<<13)+l+$|0,P=l+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+773529912|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,z=(et>>>7^et>>>18^et>>>3^et<<25^et<<14)+(x>>>17^x>>>19^x>>>10^x<<15^x<<13)+z+T|0,H=z+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+1294757372|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,et=(tt>>>7^tt>>>18^tt>>>3^tt<<25^tt<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+et+W|0,N=et+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+1396182291|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,tt=(it>>>7^it>>>18^it>>>3^it<<25^it<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+tt+yt|0,L=tt+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+1695183700|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,it=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(et>>>17^et>>>19^et>>>10^et<<15^et<<13)+it+ft|0,j=it+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+1986661051|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,k=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(tt>>>17^tt>>>19^tt>>>10^tt<<15^tt<<13)+k+gt|0,F=k+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+2177026350|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(it>>>17^it>>>19^it>>>10^it<<15^it<<13)+w+x|0,O=w+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+2456956037|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,A=(C>>>7^C>>>18^C>>>3^C<<25^C<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+A+l|0,S=A+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+2730485921|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,C=($>>>7^$>>>18^$>>>3^$<<25^$<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+C+z|0,P=C+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+2820302411|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,$=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+$+et|0,H=$+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+3259730800|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,T=(W>>>7^W>>>18^W>>>3^W<<25^W<<14)+(C>>>17^C>>>19^C>>>10^C<<15^C<<13)+T+tt|0,N=T+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+3345764771|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,W=(yt>>>7^yt>>>18^yt>>>3^yt<<25^yt<<14)+($>>>17^$>>>19^$>>>10^$<<15^$<<13)+W+it|0,L=W+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+3516065817|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,yt=(ft>>>7^ft>>>18^ft>>>3^ft<<25^ft<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+yt+k|0,j=yt+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+3600352804|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,ft=(gt>>>7^gt>>>18^gt>>>3^gt<<25^gt<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+ft+w|0,F=ft+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+4094571909|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,gt=(x>>>7^x>>>18^x>>>3^x<<25^x<<14)+(yt>>>17^yt>>>19^yt>>>10^yt<<15^yt<<13)+gt+A|0,O=gt+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+275423344|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,x=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(ft>>>17^ft>>>19^ft>>>10^ft<<15^ft<<13)+x+C|0,S=x+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+430227734|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,l=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(gt>>>17^gt>>>19^gt>>>10^gt<<15^gt<<13)+l+$|0,P=l+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+506948616|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,z=(et>>>7^et>>>18^et>>>3^et<<25^et<<14)+(x>>>17^x>>>19^x>>>10^x<<15^x<<13)+z+T|0,H=z+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+659060556|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,et=(tt>>>7^tt>>>18^tt>>>3^tt<<25^tt<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+et+W|0,N=et+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+883997877|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,tt=(it>>>7^it>>>18^it>>>3^it<<25^it<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+tt+yt|0,L=tt+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+958139571|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,it=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(et>>>17^et>>>19^et>>>10^et<<15^et<<13)+it+ft|0,j=it+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+1322822218|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,k=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(tt>>>17^tt>>>19^tt>>>10^tt<<15^tt<<13)+k+gt|0,F=k+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+1537002063|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(it>>>17^it>>>19^it>>>10^it<<15^it<<13)+w+x|0,O=w+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+1747873779|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,A=(C>>>7^C>>>18^C>>>3^C<<25^C<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+A+l|0,S=A+S+(N>>>6^N>>>11^N>>>25^N<<26^N<<21^N<<7)+(P^N&(H^P))+1955562222|0,L=L+S|0,S=S+(O&F^j&(O^F))+(O>>>2^O>>>13^O>>>22^O<<30^O<<19^O<<10)|0,C=($>>>7^$>>>18^$>>>3^$<<25^$<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+C+z|0,P=C+P+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(H^L&(N^H))+2024104815|0,j=j+P|0,P=P+(S&O^F&(S^O))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0,$=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+$+et|0,H=$+H+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(N^j&(L^N))+2227730452|0,F=F+H|0,H=H+(P&S^O&(P^S))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0,T=(W>>>7^W>>>18^W>>>3^W<<25^W<<14)+(C>>>17^C>>>19^C>>>10^C<<15^C<<13)+T+tt|0,N=T+N+(F>>>6^F>>>11^F>>>25^F<<26^F<<21^F<<7)+(L^F&(j^L))+2361852424|0,O=O+N|0,N=N+(H&P^S&(H^P))+(H>>>2^H>>>13^H>>>22^H<<30^H<<19^H<<10)|0,W=(yt>>>7^yt>>>18^yt>>>3^yt<<25^yt<<14)+($>>>17^$>>>19^$>>>10^$<<15^$<<13)+W+it|0,L=W+L+(O>>>6^O>>>11^O>>>25^O<<26^O<<21^O<<7)+(j^O&(F^j))+2428436474|0,S=S+L|0,L=L+(N&H^P&(N^H))+(N>>>2^N>>>13^N>>>22^N<<30^N<<19^N<<10)|0,yt=(ft>>>7^ft>>>18^ft>>>3^ft<<25^ft<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+yt+k|0,j=yt+j+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(F^S&(O^F))+2756734187|0,P=P+j|0,j=j+(L&N^H&(L^N))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,ft=(gt>>>7^gt>>>18^gt>>>3^gt<<25^gt<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+ft+w|0,F=ft+F+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(O^P&(S^O))+3204031479|0,H=H+F|0,F=F+(j&L^N&(j^L))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0,gt=(x>>>7^x>>>18^x>>>3^x<<25^x<<14)+(yt>>>17^yt>>>19^yt>>>10^yt<<15^yt<<13)+gt+A|0,O=gt+O+(H>>>6^H>>>11^H>>>25^H<<26^H<<21^H<<7)+(S^H&(P^S))+3329325298|0,N=N+O|0,O=O+(F&j^L&(F^j))+(F>>>2^F>>>13^F>>>22^F<<30^F<<19^F<<10)|0,n=n+O|0,a=a+F|0,s=s+j|0,o=o+L|0,u=u+N|0,c=c+H|0,h=h+P|0,f=f+S|0}function st(x){x=x|0,nt(D[x|0]<<24|D[x|1]<<16|D[x|2]<<8|D[x|3],D[x|4]<<24|D[x|5]<<16|D[x|6]<<8|D[x|7],D[x|8]<<24|D[x|9]<<16|D[x|10]<<8|D[x|11],D[x|12]<<24|D[x|13]<<16|D[x|14]<<8|D[x|15],D[x|16]<<24|D[x|17]<<16|D[x|18]<<8|D[x|19],D[x|20]<<24|D[x|21]<<16|D[x|22]<<8|D[x|23],D[x|24]<<24|D[x|25]<<16|D[x|26]<<8|D[x|27],D[x|28]<<24|D[x|29]<<16|D[x|30]<<8|D[x|31],D[x|32]<<24|D[x|33]<<16|D[x|34]<<8|D[x|35],D[x|36]<<24|D[x|37]<<16|D[x|38]<<8|D[x|39],D[x|40]<<24|D[x|41]<<16|D[x|42]<<8|D[x|43],D[x|44]<<24|D[x|45]<<16|D[x|46]<<8|D[x|47],D[x|48]<<24|D[x|49]<<16|D[x|50]<<8|D[x|51],D[x|52]<<24|D[x|53]<<16|D[x|54]<<8|D[x|55],D[x|56]<<24|D[x|57]<<16|D[x|58]<<8|D[x|59],D[x|60]<<24|D[x|61]<<16|D[x|62]<<8|D[x|63])}function q(x){x=x|0,D[x|0]=n>>>24,D[x|1]=n>>>16&255,D[x|2]=n>>>8&255,D[x|3]=n&255,D[x|4]=a>>>24,D[x|5]=a>>>16&255,D[x|6]=a>>>8&255,D[x|7]=a&255,D[x|8]=s>>>24,D[x|9]=s>>>16&255,D[x|10]=s>>>8&255,D[x|11]=s&255,D[x|12]=o>>>24,D[x|13]=o>>>16&255,D[x|14]=o>>>8&255,D[x|15]=o&255,D[x|16]=u>>>24,D[x|17]=u>>>16&255,D[x|18]=u>>>8&255,D[x|19]=u&255,D[x|20]=c>>>24,D[x|21]=c>>>16&255,D[x|22]=c>>>8&255,D[x|23]=c&255,D[x|24]=h>>>24,D[x|25]=h>>>16&255,D[x|26]=h>>>8&255,D[x|27]=h&255,D[x|28]=f>>>24,D[x|29]=f>>>16&255,D[x|30]=f>>>8&255,D[x|31]=f&255}function rt(){n=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,f=1541459225,m=b=0}function ct(x,l,z,et,tt,it,k,w,A,C){x=x|0,l=l|0,z=z|0,et=et|0,tt=tt|0,it=it|0,k=k|0,w=w|0,A=A|0,C=C|0,n=x,a=l,s=z,o=et,u=tt,c=it,h=k,f=w,m=A,b=C}function lt(x,l){x=x|0,l=l|0;var z=0;if(x&63)return-1;for(;(l|0)>=64;)st(x),x=x+64|0,l=l-64|0,z=z+64|0;return m=m+z|0,m>>>0>>0&&(b=b+1|0),z|0}function ut(x,l,z){x=x|0,l=l|0,z=z|0;var et=0,tt=0;if(x&63||~z&&z&31)return-1;if((l|0)>=64){if(et=lt(x,l)|0,(et|0)==-1)return-1;x=x+et|0,l=l-et|0}if(et=et+l|0,m=m+l|0,m>>>0>>0&&(b=b+1|0),D[x|l]=128,(l|0)>=56){for(tt=l+1|0;(tt|0)<64;tt=tt+1|0)D[x|tt]=0;st(x),l=0,D[x|0]=0}for(tt=l+1|0;(tt|0)<59;tt=tt+1|0)D[x|tt]=0;return D[x|56]=b>>>21&255,D[x|57]=b>>>13&255,D[x|58]=b>>>5&255,D[x|59]=b<<3&255|m>>>29,D[x|60]=m>>>21&255,D[x|61]=m>>>13&255,D[x|62]=m>>>5&255,D[x|63]=m<<3&255,st(x),~z&&q(z),et|0}function dt(){n=K,a=I,s=U,o=G,u=Q,c=Y,h=R,f=J,m=64,b=0}function wt(){n=V,a=X,s=d,o=y,u=_,c=g,h=p,f=E,m=64,b=0}function mt(x,l,z,et,tt,it,k,w,A,C,$,T,W,yt,ft,gt){x=x|0,l=l|0,z=z|0,et=et|0,tt=tt|0,it=it|0,k=k|0,w=w|0,A=A|0,C=C|0,$=$|0,T=T|0,W=W|0,yt=yt|0,ft=ft|0,gt=gt|0,rt(),nt(x^1549556828,l^1549556828,z^1549556828,et^1549556828,tt^1549556828,it^1549556828,k^1549556828,w^1549556828,A^1549556828,C^1549556828,$^1549556828,T^1549556828,W^1549556828,yt^1549556828,ft^1549556828,gt^1549556828),V=n,X=a,d=s,y=o,_=u,g=c,p=h,E=f,rt(),nt(x^909522486,l^909522486,z^909522486,et^909522486,tt^909522486,it^909522486,k^909522486,w^909522486,A^909522486,C^909522486,$^909522486,T^909522486,W^909522486,yt^909522486,ft^909522486,gt^909522486),K=n,I=a,U=s,G=o,Q=u,Y=c,R=h,J=f,m=64,b=0}function B(x,l,z){x=x|0,l=l|0,z=z|0;var et=0,tt=0,it=0,k=0,w=0,A=0,C=0,$=0,T=0;return x&63||~z&&z&31?-1:(T=ut(x,l,-1)|0,et=n,tt=a,it=s,k=o,w=u,A=c,C=h,$=f,wt(),nt(et,tt,it,k,w,A,C,$,2147483648,0,0,0,0,0,0,768),~z&&q(z),T|0)}function Z(x,l,z,et,tt){x=x|0,l=l|0,z=z|0,et=et|0,tt=tt|0;var it=0,k=0,w=0,A=0,C=0,$=0,T=0,W=0,yt=0,ft=0,gt=0,O=0,F=0,j=0,L=0,N=0;if(x&63||~tt&&tt&31)return-1;for(D[x+l|0]=z>>>24,D[x+l+1|0]=z>>>16&255,D[x+l+2|0]=z>>>8&255,D[x+l+3|0]=z&255,B(x,l+4|0,-1)|0,it=yt=n,k=ft=a,w=gt=s,A=O=o,C=F=u,$=j=c,T=L=h,W=N=f,et=et-1|0;(et|0)>0;)dt(),nt(yt,ft,gt,O,F,j,L,N,2147483648,0,0,0,0,0,0,768),yt=n,ft=a,gt=s,O=o,F=u,j=c,L=h,N=f,wt(),nt(yt,ft,gt,O,F,j,L,N,2147483648,0,0,0,0,0,0,768),yt=n,ft=a,gt=s,O=o,F=u,j=c,L=h,N=f,it=it^n,k=k^a,w=w^s,A=A^o,C=C^u,$=$^c,T=T^h,W=W^f,et=et-1|0;return n=it,a=k,s=w,o=A,u=C,c=$,h=T,f=W,~tt&&q(tt),0}return{reset:rt,init:ct,process:lt,finish:ut,hmac_reset:dt,hmac_init:mt,hmac_finish:B,pbkdf2_generate_block:Z}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(kc.push(this.heap),Ac.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Ro().process(e).finish().result}}Ro.NAME="sha256";var ji=Wu;function Wu(t,e){if(!t)throw Error(e||"Assertion failed")}Wu.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var wd=Ye!==void 0?Ye:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function jr(t,e){return t(e={exports:{}},e.exports),e.exports}function vd(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ti=jr(function(t){t.exports=typeof Object.create=="function"?function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}),_d=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>8,s=255&n;a?r.push(a,s):r.push(s)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}var Ad=function(t,e){for(var r="",i=0;i>>0}return a},Ed=function(t,e){for(var r=Array(4*t.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},Ft={inherits:Ti,toArray:_d,toHex:kd,htonl:Hu,toHex32:Ad,zero2:Gu,zero8:Vu,join32:Sd,split32:Ed,rotr32:function(t,e){return t>>>e|t<<32-e},rotl32:function(t,e){return t<>>32-e},sum32:function(t,e){return t+e>>>0},sum32_3:function(t,e,r){return t+e+r>>>0},sum32_4:function(t,e,r,i){return t+e+r+i>>>0},sum32_5:function(t,e,r,i,n){return t+e+r+i+n>>>0},sum64:function(t,e,r,i){var n=t[e],a=i+t[e+1]>>>0,s=(a>>0,t[e+1]=a},sum64_hi:function(t,e,r,i){return(e+i>>>0>>0},sum64_lo:function(t,e,r,i){return e+i>>>0},sum64_4_hi:function(t,e,r,i,n,a,s,o){var u=0,c=e;return u+=(c=c+i>>>0)>>0)>>0)>>0},sum64_4_lo:function(t,e,r,i,n,a,s,o){return e+i+a+o>>>0},sum64_5_hi:function(t,e,r,i,n,a,s,o,u,c){var h=0,f=e;return h+=(f=f+i>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(t,e,r,i,n,a,s,o,u,c){return e+i+a+o+c>>>0},rotr64_hi:function(t,e,r){return(e<<32-r|t>>>r)>>>0},rotr64_lo:function(t,e,r){return(t<<32-r|e>>>r)>>>0},shr64_hi:function(t,e,r){return t>>>r},shr64_lo:function(t,e,r){return(t<<32-r|e>>>r)>>>0}};function Is(){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 Pd=Is;Is.prototype.update=function(t,e){if(t=Ft.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=Ft.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a>>3},g1_256:function(t){return vr(t,17)^vr(t,19)^t>>>10}},ir=Ft.sum32,Md=Ft.sum32_4,Cd=Ft.sum32_5,Dd=gn.ch32,Kd=gn.maj32,Rd=gn.s0_256,Id=gn.s1_256,Ud=gn.g0_256,Bd=gn.g1_256,Xu=Xa.BlockHash,Td=[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 Pr(){if(!(this instanceof Pr))return new Pr;Xu.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Td,this.W=Array(64)}Ft.inherits(Pr,Xu);var _1=Pr;function ti(){if(!(this instanceof ti))return new ti;_1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Pr.blockSize=512,Pr.outSize=256,Pr.hmacStrength=192,Pr.padLength=64,Pr.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i>>32-n,r)}function Pe(t,e,r,i,n,a,s){return Io(e&r|~e&i,t,e,n,a,s)}function xe(t,e,r,i,n,a,s){return Io(e&i|r&~i,t,e,n,a,s)}function Me(t,e,r,i,n,a,s){return Io(e^r^i,t,e,n,a,s)}function Ce(t,e,r,i,n,a,s){return Io(r^(e|~i),t,e,n,a,s)}function o5(t){const e=[];let r;for(r=0;r<64;r+=4)e[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return e}const xc="0123456789abcdef".split("");function c5(t){let e="",r=0;for(;r<4;r++)e+=xc[t>>8*r+4&15]+xc[t>>8*r&15];return e}function Ki(t,e){return t+e&4294967295}const Gs=M.getWebCrypto(),Vs=M.getNodeCrypto(),u5=Vs&&Vs.getHashes();function Vi(t){if(Vs&&u5.includes(t))return async function(e){const r=Vs.createHash(t);return oe(e,i=>{r.update(i)},()=>new Uint8Array(r.digest()))}}function hs(t,e){return async function(r,i=vt){if(ce(r)&&(r=await he(r)),!M.isStream(r)&&Gs&&e&&r.length>=i.minBytesForWebCrypto)return new Uint8Array(await Gs.digest(e,r));const n=t();return oe(r,a=>{n.update(a)},()=>new Uint8Array(n.digest()))}}function Mc(t,e){return async function(r,i=vt){if(ce(r)&&(r=await he(r)),M.isStream(r)){const n=new t;return oe(r,a=>{n.process(a)},()=>n.finish().result)}return Gs&&e&&r.length>=i.minBytesForWebCrypto?new Uint8Array(await Gs.digest(e,r)):t.bytes(r)}}const Zi={md5:Vi("md5")||async function(t){const e=function(r){const i=r.length,n=[1732584193,-271733879,-1732584194,271733878];let a;for(a=64;a<=r.length;a+=64)i0(n,o5(r.substring(a-64,a)));r=r.substring(a-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a>2]|=r.charCodeAt(a)<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(i0(n,s),a=0;a<16;a++)s[a]=0;return s[14]=8*i,i0(n,s),n}(M.uint8ArrayToString(t));return M.hexToUint8Array(function(r){for(let i=0;inew Uint8Array(U.update(G)))}(t,e,r,i);if(a.substr(0,3)==="aes")return function(f,m,b,K,I){if(M.getWebCrypto()&&m.length!==24&&!M.isStream(b)&&b.length>=3e3*I.minBytesForWebCrypto)return async function(G,Q,Y,R){const J="AES-CBC",V=await Cc.importKey("raw",Q,{name:J},!1,["encrypt"]),{blockSize:X}=zi(G),d=M.concatUint8Array([new Uint8Array(X),Y]),y=new Uint8Array(await Cc.encrypt({name:J,iv:R},V,d)).subarray(0,Y.length);return function(_,g){for(let p=0;p<_.length;p++)_[p]=_[p]^g[p]}(y,Y),y}(f,m,b,K);const U=new Tn(m,K);return oe(b,G=>U.aes.AES_Encrypt_process(G),()=>U.aes.AES_Encrypt_finish())}(t,e,r,i,n);const s=new(zi(t))(e),o=s.blockSize,u=i.slice();let c=new Uint8Array;const h=f=>{f&&(c=M.concatUint8Array([c,f]));const m=new Uint8Array(c.length);let b,K=0;for(;f?c.length>=o:c.length;){const I=s.encrypt(u);for(b=0;bnew Uint8Array(I.update(U)))}(t,e,r,i);if(n.substr(0,3)==="aes")return function(h,f,m,b){if(M.isStream(m)){const K=new Tn(f,b);return oe(m,I=>K.aes.AES_Decrypt_process(I),()=>K.aes.AES_Decrypt_finish())}return Tn.decrypt(m,f,b)}(0,e,r,i);const a=new(zi(t))(e),s=a.blockSize;let o=i,u=new Uint8Array;const c=h=>{h&&(u=M.concatUint8Array([u,h]));const f=new Uint8Array(u.length);let m,b=0;for(;h?u.length>=s:u.length;){const K=a.encrypt(o);for(o=u,m=0;m48)throw new ii("illegal counter size");let a=Math.pow(2,i)-1;n.set_mask(0,0,a/4294967296|0,0|a)}else i=48,n.set_mask(0,0,65535,4294967295);if(e===void 0)throw Error("nonce is required");{let a=e.length;if(!a||a>16)throw new ii("illegal nonce size");let s=new DataView(new ArrayBuffer(16));new Uint8Array(s.buffer).set(e),n.set_nonce(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}if(r!==void 0){if(r<0||r>=Math.pow(2,i))throw new ii("illegal counter value");n.set_counter(0,0,r/4294967296|0,0|r)}}}class Qs{static encrypt(e,r,i=!0,n){return new Qs(r,n,i).encrypt(e)}static decrypt(e,r,i=!0,n){return new Qs(r,n,i).decrypt(e)}constructor(e,r,i=!0,n){this.aes=n||new Ya(e,r,i,"CBC")}encrypt(e){return $i(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return $i(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const Dc=M.getWebCrypto(),d5=M.getNodeCrypto(),Qr=16;function Kc(t,e){const r=t.length-Qr;for(let i=0;i>3),17+(b>>3)),8-(7&b)).subarray(1),G=new Uint8Array(Te),Q=new Uint8Array(u.length+ki);let Y,R=0;for(Y=0;Y16)throw new ii("illegal tagSize value");const u=r.length||0,c=new Uint8Array(16);u!==12?(this._gcm_mac_process(r),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]=u>>>29,o[12]=u>>>21&255,o[13]=u>>>13&255,o[14]=u>>>5&255,o[15]=u<<3&255,s.mac($t.MAC.GCM,$t.HEAP_DATA,16),s.get_iv($t.HEAP_DATA),s.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(r),c[15]=1);const h=new DataView(c.buffer);if(this.gamma0=h.getUint32(12),s.set_nonce(h.getUint32(0),h.getUint32(4),h.getUint32(8),0),s.set_mask(0,0,0,4294967295),i!==void 0){if(i.length>a0)throw new ii("illegal adata length");i.length?(this.adata=i,this._gcm_mac_process(i)):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");s.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,r,i,n,a){return new an(r,i,n,a).encrypt(e)}static decrypt(e,r,i,n,a){return new an(r,i,n,a).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let r=0,i=e.length||0,{asm:n,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.aes.pos,u=this.aes.len,c=0,h=u+i&-16,f=0;if((s-1<<4)+u+i>a0)throw new RangeError("counter overflow");const m=new Uint8Array(h);for(;i>0;)f=rn(a,o+u,e,r,i),u+=f,r+=f,i-=f,f=n.cipher($t.ENC.CTR,$t.HEAP_DATA+o,u),f=n.mac($t.MAC.GCM,$t.HEAP_DATA+o,f),f&&m.set(a.subarray(o,o+f),c),s+=f>>>4,c+=f,f>>29,r[4]=h>>>21,r[5]=h>>>13&255,r[6]=h>>>5&255,r[7]=h<<3&255,r[8]=r[9]=r[10]=0,r[11]=f>>>29,r[12]=f>>>21&255,r[13]=f>>>13&255,r[14]=f>>>5&255,r[15]=f<<3&255,e.mac($t.MAC.GCM,$t.HEAP_DATA,16),e.get_iv($t.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher($t.ENC.CTR,$t.HEAP_DATA,16),u.set(r.subarray(0,n),o),this.counter=1,this.aes.pos=0,this.aes.len=0,u}AES_GCM_Decrypt_process(e){let r=0,i=e.length||0,{asm:n,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.tagSize,u=this.aes.pos,c=this.aes.len,h=0,f=c+i>o?c+i-o&-16:0,m=c+i-f,b=0;if((s-1<<4)+c+i>a0)throw new RangeError("counter overflow");const K=new Uint8Array(f);for(;i>m;)b=rn(a,u+c,e,r,i-m),c+=b,r+=b,i-=b,b=n.mac($t.MAC.GCM,$t.HEAP_DATA+u,b),b=n.cipher($t.DEC.CTR,$t.HEAP_DATA+u,b),b&&K.set(a.subarray(u,u+b),h),s+=b>>>4,h+=b,u=0,c=0;return i>0&&(c+=rn(a,0,e,r,i)),this.counter=s,this.aes.pos=u,this.aes.len=c,K}AES_GCM_Decrypt_finish(){let{asm:e,heap:r}=this.aes.acquire_asm(),i=this.tagSize,n=this.adata,a=this.counter,s=this.aes.pos,o=this.aes.len,u=o-i;if(o>>29,r[4]=m>>>21,r[5]=m>>>13&255,r[6]=m>>>5&255,r[7]=m<<3&255,r[8]=r[9]=r[10]=0,r[11]=b>>>29,r[12]=b>>>21&255,r[13]=b>>>13&255,r[14]=b>>>5&255,r[15]=b<<3&255,e.mac($t.MAC.GCM,$t.HEAP_DATA,16),e.get_iv($t.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher($t.ENC.CTR,$t.HEAP_DATA,16);let K=0;for(let I=0;I0;){for(s=rn(i,0,e,n,a),n+=s,a-=s;15&s;)i[s++]=0;r.mac($t.MAC.GCM,$t.HEAP_DATA,s)}}}const s0=M.getWebCrypto(),Bc=M.getNodeCrypto(),Tc=M.getNodeBuffer(),Pn=16,o0="AES-GCM";async function Cn(t,e){if(t!==v.symmetric.aes128&&t!==v.symmetric.aes192&&t!==v.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(M.getWebCrypto()&&e.length!==24){const r=await s0.importKey("raw",e,{name:o0},!1,["encrypt","decrypt"]);return{encrypt:async function(i,n,a=new Uint8Array){if(!i.length)return an.encrypt(i,e,n,a);const s=await s0.encrypt({name:o0,iv:n,additionalData:a,tagLength:8*Pn},r,i);return new Uint8Array(s)},decrypt:async function(i,n,a=new Uint8Array){if(i.length===Pn)return an.decrypt(i,e,n,a);const s=await s0.decrypt({name:o0,iv:n,additionalData:a,tagLength:8*Pn},r,i);return new Uint8Array(s)}}}return M.getNodeCrypto()?{encrypt:async function(r,i,n=new Uint8Array){const a=new Bc.createCipheriv("aes-"+8*e.length+"-gcm",e,i);a.setAAD(n);const s=Tc.concat([a.update(r),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(r,i,n=new Uint8Array){const a=new Bc.createDecipheriv("aes-"+8*e.length+"-gcm",e,i);a.setAAD(n),a.setAuthTag(r.slice(r.length-Pn,r.length));const s=Tc.concat([a.update(r.slice(0,r.length-Pn)),a.final()]);return new Uint8Array(s)}}:{encrypt:async function(r,i,n){return an.encrypt(r,e,i,n)},decrypt:async function(r,i,n){return an.decrypt(r,e,i,n)}}}Cn.getNonce=function(t,e){const r=t.slice();for(let i=0;i>>8)-1}(B,Z,x,l,32)}function K(B,Z){var x;for(x=0;x<16;x++)B[x]=0|Z[x]}function I(B){var Z,x,l=1;for(Z=0;Z<16;Z++)x=B[Z]+l+65535,l=Math.floor(x/65536),B[Z]=x-65536*l;B[0]+=l-1+37*(l-1)}function U(B,Z,x){for(var l,z=~(x-1),et=0;et<16;et++)l=z&(B[et]^Z[et]),B[et]^=l,Z[et]^=l}function G(B,Z){var x,l,z,et=r(),tt=r();for(x=0;x<16;x++)tt[x]=Z[x];for(I(tt),I(tt),I(tt),l=0;l<2;l++){for(et[0]=tt[0]-65517,x=1;x<15;x++)et[x]=tt[x]-65535-(et[x-1]>>16&1),et[x-1]&=65535;et[15]=tt[15]-32767-(et[14]>>16&1),z=et[15]>>16&1,et[14]&=65535,U(tt,et,1-z)}for(x=0;x<16;x++)B[2*x]=255&tt[x],B[2*x+1]=tt[x]>>8}function Q(B,Z){var x=new Uint8Array(32),l=new Uint8Array(32);return G(x,B),G(l,Z),b(x,0,l,0)}function Y(B){var Z=new Uint8Array(32);return G(Z,B),1&Z[0]}function R(B,Z){var x;for(x=0;x<16;x++)B[x]=Z[2*x]+(Z[2*x+1]<<8);B[15]&=32767}function J(B,Z,x){for(var l=0;l<16;l++)B[l]=Z[l]+x[l]}function V(B,Z,x){for(var l=0;l<16;l++)B[l]=Z[l]-x[l]}function X(B,Z,x){var l,z,et=0,tt=0,it=0,k=0,w=0,A=0,C=0,$=0,T=0,W=0,yt=0,ft=0,gt=0,O=0,F=0,j=0,L=0,N=0,H=0,P=0,S=0,bt=0,ht=0,Pt=0,Lt=0,Dt=0,Ct=0,Xt=0,zt=0,Ot=0,ue=0,Mt=x[0],Rt=x[1],Nt=x[2],Et=x[3],Bt=x[4],Zt=x[5],It=x[6],at=x[7],ot=x[8],pt=x[9],_t=x[10],Kt=x[11],xt=x[12],St=x[13],Ht=x[14],Tt=x[15];et+=(l=Z[0])*Mt,tt+=l*Rt,it+=l*Nt,k+=l*Et,w+=l*Bt,A+=l*Zt,C+=l*It,$+=l*at,T+=l*ot,W+=l*pt,yt+=l*_t,ft+=l*Kt,gt+=l*xt,O+=l*St,F+=l*Ht,j+=l*Tt,tt+=(l=Z[1])*Mt,it+=l*Rt,k+=l*Nt,w+=l*Et,A+=l*Bt,C+=l*Zt,$+=l*It,T+=l*at,W+=l*ot,yt+=l*pt,ft+=l*_t,gt+=l*Kt,O+=l*xt,F+=l*St,j+=l*Ht,L+=l*Tt,it+=(l=Z[2])*Mt,k+=l*Rt,w+=l*Nt,A+=l*Et,C+=l*Bt,$+=l*Zt,T+=l*It,W+=l*at,yt+=l*ot,ft+=l*pt,gt+=l*_t,O+=l*Kt,F+=l*xt,j+=l*St,L+=l*Ht,N+=l*Tt,k+=(l=Z[3])*Mt,w+=l*Rt,A+=l*Nt,C+=l*Et,$+=l*Bt,T+=l*Zt,W+=l*It,yt+=l*at,ft+=l*ot,gt+=l*pt,O+=l*_t,F+=l*Kt,j+=l*xt,L+=l*St,N+=l*Ht,H+=l*Tt,w+=(l=Z[4])*Mt,A+=l*Rt,C+=l*Nt,$+=l*Et,T+=l*Bt,W+=l*Zt,yt+=l*It,ft+=l*at,gt+=l*ot,O+=l*pt,F+=l*_t,j+=l*Kt,L+=l*xt,N+=l*St,H+=l*Ht,P+=l*Tt,A+=(l=Z[5])*Mt,C+=l*Rt,$+=l*Nt,T+=l*Et,W+=l*Bt,yt+=l*Zt,ft+=l*It,gt+=l*at,O+=l*ot,F+=l*pt,j+=l*_t,L+=l*Kt,N+=l*xt,H+=l*St,P+=l*Ht,S+=l*Tt,C+=(l=Z[6])*Mt,$+=l*Rt,T+=l*Nt,W+=l*Et,yt+=l*Bt,ft+=l*Zt,gt+=l*It,O+=l*at,F+=l*ot,j+=l*pt,L+=l*_t,N+=l*Kt,H+=l*xt,P+=l*St,S+=l*Ht,bt+=l*Tt,$+=(l=Z[7])*Mt,T+=l*Rt,W+=l*Nt,yt+=l*Et,ft+=l*Bt,gt+=l*Zt,O+=l*It,F+=l*at,j+=l*ot,L+=l*pt,N+=l*_t,H+=l*Kt,P+=l*xt,S+=l*St,bt+=l*Ht,ht+=l*Tt,T+=(l=Z[8])*Mt,W+=l*Rt,yt+=l*Nt,ft+=l*Et,gt+=l*Bt,O+=l*Zt,F+=l*It,j+=l*at,L+=l*ot,N+=l*pt,H+=l*_t,P+=l*Kt,S+=l*xt,bt+=l*St,ht+=l*Ht,Pt+=l*Tt,W+=(l=Z[9])*Mt,yt+=l*Rt,ft+=l*Nt,gt+=l*Et,O+=l*Bt,F+=l*Zt,j+=l*It,L+=l*at,N+=l*ot,H+=l*pt,P+=l*_t,S+=l*Kt,bt+=l*xt,ht+=l*St,Pt+=l*Ht,Lt+=l*Tt,yt+=(l=Z[10])*Mt,ft+=l*Rt,gt+=l*Nt,O+=l*Et,F+=l*Bt,j+=l*Zt,L+=l*It,N+=l*at,H+=l*ot,P+=l*pt,S+=l*_t,bt+=l*Kt,ht+=l*xt,Pt+=l*St,Lt+=l*Ht,Dt+=l*Tt,ft+=(l=Z[11])*Mt,gt+=l*Rt,O+=l*Nt,F+=l*Et,j+=l*Bt,L+=l*Zt,N+=l*It,H+=l*at,P+=l*ot,S+=l*pt,bt+=l*_t,ht+=l*Kt,Pt+=l*xt,Lt+=l*St,Dt+=l*Ht,Ct+=l*Tt,gt+=(l=Z[12])*Mt,O+=l*Rt,F+=l*Nt,j+=l*Et,L+=l*Bt,N+=l*Zt,H+=l*It,P+=l*at,S+=l*ot,bt+=l*pt,ht+=l*_t,Pt+=l*Kt,Lt+=l*xt,Dt+=l*St,Ct+=l*Ht,Xt+=l*Tt,O+=(l=Z[13])*Mt,F+=l*Rt,j+=l*Nt,L+=l*Et,N+=l*Bt,H+=l*Zt,P+=l*It,S+=l*at,bt+=l*ot,ht+=l*pt,Pt+=l*_t,Lt+=l*Kt,Dt+=l*xt,Ct+=l*St,Xt+=l*Ht,zt+=l*Tt,F+=(l=Z[14])*Mt,j+=l*Rt,L+=l*Nt,N+=l*Et,H+=l*Bt,P+=l*Zt,S+=l*It,bt+=l*at,ht+=l*ot,Pt+=l*pt,Lt+=l*_t,Dt+=l*Kt,Ct+=l*xt,Xt+=l*St,zt+=l*Ht,Ot+=l*Tt,j+=(l=Z[15])*Mt,tt+=38*(N+=l*Nt),it+=38*(H+=l*Et),k+=38*(P+=l*Bt),w+=38*(S+=l*Zt),A+=38*(bt+=l*It),C+=38*(ht+=l*at),$+=38*(Pt+=l*ot),T+=38*(Lt+=l*pt),W+=38*(Dt+=l*_t),yt+=38*(Ct+=l*Kt),ft+=38*(Xt+=l*xt),gt+=38*(zt+=l*St),O+=38*(Ot+=l*Ht),F+=38*(ue+=l*Tt),et=(l=(et+=38*(L+=l*Rt))+(z=1)+65535)-65536*(z=Math.floor(l/65536)),tt=(l=tt+z+65535)-65536*(z=Math.floor(l/65536)),it=(l=it+z+65535)-65536*(z=Math.floor(l/65536)),k=(l=k+z+65535)-65536*(z=Math.floor(l/65536)),w=(l=w+z+65535)-65536*(z=Math.floor(l/65536)),A=(l=A+z+65535)-65536*(z=Math.floor(l/65536)),C=(l=C+z+65535)-65536*(z=Math.floor(l/65536)),$=(l=$+z+65535)-65536*(z=Math.floor(l/65536)),T=(l=T+z+65535)-65536*(z=Math.floor(l/65536)),W=(l=W+z+65535)-65536*(z=Math.floor(l/65536)),yt=(l=yt+z+65535)-65536*(z=Math.floor(l/65536)),ft=(l=ft+z+65535)-65536*(z=Math.floor(l/65536)),gt=(l=gt+z+65535)-65536*(z=Math.floor(l/65536)),O=(l=O+z+65535)-65536*(z=Math.floor(l/65536)),F=(l=F+z+65535)-65536*(z=Math.floor(l/65536)),j=(l=j+z+65535)-65536*(z=Math.floor(l/65536)),et=(l=(et+=z-1+37*(z-1))+(z=1)+65535)-65536*(z=Math.floor(l/65536)),tt=(l=tt+z+65535)-65536*(z=Math.floor(l/65536)),it=(l=it+z+65535)-65536*(z=Math.floor(l/65536)),k=(l=k+z+65535)-65536*(z=Math.floor(l/65536)),w=(l=w+z+65535)-65536*(z=Math.floor(l/65536)),A=(l=A+z+65535)-65536*(z=Math.floor(l/65536)),C=(l=C+z+65535)-65536*(z=Math.floor(l/65536)),$=(l=$+z+65535)-65536*(z=Math.floor(l/65536)),T=(l=T+z+65535)-65536*(z=Math.floor(l/65536)),W=(l=W+z+65535)-65536*(z=Math.floor(l/65536)),yt=(l=yt+z+65535)-65536*(z=Math.floor(l/65536)),ft=(l=ft+z+65535)-65536*(z=Math.floor(l/65536)),gt=(l=gt+z+65535)-65536*(z=Math.floor(l/65536)),O=(l=O+z+65535)-65536*(z=Math.floor(l/65536)),F=(l=F+z+65535)-65536*(z=Math.floor(l/65536)),j=(l=j+z+65535)-65536*(z=Math.floor(l/65536)),et+=z-1+37*(z-1),B[0]=et,B[1]=tt,B[2]=it,B[3]=k,B[4]=w,B[5]=A,B[6]=C,B[7]=$,B[8]=T,B[9]=W,B[10]=yt,B[11]=ft,B[12]=gt,B[13]=O,B[14]=F,B[15]=j}function d(B,Z){X(B,Z,Z)}function y(B,Z){var x,l=r();for(x=0;x<16;x++)l[x]=Z[x];for(x=253;x>=0;x--)d(l,l),x!==2&&x!==4&&X(l,l,Z);for(x=0;x<16;x++)B[x]=l[x]}function _(B,Z,x){var l,z,et=new Uint8Array(32),tt=new Float64Array(80),it=r(),k=r(),w=r(),A=r(),C=r(),$=r();for(z=0;z<31;z++)et[z]=Z[z];for(et[31]=127&Z[31]|64,et[0]&=248,R(tt,x),z=0;z<16;z++)k[z]=tt[z],A[z]=it[z]=w[z]=0;for(it[0]=A[0]=1,z=254;z>=0;--z)U(it,k,l=et[z>>>3]>>>(7&z)&1),U(w,A,l),J(C,it,w),V(it,it,w),J(w,k,A),V(k,k,A),d(A,C),d($,it),X(it,w,it),X(w,k,C),J(C,it,w),V(it,it,w),d(k,it),V(w,A,$),X(it,w,o),J(it,it,A),X(w,w,it),X(it,A,$),X(A,k,tt),d(k,C),U(it,k,l),U(w,A,l);for(z=0;z<16;z++)tt[z+16]=it[z],tt[z+32]=w[z],tt[z+48]=k[z],tt[z+64]=A[z];var T=tt.subarray(32),W=tt.subarray(16);return y(T,T),X(W,W,T),G(B,W),0}function g(B,Z){return _(B,Z,n)}function p(B,Z){var x=r(),l=r(),z=r(),et=r(),tt=r(),it=r(),k=r(),w=r(),A=r();V(x,B[1],B[0]),V(A,Z[1],Z[0]),X(x,x,A),J(l,B[0],B[1]),J(A,Z[0],Z[1]),X(l,l,A),X(z,B[3],Z[3]),X(z,z,c),X(et,B[2],Z[2]),J(et,et,et),V(tt,l,x),V(it,et,z),J(k,et,z),J(w,l,x),X(B[0],tt,it),X(B[1],w,k),X(B[2],k,it),X(B[3],tt,w)}function E(B,Z,x){var l;for(l=0;l<4;l++)U(B[l],Z[l],x)}function D(B,Z){var x=r(),l=r(),z=r();y(z,Z[2]),X(x,Z[0],z),X(l,Z[1],z),G(B,l),B[31]^=Y(x)<<7}function nt(B,Z,x){var l,z;for(K(B[0],a),K(B[1],s),K(B[2],s),K(B[3],a),z=255;z>=0;--z)E(B,Z,l=x[z/8|0]>>(7&z)&1),p(Z,B),p(B,B),E(B,Z,l)}function st(B,Z){var x=[r(),r(),r(),r()];K(x[0],h),K(x[1],f),K(x[2],s),X(x[3],h,f),nt(B,x,Z)}function q(B,Z,x){var l,z,et=[r(),r(),r(),r()];for(x||i(Z,32),(l=e.hash(Z.subarray(0,32)))[0]&=248,l[31]&=127,l[31]|=64,st(et,l),D(B,et),z=0;z<32;z++)Z[z+32]=B[z];return 0}var rt=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 ct(B,Z){var x,l,z,et;for(l=63;l>=32;--l){for(x=0,z=l-32,et=l-12;z>4)*rt[z],x=Z[z]>>8,Z[z]&=255;for(z=0;z<32;z++)Z[z]-=x*rt[z];for(l=0;l<32;l++)Z[l+1]+=Z[l]>>8,B[l]=255&Z[l]}function lt(B){var Z,x=new Float64Array(64);for(Z=0;Z<64;Z++)x[Z]=B[Z];for(Z=0;Z<64;Z++)B[Z]=0;ct(B,x)}function ut(B,Z){var x=r(),l=r(),z=r(),et=r(),tt=r(),it=r(),k=r();return K(B[2],s),R(B[1],Z),d(z,B[1]),X(et,z,u),V(z,z,B[2]),J(et,B[2],et),d(tt,et),d(it,tt),X(k,it,tt),X(x,k,z),X(x,x,et),function(w,A){var C,$=r();for(C=0;C<16;C++)$[C]=A[C];for(C=250;C>=0;C--)d($,$),C!==1&&X($,$,A);for(C=0;C<16;C++)w[C]=$[C]}(x,x),X(x,x,z),X(x,x,et),X(x,x,et),X(B[0],x,et),d(l,B[0]),X(l,l,et),Q(l,z)&&X(B[0],B[0],m),d(l,B[0]),X(l,l,et),Q(l,z)?-1:(Y(B[0])===Z[31]>>7&&V(B[0],a,B[0]),X(B[3],B[0],B[1]),0)}var dt=64;function wt(){for(var B=0;B=0},e.sign.keyPair=function(){var B=new Uint8Array(32),Z=new Uint8Array(64);return q(B,Z),{publicKey:B,secretKey:Z}},e.sign.keyPair.fromSecretKey=function(B){if(wt(B),B.length!==64)throw Error("bad secret key size");for(var Z=new Uint8Array(32),x=0;xt&&(u.imod(a.leftShift(n)).iadd(a),c=u.mod(s).toNumber());while(!await c3(u,e,r));return u}async function c3(t,e,r){return!(e&&!t.dec().gcd(e).isOne())&&!!await async function(i){const n=await M.getBigInteger();return v5.every(a=>i.mod(new n(a))!==0)}(t)&&!!await async function(i,n){const a=await M.getBigInteger();return n=n||new a(2),n.modExp(i.dec(),i).isOne()}(t)&&!!await async function(i,n,a){const s=await M.getBigInteger(),o=i.bitLength();n||(n=Math.max(1,o/48|0));const u=i.dec();let c=0;for(;!u.getBit(c);)c++;const h=i.rightShift(new s(c));for(;n>0;n--){let f,m=(a?a():await hi(new s(2),u)).modExp(h,i);if(!m.isOne()&&!m.equal(u)){for(f=1;fe-11)throw Error("Message too long");const i=function(a){const s=new Uint8Array(a);let o=0;for(;o=8&!i;if(e)return M.selectUint8Array(s,a,e);if(s)return a;throw Error("Decryption error")}async function L0(t,e,r){let i;if(e.length!==Ln.getHashByteLength(t))throw Error("Invalid hash length");const n=new Uint8Array(Sr[t].length);for(i=0;iPromise.resolve().then(function(){return _a}),void 0),Q=new G(K),Y=new G(I),R=new G(b),J=R.mod(Y.subn(1)),V=R.mod(Q.subn(1)),X=Ke.createSign(v.read(v.hash,c));X.write(h),X.end();const d={version:0,modulus:new G(f),publicExponent:new G(m),privateExponent:new G(b),prime1:new G(I),prime2:new G(K),exponent1:J,exponent2:V,coefficient:new G(U)};if(Ke.createPrivateKey!==void 0){const _=_n.encode(d,"der");return new Uint8Array(X.sign({key:_,format:"der",type:"pkcs1"}))}const y=_n.encode(d,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(X.sign(y))}(t,e,r,i,n,a,s,o)}return async function(c,h,f,m){const b=await M.getBigInteger();h=new b(h);const K=new b(await L0(c,m,h.byteLength()));if(f=new b(f),K.gte(h))throw Error("Message size cannot exceed modulus size");return K.modExp(f,h).toUint8Array("be",h.byteLength())}(t,r,n,u)},verify:async function(t,e,r,i,n,a){if(e&&!M.isStream(e)){if(M.getWebCrypto())try{return await async function(s,o,u,c,h){const f=function(b,K){return{kty:"RSA",n:Ve(b,!0),e:Ve(K,!0),ext:!0}}(c,h),m=await vn.importKey("jwk",f,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return vn.verify("RSASSA-PKCS1-v1_5",m,u,o)}(v.read(v.webHash,t),e,r,i,n)}catch(s){M.printDebugError(s)}else if(M.getNodeCrypto())return async function(s,o,u,c,h){const{default:f}=await ri(()=>Promise.resolve().then(function(){return _a}),void 0),m=Ke.createVerify(v.read(v.hash,s));m.write(o),m.end();const b={modulus:new f(c),publicExponent:new f(h)};let K;Ke.createPrivateKey!==void 0?K={key:ps.encode(b,"der"),format:"der",type:"pkcs1"}:K=ps.encode(b,"pem",{label:"RSA PUBLIC KEY"});try{return await m.verify(K,u)}catch{return!1}}(t,e,r,i,n)}return async function(s,o,u,c,h){const f=await M.getBigInteger();if(u=new f(u),o=new f(o),c=new f(c),o.gte(u))throw Error("Signature size cannot exceed modulus size");const m=o.modExp(c,u).toUint8Array("be",u.byteLength()),b=await L0(s,h,u.byteLength());return M.equalsUint8Array(m,b)}(t,r,i,n,a)},encrypt:async function(t,e,r){return M.getNodeCrypto()?async function(i,n,a){const{default:s}=await ri(()=>Promise.resolve().then(function(){return _a}),void 0),o={modulus:new s(n),publicExponent:new s(a)};let u;return Ke.createPrivateKey!==void 0?u={key:ps.encode(o,"der"),format:"der",type:"pkcs1",padding:Ke.constants.RSA_PKCS1_PADDING}:u={key:ps.encode(o,"pem",{label:"RSA PUBLIC KEY"}),padding:Ke.constants.RSA_PKCS1_PADDING},new Uint8Array(Ke.publicEncrypt(u,i))}(t,e,r):async function(i,n,a){const s=await M.getBigInteger();if(n=new s(n),i=new s(k1(i,n.byteLength())),a=new s(a),i.gte(n))throw Error("Message size cannot exceed modulus size");return i.modExp(a,n).toUint8Array("be",n.byteLength())}(t,e,r)},decrypt:async function(t,e,r,i,n,a,s,o){return M.getNodeCrypto()?async function(u,c,h,f,m,b,K,I){const{default:U}=await ri(()=>Promise.resolve().then(function(){return _a}),void 0),G=new U(m),Q=new U(b),Y=new U(f),R=Y.mod(Q.subn(1)),J=Y.mod(G.subn(1)),V={version:0,modulus:new U(c),publicExponent:new U(h),privateExponent:new U(f),prime1:new U(b),prime2:new U(m),exponent1:R,exponent2:J,coefficient:new U(K)};let X;Ke.createPrivateKey!==void 0?X={key:_n.encode(V,"der"),format:"der",type:"pkcs1",padding:Ke.constants.RSA_PKCS1_PADDING}:X={key:_n.encode(V,"pem",{label:"RSA PRIVATE KEY"}),padding:Ke.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(Ke.privateDecrypt(X,u))}catch{if(I)return I;throw Error("Decryption error")}}(t,e,r,i,n,a,s,o):async function(u,c,h,f,m,b,K,I){const U=await M.getBigInteger();if(u=new U(u),c=new U(c),h=new U(h),f=new U(f),m=new U(m),b=new U(b),K=new U(K),u.gte(c))throw Error("Data too large.");const G=f.mod(b.dec()),Q=f.mod(m.dec()),Y=(await hi(new U(2),c)).mod(c),R=Y.modInv(c).modExp(h,c);u=u.mul(R).mod(c);const J=u.modExp(Q,m),V=u.modExp(G,b);let d=K.mul(V.sub(J)).mod(b).mul(m).add(J);return d=d.mul(Y).mod(c),A1(d.toUint8Array("be",c.byteLength()),I)}(t,e,r,i,n,a,s,o)},generate:async function(t,e){if(e=new(await M.getBigInteger())(e),M.getWebCrypto()){const s={name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:e.toUint8Array(),hash:{name:"SHA-1"}},o=await vn.generateKey(s,!0,["sign","verify"]),u=await vn.exportKey("jwk",o.privateKey);return{n:Jr(u.n),e:e.toUint8Array(),d:Jr(u.d),p:Jr(u.q),q:Jr(u.p),u:Jr(u.qi)}}if(M.getNodeCrypto()&&Ke.generateKeyPair&&_n){const s={modulusLength:t,publicExponent:e.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},o=await new Promise((u,c)=>{Ke.generateKeyPair("rsa",s,(h,f,m)=>{h?c(h):u(_n.decode(m,"der"))})});return{n:o.modulus.toArrayLike(Uint8Array),e:o.publicExponent.toArrayLike(Uint8Array),d:o.privateExponent.toArrayLike(Uint8Array),p:o.prime2.toArrayLike(Uint8Array),q:o.prime1.toArrayLike(Uint8Array),u:o.coefficient.toArrayLike(Uint8Array)}}let r,i,n;do i=await qc(t-(t>>1),e,40),r=await qc(t>>1,e,40),n=r.mul(i);while(n.bitLength()!==t);const a=r.dec().imul(i.dec());return i.lt(r)&&([r,i]=[i,r]),{n:n.toUint8Array(),e:e.toUint8Array(),d:e.modInv(a).toUint8Array(),p:r.toUint8Array(),q:i.toUint8Array(),u:r.modInv(i).toUint8Array()}},validateParams:async function(t,e,r,i,n,a){const s=await M.getBigInteger();if(t=new s(t),i=new s(i),n=new s(n),!i.mul(n).equal(t))return!1;const o=new s(2);if(a=new s(a),!i.mul(a).mod(n).isOne())return!1;e=new s(e),r=new s(r);const u=new s(Math.floor(t.bitLength()/3)),c=await hi(o,o.leftShift(u)),h=c.mul(r).mul(e);return!(!h.mod(i.dec()).equal(c)||!h.mod(n.dec()).equal(c))}}),A5=Object.freeze({__proto__:null,encrypt:async function(t,e,r,i){const n=await M.getBigInteger();e=new n(e),r=new n(r),i=new n(i);const a=new n(k1(t,e.byteLength())),s=await hi(new n(1),e.dec());return{c1:r.modExp(s,e).toUint8Array(),c2:i.modExp(s,e).imul(a).imod(e).toUint8Array()}},decrypt:async function(t,e,r,i,n){const a=await M.getBigInteger();return t=new a(t),e=new a(e),r=new a(r),i=new a(i),A1(t.modExp(i,r).modInv(r).imul(e).imod(r).toUint8Array("be",r.byteLength()),n)},validateParams:async function(t,e,r,i){const n=await M.getBigInteger();t=new n(t),e=new n(e),r=new n(r);const a=new n(1);if(e.lte(a)||e.gte(t))return!1;const s=new n(t.bitLength()),o=new n(1023);if(s.lt(o)||!e.modExp(t.dec(),t).isOne())return!1;let u=e;const c=new n(1),h=new n(2).leftShift(new n(17));for(;c.lt(h);){if(u=u.mul(e).imod(t),u.isOne())return!1;c.iinc()}i=new n(i);const f=new n(2),m=await hi(f.leftShift(s.dec()),f.leftShift(s)),b=t.dec().imul(m).iadd(i);return!!r.equal(e.modExp(b,t))}});class Mr{constructor(e){if(e instanceof Mr)this.oid=e.oid;else if(M.isArray(e)||M.isUint8Array(e)){if((e=new Uint8Array(e))[0]===6){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 r=e[0];if(e.length>=1+r)return this.oid=e.subarray(1,1+r),1+this.oid.length}throw Error("Invalid oid")}write(){return M.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return M.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(v.curve[e])return v.write(v.curve,e);throw Error("Unknown curve object identifier.")}}function Uo(t,e){return t.keyPair({priv:e})}function Bo(t,e){const r=t.keyPair({pub:e});if(r.validate().result!==!0)throw Error("Invalid elliptic public key");return r}async function Yn(t){if(!vt.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:e}=await ri(()=>Promise.resolve().then(function(){return j6}),void 0);return new e.ec(t)}function h3(t){let e,r=0;const i=t[0];return i<192?([r]=t,e=1):i<255?(r=(t[0]-192<<8)+t[1]+192,e=2):i===255&&(r=M.readNumber(t.subarray(1,5)),e=5),{len:r,offset:e}}function ts(t){return t<192?new Uint8Array([t]):t>191&&t<8384?new Uint8Array([192+(t-192>>8),t-192&255]):M.concatUint8Array([new Uint8Array([255]),M.writeNumber(t,4)])}function S5(t){if(t<0||t>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+t])}function d3(t){return new Uint8Array([192|t])}function Fc(t,e){return M.concatUint8Array([d3(t),ts(e)])}function Us(t){return[v.packet.literalData,v.packet.compressedData,v.packet.symmetricallyEncryptedData,v.packet.symEncryptedIntegrityProtectedData,v.packet.aeadEncryptedData].includes(t)}async function E5(t,e){const r=Nr(t);let i,n;try{const a=await r.peekBytes(2);if(!a||a.length<2||(128&a[0])==0)throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const s=await r.readByte();let o,u,c=-1,h=-1;h=0,(64&s)!=0&&(h=1),h?c=63&s:(c=(63&s)>>2,u=3&s);const f=Us(c);let m,b=null;if(f){if(M.isStream(t)==="array"){const I=new Rr;i=We(I),b=I}else{const I=new $n;i=We(I.writable),b=I.readable}n=e({tag:c,packet:b})}else b=[];do{if(h){const I=await r.readByte();if(m=!1,I<192)o=I;else if(I>=192&&I<224)o=(I-192<<8)+await r.readByte()+192;else if(I>223&&I<255){if(o=1<<(31&I),m=!0,!f)throw new TypeError("This packet type does not support partial lengths.")}else o=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(u){case 0:o=await r.readByte();break;case 1:o=await r.readByte()<<8|await r.readByte();break;case 2:o=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:o=1/0}if(o>0){let I=0;for(;;){i&&await i.ready;const{done:U,value:G}=await r.read();if(U){if(o===1/0)break;throw Error("Unexpected end of packet")}const Q=o===1/0?G:G.subarray(0,o-I);if(i?await i.write(Q):b.push(Q),I+=G.length,I>=o){r.unshift(G.subarray(o-I+G.length));break}}}}while(m);const K=await r.peekBytes(f?1/0:2);return i?(await i.ready,await i.close()):(b=M.concatUint8Array(b),await e({tag:c,packet:b})),!K||!K.length}catch(a){if(i)return await i.abort(a),!0;throw a}finally{i&&await n,r.releaseLock()}}class fe extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,fe),this.name="UnsupportedError"}}class N0{constructor(e,r){this.tag=e,this.rawContent=r}write(){return this.rawContent}}const c0=M.getWebCrypto(),Xs=M.getNodeCrypto(),Fr={p256:"P-256",p384:"P-384",p521:"P-521"},Vr=Xs?Xs.getCurves():[],Ai=Xs?{secp256k1:Vr.includes("secp256k1")?"secp256k1":void 0,p256:Vr.includes("prime256v1")?"prime256v1":void 0,p384:Vr.includes("secp384r1")?"secp384r1":void 0,p521:Vr.includes("secp521r1")?"secp521r1":void 0,ed25519:Vr.includes("ED25519")?"ED25519":void 0,curve25519:Vr.includes("X25519")?"X25519":void 0,brainpoolP256r1:Vr.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:Vr.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:Vr.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Bs={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:v.publicKey.ecdsa,hash:v.hash.sha256,cipher:v.symmetric.aes128,node:Ai.p256,web:Fr.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:v.publicKey.ecdsa,hash:v.hash.sha384,cipher:v.symmetric.aes192,node:Ai.p384,web:Fr.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:v.publicKey.ecdsa,hash:v.hash.sha512,cipher:v.symmetric.aes256,node:Ai.p521,web:Fr.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:v.publicKey.ecdsa,hash:v.hash.sha256,cipher:v.symmetric.aes128,node:Ai.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:v.publicKey.eddsa,hash:v.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:v.publicKey.ecdh,hash:v.hash.sha256,cipher:v.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:v.publicKey.ecdsa,hash:v.hash.sha256,cipher:v.symmetric.aes128,node:Ai.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:v.publicKey.ecdsa,hash:v.hash.sha384,cipher:v.symmetric.aes192,node:Ai.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:v.publicKey.ecdsa,hash:v.hash.sha512,cipher:v.symmetric.aes256,node:Ai.brainpoolP512r1,payloadSize:64}};class di{constructor(e,r){try{(M.isArray(e)||M.isUint8Array(e))&&(e=new Mr(e)),e instanceof Mr&&(e=e.getName()),this.name=v.write(v.curve,e)}catch{throw new fe("Unknown curve")}r=r||Bs[this.name],this.keyType=r.keyType,this.oid=r.oid,this.hash=r.hash,this.cipher=r.cipher,this.node=r.node&&Bs[this.name],this.web=r.web&&Bs[this.name],this.payloadSize=r.payloadSize,this.web&&M.getWebCrypto()?this.type="web":this.node&&M.getNodeCrypto()?this.type="node":this.name==="curve25519"?this.type="curve25519":this.name==="ed25519"&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(i){const n=await c0.generateKey({name:"ECDSA",namedCurve:Fr[i]},!0,["sign","verify"]),a=await c0.exportKey("jwk",n.privateKey),s=await c0.exportKey("jwk",n.publicKey);return{publicKey:l3(s),privateKey:Jr(a.d)}}(this.name)}catch(i){M.printDebugError("Browser did not support generating ec key "+i.message);break}case"node":return async function(i){const n=Xs.createECDH(Ai[i]);return await n.generateKeys(),{publicKey:new Uint8Array(n.getPublicKey()),privateKey:new Uint8Array(n.getPrivateKey())}}(this.name);case"curve25519":{const i=qr(32);i[0]=127&i[0]|64,i[31]&=248;const n=i.slice().reverse();return e=zr.box.keyPair.fromSecretKey(n),{publicKey:M.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:i}}case"ed25519":{const i=qr(32),n=zr.sign.keyPair.fromSeed(i);return{publicKey:M.concatUint8Array([new Uint8Array([64]),n.publicKey]),privateKey:i}}}return e=await(await Yn(this.name)).genKeyPair({entropy:M.uint8ArrayToString(qr(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function f3(t,e,r,i){const n={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:t===v.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=e.getName();if(!n[a])return!1;if(a==="curve25519"){i=i.slice().reverse();const{publicKey:o}=zr.box.keyPair.fromSecretKey(i);r=new Uint8Array(r);const u=new Uint8Array([64,...o]);return!!M.equalsUint8Array(u,r)}const s=await Yn(a);try{r=Bo(s,r).getPublic()}catch{return!1}return!!Uo(s,i).getPublic().eq(r)}function l3(t){const e=Jr(t.x),r=Jr(t.y),i=new Uint8Array(e.length+r.length+1);return i[0]=4,i.set(e,1),i.set(r,e.length+1),i}function To(t,e,r){const i=t,n=r.slice(1,i+1),a=r.slice(i+1,2*i+1);return{kty:"EC",crv:e,x:Ve(n,!0),y:Ve(a,!0),ext:!0}}function p3(t,e,r,i){const n=To(t,e,r);return n.d=Ve(i,!0),n}const Js=M.getWebCrypto(),Qn=M.getNodeCrypto();async function Oc(t,e,r,i,n,a){const s=new di(t);if(r&&!M.isStream(r)){const o={publicKey:i,privateKey:n};switch(s.type){case"web":try{return await async function(u,c,h,f){const m=u.payloadSize,b=p3(u.payloadSize,Fr[u.name],f.publicKey,f.privateKey),K=await Js.importKey("jwk",b,{name:"ECDSA",namedCurve:Fr[u.name],hash:{name:v.read(v.webHash,u.hash)}},!1,["sign"]),I=new Uint8Array(await Js.sign({name:"ECDSA",namedCurve:Fr[u.name],hash:{name:v.read(v.webHash,c)}},K,h));return{r:I.slice(0,m),s:I.slice(m,m<<1)}}(s,e,r,o)}catch(u){if(s.name!=="p521"&&(u.name==="DataError"||u.name==="OperationError"))throw u;M.printDebugError("Browser did not support signing: "+u.message)}break;case"node":{const u=await async function(c,h,f,m){const b=Qn.createSign(v.read(v.hash,h));b.write(f),b.end();const K=P5.encode({version:1,parameters:c.oid,privateKey:Array.from(m.privateKey),publicKey:{unused:0,data:Array.from(m.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return y3.decode(b.sign(K),"der")}(s,e,r,o);return{r:u.r.toArrayLike(Uint8Array),s:u.s.toArrayLike(Uint8Array)}}}}return async function(o,u,c){const h=await Yn(o.name),f=Uo(h,c),m=f.sign(u);return{r:m.r.toArrayLike(Uint8Array),s:m.s.toArrayLike(Uint8Array)}}(s,a,n)}async function $c(t,e,r,i,n,a){const s=new di(t);if(i&&!M.isStream(i))switch(s.type){case"web":try{return await async function(o,u,{r:c,s:h},f,m){const b=To(o.payloadSize,Fr[o.name],m),K=await Js.importKey("jwk",b,{name:"ECDSA",namedCurve:Fr[o.name],hash:{name:v.read(v.webHash,o.hash)}},!1,["verify"]),I=M.concatUint8Array([c,h]).buffer;return Js.verify({name:"ECDSA",namedCurve:Fr[o.name],hash:{name:v.read(v.webHash,u)}},K,I,f)}(s,e,r,i,n)}catch(o){if(s.name!=="p521"&&(o.name==="DataError"||o.name==="OperationError"))throw o;M.printDebugError("Browser did not support verifying: "+o.message)}break;case"node":return async function(o,u,{r:c,s:h},f,m){const{default:b}=await ri(()=>Promise.resolve().then(function(){return _a}),void 0),K=Qn.createVerify(v.read(v.hash,u));K.write(f),K.end();const I=M5.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(m)}},"pem",{label:"PUBLIC KEY"}),U=y3.encode({r:new b(c),s:new b(h)},"der");try{return K.verify(I,U)}catch{return!1}}(s,e,r,i,n)}return async function(o,u,c,h){const f=await Yn(o.name);return Bo(f,h).verify(c,u)}(s,r,e===void 0?i:a,n)}const zo=void 0,y3=Qn?zo.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,P5=Qn?zo.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,x5=Qn?zo.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,M5=Qn?zo.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(x5),this.key("subjectPublicKey").bitstr())}):void 0;var C5=Object.freeze({__proto__:null,sign:Oc,verify:$c,validateParams:async function(t,e,r){const i=new di(t);if(i.keyType!==v.publicKey.ecdsa)return!1;switch(i.type){case"web":case"node":{const n=qr(8),a=v.hash.sha256,s=await Ln.digest(a,n);try{const o=await Oc(t,a,n,e,r,s);return await $c(t,a,o,n,e,s)}catch{return!1}}default:return f3(v.publicKey.ecdsa,t,e,r)}}});zr.hash=t=>new Uint8Array(Ja().update(t).digest());var D5=Object.freeze({__proto__:null,sign:async function(t,e,r,i,n,a){if(Ln.getHashByteLength(e)=0;--h)for(let f=o-1;f>=0;--f)u[1]=o*h+(f+1),c[0]=a[0]^u[0],c[1]=a[1]^u[1],c[2]=s[2*f],c[3]=s[2*f+1],c=to(r.decrypt(eo(c))),a=c.subarray(0,2),s[2*f]=c[2],s[2*f+1]=c[3];if(a[0]===i[0]&&a[1]===i[1])return eo(s);throw Error("Key Data Integrity failed")}function to(t){const{length:e}=t,r=function(a){if(M.isString(a)){const{length:s}=a,o=new ArrayBuffer(s),u=new Uint8Array(o);for(let c=0;c0){const r=t[e-1];if(r>=1){const i=t.subarray(e-r),n=new Uint8Array(r).fill(r);if(M.equalsUint8Array(i,n))return t.subarray(0,e-r)}}throw Error("Invalid padding")}var R5=Object.freeze({__proto__:null,encode:g3,decode:w3});const Ri=M.getWebCrypto(),v3=M.getNodeCrypto();function Lc(t,e,r,i){return M.concatUint8Array([e.write(),new Uint8Array([t]),r.write(),M.stringToUint8Array("Anonymous Sender "),i.subarray(0,20)])}async function Nc(t,e,r,i,n=!1,a=!1){let s;if(n){for(s=0;s=0&&e[s]===0;s--);e=e.subarray(0,s+1)}return(await Ln.digest(t,M.concatUint8Array([new Uint8Array([0,0,0,1]),e,i]))).subarray(0,r)}async function I5(t,e){switch(t.type){case"curve25519":{const r=qr(32),{secretKey:i,sharedKey:n}=await _3(t,e,null,r);let{publicKey:a}=zr.box.keyPair.fromSecretKey(i);return a=M.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:n}}case"web":if(t.web&&M.getWebCrypto())try{return await async function(r,i){const n=To(r.payloadSize,r.web.web,i);let a=Ri.generateKey({name:"ECDH",namedCurve:r.web.web},!0,["deriveKey","deriveBits"]),s=Ri.importKey("jwk",n,{name:"ECDH",namedCurve:r.web.web},!1,[]);[a,s]=await Promise.all([a,s]);let o=Ri.deriveBits({name:"ECDH",namedCurve:r.web.web,public:s},a.privateKey,r.web.sharedSize),u=Ri.exportKey("jwk",a.publicKey);[o,u]=await Promise.all([o,u]);const c=new Uint8Array(o);return{publicKey:new Uint8Array(l3(u)),sharedKey:c}}(t,e)}catch(r){M.printDebugError(r)}break;case"node":return async function(r,i){const n=v3.createECDH(r.node.node);n.generateKeys();const a=new Uint8Array(n.computeSecret(i));return{publicKey:new Uint8Array(n.getPublicKey()),sharedKey:a}}(t,e)}return async function(r,i){const n=await Yn(r.name),a=await r.genKeyPair();i=Bo(n,i);const s=Uo(n,a.privateKey),o=a.publicKey,u=s.derive(i.getPublic()),c=n.curve.p.byteLength(),h=u.toArrayLike(Uint8Array,"be",c);return{publicKey:o,sharedKey:h}}(t,e)}async function _3(t,e,r,i){if(i.length!==t.payloadSize){const n=new Uint8Array(t.payloadSize);n.set(i,t.payloadSize-i.length),i=n}switch(t.type){case"curve25519":{const n=i.slice().reverse();return{secretKey:n,sharedKey:zr.scalarMult(n,e.subarray(1))}}case"web":if(t.web&&M.getWebCrypto())try{return await async function(n,a,s,o){const u=p3(n.payloadSize,n.web.web,s,o);let c=Ri.importKey("jwk",u,{name:"ECDH",namedCurve:n.web.web},!0,["deriveKey","deriveBits"]);const h=To(n.payloadSize,n.web.web,a);let f=Ri.importKey("jwk",h,{name:"ECDH",namedCurve:n.web.web},!0,[]);[c,f]=await Promise.all([c,f]);let m=Ri.deriveBits({name:"ECDH",namedCurve:n.web.web,public:f},c,n.web.sharedSize),b=Ri.exportKey("jwk",c);[m,b]=await Promise.all([m,b]);const K=new Uint8Array(m);return{secretKey:Jr(b.d),sharedKey:K}}(t,e,r,i)}catch(n){M.printDebugError(n)}break;case"node":return async function(n,a,s){const o=v3.createECDH(n.node.node);o.setPrivateKey(s);const u=new Uint8Array(o.computeSecret(a));return{secretKey:new Uint8Array(o.getPrivateKey()),sharedKey:u}}(t,e,i)}return async function(n,a,s){const o=await Yn(n.name);a=Bo(o,a),s=Uo(o,s);const u=new Uint8Array(s.getPrivate()),c=s.derive(a.getPublic()),h=o.curve.p.byteLength(),f=c.toArrayLike(Uint8Array,"be",h);return{secretKey:u,sharedKey:f}}(t,e,i)}var U5=Object.freeze({__proto__:null,validateParams:async function(t,e,r){return f3(v.publicKey.ecdh,t,e,r)},encrypt:async function(t,e,r,i,n){const a=g3(r),s=new di(t),{publicKey:o,sharedKey:u}=await I5(s,i),c=Lc(v.publicKey.ecdh,t,e,n),{keySize:h}=zi(e.cipher);return{publicKey:o,wrappedKey:b3(await Nc(e.hash,u,h,c),a)}},decrypt:async function(t,e,r,i,n,a,s){const o=new di(t),{sharedKey:u}=await _3(o,r,n,a),c=Lc(v.publicKey.ecdh,t,e,s),{keySize:h}=zi(e.cipher);let f;for(let m=0;m<3;m++)try{return w3(m3(await Nc(e.hash,u,h,c,m===1,m===2),i))}catch(b){f=b}throw f}}),B5=Object.freeze({__proto__:null,Curve:di,ecdh:U5,ecdsa:C5,eddsa:D5,generate:async function(t){const e=await M.getBigInteger();t=new di(t);const r=await t.genKeyPair(),i=new e(r.publicKey).toUint8Array(),n=new e(r.privateKey).toUint8Array("be",t.payloadSize);return{oid:t.oid,Q:i,secret:n,hash:t.hash,cipher:t.cipher}},getPreferredHashAlgo:function(t){return Bs[v.write(v.curve,t.toHex())].hash}}),T5=Object.freeze({__proto__:null,sign:async function(t,e,r,i,n,a){const s=await M.getBigInteger(),o=new s(1);let u,c,h,f;i=new s(i),n=new s(n),r=new s(r),a=new s(a),r=r.mod(i),a=a.mod(n);const m=new s(e.subarray(0,n.byteLength())).mod(n);for(;;){if(u=await hi(o,n),c=r.modExp(u,i).imod(n),c.isZero())continue;const b=a.mul(c).imod(n);if(f=m.add(b).imod(n),h=u.modInv(n).imul(f).imod(n),!h.isZero())break}return{r:c.toUint8Array("be",n.byteLength()),s:h.toUint8Array("be",n.byteLength())}},verify:async function(t,e,r,i,n,a,s,o){const u=await M.getBigInteger(),c=new u(0);if(e=new u(e),r=new u(r),a=new u(a),s=new u(s),n=new u(n),o=new u(o),e.lte(c)||e.gte(s)||r.lte(c)||r.gte(s))return M.printDebug("invalid DSA Signature"),!1;const h=new u(i.subarray(0,s.byteLength())).imod(s),f=r.modInv(s);if(f.isZero())return M.printDebug("invalid DSA Signature"),!1;n=n.mod(a),o=o.mod(a);const m=h.mul(f).imod(s),b=e.mul(f).imod(s),K=n.modExp(m,a),I=o.modExp(b,a);return K.mul(I).imod(a).imod(s).equal(e)},validateParams:async function(t,e,r,i,n){const a=await M.getBigInteger();t=new a(t),e=new a(e),r=new a(r),i=new a(i);const s=new a(1);if(r.lte(s)||r.gte(t)||!t.dec().mod(e).isZero()||!r.modExp(e,t).isOne())return!1;const o=new a(e.bitLength()),u=new a(150);if(o.lt(u)||!await c3(e,null,32))return!1;n=new a(n);const c=new a(2),h=await hi(c.leftShift(o.dec()),c.leftShift(o)),f=e.mul(h).add(n);return!!i.equal(r.modExp(f,t))}}),ie={rsa:k5,elgamal:A5,elliptic:B5,dsa:T5,nacl:zr},z5=Object.freeze({__proto__:null,parseSignatureParams:function(t,e){let r=0;switch(t){case v.publicKey.rsaEncryptSign:case v.publicKey.rsaEncrypt:case v.publicKey.rsaSign:return{s:M.readMPI(e.subarray(r))};case v.publicKey.dsa:case v.publicKey.ecdsa:{const i=M.readMPI(e.subarray(r));return r+=i.length+2,{r:i,s:M.readMPI(e.subarray(r))}}case v.publicKey.eddsa:{let i=M.readMPI(e.subarray(r));r+=i.length+2,i=M.leftPad(i,32);let n=M.readMPI(e.subarray(r));return n=M.leftPad(n,32),{r:i,s:n}}default:throw new fe("Unknown signature algorithm.")}},verify:async function(t,e,r,i,n,a){switch(t){case v.publicKey.rsaEncryptSign:case v.publicKey.rsaEncrypt:case v.publicKey.rsaSign:{const{n:s,e:o}=i,u=M.leftPad(r.s,s.length);return ie.rsa.verify(e,n,u,s,o,a)}case v.publicKey.dsa:{const{g:s,p:o,q:u,y:c}=i,{r:h,s:f}=r;return ie.dsa.verify(e,h,f,a,s,o,u,c)}case v.publicKey.ecdsa:{const{oid:s,Q:o}=i,u=new ie.elliptic.Curve(s).payloadSize,c=M.leftPad(r.r,u),h=M.leftPad(r.s,u);return ie.elliptic.ecdsa.verify(s,e,{r:c,s:h},n,o,a)}case v.publicKey.eddsa:{const{oid:s,Q:o}=i;return ie.elliptic.eddsa.verify(s,e,r,n,o,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(t,e,r,i,n,a){if(!r||!i)throw Error("Missing key parameters");switch(t){case v.publicKey.rsaEncryptSign:case v.publicKey.rsaEncrypt:case v.publicKey.rsaSign:{const{n:s,e:o}=r,{d:u,p:c,q:h,u:f}=i;return{s:await ie.rsa.sign(e,n,s,o,u,c,h,f,a)}}case v.publicKey.dsa:{const{g:s,p:o,q:u}=r,{x:c}=i;return ie.dsa.sign(e,a,s,o,u,c)}case v.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case v.publicKey.ecdsa:{const{oid:s,Q:o}=r,{d:u}=i;return ie.elliptic.ecdsa.sign(s,e,n,o,u,a)}case v.publicKey.eddsa:{const{oid:s,Q:o}=r,{seed:u}=i;return ie.elliptic.eddsa.sign(s,e,n,o,u,a)}default:throw Error("Unknown signature algorithm.")}}});class jc{constructor(e){e=e===void 0?new Uint8Array([]):M.isString(e)?M.stringToUint8Array(e):new Uint8Array(e),this.data=e}read(e){if(e.length>=1){const r=e[0];if(e.length>=1+r)return this.data=e.subarray(1,1+r),1+this.data.length}throw Error("Invalid symmetric key")}write(){return M.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class Wc{constructor(e){if(e){const{hash:r,cipher:i}=e;this.hash=r,this.cipher=i}else this.hash=null,this.cipher=null}read(e){if(e.length<4||e[0]!==3||e[1]!==1)throw Error("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}function u0(t){try{t.getName()}catch{throw new fe("Unknown curve OID")}}var q5=Object.freeze({__proto__:null,publicKeyEncrypt:async function(t,e,r,i){switch(t){case v.publicKey.rsaEncrypt:case v.publicKey.rsaEncryptSign:{const{n,e:a}=e;return{c:await ie.rsa.encrypt(r,n,a)}}case v.publicKey.elgamal:{const{p:n,g:a,y:s}=e;return ie.elgamal.encrypt(r,n,a,s)}case v.publicKey.ecdh:{const{oid:n,Q:a,kdfParams:s}=e,{publicKey:o,wrappedKey:u}=await ie.elliptic.ecdh.encrypt(n,s,r,a,i);return{V:o,C:new jc(u)}}default:return[]}},publicKeyDecrypt:async function(t,e,r,i,n,a){switch(t){case v.publicKey.rsaEncryptSign:case v.publicKey.rsaEncrypt:{const{c:s}=i,{n:o,e:u}=e,{d:c,p:h,q:f,u:m}=r;return ie.rsa.decrypt(s,o,u,c,h,f,m,a)}case v.publicKey.elgamal:{const{c1:s,c2:o}=i,u=e.p,c=r.x;return ie.elgamal.decrypt(s,o,u,c,a)}case v.publicKey.ecdh:{const{oid:s,Q:o,kdfParams:u}=e,{d:c}=r,{V:h,C:f}=i;return ie.elliptic.ecdh.decrypt(s,u,h,f.data,o,c,n)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(t,e){let r=0;switch(t){case v.publicKey.rsaEncrypt:case v.publicKey.rsaEncryptSign:case v.publicKey.rsaSign:{const i=M.readMPI(e.subarray(r));r+=i.length+2;const n=M.readMPI(e.subarray(r));return r+=n.length+2,{read:r,publicParams:{n:i,e:n}}}case v.publicKey.dsa:{const i=M.readMPI(e.subarray(r));r+=i.length+2;const n=M.readMPI(e.subarray(r));r+=n.length+2;const a=M.readMPI(e.subarray(r));r+=a.length+2;const s=M.readMPI(e.subarray(r));return r+=s.length+2,{read:r,publicParams:{p:i,q:n,g:a,y:s}}}case v.publicKey.elgamal:{const i=M.readMPI(e.subarray(r));r+=i.length+2;const n=M.readMPI(e.subarray(r));r+=n.length+2;const a=M.readMPI(e.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:i,g:n,y:a}}}case v.publicKey.ecdsa:{const i=new Mr;r+=i.read(e),u0(i);const n=M.readMPI(e.subarray(r));return r+=n.length+2,{read:r,publicParams:{oid:i,Q:n}}}case v.publicKey.eddsa:{const i=new Mr;r+=i.read(e),u0(i);let n=M.readMPI(e.subarray(r));return r+=n.length+2,n=M.leftPad(n,33),{read:r,publicParams:{oid:i,Q:n}}}case v.publicKey.ecdh:{const i=new Mr;r+=i.read(e),u0(i);const n=M.readMPI(e.subarray(r));r+=n.length+2;const a=new Wc;return r+=a.read(e.subarray(r)),{read:r,publicParams:{oid:i,Q:n,kdfParams:a}}}default:throw new fe("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(t,e,r){let i=0;switch(t){case v.publicKey.rsaEncrypt:case v.publicKey.rsaEncryptSign:case v.publicKey.rsaSign:{const n=M.readMPI(e.subarray(i));i+=n.length+2;const a=M.readMPI(e.subarray(i));i+=a.length+2;const s=M.readMPI(e.subarray(i));i+=s.length+2;const o=M.readMPI(e.subarray(i));return i+=o.length+2,{read:i,privateParams:{d:n,p:a,q:s,u:o}}}case v.publicKey.dsa:case v.publicKey.elgamal:{const n=M.readMPI(e.subarray(i));return i+=n.length+2,{read:i,privateParams:{x:n}}}case v.publicKey.ecdsa:case v.publicKey.ecdh:{const n=new di(r.oid);let a=M.readMPI(e.subarray(i));return i+=a.length+2,a=M.leftPad(a,n.payloadSize),{read:i,privateParams:{d:a}}}case v.publicKey.eddsa:{const n=new di(r.oid);let a=M.readMPI(e.subarray(i));return i+=a.length+2,a=M.leftPad(a,n.payloadSize),{read:i,privateParams:{seed:a}}}default:throw new fe("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(t,e){let r=0;switch(t){case v.publicKey.rsaEncrypt:case v.publicKey.rsaEncryptSign:return{c:M.readMPI(e.subarray(r))};case v.publicKey.elgamal:{const i=M.readMPI(e.subarray(r));return r+=i.length+2,{c1:i,c2:M.readMPI(e.subarray(r))}}case v.publicKey.ecdh:{const i=M.readMPI(e.subarray(r));r+=i.length+2;const n=new jc;return n.read(e.subarray(r)),{V:i,C:n}}default:throw new fe("Unknown public key encryption algorithm.")}},serializeParams:function(t,e){const r=Object.keys(e).map(i=>{const n=e[i];return M.isUint8Array(n)?M.uint8ArrayToMPI(n):n.write()});return M.concatUint8Array(r)},generateParams:function(t,e,r){switch(t){case v.publicKey.rsaEncrypt:case v.publicKey.rsaEncryptSign:case v.publicKey.rsaSign:return ie.rsa.generate(e,65537).then(({n:i,e:n,d:a,p:s,q:o,u})=>({privateParams:{d:a,p:s,q:o,u},publicParams:{n:i,e:n}}));case v.publicKey.ecdsa:return ie.elliptic.generate(r).then(({oid:i,Q:n,secret:a})=>({privateParams:{d:a},publicParams:{oid:new Mr(i),Q:n}}));case v.publicKey.eddsa:return ie.elliptic.generate(r).then(({oid:i,Q:n,secret:a})=>({privateParams:{seed:a},publicParams:{oid:new Mr(i),Q:n}}));case v.publicKey.ecdh:return ie.elliptic.generate(r).then(({oid:i,Q:n,secret:a,hash:s,cipher:o})=>({privateParams:{d:a},publicParams:{oid:new Mr(i),Q:n,kdfParams:new Wc({hash:s,cipher:o})}}));case v.publicKey.dsa:case v.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(t,e,r){if(!e||!r)throw Error("Missing key parameters");switch(t){case v.publicKey.rsaEncrypt:case v.publicKey.rsaEncryptSign:case v.publicKey.rsaSign:{const{n:i,e:n}=e,{d:a,p:s,q:o,u}=r;return ie.rsa.validateParams(i,n,a,s,o,u)}case v.publicKey.dsa:{const{p:i,q:n,g:a,y:s}=e,{x:o}=r;return ie.dsa.validateParams(i,n,a,s,o)}case v.publicKey.elgamal:{const{p:i,g:n,y:a}=e,{x:s}=r;return ie.elgamal.validateParams(i,n,a,s)}case v.publicKey.ecdsa:case v.publicKey.ecdh:{const i=ie.elliptic[v.read(v.publicKey,t)],{oid:n,Q:a}=e,{d:s}=r;return i.validateParams(n,a,s)}case v.publicKey.eddsa:{const{oid:i,Q:n}=e,{seed:a}=r;return ie.elliptic.eddsa.validateParams(i,n,a)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(t){const{blockSize:e}=zi(t),r=await qr(e),i=new Uint8Array([r[r.length-2],r[r.length-1]]);return M.concat([r,i])},generateSessionKey:function(t){const{keySize:e}=zi(t);return qr(e)},getAEADMode:function(t){const e=v.read(v.aead,t);return o3[e]},getCipher:zi});const At={cipher:Qa,hash:Ln,mode:o3,publicKey:ie,signature:z5,random:w5,pkcs1:_5,pkcs5:R5,aesKW:K5};Object.assign(At,q5);var es=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function k3(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)}const A3={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(let a=0;a=0;)t[e]=0}const N5=0,C3=1,j5=2,E1=29,rs=256,Ba=rs+1+E1,zn=30,P1=19,Zc=2*Ba+1,sn=15,h0=16,W5=7,x1=256,D3=16,K3=17,R3=18,W0=[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],Ts=[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],H5=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Yc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Xr=Array(2*(Ba+2));Xn(Xr);const Pa=Array(2*zn);Xn(Pa);const Ta=Array(512);Xn(Ta);const za=Array(256);Xn(za);const M1=Array(E1);Xn(M1);const io=Array(zn);function d0(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let Qc,Xc,Jc;function f0(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function I3(t){return t<256?Ta[t]:Ta[256+(t>>>7)]}function qa(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Le(t,e,r){t.bi_valid>h0-r?(t.bi_buf|=e<>h0-t.bi_valid,t.bi_valid+=r-h0):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function B3(t,e,r){const i=Array(sn+1);let n,a,s=0;for(n=1;n<=sn;n++)i[n]=s=s+r[n-1]<<1;for(a=0;a<=e;a++){const o=t[2*a+1];o!==0&&(t[2*a]=U3(i[o]++,o))}}function T3(t){let e;for(e=0;e8?qa(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function t2(t,e,r,i){const n=2*e,a=2*r;return t[n]>1;s>=1;s--)l0(t,r,s);u=a;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],l0(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,r[2*u]=r[2*s]+r[2*o],t.depth[u]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,r[2*s+1]=r[2*o+1]=u,t.heap[1]=u++,l0(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(h,f){const m=f.dyn_tree,b=f.max_code,K=f.stat_desc.static_tree,I=f.stat_desc.has_stree,U=f.stat_desc.extra_bits,G=f.stat_desc.extra_base,Q=f.stat_desc.max_length;let Y,R,J,V,X,d,y=0;for(V=0;V<=sn;V++)h.bl_count[V]=0;for(m[2*h.heap[h.heap_max]+1]=0,Y=h.heap_max+1;YQ&&(V=Q,y++),m[2*R+1]=V,R>b||(h.bl_count[V]++,X=0,R>=G&&(X=U[R-G]),d=m[2*R],h.opt_len+=d*(V+X),I&&(h.static_len+=d*(K[2*R+1]+X)));if(y!==0){do{for(V=Q-1;h.bl_count[V]===0;)V--;h.bl_count[V]--,h.bl_count[V+1]+=2,h.bl_count[Q]--,y-=2}while(y>0);for(V=Q;V!==0;V--)for(R=h.bl_count[V];R!==0;)J=h.heap[--Y],J>b||(m[2*J+1]!==V&&(h.opt_len+=(V-m[2*J+1])*m[2*J],m[2*J+1]=V),R--)}}(t,e),B3(r,c,t.bl_count)}function r2(t,e,r){let i,n,a=-1,s=e[1],o=0,u=7,c=4;for(s===0&&(u=138,c=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=e[2*(i+1)+1],++o>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(t)}function Z5(t,e,r,i){let n,a,s=0;t.level>0?(t.strm.data_type===M3&&(t.strm.data_type=function(o){let u,c=4093624447;for(u=0;u<=31;u++,c>>>=1)if(1&c&&o.dyn_ltree[2*u]!==0)return Gc;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return Vc;for(u=32;u=3&&o.bl_tree[2*Yc[u]+1]===0;u--);return o.opt_len+=3*(u+1)+5+5+4,u}(t),n=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&e!==-1?q3(t,e,r,i):t.strategy===x3||a===n?(Le(t,(C3<<1)+(i?1:0),3),e2(t,Xr,Pa)):(Le(t,(j5<<1)+(i?1:0),3),function(o,u,c,h){let f;for(Le(o,u-257,5),Le(o,c-1,5),Le(o,h-4,4),f=0;f>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,e===0?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(za[r]+rs+1)]++,t.dyn_dtree[2*I3(e)]++),t.last_lit===t.lit_bufsize-1}function Fa(t,e,r,i){let n=65535&t|0,a=t>>>16&65535|0,s=0;for(;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+e[i++]|0,a=a+n|0;while(--s);n%=65521,a%=65521}return n|a<<16|0}const Y5=function(){let t;const e=[];for(let r=0;r<256;r++){t=r;for(let i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();function be(t,e,r,i){const n=Y5,a=i+r;t^=-1;for(let s=i;s>>8^n[255&(t^e[s])];return-1^t}var Oa={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const Q5=9,jt=3,Ii=258,cr=Ii+jt+1,X5=32,no=42,H0=69,zs=73,qs=91,Fs=103,on=113,ya=666,me=1,xa=2,cn=3,qn=4,J5=3;function Ui(t,e){return t.msg=Oa[e],e}function a2(t){return(t<<1)-(t>4?9:0)}function Ci(t){let e=t.length;for(;--e>=0;)t[e]=0}function Si(t){const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Or(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function Ae(t,e){Z5(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Si(t.strm)}function Vt(t,e){t.pending_buf[t.pending++]=e}function ia(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function tf(t,e,r,i){let n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,Or(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=Fa(t.adler,e,n,r):t.state.wrap===2&&(t.adler=be(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function F3(t,e){let r,i,n=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match;const u=t.strstart>t.w_size-cr?t.strstart-(t.w_size-cr):0,c=t.window,h=t.w_mask,f=t.prev,m=t.strstart+Ii;let b=c[a+s-1],K=c[a+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(r=e,c[r+s]===K&&c[r+s-1]===b&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do;while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&as){if(t.match_start=e,s=i,i>=o)break;b=c[a+s-1],K=c[a+s]}}while((e=f[e&h])>u&&--n!=0);return s<=t.lookahead?s:t.lookahead}function yn(t){const e=t.w_size;let r,i,n,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-cr)){Or(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);a+=e}if(t.strm.avail_in===0)break;if(i=tf(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=i,t.lookahead+t.insert>=jt)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<=jt&&(t.ins_h=(t.ins_h<=jt)if(i=qi(t,t.strstart-t.match_start,t.match_length-jt),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=jt){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=jt&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=jt-1)),t.prev_length>=jt&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-jt,i=qi(t,t.strstart-1-t.prev_match,t.prev_length-jt),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(yn(t),t.lookahead===0&&e===$r)return me;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,Ae(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-cr&&(Ae(t,!1),t.strm.avail_out===0))return me}return t.insert=0,e===we?(Ae(t,!0),t.strm.avail_out===0?cn:qn):(t.strstart>t.block_start&&(Ae(t,!1),t.strm.avail_out),me)}),new _r(4,4,8,4,y0),new _r(4,5,16,8,y0),new _r(4,6,32,32,y0),new _r(4,4,16,16,kn),new _r(8,16,32,32,kn),new _r(8,16,128,128,kn),new _r(8,32,128,256,kn),new _r(32,128,258,1024,kn),new _r(32,258,258,4096,kn)];class ef{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Nn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new rr(1146),this.dyn_dtree=new rr(122),this.bl_tree=new rr(78),Ci(this.dyn_ltree),Ci(this.dyn_dtree),Ci(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new rr(16),this.heap=new rr(573),Ci(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new rr(573),Ci(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function rf(t){const e=function(r){let i;return r&&r.state?(r.total_in=r.total_out=0,r.data_type=M3,i=r.state,i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?no:on,r.adler=i.wrap===2?0:1,i.last_flush=$r,G5(i),Jt):Ui(r,de)}(t);return e===Jt&&function(r){r.window_size=2*r.w_size,Ci(r.head),r.max_lazy_match=ba[r.level].max_lazy,r.good_match=ba[r.level].good_length,r.nice_match=ba[r.level].nice_length,r.max_chain_length=ba[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=jt-1,r.match_available=0,r.ins_h=0}(t.state),e}function nf(t,e){let r,i,n,a;if(!t||!t.state||e>j0||e<0)return t?Ui(t,de):de;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===ya&&e!==we)return Ui(t,t.avail_out===0?Ea:de);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===no)if(i.wrap===2)t.adler=0,Vt(i,31),Vt(i,139),Vt(i,8),i.gzhead?(Vt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Vt(i,255&i.gzhead.time),Vt(i,i.gzhead.time>>8&255),Vt(i,i.gzhead.time>>16&255),Vt(i,i.gzhead.time>>24&255),Vt(i,i.level===9?2:i.strategy>=bs||i.level<2?4:0),Vt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Vt(i,255&i.gzhead.extra.length),Vt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=be(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=H0):(Vt(i,0),Vt(i,0),Vt(i,0),Vt(i,0),Vt(i,0),Vt(i,i.level===9?2:i.strategy>=bs||i.level<2?4:0),Vt(i,J5),i.status=on);else{let o=Nn+(i.w_bits-8<<4)<<8,u=-1;u=i.strategy>=bs||i.level<2?0:i.level<6?1:i.level===6?2:3,o|=u<<6,i.strstart!==0&&(o|=X5),o+=31-o%31,i.status=on,ia(i,o),i.strstart!==0&&(ia(i,t.adler>>>16),ia(i,65535&t.adler)),t.adler=1}if(i.status===H0)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=be(t.adler,i.pending_buf,i.pending-n,n)),Si(t),n=i.pending,i.pending!==i.pending_buf_size));)Vt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=be(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=zs)}else i.status=zs;if(i.status===zs)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=be(t.adler,i.pending_buf,i.pending-n,n)),Si(t),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindexn&&(t.adler=be(t.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.gzindex=0,i.status=qs)}else i.status=qs;if(i.status===qs)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=be(t.adler,i.pending_buf,i.pending-n,n)),Si(t),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindexn&&(t.adler=be(t.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.status=Fs)}else i.status=Fs;if(i.status===Fs&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Si(t),i.pending+2<=i.pending_buf_size&&(Vt(i,255&t.adler),Vt(i,t.adler>>8&255),t.adler=0,i.status=on)):i.status=on),i.pending!==0){if(Si(t),t.avail_out===0)return i.last_flush=-1,Jt}else if(t.avail_in===0&&a2(e)<=a2(r)&&e!==we)return Ui(t,Ea);if(i.status===ya&&t.avail_in!==0)return Ui(t,Ea);if(t.avail_in!==0||i.lookahead!==0||e!==$r&&i.status!==ya){var s=i.strategy===bs?function(o,u){let c;for(;;){if(o.lookahead===0&&(yn(o),o.lookahead===0)){if(u===$r)return me;break}if(o.match_length=0,c=qi(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,c&&(Ae(o,!1),o.strm.avail_out===0))return me}return o.insert=0,u===we?(Ae(o,!0),o.strm.avail_out===0?cn:qn):o.last_lit&&(Ae(o,!1),o.strm.avail_out===0)?me:xa}(i,e):i.strategy===L5?function(o,u){let c,h,f,m;const b=o.window;for(;;){if(o.lookahead<=Ii){if(yn(o),o.lookahead<=Ii&&u===$r)return me;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=jt&&o.strstart>0&&(f=o.strstart-1,h=b[f],h===b[++f]&&h===b[++f]&&h===b[++f])){m=o.strstart+Ii;do;while(h===b[++f]&&h===b[++f]&&h===b[++f]&&h===b[++f]&&h===b[++f]&&h===b[++f]&&h===b[++f]&&h===b[++f]&&fo.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=jt?(c=qi(o,1,o.match_length-jt),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(c=qi(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),c&&(Ae(o,!1),o.strm.avail_out===0))return me}return o.insert=0,u===we?(Ae(o,!0),o.strm.avail_out===0?cn:qn):o.last_lit&&(Ae(o,!1),o.strm.avail_out===0)?me:xa}(i,e):ba[i.level].func(i,e);if(s!==cn&&s!==qn||(i.status=ya),s===me||s===cn)return t.avail_out===0&&(i.last_flush=-1),Jt;if(s===xa&&(e===F5?V5(i):e!==j0&&(q3(i,0,0,!1),e===O5&&(Ci(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Si(t),t.avail_out===0))return i.last_flush=-1,Jt}return e!==we?Jt:i.wrap<=0?ni:(i.wrap===2?(Vt(i,255&t.adler),Vt(i,t.adler>>8&255),Vt(i,t.adler>>16&255),Vt(i,t.adler>>24&255),Vt(i,255&t.total_in),Vt(i,t.total_in>>8&255),Vt(i,t.total_in>>16&255),Vt(i,t.total_in>>24&255)):(ia(i,t.adler>>>16),ia(i,65535&t.adler)),Si(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Jt:ni)}try{String.fromCharCode.call(null,0)}catch{}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const G0=new Ir(256);for(let t=0;t<256;t++)G0[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;function V0(t){let e,r,i,n,a=0;const s=t.length;for(i=0;i>>6,o[n++]=128|63&e):e<65536?(o[n++]=224|e>>>12,o[n++]=128|e>>>6&63,o[n++]=128|63&e):(o[n++]=240|e>>>18,o[n++]=128|e>>>12&63,o[n++]=128|e>>>6&63,o[n++]=128|63&e);return o}G0[254]=G0[254]=1;class O3{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class Z0{constructor(e){this.options={level:Hc,method:Nn,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new O3,this.strm.avail_out=0;var i,n,a=function(s,o,u,c,h,f){if(!s)return de;let m=1;if(o===Hc&&(o=6),c<0?(m=0,c=-c):c>15&&(m=2,c-=16),h<1||h>Q5||u!==Nn||c<8||c>15||o<0||o>9||f<0||f>x3)return Ui(s,de);c===8&&(c=9);const b=new ef;return s.state=b,b.strm=s,b.wrap=m,b.gzhead=null,b.w_bits=c,b.w_size=1<=c.w_size&&(m===0&&(Ci(c.head),c.strstart=0,c.block_start=0,c.insert=0),U=new Ir(c.w_size),Or(U,u,G-c.w_size,c.w_size,0),u=U,G=c.w_size),b=o.avail_in,K=o.next_in,I=o.input,o.avail_in=G,o.next_in=0,o.input=u,yn(c);c.lookahead>=jt;){h=c.strstart,f=c.lookahead-(jt-1);do c.ins_h=(c.ins_h<0||i.avail_out===0)&&a!==ni);return s===we?(a=function(o){let u;return o&&o.state?(u=o.state.status,u!==no&&u!==H0&&u!==zs&&u!==qs&&u!==Fs&&u!==on&&u!==ya?Ui(o,de):(o.state=null,u===on?Ui(o,S1):Jt)):de}(this.strm),this.onEnd(a),this.ended=!0,a===Jt):s!==Ua||(this.onEnd(Jt),i.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Jt&&(this.result=E3(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const ms=30,af=12;function sf(t,e){let r,i,n,a,s,o,u,c,h,f;const m=t.state;r=t.next_in;const b=t.input,K=r+(t.avail_in-5);i=t.next_out;const I=t.output,U=i-(e-t.avail_out),G=i+(t.avail_out-257),Q=m.dmax,Y=m.wsize,R=m.whave,J=m.wnext,V=m.window;n=m.hold,a=m.bits;const X=m.lencode,d=m.distcode,y=(1<>>24,n>>>=o,a-=o,o=s>>>16&255,o===0)I[i++]=65535&s;else{if(!(16&o)){if((64&o)==0){s=X[(65535&s)+(n&(1<>>=o,a-=o),a<15&&(n+=b[r++]<>>24,n>>>=o,a-=o,o=s>>>16&255,!(16&o)){if((64&o)==0){s=d[(65535&s)+(n&(1<Q){t.msg="invalid distance too far back",m.mode=ms;break t}if(n>>>=o,a-=o,o=i-U,c>o){if(o=c-o,o>R&&m.sane){t.msg="invalid distance too far back",m.mode=ms;break t}if(h=0,f=V,J===0){if(h+=Y-o,o2;)I[i++]=f[h++],I[i++]=f[h++],I[i++]=f[h++],u-=3;u&&(I[i++]=f[h++],u>1&&(I[i++]=f[h++]))}else{h=i-c;do I[i++]=I[h++],I[i++]=I[h++],I[i++]=I[h++],u-=3;while(u>2);u&&(I[i++]=I[h++],u>1&&(I[i++]=I[h++]))}break}}break}}while(r>3,r-=u,a-=u<<3,n&=(1<=1&&_[G]===0;G--);if(Q>G&&(Q=G),G===0)return n[a++]=20971520,n[a++]=20971520,o.bits=1,0;for(U=1;U0&&(t===c2||G!==1))return-1;for(g[1]=0,K=1;Ks2||t===u2&&V>o2)return 1;for(;;){p=K-R,s[I]b?(E=nt[st+s[I]],D=d[y+s[I]]):(E=96,D=0),c=1<>R)+h]=p<<24|E<<16|D|0;while(h!==0);for(c=1<>=1;if(c!==0?(X&=c-1,X+=c):X=0,I++,--_[K]==0){if(K===G)break;K=e[r+s[I]]}if(K>Q&&(X&q)!==f){for(R===0&&(R=Q),m+=U,Y=K-R,J=1<s2||t===u2&&V>o2)return 1;f=X&q,n[f]=Q<<24|Y<<16|m-a|0}}return X!==0&&(n[m+X]=K-R<<24|64<<16|0),o.bits=Q,0}const df=0,$3=1,L3=2,N3=1,h2=2,d2=3,f2=4,l2=5,p2=6,y2=7,b2=8,m2=9,g2=10,ao=11,Zr=12,m0=13,w2=14,g0=15,v2=16,_2=17,k2=18,A2=19,gs=20,ws=21,S2=22,E2=23,P2=24,x2=25,M2=26,w0=27,C2=28,D2=29,ae=30,ff=852,lf=592;function K2(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}class pf{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new rr(320),this.work=new rr(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function yf(t){let e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,function(r){let i;return r&&r.state?(i=r.state,r.total_in=r.total_out=i.total=0,r.msg="",i.wrap&&(r.adler=1&i.wrap),i.mode=N3,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new ro(ff),i.distcode=i.distdyn=new ro(lf),i.sane=1,i.back=-1,Jt):de}(t)):de}function bf(t,e){let r,i;return t?(i=new pf,t.state=i,i.window=null,r=function(n,a){let s,o;return n&&n.state?(o=n.state,a<0?(s=0,a=-a):(s=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?de:(o.window!==null&&o.wbits!==a&&(o.window=null),o.wrap=s,o.wbits=a,yf(n))):de}(t,e),r!==Jt&&(t.state=null),r):de}let v0,_0,R2=!0;function mf(t){if(R2){let e;for(v0=new ro(512),_0=new ro(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ma($3,t.lens,0,288,v0,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ma(L3,t.lens,0,32,_0,0,t.work,{bits:5}),R2=!1}t.lencode=v0,t.lenbits=9,t.distcode=_0,t.distbits=5}function j3(t,e,r,i){let n;const a=t.state;return a.window===null&&(a.wsize=1<=a.wsize?(Or(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),Or(a.window,e,r-i,n,a.wnext),(i-=n)?(Or(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=be(r.check,g,2,0),c=0,h=0,r.mode=h2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ae;break}if((15&c)!==Nn){t.msg="unknown compression method",r.mode=ae;break}if(c>>>=4,h-=4,V=8+(15&c),r.wbits===0)r.wbits=V;else if(V>r.wbits){t.msg="invalid window size",r.mode=ae;break}r.dmax=1<>8&1),512&r.flags&&(g[0]=255&c,g[1]=c>>>8&255,r.check=be(r.check,g,2,0)),c=0,h=0,r.mode=d2;case d2:for(;h<32;){if(o===0)break t;o--,c+=i[a++]<>>8&255,g[2]=c>>>16&255,g[3]=c>>>24&255,r.check=be(r.check,g,4,0)),c=0,h=0,r.mode=f2;case f2:for(;h<16;){if(o===0)break t;o--,c+=i[a++]<>8),512&r.flags&&(g[0]=255&c,g[1]=c>>>8&255,r.check=be(r.check,g,2,0)),c=0,h=0,r.mode=l2;case l2:if(1024&r.flags){for(;h<16;){if(o===0)break t;o--,c+=i[a++]<>>8&255,r.check=be(r.check,g,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=p2;case p2:if(1024&r.flags&&(b=r.length,b>o&&(b=o),b&&(r.head&&(V=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),Or(r.head.extra,i,a,b,V)),512&r.flags&&(r.check=be(r.check,i,b,a)),o-=b,a+=b,r.length-=b),r.length))break t;r.length=0,r.mode=y2;case y2:if(2048&r.flags){if(o===0)break t;b=0;do V=i[a+b++],r.head&&V&&r.length<65536&&(r.head.name+=String.fromCharCode(V));while(V&&b>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Zr;break;case g2:for(;h<32;){if(o===0)break t;o--,c+=i[a++]<>>=7&h,h-=7&h,r.mode=w0;break}for(;h<3;){if(o===0)break t;o--,c+=i[a++]<>>=1,h-=1,3&c){case 0:r.mode=w2;break;case 1:if(mf(r),r.mode=gs,e===ys){c>>>=2,h-=2;break t}break;case 2:r.mode=_2;break;case 3:t.msg="invalid block type",r.mode=ae}c>>>=2,h-=2;break;case w2:for(c>>>=7&h,h-=7&h;h<32;){if(o===0)break t;o--,c+=i[a++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=ae;break}if(r.length=65535&c,c=0,h=0,r.mode=g0,e===ys)break t;case g0:r.mode=v2;case v2:if(b=r.length,b){if(b>o&&(b=o),b>u&&(b=u),b===0)break t;Or(n,i,a,b,s),o-=b,a+=b,u-=b,s+=b,r.length-=b;break}r.mode=Zr;break;case _2:for(;h<14;){if(o===0)break t;o--,c+=i[a++]<>>=5,h-=5,r.ndist=1+(31&c),c>>>=5,h-=5,r.ncode=4+(15&c),c>>>=4,h-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ae;break}r.have=0,r.mode=k2;case k2:for(;r.have>>=3,h-=3}for(;r.have<19;)r.lens[p[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,d={bits:r.lenbits},X=Ma(df,r.lens,0,19,r.lencode,0,r.work,d),r.lenbits=d.bits,X){t.msg="invalid code lengths set",r.mode=ae;break}r.have=0,r.mode=A2;case A2:for(;r.have>>24,G=_>>>16&255,Q=65535&_,!(U<=h);){if(o===0)break t;o--,c+=i[a++]<>>=U,h-=U,r.lens[r.have++]=Q;else{if(Q===16){for(y=U+2;h>>=U,h-=U,r.have===0){t.msg="invalid bit length repeat",r.mode=ae;break}V=r.lens[r.have-1],b=3+(3&c),c>>>=2,h-=2}else if(Q===17){for(y=U+3;h>>=U,h-=U,V=0,b=3+(7&c),c>>>=3,h-=3}else{for(y=U+7;h>>=U,h-=U,V=0,b=11+(127&c),c>>>=7,h-=7}if(r.have+b>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ae;break}for(;b--;)r.lens[r.have++]=V}}if(r.mode===ae)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=ae;break}if(r.lenbits=9,d={bits:r.lenbits},X=Ma($3,r.lens,0,r.nlen,r.lencode,0,r.work,d),r.lenbits=d.bits,X){t.msg="invalid literal/lengths set",r.mode=ae;break}if(r.distbits=6,r.distcode=r.distdyn,d={bits:r.distbits},X=Ma(L3,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,d),r.distbits=d.bits,X){t.msg="invalid distances set",r.mode=ae;break}if(r.mode=gs,e===ys)break t;case gs:r.mode=ws;case ws:if(o>=6&&u>=258){t.next_out=s,t.avail_out=u,t.next_in=a,t.avail_in=o,r.hold=c,r.bits=h,sf(t,m),s=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,c=r.hold,h=r.bits,r.mode===Zr&&(r.back=-1);break}for(r.back=0;_=r.lencode[c&(1<>>24,G=_>>>16&255,Q=65535&_,!(U<=h);){if(o===0)break t;o--,c+=i[a++]<>Y)],U=_>>>24,G=_>>>16&255,Q=65535&_,!(Y+U<=h);){if(o===0)break t;o--,c+=i[a++]<>>=Y,h-=Y,r.back+=Y}if(c>>>=U,h-=U,r.back+=U,r.length=Q,G===0){r.mode=M2;break}if(32&G){r.back=-1,r.mode=Zr;break}if(64&G){t.msg="invalid literal/length code",r.mode=ae;break}r.extra=15&G,r.mode=S2;case S2:if(r.extra){for(y=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=E2;case E2:for(;_=r.distcode[c&(1<>>24,G=_>>>16&255,Q=65535&_,!(U<=h);){if(o===0)break t;o--,c+=i[a++]<>Y)],U=_>>>24,G=_>>>16&255,Q=65535&_,!(Y+U<=h);){if(o===0)break t;o--,c+=i[a++]<>>=Y,h-=Y,r.back+=Y}if(c>>>=U,h-=U,r.back+=U,64&G){t.msg="invalid distance code",r.mode=ae;break}r.offset=Q,r.extra=15&G,r.mode=P2;case P2:if(r.extra){for(y=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ae;break}r.mode=x2;case x2:if(u===0)break t;if(b=m-u,r.offset>b){if(b=r.offset-b,b>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ae;break}b>r.wnext?(b-=r.wnext,K=r.wsize-b):K=r.wnext-b,b>r.length&&(b=r.length),I=r.window}else I=n,K=s-r.offset,b=r.length;b>u&&(b=u),u-=b,r.length-=b;do n[s++]=I[K++];while(--b);r.length===0&&(r.mode=ws);break;case M2:if(u===0)break t;n[s++]=r.length,u--,r.mode=ws;break;case w0:if(r.wrap){for(;h<32;){if(o===0)break t;o--,c|=i[a++]<=0&&r.windowBits<16&&(r.windowBits=-r.windowBits,r.windowBits===0&&(r.windowBits=-15)),!(r.windowBits>=0&&r.windowBits<16)||e&&e.windowBits||(r.windowBits+=32),r.windowBits>15&&r.windowBits<48&&(15&r.windowBits)==0&&(r.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new O3,this.strm.avail_out=0;let i=bf(this.strm,r.windowBits);if(i!==Jt||(this.header=new wf,function(n,a){let s;n&&n.state&&(s=n.state,(2&s.wrap)==0||(s.head=a,a.done=!1))}(this.strm,this.header),r.dictionary&&(typeof r.dictionary=="string"?r.dictionary=V0(r.dictionary):r.dictionary instanceof ArrayBuffer&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw&&(i=I2(this.strm,r.dictionary),i!==Jt))))throw Error(Oa[i])}push(e,r){const{strm:i,options:{chunkSize:n,dictionary:a}}=this;let s,o,u=!1;if(this.ended)return!1;o=r===~~r?r:r===!0?we:$r,typeof e=="string"?i.input=function(c){const h=new Ir(c.length);for(let f=0,m=h.length;f0||i.avail_out===0)&&s!==ni);return s===ni&&(o=we),o===we?(s=function(c){if(!c||!c.state)return de;const h=c.state;return h.window&&(h.window=null),c.state=null,Jt}(this.strm),this.onEnd(s),this.ended=!0,s===Jt):o!==Ua||(this.onEnd(Jt),i.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Jt&&(this.result=E3(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var B2=[0,1,3,7,15,31,63,127,255],ma=function(t){this.stream=t,this.bitOffset=0,this.curByte=0,this.hasByte=!1};ma.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},ma.prototype.read=function(t){for(var e=0;t>0;){this._ensureByte();var r=8-this.bitOffset;if(t>=r)e<<=r,e|=B2[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,t-=r;else{e<<=t;var i=r-t;e|=(this.curByte&B2[t]<>i,this.bitOffset+=t,t=0}}return e},ma.prototype.seek=function(t){var e=t%8,r=(t-e)/8;this.bitOffset=e,this.stream.seek(r),this.hasByte=!1},ma.prototype.pi=function(){var t,e=new Uint8Array(6);for(t=0;t("00"+i.toString(16)).slice(-2)).join("")}(e)};var vf=ma,tn=function(){};tn.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},tn.prototype.read=function(t,e,r){for(var i=0;i>>0},this.updateCRC=function(e){t=t<<8^k0[255&(t>>>24^e)]},this.updateCRCRun=function(e,r){for(;r-- >0;)t=t<<8^k0[255&(t>>>24^e)]}}),T2=function(t,e){var r,i=t[e];for(r=e;r>0;r--)t[r]=t[r-1];return t[0]=i,i},se={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},Ei={};Ei[se.LAST_BLOCK]="Bad file checksum",Ei[se.NOT_BZIP_DATA]="Not bzip data",Ei[se.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",Ei[se.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",Ei[se.DATA_ERROR]="Data error",Ei[se.OUT_OF_MEMORY]="Out of memory",Ei[se.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var _e=function(t,e){var r=Ei[t]||"unknown error";e&&(r+=": "+e);var i=new TypeError(r);throw i.errorCode=t,i},ga=function(t,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(t,e)};ga.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new _f,!0):(this.writeCount=-1,!1)},ga.prototype._start_bunzip=function(t,e){var r=new Uint8Array(4);t.read(r,0,4)===4&&String.fromCharCode(r[0],r[1],r[2])==="BZh"||_e(se.NOT_BZIP_DATA,"bad magic");var i=r[3]-48;(i<1||i>9)&&_e(se.NOT_BZIP_DATA,"level out of range"),this.reader=new vf(t),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=e,this.streamCRC=0},ga.prototype._get_next_block=function(){var t,e,r,i=this.reader,n=i.pi();if(n==="177245385090")return!1;n!=="314159265359"&&_e(se.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&_e(se.OBSOLETE_INPUT);var a=i.read(24);a>this.dbufSize&&_e(se.DATA_ERROR,"initial position out of bounds");var s=i.read(16),o=new Uint8Array(256),u=0;for(t=0;t<16;t++)if(s&1<<15-t){var c=16*t;for(r=i.read(16),e=0;e<16;e++)r&1<<15-e&&(o[u++]=c+e)}var h=i.read(3);(h<2||h>6)&&_e(se.DATA_ERROR);var f=i.read(15);f===0&&_e(se.DATA_ERROR);var m=new Uint8Array(256);for(t=0;t=h&&_e(se.DATA_ERROR);b[t]=T2(m,e)}var K,I=u+2,U=[];for(e=0;e20)&&_e(se.DATA_ERROR),i.read(1);)i.read(1)?s--:s++;Y[t]=s}for(G=Q=Y[0],t=1;tQ?Q=Y[t]:Y[t]=f&&_e(se.DATA_ERROR),K=U[b[_++]]),t=K.minLen,e=i.read(t);t>K.maxLen&&_e(se.DATA_ERROR),!(e<=K.limit[t]);t++)e=e<<1|i.read(1);((e-=K.base[t])<0||e>=258)&&_e(se.DATA_ERROR);var p=K.permute[e];if(p!==0&&p!==1){if(d)for(d=0,y+s>this.dbufSize&&_e(se.DATA_ERROR),V[X=o[m[0]]]+=s;s--;)g[y++]=X;if(p>u)break;y>=this.dbufSize&&_e(se.DATA_ERROR),V[X=o[X=T2(m,t=p-1)]]++,g[y++]=X}else d||(d=1,s=0),s+=p===0?d:2*d,d<<=1}for((a<0||a>=y)&&_e(se.DATA_ERROR),e=0,t=0;t<256;t++)r=e+V[t],V[t]=e,e=r;for(t=0;t>=8,nt=-1),this.writePos=E,this.writeCurrent=D,this.writeCount=y,this.writeRun=nt,!0},ga.prototype._read_bunzip=function(t,e){var r,i,n;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,u=this.writeCount;this.outputsize;for(var c=this.writeRun;u;){for(u--,i=o,o=255&(s=a[s]),s>>=8,c++==3?(r=o,n=i,o=-1):(r=1,n=o),this.blockCRC.updateCRCRun(n,r);r--;)this.outputStream.writeByte(n),this.nextoutput++;o!=i&&(c=0)}return this.writeCount=u,this.blockCRC.getCRC()!==this.targetBlockCRC&&_e(se.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var kf=function(t){if("readByte"in t)return t;var e=new W3;return e.pos=0,e.readByte=function(){return t[this.pos++]},e.seek=function(r){this.pos=r},e.eof=function(){return this.pos>=t.length},e},Af=function(t){var e=new W3,r=!0;if(t)if(typeof t=="number")e.buffer=new Uint8Array(t),r=!1;else{if("writeByte"in t)return t;e.buffer=t,r=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(i){if(r&&this.pos>=this.buffer.length){var n=new Uint8Array(2*this.buffer.length);n.set(this.buffer),this.buffer=n}this.buffer[this.pos++]=i},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var i=new Uint8Array(this.pos);i.set(this.buffer.subarray(0,this.pos)),this.buffer=i}return this.buffer},e._coerced=!0,e},z2=function(t,e,r){for(var i=kf(t),n=Af(e),a=new ga(i,n);!("eof"in i)||!i.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&_e(se.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!r||!("eof"in i)||i.eof())break;a._start_bunzip(i,n)}if("getBuffer"in n)return n.getBuffer()};class Jn{static get tag(){return v.packet.literalData}constructor(e=new Date){this.format=v.literal.utf8,this.date=M.normalizeDate(e),this.text=null,this.data=null,this.filename=""}setText(e,r=v.literal.utf8){this.format=r,this.text=e,this.data=null}getText(e=!1){return(this.text===null||M.isStream(this.text))&&(this.text=M.decodeUTF8(M.nativeEOL(this.getBytes(e)))),this.text}setBytes(e,r){this.format=r,this.data=e,this.text=null}getBytes(e=!1){return this.data===null&&(this.data=M.canonicalizeEOL(M.encodeUTF8(this.text))),e?Un(this.data):this.data}setFilename(e){this.filename=e}getFilename(){return this.filename}async read(e){await Ko(e,async r=>{const i=await r.readByte(),n=await r.readByte();this.filename=M.decodeUTF8(await r.readBytes(n)),this.date=M.readDate(await r.readBytes(4));let a=r.remainder();ce(a)&&(a=await he(a)),this.setBytes(a,i)})}writeHeader(){const e=M.encodeUTF8(this.filename),r=new Uint8Array([e.length]),i=new Uint8Array([this.format]),n=M.writeDate(this.date);return M.concatUint8Array([i,r,e,n])}write(){const e=this.writeHeader(),r=this.getBytes();return M.concat([e,r])}}const na=Symbol("verified"),Sf=new Set([v.signatureSubpacket.issuer,v.signatureSubpacket.issuerFingerprint,v.signatureSubpacket.embeddedSignature]);class Ee{static get tag(){return v.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 Oi,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[na]=null}read(e){let r=0;if(this.version=e[r++],this.version!==4&&this.version!==5)throw new fe(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[r++],this.publicKeyAlgorithm=e[r++],this.hashAlgorithm=e[r++],r+=this.readSubPackets(e.subarray(r,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,r),r+=this.readSubPackets(e.subarray(r,e.length),!1),this.signedHashValue=e.subarray(r,r+2),r+=2,this.params=At.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(r,e.length))}writeParams(){return this.params instanceof Promise?Ni(async()=>At.serializeParams(this.publicKeyAlgorithm,await this.params)):At.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()),M.concat(e)}async sign(e,r,i=new Date,n=!1){e.version===5?this.version=5:this.version=4;const a=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=M.normalizeDate(i),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),a.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=M.concat(a);const s=this.toHash(this.signatureType,r,n),o=await this.hash(this.signatureType,r,s,n);this.signedHashValue=Se(pn(o),0,2);const u=async()=>At.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,s,await he(o));M.isStream(o)?this.params=u():(this.params=await u(),this[na]=!0)}writeHashedSubPackets(){const e=v.signatureSubpacket,r=[];let i;if(this.created===null)throw Error("Missing signature creation time");r.push(re(e.signatureCreationTime,!0,M.writeDate(this.created))),this.signatureExpirationTime!==null&&r.push(re(e.signatureExpirationTime,!0,M.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&r.push(re(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(i=new Uint8Array([this.trustLevel,this.trustAmount]),r.push(re(e.trustSignature,!0,i))),this.regularExpression!==null&&r.push(re(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&r.push(re(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&r.push(re(e.keyExpirationTime,!0,M.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.preferredSymmetricAlgorithms)),r.push(re(e.preferredSymmetricAlgorithms,!1,i))),this.revocationKeyClass!==null&&(i=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),i=M.concat([i,this.revocationKeyFingerprint]),r.push(re(e.revocationKey,!1,i))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||r.push(re(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach(({name:s,value:o,humanReadable:u,critical:c})=>{i=[new Uint8Array([u?128:0,0,0,0])];const h=M.encodeUTF8(s);i.push(M.writeNumber(h.length,2)),i.push(M.writeNumber(o.length,2)),i.push(h),i.push(o),i=M.concat(i),r.push(re(e.notationData,c,i))}),this.preferredHashAlgorithms!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.preferredHashAlgorithms)),r.push(re(e.preferredHashAlgorithms,!1,i))),this.preferredCompressionAlgorithms!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.preferredCompressionAlgorithms)),r.push(re(e.preferredCompressionAlgorithms,!1,i))),this.keyServerPreferences!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.keyServerPreferences)),r.push(re(e.keyServerPreferences,!1,i))),this.preferredKeyServer!==null&&r.push(re(e.preferredKeyServer,!1,M.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&r.push(re(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&r.push(re(e.policyURI,!1,M.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.keyFlags)),r.push(re(e.keyFlags,!0,i))),this.signersUserID!==null&&r.push(re(e.signersUserID,!1,M.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(i=M.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),r.push(re(e.reasonForRevocation,!0,i))),this.features!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.features)),r.push(re(e.features,!1,i))),this.signatureTargetPublicKeyAlgorithm!==null&&(i=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],i.push(M.stringToUint8Array(this.signatureTargetHash)),i=M.concat(i),r.push(re(e.signatureTarget,!0,i))),this.embeddedSignature!==null&&r.push(re(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(i=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],i=M.concat(i),r.push(re(e.issuerFingerprint,this.version===5,i))),this.preferredAEADAlgorithms!==null&&(i=M.stringToUint8Array(M.uint8ArrayToString(this.preferredAEADAlgorithms)),r.push(re(e.preferredAEADAlgorithms,!1,i)));const n=M.concat(r),a=M.writeNumber(n.length,2);return M.concat([a,n])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach(n=>{e.push(ts(n.length)),e.push(n)});const r=M.concat(e),i=M.writeNumber(r.length,2);return M.concat([i,r])}readSubPacket(e,r=!0){let i=0;const n=!!(128&e[i]),a=127&e[i];if(r||(this.unhashedSubpackets.push(e.subarray(i,e.length)),Sf.has(a)))switch(i++,a){case v.signatureSubpacket.signatureCreationTime:this.created=M.readDate(e.subarray(i,e.length));break;case v.signatureSubpacket.signatureExpirationTime:{const s=M.readNumber(e.subarray(i,e.length));this.signatureNeverExpires=s===0,this.signatureExpirationTime=s;break}case v.signatureSubpacket.exportableCertification:this.exportable=e[i++]===1;break;case v.signatureSubpacket.trustSignature:this.trustLevel=e[i++],this.trustAmount=e[i++];break;case v.signatureSubpacket.regularExpression:this.regularExpression=e[i];break;case v.signatureSubpacket.revocable:this.revocable=e[i++]===1;break;case v.signatureSubpacket.keyExpirationTime:{const s=M.readNumber(e.subarray(i,e.length));this.keyExpirationTime=s,this.keyNeverExpires=s===0;break}case v.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(i,e.length)];break;case v.signatureSubpacket.revocationKey:this.revocationKeyClass=e[i++],this.revocationKeyAlgorithm=e[i++],this.revocationKeyFingerprint=e.subarray(i,i+20);break;case v.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(i,e.length));break;case v.signatureSubpacket.notationData:{const s=!!(128&e[i]);i+=4;const o=M.readNumber(e.subarray(i,i+2));i+=2;const u=M.readNumber(e.subarray(i,i+2));i+=2;const c=M.decodeUTF8(e.subarray(i,i+o)),h=e.subarray(i+o,i+o+u);this.rawNotations.push({name:c,humanReadable:s,value:h,critical:n}),s&&(this.notations[c]=M.decodeUTF8(h));break}case v.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(i,e.length)];break;case v.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(i,e.length)];break;case v.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(i,e.length)];break;case v.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=M.decodeUTF8(e.subarray(i,e.length));break;case v.signatureSubpacket.primaryUserID:this.isPrimaryUserID=e[i++]!==0;break;case v.signatureSubpacket.policyURI:this.policyURI=M.decodeUTF8(e.subarray(i,e.length));break;case v.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(i,e.length)];break;case v.signatureSubpacket.signersUserID:this.signersUserID=M.decodeUTF8(e.subarray(i,e.length));break;case v.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[i++],this.reasonForRevocationString=M.decodeUTF8(e.subarray(i,e.length));break;case v.signatureSubpacket.features:this.features=[...e.subarray(i,e.length)];break;case v.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[i++],this.signatureTargetHashAlgorithm=e[i++];const s=At.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=M.uint8ArrayToString(e.subarray(i,i+s));break}case v.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Ee,this.embeddedSignature.read(e.subarray(i,e.length));break;case v.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[i++],this.issuerFingerprint=e.subarray(i,e.length),this.issuerKeyVersion===5?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case v.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(i,e.length)];break;default:{const s=Error("Unknown signature subpacket type "+a);if(n)throw s;M.printDebug(s)}}}readSubPackets(e,r=!0,i){const n=M.readNumber(e.subarray(0,2));let a=2;for(;a<2+n;){const s=h3(e.subarray(a,e.length));a+=s.offset,this.readSubPacket(e.subarray(a,a+s.len),r,i),a+=s.len}return a}toSign(e,r){const i=v.signature;switch(e){case i.binary:return r.text!==null?M.encodeUTF8(r.getText(!0)):r.getBytes(!0);case i.text:{const n=r.getBytes(!0);return M.canonicalizeEOL(n)}case i.standalone:return new Uint8Array(0);case i.certGeneric:case i.certPersona:case i.certCasual:case i.certPositive:case i.certRevocation:{let n,a;if(r.userID)a=180,n=r.userID;else{if(!r.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");a=209,n=r.userAttribute}const s=n.write();return M.concat([this.toSign(i.key,r),new Uint8Array([a]),M.writeNumber(s.length,4),s])}case i.subkeyBinding:case i.subkeyRevocation:case i.keyBinding:return M.concat([this.toSign(i.key,r),this.toSign(i.key,{key:r.bind})]);case i.key:if(r.key===void 0)throw Error("Key packet is required for this signature.");return r.key.writeForHash(this.version);case i.keyRevocation:return this.toSign(i.key,r);case i.timestamp:return new Uint8Array(0);case i.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,r){let i=0;return oe(pn(this.signatureData),n=>{i+=n.length},()=>{const n=[];return this.version!==5||this.signatureType!==v.signature.binary&&this.signatureType!==v.signature.text||(r?n.push(new Uint8Array(6)):n.push(e.writeHeader())),n.push(new Uint8Array([this.version,255])),this.version===5&&n.push(new Uint8Array(4)),n.push(M.writeNumber(i,4)),M.concat(n)})}toHash(e,r,i=!1){const n=this.toSign(e,r);return M.concat([n,this.signatureData,this.calculateTrailer(r,i)])}async hash(e,r,i,n=!1){return i||(i=this.toHash(e,r,n)),At.hash.digest(this.hashAlgorithm,i)}async verify(e,r,i,n=new Date,a=!1,s=vt){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=r===v.signature.binary||r===v.signature.text;if(!(this[na]&&!o)){let c,h;if(this.hashed?h=await this.hashed:(c=this.toHash(r,i,a),h=await this.hash(r,i,c)),h=await he(h),this.signedHashValue[0]!==h[0]||this.signedHashValue[1]!==h[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[na]=await At.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,c,h),!this[na])throw Error("Signature verification failed")}const u=M.normalizeDate(n);if(u&&this.created>u)throw Error("Signature creation time is in the future");if(u&&u>=this.getExpirationTime())throw Error("Signature is expired");if(s.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+v.read(v.hash,this.hashAlgorithm).toUpperCase());if(s.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[v.signature.binary,v.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+v.read(v.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach(({name:c,critical:h})=>{if(h&&s.knownNotations.indexOf(c)<0)throw Error("Unknown critical notation: "+c)}),this.revocationKeyClass!==null)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const r=M.normalizeDate(e);return r!==null&&!(this.created<=r&&rEe.prototype.calculateTrailer.apply(await this.correspondingSig,e))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==v.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 Ef(t,e){if(!e[t]){let r;try{r=v.read(v.packet,t)}catch{throw new fe("Unknown packet type with tag: "+t)}throw Error("Packet not allowed in this context: "+r)}return new e[t]}ur.prototype.hash=Ee.prototype.hash,ur.prototype.toHash=Ee.prototype.toHash,ur.prototype.toSign=Ee.prototype.toSign;class Qt extends Array{static async fromBinary(e,r,i=vt){const n=new Qt;return await n.read(e,r,i),n}async read(e,r,i=vt){this.stream=ci(e,async(a,s)=>{const o=We(s);try{for(;;)if(await o.ready,await E5(a,async u=>{try{if(u.tag===v.packet.marker||u.tag===v.packet.trust)return;const c=Ef(u.tag,r);c.packets=new Qt,c.fromStream=M.isStream(u.packet),await c.read(u.packet,i),await o.write(c)}catch(c){const h=!i.ignoreUnsupportedPackets&&c instanceof fe,f=!(i.ignoreMalformedPackets||c instanceof fe);if(h||f||Us(u.tag))await o.abort(c);else{const m=new N0(u.tag,u.packet);await o.write(m)}M.printDebugError(c)}}))return await o.ready,void await o.close()}catch(u){await o.abort(u)}});const n=Nr(this.stream);for(;;){const{done:a,value:s}=await n.read();if(a?this.stream=null:this.push(s),a||Us(s.constructor.tag))break}n.releaseLock()}write(){const e=[];for(let r=0;r{if(a.push(u),s+=u.length,s>=o){const c=Math.min(Math.log(s)/Math.LN2|0,30),h=2**c,f=M.concat([S5(c)].concat(a));return a=[f.subarray(1+h)],s=a[0].length,f.subarray(0,1+h)}},()=>M.concat([ts(s)].concat(a))))}else{if(M.isStream(n)){let a=0;e.push(oe(pn(n),s=>{a+=s.length},()=>Fc(i,a)))}else e.push(Fc(i,n.length));e.push(n)}}return M.concat(e)}filterByTag(...e){const r=new Qt,i=n=>a=>n===a;for(let n=0;nr.constructor.tag===e)}indexOfTag(...e){const r=[],i=this,n=a=>s=>a===s;for(let a=0;a{this.algorithm=await i.readByte(),this.compressed=i.remainder(),await this.decompress(r)})}write(){return this.compressed===null&&this.compress(),M.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(e=vt){const r=v.read(v.compression,this.algorithm),i=Mf[r];if(!i)throw Error(r+" decompression not supported");this.packets=await Qt.fromBinary(i(this.compressed),Pf,e)}compress(){const e=v.read(v.compression,this.algorithm),r=xf[e];if(!r)throw Error(e+" compression not supported");this.compressed=r(this.packets.write(),this.deflateLevel)}}const Kr=M.getNodeZlib();function q2(t){return t}function so(t,e,r={}){return function(i){return!M.isStream(i)||ce(i)?Ni(()=>he(i).then(n=>new Promise((a,s)=>{t(n,r,(o,u)=>{if(o)return s(o);a(u)})}))):Do(b1(i).pipe(e(r)))}}function oo(t,e={}){return function(r){const i=new t(e);return oe(r,n=>{if(n.length)return i.push(n,Ua),i.result},()=>{if(t===Z0)return i.push([],we),i.result})}}function F2(t){return function(e){return Ni(async()=>t(await he(e)))}}const xf=Kr?{zip:(t,e)=>so(Kr.deflateRaw,Kr.createDeflateRaw,{level:e})(t),zlib:(t,e)=>so(Kr.deflate,Kr.createDeflate,{level:e})(t)}:{zip:(t,e)=>oo(Z0,{raw:!0,level:e})(t),zlib:(t,e)=>oo(Z0,{level:e})(t)},Mf=Kr?{uncompressed:q2,zip:so(Kr.inflateRaw,Kr.createInflateRaw),zlib:so(Kr.inflate,Kr.createInflate),bzip2:F2(z2)}:{uncompressed:q2,zip:oo(U2,{raw:!0}),zlib:oo(U2),bzip2:F2(z2)},Cf=M.constructAllowedPackets([Jn,is,ur,Ee]);class H3{static get tag(){return v.packet.symEncryptedIntegrityProtectedData}constructor(){this.version=1,this.encrypted=null,this.packets=null}async read(e){await Ko(e,async r=>{const i=await r.readByte();if(i!==1)throw new fe(`Version ${i} of the SEIP packet is unsupported.`);this.encrypted=r.remainder()})}write(){return M.concat([new Uint8Array([1]),this.encrypted])}async encrypt(e,r,i=vt){const{blockSize:n}=At.getCipher(e);let a=this.packets.write();ce(a)&&(a=await he(a));const s=await At.getPrefixRandom(e),o=new Uint8Array([211,20]),u=M.concat([s,a,o]),c=await At.hash.sha1(Un(u)),h=M.concat([u,c]);return this.encrypted=await At.mode.cfb.encrypt(e,r,h,new Uint8Array(n),i),!0}async decrypt(e,r,i=vt){const{blockSize:n}=At.getCipher(e);let a=pn(this.encrypted);ce(a)&&(a=await he(a));const s=await At.mode.cfb.decrypt(e,r,a,new Uint8Array(n)),o=Se(Un(s),-20),u=Se(s,0,-20),c=Promise.all([he(await At.hash.sha1(Un(u))),he(o)]).then(([m,b])=>{if(!M.equalsUint8Array(m,b))throw Error("Modification detected.");return new Uint8Array}),h=Se(u,n+2);let f=Se(h,0,-2);return f=Ne([f,Ni(()=>c)]),M.isStream(a)&&i.allowUnauthenticatedStream||(f=await he(f)),this.packets=await Qt.fromBinary(f,Cf,i),!0}}const Df=M.constructAllowedPackets([Jn,is,ur,Ee]);class qo{static get tag(){return v.packet.aeadEncryptedData}constructor(){this.version=1,this.cipherAlgorithm=null,this.aeadAlgorithm=v.aead.eax,this.chunkSizeByte=null,this.iv=null,this.encrypted=null,this.packets=null}async read(e){await Ko(e,async r=>{const i=await r.readByte();if(i!==1)throw new fe(`Version ${i} of the AEAD-encrypted data packet is not supported.`);this.cipherAlgorithm=await r.readByte(),this.aeadAlgorithm=await r.readByte(),this.chunkSizeByte=await r.readByte();const n=At.getAEADMode(this.aeadAlgorithm);this.iv=await r.readBytes(n.ivLength),this.encrypted=r.remainder()})}write(){return M.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.iv,this.encrypted])}async decrypt(e,r,i=vt){this.packets=await Qt.fromBinary(await this.crypt("decrypt",r,pn(this.encrypted)),Df,i)}async encrypt(e,r,i=vt){this.cipherAlgorithm=e;const{ivLength:n}=At.getAEADMode(this.aeadAlgorithm);this.iv=At.random.getRandomBytes(n),this.chunkSizeByte=i.aeadChunkSizeByte;const a=this.packets.write();this.encrypted=await this.crypt("encrypt",r,a)}async crypt(e,r,i){const n=At.getAEADMode(this.aeadAlgorithm),a=await n(this.cipherAlgorithm,r),s=e==="decrypt"?n.tagLength:0,o=e==="encrypt"?n.tagLength:0,u=2**(this.chunkSizeByte+6)+s,c=new ArrayBuffer(21),h=new Uint8Array(c,0,13),f=new Uint8Array(c),m=new DataView(c),b=new Uint8Array(c,5,8);h.set([192|qo.tag,this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte],0);let K=0,I=Promise.resolve(),U=0,G=0;const Q=this.iv;return ci(i,async(Y,R)=>{if(M.isStream(Y)!=="array"){const X=new $n({},{highWaterMark:M.getHardwareConcurrency()*2**(this.chunkSizeByte+6),size:d=>d.length});Fi(X.readable,R),R=X.writable}const J=Nr(Y),V=We(R);try{for(;;){let X=await J.readBytes(u+s)||new Uint8Array;const d=X.subarray(X.length-s);let y,_;if(X=X.subarray(0,X.length-s),!K||X.length?(J.unshift(d),y=a[e](X,n.getNonce(Q,b),h),G+=X.length-s+o):(m.setInt32(17,U),y=a[e](d,n.getNonce(Q,b),f),G+=o,_=!0),U+=X.length-s,I=I.then(()=>y).then(async g=>{await V.ready,await V.write(g),G-=g.length}).catch(g=>V.abort(g)),(_||G>V.desiredSize)&&await I,_){await V.close();break}m.setInt32(9,++K)}}catch(X){await V.abort(X)}})}}class Y0{static get tag(){return v.packet.publicKeyEncryptedSessionKey}constructor(){this.version=3,this.publicKeyID=new Oi,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}read(e){if(this.version=e[0],this.version!==3)throw new fe(`Version ${this.version} of the PKESK packet is unsupported.`);this.publicKeyID.read(e.subarray(1,e.length)),this.publicKeyAlgorithm=e[9],this.encrypted=At.parseEncSessionKeyParams(this.publicKeyAlgorithm,e.subarray(10))}write(){const e=[new Uint8Array([this.version]),this.publicKeyID.write(),new Uint8Array([this.publicKeyAlgorithm]),At.serializeParams(this.publicKeyAlgorithm,this.encrypted)];return M.concatUint8Array(e)}async encrypt(e){const r=M.concatUint8Array([new Uint8Array([v.write(v.symmetric,this.sessionKeyAlgorithm)]),this.sessionKey,M.writeChecksum(this.sessionKey)]),i=v.write(v.publicKey,this.publicKeyAlgorithm);this.encrypted=await At.publicKeyEncrypt(i,e.publicParams,r,e.getFingerprintBytes())}async decrypt(e,r){if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Decryption error");const i=r?M.concatUint8Array([new Uint8Array([r.sessionKeyAlgorithm]),r.sessionKey,M.writeChecksum(r.sessionKey)]):null,n=await At.publicKeyDecrypt(this.publicKeyAlgorithm,e.publicParams,e.privateParams,this.encrypted,e.getFingerprintBytes(),i),a=n[0],s=n.subarray(1,n.length-2),o=n.subarray(n.length-2),u=M.writeChecksum(s),c=u[0]===o[0]&u[1]===o[1];if(r){const h=c&a===r.sessionKeyAlgorithm&s.length===r.sessionKey.length;this.sessionKeyAlgorithm=M.selectUint8(h,a,r.sessionKeyAlgorithm),this.sessionKey=M.selectUint8Array(h,s,r.sessionKey)}else{if(!(c&&v.read(v.symmetric,a)))throw Error("Decryption error");this.sessionKey=s,this.sessionKeyAlgorithm=a}}}class Ca{constructor(e=vt){this.algorithm=v.hash.sha256,this.type="iterated",this.c=e.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let r=0;switch(this.type=v.read(v.s2k,e[r++]),this.algorithm=e[r++],this.type){case"simple":break;case"salted":this.salt=e.subarray(r,r+8),r+=8;break;case"iterated":this.salt=e.subarray(r,r+8),r+=8,this.c=e[r++];break;case"gnu":if(M.uint8ArrayToString(e.subarray(r,r+3))!=="GNU")throw Error("Unknown s2k type.");if(r+=3,1e3+e[r++]!==1001)throw Error("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw Error("Unknown s2k type.")}return r}write(){if(this.type==="gnu-dummy")return new Uint8Array([101,0,...M.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([v.write(v.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 M.concatUint8Array(e)}async produceKey(e,r){e=M.encodeUTF8(e);const i=[];let n=0,a=0;for(;n{this.privateParams[e].fill(0),delete this.privateParams[e]}),this.privateParams=null,this.isEncrypted=!0)}}async function O2(t,e,r){const{keySize:i}=At.getCipher(r);return t.produceKey(e,i)}var If=jr(function(t){(function(e){function r(n){function a(){return Et0&&(ot.semantic=" "),ot}}function Y(at,ot){return function(){var pt,_t,Kt,xt,St;for(xt=s(),pt=c("star"),Kt=0,St=ot===void 0?0:ot;(_t=at())!==null;)Kt+=1,f(pt,_t);return Kt>=St?pt:(o(xt),null)}}function R(at){return at.charCodeAt(0)>=128}function J(){return h("cr",b("\r")())}function V(){return h("crlf",K(J,y)())}function X(){return h("dquote",b('"')())}function d(){return h("htab",b(" ")())}function y(){return h("lf",b(` `)())}function _(){return h("sp",b(" ")())}function g(){return h("vchar",m(function(at){var ot=at.charCodeAt(0),pt=33<=ot&&ot<=126;return n.rfc6532&&(pt=pt||R(at)),pt}))}function p(){return h("wsp",I(_,d)())}function E(){var at=h("quoted-pair",I(K(b("\\"),I(g,p)),F)());return at===null?null:(at.semantic=at.semantic[1],at)}function D(){return h("fws",I(L,K(U(K(Y(p),G(V))),Y(p,1)))())}function nt(){return h("ctext",I(function(){return m(function(at){var ot=at.charCodeAt(0),pt=33<=ot&&ot<=39||42<=ot&&ot<=91||93<=ot&&ot<=126;return n.rfc6532&&(pt=pt||R(at)),pt})},gt)())}function st(){return h("ccontent",I(nt,E,q)())}function q(){return h("comment",K(b("("),Y(K(U(D),st)),U(D),b(")"))())}function rt(){return h("cfws",I(K(Y(K(U(D),q),1),U(D)),D)())}function ct(){return h("atext",m(function(at){var ot="a"<=at&&at<="z"||"A"<=at&&at<="Z"||"0"<=at&&at<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(at)>=0;return n.rfc6532&&(ot=ot||R(at)),ot}))}function lt(){return h("atom",K(Q(U(rt)),Y(ct,1),Q(U(rt)))())}function ut(){var at,ot;return(at=h("dot-atom-text",Y(ct,1)()))===null||(ot=Y(K(b("."),Y(ct,1)))())!==null&&f(at,ot),at}function dt(){return h("dot-atom",K(G(U(rt)),ut,G(U(rt)))())}function wt(){return h("qtext",I(function(){return m(function(at){var ot=at.charCodeAt(0),pt=ot===33||35<=ot&&ot<=91||93<=ot&&ot<=126;return n.rfc6532&&(pt=pt||R(at)),pt})},O)())}function mt(){return h("qcontent",I(wt,E)())}function B(){return h("quoted-string",K(G(U(rt)),G(X),Y(K(U(Q(D)),mt)),U(G(D)),G(X),G(U(rt)))())}function Z(){return h("word",I(lt,B)())}function x(){return h("address",I(l,tt)())}function l(){return h("mailbox",I(z,yt)())}function z(){return h("name-addr",K(U(it),et)())}function et(){return h("angle-addr",I(K(G(U(rt)),b("<"),yt,b(">"),G(U(rt))),N)())}function tt(){return h("group",K(it,b(":"),U(A),b(";"),G(U(rt)))())}function it(){return h("display-name",((at=h("phrase",I(j,Y(Z,1))()))!==null&&(at.semantic=function(ot){return ot.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(at.semantic)),at));var at}function k(){return h("mailbox-list",I(K(l,Y(K(b(","),l))),S)())}function w(){return h("address-list",I(K(x,Y(K(b(","),x))),bt)())}function A(){return h("group-list",I(k,G(rt),ht)())}function C(){return h("local-part",I(Pt,dt,B)())}function $(){return h("dtext",I(function(){return m(function(at){var ot=at.charCodeAt(0),pt=33<=ot&&ot<=90||94<=ot&&ot<=126;return n.rfc6532&&(pt=pt||R(at)),pt})},Dt)())}function T(){return h("domain-literal",K(G(U(rt)),b("["),Y(K(U(D),$)),U(D),b("]"),G(U(rt)))())}function W(){return h("domain",(at=I(Lt,dt,T)(),n.rejectTLD&&at&&at.semantic&&at.semantic.indexOf(".")<0?null:(at&&(at.semantic=at.semantic.replace(/\s+/g,"")),at)));var at}function yt(){return h("addr-spec",K(C,b("@"),W)())}function ft(){return n.strict?null:h("obs-NO-WS-CTL",m(function(at){var ot=at.charCodeAt(0);return 1<=ot&&ot<=8||ot===11||ot===12||14<=ot&&ot<=31||ot===127}))}function gt(){return n.strict?null:h("obs-ctext",ft())}function O(){return n.strict?null:h("obs-qtext",ft())}function F(){return n.strict?null:h("obs-qp",K(b("\\"),I(b("\0"),ft,y,J))())}function j(){return n.strict?null:n.atInDisplayName?h("obs-phrase",K(Z,Y(I(Z,b("."),b("@"),Q(rt))))()):h("obs-phrase",K(Z,Y(I(Z,b("."),Q(rt))))())}function L(){return n.strict?null:h("obs-FWS",Y(K(G(U(V)),p),1)())}function N(){return n.strict?null:h("obs-angle-addr",K(G(U(rt)),b("<"),H,yt,b(">"),G(U(rt)))())}function H(){return n.strict?null:h("obs-route",K(P,b(":"))())}function P(){return n.strict?null:h("obs-domain-list",K(Y(I(G(rt),b(","))),b("@"),W,Y(K(b(","),G(U(rt)),U(K(b("@"),W)))))())}function S(){return n.strict?null:h("obs-mbox-list",K(Y(K(G(U(rt)),b(","))),l,Y(K(b(","),U(K(l,G(rt))))))())}function bt(){return n.strict?null:h("obs-addr-list",K(Y(K(G(U(rt)),b(","))),x,Y(K(b(","),U(K(x,G(rt))))))())}function ht(){return n.strict?null:h("obs-group-list",K(Y(K(G(U(rt)),b(",")),1),G(U(rt)))())}function Pt(){return n.strict?null:h("obs-local-part",K(Z,Y(K(b("."),Z)))())}function Lt(){return n.strict?null:h("obs-domain",K(lt,Y(K(b("."),lt)))())}function Dt(){return n.strict?null:h("obs-dtext",I(ft,E)())}function Ct(at,ot){var pt,_t,Kt;if(ot==null)return null;for(_t=[ot];_t.length>0;){if((Kt=_t.pop()).name===at)return Kt;for(pt=Kt.children.length-1;pt>=0;pt-=1)_t.push(Kt.children[pt])}return null}function Xt(at,ot){var pt,_t,Kt,xt,St;if(ot==null)return null;for(_t=[ot],xt=[],St={},pt=0;pt0;)if((Kt=_t.pop()).name in St)xt.push(Kt);else for(pt=Kt.children.length-1;pt>=0;pt-=1)_t.push(Kt.children[pt]);return xt}function zt(at){var ot,pt,_t,Kt,xt;if(at===null)return null;for(ot=[],pt=Xt(["group","mailbox"],at),_t=0;_t1?null:St.addresses&&St.addresses[0]}(xt):n.simple?xt&&xt.addresses:xt}function Ot(at){var ot,pt=Ct("display-name",at),_t=[],Kt=Xt(["mailbox"],at);for(ot=0;ot0;)for((Ue=Ie.pop()).name===Ht&&Fe.push(Ue),Gt=Ue.children.length-1;Gt>=0;Gt-=1)Ie.push(Ue.children[Gt]);return Fe}("cfws",at),Kt=Xt(["comment"],at),xt=Ct("local-part",pt),St=Ct("domain",pt);return{node:at,parts:{name:ot,address:pt,local:xt,domain:St,comments:_t},type:at.name,name:Mt(ot),address:Mt(pt),local:Mt(xt),domain:Mt(St),comments:Rt(Kt),groupName:Mt(at.groupName)}}function Mt(at){return at!=null?at.semantic:null}function Rt(at){var ot="";if(at)for(var pt=0;pt`),r.userID=i.join(" "),r}read(e,r=vt){const i=M.decodeUTF8(e);if(i.length>r.maxUserIDLength)throw Error("User ID string is too long");try{const{name:n,address:a,comments:s}=If.parseOneAddress({input:i,atInDisplayName:!0});this.comment=s.replace(/^\(|\)$/g,""),this.name=n,this.email=a}catch{}this.userID=i}write(){return M.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class D1 extends Fo{static get tag(){return v.packet.secretSubkey}constructor(e=new Date,r=vt){super(e,r)}}class G3{constructor(e){this.packets=e||new Qt}write(){return this.packets.write()}armor(e=vt){return Za(v.armor.signature,this.write(),void 0,void 0,void 0,e)}getSigningKeyIDs(){return this.packets.map(e=>e.issuerKeyID)}}async function V3(t,e){const r=new D1(t.date,e);return r.packets=null,r.algorithm=v.write(v.publicKey,t.algorithm),await r.generate(t.rsaBits,t.curve),await r.computeFingerprintAndKeyID(),r}async function Uf(t,e){const r=new Fo(t.date,e);return r.packets=null,r.algorithm=v.write(v.publicKey,t.algorithm),await r.generate(t.rsaBits,t.curve,t.config),await r.computeFingerprintAndKeyID(),r}async function Er(t,e,r,i,n=new Date,a){let s,o;for(let u=t.length-1;u>=0;u--)try{(!s||t[u].created>=s.created)&&(await t[u].verify(e,r,i,n,void 0,a),s=t[u])}catch(c){o=c}if(!s)throw M.wrapError(`Could not find valid ${v.read(v.signature,r)} signature in key ${e.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,(u,c,h)=>c+" "+h.toLowerCase()),o);return s}function Q0(t,e,r=new Date){const i=M.normalizeDate(r);if(i!==null){const n=co(t,e);return!(t.created<=i&&i0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1),await a.sign(e,n,r.date),a}async function $o(t,e,r=new Date,i={},n){let a=n.preferredHashAlgorithm,s=a;if(t){const o=await t.getPrimaryUser(r,i,n);o.selfCertification.preferredHashAlgorithms&&([s]=o.selfCertification.preferredHashAlgorithms,a=At.hash.getHashByteLength(a)<=At.hash.getHashByteLength(s)?s:a)}switch(Object.getPrototypeOf(e)){case Fo.prototype:case sr.prototype:case D1.prototype:case ns.prototype:switch(e.algorithm){case v.publicKey.ecdh:case v.publicKey.ecdsa:case v.publicKey.eddsa:s=At.publicKey.elliptic.getPreferredHashAlgo(e.publicParams.oid)}}return At.hash.getHashByteLength(a)<=At.hash.getHashByteLength(s)?s:a}async function X0(t,e=[],r=new Date,i=[],n=vt){const a={symmetric:v.symmetric.aes128,aead:v.aead.eax,compression:v.compression.uncompressed}[t],s={symmetric:n.preferredSymmetricAlgorithm,aead:n.preferredAEADAlgorithm,compression:n.preferredCompressionAlgorithm}[t],o={symmetric:"preferredSymmetricAlgorithms",aead:"preferredAEADAlgorithms",compression:"preferredCompressionAlgorithms"}[t];return(await Promise.all(e.map(async function(u,c){const h=(await u.getPrimaryUser(r,i[c],n)).selfCertification[o];return!!h&&h.indexOf(s)>=0}))).every(Boolean)?s:a}async function bn(t,e,r,i,n,a,s=[],o=!1,u){if(r.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!r.isDecrypted())throw Error("Signing key is not decrypted.");const c=new Ee;return Object.assign(c,i),c.publicKeyAlgorithm=r.algorithm,c.hashAlgorithm=await $o(e,r,n,a,u),c.rawNotations=s,await c.sign(r,t,n,o),c}async function dn(t,e,r,i=new Date,n){(t=t[r])&&(e[r].length?await Promise.all(t.map(async function(a){a.isExpired(i)||n&&!await n(a)||e[r].some(function(s){return M.equalsUint8Array(s.writeParams(),a.writeParams())})||e[r].push(a)})):e[r]=t)}async function Wn(t,e,r,i,n,a,s=new Date,o){a=a||t;const u=[];return await Promise.all(i.map(async function(c){try{n&&!c.issuerKeyID.equals(n.issuerKeyID)||(await c.verify(a,e,r,o.revocationsExpire?s:null,!1,o),u.push(c.issuerKeyID))}catch{}})),n?(n.revoked=!!u.some(c=>c.equals(n.issuerKeyID))||n.revoked||!1,n.revoked):u.length>0}function co(t,e){let r;return e.keyNeverExpires===!1&&(r=t.created.getTime()+1e3*e.keyExpirationTime),r?new Date(r):1/0}function J0(t,e={}){switch(t.type=t.type||e.type,t.curve=t.curve||e.curve,t.rsaBits=t.rsaBits||e.rsaBits,t.keyExpirationTime=t.keyExpirationTime!==void 0?t.keyExpirationTime:e.keyExpirationTime,t.passphrase=M.isString(t.passphrase)?t.passphrase:e.passphrase,t.date=t.date||e.date,t.sign=t.sign||!1,t.type){case"ecc":try{t.curve=v.write(v.curve,t.curve)}catch{throw Error("Unknown curve")}t.curve!==v.curve.ed25519&&t.curve!==v.curve.curve25519||(t.curve=t.sign?v.curve.ed25519:v.curve.curve25519),t.sign?t.algorithm=t.curve===v.curve.ed25519?v.publicKey.eddsa:v.publicKey.ecdsa:t.algorithm=v.publicKey.ecdh;break;case"rsa":t.algorithm=v.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+t.type)}return t}function $2(t,e){const r=t.algorithm;return r!==v.publicKey.rsaEncrypt&&r!==v.publicKey.elgamal&&r!==v.publicKey.ecdh&&(!e.keyFlags||(e.keyFlags[0]&v.keyFlags.signData)!=0)}function L2(t,e){const r=t.algorithm;return r!==v.publicKey.dsa&&r!==v.publicKey.rsaSign&&r!==v.publicKey.ecdsa&&r!==v.publicKey.eddsa&&(!e.keyFlags||(e.keyFlags[0]&v.keyFlags.encryptCommunication)!=0||(e.keyFlags[0]&v.keyFlags.encryptStorage)!=0)}function N2(t,e){return!!e.allowInsecureDecryptionWithSigningKeys||!t.keyFlags||(t.keyFlags[0]&v.keyFlags.encryptCommunication)!=0||(t.keyFlags[0]&v.keyFlags.encryptStorage)!=0}function Dn(t,e){const r=v.write(v.publicKey,t.algorithm),i=t.getAlgorithmInfo();if(e.rejectPublicKeyAlgorithms.has(r))throw Error(i.algorithm+" keys are considered too weak.");switch(r){case v.publicKey.rsaEncryptSign:case v.publicKey.rsaSign:case v.publicKey.rsaEncrypt:if(i.bitsh.getKeys(u).length>0);return c.length===0?null:(await Promise.all(c.map(async h=>{const f=await h.getSigningKey(u,e.created,void 0,n);if(e.revoked||await a.isRevoked(e,f.keyPacket,i,n))throw Error("User certificate is revoked");try{await e.verify(f.keyPacket,v.signature.certGeneric,o,i,void 0,n)}catch(m){throw M.wrapError("User certificate is invalid",m)}})),!0)}async verifyAllCertifications(e,r=new Date,i){const n=this,a=this.selfCertifications.concat(this.otherCertifications);return Promise.all(a.map(async s=>({keyID:s.issuerKeyID,valid:await n.verifyCertificate(s,e,r,i).catch(()=>!1)})))}async verify(e=new Date,r){if(!this.selfCertifications.length)throw Error("No self-certifications found");const i=this,n=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:n};let s;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const u=this.selfCertifications[o];if(u.revoked||await i.isRevoked(u,void 0,e,r))throw Error("Self-certification is revoked");try{await u.verify(n,v.signature.certGeneric,a,e,void 0,r)}catch(c){throw M.wrapError("Self-certification is invalid",c)}return!0}catch(u){s=u}throw s}async update(e,r,i){const n=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:n};await dn(e,this,"selfCertifications",r,async function(s){try{return await s.verify(n,v.signature.certGeneric,a,r,!1,i),!0}catch{return!1}}),await dn(e,this,"otherCertifications",r),await dn(e,this,"revocationSignatures",r,function(s){return Wn(n,v.signature.certRevocation,a,[s],void 0,void 0,r,i)})}async revoke(e,{flag:r=v.reasonForRevocation.noReason,string:i=""}={},n=new Date,a=vt){const s={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new Da(s.userID||s.userAttribute,this.mainKey);return o.revocationSignatures.push(await bn(s,null,e,{signatureType:v.signature.certRevocation,reasonForRevocationFlag:v.write(v.reasonForRevocation,r),reasonForRevocationString:i},n,void 0,void 0,!1,a)),await o.update(this),o}}class Hn{constructor(e,r){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=r}toPacketList(){const e=new Qt;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new Hn(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,r,i=new Date,n=vt){const a=this.mainKey.keyPacket;return Wn(a,v.signature.subkeyRevocation,{key:a,bind:this.keyPacket},this.revocationSignatures,e,r,i,n)}async verify(e=new Date,r=vt){const i=this.mainKey.keyPacket,n={key:i,bind:this.keyPacket},a=await Er(this.bindingSignatures,i,v.signature.subkeyBinding,n,e,r);if(a.revoked||await this.isRevoked(a,null,e,r))throw Error("Subkey is revoked");if(Q0(this.keyPacket,a,e))throw Error("Subkey is expired");return a}async getExpirationTime(e=new Date,r=vt){const i=this.mainKey.keyPacket,n={key:i,bind:this.keyPacket};let a;try{a=await Er(this.bindingSignatures,i,v.signature.subkeyBinding,n,e,r)}catch{return null}const s=co(this.keyPacket,a),o=a.getExpirationTime();return sa.bindingSignatures[u].created&&(a.bindingSignatures[u]=o),!1;try{return await o.verify(n,v.signature.subkeyBinding,s,r,void 0,i),!0}catch{return!1}}),await dn(e,this,"revocationSignatures",r,function(o){return Wn(n,v.signature.subkeyRevocation,s,[o],void 0,void 0,r,i)})}async revoke(e,{flag:r=v.reasonForRevocation.noReason,string:i=""}={},n=new Date,a=vt){const s={key:e,bind:this.keyPacket},o=new Hn(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await bn(s,null,e,{signatureType:v.signature.subkeyRevocation,reasonForRevocationFlag:v.write(v.reasonForRevocation,r),reasonForRevocationString:i},n,void 0,void 0,!1,a)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(t=>{Hn.prototype[t]=function(){return this.keyPacket[t]()}});const Bf=M.constructAllowedPackets([Ee]),j2=new Set([v.packet.publicKey,v.packet.privateKey]),W2=new Set([v.packet.publicKey,v.packet.privateKey,v.packet.publicSubkey,v.packet.privateSubkey]);class Y3{packetListToStructure(e,r=new Set){let i,n,a,s;for(const o of e){if(o instanceof N0){W2.has(o.tag)&&!s&&(s=j2.has(o.tag)?j2:W2);continue}const u=o.constructor.tag;if(s){if(!s.has(u))continue;s=null}if(r.has(u))throw Error("Unexpected packet type: "+u);switch(u){case v.packet.publicKey:case v.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 v.packet.userID:case v.packet.userAttribute:i=new Da(o,this),this.users.push(i);break;case v.packet.publicSubkey:case v.packet.secretSubkey:i=null,a=new Hn(o,this),this.subkeys.push(a);break;case v.packet.signature:switch(o.signatureType){case v.signature.certGeneric:case v.signature.certPersona:case v.signature.certCasual:case v.signature.certPositive:if(!i){M.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(n)?i.selfCertifications.push(o):i.otherCertifications.push(o);break;case v.signature.certRevocation:i?i.revocationSignatures.push(o):this.directSignatures.push(o);break;case v.signature.key:this.directSignatures.push(o);break;case v.signature.subkeyBinding:if(!a){M.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}a.bindingSignatures.push(o);break;case v.signature.keyRevocation:this.revocationSignatures.push(o);break;case v.signature.subkeyRevocation:if(!a){M.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}a.revocationSignatures.push(o)}}}}toPacketList(){const e=new Qt;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map(r=>e.push(...r.toPacketList())),this.subkeys.map(r=>e.push(...r.toPacketList())),e}clone(e=!1){const r=new this.constructor(this.toPacketList());return e&&r.getKeys().forEach(i=>{if(i.keyPacket=Object.create(Object.getPrototypeOf(i.keyPacket),Object.getOwnPropertyDescriptors(i.keyPacket)),!i.keyPacket.isDecrypted())return;const n={};Object.keys(i.keyPacket.privateParams).forEach(a=>{n[a]=new Uint8Array(i.keyPacket.privateParams[a])}),i.keyPacket.privateParams=n}),r}getSubkeys(e=null){return this.subkeys.filter(r=>!e||r.getKeyID().equals(e,!0))}getKeys(e=null){const r=[];return e&&!this.getKeyID().equals(e,!0)||r.push(this),r.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=>e!==null)}write(){return this.toPacketList().write()}async getSigningKey(e=null,r=new Date,i={},n=vt){await this.verifyPrimaryKey(r,i,n);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(r,n);const c={key:a,bind:u.keyPacket},h=await Er(u.bindingSignatures,a,v.signature.subkeyBinding,c,r,n);if(!$2(u.keyPacket,h))continue;if(!h.embeddedSignature)throw Error("Missing embedded signature");return await Er([h.embeddedSignature],u.keyPacket,v.signature.keyBinding,c,r,n),Dn(u.keyPacket,n),u}catch(c){o=c}try{const u=await this.getPrimaryUser(r,i,n);if((!e||a.getKeyID().equals(e))&&$2(a,u.selfCertification))return Dn(a,n),this}catch(u){o=u}throw M.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,r=new Date,i={},n=vt){await this.verifyPrimaryKey(r,i,n);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(r,n);const c={key:a,bind:u.keyPacket},h=await Er(u.bindingSignatures,a,v.signature.subkeyBinding,c,r,n);if(L2(u.keyPacket,h))return Dn(u.keyPacket,n),u}catch(c){o=c}try{const u=await this.getPrimaryUser(r,i,n);if((!e||a.getKeyID().equals(e))&&L2(a,u.selfCertification))return Dn(a,n),this}catch(u){o=u}throw M.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,r,i=new Date,n=vt){return Wn(this.keyPacket,v.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,r,i,n)}async verifyPrimaryKey(e=new Date,r={},i=vt){const n=this.keyPacket;if(await this.isRevoked(null,null,e,i))throw Error("Primary key is revoked");const{selfCertification:a}=await this.getPrimaryUser(e,r,i);if(Q0(n,a,e))throw Error("Primary key is expired");const s=await Er(this.directSignatures,n,v.signature.key,{key:n},e,i).catch(()=>{});if(s&&Q0(n,s,e))throw Error("Primary key is expired")}async getExpirationTime(e,r=vt){let i;try{const{selfCertification:n}=await this.getPrimaryUser(null,e,r),a=co(this.keyPacket,n),s=n.getExpirationTime(),o=await Er(this.directSignatures,this.keyPacket,v.signature.key,{key:this.keyPacket},null,r).catch(()=>{});if(o){const u=co(this.keyPacket,o);i=Math.min(a,s,u)}else i=ae.subkeys.some(s=>a.hasSameFingerprintAs(s)))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,i)}const n=this.clone();return await dn(e,n,"revocationSignatures",r,a=>Wn(n.keyPacket,v.signature.keyRevocation,n,[a],null,e.keyPacket,r,i)),await dn(e,n,"directSignatures",r),await Promise.all(e.users.map(async a=>{const s=n.users.filter(o=>a.userID&&a.userID.equals(o.userID)||a.userAttribute&&a.userAttribute.equals(o.userAttribute));if(s.length>0)await Promise.all(s.map(o=>o.update(a,r,i)));else{const o=a.clone();o.mainKey=n,n.users.push(o)}})),await Promise.all(e.subkeys.map(async a=>{const s=n.subkeys.filter(o=>o.hasSameFingerprintAs(a));if(s.length>0)await Promise.all(s.map(o=>o.update(a,r,i)));else{const o=a.clone();o.mainKey=n,n.subkeys.push(o)}})),n}async getRevocationCertificate(e=new Date,r=vt){const i={key:this.keyPacket},n=await Er(this.revocationSignatures,this.keyPacket,v.signature.keyRevocation,i,e,r),a=new Qt;return a.push(n),Za(v.armor.publicKey,a.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,r=new Date,i=vt){const n=await Va(e,i),a=(await Qt.fromBinary(n.data,Bf,i)).findPacket(v.packet.signature);if(!a||a.signatureType!==v.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!a.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await a.verify(this.keyPacket,v.signature.keyRevocation,{key:this.keyPacket},r,void 0,i)}catch(o){throw M.wrapError("Could not verify revocation signature",o)}const s=this.clone();return s.revocationSignatures.push(a),s}async signPrimaryUser(e,r,i,n=vt){const{index:a,user:s}=await this.getPrimaryUser(r,i,n),o=await s.certify(e,r,n),u=this.clone();return u.users[a]=o,u}async signAllUsers(e,r=new Date,i=vt){const n=this.clone();return n.users=await Promise.all(this.users.map(function(a){return a.certify(e,r,i)})),n}async verifyPrimaryUser(e,r=new Date,i,n=vt){const a=this.keyPacket,{user:s}=await this.getPrimaryUser(r,i,n);return e?await s.verifyAllCertifications(e,r,n):[{keyID:a.getKeyID(),valid:await s.verify(r,n).catch(()=>!1)}]}async verifyAllUsers(e,r=new Date,i=vt){const n=this.keyPacket,a=[];return await Promise.all(this.users.map(async s=>{const o=e?await s.verifyAllCertifications(e,r,i):[{keyID:n.getKeyID(),valid:await s.verify(r,i).catch(()=>!1)}];a.push(...o.map(u=>({userID:s.userID.userID,keyID:u.keyID,valid:u.valid})))})),a}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach(t=>{Y3.prototype[t]=Hn.prototype[t]});class t1 extends Y3{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([v.packet.secretKey,v.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=vt){return Za(v.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class as extends t1{constructor(e){if(super(),this.packetListToStructure(e,new Set([v.packet.publicKey,v.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Qt,r=this.toPacketList();for(const i of r)switch(i.constructor.tag){case v.packet.secretKey:{const n=sr.fromSecretKeyPacket(i);e.push(n);break}case v.packet.secretSubkey:{const n=ns.fromSecretSubkeyPacket(i);e.push(n);break}default:e.push(i)}return new t1(e)}armor(e=vt){return Za(v.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,r=new Date,i={},n=vt){const a=this.keyPacket,s=[];for(let u=0;ue.isDecrypted())}async validate(e=vt){if(!this.isPrivate())throw Error("Cannot validate a public key");let r;if(this.keyPacket.isDummy()){const i=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});i&&!i.keyPacket.isDummy()&&(r=i.keyPacket)}else r=this.keyPacket;if(r)return r.validate();{const i=this.getKeys();if(i.map(n=>n.keyPacket.isDummy()).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(i.map(async n=>n.keyPacket.validate()))}}clearPrivateParams(){this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})}async revoke({flag:e=v.reasonForRevocation.noReason,string:r=""}={},i=new Date,n=vt){if(!this.isPrivate())throw Error("Need private key for revoking");const a={key:this.keyPacket},s=this.clone();return s.revocationSignatures.push(await bn(a,null,this.keyPacket,{signatureType:v.signature.keyRevocation,reasonForRevocationFlag:v.write(v.reasonForRevocation,e),reasonForRevocationString:r},i,void 0,void 0,void 0,n)),s}async addSubkey(e={}){const r={...vt,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBitsK!==b)]}const c=Oo.fromObject(s),h={};h.userID=c,h.key=t;const f=new Ee;return f.signatureType=v.signature.certGeneric,f.publicKeyAlgorithm=t.algorithm,f.hashAlgorithm=await $o(null,t,void 0,void 0,i),f.keyFlags=[v.keyFlags.certifyKeys|v.keyFlags.signData],f.preferredSymmetricAlgorithms=u([v.symmetric.aes256,v.symmetric.aes128,v.symmetric.aes192],i.preferredSymmetricAlgorithm),i.aeadProtect&&(f.preferredAEADAlgorithms=u([v.aead.eax,v.aead.ocb],i.preferredAEADAlgorithm)),f.preferredHashAlgorithms=u([v.hash.sha256,v.hash.sha512],i.preferredHashAlgorithm),f.preferredCompressionAlgorithms=u([v.compression.zlib,v.compression.zip,v.compression.uncompressed],i.preferredCompressionAlgorithm),o===0&&(f.isPrimaryUserID=!0),f.features=[0],f.features[0]|=v.features.modificationDetection,i.aeadProtect&&(f.features[0]|=v.features.aead),i.v5Keys&&(f.features[0]|=v.features.v5Keys),r.keyExpirationTime>0&&(f.keyExpirationTime=r.keyExpirationTime,f.keyNeverExpires=!1),await f.sign(t,h,r.date),{userIDPacket:c,signaturePacket:f}})).then(s=>{s.forEach(({userIDPacket:o,signaturePacket:u})=>{n.push(o),n.push(u)})}),await Promise.all(e.map(async function(s,o){const u=r.subkeys[o];return{secretSubkeyPacket:s,subkeySignaturePacket:await Z3(s,t,u,i)}})).then(s=>{s.forEach(({secretSubkeyPacket:o,subkeySignaturePacket:u})=>{n.push(o),n.push(u)})});const a={key:t};return n.push(await bn(a,null,t,{signatureType:v.signature.keyRevocation,reasonForRevocationFlag:v.reasonForRevocation.noReason,reasonForRevocationString:""},r.date,void 0,void 0,void 0,i)),r.passphrase&&t.clearPrivateParams(),await Promise.all(e.map(async function(s,o){r.subkeys[o].passphrase&&s.clearPrivateParams()})),new as(n)}async function W6({armoredKey:t,binaryKey:e,config:r,...i}){if(r={...vt,...r},!t&&!e)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(t&&!M.isString(t))throw Error("readKey: options.armoredKey must be a string");if(e&&!M.isUint8Array(e))throw Error("readKey: options.binaryKey must be a Uint8Array");const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));let a;if(t){const{type:s,data:o}=await Va(t,r);if(s!==v.armor.publicKey&&s!==v.armor.privateKey)throw Error("Armored text not of type key");a=o}else a=e;return Tf(await Qt.fromBinary(a,Q3,r))}async function H6({armoredKey:t,binaryKey:e,config:r,...i}){if(r={...vt,...r},!t&&!e)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(t&&!M.isString(t))throw Error("readPrivateKey: options.armoredKey must be a string");if(e&&!M.isUint8Array(e))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));let a;if(t){const{type:o,data:u}=await Va(t,r);if(o!==v.armor.privateKey)throw Error("Armored text not of type private key");a=u}else a=e;const s=await Qt.fromBinary(a,Q3,r);return new as(s)}const qf=M.constructAllowedPackets([Jn,is,qo,H3,Rf,Y0,jn,ur,Ee]),Ff=M.constructAllowedPackets([jn]),Of=M.constructAllowedPackets([Ee]);class er{constructor(e){this.packets=e||new Qt}getEncryptionKeyIDs(){const e=[];return this.packets.filterByTag(v.packet.publicKeyEncryptedSessionKey).forEach(function(r){e.push(r.publicKeyID)}),e}getSigningKeyIDs(){const e=this.unwrapCompressed(),r=e.packets.filterByTag(v.packet.onePassSignature);return r.length>0?r.map(i=>i.issuerKeyID):e.packets.filterByTag(v.packet.signature).map(i=>i.issuerKeyID)}async decrypt(e,r,i,n=new Date,a=vt){const s=i||await this.decryptSessionKeys(e,r,n,a),o=this.packets.filterByTag(v.packet.symmetricallyEncryptedData,v.packet.symEncryptedIntegrityProtectedData,v.packet.aeadEncryptedData);if(o.length===0)throw Error("No encrypted data found");const u=o[0];let c=null;const h=Promise.all(s.map(async({algorithm:m,data:b})=>{if(!M.isUint8Array(b)||!M.isString(m))throw Error("Invalid session key for decryption.");try{const K=v.write(v.symmetric,m);await u.decrypt(K,b,a)}catch(K){M.printDebugError(K),c=K}}));if(B0(u.encrypted),u.encrypted=null,await h,!u.packets||!u.packets.length)throw c||Error("Decryption failed.");const f=new er(u.packets);return u.packets=new Qt,f}async decryptSessionKeys(e,r,i=new Date,n=vt){let a,s=[];if(r){const o=this.packets.filterByTag(v.packet.symEncryptedSessionKey);if(o.length===0)throw Error("No symmetrically encrypted session key packet found.");await Promise.all(r.map(async function(u,c){let h;h=c?await Qt.fromBinary(o.write(),Ff,n):o,await Promise.all(h.map(async function(f){try{await f.decrypt(u),s.push(f)}catch(m){M.printDebugError(m)}}))}))}else{if(!e)throw Error("No key or password specified.");{const o=this.packets.filterByTag(v.packet.publicKeyEncryptedSessionKey);if(o.length===0)throw Error("No public key encrypted session key packet found.");await Promise.all(o.map(async function(u){await Promise.all(e.map(async function(c){let h=[v.symmetric.aes256,v.symmetric.aes128,v.symmetric.tripledes,v.symmetric.cast5];try{const m=await c.getPrimaryUser(i,void 0,n);m.selfCertification.preferredSymmetricAlgorithms&&(h=h.concat(m.selfCertification.preferredSymmetricAlgorithms))}catch{}const f=(await c.getDecryptionKeys(u.publicKeyID,null,void 0,n)).map(m=>m.keyPacket);await Promise.all(f.map(async function(m){if(!(!m||m.isDummy())){if(!m.isDecrypted())throw Error("Decryption key is not decrypted.");if(n.constantTimePKCS1Decryption&&(u.publicKeyAlgorithm===v.publicKey.rsaEncrypt||u.publicKeyAlgorithm===v.publicKey.rsaEncryptSign||u.publicKeyAlgorithm===v.publicKey.rsaSign||u.publicKeyAlgorithm===v.publicKey.elgamal)){const b=u.write();await Promise.all(Array.from(n.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map(async K=>{const I=new Y0;I.read(b);const U={sessionKeyAlgorithm:K,sessionKey:At.generateSessionKey(K)};try{await I.decrypt(m,U),s.push(I)}catch(G){M.printDebugError(G),a=G}}))}else try{if(await u.decrypt(m),!h.includes(v.write(v.symmetric,u.sessionKeyAlgorithm)))throw Error("A non-preferred symmetric algorithm was used.");s.push(u)}catch(b){M.printDebugError(b),a=b}}}))})),B0(u.encrypted),u.encrypted=null}))}}if(s.length>0){if(s.length>1){const o=new Set;s=s.filter(u=>{const c=u.sessionKeyAlgorithm+M.uint8ArrayToString(u.sessionKey);return!o.has(c)&&(o.add(c),!0)})}return s.map(o=>({data:o.sessionKey,algorithm:v.read(v.symmetric,o.sessionKeyAlgorithm)}))}throw a||Error("Session key decryption failed.")}getLiteralData(){const e=this.unwrapCompressed().packets.findPacket(v.packet.literalData);return e&&e.getBytes()||null}getFilename(){const e=this.unwrapCompressed().packets.findPacket(v.packet.literalData);return e&&e.getFilename()||null}getText(){const e=this.unwrapCompressed().packets.findPacket(v.packet.literalData);return e?e.getText():null}static async generateSessionKey(e=[],r=new Date,i=[],n=vt){const a=await X0("symmetric",e,r,i,n),s=v.read(v.symmetric,a),o=n.aeadProtect&&await async function(u,c=new Date,h=[],f=vt){let m=!0;return await Promise.all(u.map(async function(b,K){const I=await b.getPrimaryUser(c,h[K],f);I.selfCertification.features&&I.selfCertification.features[0]&v.features.aead||(m=!1)})),m}(e,r,i,n)?v.read(v.aead,await X0("aead",e,r,i,n)):void 0;return{data:At.generateSessionKey(a),algorithm:s,aeadAlgorithm:o}}async encrypt(e,r,i,n=!1,a=[],s=new Date,o=[],u=vt){if(i){if(!M.isUint8Array(i.data)||!M.isString(i.algorithm))throw Error("Invalid session key for encryption.")}else if(e&&e.length)i=await er.generateSessionKey(e,s,o,u);else{if(!r||!r.length)throw Error("No keys, passwords, or session key provided.");i=await er.generateSessionKey(void 0,void 0,void 0,u)}const{data:c,algorithm:h,aeadAlgorithm:f}=i,m=await er.encryptSessionKey(c,h,f,e,r,n,a,s,o,u);let b;f?(b=new qo,b.aeadAlgorithm=v.write(v.aead,f)):b=new H3,b.packets=this.packets;const K=v.write(v.symmetric,h);return await b.encrypt(K,c,u),m.packets.push(b),b.packets=new Qt,m}static async encryptSessionKey(e,r,i,n,a,s=!1,o=[],u=new Date,c=[],h=vt){const f=new Qt,m=v.write(v.symmetric,r),b=i&&v.write(v.aead,i);if(n){const K=await Promise.all(n.map(async function(I,U){const G=await I.getEncryptionKey(o[U],u,c,h),Q=new Y0;return Q.publicKeyID=s?Oi.wildcard():G.getKeyID(),Q.publicKeyAlgorithm=G.keyPacket.algorithm,Q.sessionKey=e,Q.sessionKeyAlgorithm=m,await Q.encrypt(G.keyPacket),delete Q.sessionKey,Q}));f.push(...K)}if(a){const K=async function(Q,Y){try{return await Q.decrypt(Y),1}catch{return 0}},I=(Q,Y)=>Q+Y,U=async function(Q,Y,R,J){const V=new jn(h);return V.sessionKey=Q,V.sessionKeyAlgorithm=Y,R&&(V.aeadAlgorithm=R),await V.encrypt(J,h),h.passwordCollisionCheck&&(await Promise.all(a.map(X=>K(V,X)))).reduce(I)!==1?U(Q,Y,J):(delete V.sessionKey,V)},G=await Promise.all(a.map(Q=>U(e,m,b,Q)));f.push(...G)}return new er(f)}async sign(e=[],r=null,i=[],n=new Date,a=[],s=[],o=vt){const u=new Qt,c=this.packets.findPacket(v.packet.literalData);if(!c)throw Error("No literal data packet to sign.");let h,f;const m=c.text===null?v.signature.binary:v.signature.text;if(r)for(f=r.packets.filterByTag(v.packet.signature),h=f.length-1;h>=0;h--){const b=f[h],K=new ur;K.signatureType=b.signatureType,K.hashAlgorithm=b.hashAlgorithm,K.publicKeyAlgorithm=b.publicKeyAlgorithm,K.issuerKeyID=b.issuerKeyID,e.length||h!==0||(K.flags=1),u.push(K)}return await Promise.all(Array.from(e).reverse().map(async function(b,K){if(!b.isPrivate())throw Error("Need private key for signing");const I=i[e.length-1-K],U=await b.getSigningKey(I,n,a,o),G=new ur;return G.signatureType=m,G.hashAlgorithm=await $o(b,U.keyPacket,n,a,o),G.publicKeyAlgorithm=U.keyPacket.algorithm,G.issuerKeyID=U.getKeyID(),K===e.length-1&&(G.flags=1),G})).then(b=>{b.forEach(K=>u.push(K))}),u.push(c),u.push(...await H2(c,e,r,i,n,a,s,!1,o)),new er(u)}compress(e,r=vt){if(e===v.compression.uncompressed)return this;const i=new is(r);i.algorithm=e,i.packets=this.packets;const n=new Qt;return n.push(i),new er(n)}async signDetached(e=[],r=null,i=[],n=new Date,a=[],s=[],o=vt){const u=this.packets.findPacket(v.packet.literalData);if(!u)throw Error("No literal data packet to sign.");return new G3(await H2(u,e,r,i,n,a,s,!0,o))}async verify(e,r=new Date,i=vt){const n=this.unwrapCompressed(),a=n.packets.filterByTag(v.packet.literalData);if(a.length!==1)throw Error("Can only verify message with one literal data packet.");ce(n.packets.stream)&&n.packets.push(...await he(n.packets.stream,u=>u||[]));const s=n.packets.filterByTag(v.packet.onePassSignature).reverse(),o=n.packets.filterByTag(v.packet.signature);return s.length&&!o.length&&M.isStream(n.packets.stream)&&!ce(n.packets.stream)?(await Promise.all(s.map(async u=>{u.correspondingSig=new Promise((c,h)=>{u.correspondingSigResolve=c,u.correspondingSigReject=h}),u.signatureData=Ni(async()=>(await u.correspondingSig).signatureData),u.hashed=he(await u.hash(u.signatureType,a[0],void 0,!1)),u.hashed.catch(()=>{})})),n.packets.stream=ci(n.packets.stream,async(u,c)=>{const h=Nr(u),f=We(c);try{for(let m=0;m{b.correspondingSigReject(m)}),await f.abort(m)}}),A0(s,a,e,r,!1,i)):A0(o,a,e,r,!1,i)}verifyDetached(e,r,i=new Date,n=vt){const a=this.unwrapCompressed().packets.filterByTag(v.packet.literalData);if(a.length!==1)throw Error("Can only verify message with one literal data packet.");return A0(e.packets,a,r,i,!0,n)}unwrapCompressed(){const e=this.packets.filterByTag(v.packet.compressedData);return e.length?new er(e[0].packets):this}async appendSignature(e,r=vt){await this.packets.read(M.isUint8Array(e)?e:(await Va(e)).data,Of,r)}write(){return this.packets.write()}armor(e=vt){return Za(v.armor.message,this.write(),null,null,null,e)}}async function H2(t,e,r=null,i=[],n=new Date,a=[],s=[],o=!1,u=vt){const c=new Qt,h=t.text===null?v.signature.binary:v.signature.text;if(await Promise.all(e.map(async(f,m)=>{const b=a[m];if(!f.isPrivate())throw Error("Need private key for signing");const K=await f.getSigningKey(i[m],n,b,u);return bn(t,f,K.keyPacket,{signatureType:h},n,b,s,o,u)})).then(f=>{c.push(...f)}),r){const f=r.packets.filterByTag(v.packet.signature);c.push(...f)}return c}async function A0(t,e,r,i=new Date,n=!1,a=vt){return Promise.all(t.filter(function(s){return["text","binary"].includes(v.read(v.signature,s.signatureType))}).map(async function(s){return async function(o,u,c,h=new Date,f=!1,m=vt){let b,K;for(const G of c){const Q=G.getKeys(o.issuerKeyID);if(Q.length>0){b=G,K=Q[0];break}}const I=o instanceof ur?o.correspondingSig:o,U={keyID:o.issuerKeyID,verified:(async()=>{if(!K)throw Error("Could not find signing key with key ID "+o.issuerKeyID.toHex());await o.verify(K.keyPacket,o.signatureType,u[0],h,f,m);const G=await I;if(K.getCreationTime()>G.created)throw Error("Key is newer than the signature");try{await b.getSigningKey(K.getKeyID(),G.created,void 0,m)}catch(Q){if(!m.allowInsecureVerificationWithReformattedKeys||!Q.message.match(/Signature creation time is in the future/))throw Q;await b.getSigningKey(K.getKeyID(),h,void 0,m)}return!0})(),signature:(async()=>{const G=await I,Q=new Qt;return G&&Q.push(G),new G3(Q)})()};return U.signature.catch(()=>{}),U.verified.catch(()=>{}),U}(s,e,r,i,n,a)}))}async function G6({armoredMessage:t,binaryMessage:e,config:r,...i}){r={...vt,...r};let n=t||e;if(!n)throw Error("readMessage: must pass options object containing `armoredMessage` or `binaryMessage`");if(t&&!M.isString(t)&&!M.isStream(t))throw Error("readMessage: options.armoredMessage must be a string or stream");if(e&&!M.isUint8Array(e)&&!M.isStream(e))throw Error("readMessage: options.binaryMessage must be a Uint8Array or stream");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));const s=M.isStream(n);if(s&&(await Pu(),n=Ga(n)),t){const{type:c,data:h}=await Va(n,r);if(c!==v.armor.message)throw Error("Armored text not of type message");n=h}const o=await Qt.fromBinary(n,qf,r),u=new er(o);return u.fromStream=s,u}async function V6({text:t,binary:e,filename:r,date:i=new Date,format:n=t!==void 0?"utf8":"binary",...a}){let s=t!==void 0?t:e;if(s===void 0)throw Error("createMessage: must pass options object containing `text` or `binary`");if(t&&!M.isString(t)&&!M.isStream(t))throw Error("createMessage: options.text must be a string or stream");if(e&&!M.isUint8Array(e)&&!M.isStream(e))throw Error("createMessage: options.binary must be a Uint8Array or stream");const o=Object.keys(a);if(o.length>0)throw Error("Unknown option: "+o.join(", "));const u=M.isStream(s);u&&(await Pu(),s=Ga(s));const c=new Jn(i);t!==void 0?c.setText(s,v.write(v.literal,n)):c.setBytes(s,v.write(v.literal,n)),r!==void 0&&c.setFilename(r);const h=new Qt;h.push(c);const f=new er(h);return f.fromStream=u,f}async function Z6({userIDs:t=[],passphrase:e,type:r="ecc",rsaBits:i=4096,curve:n="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:u="armored",config:c,...h}){Lo(c={...vt,...c}),t=Ze(t);const f=Object.keys(h);if(f.length>0)throw Error("Unknown option: "+f.join(", "));if(t.length===0)throw Error("UserIDs are required for key generation");if(r==="rsa"&&iJ0(I.subkeys[V],I));let G=[Uf(I,U)];G=G.concat(I.subkeys.map(J=>V3(J,U)));const Q=await Promise.all(G),Y=await zf(Q[0],Q.slice(1),I,U),R=await Y.getRevocationCertificate(I.date,U);return Y.revocationSignatures=[],{key:Y,revocationCertificate:R}}(m,c);return b.getKeys().forEach(({keyPacket:I})=>Dn(I,c)),{privateKey:G2(b,u,c),publicKey:G2(b.toPublic(),u,c),revocationCertificate:K}}catch(b){throw M.wrapError("Error generating keypair",b)}}async function Y6({privateKey:t,passphrase:e,config:r,...i}){Lo(r={...vt,...r});const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));if(!t.isPrivate())throw Error("Cannot decrypt a public key");const a=t.clone(!0),s=M.isArray(e)?e:[e];try{return await Promise.all(a.getKeys().map(o=>M.anyPromise(s.map(u=>o.keyPacket.decrypt(u))))),await a.validate(r),a}catch(o){throw a.clearPrivateParams(),M.wrapError("Error decrypting private key",o)}}async function Q6({message:t,encryptionKeys:e,signingKeys:r,passwords:i,sessionKey:n,format:a="armored",signature:s=null,wildcard:o=!1,signingKeyIDs:u=[],encryptionKeyIDs:c=[],date:h=new Date,signingUserIDs:f=[],encryptionUserIDs:m=[],signatureNotations:b=[],config:K,...I}){if(Lo(K={...vt,...K}),X3(t),$f(a),e=Ze(e),r=Ze(r),i=Ze(i),u=Ze(u),c=Ze(c),f=Ze(f),m=Ze(m),b=Ze(b),I.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(I.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(I.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(I.armor!==void 0)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const U=Object.keys(I);if(U.length>0)throw Error("Unknown option: "+U.join(", "));r||(r=[]);const G=t.fromStream;try{if((r.length||s)&&(t=await t.sign(r,s,u,h,f,b,K)),t=t.compress(await X0("compression",e,h,m,K),K),t=await t.encrypt(e,i,n,o,c,h,m,K),a==="object")return t;const Q=a==="armored";return J3(Q?t.armor(K):t.write(),G,Q?"utf8":"binary")}catch(Q){throw M.wrapError("Error encrypting message",Q)}}async function X6({message:t,decryptionKeys:e,passwords:r,sessionKeys:i,verificationKeys:n,expectSigned:a=!1,format:s="utf8",signature:o=null,date:u=new Date,config:c,...h}){if(Lo(c={...vt,...c}),X3(t),n=Ze(n),e=Ze(e),r=Ze(r),i=Ze(i),h.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(h.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const f=Object.keys(h);if(f.length>0)throw Error("Unknown option: "+f.join(", "));try{const m=await t.decrypt(e,r,i,u,c);n||(n=[]);const b={};if(b.signatures=o?await m.verifyDetached(o,n,u,c):await m.verify(n,u,c),b.data=s==="binary"?m.getLiteralData():m.getText(),b.filename=m.getFilename(),Nf(b,t),a){if(n.length===0)throw Error("Verification keys are required to verify message signatures");if(b.signatures.length===0)throw Error("Message is not signed");b.data=Ne([b.data,Ni(async()=>{await M.anyPromise(b.signatures.map(K=>K.verified))})])}return b.data=await J3(b.data,t.fromStream,s),b}catch(m){throw M.wrapError("Error decrypting message",m)}}function X3(t){if(!(t instanceof er))throw Error("Parameter [message] needs to be of type Message")}function $f(t){if(t!=="armored"&&t!=="binary"&&t!=="object")throw Error("Unsupported format "+t)}const Lf=Object.keys(vt).length;function Lo(t){const e=Object.keys(t);if(e.length!==Lf){for(const r of e)if(vt[r]===void 0)throw Error("Unknown config property: "+r)}}function Ze(t){return t&&!M.isArray(t)&&(t=[t]),t}async function J3(t,e,r="utf8"){const i=M.isStream(t);return i==="array"?he(t):e==="node"?(t=b1(t),r!=="binary"&&t.setEncoding(r),t):e==="web"&&i==="ponyfill"?Su(t):t}function Nf(t,e){t.data=ci(e.packets.stream,async(r,i)=>{await Fi(t.data,i,{preventClose:!0});const n=We(i);try{await he(r,a=>a),await n.close()}catch(a){await n.abort(a)}})}function G2(t,e,r){switch(e){case"object":return t;case"armored":return t.armor(r);case"binary":return t.write();default:throw Error("Unsupported format "+e)}}/*! OpenPGP.js v5.7.0-1 - 2023-06-10 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */const Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:t=>`Symbol(${t})`;function K1(){}const V2=typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:void 0;function He(t){return typeof t=="object"&&t!==null||typeof t=="function"}const th=K1,R1=Promise,jf=Promise.prototype.then,Wf=Promise.resolve.bind(R1),Hf=Promise.reject.bind(R1);function ze(t){return new R1(t)}function ne(t){return Wf(t)}function Ut(t){return Hf(t)}function ai(t,e,r){return jf.call(t,e,r)}function hr(t,e,r){ai(ai(t,e,r),void 0,th)}function S0(t,e){hr(t,e)}function eh(t,e){hr(t,void 0,e)}function fn(t,e,r){return ai(t,e,r)}function ss(t){ai(t,void 0,th)}const rh=(()=>{const t=V2&&V2.queueMicrotask;if(typeof t=="function")return t;const e=ne(void 0);return r=>ai(e,r)})();function No(t,e,r){if(typeof t!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,e,r)}function wn(t,e,r){try{return ne(No(t,e,r))}catch(i){return Ut(i)}}class Lr{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 r=this._back;let i=r;r._elements.length===16383&&(i={_elements:[],_next:void 0}),r._elements.push(e),i!==r&&(this._back=i,r._next=i),++this._size}shift(){const e=this._front;let r=e;const i=this._cursor;let n=i+1;const a=e._elements,s=a[i];return n===16384&&(r=e._next,n=0),--this._size,this._cursor=n,e!==r&&(this._front=r),a[i]=void 0,s}forEach(e){let r=this._cursor,i=this._front,n=i._elements;for(;!(r===n.length&&i._next===void 0||r===n.length&&(i=i._next,n=i._elements,r=0,n.length===0));)e(n[r]),++r}peek(){const e=this._front,r=this._cursor;return e._elements[r]}}function ih(t,e){t._ownerReadableStream=e,e._reader=t,e._state==="readable"?e1(t):e._state==="closed"?function(r){e1(r),ah(r)}(t):nh(t,e._storedError)}function I1(t,e){return ln(t._ownerReadableStream,e)}function un(t){t._ownerReadableStream._state==="readable"?U1(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,r){nh(e,r)}(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._ownerReadableStream._reader=void 0,t._ownerReadableStream=void 0}function Gn(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function e1(t){t._closedPromise=ze((e,r)=>{t._closedPromise_resolve=e,t._closedPromise_reject=r})}function nh(t,e){e1(t),U1(t,e)}function U1(t,e){t._closedPromise_reject!==void 0&&(ss(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}function ah(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}const sh=Wt("[[AbortSteps]]"),oh=Wt("[[ErrorSteps]]"),B1=Wt("[[CancelSteps]]"),T1=Wt("[[PullSteps]]"),Z2=Number.isFinite||function(t){return typeof t=="number"&&isFinite(t)},Gf=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function si(t,e){if(t!==void 0&&typeof(r=t)!="object"&&typeof r!="function")throw new TypeError(e+" is not an object.");var r}function dr(t,e){if(typeof t!="function")throw new TypeError(e+" is not a function.")}function ch(t,e){if(!function(r){return typeof r=="object"&&r!==null||typeof r=="function"}(t))throw new TypeError(e+" is not an object.")}function fi(t,e,r){if(t===void 0)throw new TypeError(`Parameter ${e} is required in '${r}'.`)}function r1(t,e,r){if(t===void 0)throw new TypeError(`${e} is required in '${r}'.`)}function z1(t){return Number(t)}function Y2(t){return t===0?0:t}function uh(t,e){const r=Number.MAX_SAFE_INTEGER;let i=Number(t);if(i=Y2(i),!Z2(i))throw new TypeError(e+" is not a finite number");if(i=function(n){return Y2(Gf(n))}(i),i<0||i>r)throw new TypeError(`${e} is outside the accepted range of 0 to ${r}, inclusive`);return Z2(i)&&i!==0?i:0}function q1(t,e){if(!Pi(t))throw new TypeError(e+" is not a ReadableStream.")}function Os(t){return new uo(t)}function hh(t,e){t._reader._readRequests.push(e)}function F1(t,e,r){const i=t._reader._readRequests.shift();r?i._closeSteps():i._chunkSteps(e)}function jo(t){return t._reader._readRequests.length}function dh(t){const e=t._reader;return e!==void 0&&!!hn(e)}class uo{constructor(e){if(fi(e,1,"ReadableStreamDefaultReader"),q1(e,"First parameter"),Bi(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ih(this,e),this._readRequests=new Lr}get closed(){return hn(this)?this._closedPromise:Ut(vs("closed"))}cancel(e=void 0){return hn(this)?this._ownerReadableStream===void 0?Ut(Gn("cancel")):I1(this,e):Ut(vs("cancel"))}read(){if(!hn(this))return Ut(vs("read"));if(this._ownerReadableStream===void 0)return Ut(Gn("read from"));let e,r;const i=ze((n,a)=>{e=n,r=a});return Wo(this,{_chunkSteps:n=>e({value:n,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:n=>r(n)}),i}releaseLock(){if(!hn(this))throw vs("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");un(this)}}}function hn(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")}function Wo(t,e){const r=t._ownerReadableStream;r._disturbed=!0,r._state==="closed"?e._closeSteps():r._state==="errored"?e._errorSteps(r._storedError):r._readableStreamController[T1](e)}function vs(t){return new TypeError(`ReadableStreamDefaultReader.prototype.${t} can only be used on a ReadableStreamDefaultReader`)}let ho;Object.defineProperties(uo.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(uo.prototype,Wt.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),typeof Wt.asyncIterator=="symbol"&&(ho={[Wt.asyncIterator](){return this}},Object.defineProperty(ho,Wt.asyncIterator,{enumerable:!1}));class Vf{constructor(e,r){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=r}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?fn(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const r=()=>this._returnSteps(e);return this._ongoingPromise?fn(this._ongoingPromise,r,r):r()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(e._ownerReadableStream===void 0)return Ut(Gn("iterate"));let r,i;const n=ze((a,s)=>{r=a,i=s});return Wo(e,{_chunkSteps:a=>{this._ongoingPromise=void 0,rh(()=>r({value:a,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,un(e),r({value:void 0,done:!0})},_errorSteps:a=>{this._ongoingPromise=void 0,this._isFinished=!0,un(e),i(a)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const r=this._reader;if(r._ownerReadableStream===void 0)return Ut(Gn("finish iterating"));if(!this._preventCancel){const i=I1(r,e);return un(r),fn(i,()=>({value:e,done:!0}))}return un(r),ne({value:e,done:!0})}}const fh={next(){return Q2(this)?this._asyncIteratorImpl.next():Ut(X2("next"))},return(t){return Q2(this)?this._asyncIteratorImpl.return(t):Ut(X2("return"))}};function Q2(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl")}function X2(t){return new TypeError(`ReadableStreamAsyncIterator.${t} can only be used on a ReadableSteamAsyncIterator`)}ho!==void 0&&Object.setPrototypeOf(fh,ho);const lh=Number.isNaN||function(t){return t!=t};function ph(t){return!!function(e){return!(typeof e!="number"||lh(e)||e<0)}(t)&&t!==1/0}function i1(t){const e=t._queue.shift();return t._queueTotalSize-=e.size,t._queueTotalSize<0&&(t._queueTotalSize=0),e.value}function O1(t,e,r){if(!ph(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t._queue.push({value:e,size:r}),t._queueTotalSize+=r}function Wi(t){t._queue=new Lr,t._queueTotalSize=0}function E0(t){return t.slice()}class fo{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!P0(this))throw x0("view");return this._view}respond(e){if(!P0(this))throw x0("respond");if(fi(e,1,"respond"),e=uh(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(r,i){if(i=Number(i),!ph(i))throw new RangeError("bytesWritten must be a finite");J2(r,i)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!P0(this))throw x0("respondWithNewView");if(fi(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");(function(r,i){const n=r._pendingPullIntos.peek();if(n.byteOffset+n.bytesFilled!==i.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(n.byteLength!==i.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");n.buffer=i.buffer,J2(r,i.byteLength)})(this._associatedReadableByteStreamController,e)}}Object.defineProperties(fo.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(fo.prototype,Wt.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class lo{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!xn(this))throw aa("byobRequest");if(this._byobRequest===null&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),r=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),i=Object.create(fo.prototype);(function(n,a,s){n._associatedReadableByteStreamController=a,n._view=s})(i,this,r),this._byobRequest=i}return this._byobRequest}get desiredSize(){if(!xn(this))throw aa("desiredSize");return vh(this)}close(){if(!xn(this))throw aa("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if(e!=="readable")throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);(function(r){const i=r._controlledReadableByteStream;if(!(r._closeRequested||i._state!=="readable")){if(r._queueTotalSize>0)return void(r._closeRequested=!0);if(r._pendingPullIntos.length>0&&r._pendingPullIntos.peek().bytesFilled>0){const n=new TypeError("Insufficient bytes to fill elements in the given buffer");throw $a(r,n),n}po(r),os(i)}})(this)}enqueue(e){if(!xn(this))throw aa("enqueue");if(fi(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);(function(i,n){const a=i._controlledReadableByteStream;if(i._closeRequested||a._state!=="readable")return;const s=n.buffer,o=n.byteOffset,u=n.byteLength,c=s;dh(a)?jo(a)===0?$s(i,c,o,u):F1(a,new Uint8Array(c,o,u),!1):L1(a)?($s(i,c,o,u),wh(i)):$s(i,c,o,u),mn(i)})(this,e)}error(e=void 0){if(!xn(this))throw aa("error");$a(this,e)}[B1](e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0),Wi(this);const r=this._cancelAlgorithm(e);return po(this),r}[T1](e){const r=this._controlledReadableByteStream;if(this._queueTotalSize>0){const n=this._queue.shift();this._queueTotalSize-=n.byteLength,gh(this);const a=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);return void e._chunkSteps(a)}const i=this._autoAllocateChunkSize;if(i!==void 0){let n;try{n=new ArrayBuffer(i)}catch(s){return void e._errorSteps(s)}const a={buffer:n,byteOffset:0,byteLength:i,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(a)}hh(r,e),mn(this)}}function xn(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")}function P0(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")}function mn(t){if(!!function(r){const i=r._controlledReadableByteStream;return i._state!=="readable"||r._closeRequested||!r._started?!1:!!(dh(i)&&jo(i)>0||L1(i)&&_h(i)>0||vh(r)>0)}(t)){if(t._pulling)return void(t._pullAgain=!0);t._pulling=!0,hr(t._pullAlgorithm(),()=>{t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,mn(t))},r=>{$a(t,r)})}}function n1(t,e){let r=!1;t._state==="closed"&&(r=!0);const i=yh(e);e.readerType==="default"?F1(t,i,r):function(n,a,s){const o=n._reader,u=o._readIntoRequests.shift();s?u._closeSteps(a):u._chunkSteps(a)}(t,i,r)}function yh(t){const e=t.bytesFilled,r=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,e/r)}function $s(t,e,r,i){t._queue.push({buffer:e,byteOffset:r,byteLength:i}),t._queueTotalSize+=i}function bh(t,e){const r=e.elementSize,i=e.bytesFilled-e.bytesFilled%r,n=Math.min(t._queueTotalSize,e.byteLength-e.bytesFilled),a=e.bytesFilled+n,s=a-a%r;let o=n,u=!1;s>i&&(o=s-e.bytesFilled,u=!0);const c=t._queue;for(;o>0;){const I=c.peek(),U=Math.min(o,I.byteLength),G=e.byteOffset+e.bytesFilled;h=e.buffer,f=G,m=I.buffer,b=I.byteOffset,K=U,new Uint8Array(h).set(new Uint8Array(m,b,K),f),I.byteLength===U?c.shift():(I.byteOffset+=U,I.byteLength-=U),t._queueTotalSize-=U,mh(t,U,e),o-=U}var h,f,m,b,K;return u}function mh(t,e,r){$1(t),r.bytesFilled+=e}function gh(t){t._queueTotalSize===0&&t._closeRequested?(po(t),os(t._controlledReadableByteStream)):mn(t)}function $1(t){t._byobRequest!==null&&(t._byobRequest._associatedReadableByteStreamController=void 0,t._byobRequest._view=null,t._byobRequest=null)}function wh(t){for(;t._pendingPullIntos.length>0;){if(t._queueTotalSize===0)return;const e=t._pendingPullIntos.peek();bh(t,e)&&(a1(t),n1(t._controlledReadableByteStream,e))}}function J2(t,e){const r=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(e!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");(function(i,n){n.buffer=n.buffer;const a=i._controlledReadableByteStream;if(L1(a))for(;_h(a)>0;)n1(a,a1(i))})(t,r)}else(function(i,n,a){if(a.bytesFilled+n>a.byteLength)throw new RangeError("bytesWritten out of range");if(mh(i,n,a),a.bytesFilled0){const o=a.byteOffset+a.bytesFilled,u=a.buffer.slice(o-s,o);$s(i,u,0,u.byteLength)}a.buffer=a.buffer,a.bytesFilled-=s,n1(i._controlledReadableByteStream,a),wh(i)})(t,e,r);mn(t)}function a1(t){const e=t._pendingPullIntos.shift();return $1(t),e}function po(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function $a(t,e){const r=t._controlledReadableByteStream;r._state==="readable"&&(function(i){$1(i),i._pendingPullIntos=new Lr}(t),Wi(t),po(t),Oh(r,e))}function vh(t){const e=t._controlledReadableByteStream._state;return e==="errored"?null:e==="closed"?0:t._strategyHWM-t._queueTotalSize}function Zf(t,e,r){const i=Object.create(lo.prototype);let n=()=>{},a=()=>ne(void 0),s=()=>ne(void 0);e.start!==void 0&&(n=()=>e.start(i)),e.pull!==void 0&&(a=()=>e.pull(i)),e.cancel!==void 0&&(s=u=>e.cancel(u));const o=e.autoAllocateChunkSize;if(o===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(u,c,h,f,m,b,K){c._controlledReadableByteStream=u,c._pullAgain=!1,c._pulling=!1,c._byobRequest=null,c._queue=c._queueTotalSize=void 0,Wi(c),c._closeRequested=!1,c._started=!1,c._strategyHWM=b,c._pullAlgorithm=f,c._cancelAlgorithm=m,c._autoAllocateChunkSize=K,c._pendingPullIntos=new Lr,u._readableStreamController=c,hr(ne(h()),()=>{c._started=!0,mn(c)},I=>{$a(c,I)})})(t,i,n,a,s,r,o)}function x0(t){return new TypeError(`ReadableStreamBYOBRequest.prototype.${t} can only be used on a ReadableStreamBYOBRequest`)}function aa(t){return new TypeError(`ReadableByteStreamController.prototype.${t} can only be used on a ReadableByteStreamController`)}function tu(t,e){t._reader._readIntoRequests.push(e)}function _h(t){return t._reader._readIntoRequests.length}function L1(t){const e=t._reader;return e!==void 0&&!!wa(e)}Object.defineProperties(lo.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(lo.prototype,Wt.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class yo{constructor(e){if(fi(e,1,"ReadableStreamBYOBReader"),q1(e,"First parameter"),Bi(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!xn(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ih(this,e),this._readIntoRequests=new Lr}get closed(){return wa(this)?this._closedPromise:Ut(_s("closed"))}cancel(e=void 0){return wa(this)?this._ownerReadableStream===void 0?Ut(Gn("cancel")):I1(this,e):Ut(_s("cancel"))}read(e){if(!wa(this))return Ut(_s("read"));if(!ArrayBuffer.isView(e))return Ut(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return Ut(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return Ut(new TypeError("view's buffer must have non-zero byteLength"));if(this._ownerReadableStream===void 0)return Ut(Gn("read from"));let r,i;const n=ze((a,s)=>{r=a,i=s});return function(a,s,o){const u=a._ownerReadableStream;u._disturbed=!0,u._state==="errored"?o._errorSteps(u._storedError):function(c,h,f){const m=c._controlledReadableByteStream;let b=1;h.constructor!==DataView&&(b=h.constructor.BYTES_PER_ELEMENT);const K=h.constructor,I={buffer:h.buffer,byteOffset:h.byteOffset,byteLength:h.byteLength,bytesFilled:0,elementSize:b,viewConstructor:K,readerType:"byob"};if(c._pendingPullIntos.length>0)return c._pendingPullIntos.push(I),void tu(m,f);if(m._state!=="closed"){if(c._queueTotalSize>0){if(bh(c,I)){const U=yh(I);return gh(c),void f._chunkSteps(U)}if(c._closeRequested){const U=new TypeError("Insufficient bytes to fill elements in the given buffer");return $a(c,U),void f._errorSteps(U)}}c._pendingPullIntos.push(I),tu(m,f),mn(c)}else{const U=new K(I.buffer,I.byteOffset,0);f._closeSteps(U)}}(u._readableStreamController,s,o)}(this,e,{_chunkSteps:a=>r({value:a,done:!1}),_closeSteps:a=>r({value:a,done:!0}),_errorSteps:a=>i(a)}),n}releaseLock(){if(!wa(this))throw _s("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");un(this)}}}function wa(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")}function _s(t){return new TypeError(`ReadableStreamBYOBReader.prototype.${t} can only be used on a ReadableStreamBYOBReader`)}function La(t,e){const{highWaterMark:r}=t;if(r===void 0)return e;if(lh(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function bo(t){const{size:e}=t;return e||(()=>1)}function mo(t,e){si(t,e);const r=t==null?void 0:t.highWaterMark,i=t==null?void 0:t.size;return{highWaterMark:r===void 0?void 0:z1(r),size:i===void 0?void 0:Yf(i,e+" has member 'size' that")}}function Yf(t,e){return dr(t,e),r=>z1(t(r))}function Qf(t,e,r){return dr(t,r),i=>wn(t,e,[i])}function Xf(t,e,r){return dr(t,r),()=>wn(t,e,[])}function Jf(t,e,r){return dr(t,r),i=>No(t,e,[i])}function t6(t,e,r){return dr(t,r),(i,n)=>wn(t,e,[i,n])}function kh(t,e){if(!Kn(t))throw new TypeError(e+" is not a WritableStream.")}Object.defineProperties(yo.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(yo.prototype,Wt.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class go{constructor(e={},r={}){e===void 0?e=null:ch(e,"First parameter");const i=mo(r,"Second parameter"),n=function(s,o){si(s,o);const u=s==null?void 0:s.abort,c=s==null?void 0:s.close,h=s==null?void 0:s.start,f=s==null?void 0:s.type,m=s==null?void 0:s.write;return{abort:u===void 0?void 0:Qf(u,s,o+" has member 'abort' that"),close:c===void 0?void 0:Xf(c,s,o+" has member 'close' that"),start:h===void 0?void 0:Jf(h,s,o+" has member 'start' that"),write:m===void 0?void 0:t6(m,s,o+" has member 'write' that"),type:f}}(e,"First parameter");if(Sh(this),n.type!==void 0)throw new RangeError("Invalid type is specified");const a=bo(i);(function(s,o,u,c){const h=Object.create(Na.prototype);let f=()=>{},m=()=>ne(void 0),b=()=>ne(void 0),K=()=>ne(void 0);o.start!==void 0&&(f=()=>o.start(h)),o.write!==void 0&&(m=I=>o.write(I,h)),o.close!==void 0&&(b=()=>o.close()),o.abort!==void 0&&(K=I=>o.abort(I)),Kh(s,h,f,m,b,K,u,c)})(this,n,La(i,1),a)}get locked(){if(!Kn(this))throw As("locked");return Fn(this)}abort(e=void 0){return Kn(this)?Fn(this)?Ut(new TypeError("Cannot abort a stream that already has a writer")):wo(this,e):Ut(As("abort"))}close(){return Kn(this)?Fn(this)?Ut(new TypeError("Cannot close a stream that already has a writer")):Ur(this)?Ut(new TypeError("Cannot close an already-closing stream")):Eh(this):Ut(As("close"))}getWriter(){if(!Kn(this))throw As("getWriter");return Ah(this)}}function Ah(t){return new vo(t)}function Sh(t){t._state="writable",t._storedError=void 0,t._writer=void 0,t._writableStreamController=void 0,t._writeRequests=new Lr,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function Kn(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")}function Fn(t){return t._writer!==void 0}function wo(t,e){const r=t._state;if(r==="closed"||r==="errored")return ne(void 0);if(t._pendingAbortRequest!==void 0)return t._pendingAbortRequest._promise;let i=!1;r==="erroring"&&(i=!0,e=void 0);const n=ze((a,s)=>{t._pendingAbortRequest={_promise:void 0,_resolve:a,_reject:s,_reason:e,_wasAlreadyErroring:i}});return t._pendingAbortRequest._promise=n,i||N1(t,e),n}function Eh(t){const e=t._state;if(e==="closed"||e==="errored")return Ut(new TypeError(`The stream (in ${e} state) is not in the writable state and cannot be closed`));const r=ze((a,s)=>{const o={_resolve:a,_reject:s};t._closeRequest=o}),i=t._writer;var n;return i!==void 0&&t._backpressure&&e==="writable"&&V1(i),O1(n=t._writableStreamController,Dh,0),Ho(n),r}function s1(t,e){t._state!=="writable"?j1(t):N1(t,e)}function N1(t,e){const r=t._writableStreamController;t._state="erroring",t._storedError=e;const i=t._writer;i!==void 0&&xh(i,e),!function(n){return!(n._inFlightWriteRequest===void 0&&n._inFlightCloseRequest===void 0)}(t)&&r._started&&j1(t)}function j1(t){t._state="errored",t._writableStreamController[oh]();const e=t._storedError;if(t._writeRequests.forEach(i=>{i._reject(e)}),t._writeRequests=new Lr,t._pendingAbortRequest===void 0)return void ks(t);const r=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(e),void ks(t);hr(t._writableStreamController[sh](r._reason),()=>{r._resolve(),ks(t)},i=>{r._reject(i),ks(t)})}function Ur(t){return t._closeRequest!==void 0||t._inFlightCloseRequest!==void 0}function ks(t){t._closeRequest!==void 0&&(t._closeRequest._reject(t._storedError),t._closeRequest=void 0);const e=t._writer;e!==void 0&&G1(e,t._storedError)}function W1(t,e){const r=t._writer;r!==void 0&&e!==t._backpressure&&(e?function(i){Go(i)}(r):V1(r)),t._backpressure=e}Object.defineProperties(go.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(go.prototype,Wt.toStringTag,{value:"WritableStream",configurable:!0});class vo{constructor(e){if(fi(e,1,"WritableStreamDefaultWriter"),kh(e,"First parameter"),Fn(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const r=e._state;if(r==="writable")!Ur(e)&&e._backpressure?Go(this):eu(this),Ls(this);else if(r==="erroring")c1(this,e._storedError),Ls(this);else if(r==="closed")eu(this),Ls(i=this),Bh(i);else{const n=e._storedError;c1(this,n),Uh(this,n)}var i}get closed(){return Qi(this)?this._closedPromise:Ut(Xi("closed"))}get desiredSize(){if(!Qi(this))throw Xi("desiredSize");if(this._ownerWritableStream===void 0)throw va("desiredSize");return function(e){const r=e._ownerWritableStream,i=r._state;return i==="errored"||i==="erroring"?null:i==="closed"?0:Rh(r._writableStreamController)}(this)}get ready(){return Qi(this)?this._readyPromise:Ut(Xi("ready"))}abort(e=void 0){return Qi(this)?this._ownerWritableStream===void 0?Ut(va("abort")):function(r,i){return wo(r._ownerWritableStream,i)}(this,e):Ut(Xi("abort"))}close(){if(!Qi(this))return Ut(Xi("close"));const e=this._ownerWritableStream;return e===void 0?Ut(va("close")):Ur(e)?Ut(new TypeError("Cannot close an already-closing stream")):Ph(this)}releaseLock(){if(!Qi(this))throw Xi("releaseLock");this._ownerWritableStream!==void 0&&Mh(this)}write(e=void 0){return Qi(this)?this._ownerWritableStream===void 0?Ut(va("write to")):Ch(this,e):Ut(Xi("write"))}}function Qi(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")}function Ph(t){return Eh(t._ownerWritableStream)}function e6(t,e){t._closedPromiseState==="pending"?G1(t,e):function(r,i){Uh(r,i)}(t,e)}function xh(t,e){t._readyPromiseState==="pending"?Th(t,e):function(r,i){c1(r,i)}(t,e)}function Mh(t){const e=t._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");xh(t,r),e6(t,r),e._writer=void 0,t._ownerWritableStream=void 0}function Ch(t,e){const r=t._ownerWritableStream,i=r._writableStreamController,n=function(o,u){try{return o._strategySizeAlgorithm(u)}catch(c){return o1(o,c),1}}(i,e);if(r!==t._ownerWritableStream)return Ut(va("write to"));const a=r._state;if(a==="errored")return Ut(r._storedError);if(Ur(r)||a==="closed")return Ut(new TypeError("The stream is closing or closed and cannot be written to"));if(a==="erroring")return Ut(r._storedError);const s=function(o){return ze((u,c)=>{const h={_resolve:u,_reject:c};o._writeRequests.push(h)})}(r);return function(o,u,c){try{O1(o,u,c)}catch(f){return void o1(o,f)}const h=o._controlledWritableStream;!Ur(h)&&h._state==="writable"&&W1(h,H1(o)),Ho(o)}(i,e,n),s}Object.defineProperties(vo.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(vo.prototype,Wt.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const Dh={};class Na{constructor(){throw new TypeError("Illegal constructor")}error(e=void 0){if(!function(r){return!(!He(r)||!Object.prototype.hasOwnProperty.call(r,"_controlledWritableStream"))}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");this._controlledWritableStream._state==="writable"&&Ih(this,e)}[sh](e){const r=this._abortAlgorithm(e);return _o(this),r}[oh](){Wi(this)}}function Kh(t,e,r,i,n,a,s,o){e._controlledWritableStream=t,t._writableStreamController=e,e._queue=void 0,e._queueTotalSize=void 0,Wi(e),e._started=!1,e._strategySizeAlgorithm=o,e._strategyHWM=s,e._writeAlgorithm=i,e._closeAlgorithm=n,e._abortAlgorithm=a;const u=H1(e);W1(t,u),hr(ne(r()),()=>{e._started=!0,Ho(e)},c=>{e._started=!0,s1(t,c)})}function _o(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Rh(t){return t._strategyHWM-t._queueTotalSize}function Ho(t){const e=t._controlledWritableStream;if(!t._started||e._inFlightWriteRequest!==void 0)return;if(e._state==="erroring")return void j1(e);if(t._queue.length===0)return;const r=t._queue.peek().value;r===Dh?function(i){const n=i._controlledWritableStream;(function(s){s._inFlightCloseRequest=s._closeRequest,s._closeRequest=void 0})(n),i1(i);const a=i._closeAlgorithm();_o(i),hr(a,()=>{(function(s){s._inFlightCloseRequest._resolve(void 0),s._inFlightCloseRequest=void 0,s._state==="erroring"&&(s._storedError=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._resolve(),s._pendingAbortRequest=void 0)),s._state="closed";const o=s._writer;o!==void 0&&Bh(o)})(n)},s=>{(function(o,u){o._inFlightCloseRequest._reject(u),o._inFlightCloseRequest=void 0,o._pendingAbortRequest!==void 0&&(o._pendingAbortRequest._reject(u),o._pendingAbortRequest=void 0),s1(o,u)})(n,s)})}(t):function(i,n){const a=i._controlledWritableStream;(function(o){o._inFlightWriteRequest=o._writeRequests.shift()})(a);const s=i._writeAlgorithm(n);hr(s,()=>{(function(u){u._inFlightWriteRequest._resolve(void 0),u._inFlightWriteRequest=void 0})(a);const o=a._state;if(i1(i),!Ur(a)&&o==="writable"){const u=H1(i);W1(a,u)}Ho(i)},o=>{a._state==="writable"&&_o(i),function(u,c){u._inFlightWriteRequest._reject(c),u._inFlightWriteRequest=void 0,s1(u,c)}(a,o)})}(t,r)}function o1(t,e){t._controlledWritableStream._state==="writable"&&Ih(t,e)}function H1(t){return Rh(t)<=0}function Ih(t,e){const r=t._controlledWritableStream;_o(t),N1(r,e)}function As(t){return new TypeError(`WritableStream.prototype.${t} can only be used on a WritableStream`)}function Xi(t){return new TypeError(`WritableStreamDefaultWriter.prototype.${t} can only be used on a WritableStreamDefaultWriter`)}function va(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function Ls(t){t._closedPromise=ze((e,r)=>{t._closedPromise_resolve=e,t._closedPromise_reject=r,t._closedPromiseState="pending"})}function Uh(t,e){Ls(t),G1(t,e)}function G1(t,e){t._closedPromise_reject!==void 0&&(ss(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="rejected")}function Bh(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved")}function Go(t){t._readyPromise=ze((e,r)=>{t._readyPromise_resolve=e,t._readyPromise_reject=r}),t._readyPromiseState="pending"}function c1(t,e){Go(t),Th(t,e)}function eu(t){Go(t),V1(t)}function Th(t,e){t._readyPromise_reject!==void 0&&(ss(t._readyPromise),t._readyPromise_reject(e),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="rejected")}function V1(t){t._readyPromise_resolve!==void 0&&(t._readyPromise_resolve(void 0),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="fulfilled")}Object.defineProperties(Na.prototype,{error:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(Na.prototype,Wt.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const ru=typeof DOMException!="undefined"?DOMException:void 0,r6=function(t){if(typeof t!="function"&&typeof t!="object")return!1;try{return new t,!0}catch{return!1}}(ru)?ru:function(){const t=function(e,r){this.message=e||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(t.prototype=Object.create(Error.prototype),"constructor",{value:t,writable:!0,configurable:!0}),t}();function iu(t,e,r,i,n,a){const s=Os(t),o=Ah(e);t._disturbed=!0;let u=!1,c=ne(void 0);return ze((h,f)=>{let m;if(a!==void 0){if(m=()=>{const J=new r6("Aborted","AbortError"),V=[];i||V.push(()=>e._state==="writable"?wo(e,J):ne(void 0)),n||V.push(()=>t._state==="readable"?ln(t,J):ne(void 0)),Q(()=>Promise.all(V.map(X=>X())),!0,J)},a.aborted)return void m();a.addEventListener("abort",m)}var b,K,I;if(G(t,s._closedPromise,J=>{i?Y(!0,J):Q(()=>wo(e,J),!0,J)}),G(e,o._closedPromise,J=>{n?Y(!0,J):Q(()=>ln(t,J),!0,J)}),b=t,K=s._closedPromise,I=()=>{r?Y():Q(()=>function(J){const V=J._ownerWritableStream,X=V._state;return Ur(V)||X==="closed"?ne(void 0):X==="errored"?Ut(V._storedError):Ph(J)}(o))},b._state==="closed"?I():S0(K,I),Ur(e)||e._state==="closed"){const J=new TypeError("the destination writable stream closed before all data could be piped to it");n?Y(!0,J):Q(()=>ln(t,J),!0,J)}function U(){const J=c;return ai(c,()=>J!==c?U():void 0)}function G(J,V,X){J._state==="errored"?X(J._storedError):eh(V,X)}function Q(J,V,X){function d(){hr(J(),()=>R(V,X),y=>R(!0,y))}u||(u=!0,e._state!=="writable"||Ur(e)?d():S0(U(),d))}function Y(J,V){u||(u=!0,e._state!=="writable"||Ur(e)?R(J,V):S0(U(),()=>R(J,V)))}function R(J,V){Mh(o),un(s),a!==void 0&&a.removeEventListener("abort",m),J?f(V):h(void 0)}ss(ze((J,V)=>{(function X(d){d?J():ai(u?ne(!0):ai(o._readyPromise,()=>ze((y,_)=>{Wo(s,{_chunkSteps:g=>{c=ai(Ch(o,g),void 0,K1),y(!1)},_closeSteps:()=>y(!0),_errorSteps:_})})),X,V)})(!1)}))})}class ja{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ss(this))throw Es("desiredSize");return Z1(this)}close(){if(!Ss(this))throw Es("close");if(!Vn(this))throw new TypeError("The stream is not in a state that permits close");Ha(this)}enqueue(e=void 0){if(!Ss(this))throw Es("enqueue");if(!Vn(this))throw new TypeError("The stream is not in a state that permits enqueue");return Ao(this,e)}error(e=void 0){if(!Ss(this))throw Es("error");Li(this,e)}[B1](e){Wi(this);const r=this._cancelAlgorithm(e);return ko(this),r}[T1](e){const r=this._controlledReadableStream;if(this._queue.length>0){const i=i1(this);this._closeRequested&&this._queue.length===0?(ko(this),os(r)):Wa(this),e._chunkSteps(i)}else hh(r,e),Wa(this)}}function Ss(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")}function Wa(t){if(!!zh(t)){if(t._pulling)return void(t._pullAgain=!0);t._pulling=!0,hr(t._pullAlgorithm(),()=>{t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,Wa(t))},e=>{Li(t,e)})}}function zh(t){const e=t._controlledReadableStream;return!Vn(t)||!t._started?!1:Bi(e)&&jo(e)>0?!0:Z1(t)>0}function ko(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Ha(t){if(!Vn(t))return;const e=t._controlledReadableStream;t._closeRequested=!0,t._queue.length===0&&(ko(t),os(e))}function Ao(t,e){if(!Vn(t))return;const r=t._controlledReadableStream;if(Bi(r)&&jo(r)>0)F1(r,e,!1);else{let i;try{i=t._strategySizeAlgorithm(e)}catch(n){throw Li(t,n),n}try{O1(t,e,i)}catch(n){throw Li(t,n),n}}Wa(t)}function Li(t,e){const r=t._controlledReadableStream;r._state==="readable"&&(Wi(t),ko(t),Oh(r,e))}function Z1(t){const e=t._controlledReadableStream._state;return e==="errored"?null:e==="closed"?0:t._strategyHWM-t._queueTotalSize}function Vn(t){const e=t._controlledReadableStream._state;return!t._closeRequested&&e==="readable"}function qh(t,e,r,i,n,a,s){e._controlledReadableStream=t,e._queue=void 0,e._queueTotalSize=void 0,Wi(e),e._started=!1,e._closeRequested=!1,e._pullAgain=!1,e._pulling=!1,e._strategySizeAlgorithm=s,e._strategyHWM=a,e._pullAlgorithm=i,e._cancelAlgorithm=n,t._readableStreamController=e,hr(ne(r()),()=>{e._started=!0,Wa(e)},o=>{Li(e,o)})}function Es(t){return new TypeError(`ReadableStreamDefaultController.prototype.${t} can only be used on a ReadableStreamDefaultController`)}function i6(t,e,r){return dr(t,r),i=>wn(t,e,[i])}function n6(t,e,r){return dr(t,r),i=>wn(t,e,[i])}function a6(t,e,r){return dr(t,r),i=>No(t,e,[i])}function s6(t,e){if((t=""+t)!="bytes")throw new TypeError(`${e} '${t}' is not a valid enumeration value for ReadableStreamType`);return t}function o6(t,e){if((t=""+t)!="byob")throw new TypeError(`${e} '${t}' is not a valid enumeration value for ReadableStreamReaderMode`);return t}function nu(t,e){si(t,e);const r=t==null?void 0:t.preventAbort,i=t==null?void 0:t.preventCancel,n=t==null?void 0:t.preventClose,a=t==null?void 0:t.signal;return a!==void 0&&function(s,o){if(!function(u){if(typeof u!="object"||u===null)return!1;try{return typeof u.aborted=="boolean"}catch{return!1}}(s))throw new TypeError(o+" is not an AbortSignal.")}(a,e+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!i,preventClose:!!n,signal:a}}Object.defineProperties(ja.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(ja.prototype,Wt.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class Rn{constructor(e={},r={}){e===void 0?e=null:ch(e,"First parameter");const i=mo(r,"Second parameter"),n=function(a,s){si(a,s);const o=a,u=o==null?void 0:o.autoAllocateChunkSize,c=o==null?void 0:o.cancel,h=o==null?void 0:o.pull,f=o==null?void 0:o.start,m=o==null?void 0:o.type;return{autoAllocateChunkSize:u===void 0?void 0:uh(u,s+" has member 'autoAllocateChunkSize' that"),cancel:c===void 0?void 0:i6(c,o,s+" has member 'cancel' that"),pull:h===void 0?void 0:n6(h,o,s+" has member 'pull' that"),start:f===void 0?void 0:a6(f,o,s+" has member 'start' that"),type:m===void 0?void 0:s6(m,s+" has member 'type' that")}}(e,"First parameter");if(Fh(this),n.type==="bytes"){if(i.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");Zf(this,n,La(i,0))}else{const a=bo(i);(function(s,o,u,c){const h=Object.create(ja.prototype);let f=()=>{},m=()=>ne(void 0),b=()=>ne(void 0);o.start!==void 0&&(f=()=>o.start(h)),o.pull!==void 0&&(m=()=>o.pull(h)),o.cancel!==void 0&&(b=K=>o.cancel(K)),qh(s,h,f,m,b,u,c)})(this,n,La(i,1),a)}}get locked(){if(!Pi(this))throw Ji("locked");return Bi(this)}cancel(e=void 0){return Pi(this)?Bi(this)?Ut(new TypeError("Cannot cancel a stream that already has a reader")):ln(this,e):Ut(Ji("cancel"))}getReader(e=void 0){if(!Pi(this))throw Ji("getReader");return function(r,i){si(r,i);const n=r==null?void 0:r.mode;return{mode:n===void 0?void 0:o6(n,i+" has member 'mode' that")}}(e,"First parameter").mode===void 0?Os(this):new yo(this)}pipeThrough(e,r={}){if(!Pi(this))throw Ji("pipeThrough");fi(e,1,"pipeThrough");const i=function(a,s){si(a,s);const o=a==null?void 0:a.readable;r1(o,"readable","ReadableWritablePair"),q1(o,s+" has member 'readable' that");const u=a==null?void 0:a.writable;return r1(u,"writable","ReadableWritablePair"),kh(u,s+" has member 'writable' that"),{readable:o,writable:u}}(e,"First parameter"),n=nu(r,"Second parameter");if(Bi(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Fn(i.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return ss(iu(this,i.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),i.readable}pipeTo(e,r={}){if(!Pi(this))return Ut(Ji("pipeTo"));if(e===void 0)return Ut("Parameter 1 is required in 'pipeTo'.");if(!Kn(e))return Ut(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let i;try{i=nu(r,"Second parameter")}catch(n){return Ut(n)}return Bi(this)?Ut(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Fn(e)?Ut(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):iu(this,e,i.preventClose,i.preventAbort,i.preventCancel,i.signal)}tee(){if(!Pi(this))throw Ji("tee");const e=function(r,i){const n=Os(r);let a,s,o,u,c,h=!1,f=!1,m=!1;const b=ze(U=>{c=U});function K(){return h||(h=!0,Wo(n,{_chunkSteps:U=>{rh(()=>{h=!1;const G=U,Q=U;f||Ao(o._readableStreamController,G),m||Ao(u._readableStreamController,Q)})},_closeSteps:()=>{h=!1,f||Ha(o._readableStreamController),m||Ha(u._readableStreamController),f&&m||c(void 0)},_errorSteps:()=>{h=!1}})),ne(void 0)}function I(){}return o=u1(I,K,function(U){if(f=!0,a=U,m){const G=E0([a,s]),Q=ln(r,G);c(Q)}return b}),u=u1(I,K,function(U){if(m=!0,s=U,f){const G=E0([a,s]),Q=ln(r,G);c(Q)}return b}),eh(n._closedPromise,U=>{Li(o._readableStreamController,U),Li(u._readableStreamController,U),f&&m||c(void 0)}),[o,u]}(this);return E0(e)}values(e=void 0){if(!Pi(this))throw Ji("values");return function(r,i){const n=Os(r),a=new Vf(n,i),s=Object.create(fh);return s._asyncIteratorImpl=a,s}(this,function(r,i){return si(r,i),{preventCancel:!!(r!=null&&r.preventCancel)}}(e,"First parameter").preventCancel)}}function u1(t,e,r,i=1,n=()=>1){const a=Object.create(Rn.prototype);return Fh(a),qh(a,Object.create(ja.prototype),t,e,r,i,n),a}function Fh(t){t._state="readable",t._reader=void 0,t._storedError=void 0,t._disturbed=!1}function Pi(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")}function Bi(t){return t._reader!==void 0}function ln(t,e){return t._disturbed=!0,t._state==="closed"?ne(void 0):t._state==="errored"?Ut(t._storedError):(os(t),fn(t._readableStreamController[B1](e),K1))}function os(t){t._state="closed";const e=t._reader;e!==void 0&&(ah(e),hn(e)&&(e._readRequests.forEach(r=>{r._closeSteps()}),e._readRequests=new Lr))}function Oh(t,e){t._state="errored",t._storedError=e;const r=t._reader;r!==void 0&&(U1(r,e),hn(r)?(r._readRequests.forEach(i=>{i._errorSteps(e)}),r._readRequests=new Lr):(r._readIntoRequests.forEach(i=>{i._errorSteps(e)}),r._readIntoRequests=new Lr))}function Ji(t){return new TypeError(`ReadableStream.prototype.${t} can only be used on a ReadableStream`)}function $h(t,e){si(t,e);const r=t==null?void 0:t.highWaterMark;return r1(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:z1(r)}}Object.defineProperties(Rn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Wt.toStringTag,{value:"ReadableStream",configurable:!0}),typeof Wt.asyncIterator=="symbol"&&Object.defineProperty(Rn.prototype,Wt.asyncIterator,{value:Rn.prototype.values,writable:!0,configurable:!0});const c6=function(t){return t.byteLength};class h1{constructor(e){fi(e,1,"ByteLengthQueuingStrategy"),e=$h(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!su(this))throw au("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!su(this))throw au("size");return c6}}function au(t){return new TypeError(`ByteLengthQueuingStrategy.prototype.${t} can only be used on a ByteLengthQueuingStrategy`)}function su(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(h1.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(h1.prototype,Wt.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const u6=function(){return 1};class d1{constructor(e){fi(e,1,"CountQueuingStrategy"),e=$h(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!cu(this))throw ou("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!cu(this))throw ou("size");return u6}}function ou(t){return new TypeError(`CountQueuingStrategy.prototype.${t} can only be used on a CountQueuingStrategy`)}function cu(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_countQueuingStrategyHighWaterMark")}function h6(t,e,r){return dr(t,r),i=>wn(t,e,[i])}function d6(t,e,r){return dr(t,r),i=>No(t,e,[i])}function f6(t,e,r){return dr(t,r),(i,n)=>wn(t,e,[i,n])}Object.defineProperties(d1.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(d1.prototype,Wt.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class f1{constructor(e={},r={},i={}){e===void 0&&(e=null);const n=mo(r,"Second parameter"),a=mo(i,"Third parameter"),s=function(m,b){si(m,b);const K=m==null?void 0:m.flush,I=m==null?void 0:m.readableType,U=m==null?void 0:m.start,G=m==null?void 0:m.transform,Q=m==null?void 0:m.writableType;return{flush:K===void 0?void 0:h6(K,m,b+" has member 'flush' that"),readableType:I,start:U===void 0?void 0:d6(U,m,b+" has member 'start' that"),transform:G===void 0?void 0:f6(G,m,b+" has member 'transform' that"),writableType:Q}}(e,"First parameter");if(s.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(s.writableType!==void 0)throw new RangeError("Invalid writableType specified");const o=La(a,0),u=bo(a),c=La(n,1),h=bo(n);let f;(function(m,b,K,I,U,G){function Q(){return b}function Y(d){return function(y,_){const g=y._transformStreamController;return y._backpressure?fn(y._backpressureChangePromise,()=>{const p=y._writable;if(p._state==="erroring")throw p._storedError;return hu(g,_)}):hu(g,_)}(m,d)}function R(d){return function(y,_){return So(y,_),ne(void 0)}(m,d)}function J(){return function(d){const y=d._readable,_=d._transformStreamController,g=_._flushAlgorithm();return Lh(_),fn(g,()=>{if(y._state==="errored")throw y._storedError;Ha(y._readableStreamController)},p=>{throw So(d,p),y._storedError})}(m)}function V(){return function(d){return Eo(d,!1),d._backpressureChangePromise}(m)}function X(d){return Vo(m,d),ne(void 0)}m._writable=function(d,y,_,g,p=1,E=()=>1){const D=Object.create(go.prototype);return Sh(D),Kh(D,Object.create(Na.prototype),d,y,_,g,p,E),D}(Q,Y,J,R,K,I),m._readable=u1(Q,V,X,U,G),m._backpressure=void 0,m._backpressureChangePromise=void 0,m._backpressureChangePromise_resolve=void 0,Eo(m,!0),m._transformStreamController=void 0})(this,ze(m=>{f=m}),c,h,o,u),function(m,b){const K=Object.create(Po.prototype);let I=G=>{try{return Nh(K,G),ne(void 0)}catch(Q){return Ut(Q)}},U=()=>ne(void 0);b.transform!==void 0&&(I=G=>b.transform(G,K)),b.flush!==void 0&&(U=()=>b.flush(K)),function(G,Q,Y,R){Q._controlledTransformStream=G,G._transformStreamController=Q,Q._transformAlgorithm=Y,Q._flushAlgorithm=R}(m,K,I,U)}(this,s),s.start!==void 0?f(s.start(this._transformStreamController)):f(void 0)}get readable(){if(!uu(this))throw du("readable");return this._readable}get writable(){if(!uu(this))throw du("writable");return this._writable}}function uu(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")}function So(t,e){Li(t._readable._readableStreamController,e),Vo(t,e)}function Vo(t,e){Lh(t._transformStreamController),o1(t._writable._writableStreamController,e),t._backpressure&&Eo(t,!1)}function Eo(t,e){t._backpressureChangePromise!==void 0&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=ze(r=>{t._backpressureChangePromise_resolve=r}),t._backpressure=e}Object.defineProperties(f1.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(f1.prototype,Wt.toStringTag,{value:"TransformStream",configurable:!0});class Po{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ps(this))throw xs("desiredSize");return Z1(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!Ps(this))throw xs("enqueue");Nh(this,e)}error(e=void 0){if(!Ps(this))throw xs("error");var r;r=e,So(this._controlledTransformStream,r)}terminate(){if(!Ps(this))throw xs("terminate");(function(e){const r=e._controlledTransformStream;Ha(r._readable._readableStreamController),Vo(r,new TypeError("TransformStream terminated"))})(this)}}function Ps(t){return!!He(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")}function Lh(t){t._transformAlgorithm=void 0,t._flushAlgorithm=void 0}function Nh(t,e){const r=t._controlledTransformStream,i=r._readable._readableStreamController;if(!Vn(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{Ao(i,e)}catch(a){throw Vo(r,a),r._readable._storedError}(function(a){return!zh(a)})(i)!==r._backpressure&&Eo(r,!0)}function hu(t,e){return fn(t._transformAlgorithm(e),void 0,r=>{throw So(t._controlledTransformStream,r),r})}function xs(t){return new TypeError(`TransformStreamDefaultController.prototype.${t} can only be used on a TransformStreamDefaultController`)}function du(t){return new TypeError(`TransformStream.prototype.${t} can only be used on a TransformStream`)}Object.defineProperties(Po.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof Wt.toStringTag=="symbol"&&Object.defineProperty(Po.prototype,Wt.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var l6=Object.freeze(Object.defineProperty({__proto__:null,ByteLengthQueuingStrategy:h1,CountQueuingStrategy:d1,ReadableByteStreamController:lo,ReadableStream:Rn,ReadableStreamBYOBReader:yo,ReadableStreamBYOBRequest:fo,ReadableStreamDefaultController:ja,ReadableStreamDefaultReader:uo,TransformStream:f1,TransformStreamDefaultController:Po,WritableStream:go,WritableStreamDefaultController:Na,WritableStreamDefaultWriter:vo},Symbol.toStringTag,{value:"Module"}));/*! OpenPGP.js v5.7.0-1 - 2023-06-10 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var l1=function(t,e){return l1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},l1(t,e)};function jh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}l1(t,e),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Qe(t){if(!t)throw new TypeError("Assertion failed")}function Ka(){}function Y1(t){return typeof t=="object"&&t!==null||typeof t=="function"}function Q1(t){if(typeof t!="function")return!1;var e=!1;try{new t({start:function(){e=!0}})}catch{}return e}function X1(t){return!!Y1(t)&&typeof t.getReader=="function"}function J1(t){return!!Y1(t)&&typeof t.getWriter=="function"}function Wh(t){return!!Y1(t)&&!!X1(t.readable)&&!!J1(t.writable)}function Hh(t){try{return t.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}function p6(t){Qe(function(r){return!!Q1(r)&&!!X1(new r)}(t));var e=function(r){try{return new r({type:"bytes"}),!0}catch{return!1}}(t);return function(r,i){var n=(i===void 0?{}:i).type;if((n=Gh(n))!=="bytes"||e||(n=void 0),r.constructor===t&&(n!=="bytes"||Hh(r)))return r;if(n==="bytes"){var a=p1(r,{type:n});return new t(a)}return a=p1(r),new t(a)}}function p1(t,e){var r=(e===void 0?{}:e).type;return Qe(X1(t)),Qe(t.locked===!1),(r=Gh(r))==="bytes"?new b6(t):new y6(t)}function Gh(t){var e=t+"";if(e==="bytes")return e;if(t===void 0)return t;throw new RangeError("Invalid type is specified")}var Vh=function(){function t(e){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=e,this._attachDefaultReader()}return t.prototype.start=function(e){this._readableStreamController=e},t.prototype.cancel=function(e){return Qe(this._underlyingReader!==void 0),this._underlyingReader.cancel(e)},t.prototype._attachDefaultReader=function(){if(this._readerMode!=="default"){this._detachReader();var e=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(e)}},t.prototype._attachReader=function(e){var r=this;Qe(this._underlyingReader===void 0),this._underlyingReader=e;var i=this._underlyingReader.closed;i&&i.then(function(){return r._finishPendingRead()}).then(function(){e===r._underlyingReader&&r._readableStreamController.close()},function(n){e===r._underlyingReader&&r._readableStreamController.error(n)}).catch(Ka)},t.prototype._detachReader=function(){this._underlyingReader!==void 0&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},t.prototype._pullWithDefaultReader=function(){var e=this;this._attachDefaultReader();var r=this._underlyingReader.read().then(function(i){var n=e._readableStreamController;i.done?e._tryClose():n.enqueue(i.value)});return this._setPendingRead(r),r},t.prototype._tryClose=function(){try{this._readableStreamController.close()}catch{}},t.prototype._setPendingRead=function(e){var r,i=this,n=function(){i._pendingRead===r&&(i._pendingRead=void 0)};this._pendingRead=r=e.then(n,n)},t.prototype._finishPendingRead=function(){var e=this;if(this._pendingRead){var r=function(){return e._finishPendingRead()};return this._pendingRead.then(r,r)}},t}(),y6=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return jh(e,t),e.prototype.pull=function(){return this._pullWithDefaultReader()},e}(Vh);function fu(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}var b6=function(t){function e(r){var i=this,n=Hh(r);return(i=t.call(this,r)||this)._supportsByob=n,i}return jh(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),e.prototype._attachByobReader=function(){if(this._readerMode!=="byob"){Qe(this._supportsByob),this._detachReader();var r=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(r)}},e.prototype.pull=function(){if(this._supportsByob){var r=this._readableStreamController.byobRequest;if(r)return this._pullWithByobRequest(r)}return this._pullWithDefaultReader()},e.prototype._pullWithByobRequest=function(r){var i=this;this._attachByobReader();var n=new Uint8Array(r.view.byteLength),a=this._underlyingReader.read(n).then(function(s){var o,u,c;i._readableStreamController,s.done?(i._tryClose(),r.respond(0)):(o=s.value,u=r.view,c=fu(o),fu(u).set(c,0),r.respond(s.value.byteLength))});return this._setPendingRead(a),a},e}(Vh);function m6(t){return Qe(function(e){return!!Q1(e)&&!!J1(new e)}(t)),function(e){if(e.constructor===t)return e;var r=Zh(e);return new t(r)}}function Zh(t){Qe(J1(t)),Qe(t.locked===!1);var e=t.getWriter();return new g6(e)}var g6=function(){function t(e){var r=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=e,this._errorPromise=new Promise(function(i,n){r._errorPromiseReject=n}),this._errorPromise.catch(Ka)}return t.prototype.start=function(e){var r=this;this._writableStreamController=e,this._underlyingWriter.closed.then(function(){r._state="closed"}).catch(function(i){return r._finishErroring(i)})},t.prototype.write=function(e){var r=this,i=this._underlyingWriter;if(i.desiredSize===null)return i.ready;var n=i.write(e);n.catch(function(s){return r._finishErroring(s)}),i.ready.catch(function(s){return r._startErroring(s)});var a=Promise.race([n,this._errorPromise]);return this._setPendingWrite(a),a},t.prototype.close=function(){var e=this;return this._pendingWrite===void 0?this._underlyingWriter.close():this._finishPendingWrite().then(function(){return e.close()})},t.prototype.abort=function(e){if(this._state!=="errored")return this._underlyingWriter.abort(e)},t.prototype._setPendingWrite=function(e){var r,i=this,n=function(){i._pendingWrite===r&&(i._pendingWrite=void 0)};this._pendingWrite=r=e.then(n,n)},t.prototype._finishPendingWrite=function(){var e=this;if(this._pendingWrite===void 0)return Promise.resolve();var r=function(){return e._finishPendingWrite()};return this._pendingWrite.then(r,r)},t.prototype._startErroring=function(e){var r=this;if(this._state==="writable"){this._state="erroring",this._storedError=e;var i=function(){return r._finishErroring(e)};this._pendingWrite===void 0?i():this._finishPendingWrite().then(i,i),this._writableStreamController.error(e)}},t.prototype._finishErroring=function(e){this._state==="writable"&&this._startErroring(e),this._state==="erroring"&&(this._state="errored",this._errorPromiseReject(this._storedError))},t}();function w6(t){return Qe(function(e){return!!Q1(e)&&!!Wh(new e)}(t)),function(e){if(e.constructor===t)return e;var r=Yh(e);return new t(r)}}function Yh(t){Qe(Wh(t));var e=t.readable,r=t.writable;Qe(e.locked===!1),Qe(r.locked===!1);var i,n=e.getReader();try{i=r.getWriter()}catch(a){throw n.releaseLock(),a}return new v6(n,i)}var v6=function(){function t(e,r){var i=this;this._transformStreamController=void 0,this._onRead=function(n){if(!n.done)return i._transformStreamController.enqueue(n.value),i._reader.read().then(i._onRead)},this._onError=function(n){i._flushReject(n),i._transformStreamController.error(n),i._reader.cancel(n).catch(Ka),i._writer.abort(n).catch(Ka)},this._onTerminate=function(){i._flushResolve(),i._transformStreamController.terminate();var n=new TypeError("TransformStream terminated");i._writer.abort(n).catch(Ka)},this._reader=e,this._writer=r,this._flushPromise=new Promise(function(n,a){i._flushResolve=n,i._flushReject=a})}return t.prototype.start=function(e){this._transformStreamController=e,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var r=this._reader.closed;r&&r.then(this._onTerminate,this._onError)},t.prototype.transform=function(e){return this._writer.write(e)},t.prototype.flush=function(){var e=this;return this._writer.close().then(function(){return e._flushPromise})},t}(),_6=Object.freeze(Object.defineProperty({__proto__:null,createReadableStreamWrapper:p6,createTransformStreamWrapper:w6,createWrappingReadableSource:p1,createWrappingTransformer:Yh,createWrappingWritableSink:Zh,createWritableStreamWrapper:m6},Symbol.toStringTag,{value:"Module"}));/*! OpenPGP.js v5.7.0-1 - 2023-06-10 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var kt=jr(function(t){(function(e,r){function i(d,y){if(!d)throw Error(y||"Assertion failed")}function n(d,y){d.super_=y;var _=function(){};_.prototype=y.prototype,d.prototype=new _,d.prototype.constructor=d}function a(d,y,_){if(a.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&(y!=="le"&&y!=="be"||(_=y,y=10),this._init(d||0,y||10,_||"be"))}var s;typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{s=void 0}catch{}function o(d,y,_){for(var g=0,p=Math.min(d.length,_),E=y;E=49&&D<=54?D-49+10:D>=17&&D<=22?D-17+10:15&D}return g}function u(d,y,_,g){for(var p=0,E=Math.min(d.length,_),D=y;D=49?nt-49+10:nt>=17?nt-17+10:nt}return p}a.isBN=function(d){return d instanceof a||d!==null&&typeof d=="object"&&d.constructor.wordSize===a.wordSize&&Array.isArray(d.words)},a.max=function(d,y){return d.cmp(y)>0?d:y},a.min=function(d,y){return d.cmp(y)<0?d:y},a.prototype._init=function(d,y,_){if(typeof d=="number")return this._initNumber(d,y,_);if(typeof d=="object")return this._initArray(d,y,_);y==="hex"&&(y=16),i(y===(0|y)&&y>=2&&y<=36);var g=0;(d=d.toString().replace(/\s+/g,""))[0]==="-"&&g++,y===16?this._parseHex(d,g):this._parseBase(d,y,g),d[0]==="-"&&(this.negative=1),this.strip(),_==="le"&&this._initArray(this.toArray(),y,_)},a.prototype._initNumber=function(d,y,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[67108863&d],this.length=1):d<4503599627370496?(this.words=[67108863&d,d/67108864&67108863],this.length=2):(i(d<9007199254740992),this.words=[67108863&d,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),y,_)},a.prototype._initArray=function(d,y,_){if(i(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=Array(this.length);for(var g=0;g=0;g-=3)E=d[g]|d[g-1]<<8|d[g-2]<<16,this.words[p]|=E<>>26-D&67108863,(D+=24)>=26&&(D-=26,p++);else if(_==="le")for(g=0,p=0;g>>26-D&67108863,(D+=24)>=26&&(D-=26,p++);return this.strip()},a.prototype._parseHex=function(d,y){this.length=Math.ceil((d.length-y)/6),this.words=Array(this.length);for(var _=0;_=y;_-=6)p=o(d,_,_+6),this.words[g]|=p<>>26-E&4194303,(E+=24)>=26&&(E-=26,g++);_+6!==y&&(p=o(d,y,_+6),this.words[g]|=p<>>26-E&4194303),this.strip()},a.prototype._parseBase=function(d,y,_){this.words=[0],this.length=1;for(var g=0,p=1;p<=67108863;p*=y)g++;g--,p=p/y|0;for(var E=d.length-_,D=E%g,nt=Math.min(E,E-D)+_,st=0,q=_;q1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(d,y,_){_.negative=y.negative^d.negative;var g=d.length+y.length|0;_.length=g,g=g-1|0;var p=0|d.words[0],E=0|y.words[0],D=p*E,nt=67108863&D,st=D/67108864|0;_.words[0]=nt;for(var q=1;q>>26,ct=67108863&st,lt=Math.min(q,y.length-1),ut=Math.max(0,q-d.length+1);ut<=lt;ut++){var dt=q-ut|0;rt+=(D=(p=0|d.words[dt])*(E=0|y.words[ut])+ct)/67108864|0,ct=67108863&D}_.words[q]=0|ct,st=0|rt}return st!==0?_.words[q]=0|st:_.length--,_.strip()}a.prototype.toString=function(d,y){var _;if(y=0|y||1,(d=d||10)===16||d==="hex"){_="";for(var g=0,p=0,E=0;E>>24-g&16777215)!==0||E!==this.length-1?c[6-nt.length]+nt+_:nt+_,(g+=2)>=26&&(g-=26,E--)}for(p!==0&&(_=p.toString(16)+_);_.length%y!=0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(0|d)&&d>=2&&d<=36){var st=h[d],q=f[d];_="";var rt=this.clone();for(rt.negative=0;!rt.isZero();){var ct=rt.modn(q).toString(d);_=(rt=rt.idivn(q)).isZero()?ct+_:c[st-ct.length]+ct+_}for(this.isZero()&&(_="0"+_);_.length%y!=0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=67108864*this.words[1]:this.length===3&&this.words[2]===1?d+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(d,y){return i(s!==void 0),this.toArrayLike(s,d,y)},a.prototype.toArray=function(d,y){return this.toArrayLike(Array,d,y)},a.prototype.toArrayLike=function(d,y,_){var g=this.byteLength(),p=_||Math.max(1,g);i(g<=p,"byte array longer than desired length"),i(p>0,"Requested array length <= 0"),this.strip();var E,D,nt=y==="le",st=new d(p),q=this.clone();if(nt){for(D=0;!q.isZero();D++)E=q.andln(255),q.iushrn(8),st[D]=E;for(;D=4096&&(_+=13,y>>>=13),y>=64&&(_+=7,y>>>=7),y>=8&&(_+=4,y>>>=4),y>=2&&(_+=2,y>>>=2),_+y},a.prototype._zeroBits=function(d){if(d===0)return 26;var y=d,_=0;return(8191&y)==0&&(_+=13,y>>>=13),(127&y)==0&&(_+=7,y>>>=7),(15&y)==0&&(_+=4,y>>>=4),(3&y)==0&&(_+=2,y>>>=2),(1&y)==0&&_++,_},a.prototype.bitLength=function(){var d=this.words[this.length-1],y=this._countBits(d);return 26*(this.length-1)+y},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,y=0;yd.length?this.clone().ior(d):d.clone().ior(this)},a.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},a.prototype.iuand=function(d){var y;y=this.length>d.length?d:this;for(var _=0;_d.length?this.clone().iand(d):d.clone().iand(this)},a.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},a.prototype.iuxor=function(d){var y,_;this.length>d.length?(y=this,_=d):(y=d,_=this);for(var g=0;g<_.length;g++)this.words[g]=y.words[g]^_.words[g];if(this!==y)for(;gd.length?this.clone().ixor(d):d.clone().ixor(this)},a.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},a.prototype.inotn=function(d){i(typeof d=="number"&&d>=0);var y=0|Math.ceil(d/26),_=d%26;this._expand(y),_>0&&y--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-_),this.strip()},a.prototype.notn=function(d){return this.clone().inotn(d)},a.prototype.setn=function(d,y){i(typeof d=="number"&&d>=0);var _=d/26|0,g=d%26;return this._expand(_+1),this.words[_]=y?this.words[_]|1<d.length?(_=this,g=d):(_=d,g=this);for(var p=0,E=0;E>>26;for(;p!==0&&E<_.length;E++)y=(0|_.words[E])+p,this.words[E]=67108863&y,p=y>>>26;if(this.length=_.length,p!==0)this.words[this.length]=p,this.length++;else if(_!==this)for(;E<_.length;E++)this.words[E]=_.words[E];return this},a.prototype.add=function(d){var y;return d.negative!==0&&this.negative===0?(d.negative=0,y=this.sub(d),d.negative^=1,y):d.negative===0&&this.negative!==0?(this.negative=0,y=d.sub(this),this.negative=1,y):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},a.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var y=this.iadd(d);return d.negative=1,y._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _,g,p=this.cmp(d);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;p>0?(_=this,g=d):(_=d,g=this);for(var E=0,D=0;D>26,this.words[D]=67108863&y;for(;E!==0&&D<_.length;D++)E=(y=(0|_.words[D])+E)>>26,this.words[D]=67108863&y;if(E===0&&D<_.length&&_!==this)for(;D<_.length;D++)this.words[D]=_.words[D];return this.length=Math.max(this.length,D),_!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(d){return this.clone().isub(d)};var b=function(d,y,_){var g,p,E,D=d.words,nt=y.words,st=_.words,q=0,rt=0|D[0],ct=8191&rt,lt=rt>>>13,ut=0|D[1],dt=8191&ut,wt=ut>>>13,mt=0|D[2],B=8191&mt,Z=mt>>>13,x=0|D[3],l=8191&x,z=x>>>13,et=0|D[4],tt=8191&et,it=et>>>13,k=0|D[5],w=8191&k,A=k>>>13,C=0|D[6],$=8191&C,T=C>>>13,W=0|D[7],yt=8191&W,ft=W>>>13,gt=0|D[8],O=8191>,F=gt>>>13,j=0|D[9],L=8191&j,N=j>>>13,H=0|nt[0],P=8191&H,S=H>>>13,bt=0|nt[1],ht=8191&bt,Pt=bt>>>13,Lt=0|nt[2],Dt=8191&Lt,Ct=Lt>>>13,Xt=0|nt[3],zt=8191&Xt,Ot=Xt>>>13,ue=0|nt[4],Mt=8191&ue,Rt=ue>>>13,Nt=0|nt[5],Et=8191&Nt,Bt=Nt>>>13,Zt=0|nt[6],It=8191&Zt,at=Zt>>>13,ot=0|nt[7],pt=8191&ot,_t=ot>>>13,Kt=0|nt[8],xt=8191&Kt,St=Kt>>>13,Ht=0|nt[9],Tt=8191&Ht,Gt=Ht>>>13;_.negative=d.negative^y.negative,_.length=19;var Ie=(q+(g=Math.imul(ct,P))|0)+((8191&(p=(p=Math.imul(ct,S))+Math.imul(lt,P)|0))<<13)|0;q=((E=Math.imul(lt,S))+(p>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,g=Math.imul(dt,P),p=(p=Math.imul(dt,S))+Math.imul(wt,P)|0,E=Math.imul(wt,S);var Ue=(q+(g=g+Math.imul(ct,ht)|0)|0)+((8191&(p=(p=p+Math.imul(ct,Pt)|0)+Math.imul(lt,ht)|0))<<13)|0;q=((E=E+Math.imul(lt,Pt)|0)+(p>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,g=Math.imul(B,P),p=(p=Math.imul(B,S))+Math.imul(Z,P)|0,E=Math.imul(Z,S),g=g+Math.imul(dt,ht)|0,p=(p=p+Math.imul(dt,Pt)|0)+Math.imul(wt,ht)|0,E=E+Math.imul(wt,Pt)|0;var Fe=(q+(g=g+Math.imul(ct,Dt)|0)|0)+((8191&(p=(p=p+Math.imul(ct,Ct)|0)+Math.imul(lt,Dt)|0))<<13)|0;q=((E=E+Math.imul(lt,Ct)|0)+(p>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,g=Math.imul(l,P),p=(p=Math.imul(l,S))+Math.imul(z,P)|0,E=Math.imul(z,S),g=g+Math.imul(B,ht)|0,p=(p=p+Math.imul(B,Pt)|0)+Math.imul(Z,ht)|0,E=E+Math.imul(Z,Pt)|0,g=g+Math.imul(dt,Dt)|0,p=(p=p+Math.imul(dt,Ct)|0)+Math.imul(wt,Dt)|0,E=E+Math.imul(wt,Ct)|0;var fr=(q+(g=g+Math.imul(ct,zt)|0)|0)+((8191&(p=(p=p+Math.imul(ct,Ot)|0)+Math.imul(lt,zt)|0))<<13)|0;q=((E=E+Math.imul(lt,Ot)|0)+(p>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(tt,P),p=(p=Math.imul(tt,S))+Math.imul(it,P)|0,E=Math.imul(it,S),g=g+Math.imul(l,ht)|0,p=(p=p+Math.imul(l,Pt)|0)+Math.imul(z,ht)|0,E=E+Math.imul(z,Pt)|0,g=g+Math.imul(B,Dt)|0,p=(p=p+Math.imul(B,Ct)|0)+Math.imul(Z,Dt)|0,E=E+Math.imul(Z,Ct)|0,g=g+Math.imul(dt,zt)|0,p=(p=p+Math.imul(dt,Ot)|0)+Math.imul(wt,zt)|0,E=E+Math.imul(wt,Ot)|0;var lr=(q+(g=g+Math.imul(ct,Mt)|0)|0)+((8191&(p=(p=p+Math.imul(ct,Rt)|0)+Math.imul(lt,Mt)|0))<<13)|0;q=((E=E+Math.imul(lt,Rt)|0)+(p>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(w,P),p=(p=Math.imul(w,S))+Math.imul(A,P)|0,E=Math.imul(A,S),g=g+Math.imul(tt,ht)|0,p=(p=p+Math.imul(tt,Pt)|0)+Math.imul(it,ht)|0,E=E+Math.imul(it,Pt)|0,g=g+Math.imul(l,Dt)|0,p=(p=p+Math.imul(l,Ct)|0)+Math.imul(z,Dt)|0,E=E+Math.imul(z,Ct)|0,g=g+Math.imul(B,zt)|0,p=(p=p+Math.imul(B,Ot)|0)+Math.imul(Z,zt)|0,E=E+Math.imul(Z,Ot)|0,g=g+Math.imul(dt,Mt)|0,p=(p=p+Math.imul(dt,Rt)|0)+Math.imul(wt,Mt)|0,E=E+Math.imul(wt,Rt)|0;var pr=(q+(g=g+Math.imul(ct,Et)|0)|0)+((8191&(p=(p=p+Math.imul(ct,Bt)|0)+Math.imul(lt,Et)|0))<<13)|0;q=((E=E+Math.imul(lt,Bt)|0)+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,g=Math.imul($,P),p=(p=Math.imul($,S))+Math.imul(T,P)|0,E=Math.imul(T,S),g=g+Math.imul(w,ht)|0,p=(p=p+Math.imul(w,Pt)|0)+Math.imul(A,ht)|0,E=E+Math.imul(A,Pt)|0,g=g+Math.imul(tt,Dt)|0,p=(p=p+Math.imul(tt,Ct)|0)+Math.imul(it,Dt)|0,E=E+Math.imul(it,Ct)|0,g=g+Math.imul(l,zt)|0,p=(p=p+Math.imul(l,Ot)|0)+Math.imul(z,zt)|0,E=E+Math.imul(z,Ot)|0,g=g+Math.imul(B,Mt)|0,p=(p=p+Math.imul(B,Rt)|0)+Math.imul(Z,Mt)|0,E=E+Math.imul(Z,Rt)|0,g=g+Math.imul(dt,Et)|0,p=(p=p+Math.imul(dt,Bt)|0)+Math.imul(wt,Et)|0,E=E+Math.imul(wt,Bt)|0;var yr=(q+(g=g+Math.imul(ct,It)|0)|0)+((8191&(p=(p=p+Math.imul(ct,at)|0)+Math.imul(lt,It)|0))<<13)|0;q=((E=E+Math.imul(lt,at)|0)+(p>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(yt,P),p=(p=Math.imul(yt,S))+Math.imul(ft,P)|0,E=Math.imul(ft,S),g=g+Math.imul($,ht)|0,p=(p=p+Math.imul($,Pt)|0)+Math.imul(T,ht)|0,E=E+Math.imul(T,Pt)|0,g=g+Math.imul(w,Dt)|0,p=(p=p+Math.imul(w,Ct)|0)+Math.imul(A,Dt)|0,E=E+Math.imul(A,Ct)|0,g=g+Math.imul(tt,zt)|0,p=(p=p+Math.imul(tt,Ot)|0)+Math.imul(it,zt)|0,E=E+Math.imul(it,Ot)|0,g=g+Math.imul(l,Mt)|0,p=(p=p+Math.imul(l,Rt)|0)+Math.imul(z,Mt)|0,E=E+Math.imul(z,Rt)|0,g=g+Math.imul(B,Et)|0,p=(p=p+Math.imul(B,Bt)|0)+Math.imul(Z,Et)|0,E=E+Math.imul(Z,Bt)|0,g=g+Math.imul(dt,It)|0,p=(p=p+Math.imul(dt,at)|0)+Math.imul(wt,It)|0,E=E+Math.imul(wt,at)|0;var br=(q+(g=g+Math.imul(ct,pt)|0)|0)+((8191&(p=(p=p+Math.imul(ct,_t)|0)+Math.imul(lt,pt)|0))<<13)|0;q=((E=E+Math.imul(lt,_t)|0)+(p>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(O,P),p=(p=Math.imul(O,S))+Math.imul(F,P)|0,E=Math.imul(F,S),g=g+Math.imul(yt,ht)|0,p=(p=p+Math.imul(yt,Pt)|0)+Math.imul(ft,ht)|0,E=E+Math.imul(ft,Pt)|0,g=g+Math.imul($,Dt)|0,p=(p=p+Math.imul($,Ct)|0)+Math.imul(T,Dt)|0,E=E+Math.imul(T,Ct)|0,g=g+Math.imul(w,zt)|0,p=(p=p+Math.imul(w,Ot)|0)+Math.imul(A,zt)|0,E=E+Math.imul(A,Ot)|0,g=g+Math.imul(tt,Mt)|0,p=(p=p+Math.imul(tt,Rt)|0)+Math.imul(it,Mt)|0,E=E+Math.imul(it,Rt)|0,g=g+Math.imul(l,Et)|0,p=(p=p+Math.imul(l,Bt)|0)+Math.imul(z,Et)|0,E=E+Math.imul(z,Bt)|0,g=g+Math.imul(B,It)|0,p=(p=p+Math.imul(B,at)|0)+Math.imul(Z,It)|0,E=E+Math.imul(Z,at)|0,g=g+Math.imul(dt,pt)|0,p=(p=p+Math.imul(dt,_t)|0)+Math.imul(wt,pt)|0,E=E+Math.imul(wt,_t)|0;var mr=(q+(g=g+Math.imul(ct,xt)|0)|0)+((8191&(p=(p=p+Math.imul(ct,St)|0)+Math.imul(lt,xt)|0))<<13)|0;q=((E=E+Math.imul(lt,St)|0)+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,g=Math.imul(L,P),p=(p=Math.imul(L,S))+Math.imul(N,P)|0,E=Math.imul(N,S),g=g+Math.imul(O,ht)|0,p=(p=p+Math.imul(O,Pt)|0)+Math.imul(F,ht)|0,E=E+Math.imul(F,Pt)|0,g=g+Math.imul(yt,Dt)|0,p=(p=p+Math.imul(yt,Ct)|0)+Math.imul(ft,Dt)|0,E=E+Math.imul(ft,Ct)|0,g=g+Math.imul($,zt)|0,p=(p=p+Math.imul($,Ot)|0)+Math.imul(T,zt)|0,E=E+Math.imul(T,Ot)|0,g=g+Math.imul(w,Mt)|0,p=(p=p+Math.imul(w,Rt)|0)+Math.imul(A,Mt)|0,E=E+Math.imul(A,Rt)|0,g=g+Math.imul(tt,Et)|0,p=(p=p+Math.imul(tt,Bt)|0)+Math.imul(it,Et)|0,E=E+Math.imul(it,Bt)|0,g=g+Math.imul(l,It)|0,p=(p=p+Math.imul(l,at)|0)+Math.imul(z,It)|0,E=E+Math.imul(z,at)|0,g=g+Math.imul(B,pt)|0,p=(p=p+Math.imul(B,_t)|0)+Math.imul(Z,pt)|0,E=E+Math.imul(Z,_t)|0,g=g+Math.imul(dt,xt)|0,p=(p=p+Math.imul(dt,St)|0)+Math.imul(wt,xt)|0,E=E+Math.imul(wt,St)|0;var gr=(q+(g=g+Math.imul(ct,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(ct,Gt)|0)+Math.imul(lt,Tt)|0))<<13)|0;q=((E=E+Math.imul(lt,Gt)|0)+(p>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul(L,ht),p=(p=Math.imul(L,Pt))+Math.imul(N,ht)|0,E=Math.imul(N,Pt),g=g+Math.imul(O,Dt)|0,p=(p=p+Math.imul(O,Ct)|0)+Math.imul(F,Dt)|0,E=E+Math.imul(F,Ct)|0,g=g+Math.imul(yt,zt)|0,p=(p=p+Math.imul(yt,Ot)|0)+Math.imul(ft,zt)|0,E=E+Math.imul(ft,Ot)|0,g=g+Math.imul($,Mt)|0,p=(p=p+Math.imul($,Rt)|0)+Math.imul(T,Mt)|0,E=E+Math.imul(T,Rt)|0,g=g+Math.imul(w,Et)|0,p=(p=p+Math.imul(w,Bt)|0)+Math.imul(A,Et)|0,E=E+Math.imul(A,Bt)|0,g=g+Math.imul(tt,It)|0,p=(p=p+Math.imul(tt,at)|0)+Math.imul(it,It)|0,E=E+Math.imul(it,at)|0,g=g+Math.imul(l,pt)|0,p=(p=p+Math.imul(l,_t)|0)+Math.imul(z,pt)|0,E=E+Math.imul(z,_t)|0,g=g+Math.imul(B,xt)|0,p=(p=p+Math.imul(B,St)|0)+Math.imul(Z,xt)|0,E=E+Math.imul(Z,St)|0;var Wr=(q+(g=g+Math.imul(dt,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(dt,Gt)|0)+Math.imul(wt,Tt)|0))<<13)|0;q=((E=E+Math.imul(wt,Gt)|0)+(p>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,g=Math.imul(L,Dt),p=(p=Math.imul(L,Ct))+Math.imul(N,Dt)|0,E=Math.imul(N,Ct),g=g+Math.imul(O,zt)|0,p=(p=p+Math.imul(O,Ot)|0)+Math.imul(F,zt)|0,E=E+Math.imul(F,Ot)|0,g=g+Math.imul(yt,Mt)|0,p=(p=p+Math.imul(yt,Rt)|0)+Math.imul(ft,Mt)|0,E=E+Math.imul(ft,Rt)|0,g=g+Math.imul($,Et)|0,p=(p=p+Math.imul($,Bt)|0)+Math.imul(T,Et)|0,E=E+Math.imul(T,Bt)|0,g=g+Math.imul(w,It)|0,p=(p=p+Math.imul(w,at)|0)+Math.imul(A,It)|0,E=E+Math.imul(A,at)|0,g=g+Math.imul(tt,pt)|0,p=(p=p+Math.imul(tt,_t)|0)+Math.imul(it,pt)|0,E=E+Math.imul(it,_t)|0,g=g+Math.imul(l,xt)|0,p=(p=p+Math.imul(l,St)|0)+Math.imul(z,xt)|0,E=E+Math.imul(z,St)|0;var Hr=(q+(g=g+Math.imul(B,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(B,Gt)|0)+Math.imul(Z,Tt)|0))<<13)|0;q=((E=E+Math.imul(Z,Gt)|0)+(p>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,g=Math.imul(L,zt),p=(p=Math.imul(L,Ot))+Math.imul(N,zt)|0,E=Math.imul(N,Ot),g=g+Math.imul(O,Mt)|0,p=(p=p+Math.imul(O,Rt)|0)+Math.imul(F,Mt)|0,E=E+Math.imul(F,Rt)|0,g=g+Math.imul(yt,Et)|0,p=(p=p+Math.imul(yt,Bt)|0)+Math.imul(ft,Et)|0,E=E+Math.imul(ft,Bt)|0,g=g+Math.imul($,It)|0,p=(p=p+Math.imul($,at)|0)+Math.imul(T,It)|0,E=E+Math.imul(T,at)|0,g=g+Math.imul(w,pt)|0,p=(p=p+Math.imul(w,_t)|0)+Math.imul(A,pt)|0,E=E+Math.imul(A,_t)|0,g=g+Math.imul(tt,xt)|0,p=(p=p+Math.imul(tt,St)|0)+Math.imul(it,xt)|0,E=E+Math.imul(it,St)|0;var li=(q+(g=g+Math.imul(l,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(l,Gt)|0)+Math.imul(z,Tt)|0))<<13)|0;q=((E=E+Math.imul(z,Gt)|0)+(p>>>13)|0)+(li>>>26)|0,li&=67108863,g=Math.imul(L,Mt),p=(p=Math.imul(L,Rt))+Math.imul(N,Mt)|0,E=Math.imul(N,Rt),g=g+Math.imul(O,Et)|0,p=(p=p+Math.imul(O,Bt)|0)+Math.imul(F,Et)|0,E=E+Math.imul(F,Bt)|0,g=g+Math.imul(yt,It)|0,p=(p=p+Math.imul(yt,at)|0)+Math.imul(ft,It)|0,E=E+Math.imul(ft,at)|0,g=g+Math.imul($,pt)|0,p=(p=p+Math.imul($,_t)|0)+Math.imul(T,pt)|0,E=E+Math.imul(T,_t)|0,g=g+Math.imul(w,xt)|0,p=(p=p+Math.imul(w,St)|0)+Math.imul(A,xt)|0,E=E+Math.imul(A,St)|0;var pi=(q+(g=g+Math.imul(tt,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(tt,Gt)|0)+Math.imul(it,Tt)|0))<<13)|0;q=((E=E+Math.imul(it,Gt)|0)+(p>>>13)|0)+(pi>>>26)|0,pi&=67108863,g=Math.imul(L,Et),p=(p=Math.imul(L,Bt))+Math.imul(N,Et)|0,E=Math.imul(N,Bt),g=g+Math.imul(O,It)|0,p=(p=p+Math.imul(O,at)|0)+Math.imul(F,It)|0,E=E+Math.imul(F,at)|0,g=g+Math.imul(yt,pt)|0,p=(p=p+Math.imul(yt,_t)|0)+Math.imul(ft,pt)|0,E=E+Math.imul(ft,_t)|0,g=g+Math.imul($,xt)|0,p=(p=p+Math.imul($,St)|0)+Math.imul(T,xt)|0,E=E+Math.imul(T,St)|0;var yi=(q+(g=g+Math.imul(w,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(w,Gt)|0)+Math.imul(A,Tt)|0))<<13)|0;q=((E=E+Math.imul(A,Gt)|0)+(p>>>13)|0)+(yi>>>26)|0,yi&=67108863,g=Math.imul(L,It),p=(p=Math.imul(L,at))+Math.imul(N,It)|0,E=Math.imul(N,at),g=g+Math.imul(O,pt)|0,p=(p=p+Math.imul(O,_t)|0)+Math.imul(F,pt)|0,E=E+Math.imul(F,_t)|0,g=g+Math.imul(yt,xt)|0,p=(p=p+Math.imul(yt,St)|0)+Math.imul(ft,xt)|0,E=E+Math.imul(ft,St)|0;var bi=(q+(g=g+Math.imul($,Tt)|0)|0)+((8191&(p=(p=p+Math.imul($,Gt)|0)+Math.imul(T,Tt)|0))<<13)|0;q=((E=E+Math.imul(T,Gt)|0)+(p>>>13)|0)+(bi>>>26)|0,bi&=67108863,g=Math.imul(L,pt),p=(p=Math.imul(L,_t))+Math.imul(N,pt)|0,E=Math.imul(N,_t),g=g+Math.imul(O,xt)|0,p=(p=p+Math.imul(O,St)|0)+Math.imul(F,xt)|0,E=E+Math.imul(F,St)|0;var mi=(q+(g=g+Math.imul(yt,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(yt,Gt)|0)+Math.imul(ft,Tt)|0))<<13)|0;q=((E=E+Math.imul(ft,Gt)|0)+(p>>>13)|0)+(mi>>>26)|0,mi&=67108863,g=Math.imul(L,xt),p=(p=Math.imul(L,St))+Math.imul(N,xt)|0,E=Math.imul(N,St);var gi=(q+(g=g+Math.imul(O,Tt)|0)|0)+((8191&(p=(p=p+Math.imul(O,Gt)|0)+Math.imul(F,Tt)|0))<<13)|0;q=((E=E+Math.imul(F,Gt)|0)+(p>>>13)|0)+(gi>>>26)|0,gi&=67108863;var Hi=(q+(g=Math.imul(L,Tt))|0)+((8191&(p=(p=Math.imul(L,Gt))+Math.imul(N,Tt)|0))<<13)|0;return q=((E=Math.imul(N,Gt))+(p>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,st[0]=Ie,st[1]=Ue,st[2]=Fe,st[3]=fr,st[4]=lr,st[5]=pr,st[6]=yr,st[7]=br,st[8]=mr,st[9]=gr,st[10]=Wr,st[11]=Hr,st[12]=li,st[13]=pi,st[14]=yi,st[15]=bi,st[16]=mi,st[17]=gi,st[18]=Hi,q!==0&&(st[19]=q,_.length++),_};function K(d,y,_){return new I().mulp(d,y,_)}function I(d,y){this.x=d,this.y=y}Math.imul||(b=m),a.prototype.mulTo=function(d,y){var _,g=this.length+d.length;return _=this.length===10&&d.length===10?b(this,d,y):g<63?m(this,d,y):g<1024?function(p,E,D){D.negative=E.negative^p.negative,D.length=p.length+E.length;for(var nt=0,st=0,q=0;q>>26)|0)>>>26,rt&=67108863}D.words[q]=ct,nt=rt,rt=st}return nt!==0?D.words[q]=nt:D.length--,D.strip()}(this,d,y):K(this,d,y),_},I.prototype.makeRBT=function(d){for(var y=Array(d),_=a.prototype._countBits(d)-1,g=0;g>=1;return g},I.prototype.permute=function(d,y,_,g,p,E){for(var D=0;D>>=1)p++;return 1<>>=13,_[2*E+1]=8191&p,p>>>=13;for(E=2*y;E>=26,y+=g/67108864|0,y+=p>>>26,this.words[_]=67108863&p}return y!==0&&(this.words[_]=y,this.length++),this},a.prototype.muln=function(d){return this.clone().imuln(d)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(d){var y=function(E){for(var D=Array(E.bitLength()),nt=0;nt>>q}return D}(d);if(y.length===0)return new a(1);for(var _=this,g=0;g=0);var y,_=d%26,g=(d-_)/26,p=67108863>>>26-_<<26-_;if(_!==0){var E=0;for(y=0;y>>26-_}E&&(this.words[y]=E,this.length++)}if(g!==0){for(y=this.length-1;y>=0;y--)this.words[y+g]=this.words[y];for(y=0;y=0),g=y?(y-y%26)/26:0;var p=d%26,E=Math.min((d-p)/26,this.length),D=67108863^67108863>>>p<E)for(this.length-=E,st=0;st=0&&(q!==0||st>=g);st--){var rt=0|this.words[st];this.words[st]=q<<26-p|rt>>>p,q=rt&D}return nt&&q!==0&&(nt.words[nt.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(d,y,_){return i(this.negative===0),this.iushrn(d,y,_)},a.prototype.shln=function(d){return this.clone().ishln(d)},a.prototype.ushln=function(d){return this.clone().iushln(d)},a.prototype.shrn=function(d){return this.clone().ishrn(d)},a.prototype.ushrn=function(d){return this.clone().iushrn(d)},a.prototype.testn=function(d){i(typeof d=="number"&&d>=0);var y=d%26,_=(d-y)/26,g=1<=0);var y=d%26,_=(d-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(y!==0&&_++,this.length=Math.min(_,this.length),y!==0){var g=67108863^67108863>>>y<=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},a.prototype.isubn=function(d){if(i(typeof d=="number"),i(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y>26)-(nt/67108864|0),this.words[g+_]=67108863&p}for(;g>26,this.words[g+_]=67108863&p;if(D===0)return this.strip();for(i(D===-1),D=0,g=0;g>26,this.words[g]=67108863&p;return this.negative=1,this.strip()},a.prototype._wordDiv=function(d,y){var _=(this.length,d.length),g=this.clone(),p=d,E=0|p.words[p.length-1];(_=26-this._countBits(E))!==0&&(p=p.ushln(_),g.iushln(_),E=0|p.words[p.length-1]);var D,nt=g.length-p.length;if(y!=="mod"){(D=new a(null)).length=nt+1,D.words=Array(D.length);for(var st=0;st=0;rt--){var ct=67108864*(0|g.words[p.length+rt])+(0|g.words[p.length+rt-1]);for(ct=Math.min(ct/E|0,67108863),g._ishlnsubmul(p,ct,rt);g.negative!==0;)ct--,g.negative=0,g._ishlnsubmul(p,1,rt),g.isZero()||(g.negative^=1);D&&(D.words[rt]=ct)}return D&&D.strip(),g.strip(),y!=="div"&&_!==0&&g.iushrn(_),{div:D||null,mod:g}},a.prototype.divmod=function(d,y,_){return i(!d.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:this.negative!==0&&d.negative===0?(E=this.neg().divmod(d,y),y!=="mod"&&(g=E.div.neg()),y!=="div"&&(p=E.mod.neg(),_&&p.negative!==0&&p.iadd(d)),{div:g,mod:p}):this.negative===0&&d.negative!==0?(E=this.divmod(d.neg(),y),y!=="mod"&&(g=E.div.neg()),{div:g,mod:E.mod}):(this.negative&d.negative)!=0?(E=this.neg().divmod(d.neg(),y),y!=="div"&&(p=E.mod.neg(),_&&p.negative!==0&&p.isub(d)),{div:E.div,mod:p}):d.length>this.length||this.cmp(d)<0?{div:new a(0),mod:this}:d.length===1?y==="div"?{div:this.divn(d.words[0]),mod:null}:y==="mod"?{div:null,mod:new a(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new a(this.modn(d.words[0]))}:this._wordDiv(d,y);var g,p,E},a.prototype.div=function(d){return this.divmod(d,"div",!1).div},a.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},a.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},a.prototype.divRound=function(d){var y=this.divmod(d);if(y.mod.isZero())return y.div;var _=y.div.negative!==0?y.mod.isub(d):y.mod,g=d.ushrn(1),p=d.andln(1),E=_.cmp(g);return E<0||p===1&&E===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},a.prototype.modn=function(d){i(d<=67108863);for(var y=(1<<26)%d,_=0,g=this.length-1;g>=0;g--)_=(y*_+(0|this.words[g]))%d;return _},a.prototype.idivn=function(d){i(d<=67108863);for(var y=0,_=this.length-1;_>=0;_--){var g=(0|this.words[_])+67108864*y;this.words[_]=g/d|0,y=g%d}return this.strip()},a.prototype.divn=function(d){return this.clone().idivn(d)},a.prototype.egcd=function(d){i(d.negative===0),i(!d.isZero());var y=this,_=d.clone();y=y.negative!==0?y.umod(d):y.clone();for(var g=new a(1),p=new a(0),E=new a(0),D=new a(1),nt=0;y.isEven()&&_.isEven();)y.iushrn(1),_.iushrn(1),++nt;for(var st=_.clone(),q=y.clone();!y.isZero();){for(var rt=0,ct=1;(y.words[0]&ct)==0&&rt<26;++rt,ct<<=1);if(rt>0)for(y.iushrn(rt);rt-- >0;)(g.isOdd()||p.isOdd())&&(g.iadd(st),p.isub(q)),g.iushrn(1),p.iushrn(1);for(var lt=0,ut=1;(_.words[0]&ut)==0&<<26;++lt,ut<<=1);if(lt>0)for(_.iushrn(lt);lt-- >0;)(E.isOdd()||D.isOdd())&&(E.iadd(st),D.isub(q)),E.iushrn(1),D.iushrn(1);y.cmp(_)>=0?(y.isub(_),g.isub(E),p.isub(D)):(_.isub(y),E.isub(g),D.isub(p))}return{a:E,b:D,gcd:_.iushln(nt)}},a.prototype._invmp=function(d){i(d.negative===0),i(!d.isZero());var y=this,_=d.clone();y=y.negative!==0?y.umod(d):y.clone();for(var g,p=new a(1),E=new a(0),D=_.clone();y.cmpn(1)>0&&_.cmpn(1)>0;){for(var nt=0,st=1;(y.words[0]&st)==0&&nt<26;++nt,st<<=1);if(nt>0)for(y.iushrn(nt);nt-- >0;)p.isOdd()&&p.iadd(D),p.iushrn(1);for(var q=0,rt=1;(_.words[0]&rt)==0&&q<26;++q,rt<<=1);if(q>0)for(_.iushrn(q);q-- >0;)E.isOdd()&&E.iadd(D),E.iushrn(1);y.cmp(_)>=0?(y.isub(_),p.isub(E)):(_.isub(y),E.isub(p))}return(g=y.cmpn(1)===0?p:E).cmpn(0)<0&&g.iadd(d),g},a.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var y=this.clone(),_=d.clone();y.negative=0,_.negative=0;for(var g=0;y.isEven()&&_.isEven();g++)y.iushrn(1),_.iushrn(1);for(;;){for(;y.isEven();)y.iushrn(1);for(;_.isEven();)_.iushrn(1);var p=y.cmp(_);if(p<0){var E=y;y=_,_=E}else if(p===0||_.cmpn(1)===0)break;y.isub(_)}return _.iushln(g)},a.prototype.invm=function(d){return this.egcd(d).a.umod(d)},a.prototype.isEven=function(){return(1&this.words[0])==0},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(d){return this.words[0]&d},a.prototype.bincn=function(d){i(typeof d=="number");var y=d%26,_=(d-y)/26,g=1<>>26,D&=67108863,this.words[E]=D}return p!==0&&(this.words[E]=p,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(d){var y,_=d<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;if(this.strip(),this.length>1)y=1;else{_&&(d=-d),i(d<=67108863,"Number is too big");var g=0|this.words[0];y=g===d?0:gd.length)return 1;if(this.length=0;_--){var g=0|this.words[_],p=0|d.words[_];if(g!==p){gp&&(y=1);break}}return y},a.prototype.gtn=function(d){return this.cmpn(d)===1},a.prototype.gt=function(d){return this.cmp(d)===1},a.prototype.gten=function(d){return this.cmpn(d)>=0},a.prototype.gte=function(d){return this.cmp(d)>=0},a.prototype.ltn=function(d){return this.cmpn(d)===-1},a.prototype.lt=function(d){return this.cmp(d)===-1},a.prototype.lten=function(d){return this.cmpn(d)<=0},a.prototype.lte=function(d){return this.cmp(d)<=0},a.prototype.eqn=function(d){return this.cmpn(d)===0},a.prototype.eq=function(d){return this.cmp(d)===0},a.red=function(d){return new V(d)},a.prototype.toRed=function(d){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(d){return this.red=d,this},a.prototype.forceRed=function(d){return i(!this.red,"Already a number in reduction context"),this._forceRed(d)},a.prototype.redAdd=function(d){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},a.prototype.redIAdd=function(d){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},a.prototype.redSub=function(d){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},a.prototype.redISub=function(d){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},a.prototype.redShl=function(d){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},a.prototype.redMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},a.prototype.redIMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(d){return i(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var U={k256:null,p224:null,p192:null,p25519:null};function G(d,y){this.name=d,this.p=new a(y,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function Q(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Y(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function R(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function V(d){if(typeof d=="string"){var y=a._prime(d);this.m=y.p,this.prime=y}else i(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}function X(d){V.call(this,d),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}G.prototype._tmp=function(){var d=new a(null);return d.words=Array(Math.ceil(this.n/13)),d},G.prototype.ireduce=function(d){var y,_=d;do this.split(_,this.tmp),y=(_=(_=this.imulK(_)).iadd(this.tmp)).bitLength();while(y>this.n);var g=y0?_.isub(this.p):_.strip(),_},G.prototype.split=function(d,y){d.iushrn(this.n,0,y)},G.prototype.imulK=function(d){return d.imul(this.k)},n(Q,G),Q.prototype.split=function(d,y){for(var _=4194303,g=Math.min(d.length,9),p=0;p>>22,E=D}E>>>=22,d.words[p-10]=E,E===0&&d.length>10?d.length-=10:d.length-=9},Q.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var y=0,_=0;_>>=26,d.words[_]=p,y=g}return y!==0&&(d.words[d.length++]=y),d},a._prime=function(d){if(U[d])return U[d];var y;if(d==="k256")y=new Q;else if(d==="p224")y=new Y;else if(d==="p192")y=new R;else{if(d!=="p25519")throw Error("Unknown prime "+d);y=new J}return U[d]=y,y},V.prototype._verify1=function(d){i(d.negative===0,"red works only with positives"),i(d.red,"red works only with red numbers")},V.prototype._verify2=function(d,y){i((d.negative|y.negative)==0,"red works only with positives"),i(d.red&&d.red===y.red,"red works only with red numbers")},V.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},V.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},V.prototype.add=function(d,y){this._verify2(d,y);var _=d.add(y);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},V.prototype.iadd=function(d,y){this._verify2(d,y);var _=d.iadd(y);return _.cmp(this.m)>=0&&_.isub(this.m),_},V.prototype.sub=function(d,y){this._verify2(d,y);var _=d.sub(y);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},V.prototype.isub=function(d,y){this._verify2(d,y);var _=d.isub(y);return _.cmpn(0)<0&&_.iadd(this.m),_},V.prototype.shl=function(d,y){return this._verify1(d),this.imod(d.ushln(y))},V.prototype.imul=function(d,y){return this._verify2(d,y),this.imod(d.imul(y))},V.prototype.mul=function(d,y){return this._verify2(d,y),this.imod(d.mul(y))},V.prototype.isqr=function(d){return this.imul(d,d.clone())},V.prototype.sqr=function(d){return this.mul(d,d)},V.prototype.sqrt=function(d){if(d.isZero())return d.clone();var y=this.m.andln(3);if(i(y%2==1),y===3){var _=this.m.add(new a(1)).iushrn(2);return this.pow(d,_)}for(var g=this.m.subn(1),p=0;!g.isZero()&&g.andln(1)===0;)p++,g.iushrn(1);i(!g.isZero());var E=new a(1).toRed(this),D=E.redNeg(),nt=this.m.subn(1).iushrn(1),st=this.m.bitLength();for(st=new a(2*st*st).toRed(this);this.pow(st,nt).cmp(D)!==0;)st.redIAdd(D);for(var q=this.pow(st,g),rt=this.pow(d,g.addn(1).iushrn(1)),ct=this.pow(d,g),lt=p;ct.cmp(E)!==0;){for(var ut=ct,dt=0;ut.cmp(E)!==0;dt++)ut=ut.redSqr();i(dt=0;g--){for(var st=y.words[g],q=nt-1;q>=0;q--){var rt=st>>q&1;p!==_[0]&&(p=this.sqr(p)),rt!==0||E!==0?(E<<=1,E|=rt,(++D===4||g===0&&q===0)&&(p=this.mul(p,_[E]),D=0,E=0)):D=0}nt=26}return p},V.prototype.convertTo=function(d){var y=d.umod(this.m);return y===d?y.clone():y},V.prototype.convertFrom=function(d){var y=d.clone();return y.red=null,y},a.mont=function(d){return new X(d)},n(X,V),X.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},X.prototype.convertFrom=function(d){var y=this.imod(d.mul(this.rinv));return y.red=null,y},X.prototype.imul=function(d,y){if(d.isZero()||y.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(y),g=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=_.isub(g).iushrn(this.shift),E=p;return p.cmp(this.m)>=0?E=p.isub(this.m):p.cmpn(0)<0&&(E=p.iadd(this.m)),E._forceRed(this)},X.prototype.mul=function(d,y){if(d.isZero()||y.isZero())return new a(0)._forceRed(this);var _=d.mul(y),g=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=_.isub(g).iushrn(this.shift),E=p;return p.cmp(this.m)>=0?E=p.isub(this.m):p.cmpn(0)<0&&(E=p.iadd(this.m)),E._forceRed(this)},X.prototype.invm=function(d){return this.imod(d._invmp(this.m).mul(this.r2))._forceRed(this)}})(t,wd)}),_a=Object.freeze(Object.defineProperty({__proto__:null,default:kt,__moduleExports:kt},Symbol.toStringTag,{value:"Module"}));/*! OpenPGP.js v5.7.0-1 - 2023-06-10 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */class Ra{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");this.value=new kt(e)}clone(){const e=new Ra(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new kt(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new kt(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,r){const i=r.isEven()?kt.red(r.value):kt.mont(r.value),n=this.clone();return n.value=n.value.toRed(i).redPow(e.value).fromRed(),n}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new Ra(this.value.invm(e.value))}gcd(e){return new Ra(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new kt(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",r){return this.value.toArrayLike(Uint8Array,e,r)}}var k6=Object.freeze(Object.defineProperty({__proto__:null,default:Ra},Symbol.toStringTag,{value:"Module"}));/*! OpenPGP.js v5.7.0-1 - 2023-06-10 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var M0,or=jr(function(t,e){var r=e;function i(a){return a.length===1?"0"+a:a}function n(a){for(var s="",o=0;o>8,f=255&c;h?o.push(h,f):o.push(f)}return o},r.zero2=i,r.toHex=n,r.encode=function(a,s){return s==="hex"?n(a):a}}),Yt=jr(function(t,e){var r=e;r.assert=ji,r.toArray=or.toArray,r.zero2=or.zero2,r.toHex=or.toHex,r.encode=or.encode,r.getNAF=function(i,n){for(var a=[],s=1<=0;){var u;if(o.isOdd()){var c=o.andln(s-1);u=c>(s>>1)-1?(s>>1)-c:c,o.isubn(u)}else u=0;a.push(u);for(var h=o.cmpn(0)!==0&&o.andln(s-1)===0?n+1:1,f=1;f0||n.cmpn(-o)>0;){var u,c,h,f=i.andln(3)+s&3,m=n.andln(3)+o&3;f===3&&(f=-1),m===3&&(m=-1),(1&f)==0?u=0:u=(h=i.andln(7)+s&7)!==3&&h!==5||m!==2?f:-f,a[0].push(u),(1&m)==0?c=0:c=(h=n.andln(7)+o&7)!==3&&h!==5||f!==2?m:-m,a[1].push(c),2*s===u+1&&(s=1-s),2*o===c+1&&(o=1-o),i.iushrn(1),n.iushrn(1)}return a},r.cachedProperty=function(i,n,a){var s="_"+n;i.prototype[n]=function(){return this[s]!==void 0?this[s]:this[s]=a.call(this)}},r.parseBytes=function(i){return typeof i=="string"?r.toArray(i,"hex"):i},r.intFromLE=function(i){return new kt(i,"hex","le")}}),Zo=function(t){return M0||(M0=new Mi(null)),M0.generate(t)};function Mi(t){this.rand=t}var A6=Mi;if(Mi.prototype.generate=function(t){return this._rand(t)},Mi.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var qe=xi;function Xe(t,e){this.curve=t,this.type=e,this.precomputed=null}xi.prototype.point=function(){throw Error("Not implemented")},xi.prototype.validate=function(){throw Error("Not implemented")},xi.prototype._fixedNafMul=function(t,e){Cs(t.precomputed);var r=t._getDoubles(),i=Ms(e,1),n=(1<=s;e--)o=(o<<1)+i[e];a.push(o)}for(var u=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=n;h>0;h--){for(s=0;s=0;o--){for(e=0;o>=0&&a[o]===0;o--)e++;if(o>=0&&e++,s=s.dblp(e),o<0)break;var u=a[o];Cs(u!==0),s=t.type==="affine"?u>0?s.mixedAdd(n[u-1>>1]):s.mixedAdd(n[-u-1>>1].neg()):u>0?s.add(n[u-1>>1]):s.add(n[-u-1>>1].neg())}return t.type==="affine"?s.toP():s},xi.prototype._wnafMulAdd=function(t,e,r,i,n){for(var a=this._wnafT1,s=this._wnafT2,o=this._wnafT3,u=0,c=0;c=1;c-=2){var f=c-1,m=c;if(a[f]===1&&a[m]===1){var b=[e[f],null,null,e[m]];e[f].y.cmp(e[m].y)===0?(b[1]=e[f].add(e[m]),b[2]=e[f].toJ().mixedAdd(e[m].neg())):e[f].y.cmp(e[m].y.redNeg())===0?(b[1]=e[f].toJ().mixedAdd(e[m]),b[2]=e[f].add(e[m].neg())):(b[1]=e[f].toJ().mixedAdd(e[m]),b[2]=e[f].toJ().mixedAdd(e[m].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],I=S6(r[f],r[m]);u=Math.max(I[0].length,u),o[f]=Array(u),o[m]=Array(u);for(var U=0;U=0;c--){for(var J=0;c>=0;){var V=!0;for(U=0;U=0&&J++,Y=Y.dblp(J),c<0)break;for(U=0;U0?X=s[U][d-1>>1]:d<0&&(X=s[U][-d-1>>1].neg()),Y=X.type==="affine"?Y.mixedAdd(X):Y.add(X))}}for(c=0;c=Math.ceil((t.bitLength()+1)/e.step)},Xe.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(a=e,s=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:n},{a,b:s}]},tr.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),o=a.mul(i.a),u=n.mul(r.b),c=a.mul(i.b);return{k1:t.sub(s).sub(o),k2:u.add(c).neg()}},tr.prototype.pointFromX=function(t,e){(t=new kt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},tr.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0},tr.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},le.prototype.isInfinity=function(){return this.inf},le.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},le.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},le.prototype.getX=function(){return this.x.fromRed()},le.prototype.getY=function(){return this.y.fromRed()},le.prototype.mul=function(t){return t=new kt(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},le.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},le.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},le.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},le.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},le.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Ti(ve,qe.BasePoint),tr.prototype.jpoint=function(t,e,r){return new ve(this,t,e,r)},ve.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},ve.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ve.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),o=i.redSub(n),u=a.redSub(s);if(o.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),h=c.redMul(o),f=i.redMul(c),m=u.redSqr().redIAdd(h).redISub(f).redISub(f),b=u.redMul(f.redISub(m)).redISub(a.redMul(h)),K=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(m,b,K)},ve.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,a=t.y.redMul(e).redMul(this.z),s=r.redSub(i),o=n.redSub(a);if(s.cmpn(0)===0)return o.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=r.redMul(u),f=o.redSqr().redIAdd(c).redISub(h).redISub(h),m=o.redMul(h.redISub(f)).redISub(n.redMul(c)),b=this.z.redMul(s);return this.curve.jpoint(f,m,b)},ve.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},ve.prototype.inspect=function(){return this.isInfinity()?"":""},ve.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Ti(In,qe);var x6=In;function pe(t,e,r){qe.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new kt(e,16),this.z=new kt(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}In.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return i.redSqrt().redSqr().cmp(i)===0},Ti(pe,qe.BasePoint),In.prototype.decodePoint=function(t,e){if((t=Yt.toArray(t,e)).length===33&&t[0]===64&&(t=t.slice(1,33).reverse()),t.length!==32)throw Error("Unknown point compression format");return this.point(t,1)},In.prototype.point=function(t,e){return new pe(this,t,e)},In.prototype.pointFromJSON=function(t){return pe.fromJSON(this,t)},pe.prototype.precompute=function(){},pe.prototype._encode=function(t){var e=this.curve.p.byteLength();return t?[64].concat(this.getX().toArray("le",e)):this.getX().toArray("be",e)},pe.fromJSON=function(t,e){return new pe(t,e[0],e[1]||t.one)},pe.prototype.inspect=function(){return this.isInfinity()?"":""},pe.prototype.isInfinity=function(){return this.z.cmpn(0)===0},pe.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},pe.prototype.add=function(){throw Error("Not supported on Montgomery curve")},pe.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),a=t.x.redSub(t.z).redMul(r),s=n.redMul(i),o=e.z.redMul(a.redAdd(s).redSqr()),u=e.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,u)},pe.prototype.mul=function(t){for(var e=(t=new kt(t,16)).clone(),r=this,i=this.curve.point(null,null),n=[];e.cmpn(0)!==0;e.iushrn(1))n.push(e.andln(1));for(var a=n.length-1;a>=0;a--)n[a]===0?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},pe.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},pe.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},pe.prototype.eq=function(t){return this.getX().cmp(t.getX())===0},pe.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},pe.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var M6=Yt.assert;function Ar(t){this.twisted=(0|t.a)!=1,this.mOneA=this.twisted&&(0|t.a)==-1,this.extended=this.mOneA,qe.call(this,"edwards",t),this.a=new kt(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new kt(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new kt(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),M6(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|t.c)==1}Ti(Ar,qe);var C6=Ar;function te(t,e,r,i,n){qe.BasePoint.call(this,t,"projective"),e===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new kt(e,16),this.y=new kt(r,16),this.z=i?new kt(i,16):this.curve.one,this.t=n&&new kt(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Ar.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},Ar.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},Ar.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},Ar.prototype.pointFromX=function(t,e){(t=new kt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(n.redInvm()),s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw Error("invalid point");var o=s.fromRed().isOdd();return(e&&!o||!e&&o)&&(s=s.redNeg()),this.point(t,s)},Ar.prototype.pointFromY=function(t,e){(t=new kt(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(n.redInvm());if(a.cmp(this.zero)===0){if(e)throw Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},Ar.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return i.cmp(n)===0},Ti(te,qe.BasePoint),Ar.prototype.pointFromJSON=function(t){return te.fromJSON(this,t)},Ar.prototype.point=function(t,e,r,i){return new te(this,t,e,r,i)},te.fromJSON=function(t,e){return new te(t,e[0],e[1],e[2])},te.prototype.inspect=function(){return this.isInfinity()?"":""},te.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},te.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=i.redAdd(e),s=a.redSub(r),o=i.redSub(e),u=n.redMul(s),c=a.redMul(o),h=n.redMul(o),f=s.redMul(a);return this.curve.point(u,c,f,h)},te.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var s=(c=this.curve._mulA(n)).redAdd(a);if(this.zOne)t=i.redSub(n).redSub(a).redMul(s.redSub(this.curve.two)),e=s.redMul(c.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var o=this.z.redSqr(),u=s.redSub(o).redISub(o);t=i.redSub(n).redISub(a).redMul(u),e=s.redMul(c.redSub(a)),r=s.redMul(u)}}else{var c=n.redAdd(a);o=this.curve._mulC(this.z).redSqr(),u=c.redSub(o).redSub(o),t=this.curve._mulC(i.redISub(c)).redMul(u),e=this.curve._mulC(c).redMul(n.redISub(a)),r=c.redMul(u)}return this.curve.point(t,e,r)},te.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},te.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),s=n.redSub(i),o=n.redAdd(i),u=r.redAdd(e),c=a.redMul(s),h=o.redMul(u),f=a.redMul(u),m=s.redMul(o);return this.curve.point(c,h,m,f)},te.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),a=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(a).redMul(s),u=n.redSub(o),c=n.redAdd(o),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(s),f=i.redMul(u).redMul(h);return this.curve.twisted?(e=i.redMul(c).redMul(s.redSub(this.curve._mulA(a))),r=u.redMul(c)):(e=i.redMul(c).redMul(s.redSub(a)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,e,r)},te.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},te.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},te.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},te.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},te.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},te.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},te.prototype.getX=function(){return this.normalize(),this.x.fromRed()},te.prototype.getY=function(){return this.normalize(),this.y.fromRed()},te.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0},te.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(e)===0)return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),this.x.cmp(e)===0)return!0}},te.prototype.toP=te.prototype.normalize,te.prototype.mixedAdd=te.prototype.add;var Ns=jr(function(t,e){var r=e;r.base=qe,r.short=P6,r.mont=x6,r.edwards=C6}),C0=Ft.rotl32,sa=Ft.sum32,D6=Ft.sum32_5,K6=gn.ft_1,Qh=Xa.BlockHash,R6=[1518500249,1859775393,2400959708,3395469782];function Cr(){if(!(this instanceof Cr))return new Cr;Qh.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}Ft.inherits(Cr,Qh);var I6=Cr;Cr.blockSize=512,Cr.outSize=160,Cr.hmacStrength=80,Cr.padLength=64,Cr.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),ji(t.length<=this.blockSize);for(var e=t.length;e=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var y1=Di;Di.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Di.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof e!="string"&&(i=r,r=e,e=null),r&&(r=or.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var z6=Yt.assert;function xo(t,e){if(t instanceof xo)return t;this._importDER(t,e)||(z6(t.r&&t.s,"Signature without r or s"),this.r=new kt(t.r,16),this.s=new kt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Ds=xo;function q6(){this.place=0}function K0(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,s=e.place;a>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}xo.prototype._importDER=function(t,e){t=Yt.toArray(t,e);var r=new q6;if(t[r.place++]!==48||K0(t,r)+r.place!==t.length||t[r.place++]!==2)return!1;var i=K0(t,r),n=t.slice(r.place,i+r.place);if(r.place+=i,t[r.place++]!==2)return!1;var a=K0(t,r);if(t.length!==a+r.place)return!1;var s=t.slice(r.place,a+r.place);return n[0]===0&&128&n[1]&&(n=n.slice(1)),s[0]===0&&128&s[1]&&(s=s.slice(1)),this.r=new kt(n),this.s=new kt(s),this.recoveryParam=null,!0},xo.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=yu(e),r=yu(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];R0(i,e.length),(i=i.concat(e)).push(2),R0(i,r.length);var n=i.concat(r),a=[48];return R0(a,n.length),a=a.concat(n),Yt.encode(a,t)};var Xh=Yt.assert;function $e(t){if(!(this instanceof $e))return new $e(t);typeof t=="string"&&(Xh(Ia.hasOwnProperty(t),"Unknown curve "+t),t=Ia[t]),t instanceof Ia.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var F6=$e;$e.prototype.keyPair=function(t){return new D0(this,t)},$e.prototype.keyFromPrivate=function(t,e){return D0.fromPrivate(this,t,e)},$e.prototype.keyFromPublic=function(t,e){return D0.fromPublic(this,t,e)},$e.prototype.genKeyPair=function(t){t||(t={});var e=new y1({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Zo(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()});if(this.curve.type==="mont"){var r=new kt(e.generate(32));return this.keyFromPrivate(r)}for(var i=this.n.byteLength(),n=this.n.sub(new kt(2));;)if(!((r=new kt(e.generate(i))).cmp(n)>0))return r.iaddn(1),this.keyFromPrivate(r)},$e.prototype._truncateToN=function(t,e,r){var i=(r=r||8*t.byteLength())-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},$e.prototype.truncateMsg=function(t){var e;return t instanceof Uint8Array?(e=8*t.byteLength,t=this._truncateToN(new kt(t,16),!1,e)):typeof t=="string"?(e=4*t.length,t=this._truncateToN(new kt(t,16),!1,e)):t=this._truncateToN(new kt(t,16)),t},$e.prototype.sign=function(t,e,r,i){typeof r=="object"&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this.truncateMsg(t);for(var n=this.n.byteLength(),a=e.getPrivate().toArray("be",n),s=t.toArray("be",n),o=new y1({hash:this.hash,entropy:a,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new kt(1)),c=0;;c++){var h=i.k?i.k(c):new kt(o.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(u)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var m=f.getX(),b=m.umod(this.n);if(b.cmpn(0)!==0){var K=h.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));if((K=K.umod(this.n)).cmpn(0)!==0){var I=(f.getY().isOdd()?1:0)|(m.cmp(b)!==0?2:0);return i.canonical&&K.cmp(this.nh)>0&&(K=this.n.sub(K),I^=1),new Ds({r:b,s:K,recoveryParam:I})}}}}}},$e.prototype.verify=function(t,e,r,i){return r=this.keyFromPublic(r,i),e=new Ds(e,"hex"),this._verify(this.truncateMsg(t),e,r)||this._verify(this._truncateToN(new kt(t,16)),e,r)},$e.prototype._verify=function(t,e,r){var i=e.r,n=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;var a,s=n.invm(this.n),o=s.mul(t).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(o,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(o,r.getPublic(),u)).isInfinity()&&a.getX().umod(this.n).cmp(i)===0},$e.prototype.recoverPubKey=function(t,e,r,i){Xh((3&r)===r,"The recovery param is more than two bits"),e=new Ds(e,i);var n=this.n,a=new kt(t),s=e.r,o=e.s,u=1&r,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw Error("Unable to find sencond key candinate");s=c?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var h=e.r.invm(n),f=n.sub(a).mul(h).umod(n),m=o.mul(h).umod(n);return this.g.mulAdd(f,s,m)},$e.prototype.getKeyRecoveryParam=function(t,e,r,i){if((e=new Ds(e,i)).recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(t,e,n)}catch{continue}if(a.eq(r))return n}throw Error("Unable to find valid recovery factor")};var bu=Yt.assert,mu=Yt.parseBytes,Sn=Yt.cachedProperty;function ye(t,e){if(this.eddsa=t,e.hasOwnProperty("secret")&&(this._secret=mu(e.secret)),t.isPoint(e.pub))this._pub=e.pub;else if(this._pubBytes=mu(e.pub),this._pubBytes&&this._pubBytes.length===33&&this._pubBytes[0]===64&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&this._pubBytes.length!==32)throw Error("Unknown point compression format")}ye.fromPublic=function(t,e){return e instanceof ye?e:new ye(t,{pub:e})},ye.fromSecret=function(t,e){return e instanceof ye?e:new ye(t,{secret:e})},ye.prototype.secret=function(){return this._secret},Sn(ye,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Sn(ye,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Sn(ye,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),Sn(ye,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Sn(ye,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Sn(ye,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),ye.prototype.sign=function(t){return bu(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},ye.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},ye.prototype.getSecret=function(t){return bu(this._secret,"KeyPair is public only"),Yt.encode(this.secret(),t)},ye.prototype.getPublic=function(t,e){return Yt.encode((e?[64]:[]).concat(this.pubBytes()),t)};var I0=ye,O6=Yt.assert,Ks=Yt.cachedProperty,$6=Yt.parseBytes;function en(t,e){this.eddsa=t,typeof e!="object"&&(e=$6(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),O6(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof kt&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Ks(en,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Ks(en,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Ks(en,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Ks(en,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),en.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},en.prototype.toHex=function(){return Yt.encode(this.toBytes(),"hex").toUpperCase()};var gu=en,L6=Yt.assert,wu=Yt.parseBytes;function Re(t){if(L6(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Re))return new Re(t);t=Ia[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Ge.sha512}var N6=Re;Re.prototype.sign=function(t,e){t=wu(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),a=this.encodePoint(n),s=this.hashInt(a,r.pubBytes(),t).mul(r.priv()),o=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:o,Rencoded:a})},Re.prototype.verify=function(t,e,r){t=wu(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),a=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(a)},Re.prototype.hashInt=function(){for(var t=this.hash(),e=0;e