@ar.io/sdk 3.6.0-alpha.1 → 3.6.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/bundles/web.bundle.min.js +23 -23
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +1 -1
- package/lib/cjs/cli/options.js +15 -3
- package/lib/cjs/cli/utils.js +15 -7
- package/lib/cjs/common/io.js +4 -2
- package/lib/cjs/constants.js +4 -3
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +1 -1
- package/lib/esm/cli/options.js +15 -3
- package/lib/esm/cli/utils.js +16 -8
- package/lib/esm/common/io.js +4 -2
- package/lib/esm/constants.js +3 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/options.d.ts +11 -1
- package/lib/types/cli/types.d.ts +3 -1
- package/lib/types/cli/utils.d.ts +1 -1
- package/lib/types/common/io.d.ts +1 -1
- package/lib/types/constants.d.ts +3 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -34,14 +34,14 @@ ${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.strin
|
|
|
34
34
|
`);return i+p+h}});var Cte=ht(Hh=>{"use strict";ie();ae();ne();var QEe=Hh&&Hh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),eAe=Hh&&Hh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tAe=Hh&&Hh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QEe(e,t,r);return eAe(e,t),e};Object.defineProperty(Hh,"__esModule",{value:!0});var Nte=Ote(),Co=tAe((lu(),Qr(xm))),$I=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";encryptionAlgorithm="aes-256-cbc";generateJWK(){if(typeof Co.generateKeyPair!="function")throw new Error("Keypair generation not supported in this version of Node, only supported in versions 10+");return new Promise((e,r)=>{Co.generateKeyPair("rsa",{modulusLength:this.keyLength,publicExponent:this.publicExponent,privateKeyEncoding:{type:"pkcs1",format:"pem"},publicKeyEncoding:{type:"pkcs1",format:"pem"}},(a,i,h)=>{a&&r(a),e(this.pemToJWK(h))})})}sign(e,r,{saltLength:a}={}){return new Promise((i,h)=>{i(Co.createSign(this.hashAlgorithm).update(r).sign({key:this.jwkToPem(e),padding:Co.constants.RSA_PKCS1_PSS_PADDING,saltLength:a}))})}verify(e,r,a){return new Promise((i,h)=>{let c={kty:"RSA",e:"AQAB",n:e},p=this.jwkToPem(c),b=Co.createPublicKey({key:p,format:"pem"}),g=Co.createVerify(this.hashAlgorithm);g.update(r);let y=g.verify({key:b,padding:Co.constants.RSA_PKCS1_PSS_PADDING},a);if(!y){let M={asymmetricKeyType:b.asymmetricKeyType,modulusLength:b.asymmetricKeyDetails?.modulusLength};console.warn(`Transaction Verification Failed!
|
|
35
35
|
Details: ${JSON.stringify(M,null,2)}
|
|
36
36
|
N.B. ArweaveJS is only guaranteed to verify txs created using ArweaveJS.`)}i(y)})}hash(e,r="SHA-256"){if(typeof e=="string")throw new TypeError("Data must be a Uint8Array");return new Promise((a,i)=>{a(Co.createHash(this.parseHashAlgorithm(r)).update(e).digest())})}async encrypt(e,r,a){let i=Co.pbkdf2Sync(r,a=a||"salt",1e5,32,this.hashAlgorithm),h=Co.randomBytes(16),c=Co.createCipheriv(this.encryptionAlgorithm,i,h);return Me.concat([h,c.update(e),c.final()])}async decrypt(e,r,a){try{let i=Co.pbkdf2Sync(r,a=a||"salt",1e5,32,this.hashAlgorithm),h=e.slice(0,16),c=e.slice(16),p=Co.createDecipheriv(this.encryptionAlgorithm,i,h);return Me.concat([p.update(c),p.final()])}catch{throw new Error("Failed to decrypt")}}jwkToPem(e){return(0,Nte.jwkTopem)(e)}pemToJWK(e){return(0,Nte.pemTojwk)(e)}parseHashAlgorithm(e){switch(e){case"SHA-256":return"sha256";case"SHA-384":return"sha384";default:throw new Error(`Algorithm not supported: ${e}`)}}};Hh.default=$I});var Lte=ht(UI=>{"use strict";ie();ae();ne();Object.defineProperty(UI,"__esModule",{value:!0});var qI=class{api;constructor(e){this.api=e}getInfo(){return this.api.get("info").then(e=>e.data)}getPeers(){return this.api.get("peers").then(e=>e.data)}};UI.default=qI});var P2=ht(A4=>{"use strict";ie();ae();ne();Object.defineProperty(A4,"__esModule",{value:!0});A4.getError=rAe;var FI=class extends Error{type;response;constructor(e,r={}){r.message?super(r.message):super(),this.type=e,this.response=r.response}getType(){return this.type}};A4.default=FI;function rAe(t){let e=t.data;if(typeof t.data=="string")try{e=JSON.parse(t.data)}catch{}if(t.data instanceof ArrayBuffer||t.data instanceof Uint8Array)try{e=JSON.parse(e.toString())}catch{}return e?e.error||e:t.statusText||"unknown"}});var Kh=ht(ra=>{"use strict";ie();ae();ne();var iAe=ra&&ra.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),nAe=ra&&ra.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aAe=ra&&ra.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iAe(e,t,r);return nAe(e,t),e};Object.defineProperty(ra,"__esModule",{value:!0});ra.concatBuffers=oAe;ra.b64UrlToString=sAe;ra.bufferToString=$te;ra.stringToBuffer=qte;ra.stringToB64Url=fAe;ra.b64UrlToBuffer=Ute;ra.bufferTob64=Fte;ra.bufferTob64Url=jte;ra.b64UrlEncode=zte;ra.b64UrlDecode=Zte;var Dte=aAe(mE());function oAe(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i].byteLength;let r=new Uint8Array(e),a=0;r.set(new Uint8Array(t[0]),a),a+=t[0].byteLength;for(let i=1;i<t.length;i++)r.set(new Uint8Array(t[i]),a),a+=t[i].byteLength;return r}function sAe(t){let e=Ute(t);return $te(e)}function $te(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}function qte(t){return new TextEncoder().encode(t)}function fAe(t){return jte(qte(t))}function Ute(t){return new Uint8Array(Dte.toByteArray(Zte(t)))}function Fte(t){return Dte.fromByteArray(new Uint8Array(t))}function jte(t){return zte(Fte(t))}function zte(t){try{return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}catch(e){throw new Error("Failed to encode string",{cause:e})}}function Zte(t){try{t=t.replace(/\-/g,"+").replace(/\_/g,"/");let e;return t.length%4==0?e=0:e=4-t.length%4,t.concat("=".repeat(e))}catch(e){throw new Error("Failed to decode string",{cause:e})}}});var Wte=ht(O2=>{"use strict";ie();ae();ne();var uAe=O2&&O2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(O2,"__esModule",{value:!0});O2.default=Hte;var Lo=uAe(R4());async function Hte(t){if(Array.isArray(t)){let a=Lo.default.utils.concatBuffers([Lo.default.utils.stringToBuffer("list"),Lo.default.utils.stringToBuffer(t.length.toString())]);return await Kte(t,await Lo.default.crypto.hash(a,"SHA-384"))}let e=Lo.default.utils.concatBuffers([Lo.default.utils.stringToBuffer("blob"),Lo.default.utils.stringToBuffer(t.byteLength.toString())]),r=Lo.default.utils.concatBuffers([await Lo.default.crypto.hash(e,"SHA-384"),await Lo.default.crypto.hash(t,"SHA-384")]);return await Lo.default.crypto.hash(r,"SHA-384")}async function Kte(t,e){if(t.length<1)return e;let r=Lo.default.utils.concatBuffers([e,await Hte(t[0])]),a=await Lo.default.crypto.hash(r,"SHA-384");return await Kte(t.slice(1),a)}});var WI=ht(Di=>{"use strict";ie();ae();ne();var hAe=Di&&Di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Di,"__esModule",{value:!0});Di.arrayCompare=Di.MIN_CHUNK_SIZE=Di.MAX_CHUNK_SIZE=void 0;Di.chunkData=zI;Di.generateLeaves=ZI;Di.computeRootHash=cAe;Di.generateTree=Gte;Di.generateTransactionChunks=lAe;Di.buildLayers=I4;Di.generateProofs=Yte;Di.arrayFlatten=HI;Di.intToBuffer=L2;Di.bufferToInt=KI;Di.validatePath=N2;Di.debug=Jte;var T4=hAe(R4()),Vte=Kh();Di.MAX_CHUNK_SIZE=256*1024;Di.MIN_CHUNK_SIZE=32*1024;var C2=32,W1=32;async function zI(t){let e=[],r=t,a=0;for(;r.byteLength>=Di.MAX_CHUNK_SIZE;){let i=Di.MAX_CHUNK_SIZE,h=r.byteLength-Di.MAX_CHUNK_SIZE;h>0&&h<Di.MIN_CHUNK_SIZE&&(i=Math.ceil(r.byteLength/2));let c=r.slice(0,i),p=await T4.default.crypto.hash(c);a+=c.byteLength,e.push({dataHash:p,minByteRange:a-c.byteLength,maxByteRange:a}),r=r.slice(i)}return e.push({dataHash:await T4.default.crypto.hash(r),minByteRange:a,maxByteRange:a+r.byteLength}),e}async function ZI(t){return Promise.all(t.map(async({dataHash:e,minByteRange:r,maxByteRange:a})=>({type:"leaf",id:await ia(await Promise.all([ia(e),ia(L2(a))])),dataHash:e,minByteRange:r,maxByteRange:a})))}async function cAe(t){return(await Gte(t)).id}async function Gte(t){return await I4(await ZI(await zI(t)))}async function lAe(t){let e=await zI(t),r=await ZI(e),a=await I4(r),i=await Yte(a),h=e.slice(-1)[0];return h.maxByteRange-h.minByteRange===0&&(e.splice(e.length-1,1),i.splice(i.length-1,1)),{data_root:a.id,chunks:e,proofs:i}}async function I4(t,e=0){if(t.length<2)return t[0];let r=[];for(let a=0;a<t.length;a+=2)r.push(await dAe(t[a],t[a+1]));return I4(r,e+1)}function Yte(t){let e=jI(t);return Array.isArray(e)?HI(e):[e]}function jI(t,e=new Uint8Array,r=0){if(t.type=="leaf")return{offset:t.maxByteRange-1,proof:(0,Vte.concatBuffers)([e,t.dataHash,L2(t.maxByteRange)])};if(t.type=="branch"){let a=(0,Vte.concatBuffers)([e,t.leftChild.id,t.rightChild.id,L2(t.byteRange)]);return[jI(t.leftChild,a,r+1),jI(t.rightChild,a,r+1)]}throw new Error("Unexpected node type")}function HI(t){let e=[];return t.forEach(r=>{Array.isArray(r)?e.push(...HI(r)):e.push(r)}),e}async function dAe(t,e){return e?{type:"branch",id:await ia([await ia(t.id),await ia(e.id),await ia(L2(t.maxByteRange))]),byteRange:t.maxByteRange,maxByteRange:e.maxByteRange,leftChild:t,rightChild:e}:t}async function ia(t){return Array.isArray(t)&&(t=T4.default.utils.concatBuffers(t)),new Uint8Array(await T4.default.crypto.hash(t))}function L2(t){let e=new Uint8Array(C2);for(var r=e.length-1;r>=0;r--){var a=t%256;e[r]=a,t=(t-a)/256}return e}function KI(t){let e=0;for(var r=0;r<t.length;r++)e*=256,e+=t[r];return e}var pAe=(t,e)=>t.every((r,a)=>e[a]===r);Di.arrayCompare=pAe;async function N2(t,e,r,a,i){if(a<=0)return!1;if(e>=a)return N2(t,0,a-1,a,i);if(e<0)return N2(t,0,0,a,i);if(i.length==W1+C2){let M=i.slice(0,W1),x=i.slice(M.length,M.length+C2),E=await ia([await ia(M),await ia(x)]);return(0,Di.arrayCompare)(t,E)?{offset:a-1,leftBound:r,rightBound:a,chunkSize:a-r}:!1}let h=i.slice(0,W1),c=i.slice(h.length,h.length+W1),p=i.slice(h.length+c.length,h.length+c.length+C2),b=KI(p),g=i.slice(h.length+c.length+p.length),y=await ia([await ia(h),await ia(c),await ia(p)]);return(0,Di.arrayCompare)(t,y)?e<b?await N2(h,e,r,Math.min(a,b),g):await N2(c,e,Math.max(r,b),a,g):!1}async function Jte(t,e=""){if(t.byteLength<1)return e;let r=t.slice(0,W1),a=t.slice(r.length,r.length+W1),i=t.slice(r.length+a.length,r.length+a.length+C2),h=KI(i),c=t.slice(r.length+a.length+i.length),p=await ia([await ia(r),await ia(a),await ia(i)]),b=`${e}
|
|
37
|
-
${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.stringify(p)}`;return Jte(c,b)}});var B4=ht(Do=>{"use strict";ie();ae();ne();var vAe=Do&&Do.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),mAe=Do&&Do.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gAe=Do&&Do.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vAe(e,t,r);return mAe(e,t),e},bAe=Do&&Do.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Do,"__esModule",{value:!0});Do.Tag=void 0;var qn=gAe(Kh()),yAe=bAe(Wte()),wAe=WI(),k4=class{get(e,r){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return r&&r.decode&&r.string?qn.bufferToString(this[e]):r&&r.decode&&!r.string?this[e]:qn.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(r?.decode!==void 0||r?.string!==void 0)throw e==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[e]}return r&&r.decode==!0?r&&r.string?qn.b64UrlToString(this[e]):qn.b64UrlToBuffer(this[e]):this[e]}},D2=class extends k4{name;value;constructor(e,r,a=!1){super(),this.name=e,this.value=r}};Do.Tag=D2;var VI=class extends k4{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data=="string"&&(this.data=qn.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(r=>new D2(r.name,r.value)))}addTag(e,r){this.tags.push(new D2(qn.stringToB64Url(e),qn.stringToB64Url(r)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:qn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:r,reward:a,tags:i,signature:h}){this.id=e,this.owner=r,a&&(this.reward=a),i&&(this.tags=i),this.signature=h}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,wAe.generateTransactionChunks)(e),this.data_root=qn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(e,r){if(!this.chunks)throw new Error("Chunks have not been prepared");let a=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:qn.bufferTob64Url(a.proof),offset:a.offset.toString(),chunk:qn.bufferTob64Url(r.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((a,i)=>qn.concatBuffers([a,i.get("name",{decode:!0,string:!1}),i.get("value",{decode:!0,string:!1})]),new Uint8Array);return qn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),qn.stringToBuffer(this.quantity),qn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(a=>[a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]);return await(0,yAe.default)([qn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),qn.stringToBuffer(this.quantity),qn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r,qn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};Do.default=VI});var tre=ht(Us=>{"use strict";ie();ae();ne();var _Ae=Us&&Us.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),MAe=Us&&Us.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xAe=Us&&Us.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_Ae(e,t,r);return MAe(e,t),e},SAe=Us&&Us.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Us,"__esModule",{value:!0});Us.TransactionUploader=void 0;var Xte=SAe(B4()),EAe=xAe(Kh()),GI=P2(),AAe=WI(),Qte=1,RAe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],ere=1e3*40,YI=class t{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,r){if(this.api=e,!r.id)throw new Error("Transaction is not signed");if(!r.chunks)throw new Error("Transaction chunks not prepared");this.data=r.data,this.transaction=new Xte.default(Object.assign({},r,{data:new Uint8Array(0)}))}async uploadChunk(e){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let r=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+ere-Date.now(),ere);if(r>0&&(r=r-r*Math.random()*.3,await new Promise(c=>setTimeout(c,r))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,AAe.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),EAe.b64UrlToBuffer(a.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let h=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(c=>(console.error(c.message),{status:-1,data:{error:c.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,GI.getError)(h),RAe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(e,r,a){if(!r||typeof r.chunkIndex!="number"||typeof r.transaction!="object")throw new Error("Serialized object does not match expected format.");var i=new Xte.default(r.transaction);i.chunks||await i.prepareChunks(a);let h=new t(e,i);if(h.chunkIndex=r.chunkIndex,h.lastRequestTimeEnd=r.lastRequestTimeEnd,h.lastResponseError=r.lastResponseError,h.lastResponseStatus=r.lastResponseStatus,h.txPosted=r.txPosted,h.data=a,h.transaction.data_root!==r.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return h}static async fromTransactionId(e,r){let a=await e.get(`tx/${r}`);if(a.status!==200)throw new Error(`Tx ${r} not found: ${a.status}`);let i=a.data;return i.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:i}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=Qte){this.transaction.data=this.data;let a=await this.api.post("tx",this.transaction).catch(i=>(console.error(i),{status:-1,data:{error:i.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=a.status,this.transaction.data=new Uint8Array(0),a.status>=200&&a.status<300){this.txPosted=!0,this.chunkIndex=Qte;return}throw this.lastResponseError=(0,GI.getError)(a),new Error(`Unable to upload transaction: ${a.status}, ${this.lastResponseError}`)}let r=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=r.status,!(r.status>=200&&r.status<300))throw this.lastResponseError=(0,GI.getError)(r),new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`);this.txPosted=!0}};Us.TransactionUploader=YI});var P4=ht((Ect,rre)=>{"use strict";ie();ae();ne();rre.exports={}});var nre=ht(Nf=>{"use strict";ie();ae();ne();var TAe=Nf&&Nf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),IAe=Nf&&Nf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kAe=Nf&&Nf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&TAe(e,t,r);return IAe(e,t),e},ire=Nf&&Nf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nf,"__esModule",{value:!0});var JI=ire(P2()),Wh=ire(B4()),$2=kAe(Kh()),XI=tre();P4();var QI=class{api;crypto;chunks;constructor(e,r,a){this.api=e,this.crypto=r,this.chunks=a}async getTransactionAnchor(){let e=await this.api.get("tx_anchor");if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw new Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,r){let a=r?`price/${e}/${r}`:`price/${e}`,i=await this.api.get(a);if(!/^\d+$/.test(i.data)||!i.ok)throw new Error(`Could not getPrice. Received: ${i.data}. Status: ${i.status}, ${i.statusText}`);return i.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let a=parseInt(r.data.data_size);if(r.data.format>=2&&a>0&&a<=1024*1024*12){let i=await this.getData(e);return new Wh.default({...r.data,data:i})}return new Wh.default({...r.data,format:r.data.format||1})}throw r.status==404?new JI.default("TX_NOT_FOUND"):r.status==410?new JI.default("TX_FAILED"):new JI.default("TX_INVALID")}fromRaw(e){return new Wh.default(e)}async search(e,r){return this.api.post("arql",{op:"equals",expr1:e,expr2:r}).then(a=>a.data?a.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(r=>r.status==200?{status:200,confirmed:r.data}:{status:r.status,confirmed:null})}async getData(e,r){let a;try{a=await this.chunks.downloadChunkedData(e)}catch(i){console.error(`Error while trying to download chunked data for ${e}`),console.error(i)}if(!a){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:i,ok:h,status:c,statusText:p}=await this.api.get(`/${e}`,{responseType:"arraybuffer"});if(!h)throw new Error("Bad http status code",{cause:{status:c,statusText:p}});a=i}catch(i){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(i)}}if(!a)throw new Error(`${e} data was not found!`);return r&&r.decode&&!r.string?a:r&&r.decode&&r.string?$2.bufferToString(a):$2.bufferTob64Url(a)}async sign(e,r,a){let h=typeof r=="object"&&(p=>{let b=!0;return["n","e","d","p","q","dp","dq","qi"].map(g=>!(g in p)&&(b=!1)),b})(r),c=typeof arweaveWallet=="object";if(!h&&!c)throw new Error("No valid JWK or external wallet found to sign transaction.");if(h){e.setOwner(r.n);let p=await e.getSignatureData(),b=await this.crypto.sign(r,p,a),g=await this.crypto.hash(b);e.setSignature({id:$2.bufferTob64Url(g),owner:r.n,signature:$2.bufferTob64Url(b)})}else if(c){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let p=await arweaveWallet.sign(e,a);e.setSignature({id:p.id,owner:p.owner,reward:p.reward,tags:p.tags,signature:p.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(e){let r=await e.getSignatureData(),a=e.get("signature",{decode:!0,string:!1}),i=$2.bufferTob64Url(await this.crypto.hash(a));if(e.id!==i)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,r,a)}async post(e){if(typeof e=="string"?e=new Wh.default(JSON.parse(e)):typeof e.readInt32BE=="function"?e=new Wh.default(JSON.parse(e.toString())):typeof e=="object"&&!(e instanceof Wh.default)&&(e=new Wh.default(e)),!(e instanceof Wh.default))throw new Error("Must be Transaction object");e.chunks||await e.prepareChunks(e.data);let r=await this.getUploader(e,e.data);try{for(;!r.isComplete;)await r.uploadChunk()}catch(a){if(r.lastResponseStatus>0)return{status:r.lastResponseStatus,statusText:r.lastResponseError,data:{error:r.lastResponseError}};throw a}return{status:200,statusText:"OK",data:{}}}async getUploader(e,r){let a;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),e instanceof Wh.default){if(r||(r=e.data),!(r instanceof Uint8Array))throw new Error("Data format is invalid");e.chunks||await e.prepareChunks(r),a=new XI.TransactionUploader(this.api,e),(!a.data||a.data.length===0)&&(a.data=r)}else{if(typeof e=="string"&&(e=await XI.TransactionUploader.fromTransactionId(this.api,e)),!r||!(r instanceof Uint8Array))throw new Error("Must provide data when resuming upload");a=await XI.TransactionUploader.fromSerialized(this.api,e,r)}return a}async*upload(e,r){let a=await this.getUploader(e,r);for(;!a.isComplete;)await a.uploadChunk(),yield a;return a}};Nf.default=QI});var ore=ht(Vh=>{"use strict";ie();ae();ne();var BAe=Vh&&Vh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),PAe=Vh&&Vh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OAe=Vh&&Vh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&BAe(e,t,r);return PAe(e,t),e};Object.defineProperty(Vh,"__esModule",{value:!0});var are=OAe(Kh());P4();var ek=class{api;crypto;constructor(e,r){this.api=e,this.crypto=r}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(r=>r.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(r=>r.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e==="use_wallet"?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return are.bufferTob64Url(await this.crypto.hash(are.b64UrlToBuffer(e)))}};Vh.default=ek});var fre=ht(Cf=>{"use strict";ie();ae();ne();var NAe=Cf&&Cf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),CAe=Cf&&Cf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),LAe=Cf&&Cf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&NAe(e,t,r);return CAe(e,t),e};Object.defineProperty(Cf,"__esModule",{value:!0});Cf.SiloResource=void 0;var sre=LAe(Kh()),tk=class{api;crypto;transactions;constructor(e,r,a){this.api=e,this.crypto=r,this.transactions=a}async get(e){if(!e)throw new Error("No Silo URI specified");let r=await this.parseUri(e),a=await this.transactions.search("Silo-Name",r.getAccessKey());if(a.length==0)throw new Error(`No data could be found for the Silo URI: ${e}`);let i=await this.transactions.get(a[0]);if(!i)throw new Error(`No data could be found for the Silo URI: ${e}`);let h=i.get("data",{decode:!0,string:!1});return this.crypto.decrypt(h,r.getEncryptionKey())}async readTransactionData(e,r){if(!r)throw new Error("No Silo URI specified");let a=await this.parseUri(r),i=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,a.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let a=r[1],i=Math.pow(2,parseInt(r[2])),h=await this.hash(sre.stringToBuffer(a),i),c=sre.bufferTob64(h.slice(0,15)),p=await this.hash(h.slice(16,31),1);return new O4(e,c,p)}async hash(e,r){let a=await this.crypto.hash(e);for(let i=0;i<r-1;i++)a=await this.crypto.hash(a);return a}};Cf.default=tk;var O4=class{uri;accessKey;encryptionKey;constructor(e,r,a){this.uri=e,this.accessKey=r,this.encryptionKey=a}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Cf.SiloResource=O4});var hre=ht(Gh=>{"use strict";ie();ae();ne();var DAe=Gh&&Gh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),$Ae=Gh&&Gh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qAe=Gh&&Gh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&DAe(e,t,r);return $Ae(e,t),e};Object.defineProperty(Gh,"__esModule",{value:!0});var ure=P2(),UAe=qAe(Kh()),rk=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let r=await this.api.get(`tx/${e}/offset`);if(r.status===200)return r.data;throw new Error(`Unable to get transaction offset: ${(0,ure.getError)(r)}`)}async getChunk(e){let r=await this.api.get(`chunk/${e}`);if(r.status===200)return r.data;throw new Error(`Unable to get chunk: ${(0,ure.getError)(r)}`)}async getChunkData(e){let r=await this.getChunk(e);return UAe.b64UrlToBuffer(r.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}async downloadChunkedData(e){let r=await this.getTransactionOffset(e),a=parseInt(r.size),h=parseInt(r.offset)-a+1,c=new Uint8Array(a),p=0;for(;p<a;){this.api.config.logging&&console.log(`[chunk] ${p}/${a}`);let b;try{b=await this.getChunkData(h+p)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${h+p}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(b)c.set(b,p),p+=b.length;else throw new Error(`Couldn't complete data download at ${p}/${a}`)}return c}};Gh.default=rk});var lre=ht(q2=>{"use strict";ie();ae();ne();var FAe=q2&&q2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(q2,"__esModule",{value:!0});var cre=FAe(P2());P4();var ik=class t{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(e,r){this.api=e,this.network=r}async get(e){let r=await this.api.get(`${t.HASH_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new cre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getByHeight(e){let r=await this.api.get(`${t.HEIGHT_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new cre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}};q2.default=ik});var R4=ht(Lf=>{"use strict";ie();ae();ne();var jAe=Lf&&Lf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),zAe=Lf&&Lf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZAe=Lf&&Lf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&jAe(e,t,r);return zAe(e,t),e},Uu=Lf&&Lf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lf,"__esModule",{value:!0});var HAe=Uu(Ste()),KAe=Uu(Ete()),WAe=Uu(Cte()),VAe=Uu(Lte()),GAe=Uu(nre()),YAe=Uu(ore()),dre=Uu(B4()),U2=ZAe(Kh()),JAe=Uu(fre()),XAe=Uu(hre()),QAe=Uu(lre()),nk=class t{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new WAe.default;static utils=U2;constructor(e){this.api=new KAe.default(e),this.wallets=new YAe.default(this.api,t.crypto),this.chunks=new XAe.default(this.api),this.transactions=new GAe.default(this.api,t.crypto,this.chunks),this.silo=new JAe.default(this.api,this.crypto,this.transactions),this.network=new VAe.default(this.api),this.blocks=new QAe.default(this.api,this.network),this.ar=new HAe.default}get crypto(){return t.crypto}get utils(){return t.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,r){let a={};if(Object.assign(a,e),!e.data&&!(e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(e.owner==null&&r&&r!=="use_wallet"&&(a.owner=r.n),e.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data=="string"&&(e.data=U2.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(e.reward==null){let h=e.data?e.data.byteLength:0;a.reward=await this.transactions.getPrice(h,a.target)}a.data_root="",a.data_size=e.data?e.data.byteLength.toString():"0",a.data=e.data||new Uint8Array(0);let i=new dre.default(a);return await i.getSignatureData(),i}async createSiloTransaction(e,r,a){let i={};if(Object.assign(i,e),!e.data)throw new Error("Silo transactions must have a 'data' value");if(!a)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(e.owner==null){if(!r||!r.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");i.owner=r.n}e.last_tx==null&&(i.last_tx=await this.transactions.getTransactionAnchor());let h=await this.silo.parseUri(a);if(typeof e.data=="string"){let p=await this.crypto.encrypt(U2.stringToBuffer(e.data),h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=U2.bufferTob64Url(p)}if(e.data instanceof Uint8Array){let p=await this.crypto.encrypt(e.data,h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=U2.bufferTob64Url(p)}let c=new dre.default(i);return c.addTag("Silo-Name",h.getAccessKey()),c.addTag("Silo-Version","0.1.0"),c}arql(e){return this.api.post("/arql",e).then(r=>r.data||[])}};Lf.default=nk});var vre=ht((ok,pre)=>{"use strict";ie();ae();ne();var eRe=ok&&ok.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ak=eRe(R4());ak.default.init=function(t={}){return new ak.default(t)};pre.exports=ak.default});var uo=ht((hlt,Rre)=>{"use strict";ie();ae();ne();function V1(t){"@babel/helpers - typeof";return V1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V1(t)}function Sre(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,rRe(a.key),a)}}function tRe(t,e,r){return e&&Sre(t.prototype,e),r&&Sre(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rRe(t){var e=iRe(t,"string");return V1(e)==="symbol"?e:String(e)}function iRe(t,e){if(V1(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(V1(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aRe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&F2(t,e)}function oRe(t){var e=Are();return function(){var a=j2(t),i;if(e){var h=j2(this).constructor;i=Reflect.construct(a,arguments,h)}else i=a.apply(this,arguments);return sRe(this,i)}}function sRe(t,e){if(e&&(V1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ere(t)}function Ere(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sk(t){var e=typeof Map=="function"?new Map:void 0;return sk=function(a){if(a===null||!fRe(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(a))return e.get(a);e.set(a,i)}function i(){return L4(a,arguments,j2(this).constructor)}return i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),F2(i,a)},sk(t)}function L4(t,e,r){return Are()?L4=Reflect.construct.bind():L4=function(i,h,c){var p=[null];p.push.apply(p,h);var b=Function.bind.apply(i,p),g=new b;return c&&F2(g,c.prototype),g},L4.apply(null,arguments)}function Are(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fRe(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function F2(t,e){return F2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},F2(t,e)}function j2(t){return j2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j2(t)}var uRe=function(t){aRe(r,t);var e=oRe(r);function r(a){var i;return nRe(this,r),i=e.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
37
|
+
${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.stringify(p)}`;return Jte(c,b)}});var B4=ht(Do=>{"use strict";ie();ae();ne();var vAe=Do&&Do.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),mAe=Do&&Do.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gAe=Do&&Do.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vAe(e,t,r);return mAe(e,t),e},bAe=Do&&Do.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Do,"__esModule",{value:!0});Do.Tag=void 0;var qn=gAe(Kh()),yAe=bAe(Wte()),wAe=WI(),k4=class{get(e,r){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return r&&r.decode&&r.string?qn.bufferToString(this[e]):r&&r.decode&&!r.string?this[e]:qn.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(r?.decode!==void 0||r?.string!==void 0)throw e==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[e]}return r&&r.decode==!0?r&&r.string?qn.b64UrlToString(this[e]):qn.b64UrlToBuffer(this[e]):this[e]}},D2=class extends k4{name;value;constructor(e,r,a=!1){super(),this.name=e,this.value=r}};Do.Tag=D2;var VI=class extends k4{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data=="string"&&(this.data=qn.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(r=>new D2(r.name,r.value)))}addTag(e,r){this.tags.push(new D2(qn.stringToB64Url(e),qn.stringToB64Url(r)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:qn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:r,reward:a,tags:i,signature:h}){this.id=e,this.owner=r,a&&(this.reward=a),i&&(this.tags=i),this.signature=h}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,wAe.generateTransactionChunks)(e),this.data_root=qn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(e,r){if(!this.chunks)throw new Error("Chunks have not been prepared");let a=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:qn.bufferTob64Url(a.proof),offset:a.offset.toString(),chunk:qn.bufferTob64Url(r.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((a,i)=>qn.concatBuffers([a,i.get("name",{decode:!0,string:!1}),i.get("value",{decode:!0,string:!1})]),new Uint8Array);return qn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),qn.stringToBuffer(this.quantity),qn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(a=>[a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]);return await(0,yAe.default)([qn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),qn.stringToBuffer(this.quantity),qn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r,qn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};Do.default=VI});var tre=ht(Us=>{"use strict";ie();ae();ne();var _Ae=Us&&Us.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),MAe=Us&&Us.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xAe=Us&&Us.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_Ae(e,t,r);return MAe(e,t),e},SAe=Us&&Us.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Us,"__esModule",{value:!0});Us.TransactionUploader=void 0;var Xte=SAe(B4()),EAe=xAe(Kh()),GI=P2(),AAe=WI(),Qte=1,RAe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],ere=1e3*40,YI=class t{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,r){if(this.api=e,!r.id)throw new Error("Transaction is not signed");if(!r.chunks)throw new Error("Transaction chunks not prepared");this.data=r.data,this.transaction=new Xte.default(Object.assign({},r,{data:new Uint8Array(0)}))}async uploadChunk(e){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let r=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+ere-Date.now(),ere);if(r>0&&(r=r-r*Math.random()*.3,await new Promise(c=>setTimeout(c,r))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,AAe.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),EAe.b64UrlToBuffer(a.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let h=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(c=>(console.error(c.message),{status:-1,data:{error:c.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,GI.getError)(h),RAe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(e,r,a){if(!r||typeof r.chunkIndex!="number"||typeof r.transaction!="object")throw new Error("Serialized object does not match expected format.");var i=new Xte.default(r.transaction);i.chunks||await i.prepareChunks(a);let h=new t(e,i);if(h.chunkIndex=r.chunkIndex,h.lastRequestTimeEnd=r.lastRequestTimeEnd,h.lastResponseError=r.lastResponseError,h.lastResponseStatus=r.lastResponseStatus,h.txPosted=r.txPosted,h.data=a,h.transaction.data_root!==r.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return h}static async fromTransactionId(e,r){let a=await e.get(`tx/${r}`);if(a.status!==200)throw new Error(`Tx ${r} not found: ${a.status}`);let i=a.data;return i.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:i}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=Qte){this.transaction.data=this.data;let a=await this.api.post("tx",this.transaction).catch(i=>(console.error(i),{status:-1,data:{error:i.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=a.status,this.transaction.data=new Uint8Array(0),a.status>=200&&a.status<300){this.txPosted=!0,this.chunkIndex=Qte;return}throw this.lastResponseError=(0,GI.getError)(a),new Error(`Unable to upload transaction: ${a.status}, ${this.lastResponseError}`)}let r=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=r.status,!(r.status>=200&&r.status<300))throw this.lastResponseError=(0,GI.getError)(r),new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`);this.txPosted=!0}};Us.TransactionUploader=YI});var P4=ht((Act,rre)=>{"use strict";ie();ae();ne();rre.exports={}});var nre=ht(Nf=>{"use strict";ie();ae();ne();var TAe=Nf&&Nf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),IAe=Nf&&Nf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kAe=Nf&&Nf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&TAe(e,t,r);return IAe(e,t),e},ire=Nf&&Nf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nf,"__esModule",{value:!0});var JI=ire(P2()),Wh=ire(B4()),$2=kAe(Kh()),XI=tre();P4();var QI=class{api;crypto;chunks;constructor(e,r,a){this.api=e,this.crypto=r,this.chunks=a}async getTransactionAnchor(){let e=await this.api.get("tx_anchor");if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw new Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,r){let a=r?`price/${e}/${r}`:`price/${e}`,i=await this.api.get(a);if(!/^\d+$/.test(i.data)||!i.ok)throw new Error(`Could not getPrice. Received: ${i.data}. Status: ${i.status}, ${i.statusText}`);return i.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let a=parseInt(r.data.data_size);if(r.data.format>=2&&a>0&&a<=1024*1024*12){let i=await this.getData(e);return new Wh.default({...r.data,data:i})}return new Wh.default({...r.data,format:r.data.format||1})}throw r.status==404?new JI.default("TX_NOT_FOUND"):r.status==410?new JI.default("TX_FAILED"):new JI.default("TX_INVALID")}fromRaw(e){return new Wh.default(e)}async search(e,r){return this.api.post("arql",{op:"equals",expr1:e,expr2:r}).then(a=>a.data?a.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(r=>r.status==200?{status:200,confirmed:r.data}:{status:r.status,confirmed:null})}async getData(e,r){let a;try{a=await this.chunks.downloadChunkedData(e)}catch(i){console.error(`Error while trying to download chunked data for ${e}`),console.error(i)}if(!a){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:i,ok:h,status:c,statusText:p}=await this.api.get(`/${e}`,{responseType:"arraybuffer"});if(!h)throw new Error("Bad http status code",{cause:{status:c,statusText:p}});a=i}catch(i){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(i)}}if(!a)throw new Error(`${e} data was not found!`);return r&&r.decode&&!r.string?a:r&&r.decode&&r.string?$2.bufferToString(a):$2.bufferTob64Url(a)}async sign(e,r,a){let h=typeof r=="object"&&(p=>{let b=!0;return["n","e","d","p","q","dp","dq","qi"].map(g=>!(g in p)&&(b=!1)),b})(r),c=typeof arweaveWallet=="object";if(!h&&!c)throw new Error("No valid JWK or external wallet found to sign transaction.");if(h){e.setOwner(r.n);let p=await e.getSignatureData(),b=await this.crypto.sign(r,p,a),g=await this.crypto.hash(b);e.setSignature({id:$2.bufferTob64Url(g),owner:r.n,signature:$2.bufferTob64Url(b)})}else if(c){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let p=await arweaveWallet.sign(e,a);e.setSignature({id:p.id,owner:p.owner,reward:p.reward,tags:p.tags,signature:p.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(e){let r=await e.getSignatureData(),a=e.get("signature",{decode:!0,string:!1}),i=$2.bufferTob64Url(await this.crypto.hash(a));if(e.id!==i)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,r,a)}async post(e){if(typeof e=="string"?e=new Wh.default(JSON.parse(e)):typeof e.readInt32BE=="function"?e=new Wh.default(JSON.parse(e.toString())):typeof e=="object"&&!(e instanceof Wh.default)&&(e=new Wh.default(e)),!(e instanceof Wh.default))throw new Error("Must be Transaction object");e.chunks||await e.prepareChunks(e.data);let r=await this.getUploader(e,e.data);try{for(;!r.isComplete;)await r.uploadChunk()}catch(a){if(r.lastResponseStatus>0)return{status:r.lastResponseStatus,statusText:r.lastResponseError,data:{error:r.lastResponseError}};throw a}return{status:200,statusText:"OK",data:{}}}async getUploader(e,r){let a;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),e instanceof Wh.default){if(r||(r=e.data),!(r instanceof Uint8Array))throw new Error("Data format is invalid");e.chunks||await e.prepareChunks(r),a=new XI.TransactionUploader(this.api,e),(!a.data||a.data.length===0)&&(a.data=r)}else{if(typeof e=="string"&&(e=await XI.TransactionUploader.fromTransactionId(this.api,e)),!r||!(r instanceof Uint8Array))throw new Error("Must provide data when resuming upload");a=await XI.TransactionUploader.fromSerialized(this.api,e,r)}return a}async*upload(e,r){let a=await this.getUploader(e,r);for(;!a.isComplete;)await a.uploadChunk(),yield a;return a}};Nf.default=QI});var ore=ht(Vh=>{"use strict";ie();ae();ne();var BAe=Vh&&Vh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),PAe=Vh&&Vh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OAe=Vh&&Vh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&BAe(e,t,r);return PAe(e,t),e};Object.defineProperty(Vh,"__esModule",{value:!0});var are=OAe(Kh());P4();var ek=class{api;crypto;constructor(e,r){this.api=e,this.crypto=r}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(r=>r.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(r=>r.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e==="use_wallet"?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return are.bufferTob64Url(await this.crypto.hash(are.b64UrlToBuffer(e)))}};Vh.default=ek});var fre=ht(Cf=>{"use strict";ie();ae();ne();var NAe=Cf&&Cf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),CAe=Cf&&Cf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),LAe=Cf&&Cf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&NAe(e,t,r);return CAe(e,t),e};Object.defineProperty(Cf,"__esModule",{value:!0});Cf.SiloResource=void 0;var sre=LAe(Kh()),tk=class{api;crypto;transactions;constructor(e,r,a){this.api=e,this.crypto=r,this.transactions=a}async get(e){if(!e)throw new Error("No Silo URI specified");let r=await this.parseUri(e),a=await this.transactions.search("Silo-Name",r.getAccessKey());if(a.length==0)throw new Error(`No data could be found for the Silo URI: ${e}`);let i=await this.transactions.get(a[0]);if(!i)throw new Error(`No data could be found for the Silo URI: ${e}`);let h=i.get("data",{decode:!0,string:!1});return this.crypto.decrypt(h,r.getEncryptionKey())}async readTransactionData(e,r){if(!r)throw new Error("No Silo URI specified");let a=await this.parseUri(r),i=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,a.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let a=r[1],i=Math.pow(2,parseInt(r[2])),h=await this.hash(sre.stringToBuffer(a),i),c=sre.bufferTob64(h.slice(0,15)),p=await this.hash(h.slice(16,31),1);return new O4(e,c,p)}async hash(e,r){let a=await this.crypto.hash(e);for(let i=0;i<r-1;i++)a=await this.crypto.hash(a);return a}};Cf.default=tk;var O4=class{uri;accessKey;encryptionKey;constructor(e,r,a){this.uri=e,this.accessKey=r,this.encryptionKey=a}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Cf.SiloResource=O4});var hre=ht(Gh=>{"use strict";ie();ae();ne();var DAe=Gh&&Gh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),$Ae=Gh&&Gh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qAe=Gh&&Gh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&DAe(e,t,r);return $Ae(e,t),e};Object.defineProperty(Gh,"__esModule",{value:!0});var ure=P2(),UAe=qAe(Kh()),rk=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let r=await this.api.get(`tx/${e}/offset`);if(r.status===200)return r.data;throw new Error(`Unable to get transaction offset: ${(0,ure.getError)(r)}`)}async getChunk(e){let r=await this.api.get(`chunk/${e}`);if(r.status===200)return r.data;throw new Error(`Unable to get chunk: ${(0,ure.getError)(r)}`)}async getChunkData(e){let r=await this.getChunk(e);return UAe.b64UrlToBuffer(r.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}async downloadChunkedData(e){let r=await this.getTransactionOffset(e),a=parseInt(r.size),h=parseInt(r.offset)-a+1,c=new Uint8Array(a),p=0;for(;p<a;){this.api.config.logging&&console.log(`[chunk] ${p}/${a}`);let b;try{b=await this.getChunkData(h+p)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${h+p}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(b)c.set(b,p),p+=b.length;else throw new Error(`Couldn't complete data download at ${p}/${a}`)}return c}};Gh.default=rk});var lre=ht(q2=>{"use strict";ie();ae();ne();var FAe=q2&&q2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(q2,"__esModule",{value:!0});var cre=FAe(P2());P4();var ik=class t{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(e,r){this.api=e,this.network=r}async get(e){let r=await this.api.get(`${t.HASH_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new cre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getByHeight(e){let r=await this.api.get(`${t.HEIGHT_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new cre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}};q2.default=ik});var R4=ht(Lf=>{"use strict";ie();ae();ne();var jAe=Lf&&Lf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),zAe=Lf&&Lf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZAe=Lf&&Lf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&jAe(e,t,r);return zAe(e,t),e},Uu=Lf&&Lf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lf,"__esModule",{value:!0});var HAe=Uu(Ste()),KAe=Uu(Ete()),WAe=Uu(Cte()),VAe=Uu(Lte()),GAe=Uu(nre()),YAe=Uu(ore()),dre=Uu(B4()),U2=ZAe(Kh()),JAe=Uu(fre()),XAe=Uu(hre()),QAe=Uu(lre()),nk=class t{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new WAe.default;static utils=U2;constructor(e){this.api=new KAe.default(e),this.wallets=new YAe.default(this.api,t.crypto),this.chunks=new XAe.default(this.api),this.transactions=new GAe.default(this.api,t.crypto,this.chunks),this.silo=new JAe.default(this.api,this.crypto,this.transactions),this.network=new VAe.default(this.api),this.blocks=new QAe.default(this.api,this.network),this.ar=new HAe.default}get crypto(){return t.crypto}get utils(){return t.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,r){let a={};if(Object.assign(a,e),!e.data&&!(e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(e.owner==null&&r&&r!=="use_wallet"&&(a.owner=r.n),e.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data=="string"&&(e.data=U2.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(e.reward==null){let h=e.data?e.data.byteLength:0;a.reward=await this.transactions.getPrice(h,a.target)}a.data_root="",a.data_size=e.data?e.data.byteLength.toString():"0",a.data=e.data||new Uint8Array(0);let i=new dre.default(a);return await i.getSignatureData(),i}async createSiloTransaction(e,r,a){let i={};if(Object.assign(i,e),!e.data)throw new Error("Silo transactions must have a 'data' value");if(!a)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(e.owner==null){if(!r||!r.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");i.owner=r.n}e.last_tx==null&&(i.last_tx=await this.transactions.getTransactionAnchor());let h=await this.silo.parseUri(a);if(typeof e.data=="string"){let p=await this.crypto.encrypt(U2.stringToBuffer(e.data),h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=U2.bufferTob64Url(p)}if(e.data instanceof Uint8Array){let p=await this.crypto.encrypt(e.data,h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=U2.bufferTob64Url(p)}let c=new dre.default(i);return c.addTag("Silo-Name",h.getAccessKey()),c.addTag("Silo-Version","0.1.0"),c}arql(e){return this.api.post("/arql",e).then(r=>r.data||[])}};Lf.default=nk});var vre=ht((ok,pre)=>{"use strict";ie();ae();ne();var eRe=ok&&ok.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ak=eRe(R4());ak.default.init=function(t={}){return new ak.default(t)};pre.exports=ak.default});var uo=ht((clt,Rre)=>{"use strict";ie();ae();ne();function V1(t){"@babel/helpers - typeof";return V1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V1(t)}function Sre(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,rRe(a.key),a)}}function tRe(t,e,r){return e&&Sre(t.prototype,e),r&&Sre(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rRe(t){var e=iRe(t,"string");return V1(e)==="symbol"?e:String(e)}function iRe(t,e){if(V1(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(V1(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aRe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&F2(t,e)}function oRe(t){var e=Are();return function(){var a=j2(t),i;if(e){var h=j2(this).constructor;i=Reflect.construct(a,arguments,h)}else i=a.apply(this,arguments);return sRe(this,i)}}function sRe(t,e){if(e&&(V1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ere(t)}function Ere(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sk(t){var e=typeof Map=="function"?new Map:void 0;return sk=function(a){if(a===null||!fRe(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(a))return e.get(a);e.set(a,i)}function i(){return L4(a,arguments,j2(this).constructor)}return i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),F2(i,a)},sk(t)}function L4(t,e,r){return Are()?L4=Reflect.construct.bind():L4=function(i,h,c){var p=[null];p.push.apply(p,h);var b=Function.bind.apply(i,p),g=new b;return c&&F2(g,c.prototype),g},L4.apply(null,arguments)}function Are(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fRe(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function F2(t,e){return F2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},F2(t,e)}function j2(t){return j2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j2(t)}var uRe=function(t){aRe(r,t);var e=oRe(r);function r(a){var i;return nRe(this,r),i=e.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
38
38
|
Found: `.concat(a.toString().split(`
|
|
39
39
|
`)[0],`
|
|
40
|
-
`)),Error.captureStackTrace(Ere(i),r),i}return tRe(r)}(sk(Error));Rre.exports=function(t){if(t.length>2)throw new uRe(t);function e(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=a}e.prototype.transform=t;function r(a){return new e(a)}return r.Format=e,r}});var Bre=ht((
|
|
41
|
-
`,Un.homedir=function(){return"/"}),Un}var Un,Pre,Ir,cRe,lRe,dRe,pRe,vRe,mRe,gRe,bRe,yRe,wRe,_Re,MRe,xRe,SRe,ERe,ARe,RRe,TRe,IRe,Id=xi(()=>{"use strict";ie();ae();ne();Nb();Nb();Un={},Pre=!1;Ir=hRe();Ir.endianness;Ir.hostname;Ir.loadavg;Ir.uptime;Ir.freemem;Ir.totalmem;Ir.cpus;Ir.type;Ir.release;Ir.networkInterfaces;Ir.getNetworkInterfaces;Ir.arch;Ir.platform;Ir.tmpdir;Ir.tmpDir;Ir.EOL;Ir.homedir;cRe=new Uint8Array(new Uint16Array([1]).buffer)[0]===1?"LE":"BE";Ir.endianness=function(){return cRe};Ir.homedir=function(){return"/home"};Ir.version=function(){return""};Ir.arch=function(){return"x64"};Ir.totalmem=function(){return navigator.deviceMemory!==void 0?navigator.deviceMemory*(1<<30):2*(1<<30)};Ir.cpus=function(){return Array(navigator.hardwareConcurrency||0).fill({model:"",times:{}})};Ir.uptime=Kd;Ir.constants={};lRe=Ir.version,dRe=Ir.constants,pRe=Ir.EOL,vRe=Ir.arch,mRe=Ir.cpus,gRe=Ir.endianness,bRe=Ir.freemem,yRe=Ir.getNetworkInterfaces,wRe=Ir.homedir,_Re=Ir.hostname,MRe=Ir.loadavg,xRe=Ir.networkInterfaces,SRe=Ir.platform,ERe=Ir.release,ARe=Ir.tmpDir,RRe=Ir.tmpdir,TRe=Ir.totalmem,IRe=Ir.type});var Nre=ht((
|
|
42
|
-
`)!=-1,a=this._styles,i=a.length;i--;){var h=kd[a[i]];e=h.open+e.replace(h.closeRe,h.open)+h.close,r&&(e=e.replace(NRe,function(c){return h.close+c+h.open}))}return e}Vr.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){Vr[r]=function(a){if(typeof t[r]=="object"){var i=a;for(var h in t[r])i=Vr[t[r][h]](i);return i}return Vr[t[r]](a)}})(e)};function qRe(){var t={};return Object.keys(Xre).forEach(function(e){t[e]={get:function(){return Jre([e])}}}),t}var URe=function(e,r){var a=r.split("");return a=a.map(e),a.join("")};Vr.trap=$re();Vr.zalgo=Ure();Vr.maps={};Vr.maps.america=jre()(Vr);Vr.maps.zebra=Zre()(Vr);Vr.maps.rainbow=Kre()(Vr);Vr.maps.random=Vre()(Vr);for(Gre in Vr.maps)(function(t){Vr[t]=function(e){return URe(Vr.maps[t],e)}})(Gre);var Gre;Yre(Vr,qRe())});var uk=ht((
|
|
43
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JRe(t,e){if(t){if(typeof t=="string")return gk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gk(t,e)}}function XRe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function QRe(t){if(Array.isArray(t))return gk(t)}function gk(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function eTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,rTe(a.key),a)}}function tTe(t,e,r){return e&&pie(t.prototype,e),r&&pie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rTe(t){var e=iTe(t,"string");return H2(e)==="symbol"?e:String(e)}function iTe(t,e){if(H2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(H2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bk=on(),nTe=bk.configs,vie=bk.LEVEL,mk=bk.MESSAGE,mie=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{levels:nTe.npm.levels};eTe(this,t),this.paddings=t.paddingForLevels(e.levels,e.filler),this.options=e}return tTe(t,[{key:"transform",value:function(r,a){return r.message="".concat(this.paddings[r[vie]]).concat(r.message),r[mk]&&(r[mk]="".concat(this.paddings[r[vie]]).concat(r[mk])),r}}],[{key:"getLongestLevel",value:function(r){var a=Object.keys(r).map(function(i){return i.length});return Math.max.apply(Math,GRe(a))}},{key:"paddingForLevel",value:function(r,a,i){var h=i+1-r.length,c=Math.floor(h/a.length),p="".concat(a).concat(a.repeat(c));return p.slice(0,h)}},{key:"paddingForLevels",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ",i=t.getLongestLevel(r);return Object.keys(r).reduce(function(h,c){return h[c]=t.paddingForLevel(c,a,i),h},{})}}]),t}();U4.exports=function(t){return new mie(t)};U4.exports.Padder=U4.exports.Format=mie});var wie=ht((
|
|
44
|
-
`));return!0}_k.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var a=vTe(_ie(e)),i=a();return i.Format=a.Format,i};_k.exports.cascade=_ie});var Aie=ht((
|
|
40
|
+
`)),Error.captureStackTrace(Ere(i),r),i}return tRe(r)}(sk(Error));Rre.exports=function(t){if(t.length>2)throw new uRe(t);function e(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=a}e.prototype.transform=t;function r(a){return new e(a)}return r.Format=e,r}});var Bre=ht((vlt,kre)=>{"use strict";ie();ae();ne();var Ire={};kre.exports=Ire;var Tre={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Tre).forEach(function(t){var e=Tre[t],r=Ire[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var Td={};Ka(Td,{EOL:()=>pRe,arch:()=>vRe,constants:()=>dRe,cpus:()=>mRe,default:()=>Ir,endianness:()=>gRe,freemem:()=>bRe,getNetworkInterfaces:()=>yRe,homedir:()=>wRe,hostname:()=>_Re,loadavg:()=>MRe,networkInterfaces:()=>xRe,platform:()=>SRe,release:()=>ERe,tmpDir:()=>ARe,tmpdir:()=>RRe,totalmem:()=>TRe,type:()=>IRe,uptime:()=>Kd,version:()=>lRe});function hRe(){return Pre||(Pre=!0,Un.endianness=function(){return"LE"},Un.hostname=function(){return typeof location<"u"?location.hostname:""},Un.loadavg=function(){return[]},Un.uptime=function(){return 0},Un.freemem=function(){return Number.MAX_VALUE},Un.totalmem=function(){return Number.MAX_VALUE},Un.cpus=function(){return[]},Un.type=function(){return"Browser"},Un.release=function(){return typeof navigator<"u"?navigator.appVersion:""},Un.networkInterfaces=Un.getNetworkInterfaces=function(){return{}},Un.arch=function(){return"javascript"},Un.platform=function(){return"browser"},Un.tmpdir=Un.tmpDir=function(){return"/tmp"},Un.EOL=`
|
|
41
|
+
`,Un.homedir=function(){return"/"}),Un}var Un,Pre,Ir,cRe,lRe,dRe,pRe,vRe,mRe,gRe,bRe,yRe,wRe,_Re,MRe,xRe,SRe,ERe,ARe,RRe,TRe,IRe,Id=xi(()=>{"use strict";ie();ae();ne();Nb();Nb();Un={},Pre=!1;Ir=hRe();Ir.endianness;Ir.hostname;Ir.loadavg;Ir.uptime;Ir.freemem;Ir.totalmem;Ir.cpus;Ir.type;Ir.release;Ir.networkInterfaces;Ir.getNetworkInterfaces;Ir.arch;Ir.platform;Ir.tmpdir;Ir.tmpDir;Ir.EOL;Ir.homedir;cRe=new Uint8Array(new Uint16Array([1]).buffer)[0]===1?"LE":"BE";Ir.endianness=function(){return cRe};Ir.homedir=function(){return"/home"};Ir.version=function(){return""};Ir.arch=function(){return"x64"};Ir.totalmem=function(){return navigator.deviceMemory!==void 0?navigator.deviceMemory*(1<<30):2*(1<<30)};Ir.cpus=function(){return Array(navigator.hardwareConcurrency||0).fill({model:"",times:{}})};Ir.uptime=Kd;Ir.constants={};lRe=Ir.version,dRe=Ir.constants,pRe=Ir.EOL,vRe=Ir.arch,mRe=Ir.cpus,gRe=Ir.endianness,bRe=Ir.freemem,yRe=Ir.getNetworkInterfaces,wRe=Ir.homedir,_Re=Ir.hostname,MRe=Ir.loadavg,xRe=Ir.networkInterfaces,SRe=Ir.platform,ERe=Ir.release,ARe=Ir.tmpDir,RRe=Ir.tmpdir,TRe=Ir.totalmem,IRe=Ir.type});var Nre=ht((Slt,Ore)=>{"use strict";ie();ae();ne();Ore.exports=function(t,e){e=e||He.argv||[];var r=e.indexOf("--"),a=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(a+t);return i!==-1&&(r===-1?!0:i<r)}});var Lre=ht((Tlt,Cre)=>{"use strict";ie();ae();ne();var kRe=(Id(),Qr(Td)),$f=Nre(),Ua=He.env,G1=void 0;$f("no-color")||$f("no-colors")||$f("color=false")?G1=!1:($f("color")||$f("colors")||$f("color=true")||$f("color=always"))&&(G1=!0);"FORCE_COLOR"in Ua&&(G1=Ua.FORCE_COLOR.length===0||parseInt(Ua.FORCE_COLOR,10)!==0);function BRe(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function PRe(t){if(G1===!1)return 0;if($f("color=16m")||$f("color=full")||$f("color=truecolor"))return 3;if($f("color=256"))return 2;if(t&&!t.isTTY&&G1!==!0)return 0;var e=G1?1:0;if(He.platform==="win32"){var r=kRe.release().split(".");return Number(He.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ua)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Ua})||Ua.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Ua)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ua.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ua){var a=parseInt((Ua.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ua.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ua.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ua.TERM)||"COLORTERM"in Ua?1:(Ua.TERM==="dumb",e)}function fk(t){var e=PRe(t);return BRe(e)}Cre.exports={supportsColor:fk,stdout:fk(He.stdout),stderr:fk(He.stderr)}});var $re=ht((Plt,Dre)=>{"use strict";ie();ae();ne();Dre.exports=function(e,r){var a="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(h){h=h.toLowerCase();var c=i[h]||[" "],p=Math.floor(Math.random()*c.length);typeof i[h]<"u"?a+=i[h][p]:a+=h}),a}});var Ure=ht((Llt,qre)=>{"use strict";ie();ae();ne();qre.exports=function(e,r){e=e||" he is here ";var a={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(a.up,a.down,a.mid);function h(b){var g=Math.floor(Math.random()*b);return g}function c(b){var g=!1;return i.filter(function(y){g=y===b}),g}function p(b,g){var y="",M,x;g=g||{},g.up=typeof g.up<"u"?g.up:!0,g.mid=typeof g.mid<"u"?g.mid:!0,g.down=typeof g.down<"u"?g.down:!0,g.size=typeof g.size<"u"?g.size:"maxi",b=b.split("");for(x in b)if(!c(x)){switch(y=y+b[x],M={up:0,down:0,mid:0},g.size){case"mini":M.up=h(8),M.mid=h(2),M.down=h(8);break;case"maxi":M.up=h(16)+3,M.mid=h(4)+1,M.down=h(64)+3;break;default:M.up=h(8)+1,M.mid=h(6)/2,M.down=h(8)+1;break}var E=["up","mid","down"];for(var A in E)for(var I=E[A],P=0;P<=M[I];P++)g[I]&&(y=y+a[I][h(a[I].length)])}return y}return p(e,r)}});var jre=ht((Ult,Fre)=>{"use strict";ie();ae();ne();Fre.exports=function(t){return function(e,r,a){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var Zre=ht((Zlt,zre)=>{"use strict";ie();ae();ne();zre.exports=function(t){return function(e,r,a){return r%2===0?e:t.inverse(e)}}});var Kre=ht((Vlt,Hre)=>{"use strict";ie();ae();ne();Hre.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,a,i){return r===" "?r:t[e[a++%e.length]](r)}}});var Vre=ht((Xlt,Wre)=>{"use strict";ie();ae();ne();Wre.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,a,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var eie=ht((i0t,Qre)=>{"use strict";ie();ae();ne();var Vr={};Qre.exports=Vr;Vr.themes={};var ORe=(ao(),Qr(Af)),kd=Vr.styles=Bre(),Yre=Object.defineProperties,NRe=new RegExp(/[\r\n]+/g);Vr.supportsColor=Lre().supportsColor;typeof Vr.enabled>"u"&&(Vr.enabled=Vr.supportsColor()!==!1);Vr.enable=function(){Vr.enabled=!0};Vr.disable=function(){Vr.enabled=!1};Vr.stripColors=Vr.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var r0t=Vr.stylize=function(e,r){if(!Vr.enabled)return e+"";var a=kd[r];return!a&&r in Vr?Vr[r](e):a.open+e+a.close},CRe=/[|\\{}()[\]^$+*?.]/g,LRe=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(CRe,"\\$&")};function Jre(t){var e=function r(){return $Re.apply(r,arguments)};return e._styles=t,e.__proto__=DRe,e}var Xre=function(){var t={};return kd.grey=kd.gray,Object.keys(kd).forEach(function(e){kd[e].closeRe=new RegExp(LRe(kd[e].close),"g"),t[e]={get:function(){return Jre(this._styles.concat(e))}}}),t}(),DRe=Yre(function(){},Xre);function $Re(){var t=Array.prototype.slice.call(arguments),e=t.map(function(c){return c!=null&&c.constructor===String?c:ORe.inspect(c)}).join(" ");if(!Vr.enabled||!e)return e;for(var r=e.indexOf(`
|
|
42
|
+
`)!=-1,a=this._styles,i=a.length;i--;){var h=kd[a[i]];e=h.open+e.replace(h.closeRe,h.open)+h.close,r&&(e=e.replace(NRe,function(c){return h.close+c+h.open}))}return e}Vr.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){Vr[r]=function(a){if(typeof t[r]=="object"){var i=a;for(var h in t[r])i=Vr[t[r][h]](i);return i}return Vr[t[r]](a)}})(e)};function qRe(){var t={};return Object.keys(Xre).forEach(function(e){t[e]={get:function(){return Jre([e])}}}),t}var URe=function(e,r){var a=r.split("");return a=a.map(e),a.join("")};Vr.trap=$re();Vr.zalgo=Ure();Vr.maps={};Vr.maps.america=jre()(Vr);Vr.maps.zebra=Zre()(Vr);Vr.maps.rainbow=Kre()(Vr);Vr.maps.random=Vre()(Vr);for(Gre in Vr.maps)(function(t){Vr[t]=function(e){return URe(Vr.maps[t],e)}})(Gre);var Gre;Yre(Vr,qRe())});var uk=ht((s0t,tie)=>{"use strict";ie();ae();ne();var FRe=eie();tie.exports=FRe});var rie=ht(hk=>{"use strict";ie();ae();ne();hk.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};hk.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var iie=ht(ck=>{"use strict";ie();ae();ne();ck.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};ck.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var nie=ht(lk=>{"use strict";ie();ae();ne();lk.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};lk.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var aie=ht(D4=>{"use strict";ie();ae();ne();Object.defineProperty(D4,"cli",{value:rie()});Object.defineProperty(D4,"npm",{value:iie()});Object.defineProperty(D4,"syslog",{value:nie()})});var on=ht(z2=>{"use strict";ie();ae();ne();Object.defineProperty(z2,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(z2,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(z2,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(z2,"configs",{value:aie()})});var q4=ht((B0t,$4)=>{"use strict";ie();ae();ne();function Z2(t){"@babel/helpers - typeof";return Z2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z2(t)}function jRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,ZRe(a.key),a)}}function zRe(t,e,r){return e&&oie(t.prototype,e),r&&oie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ZRe(t){var e=HRe(t,"string");return Z2(e)==="symbol"?e:String(e)}function HRe(t,e){if(Z2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Z2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vk=uk(),fie=on(),dk=fie.LEVEL,pk=fie.MESSAGE;vk.enabled=!0;var sie=/\s+/,uie=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jRe(this,t),e.colors&&this.addColors(e.colors),this.options=e}return zRe(t,[{key:"addColors",value:function(r){return t.addColors(r)}},{key:"colorize",value:function(r,a,i){if(typeof i>"u"&&(i=a),!Array.isArray(t.allColors[r]))return vk[t.allColors[r]](i);for(var h=0,c=t.allColors[r].length;h<c;h++)i=vk[t.allColors[r][h]](i);return i}},{key:"transform",value:function(r,a){return a.all&&typeof r[pk]=="string"&&(r[pk]=this.colorize(r[dk],r.level,r[pk])),(a.level||a.all||!a.message)&&(r.level=this.colorize(r[dk],r.level)),(a.all||a.message)&&(r.message=this.colorize(r[dk],r.level,r.message)),r}}],[{key:"addColors",value:function(r){var a=Object.keys(r).reduce(function(i,h){return i[h]=sie.test(r[h])?r[h].split(sie):r[h],i},{});return t.allColors=Object.assign({},t.allColors||{},a),t.allColors}}]),t}();$4.exports=function(t){return new uie(t)};$4.exports.Colorizer=$4.exports.Format=uie});var cie=ht((C0t,hie)=>{"use strict";ie();ae();ne();var KRe=q4(),WRe=KRe.Colorizer;hie.exports=function(t){return WRe.addColors(t.colors||t),t}});var die=ht((q0t,lie)=>{"use strict";ie();ae();ne();var VRe=uo();lie.exports=VRe(function(t){return t.message=" ".concat(t.message),t})});var yk=ht((z0t,U4)=>{"use strict";ie();ae();ne();function H2(t){"@babel/helpers - typeof";return H2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H2(t)}function GRe(t){return QRe(t)||XRe(t)||JRe(t)||YRe()}function YRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
43
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JRe(t,e){if(t){if(typeof t=="string")return gk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gk(t,e)}}function XRe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function QRe(t){if(Array.isArray(t))return gk(t)}function gk(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function eTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,rTe(a.key),a)}}function tTe(t,e,r){return e&&pie(t.prototype,e),r&&pie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rTe(t){var e=iTe(t,"string");return H2(e)==="symbol"?e:String(e)}function iTe(t,e){if(H2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(H2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bk=on(),nTe=bk.configs,vie=bk.LEVEL,mk=bk.MESSAGE,mie=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{levels:nTe.npm.levels};eTe(this,t),this.paddings=t.paddingForLevels(e.levels,e.filler),this.options=e}return tTe(t,[{key:"transform",value:function(r,a){return r.message="".concat(this.paddings[r[vie]]).concat(r.message),r[mk]&&(r[mk]="".concat(this.paddings[r[vie]]).concat(r[mk])),r}}],[{key:"getLongestLevel",value:function(r){var a=Object.keys(r).map(function(i){return i.length});return Math.max.apply(Math,GRe(a))}},{key:"paddingForLevel",value:function(r,a,i){var h=i+1-r.length,c=Math.floor(h/a.length),p="".concat(a).concat(a.repeat(c));return p.slice(0,h)}},{key:"paddingForLevels",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ",i=t.getLongestLevel(r);return Object.keys(r).reduce(function(h,c){return h[c]=t.paddingForLevel(c,a,i),h},{})}}]),t}();U4.exports=function(t){return new mie(t)};U4.exports.Padder=U4.exports.Format=mie});var wie=ht((W0t,wk)=>{"use strict";ie();ae();ne();function K2(t){"@babel/helpers - typeof";return K2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K2(t)}function aTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,sTe(a.key),a)}}function oTe(t,e,r){return e&&gie(t.prototype,e),r&&gie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function sTe(t){var e=fTe(t,"string");return K2(e)==="symbol"?e:String(e)}function fTe(t,e){if(K2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(K2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uTe=q4(),hTe=uTe.Colorizer,cTe=yk(),lTe=cTe.Padder,bie=on(),dTe=bie.configs,pTe=bie.MESSAGE,yie=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};aTe(this,t),e.levels||(e.levels=dTe.cli.levels),this.colorizer=new hTe(e),this.padder=new lTe(e),this.options=e}return oTe(t,[{key:"transform",value:function(r,a){return this.colorizer.transform(this.padder.transform(r,a),a),r[pTe]="".concat(r.level,":").concat(r.message),r}}]),t}();wk.exports=function(t){return new yie(t)};wk.exports.Format=yie});var Mie=ht((J0t,_k)=>{"use strict";ie();ae();ne();var vTe=uo();function _ie(t){if(t.every(mTe))return function(e){for(var r=e,a=0;a<t.length;a++)if(r=t[a].transform(r,t[a].options),!r)return!1;return r}}function mTe(t){if(typeof t.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
|
|
44
|
+
`));return!0}_k.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var a=vTe(_ie(e)),i=a();return i.Format=a.Format,i};_k.exports.cascade=_ie});var Aie=ht((tdt,Eie)=>{"use strict";ie();ae();ne();function W2(t){"@babel/helpers - typeof";return W2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W2(t)}function Mk(t,e,r){return e=gTe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gTe(t){var e=bTe(t,"string");return W2(e)==="symbol"?e:String(e)}function bTe(t,e){if(W2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(W2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yTe=uo(),Sie=on(),xie=Sie.LEVEL,xk=Sie.MESSAGE;Eie.exports=yTe(function(t,e){var r=e.stack,a=e.cause;if(t instanceof Error){var i,h=Object.assign({},t,(i={level:t.level},Mk(i,xie,t[xie]||t.level),Mk(i,"message",t.message),Mk(i,xk,t[xk]||t.message),i));return r&&(h.stack=t.stack),a&&(h.cause=t.cause),h}if(!(t.message instanceof Error))return t;var c=t.message;return Object.assign(t,c),t.message=c.message,t[xk]=c.message,r&&(t.stack=c.stack),a&&(t.cause=c.cause),t})});var Y1=ht((Rk,kie)=>{"use strict";ie();ae();ne();var{hasOwnProperty:F4}=Object.prototype,Pd=Ak();Pd.configure=Ak;Pd.stringify=Pd;Pd.default=Pd;Rk.stringify=Pd;Rk.configure=Ak;kie.exports=Pd;var wTe=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Tl(t){return t.length<5e3&&!wTe.test(t)?`"${t}"`:JSON.stringify(t)}function Sk(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],a=e;for(;a!==0&&t[a-1]>r;)t[a]=t[a-1],a--;t[a]=r}return t}var _Te=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ek(t){return _Te.call(t)!==void 0&&t.length!==0}function Rie(t,e,r){t.length<r&&(r=t.length);let a=e===","?"":" ",i=`"0":${a}${t[0]}`;for(let h=1;h<r;h++)i+=`${e}"${h}":${a}${t[h]}`;return i}function MTe(t){if(F4.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Tie(t,e){let r;if(F4.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function Iie(t,e){let r;if(F4.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Bd(t){return t===1?"1 item":`${t} items`}function xTe(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function STe(t){if(F4.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let a=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(a+=` (${r.toString()})`),new Error(a)}}}function Ak(t){t={...t};let e=STe(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=MTe(t),a=Tie(t,"bigint"),i=Tie(t,"deterministic"),h=Iie(t,"maximumDepth"),c=Iie(t,"maximumBreadth");function p(x,E,A,I,P,N){let L=E[x];switch(typeof L=="object"&&L!==null&&typeof L.toJSON=="function"&&(L=L.toJSON(x)),L=I.call(E,x,L),typeof L){case"string":return Tl(L);case"object":{if(L===null)return"null";if(A.indexOf(L)!==-1)return r;let C="",Y=",",G=N;if(Array.isArray(L)){if(L.length===0)return"[]";if(h<A.length+1)return'"[Array]"';A.push(L),P!==""&&(N+=P,C+=`
|
|
45
45
|
${N}`,Y=`,
|
|
46
46
|
${N}`);let n=Math.min(L.length,c),s=0;for(;s<n-1;s++){let u=p(String(s),L,A,I,P,N);C+=u!==void 0?u:"null",C+=Y}let f=p(String(s),L,A,I,P,N);if(C+=f!==void 0?f:"null",L.length-1>c){let u=L.length-c-1;C+=`${Y}"... ${Bd(u)} not stringified"`}return P!==""&&(C+=`
|
|
47
47
|
${G}`),A.pop(),`[${C}]`}let ee=Object.keys(L),D=ee.length;if(D===0)return"{}";if(h<A.length+1)return'"[Object]"';let U="",V="";P!==""&&(N+=P,Y=`,
|
|
@@ -59,10 +59,10 @@ ${P}`,_=Math.min(E.length,c),n=0;for(;n<_-1;n++){let f=g(String(n),E[n],A,I,P);U
|
|
|
59
59
|
${N}`,A.pop(),`[${U}]`}let L=Object.keys(E),C=L.length;if(C===0)return"{}";if(h<A.length+1)return'"[Object]"';P+=I;let Y=`,
|
|
60
60
|
${P}`,G="",ee="",D=Math.min(C,c);Ek(E)&&(G+=Rie(E,Y,c),L=L.slice(E.length),D-=E.length,ee=Y),i&&(L=Sk(L)),A.push(E);for(let U=0;U<D;U++){let V=L[U],_=g(V,E[V],A,I,P);_!==void 0&&(G+=`${ee}${Tl(V)}: ${_}`,ee=Y)}if(C>c){let U=C-c;G+=`${ee}"...": "${Bd(U)} not stringified"`,ee=Y}return ee!==""&&(G=`
|
|
61
61
|
${P}${G}
|
|
62
|
-
${N}`),A.pop(),`{${G}}`}case"number":return isFinite(E)?String(E):e?e(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(E);default:return e?e(E):void 0}}function y(x,E,A){switch(typeof E){case"string":return Tl(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(x),typeof E!="object")return y(x,E,A);if(E===null)return"null"}if(A.indexOf(E)!==-1)return r;let I="";if(Array.isArray(E)){if(E.length===0)return"[]";if(h<A.length+1)return'"[Array]"';A.push(E);let Y=Math.min(E.length,c),G=0;for(;G<Y-1;G++){let D=y(String(G),E[G],A);I+=D!==void 0?D:"null",I+=","}let ee=y(String(G),E[G],A);if(I+=ee!==void 0?ee:"null",E.length-1>c){let D=E.length-c-1;I+=`,"... ${Bd(D)} not stringified"`}return A.pop(),`[${I}]`}let P=Object.keys(E),N=P.length;if(N===0)return"{}";if(h<A.length+1)return'"[Object]"';let L="",C=Math.min(N,c);Ek(E)&&(I+=Rie(E,",",c),P=P.slice(E.length),C-=E.length,L=","),i&&(P=Sk(P)),A.push(E);for(let Y=0;Y<C;Y++){let G=P[Y],ee=y(G,E[G],A);ee!==void 0&&(I+=`${L}${Tl(G)}:${ee}`,L=",")}if(N>c){let Y=N-c;I+=`${L}"...":"${Bd(Y)} not stringified"`}return A.pop(),`{${I}}`}case"number":return isFinite(E)?String(E):e?e(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(E);default:return e?e(E):void 0}}function M(x,E,A){if(arguments.length>1){let I="";if(typeof A=="number"?I=" ".repeat(Math.min(A,10)):typeof A=="string"&&(I=A.slice(0,10)),E!=null){if(typeof E=="function")return p("",{"":x},[],E,I,"");if(Array.isArray(E))return b("",x,[],xTe(E),I,"")}if(I.length!==0)return g("",x,[],I,"")}return y("",x,[])}return M}});var Pie=ht((
|
|
63
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uIe(t,e){if(t){if(typeof t=="string")return Ik(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ik(t,e)}}function hIe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cIe(t){if(Array.isArray(t))return Ik(t)}function Ik(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function lIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,pIe(a.key),a)}}function dIe(t,e,r){return e&&Xie(t.prototype,e),r&&Xie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pIe(t){var e=vIe(t,"string");return Y2(e)==="symbol"?e:String(e)}function vIe(t,e){if(Y2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Y2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qie=(ao(),Qr(Af)),mIe=on(),ene=mIe.SPLAT,gIe=/%[scdjifoO%]/g,bIe=/%%/g,yIe=function(){function t(e){lIe(this,t),this.options=e}return dIe(t,[{key:"_splat",value:function(r,a){var i=r.message,h=r[ene]||r.splat||[],c=i.match(bIe),p=c&&c.length||0,b=a.length-p,g=b-h.length,y=g<0?h.splice(g,-1*g):[],M=y.length;if(M)for(var x=0;x<M;x++)Object.assign(r,y[x]);return r.message=Qie.format.apply(Qie,[i].concat(sIe(h))),r}},{key:"transform",value:function(r){var a=r.message,i=r[ene]||r.splat;if(!i||!i.length)return r;var h=a&&a.match&&a.match(gIe);if(!h&&(i||i.length)){var c=i.length>1?i.splice(0):i,p=c.length;if(p)for(var b=0;b<p;b++)Object.assign(r,c[b]);return r}return h?this._splat(r,h):r}}]),t}();tne.exports=function(t){return new yIe(t)}});var nne=ht((H4,ine)=>{"use strict";ie();ae();ne();(function(t,e){typeof H4=="object"&&typeof ine<"u"?e(H4):typeof define=="function"&&define.amd?define(["exports"],e):e(t.fecha={})})(H4,function(t){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,r="\\d\\d?",a="\\d\\d",i="\\d{3}",h="\\d{4}",c="[^\\s]+",p=/\[([^]*?)\]/gm;function b(m,w){for(var d=[],o=0,v=m.length;o<v;o++)d.push(m[o].substr(0,w));return d}var g=function(m){return function(w,d){var o=d[m].map(function(R){return R.toLowerCase()}),v=o.indexOf(w.toLowerCase());return v>-1?v:null}};function y(m){for(var w=[],d=1;d<arguments.length;d++)w[d-1]=arguments[d];for(var o=0,v=w;o<v.length;o++){var R=v[o];for(var S in R)m[S]=R[S]}return m}var M=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],x=["January","February","March","April","May","June","July","August","September","October","November","December"],E=b(x,3),A=b(M,3),I={dayNamesShort:A,dayNames:M,monthNamesShort:E,monthNames:x,amPm:["am","pm"],DoFn:function(m){return m+["th","st","nd","rd"][m%10>3?0:(m-m%10!==10?1:0)*m%10]}},P=y({},I),N=function(m){return P=y(P,m)},L=function(m){return m.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},C=function(m,w){for(w===void 0&&(w=2),m=String(m);m.length<w;)m="0"+m;return m},Y={D:function(m){return String(m.getDate())},DD:function(m){return C(m.getDate())},Do:function(m,w){return w.DoFn(m.getDate())},d:function(m){return String(m.getDay())},dd:function(m){return C(m.getDay())},ddd:function(m,w){return w.dayNamesShort[m.getDay()]},dddd:function(m,w){return w.dayNames[m.getDay()]},M:function(m){return String(m.getMonth()+1)},MM:function(m){return C(m.getMonth()+1)},MMM:function(m,w){return w.monthNamesShort[m.getMonth()]},MMMM:function(m,w){return w.monthNames[m.getMonth()]},YY:function(m){return C(String(m.getFullYear()),4).substr(2)},YYYY:function(m){return C(m.getFullYear(),4)},h:function(m){return String(m.getHours()%12||12)},hh:function(m){return C(m.getHours()%12||12)},H:function(m){return String(m.getHours())},HH:function(m){return C(m.getHours())},m:function(m){return String(m.getMinutes())},mm:function(m){return C(m.getMinutes())},s:function(m){return String(m.getSeconds())},ss:function(m){return C(m.getSeconds())},S:function(m){return String(Math.round(m.getMilliseconds()/100))},SS:function(m){return C(Math.round(m.getMilliseconds()/10),2)},SSS:function(m){return C(m.getMilliseconds(),3)},a:function(m,w){return m.getHours()<12?w.amPm[0]:w.amPm[1]},A:function(m,w){return m.getHours()<12?w.amPm[0].toUpperCase():w.amPm[1].toUpperCase()},ZZ:function(m){var w=m.getTimezoneOffset();return(w>0?"-":"+")+C(Math.floor(Math.abs(w)/60)*100+Math.abs(w)%60,4)},Z:function(m){var w=m.getTimezoneOffset();return(w>0?"-":"+")+C(Math.floor(Math.abs(w)/60),2)+":"+C(Math.abs(w)%60,2)}},G=function(m){return+m-1},ee=[null,r],D=[null,c],U=["isPm",c,function(m,w){var d=m.toLowerCase();return d===w.amPm[0]?0:d===w.amPm[1]?1:null}],V=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(m){var w=(m+"").match(/([+-]|\d\d)/gi);if(w){var d=+w[1]*60+parseInt(w[2],10);return w[0]==="+"?d:-d}return 0}],_={D:["day",r],DD:["day",a],Do:["day",r+c,function(m){return parseInt(m,10)}],M:["month",r,G],MM:["month",a,G],YY:["year",a,function(m){var w=new Date,d=+(""+w.getFullYear()).substr(0,2);return+(""+(+m>68?d-1:d)+m)}],h:["hour",r,void 0,"isPm"],hh:["hour",a,void 0,"isPm"],H:["hour",r],HH:["hour",a],m:["minute",r],mm:["minute",a],s:["second",r],ss:["second",a],YYYY:["year",h],S:["millisecond","\\d",function(m){return+m*100}],SS:["millisecond",a,function(m){return+m*10}],SSS:["millisecond",i],d:ee,dd:ee,ddd:D,dddd:D,MMM:["month",c,g("monthNamesShort")],MMMM:["month",c,g("monthNames")],a:U,A:U,ZZ:V,Z:V},n={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},s=function(m){return y(n,m)},f=function(m,w,d){if(w===void 0&&(w=n.default),d===void 0&&(d={}),typeof m=="number"&&(m=new Date(m)),Object.prototype.toString.call(m)!=="[object Date]"||isNaN(m.getTime()))throw new Error("Invalid Date pass to format");w=n[w]||w;var o=[];w=w.replace(p,function(R,S){return o.push(S),"@@@"});var v=y(y({},P),d);return w=w.replace(e,function(R){return Y[R](m,v)}),w.replace(/@@@/g,function(){return o.shift()})};function u(m,w,d){if(d===void 0&&(d={}),typeof w!="string")throw new Error("Invalid format in fecha parse");if(w=n[w]||w,m.length>1e3)return null;var o=new Date,v={year:o.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},R=[],S=[],B=w.replace(p,function(Te,oe){return S.push(L(oe)),"@@@"}),F={},$={};B=L(B).replace(e,function(Te){var oe=_[Te],le=oe[0],ot=oe[1],ge=oe[3];if(F[le])throw new Error("Invalid format. "+le+" specified twice in format");return F[le]=!0,ge&&($[ge]=!0),R.push(oe),"("+ot+")"}),Object.keys($).forEach(function(Te){if(!F[Te])throw new Error("Invalid format. "+Te+" is required in specified format")}),B=B.replace(/@@@/g,function(){return S.shift()});var re=m.match(new RegExp(B,"i"));if(!re)return null;for(var Q=y(y({},P),d),Z=1;Z<re.length;Z++){var K=R[Z-1],ce=K[0],te=K[2],j=te?te(re[Z],Q):+re[Z];if(j==null)return null;v[ce]=j}v.isPm===1&&v.hour!=null&&+v.hour!=12?v.hour=+v.hour+12:v.isPm===0&&+v.hour==12&&(v.hour=0);var J;if(v.timezoneOffset==null){J=new Date(v.year,v.month,v.day,v.hour,v.minute,v.second,v.millisecond);for(var X=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],Z=0,he=X.length;Z<he;Z++)if(F[X[Z][0]]&&v[X[Z][0]]!==J[X[Z][1]]())return null}else if(J=new Date(Date.UTC(v.year,v.month,v.day,v.hour,v.minute-v.timezoneOffset,v.second,v.millisecond)),v.month>11||v.month<0||v.day>31||v.day<1||v.hour>23||v.hour<0||v.minute>59||v.minute<0||v.second>59||v.second<0)return null;return J}var l={format:f,parse:u,defaultI18n:I,setGlobalDateI18n:N,setGlobalDateMasks:s};t.assign=y,t.default=l,t.format=f,t.parse=u,t.defaultI18n=I,t.setGlobalDateI18n=N,t.setGlobalDateMasks=s,Object.defineProperty(t,"__esModule",{value:!0})})});var one=ht((Ydt,ane)=>{"use strict";ie();ae();ne();var wIe=nne(),_Ie=uo();ane.exports=_Ie(function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.format&&(t.timestamp=typeof e.format=="function"?e.format():wIe.format(new Date,e.format)),t.timestamp||(t.timestamp=new Date().toISOString()),e.alias&&(t[e.alias]=t.timestamp),t})});var fne=ht((ept,sne)=>{"use strict";ie();ae();ne();var kk=uk(),MIe=uo(),xIe=on(),Bk=xIe.MESSAGE;sne.exports=MIe(function(t,e){return e.level!==!1&&(t.level=kk.strip(t.level)),e.message!==!1&&(t.message=kk.strip(String(t.message))),e.raw!==!1&&t[Bk]&&(t[Bk]=kk.strip(String(t[Bk]))),t})});var Ok=ht(Pk=>{"use strict";ie();ae();ne();var da=Pk.format=uo();Pk.levels=cie();Object.defineProperty(da,"align",{value:die()});Object.defineProperty(da,"cli",{value:wie()});Object.defineProperty(da,"colorize",{value:q4()});Object.defineProperty(da,"combine",{value:Mie()});Object.defineProperty(da,"errors",{value:Aie()});Object.defineProperty(da,"json",{value:Pie()});Object.defineProperty(da,"label",{value:Nie()});Object.defineProperty(da,"logstash",{value:Lie()});Object.defineProperty(da,"metadata",{value:$ie()});Object.defineProperty(da,"ms",{value:jie()});Object.defineProperty(da,"padLevels",{value:yk()});Object.defineProperty(da,"prettyPrint",{value:Hie()});Object.defineProperty(da,"printf",{value:Vie()});Object.defineProperty(da,"simple",{value:Jie()});Object.defineProperty(da,"splat",{value:rne()});Object.defineProperty(da,"timestamp",{value:one()});Object.defineProperty(da,"uncolorize",{value:fne()})});var Nk=ht(K4=>{"use strict";ie();ae();ne();var SIe=(ao(),Qr(Af)),une=SIe.format;K4.warn={deprecated:function(e){return function(){throw new Error(une("{ %s } was removed in winston@3.0.0.",e))}},useFormat:function(e){return function(){throw new Error([une("{ %s } was removed in winston@3.0.0.",e),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
64
|
-
`))}},forFunctions:function(e,r,a){a.forEach(function(i){e[i]=K4.warn[r](i)})},forProperties:function(e,r,a){a.forEach(function(i){var h=K4.warn[r](i);Object.defineProperty(e,i,{get:h,set:h})})}}});var hne=ht((
|
|
65
|
-
`))};X2.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var ev=ht((_pt,Dk)=>{"use strict";ie();ae();ne();Dk.exports=Ck();Dk.exports.LegacyTransportStream=mne()});var Mne=ht((Ept,_ne)=>{"use strict";ie();ae();ne();function rv(t){"@babel/helpers - typeof";return rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rv(t)}function kIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,PIe(a.key),a)}}function BIe(t,e,r){return e&&gne(t.prototype,e),r&&gne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function PIe(t){var e=OIe(t,"string");return rv(e)=="symbol"?e:String(e)}function OIe(t,e){if(rv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(rv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NIe(t,e,r){return e=W4(e),CIe(t,yne()?Reflect.construct(e,r||[],W4(t).constructor):e.apply(t,r))}function CIe(t,e){if(e&&(rv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LIe(t)}function LIe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yne=function(){return!!t})()}function W4(t){return W4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W4(t)}function DIe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$k(t,e)}function $k(t,e){return $k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},$k(t,e)}var $Ie=(Id(),Qr(Td)),wne=on(),bne=wne.LEVEL,tv=wne.MESSAGE,qIe=ev();_ne.exports=function(t){DIe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return kIe(this,e),r=NIe(this,e,[a]),r.name=a.name||"console",r.stderrLevels=r._stringArrayToSet(a.stderrLevels),r.consoleWarnLevels=r._stringArrayToSet(a.consoleWarnLevels),r.eol=typeof a.eol=="string"?a.eol:$Ie.EOL,r.setMaxListeners(30),r}return BIe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.stderrLevels[a[bne]]){console._stderr?console._stderr.write("".concat(a[tv]).concat(this.eol)):console.error(a[tv]),i&&i();return}else if(this.consoleWarnLevels[a[bne]]){console._stderr?console._stderr.write("".concat(a[tv]).concat(this.eol)):console.warn(a[tv]),i&&i();return}console._stdout?console._stdout.write("".concat(a[tv]).concat(this.eol)):console.log(a[tv]),i&&i()}},{key:"_stringArrayToSet",value:function(a,i){if(!a)return{};if(i=i||"Cannot make set from type other than Array of string elements",!Array.isArray(a))throw new Error(i);return a.reduce(function(h,c){if(typeof c!="string")throw new Error(i);return h[c]=!0,h},{})}}]),e}(qIe)});function xne(t,e){if(t==null)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),a=1;a<arguments.length;a++){var i=arguments[a];if(i!=null)for(var h=Object.keys(Object(i)),c=0,p=h.length;c<p;c++){var b=h[c],g=Object.getOwnPropertyDescriptor(i,b);g!==void 0&&g.enumerable&&(r[b]=i[b])}}return r}function dae(){if(Lne)return Hk;function t(g){return(t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y})(g)}function e(g,y){return!y||t(y)!=="object"&&typeof y!="function"?function(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}(g):y}function r(g){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)})(g)}function a(g,y){return(a=Object.setPrototypeOf||function(M,x){return M.__proto__=x,M})(g,y)}Lne=!0;var i,h,c={};function p(g,y,M){M||(M=Error);var x=function(E){function A(I,P,N){var L;return function(C,Y){if(!(C instanceof Y))throw new TypeError("Cannot call a class as a function")}(this,A),(L=e(this,r(A).call(this,function(C,Y,G){return typeof y=="string"?y:y(C,Y,G)}(I,P,N)))).code=g,L}return function(I,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(P&&P.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),P&&a(I,P)}(A,E),A}(M);c[g]=x}function b(g,y){if(Array.isArray(g)){var M=g.length;return g=g.map(function(x){return String(x)}),M>2?"one of ".concat(y," ").concat(g.slice(0,M-1).join(", "),", or ")+g[M-1]:M===2?"one of ".concat(y," ").concat(g[0]," or ").concat(g[1]):"of ".concat(y," ").concat(g[0])}return"of ".concat(y," ").concat(String(g))}return p("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),p("ERR_INVALID_ARG_TYPE",function(g,y,M){var x,E,A;if(i===void 0&&(i=Jk()),i(typeof g=="string","'name' must be a string"),typeof y=="string"&&(E="not ",y.substr(0,E.length)===E)?(x="must not be",y=y.replace(/^not /,"")):x="must be",function(P,N,L){return(L===void 0||L>P.length)&&(L=P.length),P.substring(L-N.length,L)===N}(g," argument"))A="The ".concat(g," ").concat(x," ").concat(b(y,"type"));else{var I=function(P,N,L){return typeof L!="number"&&(L=0),!(L+N.length>P.length)&&P.indexOf(N,L)!==-1}(g,".")?"property":"argument";A='The "'.concat(g,'" ').concat(I," ").concat(x," ").concat(b(y,"type"))}return A+=". Received type ".concat(t(M))},TypeError),p("ERR_INVALID_ARG_VALUE",function(g,y){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";h===void 0&&(h=gt);var x=h.inspect(y);return x.length>128&&(x="".concat(x.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(M,". Received ").concat(x)},TypeError),p("ERR_INVALID_RETURN_VALUE",function(g,y,M){var x;return x=M&&M.constructor&&M.constructor.name?"instance of ".concat(M.constructor.name):"type ".concat(t(M)),"Expected ".concat(g,' to be returned from the "').concat(y,'"')+" function but got ".concat(x,".")},TypeError),p("ERR_MISSING_ARGS",function(){for(var g=arguments.length,y=new Array(g),M=0;M<g;M++)y[M]=arguments[M];i===void 0&&(i=Jk()),i(y.length>0,"At least one arg needs to be specified");var x="The ",E=y.length;switch(y=y.map(function(A){return'"'.concat(A,'"')}),E){case 1:x+="".concat(y[0]," argument");break;case 2:x+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:x+=y.slice(0,E-1).join(", "),x+=", and ".concat(y[E-1]," arguments")}return"".concat(x," must be specified")},TypeError),Hk.codes=c,Hk}function Ske(){if($ne)return Dne;$ne=!0;var t=ur;function e(D,U,V){return U in D?Object.defineProperty(D,U,{value:V,enumerable:!0,configurable:!0,writable:!0}):D[U]=V,D}function r(D,U){for(var V=0;V<U.length;V++){var _=U[V];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(D,_.key,_)}}function a(D,U){return!U||y(U)!=="object"&&typeof U!="function"?i(D):U}function i(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function h(D){var U=typeof Map=="function"?new Map:void 0;return(h=function(V){if(V===null||(_=V,Function.toString.call(_).indexOf("[native code]")===-1))return V;var _;if(typeof V!="function")throw new TypeError("Super expression must either be null or a function");if(U!==void 0){if(U.has(V))return U.get(V);U.set(V,n)}function n(){return p(V,arguments,g(this).constructor)}return n.prototype=Object.create(V.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),b(n,V)})(D)}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function p(D,U,V){return(p=c()?Reflect.construct:function(_,n,s){var f=[null];f.push.apply(f,n);var u=new(Function.bind.apply(_,f));return s&&b(u,s.prototype),u}).apply(null,arguments)}function b(D,U){return(b=Object.setPrototypeOf||function(V,_){return V.__proto__=_,V})(D,U)}function g(D){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)})(D)}function y(D){return(y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U})(D)}var M=gt.inspect,x=dae().codes.ERR_INVALID_ARG_TYPE;function E(D,U,V){return(V===void 0||V>D.length)&&(V=D.length),D.substring(V-U.length,V)===U}var A="",I="",P="",N="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function C(D){var U=Object.keys(D),V=Object.create(Object.getPrototypeOf(D));return U.forEach(function(_){V[_]=D[_]}),Object.defineProperty(V,"message",{value:D.message}),V}function Y(D){return M(D,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function G(D,U,V){var _="",n="",s=0,f="",u=!1,l=Y(D),m=l.split(`
|
|
62
|
+
${N}`),A.pop(),`{${G}}`}case"number":return isFinite(E)?String(E):e?e(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(E);default:return e?e(E):void 0}}function y(x,E,A){switch(typeof E){case"string":return Tl(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(x),typeof E!="object")return y(x,E,A);if(E===null)return"null"}if(A.indexOf(E)!==-1)return r;let I="";if(Array.isArray(E)){if(E.length===0)return"[]";if(h<A.length+1)return'"[Array]"';A.push(E);let Y=Math.min(E.length,c),G=0;for(;G<Y-1;G++){let D=y(String(G),E[G],A);I+=D!==void 0?D:"null",I+=","}let ee=y(String(G),E[G],A);if(I+=ee!==void 0?ee:"null",E.length-1>c){let D=E.length-c-1;I+=`,"... ${Bd(D)} not stringified"`}return A.pop(),`[${I}]`}let P=Object.keys(E),N=P.length;if(N===0)return"{}";if(h<A.length+1)return'"[Object]"';let L="",C=Math.min(N,c);Ek(E)&&(I+=Rie(E,",",c),P=P.slice(E.length),C-=E.length,L=","),i&&(P=Sk(P)),A.push(E);for(let Y=0;Y<C;Y++){let G=P[Y],ee=y(G,E[G],A);ee!==void 0&&(I+=`${L}${Tl(G)}:${ee}`,L=",")}if(N>c){let Y=N-c;I+=`${L}"...":"${Bd(Y)} not stringified"`}return A.pop(),`{${I}}`}case"number":return isFinite(E)?String(E):e?e(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(E);default:return e?e(E):void 0}}function M(x,E,A){if(arguments.length>1){let I="";if(typeof A=="number"?I=" ".repeat(Math.min(A,10)):typeof A=="string"&&(I=A.slice(0,10)),E!=null){if(typeof E=="function")return p("",{"":x},[],E,I,"");if(Array.isArray(E))return b("",x,[],xTe(E),I,"")}if(I.length!==0)return g("",x,[],I,"")}return y("",x,[])}return M}});var Pie=ht((fdt,Bie)=>{"use strict";ie();ae();ne();var ETe=uo(),ATe=on(),RTe=ATe.MESSAGE,TTe=Y1();function ITe(t,e){return typeof e=="bigint"?e.toString():e}Bie.exports=ETe(function(t,e){var r=TTe.configure(e);return t[RTe]=r(t,e.replacer||ITe,e.space),t})});var Nie=ht((ldt,Oie)=>{"use strict";ie();ae();ne();var kTe=uo();Oie.exports=kTe(function(t,e){return e.message?(t.message="[".concat(e.label,"] ").concat(t.message),t):(t.label=e.label,t)})});var Lie=ht((mdt,Cie)=>{"use strict";ie();ae();ne();var BTe=uo(),PTe=on(),OTe=PTe.MESSAGE,NTe=Y1();Cie.exports=BTe(function(t){var e={};return t.message&&(e["@message"]=t.message,delete t.message),t.timestamp&&(e["@timestamp"]=t.timestamp,delete t.timestamp),e["@fields"]=t,t[OTe]=NTe(e),t})});var $ie=ht((wdt,Die)=>{"use strict";ie();ae();ne();function V2(t){"@babel/helpers - typeof";return V2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V2(t)}function CTe(t,e,r){return e=LTe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LTe(t){var e=DTe(t,"string");return V2(e)==="symbol"?e:String(e)}function DTe(t,e){if(V2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(V2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $Te=uo();function qTe(t,e,r){var a=e.reduce(function(h,c){return h[c]=t[c],delete t[c],h},{}),i=Object.keys(t).reduce(function(h,c){return h[c]=t[c],delete t[c],h},{});return Object.assign(t,a,CTe({},r,i)),t}function UTe(t,e,r){return t[r]=e.reduce(function(a,i){return a[i]=t[i],delete t[i],a},{}),t}Die.exports=$Te(function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r="metadata";e.key&&(r=e.key);var a=[];return!e.fillExcept&&!e.fillWith&&(a.push("level"),a.push("message")),e.fillExcept&&(a=e.fillExcept),a.length>0?qTe(t,a,r):e.fillWith?UTe(t,e.fillWith,r):t})});var Uie=ht((Sdt,qie)=>{"use strict";ie();ae();ne();var J1=1e3,X1=J1*60,Q1=X1*60,Od=Q1*24,FTe=Od*7,jTe=Od*365.25;qie.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return zTe(t);if(r==="number"&&isFinite(t))return e.long?HTe(t):ZTe(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function zTe(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),a=(e[2]||"ms").toLowerCase();switch(a){case"years":case"year":case"yrs":case"yr":case"y":return r*jTe;case"weeks":case"week":case"w":return r*FTe;case"days":case"day":case"d":return r*Od;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Q1;case"minutes":case"minute":case"mins":case"min":case"m":return r*X1;case"seconds":case"second":case"secs":case"sec":case"s":return r*J1;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function ZTe(t){var e=Math.abs(t);return e>=Od?Math.round(t/Od)+"d":e>=Q1?Math.round(t/Q1)+"h":e>=X1?Math.round(t/X1)+"m":e>=J1?Math.round(t/J1)+"s":t+"ms"}function HTe(t){var e=Math.abs(t);return e>=Od?j4(t,e,Od,"day"):e>=Q1?j4(t,e,Q1,"hour"):e>=X1?j4(t,e,X1,"minute"):e>=J1?j4(t,e,J1,"second"):t+" ms"}function j4(t,e,r,a){var i=e>=r*1.5;return Math.round(t/r)+" "+a+(i?"s":"")}});var jie=ht((Tdt,Fie)=>{"use strict";ie();ae();ne();var z4=void 0,KTe=uo(),WTe=Uie();Fie.exports=KTe(function(t){var e=+new Date;return z4.diff=e-(z4.prevTime||e),z4.prevTime=e,t.ms="+".concat(WTe(z4.diff)),t})});var Hie=ht((Pdt,Zie)=>{"use strict";ie();ae();ne();var VTe=(ao(),Qr(Af)).inspect,GTe=uo(),Tk=on(),YTe=Tk.LEVEL,zie=Tk.MESSAGE,JTe=Tk.SPLAT;Zie.exports=GTe(function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Object.assign({},t);return delete r[YTe],delete r[zie],delete r[JTe],t[zie]=VTe(r,!1,e.depth||null,e.colorize),t})});var Vie=ht((Ldt,Z4)=>{"use strict";ie();ae();ne();function G2(t){"@babel/helpers - typeof";return G2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G2(t)}function XTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,eIe(a.key),a)}}function QTe(t,e,r){return e&&Kie(t.prototype,e),r&&Kie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function eIe(t){var e=tIe(t,"string");return G2(e)==="symbol"?e:String(e)}function tIe(t,e){if(G2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(G2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var rIe=on(),iIe=rIe.MESSAGE,Wie=function(){function t(e){XTe(this,t),this.template=e}return QTe(t,[{key:"transform",value:function(r){return r[iIe]=this.template(r),r}}]),t}();Z4.exports=function(t){return new Wie(t)};Z4.exports.Printf=Z4.exports.Format=Wie});var Jie=ht((Udt,Yie)=>{"use strict";ie();ae();ne();var nIe=uo(),aIe=on(),Gie=aIe.MESSAGE,oIe=Y1();Yie.exports=nIe(function(t){var e=oIe(Object.assign({},t,{level:void 0,message:void 0,splat:void 0})),r=t.padding&&t.padding[t.level]||"";return e!=="{}"?t[Gie]="".concat(t.level,":").concat(r," ").concat(t.message," ").concat(e):t[Gie]="".concat(t.level,":").concat(r," ").concat(t.message),t})});var rne=ht((Zdt,tne)=>{"use strict";ie();ae();ne();function Y2(t){"@babel/helpers - typeof";return Y2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y2(t)}function sIe(t){return cIe(t)||hIe(t)||uIe(t)||fIe()}function fIe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
63
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uIe(t,e){if(t){if(typeof t=="string")return Ik(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ik(t,e)}}function hIe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cIe(t){if(Array.isArray(t))return Ik(t)}function Ik(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function lIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xie(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,pIe(a.key),a)}}function dIe(t,e,r){return e&&Xie(t.prototype,e),r&&Xie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pIe(t){var e=vIe(t,"string");return Y2(e)==="symbol"?e:String(e)}function vIe(t,e){if(Y2(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Y2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qie=(ao(),Qr(Af)),mIe=on(),ene=mIe.SPLAT,gIe=/%[scdjifoO%]/g,bIe=/%%/g,yIe=function(){function t(e){lIe(this,t),this.options=e}return dIe(t,[{key:"_splat",value:function(r,a){var i=r.message,h=r[ene]||r.splat||[],c=i.match(bIe),p=c&&c.length||0,b=a.length-p,g=b-h.length,y=g<0?h.splice(g,-1*g):[],M=y.length;if(M)for(var x=0;x<M;x++)Object.assign(r,y[x]);return r.message=Qie.format.apply(Qie,[i].concat(sIe(h))),r}},{key:"transform",value:function(r){var a=r.message,i=r[ene]||r.splat;if(!i||!i.length)return r;var h=a&&a.match&&a.match(gIe);if(!h&&(i||i.length)){var c=i.length>1?i.splice(0):i,p=c.length;if(p)for(var b=0;b<p;b++)Object.assign(r,c[b]);return r}return h?this._splat(r,h):r}}]),t}();tne.exports=function(t){return new yIe(t)}});var nne=ht((H4,ine)=>{"use strict";ie();ae();ne();(function(t,e){typeof H4=="object"&&typeof ine<"u"?e(H4):typeof define=="function"&&define.amd?define(["exports"],e):e(t.fecha={})})(H4,function(t){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,r="\\d\\d?",a="\\d\\d",i="\\d{3}",h="\\d{4}",c="[^\\s]+",p=/\[([^]*?)\]/gm;function b(m,w){for(var d=[],o=0,v=m.length;o<v;o++)d.push(m[o].substr(0,w));return d}var g=function(m){return function(w,d){var o=d[m].map(function(R){return R.toLowerCase()}),v=o.indexOf(w.toLowerCase());return v>-1?v:null}};function y(m){for(var w=[],d=1;d<arguments.length;d++)w[d-1]=arguments[d];for(var o=0,v=w;o<v.length;o++){var R=v[o];for(var S in R)m[S]=R[S]}return m}var M=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],x=["January","February","March","April","May","June","July","August","September","October","November","December"],E=b(x,3),A=b(M,3),I={dayNamesShort:A,dayNames:M,monthNamesShort:E,monthNames:x,amPm:["am","pm"],DoFn:function(m){return m+["th","st","nd","rd"][m%10>3?0:(m-m%10!==10?1:0)*m%10]}},P=y({},I),N=function(m){return P=y(P,m)},L=function(m){return m.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},C=function(m,w){for(w===void 0&&(w=2),m=String(m);m.length<w;)m="0"+m;return m},Y={D:function(m){return String(m.getDate())},DD:function(m){return C(m.getDate())},Do:function(m,w){return w.DoFn(m.getDate())},d:function(m){return String(m.getDay())},dd:function(m){return C(m.getDay())},ddd:function(m,w){return w.dayNamesShort[m.getDay()]},dddd:function(m,w){return w.dayNames[m.getDay()]},M:function(m){return String(m.getMonth()+1)},MM:function(m){return C(m.getMonth()+1)},MMM:function(m,w){return w.monthNamesShort[m.getMonth()]},MMMM:function(m,w){return w.monthNames[m.getMonth()]},YY:function(m){return C(String(m.getFullYear()),4).substr(2)},YYYY:function(m){return C(m.getFullYear(),4)},h:function(m){return String(m.getHours()%12||12)},hh:function(m){return C(m.getHours()%12||12)},H:function(m){return String(m.getHours())},HH:function(m){return C(m.getHours())},m:function(m){return String(m.getMinutes())},mm:function(m){return C(m.getMinutes())},s:function(m){return String(m.getSeconds())},ss:function(m){return C(m.getSeconds())},S:function(m){return String(Math.round(m.getMilliseconds()/100))},SS:function(m){return C(Math.round(m.getMilliseconds()/10),2)},SSS:function(m){return C(m.getMilliseconds(),3)},a:function(m,w){return m.getHours()<12?w.amPm[0]:w.amPm[1]},A:function(m,w){return m.getHours()<12?w.amPm[0].toUpperCase():w.amPm[1].toUpperCase()},ZZ:function(m){var w=m.getTimezoneOffset();return(w>0?"-":"+")+C(Math.floor(Math.abs(w)/60)*100+Math.abs(w)%60,4)},Z:function(m){var w=m.getTimezoneOffset();return(w>0?"-":"+")+C(Math.floor(Math.abs(w)/60),2)+":"+C(Math.abs(w)%60,2)}},G=function(m){return+m-1},ee=[null,r],D=[null,c],U=["isPm",c,function(m,w){var d=m.toLowerCase();return d===w.amPm[0]?0:d===w.amPm[1]?1:null}],V=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(m){var w=(m+"").match(/([+-]|\d\d)/gi);if(w){var d=+w[1]*60+parseInt(w[2],10);return w[0]==="+"?d:-d}return 0}],_={D:["day",r],DD:["day",a],Do:["day",r+c,function(m){return parseInt(m,10)}],M:["month",r,G],MM:["month",a,G],YY:["year",a,function(m){var w=new Date,d=+(""+w.getFullYear()).substr(0,2);return+(""+(+m>68?d-1:d)+m)}],h:["hour",r,void 0,"isPm"],hh:["hour",a,void 0,"isPm"],H:["hour",r],HH:["hour",a],m:["minute",r],mm:["minute",a],s:["second",r],ss:["second",a],YYYY:["year",h],S:["millisecond","\\d",function(m){return+m*100}],SS:["millisecond",a,function(m){return+m*10}],SSS:["millisecond",i],d:ee,dd:ee,ddd:D,dddd:D,MMM:["month",c,g("monthNamesShort")],MMMM:["month",c,g("monthNames")],a:U,A:U,ZZ:V,Z:V},n={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},s=function(m){return y(n,m)},f=function(m,w,d){if(w===void 0&&(w=n.default),d===void 0&&(d={}),typeof m=="number"&&(m=new Date(m)),Object.prototype.toString.call(m)!=="[object Date]"||isNaN(m.getTime()))throw new Error("Invalid Date pass to format");w=n[w]||w;var o=[];w=w.replace(p,function(R,S){return o.push(S),"@@@"});var v=y(y({},P),d);return w=w.replace(e,function(R){return Y[R](m,v)}),w.replace(/@@@/g,function(){return o.shift()})};function u(m,w,d){if(d===void 0&&(d={}),typeof w!="string")throw new Error("Invalid format in fecha parse");if(w=n[w]||w,m.length>1e3)return null;var o=new Date,v={year:o.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},R=[],S=[],B=w.replace(p,function(Te,oe){return S.push(L(oe)),"@@@"}),F={},$={};B=L(B).replace(e,function(Te){var oe=_[Te],le=oe[0],ot=oe[1],ge=oe[3];if(F[le])throw new Error("Invalid format. "+le+" specified twice in format");return F[le]=!0,ge&&($[ge]=!0),R.push(oe),"("+ot+")"}),Object.keys($).forEach(function(Te){if(!F[Te])throw new Error("Invalid format. "+Te+" is required in specified format")}),B=B.replace(/@@@/g,function(){return S.shift()});var re=m.match(new RegExp(B,"i"));if(!re)return null;for(var Q=y(y({},P),d),Z=1;Z<re.length;Z++){var K=R[Z-1],ce=K[0],te=K[2],j=te?te(re[Z],Q):+re[Z];if(j==null)return null;v[ce]=j}v.isPm===1&&v.hour!=null&&+v.hour!=12?v.hour=+v.hour+12:v.isPm===0&&+v.hour==12&&(v.hour=0);var J;if(v.timezoneOffset==null){J=new Date(v.year,v.month,v.day,v.hour,v.minute,v.second,v.millisecond);for(var X=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],Z=0,he=X.length;Z<he;Z++)if(F[X[Z][0]]&&v[X[Z][0]]!==J[X[Z][1]]())return null}else if(J=new Date(Date.UTC(v.year,v.month,v.day,v.hour,v.minute-v.timezoneOffset,v.second,v.millisecond)),v.month>11||v.month<0||v.day>31||v.day<1||v.hour>23||v.hour<0||v.minute>59||v.minute<0||v.second>59||v.second<0)return null;return J}var l={format:f,parse:u,defaultI18n:I,setGlobalDateI18n:N,setGlobalDateMasks:s};t.assign=y,t.default=l,t.format=f,t.parse=u,t.defaultI18n=I,t.setGlobalDateI18n=N,t.setGlobalDateMasks=s,Object.defineProperty(t,"__esModule",{value:!0})})});var one=ht((Jdt,ane)=>{"use strict";ie();ae();ne();var wIe=nne(),_Ie=uo();ane.exports=_Ie(function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.format&&(t.timestamp=typeof e.format=="function"?e.format():wIe.format(new Date,e.format)),t.timestamp||(t.timestamp=new Date().toISOString()),e.alias&&(t[e.alias]=t.timestamp),t})});var fne=ht((tpt,sne)=>{"use strict";ie();ae();ne();var kk=uk(),MIe=uo(),xIe=on(),Bk=xIe.MESSAGE;sne.exports=MIe(function(t,e){return e.level!==!1&&(t.level=kk.strip(t.level)),e.message!==!1&&(t.message=kk.strip(String(t.message))),e.raw!==!1&&t[Bk]&&(t[Bk]=kk.strip(String(t[Bk]))),t})});var Ok=ht(Pk=>{"use strict";ie();ae();ne();var da=Pk.format=uo();Pk.levels=cie();Object.defineProperty(da,"align",{value:die()});Object.defineProperty(da,"cli",{value:wie()});Object.defineProperty(da,"colorize",{value:q4()});Object.defineProperty(da,"combine",{value:Mie()});Object.defineProperty(da,"errors",{value:Aie()});Object.defineProperty(da,"json",{value:Pie()});Object.defineProperty(da,"label",{value:Nie()});Object.defineProperty(da,"logstash",{value:Lie()});Object.defineProperty(da,"metadata",{value:$ie()});Object.defineProperty(da,"ms",{value:jie()});Object.defineProperty(da,"padLevels",{value:yk()});Object.defineProperty(da,"prettyPrint",{value:Hie()});Object.defineProperty(da,"printf",{value:Vie()});Object.defineProperty(da,"simple",{value:Jie()});Object.defineProperty(da,"splat",{value:rne()});Object.defineProperty(da,"timestamp",{value:one()});Object.defineProperty(da,"uncolorize",{value:fne()})});var Nk=ht(K4=>{"use strict";ie();ae();ne();var SIe=(ao(),Qr(Af)),une=SIe.format;K4.warn={deprecated:function(e){return function(){throw new Error(une("{ %s } was removed in winston@3.0.0.",e))}},useFormat:function(e){return function(){throw new Error([une("{ %s } was removed in winston@3.0.0.",e),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
64
|
+
`))}},forFunctions:function(e,r,a){a.forEach(function(i){e[i]=K4.warn[r](i)})},forProperties:function(e,r,a){a.forEach(function(i){var h=K4.warn[r](i);Object.defineProperty(e,i,{get:h,set:h})})}}});var hne=ht((dpt,EIe)=>{EIe.exports={name:"winston",description:"A logger for just about everything.",version:"3.13.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.2","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.4.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.7.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^5.0.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",mocha:"^10.3.0",nyc:"^15.1.0",rimraf:"^5.0.5",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"rimraf test/fixtures/logs/* && mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration",build:"rimraf dist && babel lib -d dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var Ck=ht((ppt,dne)=>{"use strict";ie();ae();ne();var AIe=(ao(),Qr(Af)),cne=sg(),RIe=on(),lne=RIe.LEVEL,J2=dne.exports=function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cne.call(this,{objectMode:!0,highWaterMark:r.highWaterMark}),this.format=r.format,this.level=r.level,this.handleExceptions=r.handleExceptions,this.handleRejections=r.handleRejections,this.silent=r.silent,r.log&&(this.log=r.log),r.logv&&(this.logv=r.logv),r.close&&(this.close=r.close),this.once("pipe",function(a){e.levels=a.levels,e.parent=a}),this.once("unpipe",function(a){a===e.parent&&(e.parent=null,e.close&&e.close())})};AIe.inherits(J2,cne);J2.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);var i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[e[lne]]){if(e&&!this.format)return this.log(e,a);var h=void 0,c=void 0;try{c=this.format.transform(Object.assign({},e),this.format.options)}catch(p){h=p}if(h||!c){if(a(),h)throw h;return}return this.log(c,a)}return this._writableState.sync=!1,a(null)};J2.prototype._writev=function(e,r){if(this.logv){var a=e.filter(this._accept,this);return a.length?this.logv(a,r):r(null)}for(var i=0;i<e.length;i++)if(this._accept(e[i])){if(e[i].chunk&&!this.format){this.log(e[i].chunk,e[i].callback);continue}var h=void 0,c=void 0;try{c=this.format.transform(Object.assign({},e[i].chunk),this.format.options)}catch(p){h=p}if(h||!c){if(e[i].callback(),h)throw r(null),h}else this.log(c,e[i].callback)}return r(null)};J2.prototype._accept=function(e){var r=e.chunk;if(this.silent)return!1;var a=this.level||this.parent&&this.parent.level;return!!((r.exception===!0||!a||this.levels[a]>=this.levels[r[lne]])&&(this.handleExceptions||r.exception!==!0))};J2.prototype._nop=function(){}});var mne=ht((bpt,vne)=>{"use strict";ie();ae();ne();var TIe=(ao(),Qr(Af)),IIe=on(),Lk=IIe.LEVEL,pne=Ck(),X2=vne.exports=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pne.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function r(a){this.emit("error",a,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=r.bind(this),this.transport.on("error",this.transport.__winstonError))};TIe.inherits(X2,pne);X2.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);(!this.level||this.levels[this.level]>=this.levels[e[Lk]])&&this.transport.log(e[Lk],e.message,e,this._nop),a(null)};X2.prototype._writev=function(e,r){for(var a=0;a<e.length;a++)this._accept(e[a])&&(this.transport.log(e[a].chunk[Lk],e[a].chunk.message,e[a].chunk,this._nop),e[a].callback());return r(null)};X2.prototype._deprecated=function(){console.error([this.transport.name+" is a legacy winston transport. Consider upgrading: ","- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
65
|
+
`))};X2.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var ev=ht((Mpt,Dk)=>{"use strict";ie();ae();ne();Dk.exports=Ck();Dk.exports.LegacyTransportStream=mne()});var Mne=ht((Apt,_ne)=>{"use strict";ie();ae();ne();function rv(t){"@babel/helpers - typeof";return rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rv(t)}function kIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,PIe(a.key),a)}}function BIe(t,e,r){return e&&gne(t.prototype,e),r&&gne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function PIe(t){var e=OIe(t,"string");return rv(e)=="symbol"?e:String(e)}function OIe(t,e){if(rv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(rv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NIe(t,e,r){return e=W4(e),CIe(t,yne()?Reflect.construct(e,r||[],W4(t).constructor):e.apply(t,r))}function CIe(t,e){if(e&&(rv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LIe(t)}function LIe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yne=function(){return!!t})()}function W4(t){return W4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W4(t)}function DIe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$k(t,e)}function $k(t,e){return $k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},$k(t,e)}var $Ie=(Id(),Qr(Td)),wne=on(),bne=wne.LEVEL,tv=wne.MESSAGE,qIe=ev();_ne.exports=function(t){DIe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return kIe(this,e),r=NIe(this,e,[a]),r.name=a.name||"console",r.stderrLevels=r._stringArrayToSet(a.stderrLevels),r.consoleWarnLevels=r._stringArrayToSet(a.consoleWarnLevels),r.eol=typeof a.eol=="string"?a.eol:$Ie.EOL,r.setMaxListeners(30),r}return BIe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.stderrLevels[a[bne]]){console._stderr?console._stderr.write("".concat(a[tv]).concat(this.eol)):console.error(a[tv]),i&&i();return}else if(this.consoleWarnLevels[a[bne]]){console._stderr?console._stderr.write("".concat(a[tv]).concat(this.eol)):console.warn(a[tv]),i&&i();return}console._stdout?console._stdout.write("".concat(a[tv]).concat(this.eol)):console.log(a[tv]),i&&i()}},{key:"_stringArrayToSet",value:function(a,i){if(!a)return{};if(i=i||"Cannot make set from type other than Array of string elements",!Array.isArray(a))throw new Error(i);return a.reduce(function(h,c){if(typeof c!="string")throw new Error(i);return h[c]=!0,h},{})}}]),e}(qIe)});function xne(t,e){if(t==null)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),a=1;a<arguments.length;a++){var i=arguments[a];if(i!=null)for(var h=Object.keys(Object(i)),c=0,p=h.length;c<p;c++){var b=h[c],g=Object.getOwnPropertyDescriptor(i,b);g!==void 0&&g.enumerable&&(r[b]=i[b])}}return r}function dae(){if(Lne)return Hk;function t(g){return(t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y})(g)}function e(g,y){return!y||t(y)!=="object"&&typeof y!="function"?function(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}(g):y}function r(g){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)})(g)}function a(g,y){return(a=Object.setPrototypeOf||function(M,x){return M.__proto__=x,M})(g,y)}Lne=!0;var i,h,c={};function p(g,y,M){M||(M=Error);var x=function(E){function A(I,P,N){var L;return function(C,Y){if(!(C instanceof Y))throw new TypeError("Cannot call a class as a function")}(this,A),(L=e(this,r(A).call(this,function(C,Y,G){return typeof y=="string"?y:y(C,Y,G)}(I,P,N)))).code=g,L}return function(I,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(P&&P.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),P&&a(I,P)}(A,E),A}(M);c[g]=x}function b(g,y){if(Array.isArray(g)){var M=g.length;return g=g.map(function(x){return String(x)}),M>2?"one of ".concat(y," ").concat(g.slice(0,M-1).join(", "),", or ")+g[M-1]:M===2?"one of ".concat(y," ").concat(g[0]," or ").concat(g[1]):"of ".concat(y," ").concat(g[0])}return"of ".concat(y," ").concat(String(g))}return p("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),p("ERR_INVALID_ARG_TYPE",function(g,y,M){var x,E,A;if(i===void 0&&(i=Jk()),i(typeof g=="string","'name' must be a string"),typeof y=="string"&&(E="not ",y.substr(0,E.length)===E)?(x="must not be",y=y.replace(/^not /,"")):x="must be",function(P,N,L){return(L===void 0||L>P.length)&&(L=P.length),P.substring(L-N.length,L)===N}(g," argument"))A="The ".concat(g," ").concat(x," ").concat(b(y,"type"));else{var I=function(P,N,L){return typeof L!="number"&&(L=0),!(L+N.length>P.length)&&P.indexOf(N,L)!==-1}(g,".")?"property":"argument";A='The "'.concat(g,'" ').concat(I," ").concat(x," ").concat(b(y,"type"))}return A+=". Received type ".concat(t(M))},TypeError),p("ERR_INVALID_ARG_VALUE",function(g,y){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";h===void 0&&(h=gt);var x=h.inspect(y);return x.length>128&&(x="".concat(x.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(M,". Received ").concat(x)},TypeError),p("ERR_INVALID_RETURN_VALUE",function(g,y,M){var x;return x=M&&M.constructor&&M.constructor.name?"instance of ".concat(M.constructor.name):"type ".concat(t(M)),"Expected ".concat(g,' to be returned from the "').concat(y,'"')+" function but got ".concat(x,".")},TypeError),p("ERR_MISSING_ARGS",function(){for(var g=arguments.length,y=new Array(g),M=0;M<g;M++)y[M]=arguments[M];i===void 0&&(i=Jk()),i(y.length>0,"At least one arg needs to be specified");var x="The ",E=y.length;switch(y=y.map(function(A){return'"'.concat(A,'"')}),E){case 1:x+="".concat(y[0]," argument");break;case 2:x+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:x+=y.slice(0,E-1).join(", "),x+=", and ".concat(y[E-1]," arguments")}return"".concat(x," must be specified")},TypeError),Hk.codes=c,Hk}function Ske(){if($ne)return Dne;$ne=!0;var t=ur;function e(D,U,V){return U in D?Object.defineProperty(D,U,{value:V,enumerable:!0,configurable:!0,writable:!0}):D[U]=V,D}function r(D,U){for(var V=0;V<U.length;V++){var _=U[V];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(D,_.key,_)}}function a(D,U){return!U||y(U)!=="object"&&typeof U!="function"?i(D):U}function i(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function h(D){var U=typeof Map=="function"?new Map:void 0;return(h=function(V){if(V===null||(_=V,Function.toString.call(_).indexOf("[native code]")===-1))return V;var _;if(typeof V!="function")throw new TypeError("Super expression must either be null or a function");if(U!==void 0){if(U.has(V))return U.get(V);U.set(V,n)}function n(){return p(V,arguments,g(this).constructor)}return n.prototype=Object.create(V.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),b(n,V)})(D)}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function p(D,U,V){return(p=c()?Reflect.construct:function(_,n,s){var f=[null];f.push.apply(f,n);var u=new(Function.bind.apply(_,f));return s&&b(u,s.prototype),u}).apply(null,arguments)}function b(D,U){return(b=Object.setPrototypeOf||function(V,_){return V.__proto__=_,V})(D,U)}function g(D){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)})(D)}function y(D){return(y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U})(D)}var M=gt.inspect,x=dae().codes.ERR_INVALID_ARG_TYPE;function E(D,U,V){return(V===void 0||V>D.length)&&(V=D.length),D.substring(V-U.length,V)===U}var A="",I="",P="",N="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function C(D){var U=Object.keys(D),V=Object.create(Object.getPrototypeOf(D));return U.forEach(function(_){V[_]=D[_]}),Object.defineProperty(V,"message",{value:D.message}),V}function Y(D){return M(D,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function G(D,U,V){var _="",n="",s=0,f="",u=!1,l=Y(D),m=l.split(`
|
|
66
66
|
`),w=Y(U).split(`
|
|
67
67
|
`),d=0,o="";if(V==="strictEqual"&&y(D)==="object"&&y(U)==="object"&&D!==null&&U!==null&&(V="strictEqualObject"),m.length===1&&w.length===1&&m[0]!==w[0]){var v=m[0].length+w[0].length;if(v<=10){if(!(y(D)==="object"&&D!==null||y(U)==="object"&&U!==null||D===0&&U===0))return"".concat(L[V],`
|
|
68
68
|
|
|
@@ -114,24 +114,24 @@ should equal
|
|
|
114
114
|
`),F=0;F<S.length;F++){var $=B.indexOf(S[F]);if($!==-1){B=B.slice(0,$);break}}v.stack="".concat(B.join(`
|
|
115
115
|
`),`
|
|
116
116
|
`).concat(S.join(`
|
|
117
|
-
`))}throw v}},C.strict=I(m,C,{equal:C.strictEqual,deepEqual:C.deepStrictEqual,notEqual:C.notStrictEqual,notDeepEqual:C.notDeepStrictEqual}),C.strict.strict=C.strict,Kk}var UIe,tae,Sne,rae,Q2,qk,Ene,Uk,Ane,Rne,eb,V4,Tne,Ine,FIe,jIe,zIe,kne,X4,Bne,ZIe,HIe,KIe,WIe,VIe,Wk,iae,GIe,nae,rw,YIe,Pne,JIe,XIe,QIe,Fk,eke,tke,aae,ib,Ld,jk,rke,Nd,Cd,zk,Zk,One,ike,nke,ake,oke,ske,oae,Nne,sae,fke,uke,hke,Vk,Gk,Cne,cke,lke,dke,pke,vke,fae,mke,uae,hae,Xk,Qk,gke,bke,yke,wke,_ke,cae,Mke,lae,xke,Hk,Lne,Dne,$ne,Eke,tw,Une,Fne,Q4,Yk,rb,ew,jne,Fa,Ake,Rke,zne,G4,Zne,Y4,Tke,Ike,Hne,Kne,Wne,Vne,kke,Bke,Pke,Qne,Kk,eae,or,Bpt,Ppt,Opt,Npt,Cpt,Lpt,Dpt,$pt,qpt,Upt,Fpt,jpt,zpt,Zpt,Hpt,Kpt,Wpt,tB=xi(()=>{"use strict";ie();ae();ne();zo();Fo();UIe={assign:xne,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:xne})}},Sne=Object.prototype.toString,rae=function(t){var e=Sne.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Sne.call(t.callee)==="[object Function]"),r};Object.keys||(Q2=Object.prototype.hasOwnProperty,qk=Object.prototype.toString,Ene=rae,Uk=Object.prototype.propertyIsEnumerable,Ane=!Uk.call({toString:null},"toString"),Rne=Uk.call(function(){},"prototype"),eb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],V4=function(t){var e=t.constructor;return e&&e.prototype===t},Tne={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Ine=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!Tne["$"+t]&&Q2.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{V4(window[t])}catch{return!0}}catch{return!0}return!1}(),tae=function(t){var e=t!==null&&typeof t=="object",r=qk.call(t)==="[object Function]",a=Ene(t),i=e&&qk.call(t)==="[object String]",h=[];if(!e&&!r&&!a)throw new TypeError("Object.keys called on a non-object");var c=Rne&&r;if(i&&t.length>0&&!Q2.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var b=0;b<t.length;++b)h.push(String(b));else for(var g in t)c&&g==="prototype"||!Q2.call(t,g)||h.push(String(g));if(Ane)for(var y=function(x){if(typeof window>"u"||!Ine)return V4(x);try{return V4(x)}catch{return!1}}(t),M=0;M<eb.length;++M)y&&eb[M]==="constructor"||!Q2.call(t,eb[M])||h.push(eb[M]);return h});FIe=tae,jIe=Array.prototype.slice,zIe=rae,kne=Object.keys,X4=kne?function(t){return kne(t)}:FIe,Bne=Object.keys;X4.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return zIe(t)?Bne(jIe.call(t)):Bne(t)}):Object.keys=X4,Object.keys||X4};ZIe=X4,HIe=ZIe,KIe=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",WIe=Object.prototype.toString,VIe=Array.prototype.concat,Wk=Object.defineProperty,iae=Wk&&function(){var t={};try{for(var e in Wk(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch{return!1}}(),GIe=function(t,e,r,a){var i;(!(e in t)||typeof(i=a)=="function"&&WIe.call(i)==="[object Function]"&&a())&&(iae?Wk(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},nae=function(t,e){var r=arguments.length>2?arguments[2]:{},a=HIe(e);KIe&&(a=VIe.call(a,Object.getOwnPropertySymbols(e)));for(var i=0;i<a.length;i+=1)GIe(t,a[i],e[a[i]],r[a[i]])};nae.supportsDescriptors=!!iae;rw=nae,YIe=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;for(e in t[e]=42,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},Pne=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:global).Symbol,JIe=YIe,XIe=function(){return typeof Pne=="function"&&typeof Symbol=="function"&&typeof Pne("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&JIe()},QIe="Function.prototype.bind called on incompatible ",Fk=Array.prototype.slice,eke=Object.prototype.toString,tke=function(t){var e=this;if(typeof e!="function"||eke.call(e)!=="[object Function]")throw new TypeError(QIe+e);for(var r,a=Fk.call(arguments,1),i=function(){if(this instanceof r){var g=e.apply(this,a.concat(Fk.call(arguments)));return Object(g)===g?g:this}return e.apply(t,a.concat(Fk.call(arguments)))},h=Math.max(0,e.length-a.length),c=[],p=0;p<h;p++)c.push("$"+p);if(r=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var b=function(){};b.prototype=e.prototype,r.prototype=new b,b.prototype=null}return r},aae=Function.prototype.bind||tke,ib=TypeError,Ld=Object.getOwnPropertyDescriptor;if(Ld)try{Ld({},"")}catch{Ld=null}jk=function(){throw new ib},rke=Ld?function(){try{return arguments.callee,jk}catch{try{return Ld(arguments,"callee").get}catch{return jk}}}():jk,Nd=XIe(),Cd=Object.getPrototypeOf||function(t){return t.__proto__},zk=typeof Uint8Array>"u"?void 0:Cd(Uint8Array),Zk={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":Nd?Cd([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":void 0,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView>"u"?void 0:DataView,"%DataViewPrototype%":typeof DataView>"u"?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array>"u"?void 0:Float32Array.prototype,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array>"u"?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array>"u"?void 0:Int8Array.prototype,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array>"u"?void 0:Int8Array.prototype,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array>"u"?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Nd?Cd(Cd([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%JSONParse%":typeof JSON=="object"?JSON.parse:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Nd?Cd(new Map()[Symbol.iterator]()):void 0,"%MapPrototype%":typeof Map>"u"?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%PromisePrototype%":typeof Promise>"u"?void 0:Promise.prototype,"%PromiseProto_then%":typeof Promise>"u"?void 0:Promise.prototype.then,"%Promise_all%":typeof Promise>"u"?void 0:Promise.all,"%Promise_reject%":typeof Promise>"u"?void 0:Promise.reject,"%Promise_resolve%":typeof Promise>"u"?void 0:Promise.resolve,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&Nd?Cd(new Set()[Symbol.iterator]()):void 0,"%SetPrototype%":typeof Set>"u"?void 0:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":Nd?Cd(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":Nd?Symbol:void 0,"%SymbolPrototype%":Nd?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":rke,"%TypedArray%":zk,"%TypedArrayPrototype%":zk?zk.prototype:void 0,"%TypeError%":ib,"%TypeErrorPrototype%":ib.prototype,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array>"u"?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array>"u"?void 0:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array>"u"?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakMapPrototype%":typeof WeakMap>"u"?void 0:WeakMap.prototype,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet,"%WeakSetPrototype%":typeof WeakSet>"u"?void 0:WeakSet.prototype},One=aae.call(Function.call,String.prototype.replace),ike=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nke=/\\(\\)?/g,ake=function(t){var e=[];return One(t,ike,function(r,a,i,h){e[e.length]=i?One(h,nke,"$1"):a||r}),e},oke=function(t,e){if(!(t in Zk))throw new SyntaxError("intrinsic "+t+" does not exist!");if(Zk[t]===void 0&&!e)throw new ib("intrinsic "+t+" exists, but is not available. Please file an issue!");return Zk[t]},ske=function(t,e){if(typeof t!="string"||t.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var r=ake(t),a=oke("%"+(r.length>0?r[0]:"")+"%",e),i=1;i<r.length;i+=1)if(a!=null)if(Ld&&i+1>=r.length){var h=Ld(a,r[i]);if(!e&&!(r[i]in a))throw new ib("base intrinsic for "+t+" exists, but the property is not available.");a=h?h.get||h.value:a[r[i]]}else a=a[r[i]];return a},Nne=aae,sae=ske("%Function%"),fke=sae.apply,uke=sae.call;(oae=function(){return Nne.apply(uke,arguments)}).apply=function(){return Nne.apply(fke,arguments)};hke=oae,Cne=function(t){return t!=t},cke=(Vk=function(t,e){return t===0&&e===0?1/t==1/e:t===e||!(!Cne(t)||!Cne(e))},Vk),lke=(Gk=function(){return typeof Object.is=="function"?Object.is:cke},Gk),dke=rw,pke=rw,vke=Vk,fae=Gk,mke=function(){var t=lke();return dke(Object,{is:t},{is:function(){return Object.is!==t}}),t},uae=hke(fae(),Object);pke(uae,{getPolyfill:fae,implementation:vke,shim:mke});hae=uae;Xk=function(t){return t!=t};gke=Xk,bke=(Qk=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:gke},rw),yke=Qk,wke=rw,_ke=Xk,cae=Qk,Mke=function(){var t=yke();return bke(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t},lae=cae();wke(lae,{getPolyfill:cae,implementation:_ke,shim:Mke});xke=lae,Hk={},Lne=!1;Dne={},$ne=!1;Eke=/a/g.flags!==void 0,tw=function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e},Une=function(t){var e=[];return t.forEach(function(r,a){return e.push([a,r])}),e},Fne=Object.is?Object.is:hae,Q4=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},Yk=Number.isNaN?Number.isNaN:xke;rb=eB(Object.prototype.hasOwnProperty),ew=eB(Object.prototype.propertyIsEnumerable),jne=eB(Object.prototype.toString),Fa=gt.types,Ake=Fa.isAnyArrayBuffer,Rke=Fa.isArrayBufferView,zne=Fa.isDate,G4=Fa.isMap,Zne=Fa.isRegExp,Y4=Fa.isSet,Tke=Fa.isNativeError,Ike=Fa.isBoxedPrimitive,Hne=Fa.isNumberObject,Kne=Fa.isStringObject,Wne=Fa.isBooleanObject,Vne=Fa.isBigIntObject,kke=Fa.isSymbolObject,Bke=Fa.isFloat32Array,Pke=Fa.isFloat64Array;Qne={isDeepEqual:function(t,e){return Fs(t,e,!1)},isDeepStrictEqual:function(t,e){return Fs(t,e,!0)}},Kk={},eae=!1;or=Jk();or.AssertionError;or.deepEqual;or.deepStrictEqual;or.doesNotReject;or.doesNotThrow;or.equal;or.fail;or.ifError;or.notDeepEqual;or.notDeepStrictEqual;or.notEqual;or.notStrictEqual;or.ok;or.rejects;or.strict;or.strictEqual;or.throws;or.AssertionError;or.deepEqual;or.deepStrictEqual;or.doesNotReject;or.doesNotThrow;or.equal;or.fail;or.ifError;or.notDeepEqual;or.notDeepStrictEqual;or.notEqual;or.notStrictEqual;or.ok;or.rejects;or.strict;or.strictEqual;or.throws;Bpt=or.AssertionError,Ppt=or.deepEqual,Opt=or.deepStrictEqual,Npt=or.doesNotReject,Cpt=or.doesNotThrow,Lpt=or.equal,Dpt=or.fail,$pt=or.ifError,qpt=or.notDeepEqual,Upt=or.notDeepStrictEqual,Fpt=or.notEqual,jpt=or.notStrictEqual,zpt=or.ok,Zpt=or.rejects,Hpt=or.strict,Kpt=or.strictEqual,Wpt=or.throws});function Dke(){if(vae)return rB;vae=!0;var t=yr;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,c){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}c&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,c){var p=c.dir||c.root,b=c.base||(c.name||"")+(c.ext||"");return p?p===c.root?p+b:p+h+b:b}var i={resolve:function(){for(var c="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(c=y+"/"+c,p=y.charCodeAt(0)===47)}return c=r(c,!p),p?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(c){if(e(c),c.length===0)return".";var p=c.charCodeAt(0)===47,b=c.charCodeAt(c.length-1)===47;return c=r(c,!p),c.length===0&&!p&&(c="."),c.length>0&&b&&(c+="/"),p?"/"+c:c},isAbsolute:function(c){return e(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(c===void 0?c=b:c+="/"+b)}return c===void 0?".":i.normalize(c)},relative:function(c,p){if(e(c),e(p),c===p||(c=i.resolve(c),p=i.resolve(p),c===p))return"";for(var b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var g=c.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,I=-1,P=0;P<=A;++P){if(P===A){if(E>A){if(p.charCodeAt(M+P)===47)return p.slice(M+P+1);if(P===0)return p.slice(M+P)}else y>A&&(c.charCodeAt(b+P)===47?I=P:P===0&&(I=0));break}var N=c.charCodeAt(b+P),L=p.charCodeAt(M+P);if(N!==L)break;N===47&&(I=P)}var C="";for(P=b+I+1;P<=g;++P)(P===g||c.charCodeAt(P)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+I):(M+=I,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(c){return c},dirname:function(c){if(e(c),c.length===0)return".";for(var p=c.charCodeAt(0),b=p===47,g=-1,y=!0,M=c.length-1;M>=1;--M)if(p=c.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":c.slice(0,g)},basename:function(c,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(c);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=c.length){if(p.length===c.length&&p===c)return"";var x=p.length-1,E=-1;for(M=c.length-1;M>=0;--M){var A=c.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=c.length),c.slice(b,g)}else{for(M=c.length-1;M>=0;--M)if(c.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":c.slice(b,g)}},extname:function(c){e(c);for(var p=-1,b=0,g=-1,y=!0,M=0,x=c.length-1;x>=0;--x){var E=c.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":c.slice(p,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return a("/",c)},parse:function(c){e(c);var p={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return p;var b=c.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,I=c.length-1,P=0;I>=y;--I){if(b=c.charCodeAt(I),b===47){if(!A){x=I+1;break}continue}E===-1&&(A=!1,E=I+1),b===46?M===-1?M=I:P!==1&&(P=1):M!==-1&&(P=-1)}return M===-1||E===-1||P===0||P===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=c.slice(1,E):p.base=p.name=c.slice(x,E)):(x===0&&g?(p.name=c.slice(1,M),p.base=c.slice(1,E)):(p.name=c.slice(x,M),p.base=c.slice(x,E)),p.ext=c.slice(M,E)),x>0?p.dir=c.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,rB=i,rB}var rB,vae,sn,Dd=xi(()=>{"use strict";ie();ae();ne();Ks();rB={},vae=!1;sn=Dke()});var mae={};Ka(mae,{_makeLong:()=>$ke,basename:()=>qke,default:()=>sn,delimiter:()=>Uke,dirname:()=>Fke,extname:()=>jke,format:()=>zke,isAbsolute:()=>Zke,join:()=>Hke,normalize:()=>Kke,parse:()=>Wke,posix:()=>Vke,relative:()=>Gke,resolve:()=>Yke,sep:()=>Jke,win32:()=>Xke});var $ke,qke,Uke,Fke,jke,zke,Zke,Hke,Kke,Wke,Vke,Gke,Yke,Jke,Xke,iB=xi(()=>{"use strict";ie();ae();ne();Dd();Dd();Ks();$ke=sn._makeLong,qke=sn.basename,Uke=sn.delimiter,Fke=sn.dirname,jke=sn.extname,zke=sn.format,Zke=sn.isAbsolute,Hke=sn.join,Kke=sn.normalize,Wke=sn.parse,Vke=sn.posix,Gke=sn.relative,Yke=sn.resolve,Jke=sn.sep,Xke=sn.win32});function $d(t){throw new RangeError(rBe[t])}function gae(t,e){let r=t.split("@"),a="";r.length>1&&(a=r[0]+"@",t=r[1]);let i=function(h,c){let p=[],b=h.length;for(;b--;)p[b]=c(h[b]);return p}((t=t.replace(tBe,".")).split("."),e).join(".");return a+i}function _ae(t){let e=[],r=0,a=t.length;for(;r<a;){let i=t.charCodeAt(r++);if(i>=55296&&i<=56319&&r<a){let h=t.charCodeAt(r++);(64512&h)==56320?e.push(((1023&i)<<10)+(1023&h)+65536):(e.push(i),r--)}else e.push(i)}return e}var Qke,eBe,tBe,rBe,Fu,nB,bae,Mae,yae,wae,Il,nb=xi(()=>{"use strict";ie();ae();ne();Qke=/^xn--/,eBe=/[^\0-\x7E]/,tBe=/[\x2E\u3002\uFF0E\uFF61]/g,rBe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fu=Math.floor,nB=String.fromCharCode;bae=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Mae=function(t,e,r){let a=0;for(t=r?Fu(t/700):t>>1,t+=Fu(t/e);t>455;a+=36)t=Fu(t/35);return Fu(a+36*t/(t+38))},yae=function(t){let e=[],r=t.length,a=0,i=128,h=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let b=0;b<c;++b)t.charCodeAt(b)>=128&&$d("not-basic"),e.push(t.charCodeAt(b));for(let b=c>0?c+1:0;b<r;){let g=a;for(let M=1,x=36;;x+=36){b>=r&&$d("invalid-input");let E=(p=t.charCodeAt(b++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36;(E>=36||E>Fu((2147483647-a)/M))&&$d("overflow"),a+=E*M;let A=x<=h?1:x>=h+26?26:x-h;if(E<A)break;let I=36-A;M>Fu(2147483647/I)&&$d("overflow"),M*=I}let y=e.length+1;h=Mae(a-g,y,g==0),Fu(a/y)>2147483647-i&&$d("overflow"),i+=Fu(a/y),a%=y,e.splice(a++,0,i)}var p;return String.fromCodePoint(...e)},wae=function(t){let e=[],r=(t=_ae(t)).length,a=128,i=0,h=72;for(let b of t)b<128&&e.push(nB(b));let c=e.length,p=c;for(c&&e.push("-");p<r;){let b=2147483647;for(let y of t)y>=a&&y<b&&(b=y);let g=p+1;b-a>Fu((2147483647-i)/g)&&$d("overflow"),i+=(b-a)*g,a=b;for(let y of t)if(y<a&&++i>2147483647&&$d("overflow"),y==a){let M=i;for(let x=36;;x+=36){let E=x<=h?1:x>=h+26?26:x-h;if(M<E)break;let A=M-E,I=36-E;e.push(nB(bae(E+A%I,0))),M=Fu(A/I)}e.push(nB(bae(M,0))),h=Mae(i,g,p==c),i=0,++p}++i,++a}return e.join("")},Il={version:"2.1.0",ucs2:{decode:_ae,encode:t=>String.fromCodePoint(...t)},decode:yae,encode:wae,toASCII:function(t){return gae(t,function(e){return eBe.test(e)?"xn--"+wae(e):e})},toUnicode:function(t){return gae(t,function(e){return Qke.test(e)?yae(e.slice(4).toLowerCase()):e})}};Il.decode;Il.encode;Il.toASCII;Il.toUnicode;Il.ucs2;Il.version});function iBe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var nBe,ab,aBe,ju,ob=xi(()=>{"use strict";ie();ae();ne();nBe=function(t,e,r,a){e=e||"&",r=r||"=";var i={};if(typeof t!="string"||t.length===0)return i;var h=/\+/g;t=t.split(e);var c=1e3;a&&typeof a.maxKeys=="number"&&(c=a.maxKeys);var p=t.length;c>0&&p>c&&(p=c);for(var b=0;b<p;++b){var g,y,M,x,E=t[b].replace(h,"%20"),A=E.indexOf(r);A>=0?(g=E.substr(0,A),y=E.substr(A+1)):(g=E,y=""),M=decodeURIComponent(g),x=decodeURIComponent(y),iBe(i,M)?Array.isArray(i[M])?i[M].push(x):i[M]=[i[M],x]:i[M]=x}return i},ab=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},aBe=function(t,e,r,a){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(i){var h=encodeURIComponent(ab(i))+r;return Array.isArray(t[i])?t[i].map(function(c){return h+encodeURIComponent(ab(c))}).join(e):h+encodeURIComponent(ab(t[i]))}).join(e):a?encodeURIComponent(ab(a))+r+encodeURIComponent(ab(t)):""},ju={};ju.decode=ju.parse=nBe,ju.encode=ju.stringify=aBe;ju.decode;ju.encode;ju.parse;ju.stringify});function js(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function sb(t,e,r){if(t&&zu.isObject(t)&&t instanceof js)return t;var a=new js;return a.parse(t,e,r),a}function dBe(){if(Aae)return sB;Aae=!0;var t=ur;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,c){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}c&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,c){var p=c.dir||c.root,b=c.base||(c.name||"")+(c.ext||"");return p?p===c.root?p+b:p+h+b:b}var i={resolve:function(){for(var c="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(c=y+"/"+c,p=y.charCodeAt(0)===47)}return c=r(c,!p),p?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(c){if(e(c),c.length===0)return".";var p=c.charCodeAt(0)===47,b=c.charCodeAt(c.length-1)===47;return c=r(c,!p),c.length===0&&!p&&(c="."),c.length>0&&b&&(c+="/"),p?"/"+c:c},isAbsolute:function(c){return e(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(c===void 0?c=b:c+="/"+b)}return c===void 0?".":i.normalize(c)},relative:function(c,p){if(e(c),e(p),c===p||(c=i.resolve(c),p=i.resolve(p),c===p))return"";for(var b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var g=c.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,I=-1,P=0;P<=A;++P){if(P===A){if(E>A){if(p.charCodeAt(M+P)===47)return p.slice(M+P+1);if(P===0)return p.slice(M+P)}else y>A&&(c.charCodeAt(b+P)===47?I=P:P===0&&(I=0));break}var N=c.charCodeAt(b+P),L=p.charCodeAt(M+P);if(N!==L)break;N===47&&(I=P)}var C="";for(P=b+I+1;P<=g;++P)(P===g||c.charCodeAt(P)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+I):(M+=I,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(c){return c},dirname:function(c){if(e(c),c.length===0)return".";for(var p=c.charCodeAt(0),b=p===47,g=-1,y=!0,M=c.length-1;M>=1;--M)if(p=c.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":c.slice(0,g)},basename:function(c,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(c);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=c.length){if(p.length===c.length&&p===c)return"";var x=p.length-1,E=-1;for(M=c.length-1;M>=0;--M){var A=c.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=c.length),c.slice(b,g)}else{for(M=c.length-1;M>=0;--M)if(c.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":c.slice(b,g)}},extname:function(c){e(c);for(var p=-1,b=0,g=-1,y=!0,M=0,x=c.length-1;x>=0;--x){var E=c.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":c.slice(p,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return a("/",c)},parse:function(c){e(c);var p={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return p;var b=c.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,I=c.length-1,P=0;I>=y;--I){if(b=c.charCodeAt(I),b===47){if(!A){x=I+1;break}continue}E===-1&&(A=!1,E=I+1),b===46?M===-1?M=I:P!==1&&(P=1):M!==-1&&(P=-1)}return M===-1||E===-1||P===0||P===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=c.slice(1,E):p.base=p.name=c.slice(x,E)):(x===0&&g?(p.name=c.slice(1,M),p.base=c.slice(1,E)):(p.name=c.slice(x,M),p.base=c.slice(x,E)),p.ext=c.slice(M,E)),x>0?p.dir=c.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,sB=i,sB}function EBe(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return uB?ABe(t):RBe(t)}function ABe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(yBe,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<gBe||a>bBe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function RBe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function TBe(t){let e=Rae.resolve(t),r=t.charCodeAt(t.length-1);(r===mBe||uB&&r===vBe)&&e[e.length-1]!==Rae.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace(wBe,"%25")),!uB&&e.includes("\\")&&(e=e.replace(_Be,"%5C")),e.includes(`
|
|
117
|
+
`))}throw v}},C.strict=I(m,C,{equal:C.strictEqual,deepEqual:C.deepStrictEqual,notEqual:C.notStrictEqual,notDeepEqual:C.notDeepStrictEqual}),C.strict.strict=C.strict,Kk}var UIe,tae,Sne,rae,Q2,qk,Ene,Uk,Ane,Rne,eb,V4,Tne,Ine,FIe,jIe,zIe,kne,X4,Bne,ZIe,HIe,KIe,WIe,VIe,Wk,iae,GIe,nae,rw,YIe,Pne,JIe,XIe,QIe,Fk,eke,tke,aae,ib,Ld,jk,rke,Nd,Cd,zk,Zk,One,ike,nke,ake,oke,ske,oae,Nne,sae,fke,uke,hke,Vk,Gk,Cne,cke,lke,dke,pke,vke,fae,mke,uae,hae,Xk,Qk,gke,bke,yke,wke,_ke,cae,Mke,lae,xke,Hk,Lne,Dne,$ne,Eke,tw,Une,Fne,Q4,Yk,rb,ew,jne,Fa,Ake,Rke,zne,G4,Zne,Y4,Tke,Ike,Hne,Kne,Wne,Vne,kke,Bke,Pke,Qne,Kk,eae,or,Ppt,Opt,Npt,Cpt,Lpt,Dpt,$pt,qpt,Upt,Fpt,jpt,zpt,Zpt,Hpt,Kpt,Wpt,Vpt,tB=xi(()=>{"use strict";ie();ae();ne();zo();Fo();UIe={assign:xne,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:xne})}},Sne=Object.prototype.toString,rae=function(t){var e=Sne.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Sne.call(t.callee)==="[object Function]"),r};Object.keys||(Q2=Object.prototype.hasOwnProperty,qk=Object.prototype.toString,Ene=rae,Uk=Object.prototype.propertyIsEnumerable,Ane=!Uk.call({toString:null},"toString"),Rne=Uk.call(function(){},"prototype"),eb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],V4=function(t){var e=t.constructor;return e&&e.prototype===t},Tne={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Ine=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!Tne["$"+t]&&Q2.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{V4(window[t])}catch{return!0}}catch{return!0}return!1}(),tae=function(t){var e=t!==null&&typeof t=="object",r=qk.call(t)==="[object Function]",a=Ene(t),i=e&&qk.call(t)==="[object String]",h=[];if(!e&&!r&&!a)throw new TypeError("Object.keys called on a non-object");var c=Rne&&r;if(i&&t.length>0&&!Q2.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var b=0;b<t.length;++b)h.push(String(b));else for(var g in t)c&&g==="prototype"||!Q2.call(t,g)||h.push(String(g));if(Ane)for(var y=function(x){if(typeof window>"u"||!Ine)return V4(x);try{return V4(x)}catch{return!1}}(t),M=0;M<eb.length;++M)y&&eb[M]==="constructor"||!Q2.call(t,eb[M])||h.push(eb[M]);return h});FIe=tae,jIe=Array.prototype.slice,zIe=rae,kne=Object.keys,X4=kne?function(t){return kne(t)}:FIe,Bne=Object.keys;X4.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return zIe(t)?Bne(jIe.call(t)):Bne(t)}):Object.keys=X4,Object.keys||X4};ZIe=X4,HIe=ZIe,KIe=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",WIe=Object.prototype.toString,VIe=Array.prototype.concat,Wk=Object.defineProperty,iae=Wk&&function(){var t={};try{for(var e in Wk(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch{return!1}}(),GIe=function(t,e,r,a){var i;(!(e in t)||typeof(i=a)=="function"&&WIe.call(i)==="[object Function]"&&a())&&(iae?Wk(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},nae=function(t,e){var r=arguments.length>2?arguments[2]:{},a=HIe(e);KIe&&(a=VIe.call(a,Object.getOwnPropertySymbols(e)));for(var i=0;i<a.length;i+=1)GIe(t,a[i],e[a[i]],r[a[i]])};nae.supportsDescriptors=!!iae;rw=nae,YIe=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;for(e in t[e]=42,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},Pne=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:global).Symbol,JIe=YIe,XIe=function(){return typeof Pne=="function"&&typeof Symbol=="function"&&typeof Pne("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&JIe()},QIe="Function.prototype.bind called on incompatible ",Fk=Array.prototype.slice,eke=Object.prototype.toString,tke=function(t){var e=this;if(typeof e!="function"||eke.call(e)!=="[object Function]")throw new TypeError(QIe+e);for(var r,a=Fk.call(arguments,1),i=function(){if(this instanceof r){var g=e.apply(this,a.concat(Fk.call(arguments)));return Object(g)===g?g:this}return e.apply(t,a.concat(Fk.call(arguments)))},h=Math.max(0,e.length-a.length),c=[],p=0;p<h;p++)c.push("$"+p);if(r=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var b=function(){};b.prototype=e.prototype,r.prototype=new b,b.prototype=null}return r},aae=Function.prototype.bind||tke,ib=TypeError,Ld=Object.getOwnPropertyDescriptor;if(Ld)try{Ld({},"")}catch{Ld=null}jk=function(){throw new ib},rke=Ld?function(){try{return arguments.callee,jk}catch{try{return Ld(arguments,"callee").get}catch{return jk}}}():jk,Nd=XIe(),Cd=Object.getPrototypeOf||function(t){return t.__proto__},zk=typeof Uint8Array>"u"?void 0:Cd(Uint8Array),Zk={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":Nd?Cd([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":void 0,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView>"u"?void 0:DataView,"%DataViewPrototype%":typeof DataView>"u"?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array>"u"?void 0:Float32Array.prototype,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array>"u"?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array>"u"?void 0:Int8Array.prototype,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array>"u"?void 0:Int8Array.prototype,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array>"u"?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Nd?Cd(Cd([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%JSONParse%":typeof JSON=="object"?JSON.parse:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Nd?Cd(new Map()[Symbol.iterator]()):void 0,"%MapPrototype%":typeof Map>"u"?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%PromisePrototype%":typeof Promise>"u"?void 0:Promise.prototype,"%PromiseProto_then%":typeof Promise>"u"?void 0:Promise.prototype.then,"%Promise_all%":typeof Promise>"u"?void 0:Promise.all,"%Promise_reject%":typeof Promise>"u"?void 0:Promise.reject,"%Promise_resolve%":typeof Promise>"u"?void 0:Promise.resolve,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&Nd?Cd(new Set()[Symbol.iterator]()):void 0,"%SetPrototype%":typeof Set>"u"?void 0:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":Nd?Cd(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":Nd?Symbol:void 0,"%SymbolPrototype%":Nd?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":rke,"%TypedArray%":zk,"%TypedArrayPrototype%":zk?zk.prototype:void 0,"%TypeError%":ib,"%TypeErrorPrototype%":ib.prototype,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array>"u"?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array>"u"?void 0:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array>"u"?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakMapPrototype%":typeof WeakMap>"u"?void 0:WeakMap.prototype,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet,"%WeakSetPrototype%":typeof WeakSet>"u"?void 0:WeakSet.prototype},One=aae.call(Function.call,String.prototype.replace),ike=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nke=/\\(\\)?/g,ake=function(t){var e=[];return One(t,ike,function(r,a,i,h){e[e.length]=i?One(h,nke,"$1"):a||r}),e},oke=function(t,e){if(!(t in Zk))throw new SyntaxError("intrinsic "+t+" does not exist!");if(Zk[t]===void 0&&!e)throw new ib("intrinsic "+t+" exists, but is not available. Please file an issue!");return Zk[t]},ske=function(t,e){if(typeof t!="string"||t.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var r=ake(t),a=oke("%"+(r.length>0?r[0]:"")+"%",e),i=1;i<r.length;i+=1)if(a!=null)if(Ld&&i+1>=r.length){var h=Ld(a,r[i]);if(!e&&!(r[i]in a))throw new ib("base intrinsic for "+t+" exists, but the property is not available.");a=h?h.get||h.value:a[r[i]]}else a=a[r[i]];return a},Nne=aae,sae=ske("%Function%"),fke=sae.apply,uke=sae.call;(oae=function(){return Nne.apply(uke,arguments)}).apply=function(){return Nne.apply(fke,arguments)};hke=oae,Cne=function(t){return t!=t},cke=(Vk=function(t,e){return t===0&&e===0?1/t==1/e:t===e||!(!Cne(t)||!Cne(e))},Vk),lke=(Gk=function(){return typeof Object.is=="function"?Object.is:cke},Gk),dke=rw,pke=rw,vke=Vk,fae=Gk,mke=function(){var t=lke();return dke(Object,{is:t},{is:function(){return Object.is!==t}}),t},uae=hke(fae(),Object);pke(uae,{getPolyfill:fae,implementation:vke,shim:mke});hae=uae;Xk=function(t){return t!=t};gke=Xk,bke=(Qk=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:gke},rw),yke=Qk,wke=rw,_ke=Xk,cae=Qk,Mke=function(){var t=yke();return bke(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t},lae=cae();wke(lae,{getPolyfill:cae,implementation:_ke,shim:Mke});xke=lae,Hk={},Lne=!1;Dne={},$ne=!1;Eke=/a/g.flags!==void 0,tw=function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e},Une=function(t){var e=[];return t.forEach(function(r,a){return e.push([a,r])}),e},Fne=Object.is?Object.is:hae,Q4=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},Yk=Number.isNaN?Number.isNaN:xke;rb=eB(Object.prototype.hasOwnProperty),ew=eB(Object.prototype.propertyIsEnumerable),jne=eB(Object.prototype.toString),Fa=gt.types,Ake=Fa.isAnyArrayBuffer,Rke=Fa.isArrayBufferView,zne=Fa.isDate,G4=Fa.isMap,Zne=Fa.isRegExp,Y4=Fa.isSet,Tke=Fa.isNativeError,Ike=Fa.isBoxedPrimitive,Hne=Fa.isNumberObject,Kne=Fa.isStringObject,Wne=Fa.isBooleanObject,Vne=Fa.isBigIntObject,kke=Fa.isSymbolObject,Bke=Fa.isFloat32Array,Pke=Fa.isFloat64Array;Qne={isDeepEqual:function(t,e){return Fs(t,e,!1)},isDeepStrictEqual:function(t,e){return Fs(t,e,!0)}},Kk={},eae=!1;or=Jk();or.AssertionError;or.deepEqual;or.deepStrictEqual;or.doesNotReject;or.doesNotThrow;or.equal;or.fail;or.ifError;or.notDeepEqual;or.notDeepStrictEqual;or.notEqual;or.notStrictEqual;or.ok;or.rejects;or.strict;or.strictEqual;or.throws;or.AssertionError;or.deepEqual;or.deepStrictEqual;or.doesNotReject;or.doesNotThrow;or.equal;or.fail;or.ifError;or.notDeepEqual;or.notDeepStrictEqual;or.notEqual;or.notStrictEqual;or.ok;or.rejects;or.strict;or.strictEqual;or.throws;Ppt=or.AssertionError,Opt=or.deepEqual,Npt=or.deepStrictEqual,Cpt=or.doesNotReject,Lpt=or.doesNotThrow,Dpt=or.equal,$pt=or.fail,qpt=or.ifError,Upt=or.notDeepEqual,Fpt=or.notDeepStrictEqual,jpt=or.notEqual,zpt=or.notStrictEqual,Zpt=or.ok,Hpt=or.rejects,Kpt=or.strict,Wpt=or.strictEqual,Vpt=or.throws});function Dke(){if(vae)return rB;vae=!0;var t=yr;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,c){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}c&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,c){var p=c.dir||c.root,b=c.base||(c.name||"")+(c.ext||"");return p?p===c.root?p+b:p+h+b:b}var i={resolve:function(){for(var c="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(c=y+"/"+c,p=y.charCodeAt(0)===47)}return c=r(c,!p),p?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(c){if(e(c),c.length===0)return".";var p=c.charCodeAt(0)===47,b=c.charCodeAt(c.length-1)===47;return c=r(c,!p),c.length===0&&!p&&(c="."),c.length>0&&b&&(c+="/"),p?"/"+c:c},isAbsolute:function(c){return e(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(c===void 0?c=b:c+="/"+b)}return c===void 0?".":i.normalize(c)},relative:function(c,p){if(e(c),e(p),c===p||(c=i.resolve(c),p=i.resolve(p),c===p))return"";for(var b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var g=c.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,I=-1,P=0;P<=A;++P){if(P===A){if(E>A){if(p.charCodeAt(M+P)===47)return p.slice(M+P+1);if(P===0)return p.slice(M+P)}else y>A&&(c.charCodeAt(b+P)===47?I=P:P===0&&(I=0));break}var N=c.charCodeAt(b+P),L=p.charCodeAt(M+P);if(N!==L)break;N===47&&(I=P)}var C="";for(P=b+I+1;P<=g;++P)(P===g||c.charCodeAt(P)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+I):(M+=I,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(c){return c},dirname:function(c){if(e(c),c.length===0)return".";for(var p=c.charCodeAt(0),b=p===47,g=-1,y=!0,M=c.length-1;M>=1;--M)if(p=c.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":c.slice(0,g)},basename:function(c,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(c);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=c.length){if(p.length===c.length&&p===c)return"";var x=p.length-1,E=-1;for(M=c.length-1;M>=0;--M){var A=c.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=c.length),c.slice(b,g)}else{for(M=c.length-1;M>=0;--M)if(c.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":c.slice(b,g)}},extname:function(c){e(c);for(var p=-1,b=0,g=-1,y=!0,M=0,x=c.length-1;x>=0;--x){var E=c.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":c.slice(p,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return a("/",c)},parse:function(c){e(c);var p={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return p;var b=c.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,I=c.length-1,P=0;I>=y;--I){if(b=c.charCodeAt(I),b===47){if(!A){x=I+1;break}continue}E===-1&&(A=!1,E=I+1),b===46?M===-1?M=I:P!==1&&(P=1):M!==-1&&(P=-1)}return M===-1||E===-1||P===0||P===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=c.slice(1,E):p.base=p.name=c.slice(x,E)):(x===0&&g?(p.name=c.slice(1,M),p.base=c.slice(1,E)):(p.name=c.slice(x,M),p.base=c.slice(x,E)),p.ext=c.slice(M,E)),x>0?p.dir=c.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,rB=i,rB}var rB,vae,sn,Dd=xi(()=>{"use strict";ie();ae();ne();Ks();rB={},vae=!1;sn=Dke()});var mae={};Ka(mae,{_makeLong:()=>$ke,basename:()=>qke,default:()=>sn,delimiter:()=>Uke,dirname:()=>Fke,extname:()=>jke,format:()=>zke,isAbsolute:()=>Zke,join:()=>Hke,normalize:()=>Kke,parse:()=>Wke,posix:()=>Vke,relative:()=>Gke,resolve:()=>Yke,sep:()=>Jke,win32:()=>Xke});var $ke,qke,Uke,Fke,jke,zke,Zke,Hke,Kke,Wke,Vke,Gke,Yke,Jke,Xke,iB=xi(()=>{"use strict";ie();ae();ne();Dd();Dd();Ks();$ke=sn._makeLong,qke=sn.basename,Uke=sn.delimiter,Fke=sn.dirname,jke=sn.extname,zke=sn.format,Zke=sn.isAbsolute,Hke=sn.join,Kke=sn.normalize,Wke=sn.parse,Vke=sn.posix,Gke=sn.relative,Yke=sn.resolve,Jke=sn.sep,Xke=sn.win32});function $d(t){throw new RangeError(rBe[t])}function gae(t,e){let r=t.split("@"),a="";r.length>1&&(a=r[0]+"@",t=r[1]);let i=function(h,c){let p=[],b=h.length;for(;b--;)p[b]=c(h[b]);return p}((t=t.replace(tBe,".")).split("."),e).join(".");return a+i}function _ae(t){let e=[],r=0,a=t.length;for(;r<a;){let i=t.charCodeAt(r++);if(i>=55296&&i<=56319&&r<a){let h=t.charCodeAt(r++);(64512&h)==56320?e.push(((1023&i)<<10)+(1023&h)+65536):(e.push(i),r--)}else e.push(i)}return e}var Qke,eBe,tBe,rBe,Fu,nB,bae,Mae,yae,wae,Il,nb=xi(()=>{"use strict";ie();ae();ne();Qke=/^xn--/,eBe=/[^\0-\x7E]/,tBe=/[\x2E\u3002\uFF0E\uFF61]/g,rBe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fu=Math.floor,nB=String.fromCharCode;bae=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Mae=function(t,e,r){let a=0;for(t=r?Fu(t/700):t>>1,t+=Fu(t/e);t>455;a+=36)t=Fu(t/35);return Fu(a+36*t/(t+38))},yae=function(t){let e=[],r=t.length,a=0,i=128,h=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let b=0;b<c;++b)t.charCodeAt(b)>=128&&$d("not-basic"),e.push(t.charCodeAt(b));for(let b=c>0?c+1:0;b<r;){let g=a;for(let M=1,x=36;;x+=36){b>=r&&$d("invalid-input");let E=(p=t.charCodeAt(b++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36;(E>=36||E>Fu((2147483647-a)/M))&&$d("overflow"),a+=E*M;let A=x<=h?1:x>=h+26?26:x-h;if(E<A)break;let I=36-A;M>Fu(2147483647/I)&&$d("overflow"),M*=I}let y=e.length+1;h=Mae(a-g,y,g==0),Fu(a/y)>2147483647-i&&$d("overflow"),i+=Fu(a/y),a%=y,e.splice(a++,0,i)}var p;return String.fromCodePoint(...e)},wae=function(t){let e=[],r=(t=_ae(t)).length,a=128,i=0,h=72;for(let b of t)b<128&&e.push(nB(b));let c=e.length,p=c;for(c&&e.push("-");p<r;){let b=2147483647;for(let y of t)y>=a&&y<b&&(b=y);let g=p+1;b-a>Fu((2147483647-i)/g)&&$d("overflow"),i+=(b-a)*g,a=b;for(let y of t)if(y<a&&++i>2147483647&&$d("overflow"),y==a){let M=i;for(let x=36;;x+=36){let E=x<=h?1:x>=h+26?26:x-h;if(M<E)break;let A=M-E,I=36-E;e.push(nB(bae(E+A%I,0))),M=Fu(A/I)}e.push(nB(bae(M,0))),h=Mae(i,g,p==c),i=0,++p}++i,++a}return e.join("")},Il={version:"2.1.0",ucs2:{decode:_ae,encode:t=>String.fromCodePoint(...t)},decode:yae,encode:wae,toASCII:function(t){return gae(t,function(e){return eBe.test(e)?"xn--"+wae(e):e})},toUnicode:function(t){return gae(t,function(e){return Qke.test(e)?yae(e.slice(4).toLowerCase()):e})}};Il.decode;Il.encode;Il.toASCII;Il.toUnicode;Il.ucs2;Il.version});function iBe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var nBe,ab,aBe,ju,ob=xi(()=>{"use strict";ie();ae();ne();nBe=function(t,e,r,a){e=e||"&",r=r||"=";var i={};if(typeof t!="string"||t.length===0)return i;var h=/\+/g;t=t.split(e);var c=1e3;a&&typeof a.maxKeys=="number"&&(c=a.maxKeys);var p=t.length;c>0&&p>c&&(p=c);for(var b=0;b<p;++b){var g,y,M,x,E=t[b].replace(h,"%20"),A=E.indexOf(r);A>=0?(g=E.substr(0,A),y=E.substr(A+1)):(g=E,y=""),M=decodeURIComponent(g),x=decodeURIComponent(y),iBe(i,M)?Array.isArray(i[M])?i[M].push(x):i[M]=[i[M],x]:i[M]=x}return i},ab=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},aBe=function(t,e,r,a){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(i){var h=encodeURIComponent(ab(i))+r;return Array.isArray(t[i])?t[i].map(function(c){return h+encodeURIComponent(ab(c))}).join(e):h+encodeURIComponent(ab(t[i]))}).join(e):a?encodeURIComponent(ab(a))+r+encodeURIComponent(ab(t)):""},ju={};ju.decode=ju.parse=nBe,ju.encode=ju.stringify=aBe;ju.decode;ju.encode;ju.parse;ju.stringify});function js(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function sb(t,e,r){if(t&&zu.isObject(t)&&t instanceof js)return t;var a=new js;return a.parse(t,e,r),a}function dBe(){if(Aae)return sB;Aae=!0;var t=ur;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,c){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}c&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,c){var p=c.dir||c.root,b=c.base||(c.name||"")+(c.ext||"");return p?p===c.root?p+b:p+h+b:b}var i={resolve:function(){for(var c="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(c=y+"/"+c,p=y.charCodeAt(0)===47)}return c=r(c,!p),p?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(c){if(e(c),c.length===0)return".";var p=c.charCodeAt(0)===47,b=c.charCodeAt(c.length-1)===47;return c=r(c,!p),c.length===0&&!p&&(c="."),c.length>0&&b&&(c+="/"),p?"/"+c:c},isAbsolute:function(c){return e(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(c===void 0?c=b:c+="/"+b)}return c===void 0?".":i.normalize(c)},relative:function(c,p){if(e(c),e(p),c===p||(c=i.resolve(c),p=i.resolve(p),c===p))return"";for(var b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var g=c.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,I=-1,P=0;P<=A;++P){if(P===A){if(E>A){if(p.charCodeAt(M+P)===47)return p.slice(M+P+1);if(P===0)return p.slice(M+P)}else y>A&&(c.charCodeAt(b+P)===47?I=P:P===0&&(I=0));break}var N=c.charCodeAt(b+P),L=p.charCodeAt(M+P);if(N!==L)break;N===47&&(I=P)}var C="";for(P=b+I+1;P<=g;++P)(P===g||c.charCodeAt(P)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+I):(M+=I,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(c){return c},dirname:function(c){if(e(c),c.length===0)return".";for(var p=c.charCodeAt(0),b=p===47,g=-1,y=!0,M=c.length-1;M>=1;--M)if(p=c.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":c.slice(0,g)},basename:function(c,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(c);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=c.length){if(p.length===c.length&&p===c)return"";var x=p.length-1,E=-1;for(M=c.length-1;M>=0;--M){var A=c.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=c.length),c.slice(b,g)}else{for(M=c.length-1;M>=0;--M)if(c.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":c.slice(b,g)}},extname:function(c){e(c);for(var p=-1,b=0,g=-1,y=!0,M=0,x=c.length-1;x>=0;--x){var E=c.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":c.slice(p,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return a("/",c)},parse:function(c){e(c);var p={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return p;var b=c.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,I=c.length-1,P=0;I>=y;--I){if(b=c.charCodeAt(I),b===47){if(!A){x=I+1;break}continue}E===-1&&(A=!1,E=I+1),b===46?M===-1?M=I:P!==1&&(P=1):M!==-1&&(P=-1)}return M===-1||E===-1||P===0||P===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=c.slice(1,E):p.base=p.name=c.slice(x,E)):(x===0&&g?(p.name=c.slice(1,M),p.base=c.slice(1,E)):(p.name=c.slice(x,M),p.base=c.slice(x,E)),p.ext=c.slice(M,E)),x>0?p.dir=c.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,sB=i,sB}function EBe(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return uB?ABe(t):RBe(t)}function ABe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(yBe,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<gBe||a>bBe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function RBe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function TBe(t){let e=Rae.resolve(t),r=t.charCodeAt(t.length-1);(r===mBe||uB&&r===vBe)&&e[e.length-1]!==Rae.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace(wBe,"%25")),!uB&&e.includes("\\")&&(e=e.replace(_Be,"%5C")),e.includes(`
|
|
118
118
|
`)&&(e=e.replace(MBe,"%0A")),e.includes("\r")&&(e=e.replace(xBe,"%0D")),e.includes(" ")&&(e=e.replace(SBe,"%09")),a.pathname=e,a}function cB(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return hB?UBe(t):FBe(t)}function UBe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(NBe,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<PBe||a>OBe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function FBe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function jBe(t){let e=sn.resolve(t),r=t.charCodeAt(t.length-1);(r===BBe||hB&&r===kBe)&&e[e.length-1]!==sn.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace(CBe,"%25")),!hB&&e.includes("\\")&&(e=e.replace(LBe,"%5C")),e.includes(`
|
|
119
|
-
`)&&(e=e.replace(DBe,"%0A")),e.includes("\r")&&(e=e.replace($Be,"%0D")),e.includes(" ")&&(e=e.replace(qBe,"%09")),a.pathname=e,a}var vi,oBe,zu,sBe,fBe,uBe,hBe,fB,xae,Sae,Eae,cBe,lBe,aB,iv,oB,sB,Aae,Rae,pBe,vBe,mBe,gBe,bBe,uB,yBe,wBe,_Be,MBe,xBe,SBe,IBe,
|
|
120
|
-
`," "]),fB=["'"].concat(hBe),xae=["%","/","?",";","#"].concat(fB),Sae=["/","?","#"],Eae=/^[+a-z0-9A-Z_-]{0,63}$/,cBe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lBe={javascript:!0,"javascript:":!0},aB={javascript:!0,"javascript:":!0},iv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},oB=ju;js.prototype.parse=function(t,e,r){if(!zu.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),i=a!==-1&&a<t.indexOf("#")?"?":"#",h=t.split(i);h[0]=h[0].replace(/\\/g,"/");var c=t=h.join(i);if(c=c.trim(),!r&&t.split("#").length===1){var p=uBe.exec(c);if(p)return this.path=c,this.href=c,this.pathname=p[1],p[2]?(this.search=p[2],this.query=e?oB.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=sBe.exec(c);if(b){var g=(b=b[0]).toLowerCase();this.protocol=g,c=c.substr(b.length)}if(r||b||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var y=c.substr(0,2)==="//";!y||b&&aB[b]||(c=c.substr(2),this.slashes=!0)}if(!aB[b]&&(y||b&&!iv[b])){for(var M,x,E=-1,A=0;A<Sae.length;A++)(I=c.indexOf(Sae[A]))!==-1&&(E===-1||I<E)&&(E=I);for((x=E===-1?c.lastIndexOf("@"):c.lastIndexOf("@",E))!==-1&&(M=c.slice(0,x),c=c.slice(x+1),this.auth=decodeURIComponent(M)),E=-1,A=0;A<xae.length;A++){var I;(I=c.indexOf(xae[A]))!==-1&&(E===-1||I<E)&&(E=I)}E===-1&&(E=c.length),this.host=c.slice(0,E),c=c.slice(E),this.parseHost(),this.hostname=this.hostname||"";var P=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!P)for(var N=this.hostname.split(/\./),L=(A=0,N.length);A<L;A++){var C=N[A];if(C&&!C.match(Eae)){for(var Y="",G=0,ee=C.length;G<ee;G++)C.charCodeAt(G)>127?Y+="x":Y+=C[G];if(!Y.match(Eae)){var D=N.slice(0,A),U=N.slice(A+1),V=C.match(cBe);V&&(D.push(V[1]),U.unshift(V[2])),U.length&&(c="/"+U.join(".")+c),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=oBe.toASCII(this.hostname));var _=this.port?":"+this.port:"",n=this.hostname||"";this.host=n+_,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),c[0]!=="/"&&(c="/"+c))}if(!lBe[g])for(A=0,L=fB.length;A<L;A++){var s=fB[A];if(c.indexOf(s)!==-1){var f=encodeURIComponent(s);f===s&&(f=escape(s)),c=c.split(s).join(f)}}var u=c.indexOf("#");u!==-1&&(this.hash=c.substr(u),c=c.slice(0,u));var l=c.indexOf("?");if(l!==-1?(this.search=c.substr(l),this.query=c.substr(l+1),e&&(this.query=oB.parse(this.query)),c=c.slice(0,l)):e&&(this.search="",this.query={}),c&&(this.pathname=c),iv[g]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var m=this.search||"";this.path=_+m}return this.href=this.format(),this},js.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",a=this.hash||"",i=!1,h="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&zu.isObject(this.query)&&Object.keys(this.query).length&&(h=oB.stringify(this.query));var c=this.search||h&&"?"+h||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||iv[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),a&&a.charAt(0)!=="#"&&(a="#"+a),c&&c.charAt(0)!=="?"&&(c="?"+c),e+i+(r=r.replace(/[?#]/g,function(p){return encodeURIComponent(p)}))+(c=c.replace("#","%23"))+a},js.prototype.resolve=function(t){return this.resolveObject(sb(t,!1,!0)).format()},js.prototype.resolveObject=function(t){if(zu.isString(t)){var e=new js;e.parse(t,!1,!0),t=e}for(var r=new js,a=Object.keys(this),i=0;i<a.length;i++){var h=a[i];r[h]=this[h]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var c=Object.keys(t),p=0;p<c.length;p++){var b=c[p];b!=="protocol"&&(r[b]=t[b])}return iv[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!iv[t.protocol]){for(var g=Object.keys(t),y=0;y<g.length;y++){var M=g[y];r[M]=t[M]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||aB[t.protocol])r.pathname=t.pathname;else{for(var x=(t.pathname||"").split("/");x.length&&!(t.host=x.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),r.pathname=x.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var E=r.pathname||"",A=r.search||"";r.path=E+A}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var I=r.pathname&&r.pathname.charAt(0)==="/",P=t.host||t.pathname&&t.pathname.charAt(0)==="/",N=P||I||r.host&&t.pathname,L=N,C=r.pathname&&r.pathname.split("/")||[],Y=(x=t.pathname&&t.pathname.split("/")||[],r.protocol&&!iv[r.protocol]);if(Y&&(r.hostname="",r.port=null,r.host&&(C[0]===""?C[0]=r.host:C.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(x[0]===""?x[0]=t.host:x.unshift(t.host)),t.host=null),N=N&&(x[0]===""||C[0]==="")),P)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,C=x;else if(x.length)C||(C=[]),C.pop(),C=C.concat(x),r.search=t.search,r.query=t.query;else if(!zu.isNullOrUndefined(t.search))return Y&&(r.hostname=r.host=C.shift(),(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),r.search=t.search,r.query=t.query,zu.isNull(r.pathname)&&zu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=C.slice(-1)[0],ee=(r.host||t.host||C.length>1)&&(G==="."||G==="..")||G==="",D=0,U=C.length;U>=0;U--)(G=C[U])==="."?C.splice(U,1):G===".."?(C.splice(U,1),D++):D&&(C.splice(U,1),D--);if(!N&&!L)for(;D--;D)C.unshift("..");!N||C[0]===""||C[0]&&C[0].charAt(0)==="/"||C.unshift(""),ee&&C.join("/").substr(-1)!=="/"&&C.push("");var V,_=C[0]===""||C[0]&&C[0].charAt(0)==="/";return Y&&(r.hostname=r.host=_?"":C.length?C.shift():"",(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),(N=N||r.host&&C.length)&&!_&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),zu.isNull(r.pathname)&&zu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},js.prototype.parseHost=function(){var t=this.host,e=fBe.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};vi.Url;vi.format;vi.resolve;vi.resolveObject;sB={},Aae=!1;Rae=dBe(),pBe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=TBe;vi.fileURLToPath=EBe;vi.Url;vi.format;vi.resolve;vi.resolveObject;vi.URL;vBe=92,mBe=47,gBe=97,bBe=122,uB=pBe==="win32",yBe=/\//g,wBe=/%/g,_Be=/\\/g,MBe=/\n/g,xBe=/\r/g,SBe=/\t/g;IBe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=jBe;vi.fileURLToPath=cB;M1t=vi.Url,x1t=vi.format,S1t=vi.resolve,E1t=vi.resolveObject,A1t=vi.parse,R1t=vi.URL,kBe=92,BBe=47,PBe=97,OBe=122,hB=IBe==="win32",NBe=/\//g,CBe=/%/g,LBe=/\\/g,DBe=/\n/g,$Be=/\r/g,qBe=/\t/g});var vB={};Ka(vB,{Dir:()=>POe,Dirent:()=>OOe,F_OK:()=>UOe,FileReadStream:()=>DOe,FileWriteStream:()=>$Oe,R_OK:()=>FOe,ReadStream:()=>COe,Stats:()=>NOe,W_OK:()=>jOe,WriteStream:()=>LOe,X_OK:()=>zOe,_toUnixTimestamp:()=>qOe,access:()=>aPe,accessSync:()=>oPe,appendFile:()=>iPe,appendFileSync:()=>nPe,chmod:()=>uPe,chmodSync:()=>hPe,chown:()=>sPe,chownSync:()=>fPe,close:()=>cPe,closeSync:()=>lPe,constants:()=>ZOe,copyFile:()=>dPe,copyFileSync:()=>pPe,cp:()=>vPe,cpSync:()=>mPe,createReadStream:()=>gPe,createWriteStream:()=>bPe,default:()=>Yi,exists:()=>yPe,existsSync:()=>Xae,fchmod:()=>MPe,fchmodSync:()=>xPe,fchown:()=>wPe,fchownSync:()=>_Pe,fdatasync:()=>SPe,fdatasyncSync:()=>EPe,fstat:()=>APe,fstatSync:()=>RPe,fsync:()=>TPe,fsyncSync:()=>IPe,ftruncate:()=>kPe,ftruncateSync:()=>BPe,futimes:()=>PPe,futimesSync:()=>OPe,lchmod:()=>LPe,lchmodSync:()=>DPe,lchown:()=>NPe,lchownSync:()=>CPe,link:()=>$Pe,linkSync:()=>qPe,lstat:()=>UPe,lstatSync:()=>FPe,mkdir:()=>jPe,mkdirSync:()=>zPe,mkdtemp:()=>ZPe,mkdtempSync:()=>HPe,open:()=>KPe,openSync:()=>WPe,opendir:()=>VPe,opendirSync:()=>GPe,promises:()=>HOe,read:()=>XPe,readFile:()=>rOe,readFileSync:()=>iOe,readSync:()=>QPe,readdir:()=>YPe,readdirSync:()=>JPe,readlink:()=>nOe,readlinkSync:()=>aOe,readv:()=>eOe,readvSync:()=>tOe,realpath:()=>oOe,realpathSync:()=>sOe,rename:()=>fOe,renameSync:()=>uOe,rm:()=>hOe,rmSync:()=>cOe,rmdir:()=>lOe,rmdirSync:()=>dOe,stat:()=>pOe,statSync:()=>vOe,symlink:()=>mOe,symlinkSync:()=>gOe,truncate:()=>bOe,truncateSync:()=>yOe,unlink:()=>_Oe,unlinkSync:()=>MOe,unwatchFile:()=>wOe,utimes:()=>xOe,utimesSync:()=>SOe,watch:()=>EOe,watchFile:()=>AOe,write:()=>TOe,writeFile:()=>ROe,writeFileSync:()=>Qae,writeSync:()=>IOe,writev:()=>kOe,writevSync:()=>BOe});function hb(){return Tae||(Tae=!0,Object.defineProperty(fb,"__esModule",{value:!0}),fb.constants=void 0,fb.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),fb}function zBe(){return Iae||(Iae=!0,typeof BigInt=="function"?nw.default=BigInt:nw.default=function(){throw new Error("BigInt is not supported in this environment.")}),nw}function lB(){if(kae)return nv;kae=!0,Object.defineProperty(nv,"__esModule",{value:!0}),nv.Stats=void 0;var t=hb(),e=zBe(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){}return M.build=function(x,E){E===void 0&&(E=!1);var A=new M,I=x.uid,P=x.gid,N=x.atime,L=x.mtime,C=x.ctime,Y=E?e.default:function(ee){return ee};A.uid=Y(I),A.gid=Y(P),A.rdev=Y(0),A.blksize=Y(4096),A.ino=Y(x.ino),A.size=Y(x.getSize()),A.blocks=Y(1),A.atime=N,A.mtime=L,A.ctime=C,A.birthtime=C,A.atimeMs=Y(N.getTime()),A.mtimeMs=Y(L.getTime());var G=Y(C.getTime());return A.ctimeMs=G,A.birthtimeMs=G,A.dev=Y(0),A.mode=Y(x.mode),A.nlink=Y(x.nlink),A},M.prototype._checkModeProperty=function(x){return(Number(this.mode)&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return nv.Stats=y,nv.default=y,nv}function dB(){if(Bae)return Uf;Bae=!0;var t=Uf&&Uf.__spreadArray||function(h,c,p){if(p||arguments.length===2)for(var b=0,g=c.length,y;b<g;b++)(y||!(b in c))&&(y||(y=Array.prototype.slice.call(c,0,b)),y[b]=c[b]);return h.concat(y||Array.prototype.slice.call(c))};Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.bufferFrom=Uf.bufferAllocUnsafe=Uf.Buffer=void 0;var e=ii;Object.defineProperty(Uf,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function r(h){for(var c=[],p=1;p<arguments.length;p++)c[p-1]=arguments[p];return new(e.Buffer.bind.apply(e.Buffer,t([void 0,h],c,!1)))}var a=e.Buffer.allocUnsafe||r;Uf.bufferAllocUnsafe=a;var i=e.Buffer.from||r;return Uf.bufferFrom=i,Uf}function Hae(){if(Pae)return Fn;Pae=!0;var t=Fn&&Fn.__extends||function(){var A=function(I,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(I,P)};return function(I,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(I,P);function N(){this.constructor=I}I.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.E=Fn.AssertionError=Fn.message=Fn.RangeError=Fn.TypeError=Fn.Error=void 0;var e=or,r=gt,a=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function h(A){return function(I){t(P,I);function P(N){for(var L=[],C=1;C<arguments.length;C++)L[C-1]=arguments[C];var Y=I.call(this,b(N,L))||this;return Y.code=N,Y[a]=N,Y.name=I.prototype.name+" ["+Y[a]+"]",Y}return P}(A)}var c=typeof globalThis<"u"?globalThis:ZBe,p=function(A){t(I,A);function I(P){var N=this;if(typeof P!="object"||P===null)throw new Fn.TypeError("ERR_INVALID_ARG_TYPE","options","object");return P.message?N=A.call(this,P.message)||this:N=A.call(this,r.inspect(P.actual).slice(0,128)+" "+(P.operator+" "+r.inspect(P.expected).slice(0,128)))||this,N.generatedMessage=!P.message,N.name="AssertionError [ERR_ASSERTION]",N.code="ERR_ASSERTION",N.actual=P.actual,N.expected=P.expected,N.operator=P.operator,Fn.Error.captureStackTrace(N,P.stackStartFunction),N}return I}(c.Error);Fn.AssertionError=p;function b(A,I){e.strictEqual(typeof A,"string");var P=i[A];e(P,"An invalid error message key was used: "+A+".");var N;if(typeof P=="function")N=P;else{if(N=r.format,I===void 0||I.length===0)return P;I.unshift(P)}return String(N.apply(null,I))}Fn.message=b;function g(A,I){i[A]=typeof I=="function"?I:String(I)}Fn.E=g,Fn.Error=h(c.Error),Fn.TypeError=h(c.TypeError),Fn.RangeError=h(c.RangeError),g("ERR_ARG_NOT_ITERABLE","%s must be iterable"),g("ERR_ASSERTION","%s"),g("ERR_BUFFER_OUT_OF_BOUNDS",E),g("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),g("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),g("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),g("ERR_DNS_SET_SERVERS_FAILED",function(A,I){return'c-ares failed to set servers: "'+A+'" ['+I+"]"}),g("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),g("ERR_ENCODING_NOT_SUPPORTED",function(A){return'The "'+A+'" encoding is not supported'}),g("ERR_ENCODING_INVALID_ENCODED_DATA",function(A){return"The encoded data was not valid for encoding "+A}),g("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),g("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),g("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),g("ERR_INDEX_OUT_OF_RANGE","Index out of range"),g("ERR_INVALID_ARG_TYPE",y),g("ERR_INVALID_ARRAY_LENGTH",function(A,I,P){return e.strictEqual(typeof P,"number"),'The array "'+A+'" (length '+P+") must be of length "+I+"."}),g("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),g("ERR_INVALID_CALLBACK","Callback must be a function"),g("ERR_INVALID_CHAR","Invalid character in %s"),g("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),g("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),g("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),g("ERR_INVALID_FILE_URL_PATH","File URL path %s"),g("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),g("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),g("ERR_INVALID_OPT_VALUE",function(A,I){return'The value "'+String(I)+'" is invalid for option "'+A+'"'}),g("ERR_INVALID_OPT_VALUE_ENCODING",function(A){return'The value "'+String(A)+'" is invalid for option "encoding"'}),g("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),g("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),g("ERR_INVALID_THIS",'Value of "this" must be of type %s'),g("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),g("ERR_INVALID_URL","Invalid URL: %s"),g("ERR_INVALID_URL_SCHEME",function(A){return"The URL must be "+x(A,"scheme")}),g("ERR_IPC_CHANNEL_CLOSED","Channel closed"),g("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),g("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),g("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),g("ERR_MISSING_ARGS",M),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),g("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),g("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),g("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),g("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),g("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),g("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),g("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),g("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),g("ERR_SOCKET_CANNOT_SEND","Unable to send data"),g("ERR_SOCKET_CLOSED","Socket is closed"),g("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),g("ERR_STDERR_CLOSE","process.stderr cannot be closed"),g("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),g("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),g("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),g("ERR_TLS_DH_PARAM_SIZE",function(A){return"DH parameter size "+A+" is less than 2048"}),g("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),g("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),g("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),g("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),g("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),g("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),g("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),g("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),g("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),g("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function y(A,I,P){e(A,"name is required");var N;I.includes("not ")?(N="must not be",I=I.split("not ")[1]):N="must be";var L;if(Array.isArray(A)){var C=A.map(function(G){return'"'+G+'"'}).join(", ");L="The "+C+" arguments "+N+" "+x(I,"type")}else if(A.includes(" argument"))L="The "+A+" "+N+" "+x(I,"type");else{var Y=A.includes(".")?"property":"argument";L='The "'+A+'" '+Y+" "+N+" "+x(I,"type")}return arguments.length>=3&&(L+=". Received type "+(P!==null?typeof P:"null")),L}function M(){for(var A=[],I=0;I<arguments.length;I++)A[I]=arguments[I];e(A.length>0,"At least one arg needs to be specified");var P="The ",N=A.length;switch(A=A.map(function(L){return'"'+L+'"'}),N){case 1:P+=A[0]+" argument";break;case 2:P+=A[0]+" and "+A[1]+" arguments";break;default:P+=A.slice(0,N-1).join(", "),P+=", and "+A[N-1]+" arguments";break}return P+" must be specified"}function x(A,I){if(e(A,"expected is required"),e(typeof I=="string","thing is required"),Array.isArray(A)){var P=A.length;return e(P>0,"At least one expected value needs to be specified"),A=A.map(function(N){return String(N)}),P>2?"one of "+I+" "+A.slice(0,P-1).join(", ")+", or "+A[P-1]:P===2?"one of "+I+" "+A[0]+" or "+A[1]:"of "+I+" "+A[0]}else return"of "+I+" "+String(A)}function E(A,I){return I?"Attempt to write outside buffer bounds":'"'+A+'" is outside of buffer bounds'}return Fn}function Kae(){if(Oae)return Zu;Oae=!0,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.strToEncoding=Zu.assertEncoding=Zu.ENCODING_UTF8=void 0;var t=dB(),e=Hae();Zu.ENCODING_UTF8="utf8";function r(i){if(i&&!t.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}Zu.assertEncoding=r;function a(i,h){return!h||h===Zu.ENCODING_UTF8?i:h==="buffer"?new t.Buffer(i):new t.Buffer(i).toString(h)}return Zu.strToEncoding=a,Zu}function Wae(){if(Nae)return av;Nae=!0,Object.defineProperty(av,"__esModule",{value:!0}),av.Dirent=void 0;var t=hb(),e=Kae(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){this.name="",this.mode=0}return M.build=function(x,E){var A=new M,I=x.getNode().mode;return A.name=(0,e.strToEncoding)(x.getName(),E),A.mode=I,A},M.prototype._checkModeProperty=function(x){return(this.mode&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return av.Dirent=y,av.default=y,av}function Vae(){if(Cae)return aw;Cae=!0;var t=yr;Object.defineProperty(aw,"__esModule",{value:!0});var e;return typeof t.nextTick=="function"?e=t.nextTick.bind(typeof globalThis<"u"?globalThis:Lae):e=setTimeout.bind(typeof globalThis<"u"?globalThis:Lae),aw.default=e,aw}function Gae(){if(Dae)return ov;Dae=!0;var t=yr;Object.defineProperty(ov,"__esModule",{value:!0}),ov.createProcess=void 0;var e=function(){if(typeof t<"u")return t;try{return yr}catch{return}};function r(){var a=e()||{};return a.getuid||(a.getuid=function(){return 0}),a.getgid||(a.getgid=function(){return 0}),a.cwd||(a.cwd=function(){return"/"}),a.nextTick||(a.nextTick=Vae().default),a.emitWarning||(a.emitWarning=function(i,h){console.warn(""+h+(h?": ":"")+i)}),a.env||(a.env={}),a}return ov.createProcess=r,ov.default=r(),ov}function HBe(){if($ae)return ho;$ae=!0;var t=ho&&ho.__extends||function(){var A=function(I,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(I,P)};return function(I,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(I,P);function N(){this.constructor=I}I.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(ho,"__esModule",{value:!0}),ho.File=ho.Link=ho.Node=ho.SEP=void 0;var e=Gae(),r=dB(),a=hb(),i=Si,h=lB(),c=a.constants.S_IFMT,p=a.constants.S_IFDIR,b=a.constants.S_IFREG,g=a.constants.S_IFLNK,y=a.constants.O_APPEND;ho.SEP="/";var M=function(A){t(I,A);function I(P,N){N===void 0&&(N=438);var L=A.call(this)||this;return L.uid=e.default.getuid(),L.gid=e.default.getgid(),L.atime=new Date,L.mtime=new Date,L.ctime=new Date,L.perm=438,L.mode=b,L.nlink=1,L.perm=N,L.mode|=N,L.ino=P,L}return I.prototype.getString=function(P){return P===void 0&&(P="utf8"),this.getBuffer().toString(P)},I.prototype.setString=function(P){this.buf=(0,r.bufferFrom)(P,"utf8"),this.touch()},I.prototype.getBuffer=function(){return this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},I.prototype.setBuffer=function(P){this.buf=(0,r.bufferFrom)(P),this.touch()},I.prototype.getSize=function(){return this.buf?this.buf.length:0},I.prototype.setModeProperty=function(P){this.mode=this.mode&~c|P},I.prototype.setIsFile=function(){this.setModeProperty(b)},I.prototype.setIsDirectory=function(){this.setModeProperty(p)},I.prototype.setIsSymlink=function(){this.setModeProperty(g)},I.prototype.isFile=function(){return(this.mode&c)===b},I.prototype.isDirectory=function(){return(this.mode&c)===p},I.prototype.isSymlink=function(){return(this.mode&c)===g},I.prototype.makeSymlink=function(P){this.symlink=P,this.setIsSymlink()},I.prototype.write=function(P,N,L,C){if(N===void 0&&(N=0),L===void 0&&(L=P.length),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),C+L>this.buf.length){var Y=(0,r.bufferAllocUnsafe)(C+L);this.buf.copy(Y,0,0,this.buf.length),this.buf=Y}return P.copy(this.buf,C,N,N+L),this.touch(),L},I.prototype.read=function(P,N,L,C){N===void 0&&(N=0),L===void 0&&(L=P.byteLength),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var Y=L;return Y>P.byteLength&&(Y=P.byteLength),Y+C>this.buf.length&&(Y=this.buf.length-C),this.buf.copy(P,N,C,C+Y),Y},I.prototype.truncate=function(P){if(P===void 0&&(P=0),!P)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),P<=this.buf.length)this.buf=this.buf.slice(0,P);else{var N=(0,r.bufferAllocUnsafe)(0);this.buf.copy(N),N.fill(0,P)}this.touch()},I.prototype.chmod=function(P){this.perm=P,this.mode=this.mode&-512|P,this.touch()},I.prototype.chown=function(P,N){this.uid=P,this.gid=N,this.touch()},I.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},I.prototype.canRead=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&4||N===this.gid&&this.perm&32||P===this.uid&&this.perm&256)},I.prototype.canWrite=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&2||N===this.gid&&this.perm&16||P===this.uid&&this.perm&128)},I.prototype.del=function(){this.emit("delete",this)},I.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},I}(i.EventEmitter);ho.Node=M;var x=function(A){t(I,A);function I(P,N,L){var C=A.call(this)||this;return C.children={},C.steps=[],C.ino=0,C.length=0,C.vol=P,C.parent=N,C.steps=N?N.steps.concat([L]):[L],C}return I.prototype.setNode=function(P){this.node=P,this.ino=P.ino},I.prototype.getNode=function(){return this.node},I.prototype.createChild=function(P,N){N===void 0&&(N=this.vol.createNode());var L=new I(this.vol,this,P);return L.setNode(N),N.isDirectory(),this.setChild(P,L),L},I.prototype.setChild=function(P,N){return N===void 0&&(N=new I(this.vol,this,P)),this.children[P]=N,N.parent=this,this.length++,this.emit("child:add",N,this),N},I.prototype.deleteChild=function(P){delete this.children[P.getName()],this.length--,this.emit("child:delete",P,this)},I.prototype.getChild=function(P){if(Object.hasOwnProperty.call(this.children,P))return this.children[P]},I.prototype.getPath=function(){return this.steps.join(ho.SEP)},I.prototype.getName=function(){return this.steps[this.steps.length-1]},I.prototype.walk=function(P,N,L){if(N===void 0&&(N=P.length),L===void 0&&(L=0),L>=P.length)return this;if(L>=N)return this;var C=P[L],Y=this.getChild(C);return Y?Y.walk(P,N,L+1):null},I.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},I}(i.EventEmitter);ho.Link=x;var E=function(){function A(I,P,N,L){this.position=0,this.link=I,this.node=P,this.flags=N,this.fd=L}return A.prototype.getString=function(I){return this.node.getString()},A.prototype.setString=function(I){this.node.setString(I)},A.prototype.getBuffer=function(){return this.node.getBuffer()},A.prototype.setBuffer=function(I){this.node.setBuffer(I)},A.prototype.getSize=function(){return this.node.getSize()},A.prototype.truncate=function(I){this.node.truncate(I)},A.prototype.seekTo=function(I){this.position=I},A.prototype.stats=function(){return h.default.build(this.node)},A.prototype.write=function(I,P,N,L){P===void 0&&(P=0),N===void 0&&(N=I.length),typeof L!="number"&&(L=this.position),this.flags&y&&(L=this.getSize());var C=this.node.write(I,P,N,L);return this.position=L+C,C},A.prototype.read=function(I,P,N,L){P===void 0&&(P=0),N===void 0&&(N=I.byteLength),typeof L!="number"&&(L=this.position);var C=this.node.read(I,P,N,L);return this.position=L+C,C},A.prototype.chmod=function(I){this.node.chmod(I)},A.prototype.chown=function(I,P){this.node.chown(I,P)},A}();return ho.File=E,ho}function WBe(){if(qae)return ow;qae=!0,Object.defineProperty(ow,"__esModule",{value:!0});function t(e,r,a){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:KBe,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return ow.default=t,ow}function VBe(){if(Uae)return kl;Uae=!0;var t=kl&&kl.__spreadArray||function(i,h,c){if(c||arguments.length===2)for(var p=0,b=h.length,g;p<b;p++)(g||!(p in h))&&(g||(g=Array.prototype.slice.call(h,0,p)),g[p]=h[p]);return i.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(kl,"__esModule",{value:!0}),kl.FileHandle=void 0;function e(i,h,c){return c===void 0&&(c=function(p){return p}),function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return new Promise(function(g,y){i[h].bind(i).apply(void 0,t(t([],p,!1),[function(M,x){return M?y(M):g(c(x))}],!1))})}}var r=function(){function i(h,c){this.vol=h,this.fd=c}return i.prototype.appendFile=function(h,c){return e(this.vol,"appendFile")(this.fd,h,c)},i.prototype.chmod=function(h){return e(this.vol,"fchmod")(this.fd,h)},i.prototype.chown=function(h,c){return e(this.vol,"fchown")(this.fd,h,c)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(h,c,p,b){return e(this.vol,"read",function(g){return{bytesRead:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.readFile=function(h){return e(this.vol,"readFile")(this.fd,h)},i.prototype.stat=function(h){return e(this.vol,"fstat")(this.fd,h)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(h){return e(this.vol,"ftruncate")(this.fd,h)},i.prototype.utimes=function(h,c){return e(this.vol,"futimes")(this.fd,h,c)},i.prototype.write=function(h,c,p,b){return e(this.vol,"write",function(g){return{bytesWritten:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.writeFile=function(h,c){return e(this.vol,"writeFile")(this.fd,h,c)},i}();kl.FileHandle=r;function a(i){return typeof Promise>"u"?null:{FileHandle:r,access:function(h,c){return e(i,"access")(h,c)},appendFile:function(h,c,p){return e(i,"appendFile")(h instanceof r?h.fd:h,c,p)},chmod:function(h,c){return e(i,"chmod")(h,c)},chown:function(h,c,p){return e(i,"chown")(h,c,p)},copyFile:function(h,c,p){return e(i,"copyFile")(h,c,p)},lchmod:function(h,c){return e(i,"lchmod")(h,c)},lchown:function(h,c,p){return e(i,"lchown")(h,c,p)},link:function(h,c){return e(i,"link")(h,c)},lstat:function(h,c){return e(i,"lstat")(h,c)},mkdir:function(h,c){return e(i,"mkdir")(h,c)},mkdtemp:function(h,c){return e(i,"mkdtemp")(h,c)},open:function(h,c,p){return e(i,"open",function(b){return new r(i,b)})(h,c,p)},readdir:function(h,c){return e(i,"readdir")(h,c)},readFile:function(h,c){return e(i,"readFile")(h instanceof r?h.fd:h,c)},readlink:function(h,c){return e(i,"readlink")(h,c)},realpath:function(h,c){return e(i,"realpath")(h,c)},rename:function(h,c){return e(i,"rename")(h,c)},rmdir:function(h){return e(i,"rmdir")(h)},stat:function(h,c){return e(i,"stat")(h,c)},symlink:function(h,c,p){return e(i,"symlink")(h,c,p)},truncate:function(h,c){return e(i,"truncate")(h,c)},unlink:function(h){return e(i,"unlink")(h)},utimes:function(h,c,p){return e(i,"utimes")(h,c,p)},writeFile:function(h,c,p){return e(i,"writeFile")(h instanceof r?h.fd:h,c,p)}}}return kl.default=a,kl}function GBe(){if(Fae)return ub;Fae=!0;var t=yr;Object.defineProperty(ub,"__esModule",{value:!0}),ub.unixify=h,ub.correctPath=c;var e=t.platform==="win32";function r(p){var b=p.length-1;if(b<2)return p;for(;a(p,b);)b--;return p.substr(0,b+1)}function a(p,b){var g=p[b];return b>0&&(g==="/"||e&&g==="\\")}function i(p,b){if(typeof p!="string")throw new TypeError("expected a string");return p=p.replace(/[\\\/]+/g,"/"),b!==!1&&(p=r(p)),p}function h(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(p=i(p,b),p.replace(/^([a-zA-Z]+:|\.\/)/,"")):p}function c(p){return h(p.replace(/^\\\\\?\\.:\\/,"\\"))}return ub}function Yae(){if(jae)return hi;jae=!0;var t=hi&&hi.__extends||function(){var Ke=function(ve,we){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ze,rt){ze.__proto__=rt}||function(ze,rt){for(var ft in rt)Object.prototype.hasOwnProperty.call(rt,ft)&&(ze[ft]=rt[ft])},Ke(ve,we)};return function(ve,we){if(typeof we!="function"&&we!==null)throw new TypeError("Class extends value "+String(we)+" is not a constructor or null");Ke(ve,we);function ze(){this.constructor=ve}ve.prototype=we===null?Object.create(we):(ze.prototype=we.prototype,new ze)}}(),e=hi&&hi.__spreadArray||function(Ke,ve,we){if(we||arguments.length===2)for(var ze=0,rt=ve.length,ft;ze<rt;ze++)(ft||!(ze in ve))&&(ft||(ft=Array.prototype.slice.call(ve,0,ze)),ft[ze]=ve[ze]);return Ke.concat(ft||Array.prototype.slice.call(ve))};Object.defineProperty(hi,"__esModule",{value:!0}),hi.FSWatcher=hi.StatWatcher=hi.Volume=hi.toUnixTimestamp=hi.bufferToEncoding=hi.dataToBuffer=hi.dataToStr=hi.pathToSteps=hi.filenameToSteps=hi.pathToFilename=hi.flagsToNumber=hi.FLAGS=void 0;var r=sn,a=HBe(),i=lB(),h=Wae(),c=dB(),p=Vae(),b=Gae(),g=WBe(),y=Ia,M=hb(),x=Si,E=Kae(),A=Hae(),I=gt,P=VBe(),N=r.resolve,L=M.constants.O_RDONLY,C=M.constants.O_WRONLY,Y=M.constants.O_RDWR,G=M.constants.O_CREAT,ee=M.constants.O_EXCL,D=M.constants.O_TRUNC,U=M.constants.O_APPEND,V=M.constants.O_SYNC,_=M.constants.O_DIRECTORY,n=M.constants.F_OK,s=M.constants.COPYFILE_EXCL,f=M.constants.COPYFILE_FICLONE_FORCE,u=r.posix?r.posix:r,l=u.sep,m=u.relative,w=u.join,d=u.dirname,o=b.default.platform==="win32",v=128,R={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},S=function(Ke){return"Expected options to be either an object or a string, but got "+Ke+" instead"},B="ENOENT",F="EBADF",$="EINVAL",re="EPERM",Q="EPROTO",Z="EEXIST",K="ENOTDIR",ce="EMFILE",te="EACCES",j="EISDIR",J="ENOTEMPTY",X="ENOSYS";function he(Ke,ve,we,ze){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze="");var rt="";switch(we&&(rt=" '"+we+"'"),ze&&(rt+=" -> '"+ze+"'"),Ke){case B:return"ENOENT: no such file or directory, "+ve+rt;case F:return"EBADF: bad file descriptor, "+ve+rt;case $:return"EINVAL: invalid argument, "+ve+rt;case re:return"EPERM: operation not permitted, "+ve+rt;case Q:return"EPROTO: protocol error, "+ve+rt;case Z:return"EEXIST: file already exists, "+ve+rt;case K:return"ENOTDIR: not a directory, "+ve+rt;case j:return"EISDIR: illegal operation on a directory, "+ve+rt;case te:return"EACCES: permission denied, "+ve+rt;case J:return"ENOTEMPTY: directory not empty, "+ve+rt;case ce:return"EMFILE: too many open files, "+ve+rt;case X:return"ENOSYS: function not implemented, "+ve+rt;default:return Ke+": error occurred, "+ve+rt}}function Te(Ke,ve,we,ze,rt){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze=""),rt===void 0&&(rt=Error);var ft=new rt(he(Ke,ve,we,ze));return ft.code=Ke,ft}var oe;(function(Ke){Ke[Ke.r=L]="r",Ke[Ke["r+"]=Y]="r+",Ke[Ke.rs=L|V]="rs",Ke[Ke.sr=Ke.rs]="sr",Ke[Ke["rs+"]=Y|V]="rs+",Ke[Ke["sr+"]=Ke["rs+"]]="sr+",Ke[Ke.w=C|G|D]="w",Ke[Ke.wx=C|G|D|ee]="wx",Ke[Ke.xw=Ke.wx]="xw",Ke[Ke["w+"]=Y|G|D]="w+",Ke[Ke["wx+"]=Y|G|D|ee]="wx+",Ke[Ke["xw+"]=Ke["wx+"]]="xw+",Ke[Ke.a=C|U|G]="a",Ke[Ke.ax=C|U|G|ee]="ax",Ke[Ke.xa=Ke.ax]="xa",Ke[Ke["a+"]=Y|U|G]="a+",Ke[Ke["ax+"]=Y|U|G|ee]="ax+",Ke[Ke["xa+"]=Ke["ax+"]]="xa+"})(oe=hi.FLAGS||(hi.FLAGS={}));function le(Ke){if(typeof Ke=="number")return Ke;if(typeof Ke=="string"){var ve=oe[Ke];if(typeof ve<"u")return ve}throw new A.TypeError("ERR_INVALID_OPT_VALUE","flags",Ke)}hi.flagsToNumber=le;function ot(Ke,ve){var we;if(ve){var ze=typeof ve;switch(ze){case"string":we=Object.assign({},Ke,{encoding:ve});break;case"object":we=Object.assign({},Ke,ve);break;default:throw TypeError(S(ze))}}else return Ke;return we.encoding!=="buffer"&&(0,E.assertEncoding)(we.encoding),we}function ge(Ke){return function(ve){return ot(Ke,ve)}}function Se(Ke){if(typeof Ke!="function")throw TypeError(R.CB);return Ke}function ut(Ke){return function(ve,we){return typeof ve=="function"?[Ke(),ve]:[Ke(ve),Se(we)]}}var Ze={encoding:"utf8"},Ge=ge(Ze),ct=ut(Ge),z={flag:"r"},T=ge(z),k={encoding:"utf8",mode:438,flag:oe[oe.w]},O=ge(k),q={encoding:"utf8",mode:438,flag:oe[oe.a]},H=ge(q),W=ut(H),fe=Ze,st=ge(fe),ue=ut(st),me={mode:511,recursive:!1},pe=function(Ke){return typeof Ke=="number"?Object.assign({},me,{mode:Ke}):Object.assign({},me,Ke)},be={recursive:!1},Qe=function(Ke){return Object.assign({},be,Ke)},se={encoding:"utf8",withFileTypes:!1},ye=ge(se),Ee=ut(ye),Fe={bigint:!1},de=function(Ke){return Ke===void 0&&(Ke={}),Object.assign({},Fe,Ke)},xe=function(Ke,ve){return typeof Ke=="function"?[de(),Ke]:[de(Ke),Se(ve)]};function lt(Ke){if(Ke.hostname!=="")throw new A.TypeError("ERR_INVALID_FILE_URL_HOST",b.default.platform);for(var ve=Ke.pathname,we=0;we<ve.length;we++)if(ve[we]==="%"){var ze=ve.codePointAt(we+2)|32;if(ve[we+1]==="2"&&ze===102)throw new A.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(ve)}function _e(Ke){if(typeof Ke!="string"&&!c.Buffer.isBuffer(Ke)){try{if(!(Ke instanceof vi.URL))throw new TypeError(R.PATH_STR)}catch{throw new TypeError(R.PATH_STR)}Ke=lt(Ke)}var ve=String(Ke);return Je(ve),ve}hi.pathToFilename=_e;var Ve=function(Ke,ve){return ve===void 0&&(ve=b.default.cwd()),N(ve,Ke)};if(o){var vt=Ve,Ye=GBe().unixify;Ve=function(Ke,ve){return Ye(vt(Ke,ve))}}function et(Ke,ve){var we=Ve(Ke,ve),ze=we.substr(1);return ze?ze.split(l):[]}hi.filenameToSteps=et;function mt(Ke){return et(_e(Ke))}hi.pathToSteps=mt;function We(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke.toString(ve):Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke).toString(ve):String(Ke)}hi.dataToStr=We;function nt(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke:Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke):(0,c.bufferFrom)(String(Ke),ve)}hi.dataToBuffer=nt;function bt(Ke,ve){return!ve||ve==="buffer"?Ke:Ke.toString(ve)}hi.bufferToEncoding=bt;function Je(Ke,ve){if((""+Ke).indexOf("\0")!==-1){var we=new Error("Path must be a string without null bytes");if(we.code=B,typeof ve!="function")throw we;return b.default.nextTick(ve,we),!1}return!0}function at(Ke,ve){if(typeof Ke=="number")return Ke;if(typeof Ke=="string")return parseInt(Ke,8);if(ve)return yt(ve)}function yt(Ke,ve){var we=at(Ke,ve);if(typeof we!="number"||isNaN(we))throw new TypeError(R.MODE_INT);return we}function Xe(Ke){return Ke>>>0===Ke}function it(Ke){if(!Xe(Ke))throw TypeError(R.FD)}function _t(Ke){if(typeof Ke=="string"&&+Ke==Ke)return+Ke;if(Ke instanceof Date)return Ke.getTime()/1e3;if(isFinite(Ke))return Ke<0?Date.now()/1e3:Ke;throw new Error("Cannot parse time: "+Ke)}hi.toUnixTimestamp=_t;function dt(Ke){if(typeof Ke!="number")throw TypeError(R.UID)}function Mt(Ke){if(typeof Ke!="number")throw TypeError(R.GID)}function qt(Ke){var ve={};function we(ze,rt){for(var ft in rt){var pt=rt[ft],xt=w(ze,ft);typeof pt=="string"?ve[xt]=pt:typeof pt=="object"&&pt!==null&&Object.keys(pt).length>0?we(xt,pt):ve[xt]=null}}return we("",Ke),ve}var Ut=function(){function Ke(ve){ve===void 0&&(ve={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,P.default)(this),this.statWatchers={},this.props=Object.assign({Node:a.Node,Link:a.Link,File:a.File},ve);var we=this.createLink();we.setNode(this.createNode(!0));var ze=this;this.StatWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}($t);var rt=Lt;this.ReadStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],er=0;er<arguments.length;er++)Kt[er]=arguments[er];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(rt);var ft=Nt;this.WriteStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],er=0;er<arguments.length;er++)Kt[er]=arguments[er];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(ft),this.FSWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(zt),this.root=we}return Ke.fromJSON=function(ve,we){var ze=new Ke;return ze.fromJSON(ve,we),ze},Ke.fromNestedJSON=function(ve,we){var ze=new Ke;return ze.fromNestedJSON(ve,we),ze},Object.defineProperty(Ke.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),Ke.prototype.createLink=function(ve,we,ze,rt){if(ze===void 0&&(ze=!1),!ve)return new this.props.Link(this,null,"");if(!we)throw new Error("createLink: name cannot be empty");return ve.createChild(we,this.createNode(ze,rt))},Ke.prototype.deleteLink=function(ve){var we=ve.parent;return we?(we.deleteChild(ve),!0):!1},Ke.prototype.newInoNumber=function(){var ve=this.releasedInos.pop();return ve||(this.ino=(this.ino+1)%4294967295,this.ino)},Ke.prototype.newFdNumber=function(){var ve=this.releasedFds.pop();return typeof ve=="number"?ve:Ke.fd--},Ke.prototype.createNode=function(ve,we){ve===void 0&&(ve=!1);var ze=new this.props.Node(this.newInoNumber(),we);return ve&&ze.setIsDirectory(),this.inodes[ze.ino]=ze,ze},Ke.prototype.getNode=function(ve){return this.inodes[ve]},Ke.prototype.deleteNode=function(ve){ve.del(),delete this.inodes[ve.ino],this.releasedInos.push(ve.ino)},Ke.prototype.genRndStr=function(){var ve=(Math.random()+1).toString(36).substr(2,6);return ve.length===6?ve:this.genRndStr()},Ke.prototype.getLink=function(ve){return this.root.walk(ve)},Ke.prototype.getLinkOrThrow=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,we,ve);return rt},Ke.prototype.getResolvedLink=function(ve){for(var we=typeof ve=="string"?et(ve):ve,ze=this.root,rt=0;rt<we.length;){var ft=we[rt];if(ze=ze.getChild(ft),!ze)return null;var pt=ze.getNode();if(pt.isSymlink()){we=pt.symlink.concat(we.slice(rt+1)),ze=this.root,rt=0;continue}rt++}return ze},Ke.prototype.getResolvedLinkOrThrow=function(ve,we){var ze=this.getResolvedLink(ve);if(!ze)throw Te(B,we,ve);return ze},Ke.prototype.resolveSymlinks=function(ve){return this.getResolvedLink(ve.steps.slice(1))},Ke.prototype.getLinkAsDirOrThrow=function(ve,we){var ze=this.getLinkOrThrow(ve,we);if(!ze.getNode().isDirectory())throw Te(K,we,ve);return ze},Ke.prototype.getLinkParent=function(ve){return this.root.walk(ve,ve.length-1)},Ke.prototype.getLinkParentAsDirOrThrow=function(ve,we){var ze=ve instanceof Array?ve:et(ve),rt=this.getLinkParent(ze);if(!rt)throw Te(B,we,l+ze.join(l));if(!rt.getNode().isDirectory())throw Te(K,we,l+ze.join(l));return rt},Ke.prototype.getFileByFd=function(ve){return this.fds[String(ve)]},Ke.prototype.getFileByFdOrThrow=function(ve,we){if(!Xe(ve))throw TypeError(R.FD);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,we);return ze},Ke.prototype.getNodeByIdOrCreate=function(ve,we,ze){if(typeof ve=="number"){var rt=this.getFileByFd(ve);if(!rt)throw Error("File nto found");return rt.node}else{var ft=mt(ve),pt=this.getLink(ft);if(pt)return pt.getNode();if(we&G){var xt=this.getLinkParent(ft);if(xt){var Kt=ft[ft.length-1];return pt=this.createLink(xt,Kt,!1,ze),pt.getNode()}}throw Te(B,"getNodeByIdOrCreate",_e(ve))}},Ke.prototype.wrapAsync=function(ve,we,ze){var rt=this;Se(ze),(0,p.default)(function(){var ft;try{ft=ve.apply(rt,we)}catch(pt){ze(pt);return}ze(null,ft)})},Ke.prototype._toJSON=function(ve,we,ze){var rt;ve===void 0&&(ve=this.root),we===void 0&&(we={});var ft=!0,pt=ve.children;ve.getNode().isFile()&&(pt=(rt={},rt[ve.getName()]=ve.parent.getChild(ve.getName()),rt),ve=ve.parent);for(var xt in pt){ft=!1;var Kt=ve.getChild(xt);if(!Kt)throw new Error("_toJSON: unexpected undefined");var er=Kt.getNode();if(er.isFile()){var ci=Kt.getPath();ze&&(ci=m(ze,ci)),we[ci]=er.getString()}else er.isDirectory()&&this._toJSON(Kt,we,ze)}var yn=ve.getPath();return ze&&(yn=m(ze,yn)),yn&&ft&&(we[yn]=null),we},Ke.prototype.toJSON=function(ve,we,ze){we===void 0&&(we={}),ze===void 0&&(ze=!1);var rt=[];if(ve){ve instanceof Array||(ve=[ve]);for(var ft=0,pt=ve;ft<pt.length;ft++){var xt=pt[ft],Kt=_e(xt),er=this.getResolvedLink(Kt);er&&rt.push(er)}}else rt.push(this.root);if(!rt.length)return we;for(var ci=0,yn=rt;ci<yn.length;ci++){var er=yn[ci];this._toJSON(er,we,ze?er.getPath():"")}return we},Ke.prototype.fromJSON=function(ve,we){we===void 0&&(we=b.default.cwd());for(var ze in ve){var rt=ve[ze];if(ze=Ve(ze,we),typeof rt=="string"){var ft=d(ze);this.mkdirpBase(ft,511),this.writeFileSync(ze,rt)}else this.mkdirpBase(ze,511)}},Ke.prototype.fromNestedJSON=function(ve,we){this.fromJSON(qt(ve),we)},Ke.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},Ke.prototype.mountSync=function(ve,we){this.fromJSON(we,ve)},Ke.prototype.openLink=function(ve,we,ze){if(ze===void 0&&(ze=!0),this.openFiles>=this.maxFiles)throw Te(ce,"open",ve.getPath());var rt=ve;if(ze&&(rt=this.resolveSymlinks(ve)),!rt)throw Te(B,"open",ve.getPath());var ft=rt.getNode();if(ft.isDirectory()){if((we&(L|Y|C))!==L)throw Te(j,"open",ve.getPath())}else if(we&_)throw Te(K,"open",ve.getPath());if(!(we&C)&&!ft.canRead())throw Te(te,"open",ve.getPath());var pt=new this.props.File(ve,ft,we,this.newFdNumber());return this.fds[pt.fd]=pt,this.openFiles++,we&D&&pt.truncate(),pt},Ke.prototype.openFile=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=et(ve),pt=rt?this.getResolvedLink(ft):this.getLink(ft);if(!pt&&we&G){var xt=this.getResolvedLink(ft.slice(0,ft.length-1));if(!xt)throw Te(B,"open",l+ft.join(l));we&G&&typeof ze=="number"&&(pt=this.createLink(xt,ft[ft.length-1],!1,ze))}if(pt)return this.openLink(pt,we,rt);throw Te(B,"open",ve)},Ke.prototype.openBase=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=this.openFile(ve,we,ze,rt);if(!ft)throw Te(B,"open",ve);return ft.fd},Ke.prototype.openSync=function(ve,we,ze){ze===void 0&&(ze=438);var rt=yt(ze),ft=_e(ve),pt=le(we);return this.openBase(ft,pt,rt)},Ke.prototype.open=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=438,pt=ze),ft=ft||438;var xt=yt(ft),Kt=_e(ve),er=le(we);this.wrapAsync(this.openBase,[Kt,er,xt],pt)},Ke.prototype.closeFile=function(ve){this.fds[ve.fd]&&(this.openFiles--,delete this.fds[ve.fd],this.releasedFds.push(ve.fd))},Ke.prototype.closeSync=function(ve){it(ve);var we=this.getFileByFdOrThrow(ve,"close");this.closeFile(we)},Ke.prototype.close=function(ve,we){it(ve),this.wrapAsync(this.closeSync,[ve],we)},Ke.prototype.openFileOrGetById=function(ve,we,ze){if(typeof ve=="number"){var rt=this.fds[ve];if(!rt)throw Te(B);return rt}else return this.openFile(_e(ve),we,ze)},Ke.prototype.readBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve);return pt.read(we,Number(ze),Number(rt),ft)},Ke.prototype.readSync=function(ve,we,ze,rt,ft){return it(ve),this.readBase(ve,we,ze,rt,ft)},Ke.prototype.read=function(ve,we,ze,rt,ft,pt){var xt=this;if(Se(pt),rt===0)return b.default.nextTick(function(){pt&&pt(null,0,we)});(0,p.default)(function(){try{var Kt=xt.readBase(ve,we,ze,rt,ft);pt(null,Kt,we)}catch(er){pt(er)}})},Ke.prototype.readFileBase=function(ve,we,ze){var rt,ft=typeof ve=="number",pt=ft&&Xe(ve),xt;if(pt)xt=ve;else{var Kt=_e(ve),er=et(Kt),ci=this.getResolvedLink(er);if(ci){var yn=ci.getNode();if(yn.isDirectory())throw Te(j,"open",ci.getPath())}xt=this.openSync(ve,we)}try{rt=bt(this.getFileByFdOrThrow(xt).getBuffer(),ze)}finally{pt||this.closeSync(xt)}return rt},Ke.prototype.readFileSync=function(ve,we){var ze=T(we),rt=le(ze.flag);return this.readFileBase(ve,rt,ze.encoding)},Ke.prototype.readFile=function(ve,we,ze){var rt=ut(T)(we,ze),ft=rt[0],pt=rt[1],xt=le(ft.flag);this.wrapAsync(this.readFileBase,[ve,xt,ft.encoding],pt)},Ke.prototype.writeBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve,"write");return pt.write(we,ze,rt,ft)},Ke.prototype.writeSync=function(ve,we,ze,rt,ft){it(ve);var pt,xt,Kt,er,ci=typeof we!="string";ci?(xt=(ze||0)|0,Kt=rt,er=ft):(er=ze,pt=rt);var yn=nt(we,pt);return ci?typeof Kt>"u"&&(Kt=yn.length):(xt=0,Kt=yn.length),this.writeBase(ve,yn,xt,Kt,er)},Ke.prototype.write=function(ve,we,ze,rt,ft,pt){var xt=this;it(ve);var Kt,er,ci,yn,Zs,Vw=typeof we,wP=typeof ze,_P=typeof rt,MP=typeof ft;Vw!=="string"?wP==="function"?Zs=ze:_P==="function"?(Kt=ze|0,Zs=rt):MP==="function"?(Kt=ze|0,er=rt,Zs=ft):(Kt=ze|0,er=rt,ci=ft,Zs=pt):wP==="function"?Zs=ze:_P==="function"?(ci=ze,Zs=rt):MP==="function"&&(ci=ze,yn=rt,Zs=ft);var Ib=nt(we,yn);Vw!=="string"?typeof er>"u"&&(er=Ib.length):(Kt=0,er=Ib.length);var Gw=Se(Zs);(0,p.default)(function(){try{var xP=xt.writeBase(ve,Ib,Kt,er,ci);Vw!=="string"?Gw(null,xP,Ib):Gw(null,xP,we)}catch(aue){Gw(aue)}})},Ke.prototype.writeFileBase=function(ve,we,ze,rt){var ft=typeof ve=="number",pt;ft?pt=ve:pt=this.openBase(_e(ve),ze,rt);var xt=0,Kt=we.length,er=ze&U?void 0:0;try{for(;Kt>0;){var ci=this.writeSync(pt,we,xt,Kt,er);xt+=ci,Kt-=ci,er!==void 0&&(er+=ci)}}finally{ft||this.closeSync(pt)}},Ke.prototype.writeFileSync=function(ve,we,ze){var rt=O(ze),ft=le(rt.flag),pt=yt(rt.mode),xt=nt(we,rt.encoding);this.writeFileBase(ve,xt,ft,pt)},Ke.prototype.writeFile=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=k,pt=ze);var xt=Se(pt),Kt=O(ft),er=le(Kt.flag),ci=yt(Kt.mode),yn=nt(we,Kt.encoding);this.wrapAsync(this.writeFileBase,[ve,yn,er,ci],xt)},Ke.prototype.linkBase=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,"link",ve,we);var ft=et(we),pt=this.getLinkParent(ft);if(!pt)throw Te(B,"link",ve,we);var xt=ft[ft.length-1];if(pt.getChild(xt))throw Te(Z,"link",ve,we);var Kt=rt.getNode();Kt.nlink++,pt.createChild(xt,Kt)},Ke.prototype.copyFileBase=function(ve,we,ze){var rt=this.readFileSync(ve);if(ze&s&&this.existsSync(we))throw Te(Z,"copyFile",ve,we);if(ze&f)throw Te(X,"copyFile",ve,we);this.writeFileBase(we,rt,oe.w,438)},Ke.prototype.copyFileSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);return this.copyFileBase(rt,ft,(ze||0)|0)},Ke.prototype.copyFile=function(ve,we,ze,rt){var ft=_e(ve),pt=_e(we),xt,Kt;typeof ze=="function"?(xt=0,Kt=ze):(xt=ze,Kt=rt),Se(Kt),this.wrapAsync(this.copyFileBase,[ft,pt,xt],Kt)},Ke.prototype.linkSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.linkBase(ze,rt)},Ke.prototype.link=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.linkBase,[rt,ft],ze)},Ke.prototype.unlinkBase=function(ve){var we=et(ve),ze=this.getLink(we);if(!ze)throw Te(B,"unlink",ve);if(ze.length)throw Error("Dir not empty...");this.deleteLink(ze);var rt=ze.getNode();rt.nlink--,rt.nlink<=0&&this.deleteNode(rt)},Ke.prototype.unlinkSync=function(ve){var we=_e(ve);this.unlinkBase(we)},Ke.prototype.unlink=function(ve,we){var ze=_e(ve);this.wrapAsync(this.unlinkBase,[ze],we)},Ke.prototype.symlinkBase=function(ve,we){var ze=et(we),rt=this.getLinkParent(ze);if(!rt)throw Te(B,"symlink",ve,we);var ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"symlink",ve,we);var pt=rt.createChild(ft);return pt.getNode().makeSymlink(et(ve)),pt},Ke.prototype.symlinkSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.symlinkBase(rt,ft)},Ke.prototype.symlink=function(ve,we,ze,rt){var ft=Se(typeof ze=="function"?ze:rt),pt=_e(ve),xt=_e(we);this.wrapAsync(this.symlinkBase,[pt,xt],ft)},Ke.prototype.realpathBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"realpath",ve);return(0,E.strToEncoding)(rt.getPath(),we)},Ke.prototype.realpathSync=function(ve,we){return this.realpathBase(_e(ve),st(we).encoding)},Ke.prototype.realpath=function(ve,we,ze){var rt=ue(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.realpathBase,[xt,ft.encoding],pt)},Ke.prototype.lstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getLink(et(ve));if(!ze)throw Te(B,"lstat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.lstatSync=function(ve,we){return this.lstatBase(_e(ve),de(we).bigint)},Ke.prototype.lstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.lstatBase,[_e(ve),ft.bigint],pt)},Ke.prototype.statBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getResolvedLink(et(ve));if(!ze)throw Te(B,"stat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.statSync=function(ve,we){return this.statBase(_e(ve),de(we).bigint)},Ke.prototype.stat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.statBase,[_e(ve),ft.bigint],pt)},Ke.prototype.fstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,"fstat");return i.default.build(ze.node,we)},Ke.prototype.fstatSync=function(ve,we){return this.fstatBase(ve,de(we).bigint)},Ke.prototype.fstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.fstatBase,[ve,ft.bigint],pt)},Ke.prototype.renameBase=function(ve,we){var ze=this.getLink(et(ve));if(!ze)throw Te(B,"rename",ve,we);var rt=et(we),ft=this.getLinkParent(rt);if(!ft)throw Te(B,"rename",ve,we);var pt=ze.parent;pt&&pt.deleteChild(ze);var xt=rt[rt.length-1];ze.steps=e(e([],ft.steps,!0),[xt],!1),ft.setChild(ze.getName(),ze)},Ke.prototype.renameSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.renameBase(ze,rt)},Ke.prototype.rename=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.renameBase,[rt,ft],ze)},Ke.prototype.existsBase=function(ve){return!!this.statBase(ve)},Ke.prototype.existsSync=function(ve){try{return this.existsBase(_e(ve))}catch{return!1}},Ke.prototype.exists=function(ve,we){var ze=this,rt=_e(ve);if(typeof we!="function")throw Error(R.CB);(0,p.default)(function(){try{we(ze.existsBase(rt))}catch{we(!1)}})},Ke.prototype.accessBase=function(ve,we){this.getLinkOrThrow(ve,"access")},Ke.prototype.accessSync=function(ve,we){we===void 0&&(we=n);var ze=_e(ve);we=we|0,this.accessBase(ze,we)},Ke.prototype.access=function(ve,we,ze){var rt=n,ft;typeof we!="function"?(rt=we|0,ft=Se(ze)):ft=we;var pt=_e(ve);this.wrapAsync(this.accessBase,[pt,rt],ft)},Ke.prototype.appendFileSync=function(ve,we,ze){ze===void 0&&(ze=q);var rt=H(ze);(!rt.flag||Xe(ve))&&(rt.flag="a"),this.writeFileSync(ve,we,rt)},Ke.prototype.appendFile=function(ve,we,ze,rt){var ft=W(ze,rt),pt=ft[0],xt=ft[1];(!pt.flag||Xe(ve))&&(pt.flag="a"),this.writeFile(ve,we,pt,xt)},Ke.prototype.readdirBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"readdir",ve);var ft=rt.getNode();if(!ft.isDirectory())throw Te(K,"scandir",ve);if(we.withFileTypes){var pt=[];for(var xt in rt.children){var Kt=rt.getChild(xt);Kt&&pt.push(h.default.build(Kt,we.encoding))}return!o&&we.encoding!=="buffer"&&pt.sort(function(yn,Zs){return yn.name<Zs.name?-1:yn.name>Zs.name?1:0}),pt}var er=[];for(var ci in rt.children)er.push((0,E.strToEncoding)(ci,we.encoding));return!o&&we.encoding!=="buffer"&&er.sort(),er},Ke.prototype.readdirSync=function(ve,we){var ze=ye(we),rt=_e(ve);return this.readdirBase(rt,ze)},Ke.prototype.readdir=function(ve,we,ze){var rt=Ee(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readdirBase,[xt,ft],pt)},Ke.prototype.readlinkBase=function(ve,we){var ze=this.getLinkOrThrow(ve,"readlink"),rt=ze.getNode();if(!rt.isSymlink())throw Te($,"readlink",ve);var ft=l+rt.symlink.join(l);return(0,E.strToEncoding)(ft,we)},Ke.prototype.readlinkSync=function(ve,we){var ze=Ge(we),rt=_e(ve);return this.readlinkBase(rt,ze.encoding)},Ke.prototype.readlink=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readlinkBase,[xt,ft.encoding],pt)},Ke.prototype.fsyncBase=function(ve){this.getFileByFdOrThrow(ve,"fsync")},Ke.prototype.fsyncSync=function(ve){this.fsyncBase(ve)},Ke.prototype.fsync=function(ve,we){this.wrapAsync(this.fsyncBase,[ve],we)},Ke.prototype.fdatasyncBase=function(ve){this.getFileByFdOrThrow(ve,"fdatasync")},Ke.prototype.fdatasyncSync=function(ve){this.fdatasyncBase(ve)},Ke.prototype.fdatasync=function(ve,we){this.wrapAsync(this.fdatasyncBase,[ve],we)},Ke.prototype.ftruncateBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"ftruncate");ze.truncate(we)},Ke.prototype.ftruncateSync=function(ve,we){this.ftruncateBase(ve,we)},Ke.prototype.ftruncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);this.wrapAsync(this.ftruncateBase,[ve,rt],ft)},Ke.prototype.truncateBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.ftruncateSync(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.truncateSync=function(ve,we){if(Xe(ve))return this.ftruncateSync(ve,we);this.truncateBase(ve,we)},Ke.prototype.truncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);if(Xe(ve))return this.ftruncate(ve,rt,ft);this.wrapAsync(this.truncateBase,[ve,rt],ft)},Ke.prototype.futimesBase=function(ve,we,ze){var rt=this.getFileByFdOrThrow(ve,"futimes"),ft=rt.node;ft.atime=new Date(we*1e3),ft.mtime=new Date(ze*1e3)},Ke.prototype.futimesSync=function(ve,we,ze){this.futimesBase(ve,_t(we),_t(ze))},Ke.prototype.futimes=function(ve,we,ze,rt){this.wrapAsync(this.futimesBase,[ve,_t(we),_t(ze)],rt)},Ke.prototype.utimesBase=function(ve,we,ze){var rt=this.openSync(ve,"r+");try{this.futimesBase(rt,we,ze)}finally{this.closeSync(rt)}},Ke.prototype.utimesSync=function(ve,we,ze){this.utimesBase(_e(ve),_t(we),_t(ze))},Ke.prototype.utimes=function(ve,we,ze,rt){this.wrapAsync(this.utimesBase,[_e(ve),_t(we),_t(ze)],rt)},Ke.prototype.mkdirBase=function(ve,we){var ze=et(ve);if(!ze.length)throw Te(Z,"mkdir",ve);var rt=this.getLinkParentAsDirOrThrow(ve,"mkdir"),ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"mkdir",ve);rt.createChild(ft,this.createNode(!0,we))},Ke.prototype.mkdirpBase=function(ve,we){for(var ze=et(ve),rt=this.root,ft=0;ft<ze.length;ft++){var pt=ze[ft];if(!rt.getNode().isDirectory())throw Te(K,"mkdir",rt.getPath());var xt=rt.getChild(pt);if(xt)if(xt.getNode().isDirectory())rt=xt;else throw Te(K,"mkdir",xt.getPath());else rt=rt.createChild(pt,this.createNode(!0,we))}},Ke.prototype.mkdirSync=function(ve,we){var ze=pe(we),rt=yt(ze.mode,511),ft=_e(ve);ze.recursive?this.mkdirpBase(ft,rt):this.mkdirBase(ft,rt)},Ke.prototype.mkdir=function(ve,we,ze){var rt=pe(we),ft=Se(typeof we=="function"?we:ze),pt=yt(rt.mode,511),xt=_e(ve);rt.recursive?this.wrapAsync(this.mkdirpBase,[xt,pt],ft):this.wrapAsync(this.mkdirBase,[xt,pt],ft)},Ke.prototype.mkdirpSync=function(ve,we){this.mkdirSync(ve,{mode:we,recursive:!0})},Ke.prototype.mkdirp=function(ve,we,ze){var rt=typeof we=="function"?void 0:we,ft=Se(typeof we=="function"?we:ze);this.mkdir(ve,{mode:rt,recursive:!0},ft)},Ke.prototype.mkdtempBase=function(ve,we,ze){ze===void 0&&(ze=5);var rt=ve+this.genRndStr();try{return this.mkdirBase(rt,511),(0,E.strToEncoding)(rt,we)}catch(ft){if(ft.code===Z){if(ze>1)return this.mkdtempBase(ve,we,ze-1);throw Error("Could not create temp dir.")}else throw ft}},Ke.prototype.mkdtempSync=function(ve,we){var ze=Ge(we).encoding;if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");return Je(ve),this.mkdtempBase(ve,ze)},Ke.prototype.mkdtemp=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0].encoding,pt=rt[1];if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");Je(ve)&&this.wrapAsync(this.mkdtempBase,[ve,ft],pt)},Ke.prototype.rmdirBase=function(ve,we){var ze=Qe(we),rt=this.getLinkAsDirOrThrow(ve,"rmdir");if(rt.length&&!ze.recursive)throw Te(J,"rmdir",ve);this.deleteLink(rt)},Ke.prototype.rmdirSync=function(ve,we){this.rmdirBase(_e(ve),we)},Ke.prototype.rmdir=function(ve,we,ze){var rt=Qe(we),ft=Se(typeof we=="function"?we:ze);this.wrapAsync(this.rmdirBase,[_e(ve),rt],ft)},Ke.prototype.fchmodBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"fchmod");ze.chmod(we)},Ke.prototype.fchmodSync=function(ve,we){this.fchmodBase(ve,yt(we))},Ke.prototype.fchmod=function(ve,we,ze){this.wrapAsync(this.fchmodBase,[ve,yt(we)],ze)},Ke.prototype.chmodBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.chmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.chmodBase(rt,ze)},Ke.prototype.chmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.chmodBase,[ft,rt],ze)},Ke.prototype.lchmodBase=function(ve,we){var ze=this.openBase(ve,Y,0,!1);try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.lchmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.lchmodBase(rt,ze)},Ke.prototype.lchmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.lchmodBase,[ft,rt],ze)},Ke.prototype.fchownBase=function(ve,we,ze){this.getFileByFdOrThrow(ve,"fchown").chown(we,ze)},Ke.prototype.fchownSync=function(ve,we,ze){dt(we),Mt(ze),this.fchownBase(ve,we,ze)},Ke.prototype.fchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.fchownBase,[ve,we,ze],rt)},Ke.prototype.chownBase=function(ve,we,ze){var rt=this.getResolvedLinkOrThrow(ve,"chown"),ft=rt.getNode();ft.chown(we,ze)},Ke.prototype.chownSync=function(ve,we,ze){dt(we),Mt(ze),this.chownBase(_e(ve),we,ze)},Ke.prototype.chown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.chownBase,[_e(ve),we,ze],rt)},Ke.prototype.lchownBase=function(ve,we,ze){this.getLinkOrThrow(ve,"lchown").getNode().chown(we,ze)},Ke.prototype.lchownSync=function(ve,we,ze){dt(we),Mt(ze),this.lchownBase(_e(ve),we,ze)},Ke.prototype.lchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.lchownBase,[_e(ve),we,ze],rt)},Ke.prototype.watchFile=function(ve,we,ze){var rt=_e(ve),ft=we,pt=ze;if(typeof ft=="function"&&(pt=we,ft=null),typeof pt!="function")throw Error('"watchFile()" requires a listener function');var xt=5007,Kt=!0;ft&&typeof ft=="object"&&(typeof ft.interval=="number"&&(xt=ft.interval),typeof ft.persistent=="boolean"&&(Kt=ft.persistent));var er=this.statWatchers[rt];return er||(er=new this.StatWatcher,er.start(rt,Kt,xt),this.statWatchers[rt]=er),er.addListener("change",pt),er},Ke.prototype.unwatchFile=function(ve,we){var ze=_e(ve),rt=this.statWatchers[ze];rt&&(typeof we=="function"?rt.removeListener("change",we):rt.removeAllListeners("change"),rt.listenerCount("change")===0&&(rt.stop(),delete this.statWatchers[ze]))},Ke.prototype.createReadStream=function(ve,we){return new this.ReadStream(ve,we)},Ke.prototype.createWriteStream=function(ve,we){return new this.WriteStream(ve,we)},Ke.prototype.watch=function(ve,we,ze){var rt=_e(ve),ft=we;typeof we=="function"&&(ze=we,ft=null);var pt=Ge(ft),xt=pt.persistent,Kt=pt.recursive,er=pt.encoding;xt===void 0&&(xt=!0),Kt===void 0&&(Kt=!1);var ci=new this.FSWatcher;return ci.start(rt,xt,Kt,er),ze&&ci.addListener("change",ze),ci},Ke.fd=2147483647,Ke}();hi.Volume=Ut;function Ft(Ke){Ke.emit("stop")}var $t=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze.onInterval=function(){try{var rt=ze.vol.statSync(ze.filename);ze.hasChanged(rt)&&(ze.emit("change",rt,ze.prev),ze.prev=rt)}finally{ze.loop()}},ze.vol=we,ze}return ve.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},ve.prototype.hasChanged=function(we){return we.mtimeMs>this.prev.mtimeMs||we.nlink!==this.prev.nlink},ve.prototype.start=function(we,ze,rt){ze===void 0&&(ze=!0),rt===void 0&&(rt=5007),this.filename=_e(we),this.setTimeout=ze?setTimeout.bind(typeof globalThis<"u"?globalThis:YBe):g.default,this.interval=rt,this.prev=this.vol.statSync(this.filename),this.loop()},ve.prototype.stop=function(){clearTimeout(this.timeoutRef),b.default.nextTick(Ft,this)},ve}(x.EventEmitter);hi.StatWatcher=$t;var Tt;function Zt(Ke){Tt=(0,c.bufferAllocUnsafe)(Ke),Tt.used=0}I.inherits(Lt,y.Readable),hi.ReadStream=Lt;function Lt(Ke,ve,we){if(!(this instanceof Lt))return new Lt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),we.highWaterMark===void 0&&(we.highWaterMark=64*1024),y.Readable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"r":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.end=we.end,this.autoClose=we.autoClose===void 0?!0:we.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Lt.prototype.open=function(){var Ke=this;this._vol.open(this.path,this.flags,this.mode,function(ve,we){if(ve){Ke.autoClose&&Ke.destroy&&Ke.destroy(),Ke.emit("error",ve);return}Ke.fd=we,Ke.emit("open",we),Ke.read()})},Lt.prototype._read=function(Ke){if(typeof this.fd!="number")return this.once("open",function(){this._read(Ke)});if(this.destroyed)return;(!Tt||Tt.length-Tt.used<v)&&Zt(this._readableState.highWaterMark);var ve=Tt,we=Math.min(Tt.length-Tt.used,Ke),ze=Tt.used;if(this.pos!==void 0&&(we=Math.min(this.end-this.pos+1,we)),we<=0)return this.push(null);var rt=this;this._vol.read(this.fd,Tt,Tt.used,we,this.pos,ft),this.pos!==void 0&&(this.pos+=we),Tt.used+=we;function ft(pt,xt){if(pt)rt.autoClose&&rt.destroy&&rt.destroy(),rt.emit("error",pt);else{var Kt=null;xt>0&&(rt.bytesRead+=xt,Kt=ve.slice(ze,ze+xt)),rt.push(Kt)}}},Lt.prototype._destroy=function(Ke,ve){this.close(function(we){ve(Ke||we)})},Lt.prototype.close=function(Ke){var ve=this;if(Ke&&this.once("close",Ke),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Ht);return}return b.default.nextTick(function(){return ve.emit("close")})}this.closed=!0,this._vol.close(this.fd,function(we){we?ve.emit("error",we):ve.emit("close")}),this.fd=null};function Ht(Ke){this.close()}I.inherits(Nt,y.Writable),hi.WriteStream=Nt;function Nt(Ke,ve,we){if(!(this instanceof Nt))return new Nt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),y.Writable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"w":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.autoClose=we.autoClose===void 0?!0:!!we.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}we.encoding&&this.setDefaultEncoding(we.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Nt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(Ke,ve){if(Ke){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",Ke);return}this.fd=ve,this.emit("open",ve)}.bind(this))},Nt.prototype._write=function(Ke,ve,we){if(!(Ke instanceof c.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(Ke,ve,we)});var ze=this;this._vol.write(this.fd,Ke,0,Ke.length,this.pos,function(rt,ft){if(rt)return ze.autoClose&&ze.destroy&&ze.destroy(),we(rt);ze.bytesWritten+=ft,we()}),this.pos!==void 0&&(this.pos+=Ke.length)},Nt.prototype._writev=function(Ke,ve){if(typeof this.fd!="number")return this.once("open",function(){this._writev(Ke,ve)});for(var we=this,ze=Ke.length,rt=new Array(ze),ft=0,pt=0;pt<ze;pt++){var xt=Ke[pt].chunk;rt[pt]=xt,ft+=xt.length}var Kt=c.Buffer.concat(rt);this._vol.write(this.fd,Kt,0,Kt.length,this.pos,function(er,ci){if(er)return we.destroy&&we.destroy(),ve(er);we.bytesWritten+=ci,ve()}),this.pos!==void 0&&(this.pos+=ft)},Nt.prototype._destroy=Lt.prototype._destroy,Nt.prototype.close=Lt.prototype.close,Nt.prototype.destroySoon=Nt.prototype.end;var zt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze._filename="",ze._filenameEncoded="",ze._recursive=!1,ze._encoding=E.ENCODING_UTF8,ze._onNodeChange=function(){ze._emit("change")},ze._onParentChild=function(rt){rt.getName()===ze._getName()&&ze._emit("rename")},ze._emit=function(rt){ze.emit("change",rt,ze._filenameEncoded)},ze._persist=function(){ze._timer=setTimeout(ze._persist,1e6)},ze._vol=we,ze}return ve.prototype._getName=function(){return this._steps[this._steps.length-1]},ve.prototype.start=function(we,ze,rt,ft){ze===void 0&&(ze=!0),rt===void 0&&(rt=!1),ft===void 0&&(ft=E.ENCODING_UTF8),this._filename=_e(we),this._steps=et(this._filename),this._filenameEncoded=(0,E.strToEncoding)(this._filename),this._recursive=rt,this._encoding=ft;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Kt){var pt=new Error("watch "+this._filename+" "+Kt.code);throw pt.code=Kt.code,pt.errno=Kt.code,pt}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var xt=this._link.parent;xt&&(xt.setMaxListeners(xt.getMaxListeners()+1),xt.on("child:delete",this._onParentChild)),ze&&this._persist()},ve.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var we=this._link.parent;we&&we.removeListener("child:delete",this._onParentChild)},ve}(x.EventEmitter);return hi.FSWatcher=zt,hi}function JBe(){if(zae)return Yh;zae=!0,Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.fsAsyncMethods=Yh.fsSyncMethods=Yh.fsProps=void 0;var t=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];Yh.fsProps=t;var e=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];Yh.fsSyncMethods=e;var r=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];return Yh.fsAsyncMethods=r,Yh}function XBe(){if(Zae)return na;Zae=!0;var t=na&&na.__assign||function(){return t=Object.assign||function(E){for(var A,I=1,P=arguments.length;I<P;I++){A=arguments[I];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])}return E},t.apply(this,arguments)};Object.defineProperty(na,"__esModule",{value:!0}),na.fs=na.createFsFromVolume=na.vol=na.Volume=void 0;var e=lB(),r=Wae(),a=Yae(),i=JBe(),h=i.fsSyncMethods,c=i.fsAsyncMethods,p=hb(),b=p.constants.F_OK,g=p.constants.R_OK,y=p.constants.W_OK,M=p.constants.X_OK;na.Volume=a.Volume,na.vol=new a.Volume;function x(E){for(var A={F_OK:b,R_OK:g,W_OK:y,X_OK:M,constants:p.constants,Stats:e.default,Dirent:r.default},I=0,P=h;I<P.length;I++){var N=P[I];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}for(var L=0,C=c;L<C.length;L++){var N=C[L];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}return A.StatWatcher=E.StatWatcher,A.FSWatcher=E.FSWatcher,A.WriteStream=E.WriteStream,A.ReadStream=E.ReadStream,A.promises=E.promises,A._toUnixTimestamp=a.toUnixTimestamp,A}return na.createFsFromVolume=x,na.fs=x(na.vol),na=t(t({},na),na.fs),na.semantic=!0,na}function $o(t){throw new Error(`Node.js fs ${t} is not supported by JSPM core in the browser`)}function Jae(t,e,r){let a=0,i=new TextDecoder;Jh.watch(t,"utf8",()=>{let{size:h}=Jh.fstatSync(e),c=Me.alloc(h-a);Jh.readSync(e,c,0,c.length,a),a=h,r(i.decode(c,{stream:!0}))})}function pB(t,e){if(t.protocol==="file:")return cB(t);if(t.protocol==="https:"||t.protocol==="http:"){let r="\\\\url\\"+t.href.replaceAll(/\//g,"\\\\");if(Xae(r))return r;if(e)throw new Error(`Cannot sync request URL ${t} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let a=await fetch(t);if(!a.ok)throw new Error(`Unable to fetch ${t.href}, ${a.status}`);let i=await a.arrayBuffer();return Qae(r,Me.from(i)),r})()}throw new Error("URL "+t+" not supported in JSPM FS implementation.")}function ePe(t){return function(e,...r){return e instanceof URL?t(pB(e,!0),...r):t(e,...r)}}function tPe(t){return async function(e,...r){return e instanceof URL?t(await pB(e),...r):t(e,...r)}}function rPe(t){return function(e,...r){let a=r[r.length-1];e instanceof URL&&typeof a=="function"?pB(e).then(i=>{t(i,...r)},a):t(e,...r)}}var fb,Tae,nw,Iae,nv,kae,Uf,Bae,Fn,Pae,ZBe,Zu,Oae,av,Nae,aw,Cae,Lae,ov,Dae,ho,$ae,ow,qae,KBe,kl,Uae,ub,Fae,hi,jae,YBe,Yh,zae,na,Zae,qd,ja,Jh,QBe,Yi,iPe,nPe,aPe,oPe,sPe,fPe,uPe,hPe,cPe,lPe,dPe,pPe,vPe,mPe,gPe,bPe,yPe,Xae,wPe,_Pe,MPe,xPe,SPe,EPe,APe,RPe,TPe,IPe,kPe,BPe,PPe,OPe,NPe,CPe,LPe,DPe,$Pe,qPe,UPe,FPe,jPe,zPe,ZPe,HPe,KPe,WPe,VPe,GPe,YPe,JPe,XPe,QPe,eOe,tOe,rOe,iOe,nOe,aOe,oOe,sOe,fOe,uOe,hOe,cOe,lOe,dOe,pOe,vOe,mOe,gOe,bOe,yOe,wOe,_Oe,MOe,xOe,SOe,EOe,AOe,ROe,Qae,TOe,IOe,kOe,BOe,POe,OOe,NOe,COe,LOe,DOe,$Oe,qOe,UOe,FOe,jOe,zOe,ZOe,HOe,mB=xi(()=>{"use strict";ie();ae();ne();ah();tB();ao();zo();iB();Ks();Z0();Hs();k8();iw();Dd();Tg();lo();th();Fo();Gf();nb();ob();fb={},Tae=!1;nw={},Iae=!1;nv={},kae=!1;Uf={},Bae=!1;Fn={},Pae=!1,ZBe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Zu={},Oae=!1;av={},Nae=!1;aw={},Cae=!1,Lae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ov={},Dae=!1;ho={},$ae=!1;ow={},qae=!1,KBe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;kl={},Uae=!1;ub={},Fae=!1;hi={},jae=!1,YBe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yh={},zae=!1;na={},Zae=!1;qd=XBe();qd.__esModule;qd.fs;qd.createFsFromVolume;qd.vol;qd.Volume;qd.semantic;ja=Yae();ja.__esModule;ja.FSWatcher;ja.StatWatcher;ja.Volume;ja.toUnixTimestamp;ja.bufferToEncoding;ja.dataToBuffer;ja.dataToStr;ja.pathToSteps;ja.filenameToSteps;ja.pathToFilename;ja.flagsToNumber;ja.FLAGS;ja.ReadStream;ja.WriteStream;({vol:Jh,createFsFromVolume:QBe}=qd);Jh.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Jh.releasedFds=[2,1,0];Jh.openSync("/dev/stdin","w");Jh.openSync("/dev/stdout","r");Jh.openSync("/dev/stderr","r");Jae("/dev/stdout",1,console.log);Jae("/dev/stderr",2,console.error);Yi=QBe(Jh);Yi.opendir=()=>$o("opendir");Yi.opendirSync=()=>$o("opendirSync");Yi.promises.opendir=()=>$o("promises.opendir");Yi.cp=()=>$o("cp");Yi.cpSync=()=>$o("cpSync");Yi.promises.cp=()=>$o("promises.cp");Yi.readv=()=>$o("readv");Yi.readvSync=()=>$o("readvSync");Yi.rm=()=>$o("rm");Yi.rmSync=()=>$o("rmSync");Yi.promises.rm=()=>$o("promises.rm");Yi.Dir=()=>$o("Dir");Yi.promises.watch=()=>$o("promises.watch");Yi.FileReadStream=Yi.ReadStream;Yi.FileWriteStream=Yi.WriteStream;Yi.promises.readFile=tPe(Yi.promises.readFile);Yi.readFile=rPe(Yi.readFile);Yi.readFileSync=ePe(Yi.readFileSync);({appendFile:iPe,appendFileSync:nPe,access:aPe,accessSync:oPe,chown:sPe,chownSync:fPe,chmod:uPe,chmodSync:hPe,close:cPe,closeSync:lPe,copyFile:dPe,copyFileSync:pPe,cp:vPe,cpSync:mPe,createReadStream:gPe,createWriteStream:bPe,exists:yPe,existsSync:Xae,fchown:wPe,fchownSync:_Pe,fchmod:MPe,fchmodSync:xPe,fdatasync:SPe,fdatasyncSync:EPe,fstat:APe,fstatSync:RPe,fsync:TPe,fsyncSync:IPe,ftruncate:kPe,ftruncateSync:BPe,futimes:PPe,futimesSync:OPe,lchown:NPe,lchownSync:CPe,lchmod:LPe,lchmodSync:DPe,link:$Pe,linkSync:qPe,lstat:UPe,lstatSync:FPe,mkdir:jPe,mkdirSync:zPe,mkdtemp:ZPe,mkdtempSync:HPe,open:KPe,openSync:WPe,opendir:VPe,opendirSync:GPe,readdir:YPe,readdirSync:JPe,read:XPe,readSync:QPe,readv:eOe,readvSync:tOe,readFile:rOe,readFileSync:iOe,readlink:nOe,readlinkSync:aOe,realpath:oOe,realpathSync:sOe,rename:fOe,renameSync:uOe,rm:hOe,rmSync:cOe,rmdir:lOe,rmdirSync:dOe,stat:pOe,statSync:vOe,symlink:mOe,symlinkSync:gOe,truncate:bOe,truncateSync:yOe,unwatchFile:wOe,unlink:_Oe,unlinkSync:MOe,utimes:xOe,utimesSync:SOe,watch:EOe,watchFile:AOe,writeFile:ROe,writeFileSync:Qae,write:TOe,writeSync:IOe,writev:kOe,writevSync:BOe,Dir:POe,Dirent:OOe,Stats:NOe,ReadStream:COe,WriteStream:LOe,FileReadStream:DOe,FileWriteStream:$Oe,_toUnixTimestamp:qOe,constants:{F_OK:UOe,R_OK:FOe,W_OK:jOe,X_OK:zOe},constants:ZOe,promises:HOe}=Yi)});var fw=ht((sw,eoe)=>{"use strict";ie();ae();ne();Object.defineProperty(sw,"__esModule",{value:!0});sw.default=KOe;function KOe(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}eoe.exports=sw.default});var roe=ht((uw,toe)=>{"use strict";ie();ae();ne();Object.defineProperty(uw,"__esModule",{value:!0});uw.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};toe.exports=uw.default});var aoe=ht(Bl=>{"use strict";ie();ae();ne();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.fallback=ioe;Bl.wrap=noe;var WOe=Bl.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,VOe=Bl.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,GOe=Bl.hasNextTick=typeof He=="object"&&typeof He.nextTick=="function";function ioe(t){setTimeout(t,0)}function noe(t){return(e,...r)=>t(()=>e(...r))}var cb;WOe?cb=queueMicrotask:VOe?cb=setImmediate:GOe?cb=He.nextTick:cb=ioe;Bl.default=noe(cb)});var hoe=ht((hw,uoe)=>{"use strict";ie();ae();ne();Object.defineProperty(hw,"__esModule",{value:!0});hw.default=tNe;var YOe=roe(),JOe=foe(YOe),XOe=aoe(),QOe=foe(XOe),eNe=Ud();function foe(t){return t&&t.__esModule?t:{default:t}}function tNe(t){return(0,eNe.isAsync)(t)?function(...e){let r=e.pop(),a=t.apply(this,e);return ooe(a,r)}:(0,JOe.default)(function(e,r){var a;try{a=t.apply(this,e)}catch(i){return r(i)}if(a&&typeof a.then=="function")return ooe(a,r);r(null,a)})}function ooe(t,e){return t.then(r=>{soe(e,null,r)},r=>{soe(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function soe(t,e,r){try{t(e,r)}catch(a){(0,QOe.default)(i=>{throw i},a)}}uoe.exports=hw.default});var Ud=ht(Xh=>{"use strict";ie();ae();ne();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.isAsyncIterable=Xh.isAsyncGenerator=Xh.isAsync=void 0;var rNe=hoe(),iNe=nNe(rNe);function nNe(t){return t&&t.__esModule?t:{default:t}}function coe(t){return t[Symbol.toStringTag]==="AsyncFunction"}function aNe(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function oNe(t){return typeof t[Symbol.asyncIterator]=="function"}function sNe(t){if(typeof t!="function")throw new Error("expected a function");return coe(t)?(0,iNe.default)(t):t}Xh.default=sNe;Xh.isAsync=coe;Xh.isAsyncGenerator=aNe;Xh.isAsyncIterable=oNe});var sv=ht((cw,loe)=>{"use strict";ie();ae();ne();Object.defineProperty(cw,"__esModule",{value:!0});cw.default=fNe;function fNe(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...a){return typeof a[e-1]=="function"?t.apply(this,a):new Promise((i,h)=>{a[e-1]=(c,...p)=>{if(c)return h(c);i(p.length>1?p:p[0])},t.apply(this,a)})}return r}loe.exports=cw.default});var poe=ht((lw,doe)=>{"use strict";ie();ae();ne();Object.defineProperty(lw,"__esModule",{value:!0});var uNe=fw(),hNe=gB(uNe),cNe=Ud(),lNe=gB(cNe),dNe=sv(),pNe=gB(dNe);function gB(t){return t&&t.__esModule?t:{default:t}}lw.default=(0,pNe.default)((t,e,r)=>{var a=(0,hNe.default)(e)?[]:{};t(e,(i,h,c)=>{(0,lNe.default)(i)((p,...b)=>{b.length<2&&([b]=b),a[h]=b,c(p)})},i=>r(i,a))},3);doe.exports=lw.default});var bB=ht((dw,voe)=>{"use strict";ie();ae();ne();Object.defineProperty(dw,"__esModule",{value:!0});dw.default=vNe;function vNe(t){function e(...r){if(t!==null){var a=t;t=null,a.apply(this,r)}}return Object.assign(e,t),e}voe.exports=dw.default});var goe=ht((pw,moe)=>{"use strict";ie();ae();ne();Object.defineProperty(pw,"__esModule",{value:!0});pw.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};moe.exports=pw.default});var woe=ht((vw,yoe)=>{"use strict";ie();ae();ne();Object.defineProperty(vw,"__esModule",{value:!0});vw.default=xNe;var mNe=fw(),gNe=boe(mNe),bNe=goe(),yNe=boe(bNe);function boe(t){return t&&t.__esModule?t:{default:t}}function wNe(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function _Ne(t){var e=-1;return function(){var a=t.next();return a.done?null:(e++,{value:a.value,key:e})}}function MNe(t){var e=t?Object.keys(t):[],r=-1,a=e.length;return function i(){var h=e[++r];return h==="__proto__"?i():r<a?{value:t[h],key:h}:null}}function xNe(t){if((0,gNe.default)(t))return wNe(t);var e=(0,yNe.default)(t);return e?_Ne(e):MNe(t)}yoe.exports=vw.default});var yB=ht((mw,_oe)=>{"use strict";ie();ae();ne();Object.defineProperty(mw,"__esModule",{value:!0});mw.default=SNe;function SNe(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}_oe.exports=mw.default});var bw=ht((gw,Moe)=>{"use strict";ie();ae();ne();Object.defineProperty(gw,"__esModule",{value:!0});var ENe={};gw.default=ENe;Moe.exports=gw.default});var Soe=ht((yw,xoe)=>{"use strict";ie();ae();ne();Object.defineProperty(yw,"__esModule",{value:!0});yw.default=INe;var ANe=bw(),RNe=TNe(ANe);function TNe(t){return t&&t.__esModule?t:{default:t}}function INe(t,e,r,a){let i=!1,h=!1,c=!1,p=0,b=0;function g(){p>=e||c||i||(c=!0,t.next().then(({value:x,done:E})=>{if(!(h||i)){if(c=!1,E){i=!0,p<=0&&a(null);return}p++,r(x,b,y),b++,g()}}).catch(M))}function y(x,E){if(p-=1,!h){if(x)return M(x);if(x===!1){i=!0,h=!0;return}if(E===RNe.default||i&&p<=0)return i=!0,a(null);g()}}function M(x){h||(c=!1,i=!0,a(x))}g()}xoe.exports=yw.default});var Toe=ht((ww,Roe)=>{"use strict";ie();ae();ne();Object.defineProperty(ww,"__esModule",{value:!0});var kNe=bB(),BNe=lb(kNe),PNe=woe(),ONe=lb(PNe),NNe=yB(),CNe=lb(NNe),Eoe=Ud(),LNe=Soe(),Aoe=lb(LNe),DNe=bw(),$Ne=lb(DNe);function lb(t){return t&&t.__esModule?t:{default:t}}ww.default=t=>(e,r,a)=>{if(a=(0,BNe.default)(a),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return a(null);if((0,Eoe.isAsyncGenerator)(e))return(0,Aoe.default)(e,t,r,a);if((0,Eoe.isAsyncIterable)(e))return(0,Aoe.default)(e[Symbol.asyncIterator](),t,r,a);var i=(0,ONe.default)(e),h=!1,c=!1,p=0,b=!1;function g(M,x){if(!c)if(p-=1,M)h=!0,a(M);else if(M===!1)h=!0,c=!0;else{if(x===$Ne.default||h&&p<=0)return h=!0,a(null);b||y()}}function y(){for(b=!0;p<t&&!h;){var M=i();if(M===null){h=!0,p<=0&&a(null);return}p+=1,r(M.value,M.key,(0,CNe.default)(g))}b=!1}y()};Roe.exports=ww.default});var _B=ht((_w,Ioe)=>{"use strict";ie();ae();ne();Object.defineProperty(_w,"__esModule",{value:!0});var qNe=Toe(),UNe=wB(qNe),FNe=Ud(),jNe=wB(FNe),zNe=sv(),ZNe=wB(zNe);function wB(t){return t&&t.__esModule?t:{default:t}}function HNe(t,e,r,a){return(0,UNe.default)(e)(t,(0,jNe.default)(r),a)}_w.default=(0,ZNe.default)(HNe,4);Ioe.exports=_w.default});var Poe=ht((Mw,Boe)=>{"use strict";ie();ae();ne();Object.defineProperty(Mw,"__esModule",{value:!0});var KNe=_B(),WNe=koe(KNe),VNe=sv(),GNe=koe(VNe);function koe(t){return t&&t.__esModule?t:{default:t}}function YNe(t,e,r){return(0,WNe.default)(t,1,e,r)}Mw.default=(0,GNe.default)(YNe,3);Boe.exports=Mw.default});var Coe=ht((xw,Noe)=>{"use strict";ie();ae();ne();Object.defineProperty(xw,"__esModule",{value:!0});xw.default=tCe;var JNe=poe(),XNe=Ooe(JNe),QNe=Poe(),eCe=Ooe(QNe);function Ooe(t){return t&&t.__esModule?t:{default:t}}function tCe(t,e){return(0,XNe.default)(eCe.default,t,e)}Noe.exports=xw.default});var Joe={};Ka(Joe,{Deflate:()=>lCe,DeflateRaw:()=>dCe,Gunzip:()=>pCe,Gzip:()=>vCe,Inflate:()=>mCe,InflateRaw:()=>gCe,Unzip:()=>bCe,Z_BEST_COMPRESSION:()=>yCe,Z_BEST_SPEED:()=>wCe,Z_BINARY:()=>_Ce,Z_BLOCK:()=>MCe,Z_BUF_ERROR:()=>xCe,Z_DATA_ERROR:()=>SCe,Z_DEFAULT_CHUNK:()=>ECe,Z_DEFAULT_COMPRESSION:()=>ACe,Z_DEFAULT_LEVEL:()=>RCe,Z_DEFAULT_MEMLEVEL:()=>TCe,Z_DEFAULT_STRATEGY:()=>ICe,Z_DEFAULT_WINDOWBITS:()=>kCe,Z_DEFLATED:()=>BCe,Z_ERRNO:()=>PCe,Z_FILTERED:()=>OCe,Z_FINISH:()=>NCe,Z_FIXED:()=>CCe,Z_FULL_FLUSH:()=>LCe,Z_HUFFMAN_ONLY:()=>DCe,Z_MAX_CHUNK:()=>$Ce,Z_MAX_LEVEL:()=>qCe,Z_MAX_MEMLEVEL:()=>UCe,Z_MAX_WINDOWBITS:()=>FCe,Z_MIN_CHUNK:()=>jCe,Z_MIN_LEVEL:()=>zCe,Z_MIN_MEMLEVEL:()=>ZCe,Z_MIN_WINDOWBITS:()=>HCe,Z_NEED_DICT:()=>KCe,Z_NO_COMPRESSION:()=>WCe,Z_NO_FLUSH:()=>VCe,Z_OK:()=>GCe,Z_PARTIAL_FLUSH:()=>YCe,Z_RLE:()=>JCe,Z_STREAM_END:()=>XCe,Z_STREAM_ERROR:()=>QCe,Z_SYNC_FLUSH:()=>eLe,Z_TEXT:()=>tLe,Z_TREES:()=>rLe,Z_UNKNOWN:()=>iLe,Zlib:()=>nLe,codes:()=>aLe,createDeflate:()=>oLe,createDeflateRaw:()=>sLe,createGunzip:()=>fLe,createGzip:()=>uLe,createInflate:()=>hLe,createInflateRaw:()=>cLe,createUnzip:()=>lLe,default:()=>At,deflate:()=>dLe,deflateRaw:()=>pLe,deflateRawSync:()=>vLe,deflateSync:()=>mLe,gunzip:()=>gLe,gunzipSync:()=>bLe,gzip:()=>yLe,gzipSync:()=>wLe,inflate:()=>_Le,inflateRaw:()=>MLe,inflateRawSync:()=>xLe,inflateSync:()=>SLe,unzip:()=>ELe,unzipSync:()=>ALe});function rCe(){if(Loe)return MB;Loe=!0;function t(){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}return MB=t,MB}function Sw(){if(Doe)return Ba;Doe=!0;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,h){return Object.prototype.hasOwnProperty.call(i,h)}Ba.assign=function(i){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var c=h.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var p in c)e(c,p)&&(i[p]=c[p])}}return i},Ba.shrinkBuf=function(i,h){return i.length===h?i:i.subarray?i.subarray(0,h):(i.length=h,i)};var r={arraySet:function(i,h,c,p,b){if(h.subarray&&i.subarray){i.set(h.subarray(c,c+p),b);return}for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){var h,c,p,b,g,y;for(p=0,h=0,c=i.length;h<c;h++)p+=i[h].length;for(y=new Uint8Array(p),b=0,h=0,c=i.length;h<c;h++)g=i[h],y.set(g,b),b+=g.length;return y}},a={arraySet:function(i,h,c,p,b){for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){return[].concat.apply([],i)}};return Ba.setTyped=function(i){i?(Ba.Buf8=Uint8Array,Ba.Buf16=Uint16Array,Ba.Buf32=Int32Array,Ba.assign(Ba,r)):(Ba.Buf8=Array,Ba.Buf16=Array,Ba.Buf32=Array,Ba.assign(Ba,a))},Ba.setTyped(t),Ba}function iCe(){if($oe)return Fd;$oe=!0;var t=Sw(),e=4,r=0,a=1,i=2;function h(H){for(var W=H.length;--W>=0;)H[W]=0}var c=0,p=1,b=2,g=3,y=258,M=29,x=256,E=x+1+M,A=30,I=19,P=2*E+1,N=15,L=16,C=7,Y=256,G=16,ee=17,D=18,U=[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],V=[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],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=512,f=new Array((E+2)*2);h(f);var u=new Array(A*2);h(u);var l=new Array(s);h(l);var m=new Array(y-g+1);h(m);var w=new Array(M);h(w);var d=new Array(A);h(d);function o(H,W,fe,st,ue){this.static_tree=H,this.extra_bits=W,this.extra_base=fe,this.elems=st,this.max_length=ue,this.has_stree=H&&H.length}var v,R,S;function B(H,W){this.dyn_tree=H,this.max_code=0,this.stat_desc=W}function F(H){return H<256?l[H]:l[256+(H>>>7)]}function $(H,W){H.pending_buf[H.pending++]=W&255,H.pending_buf[H.pending++]=W>>>8&255}function re(H,W,fe){H.bi_valid>L-fe?(H.bi_buf|=W<<H.bi_valid&65535,$(H,H.bi_buf),H.bi_buf=W>>L-H.bi_valid,H.bi_valid+=fe-L):(H.bi_buf|=W<<H.bi_valid&65535,H.bi_valid+=fe)}function Q(H,W,fe){re(H,fe[W*2],fe[W*2+1])}function Z(H,W){var fe=0;do fe|=H&1,H>>>=1,fe<<=1;while(--W>0);return fe>>>1}function K(H){H.bi_valid===16?($(H,H.bi_buf),H.bi_buf=0,H.bi_valid=0):H.bi_valid>=8&&(H.pending_buf[H.pending++]=H.bi_buf&255,H.bi_buf>>=8,H.bi_valid-=8)}function ce(H,W){var fe=W.dyn_tree,st=W.max_code,ue=W.stat_desc.static_tree,me=W.stat_desc.has_stree,pe=W.stat_desc.extra_bits,be=W.stat_desc.extra_base,Qe=W.stat_desc.max_length,se,ye,Ee,Fe,de,xe,lt=0;for(Fe=0;Fe<=N;Fe++)H.bl_count[Fe]=0;for(fe[H.heap[H.heap_max]*2+1]=0,se=H.heap_max+1;se<P;se++)ye=H.heap[se],Fe=fe[fe[ye*2+1]*2+1]+1,Fe>Qe&&(Fe=Qe,lt++),fe[ye*2+1]=Fe,!(ye>st)&&(H.bl_count[Fe]++,de=0,ye>=be&&(de=pe[ye-be]),xe=fe[ye*2],H.opt_len+=xe*(Fe+de),me&&(H.static_len+=xe*(ue[ye*2+1]+de)));if(lt!==0){do{for(Fe=Qe-1;H.bl_count[Fe]===0;)Fe--;H.bl_count[Fe]--,H.bl_count[Fe+1]+=2,H.bl_count[Qe]--,lt-=2}while(lt>0);for(Fe=Qe;Fe!==0;Fe--)for(ye=H.bl_count[Fe];ye!==0;)Ee=H.heap[--se],!(Ee>st)&&(fe[Ee*2+1]!==Fe&&(H.opt_len+=(Fe-fe[Ee*2+1])*fe[Ee*2],fe[Ee*2+1]=Fe),ye--)}}function te(H,W,fe){var st=new Array(N+1),ue=0,me,pe;for(me=1;me<=N;me++)st[me]=ue=ue+fe[me-1]<<1;for(pe=0;pe<=W;pe++){var be=H[pe*2+1];be!==0&&(H[pe*2]=Z(st[be]++,be))}}function j(){var H,W,fe,st,ue,me=new Array(N+1);for(fe=0,st=0;st<M-1;st++)for(w[st]=fe,H=0;H<1<<U[st];H++)m[fe++]=st;for(m[fe-1]=st,ue=0,st=0;st<16;st++)for(d[st]=ue,H=0;H<1<<V[st];H++)l[ue++]=st;for(ue>>=7;st<A;st++)for(d[st]=ue<<7,H=0;H<1<<V[st]-7;H++)l[256+ue++]=st;for(W=0;W<=N;W++)me[W]=0;for(H=0;H<=143;)f[H*2+1]=8,H++,me[8]++;for(;H<=255;)f[H*2+1]=9,H++,me[9]++;for(;H<=279;)f[H*2+1]=7,H++,me[7]++;for(;H<=287;)f[H*2+1]=8,H++,me[8]++;for(te(f,E+1,me),H=0;H<A;H++)u[H*2+1]=5,u[H*2]=Z(H,5);v=new o(f,U,x+1,E,N),R=new o(u,V,0,A,N),S=new o(new Array(0),_,0,I,C)}function J(H){var W;for(W=0;W<E;W++)H.dyn_ltree[W*2]=0;for(W=0;W<A;W++)H.dyn_dtree[W*2]=0;for(W=0;W<I;W++)H.bl_tree[W*2]=0;H.dyn_ltree[Y*2]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function X(H){H.bi_valid>8?$(H,H.bi_buf):H.bi_valid>0&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function he(H,W,fe,st){X(H),st&&($(H,fe),$(H,~fe)),t.arraySet(H.pending_buf,H.window,W,fe,H.pending),H.pending+=fe}function Te(H,W,fe,st){var ue=W*2,me=fe*2;return H[ue]<H[me]||H[ue]===H[me]&&st[W]<=st[fe]}function oe(H,W,fe){for(var st=H.heap[fe],ue=fe<<1;ue<=H.heap_len&&(ue<H.heap_len&&Te(W,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Te(W,st,H.heap[ue],H.depth));)H.heap[fe]=H.heap[ue],fe=ue,ue<<=1;H.heap[fe]=st}function le(H,W,fe){var st,ue,me=0,pe,be;if(H.last_lit!==0)do st=H.pending_buf[H.d_buf+me*2]<<8|H.pending_buf[H.d_buf+me*2+1],ue=H.pending_buf[H.l_buf+me],me++,st===0?Q(H,ue,W):(pe=m[ue],Q(H,pe+x+1,W),be=U[pe],be!==0&&(ue-=w[pe],re(H,ue,be)),st--,pe=F(st),Q(H,pe,fe),be=V[pe],be!==0&&(st-=d[pe],re(H,st,be)));while(me<H.last_lit);Q(H,Y,W)}function ot(H,W){var fe=W.dyn_tree,st=W.stat_desc.static_tree,ue=W.stat_desc.has_stree,me=W.stat_desc.elems,pe,be,Qe=-1,se;for(H.heap_len=0,H.heap_max=P,pe=0;pe<me;pe++)fe[pe*2]!==0?(H.heap[++H.heap_len]=Qe=pe,H.depth[pe]=0):fe[pe*2+1]=0;for(;H.heap_len<2;)se=H.heap[++H.heap_len]=Qe<2?++Qe:0,fe[se*2]=1,H.depth[se]=0,H.opt_len--,ue&&(H.static_len-=st[se*2+1]);for(W.max_code=Qe,pe=H.heap_len>>1;pe>=1;pe--)oe(H,fe,pe);se=me;do pe=H.heap[1],H.heap[1]=H.heap[H.heap_len--],oe(H,fe,1),be=H.heap[1],H.heap[--H.heap_max]=pe,H.heap[--H.heap_max]=be,fe[se*2]=fe[pe*2]+fe[be*2],H.depth[se]=(H.depth[pe]>=H.depth[be]?H.depth[pe]:H.depth[be])+1,fe[pe*2+1]=fe[be*2+1]=se,H.heap[1]=se++,oe(H,fe,1);while(H.heap_len>=2);H.heap[--H.heap_max]=H.heap[1],ce(H,W),te(fe,Qe,H.bl_count)}function ge(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),W[(fe+1)*2+1]=65535,st=0;st<=fe;st++)me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)&&(be<se?H.bl_tree[me*2]+=be:me!==0?(me!==ue&&H.bl_tree[me*2]++,H.bl_tree[G*2]++):be<=10?H.bl_tree[ee*2]++:H.bl_tree[D*2]++,be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4))}function Se(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),st=0;st<=fe;st++)if(me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)){if(be<se)do Q(H,me,H.bl_tree);while(--be!==0);else me!==0?(me!==ue&&(Q(H,me,H.bl_tree),be--),Q(H,G,H.bl_tree),re(H,be-3,2)):be<=10?(Q(H,ee,H.bl_tree),re(H,be-3,3)):(Q(H,D,H.bl_tree),re(H,be-11,7));be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4)}}function ut(H){var W;for(ge(H,H.dyn_ltree,H.l_desc.max_code),ge(H,H.dyn_dtree,H.d_desc.max_code),ot(H,H.bl_desc),W=I-1;W>=3&&H.bl_tree[n[W]*2+1]===0;W--);return H.opt_len+=3*(W+1)+5+5+4,W}function Ze(H,W,fe,st){var ue;for(re(H,W-257,5),re(H,fe-1,5),re(H,st-4,4),ue=0;ue<st;ue++)re(H,H.bl_tree[n[ue]*2+1],3);Se(H,H.dyn_ltree,W-1),Se(H,H.dyn_dtree,fe-1)}function Ge(H){var W=4093624447,fe;for(fe=0;fe<=31;fe++,W>>>=1)if(W&1&&H.dyn_ltree[fe*2]!==0)return r;if(H.dyn_ltree[9*2]!==0||H.dyn_ltree[10*2]!==0||H.dyn_ltree[13*2]!==0)return a;for(fe=32;fe<x;fe++)if(H.dyn_ltree[fe*2]!==0)return a;return r}var ct=!1;function z(H){ct||(j(),ct=!0),H.l_desc=new B(H.dyn_ltree,v),H.d_desc=new B(H.dyn_dtree,R),H.bl_desc=new B(H.bl_tree,S),H.bi_buf=0,H.bi_valid=0,J(H)}function T(H,W,fe,st){re(H,(c<<1)+(st?1:0),3),he(H,W,fe,!0)}function k(H){re(H,p<<1,3),Q(H,Y,f),K(H)}function O(H,W,fe,st){var ue,me,pe=0;H.level>0?(H.strm.data_type===i&&(H.strm.data_type=Ge(H)),ot(H,H.l_desc),ot(H,H.d_desc),pe=ut(H),ue=H.opt_len+3+7>>>3,me=H.static_len+3+7>>>3,me<=ue&&(ue=me)):ue=me=fe+5,fe+4<=ue&&W!==-1?T(H,W,fe,st):H.strategy===e||me===ue?(re(H,(p<<1)+(st?1:0),3),le(H,f,u)):(re(H,(b<<1)+(st?1:0),3),Ze(H,H.l_desc.max_code+1,H.d_desc.max_code+1,pe+1),le(H,H.dyn_ltree,H.dyn_dtree)),J(H),st&&X(H)}function q(H,W,fe){return H.pending_buf[H.d_buf+H.last_lit*2]=W>>>8&255,H.pending_buf[H.d_buf+H.last_lit*2+1]=W&255,H.pending_buf[H.l_buf+H.last_lit]=fe&255,H.last_lit++,W===0?H.dyn_ltree[fe*2]++:(H.matches++,W--,H.dyn_ltree[(m[fe]+x+1)*2]++,H.dyn_dtree[F(W)*2]++),H.last_lit===H.lit_bufsize-1}return Fd._tr_init=z,Fd._tr_stored_block=T,Fd._tr_flush_block=O,Fd._tr_tally=q,Fd._tr_align=k,Fd}function Goe(){if(qoe)return xB;qoe=!0;function t(e,r,a,i){for(var h=e&65535|0,c=e>>>16&65535|0,p=0;a!==0;){p=a>2e3?2e3:a,a-=p;do h=h+r[i++]|0,c=c+h|0;while(--p);h%=65521,c%=65521}return h|c<<16|0}return xB=t,xB}function Yoe(){if(Uoe)return SB;Uoe=!0;function t(){for(var a,i=[],h=0;h<256;h++){a=h;for(var c=0;c<8;c++)a=a&1?3988292384^a>>>1:a>>>1;i[h]=a}return i}var e=t();function r(a,i,h,c){var p=e,b=c+h;a^=-1;for(var g=c;g<b;g++)a=a>>>8^p[(a^i[g])&255];return a^-1}return SB=r,SB}function nCe(){return Foe||(Foe=!0,EB={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"}),EB}function aCe(){if(joe)return Ff;joe=!0;var t=Sw(),e=iCe(),r=Goe(),a=Yoe(),i=nCe(),h=0,c=1,p=3,b=4,g=5,y=0,M=1,x=-2,E=-3,A=-5,I=-1,P=1,N=2,L=3,C=4,Y=0,G=2,ee=8,D=9,U=15,V=8,_=29,n=256,s=n+1+_,f=30,u=19,l=2*s+1,m=15,w=3,d=258,o=d+w+1,v=32,R=42,S=69,B=73,F=91,$=103,re=113,Q=666,Z=1,K=2,ce=3,te=4,j=3;function J(se,ye){return se.msg=i[ye],ye}function X(se){return(se<<1)-(se>4?9:0)}function he(se){for(var ye=se.length;--ye>=0;)se[ye]=0}function Te(se){var ye=se.state,Ee=ye.pending;Ee>se.avail_out&&(Ee=se.avail_out),Ee!==0&&(t.arraySet(se.output,ye.pending_buf,ye.pending_out,Ee,se.next_out),se.next_out+=Ee,ye.pending_out+=Ee,se.total_out+=Ee,se.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function oe(se,ye){e._tr_flush_block(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ye),se.block_start=se.strstart,Te(se.strm)}function le(se,ye){se.pending_buf[se.pending++]=ye}function ot(se,ye){se.pending_buf[se.pending++]=ye>>>8&255,se.pending_buf[se.pending++]=ye&255}function ge(se,ye,Ee,Fe){var de=se.avail_in;return de>Fe&&(de=Fe),de===0?0:(se.avail_in-=de,t.arraySet(ye,se.input,se.next_in,de,Ee),se.state.wrap===1?se.adler=r(se.adler,ye,de,Ee):se.state.wrap===2&&(se.adler=a(se.adler,ye,de,Ee)),se.next_in+=de,se.total_in+=de,de)}function Se(se,ye){var Ee=se.max_chain_length,Fe=se.strstart,de,xe,lt=se.prev_length,_e=se.nice_match,Ve=se.strstart>se.w_size-o?se.strstart-(se.w_size-o):0,vt=se.window,Ye=se.w_mask,et=se.prev,mt=se.strstart+d,We=vt[Fe+lt-1],nt=vt[Fe+lt];se.prev_length>=se.good_match&&(Ee>>=2),_e>se.lookahead&&(_e=se.lookahead);do if(de=ye,!(vt[de+lt]!==nt||vt[de+lt-1]!==We||vt[de]!==vt[Fe]||vt[++de]!==vt[Fe+1])){Fe+=2,de++;do;while(vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&Fe<mt);if(xe=d-(mt-Fe),Fe=mt-d,xe>lt){if(se.match_start=ye,lt=xe,xe>=_e)break;We=vt[Fe+lt-1],nt=vt[Fe+lt]}}while((ye=et[ye&Ye])>Ve&&--Ee!==0);return lt<=se.lookahead?lt:se.lookahead}function ut(se){var ye=se.w_size,Ee,Fe,de,xe,lt;do{if(xe=se.window_size-se.lookahead-se.strstart,se.strstart>=ye+(ye-o)){t.arraySet(se.window,se.window,ye,ye,0),se.match_start-=ye,se.strstart-=ye,se.block_start-=ye,Fe=se.hash_size,Ee=Fe;do de=se.head[--Ee],se.head[Ee]=de>=ye?de-ye:0;while(--Fe);Fe=ye,Ee=Fe;do de=se.prev[--Ee],se.prev[Ee]=de>=ye?de-ye:0;while(--Fe);xe+=ye}if(se.strm.avail_in===0)break;if(Fe=ge(se.strm,se.window,se.strstart+se.lookahead,xe),se.lookahead+=Fe,se.lookahead+se.insert>=w)for(lt=se.strstart-se.insert,se.ins_h=se.window[lt],se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+w-1])&se.hash_mask,se.prev[lt&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=lt,lt++,se.insert--,!(se.lookahead+se.insert<w)););}while(se.lookahead<o&&se.strm.avail_in!==0)}function Ze(se,ye){var Ee=65535;for(Ee>se.pending_buf_size-5&&(Ee=se.pending_buf_size-5);;){if(se.lookahead<=1){if(ut(se),se.lookahead===0&&ye===h)return Z;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var Fe=se.block_start+Ee;if((se.strstart===0||se.strstart>=Fe)&&(se.lookahead=se.strstart-Fe,se.strstart=Fe,oe(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-o&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):(se.strstart>se.block_start&&(oe(se,!1),se.strm.avail_out===0),Z)}function Ge(se,ye){for(var Ee,Fe;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ee!==0&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee)),se.match_length>=w)if(Fe=e._tr_tally(se,se.strstart-se.match_start,se.match_length-w),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=w){se.match_length--;do se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else Fe=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function ct(se,ye){for(var Ee,Fe,de;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=w-1,Ee!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee),se.match_length<=5&&(se.strategy===P||se.match_length===w&&se.strstart-se.match_start>4096)&&(se.match_length=w-1)),se.prev_length>=w&&se.match_length<=se.prev_length){de=se.strstart+se.lookahead-w,Fe=e._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-w),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=de&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=w-1,se.strstart++,Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}else if(se.match_available){if(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),Fe&&oe(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Z}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function z(se,ye){for(var Ee,Fe,de,xe,lt=se.window;;){if(se.lookahead<=d){if(ut(se),se.lookahead<=d&&ye===h)return Z;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=w&&se.strstart>0&&(de=se.strstart-1,Fe=lt[de],Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de])){xe=se.strstart+d;do;while(Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&de<xe);se.match_length=d-(xe-de),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=w?(Ee=e._tr_tally(se,1,se.match_length-w),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function T(se,ye){for(var Ee;;){if(se.lookahead===0&&(ut(se),se.lookahead===0)){if(ye===h)return Z;break}if(se.match_length=0,Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function k(se,ye,Ee,Fe,de){this.good_length=se,this.max_lazy=ye,this.nice_length=Ee,this.max_chain=Fe,this.func=de}var O;O=[new k(0,0,0,0,Ze),new k(4,4,8,4,Ge),new k(4,5,16,8,Ge),new k(4,6,32,32,Ge),new k(4,4,16,16,ct),new k(8,16,32,32,ct),new k(8,16,128,128,ct),new k(8,32,128,256,ct),new k(32,128,258,1024,ct),new k(32,258,258,4096,ct)];function q(se){se.window_size=2*se.w_size,he(se.head),se.max_lazy_match=O[se.level].max_lazy,se.good_match=O[se.level].good_length,se.nice_match=O[se.level].nice_length,se.max_chain_length=O[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=w-1,se.match_available=0,se.ins_h=0}function H(){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=ee,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 t.Buf16(l*2),this.dyn_dtree=new t.Buf16((2*f+1)*2),this.bl_tree=new t.Buf16((2*u+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(m+1),this.heap=new t.Buf16(2*s+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*s+1),he(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 W(se){var ye;return!se||!se.state?J(se,x):(se.total_in=se.total_out=0,se.data_type=G,ye=se.state,ye.pending=0,ye.pending_out=0,ye.wrap<0&&(ye.wrap=-ye.wrap),ye.status=ye.wrap?R:re,se.adler=ye.wrap===2?0:1,ye.last_flush=h,e._tr_init(ye),y)}function fe(se){var ye=W(se);return ye===y&&q(se.state),ye}function st(se,ye){return!se||!se.state||se.state.wrap!==2?x:(se.state.gzhead=ye,y)}function ue(se,ye,Ee,Fe,de,xe){if(!se)return x;var lt=1;if(ye===I&&(ye=6),Fe<0?(lt=0,Fe=-Fe):Fe>15&&(lt=2,Fe-=16),de<1||de>D||Ee!==ee||Fe<8||Fe>15||ye<0||ye>9||xe<0||xe>C)return J(se,x);Fe===8&&(Fe=9);var _e=new H;return se.state=_e,_e.strm=se,_e.wrap=lt,_e.gzhead=null,_e.w_bits=Fe,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=de+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+w-1)/w),_e.window=new t.Buf8(_e.w_size*2),_e.head=new t.Buf16(_e.hash_size),_e.prev=new t.Buf16(_e.w_size),_e.lit_bufsize=1<<de+6,_e.pending_buf_size=_e.lit_bufsize*4,_e.pending_buf=new t.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ye,_e.strategy=xe,_e.method=Ee,fe(se)}function me(se,ye){return ue(se,ye,ee,U,V,Y)}function pe(se,ye){var Ee,Fe,de,xe;if(!se||!se.state||ye>g||ye<0)return se?J(se,x):x;if(Fe=se.state,!se.output||!se.input&&se.avail_in!==0||Fe.status===Q&&ye!==b)return J(se,se.avail_out===0?A:x);if(Fe.strm=se,Ee=Fe.last_flush,Fe.last_flush=ye,Fe.status===R)if(Fe.wrap===2)se.adler=0,le(Fe,31),le(Fe,139),le(Fe,8),Fe.gzhead?(le(Fe,(Fe.gzhead.text?1:0)+(Fe.gzhead.hcrc?2:0)+(Fe.gzhead.extra?4:0)+(Fe.gzhead.name?8:0)+(Fe.gzhead.comment?16:0)),le(Fe,Fe.gzhead.time&255),le(Fe,Fe.gzhead.time>>8&255),le(Fe,Fe.gzhead.time>>16&255),le(Fe,Fe.gzhead.time>>24&255),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,Fe.gzhead.os&255),Fe.gzhead.extra&&Fe.gzhead.extra.length&&(le(Fe,Fe.gzhead.extra.length&255),le(Fe,Fe.gzhead.extra.length>>8&255)),Fe.gzhead.hcrc&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending,0)),Fe.gzindex=0,Fe.status=S):(le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,j),Fe.status=re);else{var lt=ee+(Fe.w_bits-8<<4)<<8,_e=-1;Fe.strategy>=N||Fe.level<2?_e=0:Fe.level<6?_e=1:Fe.level===6?_e=2:_e=3,lt|=_e<<6,Fe.strstart!==0&&(lt|=v),lt+=31-lt%31,Fe.status=re,ot(Fe,lt),Fe.strstart!==0&&(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),se.adler=1}if(Fe.status===S)if(Fe.gzhead.extra){for(de=Fe.pending;Fe.gzindex<(Fe.gzhead.extra.length&65535)&&!(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size));)le(Fe,Fe.gzhead.extra[Fe.gzindex]&255),Fe.gzindex++;Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Fe.gzindex===Fe.gzhead.extra.length&&(Fe.gzindex=0,Fe.status=B)}else Fe.status=B;if(Fe.status===B)if(Fe.gzhead.name){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.name.length?xe=Fe.gzhead.name.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.gzindex=0,Fe.status=F)}else Fe.status=F;if(Fe.status===F)if(Fe.gzhead.comment){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.comment.length?xe=Fe.gzhead.comment.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.status=$)}else Fe.status=$;if(Fe.status===$&&(Fe.gzhead.hcrc?(Fe.pending+2>Fe.pending_buf_size&&Te(se),Fe.pending+2<=Fe.pending_buf_size&&(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),se.adler=0,Fe.status=re)):Fe.status=re),Fe.pending!==0){if(Te(se),se.avail_out===0)return Fe.last_flush=-1,y}else if(se.avail_in===0&&X(ye)<=X(Ee)&&ye!==b)return J(se,A);if(Fe.status===Q&&se.avail_in!==0)return J(se,A);if(se.avail_in!==0||Fe.lookahead!==0||ye!==h&&Fe.status!==Q){var Ve=Fe.strategy===N?T(Fe,ye):Fe.strategy===L?z(Fe,ye):O[Fe.level].func(Fe,ye);if((Ve===ce||Ve===te)&&(Fe.status=Q),Ve===Z||Ve===ce)return se.avail_out===0&&(Fe.last_flush=-1),y;if(Ve===K&&(ye===c?e._tr_align(Fe):ye!==g&&(e._tr_stored_block(Fe,0,0,!1),ye===p&&(he(Fe.head),Fe.lookahead===0&&(Fe.strstart=0,Fe.block_start=0,Fe.insert=0))),Te(se),se.avail_out===0))return Fe.last_flush=-1,y}return ye!==b?y:Fe.wrap<=0?M:(Fe.wrap===2?(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),le(Fe,se.adler>>16&255),le(Fe,se.adler>>24&255),le(Fe,se.total_in&255),le(Fe,se.total_in>>8&255),le(Fe,se.total_in>>16&255),le(Fe,se.total_in>>24&255)):(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),Te(se),Fe.wrap>0&&(Fe.wrap=-Fe.wrap),Fe.pending!==0?y:M)}function be(se){var ye;return!se||!se.state?x:(ye=se.state.status,ye!==R&&ye!==S&&ye!==B&&ye!==F&&ye!==$&&ye!==re&&ye!==Q?J(se,x):(se.state=null,ye===re?J(se,E):y))}function Qe(se,ye){var Ee=ye.length,Fe,de,xe,lt,_e,Ve,vt,Ye;if(!se||!se.state||(Fe=se.state,lt=Fe.wrap,lt===2||lt===1&&Fe.status!==R||Fe.lookahead))return x;for(lt===1&&(se.adler=r(se.adler,ye,Ee,0)),Fe.wrap=0,Ee>=Fe.w_size&&(lt===0&&(he(Fe.head),Fe.strstart=0,Fe.block_start=0,Fe.insert=0),Ye=new t.Buf8(Fe.w_size),t.arraySet(Ye,ye,Ee-Fe.w_size,Fe.w_size,0),ye=Ye,Ee=Fe.w_size),_e=se.avail_in,Ve=se.next_in,vt=se.input,se.avail_in=Ee,se.next_in=0,se.input=ye,ut(Fe);Fe.lookahead>=w;){de=Fe.strstart,xe=Fe.lookahead-(w-1);do Fe.ins_h=(Fe.ins_h<<Fe.hash_shift^Fe.window[de+w-1])&Fe.hash_mask,Fe.prev[de&Fe.w_mask]=Fe.head[Fe.ins_h],Fe.head[Fe.ins_h]=de,de++;while(--xe);Fe.strstart=de,Fe.lookahead=w-1,ut(Fe)}return Fe.strstart+=Fe.lookahead,Fe.block_start=Fe.strstart,Fe.insert=Fe.lookahead,Fe.lookahead=0,Fe.match_length=Fe.prev_length=w-1,Fe.match_available=0,se.next_in=Ve,se.input=vt,se.avail_in=_e,Fe.wrap=lt,y}return Ff.deflateInit=me,Ff.deflateInit2=ue,Ff.deflateReset=fe,Ff.deflateResetKeep=W,Ff.deflateSetHeader=st,Ff.deflate=pe,Ff.deflateEnd=be,Ff.deflateSetDictionary=Qe,Ff.deflateInfo="pako deflate (from Nodeca project)",Ff}function oCe(){if(zoe)return AB;zoe=!0;var t=30,e=12;return AB=function(a,i){var h,c,p,b,g,y,M,x,E,A,I,P,N,L,C,Y,G,ee,D,U,V,_,n,s,f;h=a.state,c=a.next_in,s=a.input,p=c+(a.avail_in-5),b=a.next_out,f=a.output,g=b-(i-a.avail_out),y=b+(a.avail_out-257),M=h.dmax,x=h.wsize,E=h.whave,A=h.wnext,I=h.window,P=h.hold,N=h.bits,L=h.lencode,C=h.distcode,Y=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{N<15&&(P+=s[c++]<<N,N+=8,P+=s[c++]<<N,N+=8),ee=L[P&Y];t:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D===0)f[b++]=ee&65535;else if(D&16){U=ee&65535,D&=15,D&&(N<D&&(P+=s[c++]<<N,N+=8),U+=P&(1<<D)-1,P>>>=D,N-=D),N<15&&(P+=s[c++]<<N,N+=8,P+=s[c++]<<N,N+=8),ee=C[P&G];r:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D&16){if(V=ee&65535,D&=15,N<D&&(P+=s[c++]<<N,N+=8,N<D&&(P+=s[c++]<<N,N+=8)),V+=P&(1<<D)-1,V>M){a.msg="invalid distance too far back",h.mode=t;break e}if(P>>>=D,N-=D,D=b-g,V>D){if(D=V-D,D>E&&h.sane){a.msg="invalid distance too far back",h.mode=t;break e}if(_=0,n=I,A===0){if(_+=x-D,D<U){U-=D;do f[b++]=I[_++];while(--D);_=b-V,n=f}}else if(A<D){if(_+=x+A-D,D-=A,D<U){U-=D;do f[b++]=I[_++];while(--D);if(_=0,A<U){D=A,U-=D;do f[b++]=I[_++];while(--D);_=b-V,n=f}}}else if(_+=A-D,D<U){U-=D;do f[b++]=I[_++];while(--D);_=b-V,n=f}for(;U>2;)f[b++]=n[_++],f[b++]=n[_++],f[b++]=n[_++],U-=3;U&&(f[b++]=n[_++],U>1&&(f[b++]=n[_++]))}else{_=b-V;do f[b++]=f[_++],f[b++]=f[_++],f[b++]=f[_++],U-=3;while(U>2);U&&(f[b++]=f[_++],U>1&&(f[b++]=f[_++]))}}else if(D&64){a.msg="invalid distance code",h.mode=t;break e}else{ee=C[(ee&65535)+(P&(1<<D)-1)];continue r}break}}else if(D&64)if(D&32){h.mode=e;break e}else{a.msg="invalid literal/length code",h.mode=t;break e}else{ee=L[(ee&65535)+(P&(1<<D)-1)];continue t}break}}while(c<p&&b<y);U=N>>3,c-=U,N-=U<<3,P&=(1<<N)-1,a.next_in=c,a.next_out=b,a.avail_in=c<p?5+(p-c):5-(c-p),a.avail_out=b<y?257+(y-b):257-(b-y),h.hold=P,h.bits=N},AB}function sCe(){if(Zoe)return RB;Zoe=!0;var t=Sw(),e=15,r=852,a=592,i=0,h=1,c=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return RB=function(x,E,A,I,P,N,L,C){var Y=C.bits,G=0,ee=0,D=0,U=0,V=0,_=0,n=0,s=0,f=0,u=0,l,m,w,d,o,v=null,R=0,S,B=new t.Buf16(e+1),F=new t.Buf16(e+1),$=null,re=0,Q,Z,K;for(G=0;G<=e;G++)B[G]=0;for(ee=0;ee<I;ee++)B[E[A+ee]]++;for(V=Y,U=e;U>=1&&B[U]===0;U--);if(V>U&&(V=U),U===0)return P[N++]=1<<24|64<<16|0,P[N++]=1<<24|64<<16|0,C.bits=1,0;for(D=1;D<U&&B[D]===0;D++);for(V<D&&(V=D),s=1,G=1;G<=e;G++)if(s<<=1,s-=B[G],s<0)return-1;if(s>0&&(x===i||U!==1))return-1;for(F[1]=0,G=1;G<e;G++)F[G+1]=F[G]+B[G];for(ee=0;ee<I;ee++)E[A+ee]!==0&&(L[F[E[A+ee]]++]=ee);if(x===i?(v=$=L,S=19):x===h?(v=p,R-=257,$=b,re-=257,S=256):(v=g,$=y,S=-1),u=0,ee=0,G=D,o=N,_=V,n=0,w=-1,f=1<<V,d=f-1,x===h&&f>r||x===c&&f>a)return 1;for(;;){Q=G-n,L[ee]<S?(Z=0,K=L[ee]):L[ee]>S?(Z=$[re+L[ee]],K=v[R+L[ee]]):(Z=96,K=0),l=1<<G-n,m=1<<_,D=m;do m-=l,P[o+(u>>n)+m]=Q<<24|Z<<16|K|0;while(m!==0);for(l=1<<G-1;u&l;)l>>=1;if(l!==0?(u&=l-1,u+=l):u=0,ee++,--B[G]===0){if(G===U)break;G=E[A+L[ee]]}if(G>V&&(u&d)!==w){for(n===0&&(n=V),o+=D,_=G-n,s=1<<_;_+n<U&&(s-=B[_+n],!(s<=0));)_++,s<<=1;if(f+=1<<_,x===h&&f>r||x===c&&f>a)return 1;w=u&d,P[w]=V<<24|_<<16|o-N|0}}return u!==0&&(P[o+u]=G-n<<24|64<<16|0),C.bits=V,0},RB}function fCe(){if(Hoe)return zs;Hoe=!0;var t=Sw(),e=Goe(),r=Yoe(),a=oCe(),i=sCe(),h=0,c=1,p=2,b=4,g=5,y=6,M=0,x=1,E=2,A=-2,I=-3,P=-4,N=-5,L=8,C=1,Y=2,G=3,ee=4,D=5,U=6,V=7,_=8,n=9,s=10,f=11,u=12,l=13,m=14,w=15,d=16,o=17,v=18,R=19,S=20,B=21,F=22,$=23,re=24,Q=25,Z=26,K=27,ce=28,te=29,j=30,J=31,X=32,he=852,Te=592,oe=15,le=oe;function ot(ue){return(ue>>>24&255)+(ue>>>8&65280)+((ue&65280)<<8)+((ue&255)<<24)}function ge(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Se(ue){var me;return!ue||!ue.state?A:(me=ue.state,ue.total_in=ue.total_out=me.total=0,ue.msg="",me.wrap&&(ue.adler=me.wrap&1),me.mode=C,me.last=0,me.havedict=0,me.dmax=32768,me.head=null,me.hold=0,me.bits=0,me.lencode=me.lendyn=new t.Buf32(he),me.distcode=me.distdyn=new t.Buf32(Te),me.sane=1,me.back=-1,M)}function ut(ue){var me;return!ue||!ue.state?A:(me=ue.state,me.wsize=0,me.whave=0,me.wnext=0,Se(ue))}function Ze(ue,me){var pe,be;return!ue||!ue.state||(be=ue.state,me<0?(pe=0,me=-me):(pe=(me>>4)+1,me<48&&(me&=15)),me&&(me<8||me>15))?A:(be.window!==null&&be.wbits!==me&&(be.window=null),be.wrap=pe,be.wbits=me,ut(ue))}function Ge(ue,me){var pe,be;return ue?(be=new ge,ue.state=be,be.window=null,pe=Ze(ue,me),pe!==M&&(ue.state=null),pe):A}function ct(ue){return Ge(ue,le)}var z=!0,T,k;function O(ue){if(z){var me;for(T=new t.Buf32(512),k=new t.Buf32(32),me=0;me<144;)ue.lens[me++]=8;for(;me<256;)ue.lens[me++]=9;for(;me<280;)ue.lens[me++]=7;for(;me<288;)ue.lens[me++]=8;for(i(c,ue.lens,0,288,T,0,ue.work,{bits:9}),me=0;me<32;)ue.lens[me++]=5;i(p,ue.lens,0,32,k,0,ue.work,{bits:5}),z=!1}ue.lencode=T,ue.lenbits=9,ue.distcode=k,ue.distbits=5}function q(ue,me,pe,be){var Qe,se=ue.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new t.Buf8(se.wsize)),be>=se.wsize?(t.arraySet(se.window,me,pe-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(Qe=se.wsize-se.wnext,Qe>be&&(Qe=be),t.arraySet(se.window,me,pe-be,Qe,se.wnext),be-=Qe,be?(t.arraySet(se.window,me,pe-be,be,0),se.wnext=be,se.whave=se.wsize):(se.wnext+=Qe,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=Qe))),0}function H(ue,me){var pe,be,Qe,se,ye,Ee,Fe,de,xe,lt,_e,Ve,vt,Ye,et=0,mt,We,nt,bt,Je,at,yt,Xe,it=new t.Buf8(4),_t,dt,Mt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ue||!ue.state||!ue.output||!ue.input&&ue.avail_in!==0)return A;pe=ue.state,pe.mode===u&&(pe.mode=l),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,lt=Ee,_e=Fe,Xe=M;e:for(;;)switch(pe.mode){case C:if(pe.wrap===0){pe.mode=l;break}for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.wrap&2&&de===35615){pe.check=0,it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0),de=0,xe=0,pe.mode=Y;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(pe.wrap&1)||(((de&255)<<8)+(de>>8))%31){ue.msg="incorrect header check",pe.mode=j;break}if((de&15)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(de>>>=4,xe-=4,yt=(de&15)+8,pe.wbits===0)pe.wbits=yt;else if(yt>pe.wbits){ue.msg="invalid window size",pe.mode=j;break}pe.dmax=1<<yt,ue.adler=pe.check=1,pe.mode=de&512?s:u,de=0,xe=0;break;case Y:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.flags=de,(pe.flags&255)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(pe.flags&57344){ue.msg="unknown header flags set",pe.mode=j;break}pe.head&&(pe.head.text=de>>8&1),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=G;case G:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.time=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,it[2]=de>>>16&255,it[3]=de>>>24&255,pe.check=r(pe.check,it,4,0)),de=0,xe=0,pe.mode=ee;case ee:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.xflags=de&255,pe.head.os=de>>8),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=D;case D:if(pe.flags&1024){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length=de,pe.head&&(pe.head.extra_len=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0}else pe.head&&(pe.head.extra=null);pe.mode=U;case U:if(pe.flags&1024&&(Ve=pe.length,Ve>Ee&&(Ve=Ee),Ve&&(pe.head&&(yt=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=new Array(pe.head.extra_len)),t.arraySet(pe.head.extra,be,se,Ve,yt)),pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,pe.length-=Ve),pe.length))break e;pe.length=0,pe.mode=V;case V:if(pe.flags&2048){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.name+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.name=null);pe.length=0,pe.mode=_;case _:if(pe.flags&4096){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.comment+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.comment=null);pe.mode=n;case n:if(pe.flags&512){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.check&65535)){ue.msg="header crc mismatch",pe.mode=j;break}de=0,xe=0}pe.head&&(pe.head.hcrc=pe.flags>>9&1,pe.head.done=!0),ue.adler=pe.check=0,pe.mode=u;break;case s:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}ue.adler=pe.check=ot(de),de=0,xe=0,pe.mode=f;case f:if(pe.havedict===0)return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,E;ue.adler=pe.check=1,pe.mode=u;case u:if(me===g||me===y)break e;case l:if(pe.last){de>>>=xe&7,xe-=xe&7,pe.mode=K;break}for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}switch(pe.last=de&1,de>>>=1,xe-=1,de&3){case 0:pe.mode=m;break;case 1:if(O(pe),pe.mode=S,me===y){de>>>=2,xe-=2;break e}break;case 2:pe.mode=o;break;case 3:ue.msg="invalid block type",pe.mode=j}de>>>=2,xe-=2;break;case m:for(de>>>=xe&7,xe-=xe&7;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if((de&65535)!==(de>>>16^65535)){ue.msg="invalid stored block lengths",pe.mode=j;break}if(pe.length=de&65535,de=0,xe=0,pe.mode=w,me===y)break e;case w:pe.mode=d;case d:if(Ve=pe.length,Ve){if(Ve>Ee&&(Ve=Ee),Ve>Fe&&(Ve=Fe),Ve===0)break e;t.arraySet(Qe,be,se,Ve,ye),Ee-=Ve,se+=Ve,Fe-=Ve,ye+=Ve,pe.length-=Ve;break}pe.mode=u;break;case o:for(;xe<14;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.nlen=(de&31)+257,de>>>=5,xe-=5,pe.ndist=(de&31)+1,de>>>=5,xe-=5,pe.ncode=(de&15)+4,de>>>=4,xe-=4,pe.nlen>286||pe.ndist>30){ue.msg="too many length or distance symbols",pe.mode=j;break}pe.have=0,pe.mode=v;case v:for(;pe.have<pe.ncode;){for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.lens[Mt[pe.have++]]=de&7,de>>>=3,xe-=3}for(;pe.have<19;)pe.lens[Mt[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,_t={bits:pe.lenbits},Xe=i(h,pe.lens,0,19,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid code lengths set",pe.mode=j;break}pe.have=0,pe.mode=R;case R:for(;pe.have<pe.nlen+pe.ndist;){for(;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(nt<16)de>>>=mt,xe-=mt,pe.lens[pe.have++]=nt;else{if(nt===16){for(dt=mt+2;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de>>>=mt,xe-=mt,pe.have===0){ue.msg="invalid bit length repeat",pe.mode=j;break}yt=pe.lens[pe.have-1],Ve=3+(de&3),de>>>=2,xe-=2}else if(nt===17){for(dt=mt+3;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=3+(de&7),de>>>=3,xe-=3}else{for(dt=mt+7;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=11+(de&127),de>>>=7,xe-=7}if(pe.have+Ve>pe.nlen+pe.ndist){ue.msg="invalid bit length repeat",pe.mode=j;break}for(;Ve--;)pe.lens[pe.have++]=yt}}if(pe.mode===j)break;if(pe.lens[256]===0){ue.msg="invalid code -- missing end-of-block",pe.mode=j;break}if(pe.lenbits=9,_t={bits:pe.lenbits},Xe=i(c,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid literal/lengths set",pe.mode=j;break}if(pe.distbits=6,pe.distcode=pe.distdyn,_t={bits:pe.distbits},Xe=i(p,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,_t),pe.distbits=_t.bits,Xe){ue.msg="invalid distances set",pe.mode=j;break}if(pe.mode=S,me===y)break e;case S:pe.mode=B;case B:if(Ee>=6&&Fe>=258){ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,a(ue,_e),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,pe.mode===u&&(pe.back=-1);break}for(pe.back=0;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(We&&!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.lencode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,pe.length=nt,We===0){pe.mode=Z;break}if(We&32){pe.back=-1,pe.mode=u;break}if(We&64){ue.msg="invalid literal/length code",pe.mode=j;break}pe.extra=We&15,pe.mode=F;case F:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=$;case $:for(;et=pe.distcode[de&(1<<pe.distbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.distcode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,We&64){ue.msg="invalid distance code",pe.mode=j;break}pe.offset=nt,pe.extra=We&15,pe.mode=re;case re:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.offset+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ue.msg="invalid distance too far back",pe.mode=j;break}pe.mode=Q;case Q:if(Fe===0)break e;if(Ve=_e-Fe,pe.offset>Ve){if(Ve=pe.offset-Ve,Ve>pe.whave&&pe.sane){ue.msg="invalid distance too far back",pe.mode=j;break}Ve>pe.wnext?(Ve-=pe.wnext,vt=pe.wsize-Ve):vt=pe.wnext-Ve,Ve>pe.length&&(Ve=pe.length),Ye=pe.window}else Ye=Qe,vt=ye-pe.offset,Ve=pe.length;Ve>Fe&&(Ve=Fe),Fe-=Ve,pe.length-=Ve;do Qe[ye++]=Ye[vt++];while(--Ve);pe.length===0&&(pe.mode=B);break;case Z:if(Fe===0)break e;Qe[ye++]=pe.length,Fe--,pe.mode=B;break;case K:if(pe.wrap){for(;xe<32;){if(Ee===0)break e;Ee--,de|=be[se++]<<xe,xe+=8}if(_e-=Fe,ue.total_out+=_e,pe.total+=_e,_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ye-_e):e(pe.check,Qe,_e,ye-_e)),_e=Fe,(pe.flags?de:ot(de))!==pe.check){ue.msg="incorrect data check",pe.mode=j;break}de=0,xe=0}pe.mode=ce;case ce:if(pe.wrap&&pe.flags){for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.total&4294967295)){ue.msg="incorrect length check",pe.mode=j;break}de=0,xe=0}pe.mode=te;case te:Xe=x;break e;case j:Xe=I;break e;case J:return P;case X:default:return A}return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,(pe.wsize||_e!==ue.avail_out&&pe.mode<j&&(pe.mode<K||me!==b))&&q(ue,ue.output,ue.next_out,_e-ue.avail_out),lt-=ue.avail_in,_e-=ue.avail_out,ue.total_in+=lt,ue.total_out+=_e,pe.total+=_e,pe.wrap&&_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ue.next_out-_e):e(pe.check,Qe,_e,ue.next_out-_e)),ue.data_type=pe.bits+(pe.last?64:0)+(pe.mode===u?128:0)+(pe.mode===S||pe.mode===w?256:0),(lt===0&&_e===0||me===b)&&Xe===M&&(Xe=N),Xe}function W(ue){if(!ue||!ue.state)return A;var me=ue.state;return me.window&&(me.window=null),ue.state=null,M}function fe(ue,me){var pe;return!ue||!ue.state||(pe=ue.state,!(pe.wrap&2))?A:(pe.head=me,me.done=!1,M)}function st(ue,me){var pe=me.length,be,Qe,se;return!ue||!ue.state||(be=ue.state,be.wrap!==0&&be.mode!==f)?A:be.mode===f&&(Qe=1,Qe=e(Qe,me,pe,0),Qe!==be.check)?I:(se=q(ue,me,pe,pe),se?(be.mode=J,P):(be.havedict=1,M))}return zs.inflateReset=ut,zs.inflateReset2=Ze,zs.inflateResetKeep=Se,zs.inflateInit=ct,zs.inflateInit2=Ge,zs.inflate=H,zs.inflateEnd=W,zs.inflateGetHeader=fe,zs.inflateSetDictionary=st,zs.inflateInfo="pako inflate (from Nodeca project)",zs}function uCe(){return Koe||(Koe=!0,TB={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),TB}function hCe(){if(Woe)return Dt;Woe=!0;var t=ii.Buffer,e=yr,r=or,a=rCe(),i=aCe(),h=fCe(),c=uCe();for(var p in c)Dt[p]=c[p];Dt.NONE=0,Dt.DEFLATE=1,Dt.INFLATE=2,Dt.GZIP=3,Dt.GUNZIP=4,Dt.DEFLATERAW=5,Dt.INFLATERAW=6,Dt.UNZIP=7;var b=31,g=139;function y(M){if(typeof M!="number"||M<Dt.DEFLATE||M>Dt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=M,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return y.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,r(this.init_done,"close before init"),r(this.mode<=Dt.UNZIP),this.mode===Dt.DEFLATE||this.mode===Dt.GZIP||this.mode===Dt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===Dt.INFLATE||this.mode===Dt.GUNZIP||this.mode===Dt.INFLATERAW||this.mode===Dt.UNZIP)&&h.inflateEnd(this.strm),this.mode=Dt.NONE,this.dictionary=null},y.prototype.write=function(M,x,E,A,I,P,N){return this._write(!0,M,x,E,A,I,P,N)},y.prototype.writeSync=function(M,x,E,A,I,P,N){return this._write(!1,M,x,E,A,I,P,N)},y.prototype._write=function(M,x,E,A,I,P,N,L){if(r.equal(arguments.length,8),r(this.init_done,"write before init"),r(this.mode!==Dt.NONE,"already finalized"),r.equal(!1,this.write_in_progress,"write already in progress"),r.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,r.equal(!1,x===void 0,"must provide flush value"),this.write_in_progress=!0,x!==Dt.Z_NO_FLUSH&&x!==Dt.Z_PARTIAL_FLUSH&&x!==Dt.Z_SYNC_FLUSH&&x!==Dt.Z_FULL_FLUSH&&x!==Dt.Z_FINISH&&x!==Dt.Z_BLOCK)throw new Error("Invalid flush value");if(E==null&&(E=t.alloc(0),I=0,A=0),this.strm.avail_in=I,this.strm.input=E,this.strm.next_in=A,this.strm.avail_out=L,this.strm.output=P,this.strm.next_out=N,this.flush=x,!M)return this._process(),this._checkError()?this._afterSync():void 0;var C=this;return e.nextTick(function(){C._process(),C._after()}),this},y.prototype._afterSync=function(){var M=this.strm.avail_out,x=this.strm.avail_in;return this.write_in_progress=!1,[x,M]},y.prototype._process=function(){var M=null;switch(this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case Dt.UNZIP:switch(this.strm.avail_in>0&&(M=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(M===null)break;if(this.strm.input[M]===b){if(this.gzip_id_bytes_read=1,M++,this.strm.avail_in===1)break}else{this.mode=Dt.INFLATE;break}case 1:if(M===null)break;this.strm.input[M]===g?(this.gzip_id_bytes_read=2,this.mode=Dt.GUNZIP):this.mode=Dt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===Dt.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===Dt.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===Dt.Z_DATA_ERROR&&(this.err=Dt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Dt.GUNZIP&&this.err===Dt.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},y.prototype._checkError=function(){switch(this.err){case Dt.Z_OK:case Dt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===Dt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Dt.Z_STREAM_END:break;case Dt.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},y.prototype._after=function(){if(this._checkError()){var M=this.strm.avail_out,x=this.strm.avail_in;this.write_in_progress=!1,this.callback(x,M),this.pending_close&&this.close()}},y.prototype._error=function(M){this.strm.msg&&(M=this.strm.msg),this.onerror(M,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},y.prototype.init=function(M,x,E,A,I){r(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),r(M>=8&&M<=15,"invalid windowBits"),r(x>=-1&&x<=9,"invalid compression level"),r(E>=1&&E<=9,"invalid memlevel"),r(A===Dt.Z_FILTERED||A===Dt.Z_HUFFMAN_ONLY||A===Dt.Z_RLE||A===Dt.Z_FIXED||A===Dt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(x,M,E,A,I),this._setDictionary()},y.prototype.params=function(){throw new Error("deflateParams Not supported")},y.prototype.reset=function(){this._reset(),this._setDictionary()},y.prototype._init=function(M,x,E,A,I){switch(this.level=M,this.windowBits=x,this.memLevel=E,this.strategy=A,this.flush=Dt.Z_NO_FLUSH,this.err=Dt.Z_OK,(this.mode===Dt.GZIP||this.mode===Dt.GUNZIP)&&(this.windowBits+=16),this.mode===Dt.UNZIP&&(this.windowBits+=32),(this.mode===Dt.DEFLATERAW||this.mode===Dt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,Dt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:case Dt.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Dt.Z_OK&&this._error("Init error"),this.dictionary=I,this.write_in_progress=!1,this.init_done=!0},y.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==Dt.Z_OK&&this._error("Failed to set dictionary")}},y.prototype._reset=function(){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:case Dt.GZIP:this.err=i.deflateReset(this.strm);break;case Dt.INFLATE:case Dt.INFLATERAW:case Dt.GUNZIP:this.err=h.inflateReset(this.strm);break}this.err!==Dt.Z_OK&&this._error("Failed to reset stream")},Dt.Zlib=y,Dt}function cCe(){if(Voe)return rr;Voe=!0;var t=yr,e=ii.Buffer,r=Ia.Transform,a=hCe(),i=gt,h=or.ok,c=ii.kMaxLength,p="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16*1024,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var b=Object.keys(a),g=0;g<b.length;g++){var y=b[g];y.match(/^Z/)&&Object.defineProperty(rr,y,{enumerable:!0,value:a[y],writable:!1})}for(var M={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},x=Object.keys(M),E=0;E<x.length;E++){var A=x[E];M[M[A]]=A}Object.defineProperty(rr,"codes",{enumerable:!0,value:Object.freeze(M),writable:!1}),rr.Deflate=N,rr.Inflate=L,rr.Gzip=C,rr.Gunzip=Y,rr.DeflateRaw=G,rr.InflateRaw=ee,rr.Unzip=D,rr.createDeflate=function(s){return new N(s)},rr.createInflate=function(s){return new L(s)},rr.createDeflateRaw=function(s){return new G(s)},rr.createInflateRaw=function(s){return new ee(s)},rr.createGzip=function(s){return new C(s)},rr.createGunzip=function(s){return new Y(s)},rr.createUnzip=function(s){return new D(s)},rr.deflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new N(f),s,u)},rr.deflateSync=function(s,f){return P(new N(f),s)},rr.gzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new C(f),s,u)},rr.gzipSync=function(s,f){return P(new C(f),s)},rr.deflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new G(f),s,u)},rr.deflateRawSync=function(s,f){return P(new G(f),s)},rr.unzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new D(f),s,u)},rr.unzipSync=function(s,f){return P(new D(f),s)},rr.inflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new L(f),s,u)},rr.inflateSync=function(s,f){return P(new L(f),s)},rr.gunzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new Y(f),s,u)},rr.gunzipSync=function(s,f){return P(new Y(f),s)},rr.inflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new ee(f),s,u)},rr.inflateRawSync=function(s,f){return P(new ee(f),s)};function I(s,f,u){var l=[],m=0;s.on("error",d),s.on("end",o),s.end(f),w();function w(){for(var v;(v=s.read())!==null;)l.push(v),m+=v.length;s.once("readable",w)}function d(v){s.removeListener("end",o),s.removeListener("readable",w),u(v)}function o(){var v,R=null;m>=c?R=new RangeError(p):v=e.concat(l,m),l=[],s.close(),u(R,v)}}function P(s,f){if(typeof f=="string"&&(f=e.from(f)),!e.isBuffer(f))throw new TypeError("Not a string or buffer");var u=s._finishFlushFlag;return s._processChunk(f,u)}function N(s){if(!(this instanceof N))return new N(s);V.call(this,s,a.DEFLATE)}function L(s){if(!(this instanceof L))return new L(s);V.call(this,s,a.INFLATE)}function C(s){if(!(this instanceof C))return new C(s);V.call(this,s,a.GZIP)}function Y(s){if(!(this instanceof Y))return new Y(s);V.call(this,s,a.GUNZIP)}function G(s){if(!(this instanceof G))return new G(s);V.call(this,s,a.DEFLATERAW)}function ee(s){if(!(this instanceof ee))return new ee(s);V.call(this,s,a.INFLATERAW)}function D(s){if(!(this instanceof D))return new D(s);V.call(this,s,a.UNZIP)}function U(s){return s===a.Z_NO_FLUSH||s===a.Z_PARTIAL_FLUSH||s===a.Z_SYNC_FLUSH||s===a.Z_FULL_FLUSH||s===a.Z_FINISH||s===a.Z_BLOCK}function V(s,f){var u=this;if(this._opts=s=s||{},this._chunkSize=s.chunkSize||rr.Z_DEFAULT_CHUNK,r.call(this,s),s.flush&&!U(s.flush))throw new Error("Invalid flush flag: "+s.flush);if(s.finishFlush&&!U(s.finishFlush))throw new Error("Invalid flush flag: "+s.finishFlush);if(this._flushFlag=s.flush||a.Z_NO_FLUSH,this._finishFlushFlag=typeof s.finishFlush<"u"?s.finishFlush:a.Z_FINISH,s.chunkSize&&(s.chunkSize<rr.Z_MIN_CHUNK||s.chunkSize>rr.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+s.chunkSize);if(s.windowBits&&(s.windowBits<rr.Z_MIN_WINDOWBITS||s.windowBits>rr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+s.windowBits);if(s.level&&(s.level<rr.Z_MIN_LEVEL||s.level>rr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+s.level);if(s.memLevel&&(s.memLevel<rr.Z_MIN_MEMLEVEL||s.memLevel>rr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+s.memLevel);if(s.strategy&&s.strategy!=rr.Z_FILTERED&&s.strategy!=rr.Z_HUFFMAN_ONLY&&s.strategy!=rr.Z_RLE&&s.strategy!=rr.Z_FIXED&&s.strategy!=rr.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+s.strategy);if(s.dictionary&&!e.isBuffer(s.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(f);var l=this;this._hadError=!1,this._handle.onerror=function(d,o){_(l),l._hadError=!0;var v=new Error(d);v.errno=o,v.code=rr.codes[o],l.emit("error",v)};var m=rr.Z_DEFAULT_COMPRESSION;typeof s.level=="number"&&(m=s.level);var w=rr.Z_DEFAULT_STRATEGY;typeof s.strategy=="number"&&(w=s.strategy),this._handle.init(s.windowBits||rr.Z_DEFAULT_WINDOWBITS,m,s.memLevel||rr.Z_DEFAULT_MEMLEVEL,w,s.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=m,this._strategy=w,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!u._handle},configurable:!0,enumerable:!0})}i.inherits(V,r),V.prototype.params=function(s,f,u){if(s<rr.Z_MIN_LEVEL||s>rr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+s);if(f!=rr.Z_FILTERED&&f!=rr.Z_HUFFMAN_ONLY&&f!=rr.Z_RLE&&f!=rr.Z_FIXED&&f!=rr.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+f);if(this._level!==s||this._strategy!==f){var l=this;this.flush(a.Z_SYNC_FLUSH,function(){h(l._handle,"zlib binding closed"),l._handle.params(s,f),l._hadError||(l._level=s,l._strategy=f,u&&u())})}else t.nextTick(u)},V.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(s){this._transform(e.alloc(0),"",s)},V.prototype.flush=function(s,f){var u=this,l=this._writableState;(typeof s=="function"||s===void 0&&!f)&&(f=s,s=a.Z_FULL_FLUSH),l.ended?f&&t.nextTick(f):l.ending?f&&this.once("end",f):l.needDrain?f&&this.once("drain",function(){return u.flush(s,f)}):(this._flushFlag=s,this.write(e.alloc(0),"",f))},V.prototype.close=function(s){_(this,s),t.nextTick(n,this)};function _(s,f){f&&t.nextTick(f),s._handle&&(s._handle.close(),s._handle=null)}function n(s){s.emit("close")}return V.prototype._transform=function(s,f,u){var l,m=this._writableState,w=m.ending||m.ended,d=w&&(!s||m.length===s.length);if(s!==null&&!e.isBuffer(s))return u(new Error("invalid input"));if(!this._handle)return u(new Error("zlib binding closed"));d?l=this._finishFlushFlag:(l=this._flushFlag,s.length>=m.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),this._processChunk(s,l,u)},V.prototype._processChunk=function(s,f,u){var l=s&&s.length,m=this._chunkSize-this._offset,w=0,d=this,o=typeof u=="function";if(!o){var v=[],R=0,S;this.on("error",function(Q){S=Q}),h(this._handle,"zlib binding closed");do var B=this._handle.writeSync(f,s,w,l,this._buffer,this._offset,m);while(!this._hadError&&re(B[0],B[1]));if(this._hadError)throw S;if(R>=c)throw _(this),new RangeError(p);var F=e.concat(v,R);return _(this),F}h(this._handle,"zlib binding closed");var $=this._handle.write(f,s,w,l,this._buffer,this._offset,m);$.buffer=s,$.callback=re;function re(Q,Z){if(this&&(this.buffer=null,this.callback=null),!d._hadError){var K=m-Z;if(h(K>=0,"have should not go down"),K>0){var ce=d._buffer.slice(d._offset,d._offset+K);d._offset+=K,o?d.push(ce):(v.push(ce),R+=ce.length)}if((Z===0||d._offset>=d._chunkSize)&&(m=d._chunkSize,d._offset=0,d._buffer=e.allocUnsafe(d._chunkSize)),Z===0){if(w+=l-Q,l=Q,!o)return!0;var te=d._handle.write(f,s,w,l,d._buffer,d._offset,d._chunkSize);te.callback=re,te.buffer=s;return}if(!o)return!1;u()}}},i.inherits(N,V),i.inherits(L,V),i.inherits(C,V),i.inherits(Y,V),i.inherits(G,V),i.inherits(ee,V),i.inherits(D,V),rr}var MB,Loe,Ba,Doe,Fd,$oe,xB,qoe,SB,Uoe,EB,Foe,Ff,joe,AB,zoe,RB,Zoe,zs,Hoe,TB,Koe,Dt,Woe,rr,Voe,At,lCe,dCe,pCe,vCe,mCe,gCe,bCe,yCe,wCe,_Ce,MCe,xCe,SCe,ECe,ACe,RCe,TCe,ICe,kCe,BCe,PCe,OCe,NCe,CCe,LCe,DCe,$Ce,qCe,UCe,FCe,jCe,zCe,ZCe,HCe,KCe,WCe,VCe,GCe,YCe,JCe,XCe,QCe,eLe,tLe,rLe,iLe,nLe,aLe,oLe,sLe,fLe,uLe,hLe,cLe,lLe,dLe,pLe,vLe,mLe,gLe,bLe,yLe,wLe,_Le,MLe,xLe,SLe,ELe,ALe,Xoe=xi(()=>{"use strict";ie();ae();ne();ah();k8();tB();Ks();ao();Tg();zo();Hs();th();Fo();Gf();Z0();MB={},Loe=!1;Ba={},Doe=!1;Fd={},$oe=!1;xB={},qoe=!1;SB={},Uoe=!1;EB={},Foe=!1;Ff={},joe=!1;AB={},zoe=!1;RB={},Zoe=!1;zs={},Hoe=!1;TB={},Koe=!1;Dt={},Woe=!1;rr={},Voe=!1;At=cCe();At.codes;At.Deflate;At.Inflate;At.Gzip;At.Gunzip;At.DeflateRaw;At.InflateRaw;At.Unzip;At.createDeflate;At.createInflate;At.createDeflateRaw;At.createInflateRaw;At.createGzip;At.createGunzip;At.createUnzip;At.deflate;At.deflateSync;At.gzip;At.gzipSync;At.deflateRaw;At.deflateRawSync;At.unzip;At.unzipSync;At.inflate;At.inflateSync;At.gunzip;At.gunzipSync;At.inflateRaw;At.inflateRawSync;lCe=At.Deflate,dCe=At.DeflateRaw,pCe=At.Gunzip,vCe=At.Gzip,mCe=At.Inflate,gCe=At.InflateRaw,bCe=At.Unzip,yCe=At.Z_BEST_COMPRESSION,wCe=At.Z_BEST_SPEED,_Ce=At.Z_BINARY,MCe=At.Z_BLOCK,xCe=At.Z_BUF_ERROR,SCe=At.Z_DATA_ERROR,ECe=At.Z_DEFAULT_CHUNK,ACe=At.Z_DEFAULT_COMPRESSION,RCe=At.Z_DEFAULT_LEVEL,TCe=At.Z_DEFAULT_MEMLEVEL,ICe=At.Z_DEFAULT_STRATEGY,kCe=At.Z_DEFAULT_WINDOWBITS,BCe=At.Z_DEFLATED,PCe=At.Z_ERRNO,OCe=At.Z_FILTERED,NCe=At.Z_FINISH,CCe=At.Z_FIXED,LCe=At.Z_FULL_FLUSH,DCe=At.Z_HUFFMAN_ONLY,$Ce=At.Z_MAX_CHUNK,qCe=At.Z_MAX_LEVEL,UCe=At.Z_MAX_MEMLEVEL,FCe=At.Z_MAX_WINDOWBITS,jCe=At.Z_MIN_CHUNK,zCe=At.Z_MIN_LEVEL,ZCe=At.Z_MIN_MEMLEVEL,HCe=At.Z_MIN_WINDOWBITS,KCe=At.Z_NEED_DICT,WCe=At.Z_NO_COMPRESSION,VCe=At.Z_NO_FLUSH,GCe=At.Z_OK,YCe=At.Z_PARTIAL_FLUSH,JCe=At.Z_RLE,XCe=At.Z_STREAM_END,QCe=At.Z_STREAM_ERROR,eLe=At.Z_SYNC_FLUSH,tLe=At.Z_TEXT,rLe=At.Z_TREES,iLe=At.Z_UNKNOWN,nLe=At.Zlib,aLe=At.codes,oLe=At.createDeflate,sLe=At.createDeflateRaw,fLe=At.createGunzip,uLe=At.createGzip,hLe=At.createInflate,cLe=At.createInflateRaw,lLe=At.createUnzip,dLe=At.deflate,pLe=At.deflateRaw,vLe=At.deflateRawSync,mLe=At.deflateSync,gLe=At.gunzip,bLe=At.gunzipSync,yLe=At.gzip,wLe=At.gzipSync,_Le=At.inflate,MLe=At.inflateRaw,xLe=At.inflateRawSync,SLe=At.inflateSync,ELe=At.unzip,ALe=At.unzipSync});var tse=ht((dmt,ese)=>{"use strict";ie();ae();ne();var fv=[],db=[],IB=function(){};function BB(t){return~fv.indexOf(t)?!1:(fv.push(t),!0)}function PB(t){IB=t}function RLe(t){for(var e=[],r=0;r<fv.length;r++){if(fv[r].async){e.push(fv[r]);continue}if(fv[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(c){return c(t)})).then(function(c){i(c.some(Boolean))})}):!1}function OB(t){return~db.indexOf(t)?!1:(db.push(t),!0)}function kB(){IB.apply(IB,arguments)}function Qoe(t){for(var e=0;e<db.length;e++)t=db[e].apply(db[e],arguments);return t}function NB(t,e){var r=Object.prototype.hasOwnProperty;for(var a in e)r.call(e,a)&&(t[a]=e[a]);return t}function TLe(t){return t.enabled=!1,t.modify=OB,t.set=PB,t.use=BB,NB(function(){return!1},t)}function ILe(t){function e(){var r=Array.prototype.slice.call(arguments,0);return kB.call(kB,t,Qoe(r,t)),!0}return t.enabled=!0,t.modify=OB,t.set=PB,t.use=BB,NB(e,t)}ese.exports=function(e){return e.introduce=NB,e.enabled=RLe,e.process=Qoe,e.modify=OB,e.write=kB,e.nope=TLe,e.yep=ILe,e.set=PB,e.use=BB,e}});var ise=ht((gmt,rse)=>{"use strict";ie();ae();ne();var kLe=tse(),BLe=kLe(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});rse.exports=BLe});var pb=ht((_mt,nse)=>{"use strict";ie();ae();ne();nse.exports=ise()});var ase={};Ka(ase,{StringDecoder:()=>PLe,default:()=>En});var PLe,ose=xi(()=>{"use strict";ie();ae();ne();Gf();Gf();PLe=En.StringDecoder});var fse=ht((kmt,sse)=>{"use strict";ie();ae();ne();var CB=(mB(),Qr(vB)),OLe=(ose(),Qr(ase)),NLe=OLe.StringDecoder,CLe=Ph(),LLe=CLe.Stream;function DLe(){}sse.exports=function(t,e){var r=Me.alloc(65536),a=new NLe("utf8"),i=new LLe,h="",c=0,p=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=function(){i.destroyed=!0,i.emit("end"),i.emit("close")},CB.open(t.file,"a+","0644",function(b,g){if(b){e?e(b):i.emit("error",b),i.destroy();return}(function y(){if(i.destroyed){CB.close(g,DLe);return}return CB.read(g,r,0,r.length,c,function(M,x){if(M){e?e(M):i.emit("error",M),i.destroy();return}if(!x)return h&&((t.start==null||p>t.start)&&(e?e(null,h):i.emit("line",h)),p++,h=""),setTimeout(y,1e3);var E=a.write(r.slice(0,x));e||i.emit("data",E),E=(h+E).split(/\n+/);for(var A=E.length-1,I=0;I<A;I++)(t.start==null||p>t.start)&&(e?e(null,E[I]):i.emit("line",E[I])),p++;return h=E[A],c+=x,y()})})()}),e?i.destroy:i}});var mse=ht((Nmt,vse)=>{"use strict";ie();ae();ne();function Qh(t){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qh(t)}function $Le(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function use(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,ULe(a.key),a)}}function qLe(t,e,r){return e&&use(t.prototype,e),r&&use(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ULe(t){var e=FLe(t,"string");return Qh(e)=="symbol"?e:String(e)}function FLe(t,e){if(Qh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Qh(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jLe(t,e,r){return e=Ew(e),zLe(t,lse()?Reflect.construct(e,r||[],Ew(t).constructor):e.apply(t,r))}function zLe(t,e){if(e&&(Qh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dse(t)}function lse(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lse=function(){return!!t})()}function Ew(t){return Ew=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ew(t)}function dse(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZLe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LB(t,e)}function LB(t,e){return LB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},LB(t,e)}var co=(mB(),Qr(vB)),aa=(iB(),Qr(mae)),hse=Coe(),HLe=(Xoe(),Qr(Joe)),KLe=on(),WLe=KLe.MESSAGE,pse=Ph(),VLe=pse.Stream,cse=pse.PassThrough,GLe=ev(),jf=pb()("winston:file"),YLe=(Id(),Qr(Td)),JLe=fse();vse.exports=function(t){ZLe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$Le(this,e),r=jLe(this,e,[a]),r.name=a.name||"file";function i(h){for(var c=arguments.length,p=new Array(c>1?c-1:0),b=1;b<c;b++)p[b-1]=arguments[b];p.slice(1).forEach(function(g){if(a[g])throw new Error("Cannot set ".concat(g," and ").concat(h," together"))})}if(r._stream=new cse,r._stream.setMaxListeners(30),r._onError=r._onError.bind(dse(r)),a.filename||a.dirname)i("filename or dirname","stream"),r._basename=r.filename=a.filename?aa.basename(a.filename):"winston.log",r.dirname=a.dirname||aa.dirname(a.filename),r.options=a.options||{flags:"a"};else if(a.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),i("stream","filename","maxsize"),r._dest=r._stream.pipe(r._setupStream(a.stream)),r.dirname=aa.dirname(r._dest.path);else throw new Error("Cannot log to file without filename or stream.");return r.maxsize=a.maxsize||null,r.rotationFormat=a.rotationFormat||!1,r.zippedArchive=a.zippedArchive||!1,r.maxFiles=a.maxFiles||null,r.eol=typeof a.eol=="string"?a.eol:YLe.EOL,r.tailable=a.tailable||!1,r.lazy=a.lazy||!1,r._size=0,r._pendingSize=0,r._created=0,r._drain=!1,r._opening=!1,r._ending=!1,r._fileExist=!1,r.dirname&&r._createLogDirIfNotExist(r.dirname),r.lazy||r.open(),r}return qLe(e,[{key:"finishIfEnding",value:function(){var a=this;this._ending&&(this._opening?this.once("open",function(){a._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})}):(this._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})))}},{key:"log",value:function(a){var i=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return h(),!0;if(this._drain){this._stream.once("drain",function(){i._drain=!1,i.log(a,h)});return}if(this._rotate){this._stream.once("rotate",function(){i._rotate=!1,i.log(a,h)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",function(){i._fileExist=!0,i.log(a,h)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",function(){i._opening||i.open(),i.once("open",function(){i.log(a,h)})});return}}var c="".concat(a[WLe]).concat(this.eol),p=Me.byteLength(c);function b(){var y=this;if(this._size+=p,this._pendingSize-=p,jf("logged %s %s",this._size,c),this.emit("logged",a),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(function(){y.emit("fileclosed")});return}this._rotate=!0,this._endStream(function(){return y._rotateFile()})}}this._pendingSize+=p,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var g=this._stream.write(c,b.bind(this));return g?h():(this._drain=!0,this._stream.once("drain",function(){i._drain=!1,h()})),jf("written",g,this._drain),this.finishIfEnding(),g}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=E(a);var h=aa.join(this.dirname,this.filename),c="",p=[],b=0,g=co.createReadStream(h,{encoding:"utf8"});g.on("error",function(A){if(g.readable&&g.destroy(),!!i)return A.code!=="ENOENT"?i(A):i(null,p)}),g.on("data",function(A){A=(c+A).split(/\n+/);for(var I=A.length-1,P=0;P<I;P++)(!a.start||b>=a.start)&&y(A[P]),b++;c=A[I]}),g.on("close",function(){c&&y(c,!0),a.order==="desc"&&(p=p.reverse()),i&&i(null,p)});function y(A,I){try{var P=JSON.parse(A);x(P)&&M(P)}catch(N){I||g.emit("error",N)}}function M(A){if(a.rows&&p.length>=a.rows&&a.order!=="desc"){g.readable&&g.destroy();return}a.fields&&(A=a.fields.reduce(function(I,P){return I[P]=A[P],I},{})),a.order==="desc"&&p.length>=a.rows&&p.shift(),p.push(A)}function x(A){if(A&&Qh(A)==="object"){var I=new Date(A.timestamp);if(!(a.from&&I<a.from||a.until&&I>a.until||a.level&&a.level!==A.level))return!0}}function E(A){return A=A||{},A.rows=A.rows||A.limit||10,A.start=A.start||0,A.until=A.until||new Date,Qh(A.until)!=="object"&&(A.until=new Date(A.until)),A.from=A.from||A.until-24*60*60*1e3,Qh(A.from)!=="object"&&(A.from=new Date(A.from)),A.order=A.order||"desc",A}}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=aa.join(this.dirname,this.filename),h=new VLe,c={file:i,start:a.start};return h.destroy=JLe(c,function(p,b){if(p)return h.emit("error",p);try{h.emit("data",b),b=JSON.parse(b),h.emit("log",b)}catch(g){h.emit("error",g)}}),h}},{key:"open",value:function(){var a=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(i,h){if(i)return a.emit("error",i);jf("stat done: %s { size: %s }",a.filename,h),a._size=h,a._dest=a._createStream(a._stream),a._opening=!1,a.once("open",function(){a._stream.eventNames().includes("rotate")?a._stream.emit("rotate"):a._rotate=!1})})))}},{key:"stat",value:function(a){var i=this,h=this._getFile(),c=aa.join(this.dirname,h);co.stat(c,function(p,b){if(p&&p.code==="ENOENT")return jf("ENOENT\xA0ok",c),i.filename=h,a(null,0);if(p)return jf("err ".concat(p.code," ").concat(c)),a(p);if(!b||i._needsNewFile(b.size))return i._incFile(function(){return i.stat(a)});i.filename=h,a(null,b.size)})}},{key:"close",value:function(a){var i=this;this._stream&&this._stream.end(function(){a&&a(),i.emit("flush"),i.emit("closed")})}},{key:"_needsNewFile",value:function(a){return a=a||this._size,this.maxsize&&a>=this.maxsize}},{key:"_onError",value:function(a){this.emit("error",a)}},{key:"_setupStream",value:function(a){return a.on("error",this._onError),a}},{key:"_cleanupStream",value:function(a){return a.removeListener("error",this._onError),a.destroy(),a}},{key:"_rotateFile",value:function(){var a=this;this._incFile(function(){return a.open()})}},{key:"_endStream",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){a._cleanupStream(a._dest),i()})):i()}},{key:"_createStream",value:function(a){var i=this,h=aa.join(this.dirname,this.filename);jf("create stream start",h,this.options);var c=co.createWriteStream(h,this.options).on("error",function(p){return jf(p)}).on("close",function(){return jf("close",c.path,c.bytesWritten)}).on("open",function(){jf("file open ok",h),i.emit("open",h),a.pipe(c),i.rotatedWhileOpening&&(i._stream=new cse,i._stream.setMaxListeners(30),i._rotateFile(),i.rotatedWhileOpening=!1,i._cleanupStream(c),a.end())});return jf("create stream ok",h),c}},{key:"_incFile",value:function(a){jf("_incFile",this.filename);var i=aa.extname(this._basename),h=aa.basename(this._basename,i),c=[];this.zippedArchive&&c.push(function(p){var b=this._created>0&&!this.tailable?this._created:"";this._compressFile(aa.join(this.dirname,"".concat(h).concat(b).concat(i)),aa.join(this.dirname,"".concat(h).concat(b).concat(i,".gz")),p)}.bind(this)),c.push(function(p){this.tailable?this._checkMaxFilesTailable(i,h,p):(this._created+=1,this._checkMaxFilesIncrementing(i,h,p))}.bind(this)),hse(c,a)}},{key:"_getFile",value:function(){var a=aa.extname(this._basename),i=aa.basename(this._basename,a),h=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?"".concat(i).concat(h).concat(a):"".concat(i).concat(a)}},{key:"_checkMaxFilesIncrementing",value:function(a,i,h){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(h);var c=this._created-this.maxFiles,p=c!==0?c:"",b=this.zippedArchive?".gz":"",g="".concat(i).concat(p).concat(a).concat(b),y=aa.join(this.dirname,g);co.unlink(y,h)}},{key:"_checkMaxFilesTailable",value:function(a,i,h){var c=this,p=[];if(this.maxFiles){for(var b=this.zippedArchive?".gz":"",g=this.maxFiles-1;g>1;g--)p.push(function(y,M){var x=this,E="".concat(i).concat(y-1).concat(a).concat(b),A=aa.join(this.dirname,E);co.exists(A,function(I){if(!I)return M(null);E="".concat(i).concat(y).concat(a).concat(b),co.rename(A,aa.join(x.dirname,E),M)})}.bind(this,g));hse(p,function(){co.rename(aa.join(c.dirname,"".concat(i).concat(a).concat(b)),aa.join(c.dirname,"".concat(i,"1").concat(a).concat(b)),h)})}}},{key:"_compressFile",value:function(a,i,h){co.access(a,co.F_OK,function(c){if(c)return h();var p=HLe.createGzip(),b=co.createReadStream(a),g=co.createWriteStream(i);g.on("finish",function(){co.unlink(a,h)}),b.pipe(p).pipe(g)})}},{key:"_createLogDirIfNotExist",value:function(a){co.existsSync(a)||co.mkdirSync(a,{recursive:!0})}}]),e}(GLe)});var Ese={};Ka(Ese,{Agent:()=>iDe,ClientRequest:()=>nDe,IncomingMessage:()=>aDe,METHODS:()=>oDe,STATUS_CODES:()=>sDe,default:()=>zf,get:()=>fDe,globalAgent:()=>uDe,request:()=>hDe});function xse(){if(gse)return qo;gse=!0,qo.fetch=a(jd.fetch)&&a(jd.ReadableStream),qo.writableStream=a(jd.WritableStream),qo.abortController=a(jd.AbortController);var t;function e(){if(t!==void 0)return t;if(jd.XMLHttpRequest){t=new jd.XMLHttpRequest;try{t.open("GET",jd.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var h=e();if(!h)return!1;try{return h.responseType=i,h.responseType===i}catch{}return!1}qo.arraybuffer=qo.fetch||r("arraybuffer"),qo.msstream=!qo.fetch&&r("ms-stream"),qo.mozchunkedarraybuffer=!qo.fetch&&r("moz-chunked-arraybuffer"),qo.overrideMimeType=qo.fetch||(e()?a(e().overrideMimeType):!1);function a(i){return typeof i=="function"}return t=null,qo}function Sse(){if(bse)return Aw;bse=!0;var t=ii.Buffer,e=yr,r=xse(),a=Mr(),i=rp(),h=Aw.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=Aw.IncomingMessage=function(p,b,g,y){var M=this||Rw;if(i.Readable.call(M),M._mode=g,M.headers={},M.rawHeaders=[],M.trailers={},M.rawTrailers=[],M.on("end",function(){e.nextTick(function(){M.emit("close")})}),g==="fetch"){let L=function(){E.read().then(function(C){if(!M._destroyed){if(y(C.done),C.done){M.push(null);return}M.push(t.from(C.value)),L()}}).catch(function(C){y(!0),M._destroyed||M.emit("error",C)})};var N=L;if(M._fetchResponse=b,M.url=b.url,M.statusCode=b.status,M.statusMessage=b.statusText,b.headers.forEach(function(C,Y){M.headers[Y.toLowerCase()]=C,M.rawHeaders.push(Y,C)}),r.writableStream){var x=new WritableStream({write:function(C){return y(!1),new Promise(function(Y,G){M._destroyed?G():M.push(t.from(C))?Y():M._resumeFetch=Y})},close:function(){y(!0),M._destroyed||M.push(null)},abort:function(C){y(!0),M._destroyed||M.emit("error",C)}});try{b.body.pipeTo(x).catch(function(C){y(!0),M._destroyed||M.emit("error",C)});return}catch{}}var E=b.body.getReader();L()}else{M._xhr=p,M._pos=0,M.url=p.responseURL,M.statusCode=p.status,M.statusMessage=p.statusText;var A=p.getAllResponseHeaders().split(/\r?\n/);if(A.forEach(function(L){var C=L.match(/^([^:]+):\s*(.*)/);if(C){var Y=C[1].toLowerCase();Y==="set-cookie"?(M.headers[Y]===void 0&&(M.headers[Y]=[]),M.headers[Y].push(C[2])):M.headers[Y]!==void 0?M.headers[Y]+=", "+C[2]:M.headers[Y]=C[2],M.rawHeaders.push(C[1],C[2])}}),M._charset="x-user-defined",!r.overrideMimeType){var I=M.rawHeaders["mime-type"];if(I){var P=I.match(/;\s*charset=([^;])(;|$)/);P&&(M._charset=P[1].toLowerCase())}M._charset||(M._charset="utf-8")}}};return a(c,i.Readable),c.prototype._read=function(){var p=this||Rw,b=p._resumeFetch;b&&(p._resumeFetch=null,b())},c.prototype._onXHRProgress=function(p){var b=this||Rw,g=b._xhr,y=null;switch(b._mode){case"text":if(y=g.responseText,y.length>b._pos){var M=y.substr(b._pos);if(b._charset==="x-user-defined"){for(var x=t.alloc(M.length),E=0;E<M.length;E++)x[E]=M.charCodeAt(E)&255;b.push(x)}else b.push(M,b._charset);b._pos=y.length}break;case"arraybuffer":if(g.readyState!==h.DONE||!g.response)break;y=g.response,b.push(t.from(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=g.response,g.readyState!==h.LOADING||!y)break;b.push(t.from(new Uint8Array(y)));break;case"ms-stream":if(y=g.response,g.readyState!==h.LOADING)break;var A=new Rw.MSStreamReader;A.onprogress=function(){A.result.byteLength>b._pos&&(b.push(t.from(new Uint8Array(A.result.slice(b._pos)))),b._pos=A.result.byteLength)},A.onload=function(){p(!0),b.push(null)},A.readAsArrayBuffer(y);break}b._xhr.readyState===h.DONE&&b._mode!=="ms-stream"&&(p(!0),b.push(null))},Aw}function XLe(){if(yse)return DB;yse=!0;var t=ii.Buffer,e=yr,r=xse(),a=Mr(),i=Sse(),h=rp(),c=i.IncomingMessage,p=i.readyStates;function b(x,E){return r.fetch&&E?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&x?"arraybuffer":"text"}var g=DB=function(x){var E=this||oa;h.Writable.call(E),E._opts=x,E._body=[],E._headers={},x.auth&&E.setHeader("Authorization","Basic "+t.from(x.auth).toString("base64")),Object.keys(x.headers).forEach(function(P){E.setHeader(P,x.headers[P])});var A,I=!0;if(x.mode==="disable-fetch"||"requestTimeout"in x&&!r.abortController)I=!1,A=!0;else if(x.mode==="prefer-streaming")A=!1;else if(x.mode==="allow-wrong-content-type")A=!r.overrideMimeType;else if(!x.mode||x.mode==="default"||x.mode==="prefer-fast")A=!0;else throw new Error("Invalid value for opts.mode");E._mode=b(A,I),E._fetchTimer=null,E._socketTimeout=null,E._socketTimer=null,E.on("finish",function(){E._onFinish()})};a(g,h.Writable),g.prototype.setHeader=function(x,E){var A=this||oa,I=x.toLowerCase();M.indexOf(I)===-1&&(A._headers[I]={name:x,value:E})},g.prototype.getHeader=function(x){var E=(this||oa)._headers[x.toLowerCase()];return E?E.value:null},g.prototype.removeHeader=function(x){var E=this||oa;delete E._headers[x.toLowerCase()]},g.prototype._onFinish=function(){var x=this||oa;if(!x._destroyed){var E=x._opts;"timeout"in E&&E.timeout!==0&&x.setTimeout(E.timeout);var A=x._headers,I=null;E.method!=="GET"&&E.method!=="HEAD"&&(I=new Blob(x._body,{type:(A["content-type"]||{}).value||""}));var P=[];if(Object.keys(A).forEach(function(Y){var G=A[Y].name,ee=A[Y].value;Array.isArray(ee)?ee.forEach(function(D){P.push([G,D])}):P.push([G,ee])}),x._mode==="fetch"){var N=null;if(r.abortController){var L=new AbortController;N=L.signal,x._fetchAbortController=L,"requestTimeout"in E&&E.requestTimeout!==0&&(x._fetchTimer=oa.setTimeout(function(){x.emit("requestTimeout"),x._fetchAbortController&&x._fetchAbortController.abort()},E.requestTimeout))}oa.fetch(x._opts.url,{method:x._opts.method,headers:P,body:I||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:N}).then(function(Y){x._fetchResponse=Y,x._resetTimers(!1),x._connect()},function(Y){x._resetTimers(!0),x._destroyed||x.emit("error",Y)})}else{var C=x._xhr=new oa.XMLHttpRequest;try{C.open(x._opts.method,x._opts.url,!0)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}"responseType"in C&&(C.responseType=x._mode),"withCredentials"in C&&(C.withCredentials=!!E.withCredentials),x._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(C.timeout=E.requestTimeout,C.ontimeout=function(){x.emit("requestTimeout")}),P.forEach(function(Y){C.setRequestHeader(Y[0],Y[1])}),x._response=null,C.onreadystatechange=function(){switch(C.readyState){case p.LOADING:case p.DONE:x._onXHRProgress();break}},x._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){x._onXHRProgress()}),C.onerror=function(){x._destroyed||(x._resetTimers(!0),x.emit("error",new Error("XHR error")))};try{C.send(I)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}}}};function y(x){try{var E=x.status;return E!==null&&E!==0}catch{return!1}}g.prototype._onXHRProgress=function(){var x=this||oa;x._resetTimers(!1),!(!y(x._xhr)||x._destroyed)&&(x._response||x._connect(),x._response._onXHRProgress(x._resetTimers.bind(x)))},g.prototype._connect=function(){var x=this||oa;x._destroyed||(x._response=new c(x._xhr,x._fetchResponse,x._mode,x._resetTimers.bind(x)),x._response.on("error",function(E){x.emit("error",E)}),x.emit("response",x._response))},g.prototype._write=function(x,E,A){var I=this||oa;I._body.push(x),A()},g.prototype._resetTimers=function(x){var E=this||oa;oa.clearTimeout(E._socketTimer),E._socketTimer=null,x?(oa.clearTimeout(E._fetchTimer),E._fetchTimer=null):E._socketTimeout&&(E._socketTimer=oa.setTimeout(function(){E.emit("timeout")},E._socketTimeout))},g.prototype.abort=g.prototype.destroy=function(x){var E=this||oa;E._destroyed=!0,E._resetTimers(!0),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort(),x&&E.emit("error",x)},g.prototype.end=function(x,E,A){var I=this||oa;typeof x=="function"&&(A=x,x=void 0),h.Writable.prototype.end.call(I,x,E,A)},g.prototype.setTimeout=function(x,E){var A=this||oa;E&&A.once("timeout",E),A._socketTimeout=x,A._resetTimers(!1)},g.prototype.flushHeaders=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var M=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return DB}function QLe(){if(wse)return $B;wse=!0,$B=e;var t=Object.prototype.hasOwnProperty;function e(){for(var r={},a=0;a<arguments.length;a++){var i=arguments[a];for(var h in i)t.call(i,h)&&(r[h]=i[h])}return r}return $B}function eDe(){return _se||(_se=!0,qB={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),qB}function rDe(){if(Mse)return UB;Mse=!0;var t=XLe(),e=Sse(),r=QLe(),a=eDe(),i=vi,h=UB;return h.request=function(c,p){typeof c=="string"?c=i.parse(c):c=r(c);var b=tDe.location.protocol.search(/^https?:$/)===-1?"http:":"",g=c.protocol||b,y=c.hostname||c.host,M=c.port,x=c.path||"/";y&&y.indexOf(":")!==-1&&(y="["+y+"]"),c.url=(y?g+"//"+y:"")+(M?":"+M:"")+x,c.method=(c.method||"GET").toUpperCase(),c.headers=c.headers||{};var E=new t(c);return p&&E.on("response",p),E},h.get=function(p,b){var g=h.request(p,b);return g.end(),g},h.ClientRequest=t,h.IncomingMessage=e.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=a,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],UB}var qo,gse,jd,Aw,bse,Rw,DB,yse,oa,$B,wse,qB,_se,UB,Mse,tDe,zf,iDe,nDe,aDe,oDe,sDe,fDe,uDe,hDe,FB=xi(()=>{"use strict";ie();ae();ne();ah();sy();Ks();iw();Hs();th();zo();Fo();Gf();nb();ob();Dd();qo={},gse=!1,jd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Aw={},bse=!1,Rw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;DB={},yse=!1,oa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$B={},wse=!1;qB={},_se=!1;UB={},Mse=!1,tDe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zf=rDe(),iDe=zf.Agent,nDe=zf.ClientRequest,aDe=zf.IncomingMessage,oDe=zf.METHODS,sDe=zf.STATUS_CODES,fDe=zf.get,uDe=zf.globalAgent,hDe=zf.request});var Tse={};Ka(Tse,{Agent:()=>lDe,ClientRequest:()=>dDe,IncomingMessage:()=>pDe,METHODS:()=>vDe,STATUS_CODES:()=>mDe,default:()=>ec,get:()=>gDe,globalAgent:()=>bDe,request:()=>yDe});function cDe(){if(Ase)return jB;Ase=!0;var t=zf,e=vi,r=jB;for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.request=function(h,c){return h=i(h),t.request.call(this||Rse,h,c)},r.get=function(h,c){return h=i(h),t.get.call(this||Rse,h,c)};function i(h){if(typeof h=="string"&&(h=e.parse(h)),h.protocol||(h.protocol="https:"),h.protocol!=="https:")throw new Error('Protocol "'+h.protocol+'" not supported. Expected "https:"');return h}return jB}var jB,Ase,Rse,ec,lDe,dDe,pDe,vDe,mDe,gDe,bDe,yDe,Ise=xi(()=>{"use strict";ie();ae();ne();FB();iw();ah();Hs();th();zo();Fo();Ks();Gf();sy();nb();ob();Dd();jB={},Ase=!1,Rse=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ec=cDe(),lDe=ec.Agent,dDe=ec.ClientRequest,pDe=ec.IncomingMessage,vDe=ec.METHODS,mDe=ec.STATUS_CODES,gDe=ec.get,bDe=ec.globalAgent,yDe=ec.request});var Cse=ht((vgt,Nse)=>{"use strict";ie();ae();ne();function uv(t){"@babel/helpers - typeof";return uv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uv(t)}function kse(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function zB(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kse(Object(r),!0).forEach(function(a){wDe(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kse(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function wDe(t,e,r){return e=Pse(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bse(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Pse(a.key),a)}}function MDe(t,e,r){return e&&Bse(t.prototype,e),r&&Bse(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pse(t){var e=xDe(t,"string");return uv(e)=="symbol"?e:String(e)}function xDe(t,e){if(uv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(uv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SDe(t,e,r){return e=Tw(e),EDe(t,Ose()?Reflect.construct(e,r||[],Tw(t).constructor):e.apply(t,r))}function EDe(t,e){if(e&&(uv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ADe(t)}function ADe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ose(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ose=function(){return!!t})()}function Tw(t){return Tw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tw(t)}function RDe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ZB(t,e)}function ZB(t,e){return ZB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},ZB(t,e)}var TDe=(FB(),Qr(Ese)),IDe=(Ise(),Qr(Tse)),kDe=Ph(),BDe=kDe.Stream,PDe=ev(),ODe=Y1(),NDe=ODe.configure;Nse.exports=function(t){RDe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return _De(this,e),r=SDe(this,e,[a]),r.options=a,r.name=a.name||"http",r.ssl=!!a.ssl,r.host=a.host||"localhost",r.port=a.port,r.auth=a.auth,r.path=a.path||"",r.maximumDepth=a.maximumDepth,r.agent=a.agent,r.headers=a.headers||{},r.headers["content-type"]="application/json",r.batch=a.batch||!1,r.batchInterval=a.batchInterval||5e3,r.batchCount=a.batchCount||10,r.batchOptions=[],r.batchTimeoutID=-1,r.batchCallback={},r.port||(r.port=r.ssl?443:80),r}return MDe(e,[{key:"log",value:function(a,i){var h=this;this._request(a,null,null,function(c,p){p&&p.statusCode!==200&&(c=new Error("Invalid HTTP Status Code: ".concat(p.statusCode))),c?h.emit("warn",c):h.emit("logged",a)}),i&&setImmediate(i)}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a={method:"query",params:this.normalizeQuery(a)};var h=a.params.auth||null;delete a.params.auth;var c=a.params.path||null;delete a.params.path,this._request(a,h,c,function(p,b,g){if(b&&b.statusCode!==200&&(p=new Error("Invalid HTTP Status Code: ".concat(b.statusCode))),p)return i(p);if(typeof g=="string")try{g=JSON.parse(g)}catch(y){return i(y)}i(null,g)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new BDe;a={method:"stream",params:a};var h=a.params.path||null;delete a.params.path;var c=a.params.auth||null;delete a.params.auth;var p="",b=this._request(a,c,h);return i.destroy=function(){return b.destroy()},b.on("data",function(g){g=(p+g).split(/\n+/);for(var y=g.length-1,M=0;M<y;M++)try{i.emit("log",JSON.parse(g[M]))}catch(x){i.emit("error",x)}p=g[y]}),b.on("error",function(g){return i.emit("error",g)}),i}},{key:"_request",value:function(a,i,h,c){a=a||{},i=i||this.auth,h=h||this.path||"",this.batch?this._doBatch(a,c,i,h):this._doRequest(a,c,i,h)}},{key:"_doBatch",value:function(a,i,h,c){if(this.batchOptions.push(a),this.batchOptions.length===1){var p=this;this.batchCallback=i,this.batchTimeoutID=setTimeout(function(){p.batchTimeoutID=-1,p._doBatchRequest(p.batchCallback,h,c)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,h,c)}},{key:"_doBatchRequest",value:function(a,i,h){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var c=this.batchOptions.slice();this.batchOptions=[],this._doRequest(c,a,i,h)}},{key:"_doRequest",value:function(a,i,h,c){var p=Object.assign({},this.headers);h&&h.bearer&&(p.Authorization="Bearer ".concat(h.bearer));var b=(this.ssl?IDe:TDe).request(zB(zB({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(c.replace(/^\//,"")),headers:p,auth:h&&h.username&&h.password?"".concat(h.username,":").concat(h.password):"",agent:this.agent}));b.on("error",i),b.on("response",function(y){return y.on("end",function(){return i(null,y)}).resume()});var g=NDe(zB({},this.maximumDepth&&{maximumDepth:this.maximumDepth}));b.end(Me.from(g(a,this.options.replacer),"utf8"))}}]),e}(PDe)});var HB=ht((ygt,Lse)=>{"use strict";ie();ae();ne();var Hu=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Hu.writable=t=>Hu(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Hu.readable=t=>Hu(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Hu.duplex=t=>Hu.writable(t)&&Hu.readable(t);Hu.transform=t=>Hu.duplex(t)&&typeof t._transform=="function";Lse.exports=Hu});var Use=ht((xgt,qse)=>{"use strict";ie();ae();ne();function hv(t){"@babel/helpers - typeof";return hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hv(t)}function CDe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dse(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,DDe(a.key),a)}}function LDe(t,e,r){return e&&Dse(t.prototype,e),r&&Dse(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function DDe(t){var e=$De(t,"string");return hv(e)=="symbol"?e:String(e)}function $De(t,e){if(hv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(hv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qDe(t,e,r){return e=Iw(e),UDe(t,$se()?Reflect.construct(e,r||[],Iw(t).constructor):e.apply(t,r))}function UDe(t,e){if(e&&(hv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FDe(t)}function FDe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $se(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($se=function(){return!!t})()}function Iw(t){return Iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Iw(t)}function jDe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&KB(t,e)}function KB(t,e){return KB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},KB(t,e)}var zDe=HB(),ZDe=on(),HDe=ZDe.MESSAGE,KDe=(Id(),Qr(Td)),WDe=ev();qse.exports=function(t){jDe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(CDe(this,e),r=qDe(this,e,[a]),!a.stream||!zDe(a.stream))throw new Error("options.stream is required.");return r._stream=a.stream,r._stream.setMaxListeners(1/0),r.isObjectMode=a.stream._writableState.objectMode,r.eol=typeof a.eol=="string"?a.eol:KDe.EOL,r}return LDe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.isObjectMode){this._stream.write(a),i&&i();return}this._stream.write("".concat(a[HDe]).concat(this.eol)),i&&i()}}]),e}(WDe)});var Fse=ht(vb=>{"use strict";ie();ae();ne();Object.defineProperty(vb,"Console",{configurable:!0,enumerable:!0,get:function(){return Mne()}});Object.defineProperty(vb,"File",{configurable:!0,enumerable:!0,get:function(){return mse()}});Object.defineProperty(vb,"Http",{configurable:!0,enumerable:!0,get:function(){return Cse()}});Object.defineProperty(vb,"Stream",{configurable:!0,enumerable:!0,get:function(){return Use()}})});var Bw=ht(mb=>{"use strict";ie();ae();ne();var kw=Ok(),VDe=on(),WB=VDe.configs;mb.cli=kw.levels(WB.cli);mb.npm=kw.levels(WB.npm);mb.syslog=kw.levels(WB.syslog);mb.addColors=kw.levels});var zse=ht((Pw,jse)=>{"use strict";ie();ae();ne();Object.defineProperty(Pw,"__esModule",{value:!0});var GDe=fw(),YDe=zd(GDe),JDe=bw(),XDe=zd(JDe),QDe=_B(),e$e=zd(QDe),t$e=bB(),r$e=zd(t$e),i$e=yB(),n$e=zd(i$e),a$e=Ud(),o$e=zd(a$e),s$e=sv(),f$e=zd(s$e);function zd(t){return t&&t.__esModule?t:{default:t}}function u$e(t,e,r){r=(0,r$e.default)(r);var a=0,i=0,{length:h}=t,c=!1;h===0&&r(null);function p(b,g){b===!1&&(c=!0),c!==!0&&(b?r(b):(++i===h||g===XDe.default)&&r(null))}for(;a<h;a++)e(t[a],a,(0,n$e.default)(p))}function h$e(t,e,r){return(0,e$e.default)(t,1/0,e,r)}function c$e(t,e,r){var a=(0,YDe.default)(t)?u$e:h$e;return a(t,(0,o$e.default)(e),r)}Pw.default=(0,f$e.default)(c$e,3);jse.exports=Pw.default});var Hse=ht((Ow,Zse)=>{"use strict";ie();ae();ne();Object.defineProperty(Ow,"__esModule",{value:!0});Ow.default=l$e;function l$e(t){return(e,r,a)=>t(e,a)}Zse.exports=Ow.default});var Lw=ht((Cw,Kse)=>{"use strict";ie();ae();ne();Object.defineProperty(Cw,"__esModule",{value:!0});var d$e=zse(),p$e=Nw(d$e),v$e=Hse(),m$e=Nw(v$e),g$e=Ud(),b$e=Nw(g$e),y$e=sv(),w$e=Nw(y$e);function Nw(t){return t&&t.__esModule?t:{default:t}}function _$e(t,e,r){return(0,p$e.default)(t,(0,m$e.default)((0,b$e.default)(e)),r)}Cw.default=(0,w$e.default)(_$e,3);Kse.exports=Cw.default});var Vse=ht((Zgt,Wse)=>{"use strict";ie();ae();ne();var M$e=Object.prototype.toString;Wse.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),a=M$e.call(e).slice(8,-1);return a==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=a,r||"anonymous"}});var VB=ht((Vgt,Gse)=>{"use strict";ie();ae();ne();var x$e=Vse();Gse.exports=function(e){var r=0,a;function i(){return r||(r=1,a=e.apply(this,arguments),e=null),a}return i.displayName=x$e(e),i}});var GB=ht(bb=>{"use strict";ie();ae();ne();bb.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},a=Error.prepareStackTrace;Error.prepareStackTrace=function(h,c){return c},Error.captureStackTrace(r,t||bb.get);var i=r.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=e,i};bb.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
|
|
121
|
-
`).slice(1);return r.map(function(a){if(a.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:a,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=a.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var h=null,c=null,p=null,b=null,g=null,y=i[5]==="native";if(i[1]){p=i[1];var M=p.lastIndexOf(".");if(p[M-1]=="."&&M--,M>0){h=p.substr(0,M),c=p.substr(M+1);var x=h.indexOf(".Module");x>0&&(p=p.substr(x+1),h=h.substr(0,x))}b=null}c&&(b=h,g=c),c==="<anonymous>"&&(g=null,p=null);var E={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:p,typeName:b,methodName:g,columnNumber:parseInt(i[4],10)||null,native:y};return e._createParsedCallSite(E)}}).filter(function(a){return!!a})};function gb(t){for(var e in t)this[e]=t[e]}var S$e=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],E$e=["topLevel","eval","native","constructor"];S$e.forEach(function(t){gb.prototype[t]=null,gb.prototype["get"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});E$e.forEach(function(t){gb.prototype[t]=!1,gb.prototype["is"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});bb._createParsedCallSite=function(t){return new gb(t)}});var Qse=ht((
|
|
122
|
-
`),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:tfe.loadavg(),uptime:tfe.uptime()}}},{key:"getTrace",value:function(r){var a=r?rfe.parse(r):rfe.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleExceptions=!0;var a=new j$e(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_uncaughtException",value:function(r){var a=this.getAllInfo(r),i=this._getExceptionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,c;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),h=!1);function p(){JB("doExit",h),JB("process._exiting",He._exiting),h&&!He._exiting&&(c&&clearTimeout(c),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);U$e(i,function(b,g){var y=F$e(g),M=b.transport||b;function x(E){return function(){JB(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(c=setTimeout(p,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleExceptions})}}]),t}()});var sfe=ht((
|
|
123
|
-
`),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:ufe.loadavg(),uptime:ufe.uptime()}}},{key:"getTrace",value:function(r){var a=r?hfe.parse(r):hfe.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleRejections=!0;var a=new aqe(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_unhandledRejection",value:function(r){var a=this.getAllInfo(r),i=this._getRejectionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,c;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),h=!1);function p(){eP("doExit",h),eP("process._exiting",He._exiting),h&&!He._exiting&&(c&&clearTimeout(c),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);iqe(i,function(b,g){var y=nqe(g),M=b.transport||b;function x(E){return function(){eP(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(c=setTimeout(p,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleRejections})}}]),t}()});var vfe=ht((
|
|
124
|
-
`))};Mb.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var _fe=ht((
|
|
119
|
+
`)&&(e=e.replace(DBe,"%0A")),e.includes("\r")&&(e=e.replace($Be,"%0D")),e.includes(" ")&&(e=e.replace(qBe,"%09")),a.pathname=e,a}var vi,oBe,zu,sBe,fBe,uBe,hBe,fB,xae,Sae,Eae,cBe,lBe,aB,iv,oB,sB,Aae,Rae,pBe,vBe,mBe,gBe,bBe,uB,yBe,wBe,_Be,MBe,xBe,SBe,IBe,x1t,S1t,E1t,A1t,R1t,T1t,kBe,BBe,PBe,OBe,hB,NBe,CBe,LBe,DBe,$Be,qBe,iw=xi(()=>{"use strict";ie();ae();ne();nb();ob();Fo();Dd();Ks();vi={},oBe=Il,zu={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};vi.parse=sb,vi.resolve=function(t,e){return sb(t,!1,!0).resolve(e)},vi.resolveObject=function(t,e){return t?sb(t,!1,!0).resolveObject(e):e},vi.format=function(t){return zu.isString(t)&&(t=sb(t)),t instanceof js?t.format():js.prototype.format.call(t)},vi.Url=js;sBe=/^([a-z0-9.+-]+:)/i,fBe=/:[0-9]*$/,uBe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,hBe=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
120
|
+
`," "]),fB=["'"].concat(hBe),xae=["%","/","?",";","#"].concat(fB),Sae=["/","?","#"],Eae=/^[+a-z0-9A-Z_-]{0,63}$/,cBe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lBe={javascript:!0,"javascript:":!0},aB={javascript:!0,"javascript:":!0},iv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},oB=ju;js.prototype.parse=function(t,e,r){if(!zu.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),i=a!==-1&&a<t.indexOf("#")?"?":"#",h=t.split(i);h[0]=h[0].replace(/\\/g,"/");var c=t=h.join(i);if(c=c.trim(),!r&&t.split("#").length===1){var p=uBe.exec(c);if(p)return this.path=c,this.href=c,this.pathname=p[1],p[2]?(this.search=p[2],this.query=e?oB.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=sBe.exec(c);if(b){var g=(b=b[0]).toLowerCase();this.protocol=g,c=c.substr(b.length)}if(r||b||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var y=c.substr(0,2)==="//";!y||b&&aB[b]||(c=c.substr(2),this.slashes=!0)}if(!aB[b]&&(y||b&&!iv[b])){for(var M,x,E=-1,A=0;A<Sae.length;A++)(I=c.indexOf(Sae[A]))!==-1&&(E===-1||I<E)&&(E=I);for((x=E===-1?c.lastIndexOf("@"):c.lastIndexOf("@",E))!==-1&&(M=c.slice(0,x),c=c.slice(x+1),this.auth=decodeURIComponent(M)),E=-1,A=0;A<xae.length;A++){var I;(I=c.indexOf(xae[A]))!==-1&&(E===-1||I<E)&&(E=I)}E===-1&&(E=c.length),this.host=c.slice(0,E),c=c.slice(E),this.parseHost(),this.hostname=this.hostname||"";var P=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!P)for(var N=this.hostname.split(/\./),L=(A=0,N.length);A<L;A++){var C=N[A];if(C&&!C.match(Eae)){for(var Y="",G=0,ee=C.length;G<ee;G++)C.charCodeAt(G)>127?Y+="x":Y+=C[G];if(!Y.match(Eae)){var D=N.slice(0,A),U=N.slice(A+1),V=C.match(cBe);V&&(D.push(V[1]),U.unshift(V[2])),U.length&&(c="/"+U.join(".")+c),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=oBe.toASCII(this.hostname));var _=this.port?":"+this.port:"",n=this.hostname||"";this.host=n+_,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),c[0]!=="/"&&(c="/"+c))}if(!lBe[g])for(A=0,L=fB.length;A<L;A++){var s=fB[A];if(c.indexOf(s)!==-1){var f=encodeURIComponent(s);f===s&&(f=escape(s)),c=c.split(s).join(f)}}var u=c.indexOf("#");u!==-1&&(this.hash=c.substr(u),c=c.slice(0,u));var l=c.indexOf("?");if(l!==-1?(this.search=c.substr(l),this.query=c.substr(l+1),e&&(this.query=oB.parse(this.query)),c=c.slice(0,l)):e&&(this.search="",this.query={}),c&&(this.pathname=c),iv[g]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var m=this.search||"";this.path=_+m}return this.href=this.format(),this},js.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",a=this.hash||"",i=!1,h="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&zu.isObject(this.query)&&Object.keys(this.query).length&&(h=oB.stringify(this.query));var c=this.search||h&&"?"+h||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||iv[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),a&&a.charAt(0)!=="#"&&(a="#"+a),c&&c.charAt(0)!=="?"&&(c="?"+c),e+i+(r=r.replace(/[?#]/g,function(p){return encodeURIComponent(p)}))+(c=c.replace("#","%23"))+a},js.prototype.resolve=function(t){return this.resolveObject(sb(t,!1,!0)).format()},js.prototype.resolveObject=function(t){if(zu.isString(t)){var e=new js;e.parse(t,!1,!0),t=e}for(var r=new js,a=Object.keys(this),i=0;i<a.length;i++){var h=a[i];r[h]=this[h]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var c=Object.keys(t),p=0;p<c.length;p++){var b=c[p];b!=="protocol"&&(r[b]=t[b])}return iv[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!iv[t.protocol]){for(var g=Object.keys(t),y=0;y<g.length;y++){var M=g[y];r[M]=t[M]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||aB[t.protocol])r.pathname=t.pathname;else{for(var x=(t.pathname||"").split("/");x.length&&!(t.host=x.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),r.pathname=x.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var E=r.pathname||"",A=r.search||"";r.path=E+A}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var I=r.pathname&&r.pathname.charAt(0)==="/",P=t.host||t.pathname&&t.pathname.charAt(0)==="/",N=P||I||r.host&&t.pathname,L=N,C=r.pathname&&r.pathname.split("/")||[],Y=(x=t.pathname&&t.pathname.split("/")||[],r.protocol&&!iv[r.protocol]);if(Y&&(r.hostname="",r.port=null,r.host&&(C[0]===""?C[0]=r.host:C.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(x[0]===""?x[0]=t.host:x.unshift(t.host)),t.host=null),N=N&&(x[0]===""||C[0]==="")),P)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,C=x;else if(x.length)C||(C=[]),C.pop(),C=C.concat(x),r.search=t.search,r.query=t.query;else if(!zu.isNullOrUndefined(t.search))return Y&&(r.hostname=r.host=C.shift(),(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),r.search=t.search,r.query=t.query,zu.isNull(r.pathname)&&zu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=C.slice(-1)[0],ee=(r.host||t.host||C.length>1)&&(G==="."||G==="..")||G==="",D=0,U=C.length;U>=0;U--)(G=C[U])==="."?C.splice(U,1):G===".."?(C.splice(U,1),D++):D&&(C.splice(U,1),D--);if(!N&&!L)for(;D--;D)C.unshift("..");!N||C[0]===""||C[0]&&C[0].charAt(0)==="/"||C.unshift(""),ee&&C.join("/").substr(-1)!=="/"&&C.push("");var V,_=C[0]===""||C[0]&&C[0].charAt(0)==="/";return Y&&(r.hostname=r.host=_?"":C.length?C.shift():"",(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),(N=N||r.host&&C.length)&&!_&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),zu.isNull(r.pathname)&&zu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},js.prototype.parseHost=function(){var t=this.host,e=fBe.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};vi.Url;vi.format;vi.resolve;vi.resolveObject;sB={},Aae=!1;Rae=dBe(),pBe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=TBe;vi.fileURLToPath=EBe;vi.Url;vi.format;vi.resolve;vi.resolveObject;vi.URL;vBe=92,mBe=47,gBe=97,bBe=122,uB=pBe==="win32",yBe=/\//g,wBe=/%/g,_Be=/\\/g,MBe=/\n/g,xBe=/\r/g,SBe=/\t/g;IBe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=jBe;vi.fileURLToPath=cB;x1t=vi.Url,S1t=vi.format,E1t=vi.resolve,A1t=vi.resolveObject,R1t=vi.parse,T1t=vi.URL,kBe=92,BBe=47,PBe=97,OBe=122,hB=IBe==="win32",NBe=/\//g,CBe=/%/g,LBe=/\\/g,DBe=/\n/g,$Be=/\r/g,qBe=/\t/g});var vB={};Ka(vB,{Dir:()=>POe,Dirent:()=>OOe,F_OK:()=>UOe,FileReadStream:()=>DOe,FileWriteStream:()=>$Oe,R_OK:()=>FOe,ReadStream:()=>COe,Stats:()=>NOe,W_OK:()=>jOe,WriteStream:()=>LOe,X_OK:()=>zOe,_toUnixTimestamp:()=>qOe,access:()=>aPe,accessSync:()=>oPe,appendFile:()=>iPe,appendFileSync:()=>nPe,chmod:()=>uPe,chmodSync:()=>hPe,chown:()=>sPe,chownSync:()=>fPe,close:()=>cPe,closeSync:()=>lPe,constants:()=>ZOe,copyFile:()=>dPe,copyFileSync:()=>pPe,cp:()=>vPe,cpSync:()=>mPe,createReadStream:()=>gPe,createWriteStream:()=>bPe,default:()=>Yi,exists:()=>yPe,existsSync:()=>Xae,fchmod:()=>MPe,fchmodSync:()=>xPe,fchown:()=>wPe,fchownSync:()=>_Pe,fdatasync:()=>SPe,fdatasyncSync:()=>EPe,fstat:()=>APe,fstatSync:()=>RPe,fsync:()=>TPe,fsyncSync:()=>IPe,ftruncate:()=>kPe,ftruncateSync:()=>BPe,futimes:()=>PPe,futimesSync:()=>OPe,lchmod:()=>LPe,lchmodSync:()=>DPe,lchown:()=>NPe,lchownSync:()=>CPe,link:()=>$Pe,linkSync:()=>qPe,lstat:()=>UPe,lstatSync:()=>FPe,mkdir:()=>jPe,mkdirSync:()=>zPe,mkdtemp:()=>ZPe,mkdtempSync:()=>HPe,open:()=>KPe,openSync:()=>WPe,opendir:()=>VPe,opendirSync:()=>GPe,promises:()=>HOe,read:()=>XPe,readFile:()=>rOe,readFileSync:()=>iOe,readSync:()=>QPe,readdir:()=>YPe,readdirSync:()=>JPe,readlink:()=>nOe,readlinkSync:()=>aOe,readv:()=>eOe,readvSync:()=>tOe,realpath:()=>oOe,realpathSync:()=>sOe,rename:()=>fOe,renameSync:()=>uOe,rm:()=>hOe,rmSync:()=>cOe,rmdir:()=>lOe,rmdirSync:()=>dOe,stat:()=>pOe,statSync:()=>vOe,symlink:()=>mOe,symlinkSync:()=>gOe,truncate:()=>bOe,truncateSync:()=>yOe,unlink:()=>_Oe,unlinkSync:()=>MOe,unwatchFile:()=>wOe,utimes:()=>xOe,utimesSync:()=>SOe,watch:()=>EOe,watchFile:()=>AOe,write:()=>TOe,writeFile:()=>ROe,writeFileSync:()=>Qae,writeSync:()=>IOe,writev:()=>kOe,writevSync:()=>BOe});function hb(){return Tae||(Tae=!0,Object.defineProperty(fb,"__esModule",{value:!0}),fb.constants=void 0,fb.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),fb}function zBe(){return Iae||(Iae=!0,typeof BigInt=="function"?nw.default=BigInt:nw.default=function(){throw new Error("BigInt is not supported in this environment.")}),nw}function lB(){if(kae)return nv;kae=!0,Object.defineProperty(nv,"__esModule",{value:!0}),nv.Stats=void 0;var t=hb(),e=zBe(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){}return M.build=function(x,E){E===void 0&&(E=!1);var A=new M,I=x.uid,P=x.gid,N=x.atime,L=x.mtime,C=x.ctime,Y=E?e.default:function(ee){return ee};A.uid=Y(I),A.gid=Y(P),A.rdev=Y(0),A.blksize=Y(4096),A.ino=Y(x.ino),A.size=Y(x.getSize()),A.blocks=Y(1),A.atime=N,A.mtime=L,A.ctime=C,A.birthtime=C,A.atimeMs=Y(N.getTime()),A.mtimeMs=Y(L.getTime());var G=Y(C.getTime());return A.ctimeMs=G,A.birthtimeMs=G,A.dev=Y(0),A.mode=Y(x.mode),A.nlink=Y(x.nlink),A},M.prototype._checkModeProperty=function(x){return(Number(this.mode)&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return nv.Stats=y,nv.default=y,nv}function dB(){if(Bae)return Uf;Bae=!0;var t=Uf&&Uf.__spreadArray||function(h,c,p){if(p||arguments.length===2)for(var b=0,g=c.length,y;b<g;b++)(y||!(b in c))&&(y||(y=Array.prototype.slice.call(c,0,b)),y[b]=c[b]);return h.concat(y||Array.prototype.slice.call(c))};Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.bufferFrom=Uf.bufferAllocUnsafe=Uf.Buffer=void 0;var e=ii;Object.defineProperty(Uf,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function r(h){for(var c=[],p=1;p<arguments.length;p++)c[p-1]=arguments[p];return new(e.Buffer.bind.apply(e.Buffer,t([void 0,h],c,!1)))}var a=e.Buffer.allocUnsafe||r;Uf.bufferAllocUnsafe=a;var i=e.Buffer.from||r;return Uf.bufferFrom=i,Uf}function Hae(){if(Pae)return Fn;Pae=!0;var t=Fn&&Fn.__extends||function(){var A=function(I,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(I,P)};return function(I,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(I,P);function N(){this.constructor=I}I.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.E=Fn.AssertionError=Fn.message=Fn.RangeError=Fn.TypeError=Fn.Error=void 0;var e=or,r=gt,a=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function h(A){return function(I){t(P,I);function P(N){for(var L=[],C=1;C<arguments.length;C++)L[C-1]=arguments[C];var Y=I.call(this,b(N,L))||this;return Y.code=N,Y[a]=N,Y.name=I.prototype.name+" ["+Y[a]+"]",Y}return P}(A)}var c=typeof globalThis<"u"?globalThis:ZBe,p=function(A){t(I,A);function I(P){var N=this;if(typeof P!="object"||P===null)throw new Fn.TypeError("ERR_INVALID_ARG_TYPE","options","object");return P.message?N=A.call(this,P.message)||this:N=A.call(this,r.inspect(P.actual).slice(0,128)+" "+(P.operator+" "+r.inspect(P.expected).slice(0,128)))||this,N.generatedMessage=!P.message,N.name="AssertionError [ERR_ASSERTION]",N.code="ERR_ASSERTION",N.actual=P.actual,N.expected=P.expected,N.operator=P.operator,Fn.Error.captureStackTrace(N,P.stackStartFunction),N}return I}(c.Error);Fn.AssertionError=p;function b(A,I){e.strictEqual(typeof A,"string");var P=i[A];e(P,"An invalid error message key was used: "+A+".");var N;if(typeof P=="function")N=P;else{if(N=r.format,I===void 0||I.length===0)return P;I.unshift(P)}return String(N.apply(null,I))}Fn.message=b;function g(A,I){i[A]=typeof I=="function"?I:String(I)}Fn.E=g,Fn.Error=h(c.Error),Fn.TypeError=h(c.TypeError),Fn.RangeError=h(c.RangeError),g("ERR_ARG_NOT_ITERABLE","%s must be iterable"),g("ERR_ASSERTION","%s"),g("ERR_BUFFER_OUT_OF_BOUNDS",E),g("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),g("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),g("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),g("ERR_DNS_SET_SERVERS_FAILED",function(A,I){return'c-ares failed to set servers: "'+A+'" ['+I+"]"}),g("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),g("ERR_ENCODING_NOT_SUPPORTED",function(A){return'The "'+A+'" encoding is not supported'}),g("ERR_ENCODING_INVALID_ENCODED_DATA",function(A){return"The encoded data was not valid for encoding "+A}),g("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),g("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),g("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),g("ERR_INDEX_OUT_OF_RANGE","Index out of range"),g("ERR_INVALID_ARG_TYPE",y),g("ERR_INVALID_ARRAY_LENGTH",function(A,I,P){return e.strictEqual(typeof P,"number"),'The array "'+A+'" (length '+P+") must be of length "+I+"."}),g("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),g("ERR_INVALID_CALLBACK","Callback must be a function"),g("ERR_INVALID_CHAR","Invalid character in %s"),g("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),g("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),g("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),g("ERR_INVALID_FILE_URL_PATH","File URL path %s"),g("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),g("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),g("ERR_INVALID_OPT_VALUE",function(A,I){return'The value "'+String(I)+'" is invalid for option "'+A+'"'}),g("ERR_INVALID_OPT_VALUE_ENCODING",function(A){return'The value "'+String(A)+'" is invalid for option "encoding"'}),g("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),g("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),g("ERR_INVALID_THIS",'Value of "this" must be of type %s'),g("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),g("ERR_INVALID_URL","Invalid URL: %s"),g("ERR_INVALID_URL_SCHEME",function(A){return"The URL must be "+x(A,"scheme")}),g("ERR_IPC_CHANNEL_CLOSED","Channel closed"),g("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),g("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),g("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),g("ERR_MISSING_ARGS",M),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),g("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),g("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),g("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),g("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),g("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),g("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),g("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),g("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),g("ERR_SOCKET_CANNOT_SEND","Unable to send data"),g("ERR_SOCKET_CLOSED","Socket is closed"),g("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),g("ERR_STDERR_CLOSE","process.stderr cannot be closed"),g("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),g("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),g("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),g("ERR_TLS_DH_PARAM_SIZE",function(A){return"DH parameter size "+A+" is less than 2048"}),g("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),g("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),g("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),g("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),g("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),g("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),g("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),g("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),g("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),g("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function y(A,I,P){e(A,"name is required");var N;I.includes("not ")?(N="must not be",I=I.split("not ")[1]):N="must be";var L;if(Array.isArray(A)){var C=A.map(function(G){return'"'+G+'"'}).join(", ");L="The "+C+" arguments "+N+" "+x(I,"type")}else if(A.includes(" argument"))L="The "+A+" "+N+" "+x(I,"type");else{var Y=A.includes(".")?"property":"argument";L='The "'+A+'" '+Y+" "+N+" "+x(I,"type")}return arguments.length>=3&&(L+=". Received type "+(P!==null?typeof P:"null")),L}function M(){for(var A=[],I=0;I<arguments.length;I++)A[I]=arguments[I];e(A.length>0,"At least one arg needs to be specified");var P="The ",N=A.length;switch(A=A.map(function(L){return'"'+L+'"'}),N){case 1:P+=A[0]+" argument";break;case 2:P+=A[0]+" and "+A[1]+" arguments";break;default:P+=A.slice(0,N-1).join(", "),P+=", and "+A[N-1]+" arguments";break}return P+" must be specified"}function x(A,I){if(e(A,"expected is required"),e(typeof I=="string","thing is required"),Array.isArray(A)){var P=A.length;return e(P>0,"At least one expected value needs to be specified"),A=A.map(function(N){return String(N)}),P>2?"one of "+I+" "+A.slice(0,P-1).join(", ")+", or "+A[P-1]:P===2?"one of "+I+" "+A[0]+" or "+A[1]:"of "+I+" "+A[0]}else return"of "+I+" "+String(A)}function E(A,I){return I?"Attempt to write outside buffer bounds":'"'+A+'" is outside of buffer bounds'}return Fn}function Kae(){if(Oae)return Zu;Oae=!0,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.strToEncoding=Zu.assertEncoding=Zu.ENCODING_UTF8=void 0;var t=dB(),e=Hae();Zu.ENCODING_UTF8="utf8";function r(i){if(i&&!t.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}Zu.assertEncoding=r;function a(i,h){return!h||h===Zu.ENCODING_UTF8?i:h==="buffer"?new t.Buffer(i):new t.Buffer(i).toString(h)}return Zu.strToEncoding=a,Zu}function Wae(){if(Nae)return av;Nae=!0,Object.defineProperty(av,"__esModule",{value:!0}),av.Dirent=void 0;var t=hb(),e=Kae(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){this.name="",this.mode=0}return M.build=function(x,E){var A=new M,I=x.getNode().mode;return A.name=(0,e.strToEncoding)(x.getName(),E),A.mode=I,A},M.prototype._checkModeProperty=function(x){return(this.mode&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return av.Dirent=y,av.default=y,av}function Vae(){if(Cae)return aw;Cae=!0;var t=yr;Object.defineProperty(aw,"__esModule",{value:!0});var e;return typeof t.nextTick=="function"?e=t.nextTick.bind(typeof globalThis<"u"?globalThis:Lae):e=setTimeout.bind(typeof globalThis<"u"?globalThis:Lae),aw.default=e,aw}function Gae(){if(Dae)return ov;Dae=!0;var t=yr;Object.defineProperty(ov,"__esModule",{value:!0}),ov.createProcess=void 0;var e=function(){if(typeof t<"u")return t;try{return yr}catch{return}};function r(){var a=e()||{};return a.getuid||(a.getuid=function(){return 0}),a.getgid||(a.getgid=function(){return 0}),a.cwd||(a.cwd=function(){return"/"}),a.nextTick||(a.nextTick=Vae().default),a.emitWarning||(a.emitWarning=function(i,h){console.warn(""+h+(h?": ":"")+i)}),a.env||(a.env={}),a}return ov.createProcess=r,ov.default=r(),ov}function HBe(){if($ae)return ho;$ae=!0;var t=ho&&ho.__extends||function(){var A=function(I,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(I,P)};return function(I,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(I,P);function N(){this.constructor=I}I.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(ho,"__esModule",{value:!0}),ho.File=ho.Link=ho.Node=ho.SEP=void 0;var e=Gae(),r=dB(),a=hb(),i=Si,h=lB(),c=a.constants.S_IFMT,p=a.constants.S_IFDIR,b=a.constants.S_IFREG,g=a.constants.S_IFLNK,y=a.constants.O_APPEND;ho.SEP="/";var M=function(A){t(I,A);function I(P,N){N===void 0&&(N=438);var L=A.call(this)||this;return L.uid=e.default.getuid(),L.gid=e.default.getgid(),L.atime=new Date,L.mtime=new Date,L.ctime=new Date,L.perm=438,L.mode=b,L.nlink=1,L.perm=N,L.mode|=N,L.ino=P,L}return I.prototype.getString=function(P){return P===void 0&&(P="utf8"),this.getBuffer().toString(P)},I.prototype.setString=function(P){this.buf=(0,r.bufferFrom)(P,"utf8"),this.touch()},I.prototype.getBuffer=function(){return this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},I.prototype.setBuffer=function(P){this.buf=(0,r.bufferFrom)(P),this.touch()},I.prototype.getSize=function(){return this.buf?this.buf.length:0},I.prototype.setModeProperty=function(P){this.mode=this.mode&~c|P},I.prototype.setIsFile=function(){this.setModeProperty(b)},I.prototype.setIsDirectory=function(){this.setModeProperty(p)},I.prototype.setIsSymlink=function(){this.setModeProperty(g)},I.prototype.isFile=function(){return(this.mode&c)===b},I.prototype.isDirectory=function(){return(this.mode&c)===p},I.prototype.isSymlink=function(){return(this.mode&c)===g},I.prototype.makeSymlink=function(P){this.symlink=P,this.setIsSymlink()},I.prototype.write=function(P,N,L,C){if(N===void 0&&(N=0),L===void 0&&(L=P.length),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),C+L>this.buf.length){var Y=(0,r.bufferAllocUnsafe)(C+L);this.buf.copy(Y,0,0,this.buf.length),this.buf=Y}return P.copy(this.buf,C,N,N+L),this.touch(),L},I.prototype.read=function(P,N,L,C){N===void 0&&(N=0),L===void 0&&(L=P.byteLength),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var Y=L;return Y>P.byteLength&&(Y=P.byteLength),Y+C>this.buf.length&&(Y=this.buf.length-C),this.buf.copy(P,N,C,C+Y),Y},I.prototype.truncate=function(P){if(P===void 0&&(P=0),!P)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),P<=this.buf.length)this.buf=this.buf.slice(0,P);else{var N=(0,r.bufferAllocUnsafe)(0);this.buf.copy(N),N.fill(0,P)}this.touch()},I.prototype.chmod=function(P){this.perm=P,this.mode=this.mode&-512|P,this.touch()},I.prototype.chown=function(P,N){this.uid=P,this.gid=N,this.touch()},I.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},I.prototype.canRead=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&4||N===this.gid&&this.perm&32||P===this.uid&&this.perm&256)},I.prototype.canWrite=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&2||N===this.gid&&this.perm&16||P===this.uid&&this.perm&128)},I.prototype.del=function(){this.emit("delete",this)},I.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},I}(i.EventEmitter);ho.Node=M;var x=function(A){t(I,A);function I(P,N,L){var C=A.call(this)||this;return C.children={},C.steps=[],C.ino=0,C.length=0,C.vol=P,C.parent=N,C.steps=N?N.steps.concat([L]):[L],C}return I.prototype.setNode=function(P){this.node=P,this.ino=P.ino},I.prototype.getNode=function(){return this.node},I.prototype.createChild=function(P,N){N===void 0&&(N=this.vol.createNode());var L=new I(this.vol,this,P);return L.setNode(N),N.isDirectory(),this.setChild(P,L),L},I.prototype.setChild=function(P,N){return N===void 0&&(N=new I(this.vol,this,P)),this.children[P]=N,N.parent=this,this.length++,this.emit("child:add",N,this),N},I.prototype.deleteChild=function(P){delete this.children[P.getName()],this.length--,this.emit("child:delete",P,this)},I.prototype.getChild=function(P){if(Object.hasOwnProperty.call(this.children,P))return this.children[P]},I.prototype.getPath=function(){return this.steps.join(ho.SEP)},I.prototype.getName=function(){return this.steps[this.steps.length-1]},I.prototype.walk=function(P,N,L){if(N===void 0&&(N=P.length),L===void 0&&(L=0),L>=P.length)return this;if(L>=N)return this;var C=P[L],Y=this.getChild(C);return Y?Y.walk(P,N,L+1):null},I.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},I}(i.EventEmitter);ho.Link=x;var E=function(){function A(I,P,N,L){this.position=0,this.link=I,this.node=P,this.flags=N,this.fd=L}return A.prototype.getString=function(I){return this.node.getString()},A.prototype.setString=function(I){this.node.setString(I)},A.prototype.getBuffer=function(){return this.node.getBuffer()},A.prototype.setBuffer=function(I){this.node.setBuffer(I)},A.prototype.getSize=function(){return this.node.getSize()},A.prototype.truncate=function(I){this.node.truncate(I)},A.prototype.seekTo=function(I){this.position=I},A.prototype.stats=function(){return h.default.build(this.node)},A.prototype.write=function(I,P,N,L){P===void 0&&(P=0),N===void 0&&(N=I.length),typeof L!="number"&&(L=this.position),this.flags&y&&(L=this.getSize());var C=this.node.write(I,P,N,L);return this.position=L+C,C},A.prototype.read=function(I,P,N,L){P===void 0&&(P=0),N===void 0&&(N=I.byteLength),typeof L!="number"&&(L=this.position);var C=this.node.read(I,P,N,L);return this.position=L+C,C},A.prototype.chmod=function(I){this.node.chmod(I)},A.prototype.chown=function(I,P){this.node.chown(I,P)},A}();return ho.File=E,ho}function WBe(){if(qae)return ow;qae=!0,Object.defineProperty(ow,"__esModule",{value:!0});function t(e,r,a){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:KBe,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return ow.default=t,ow}function VBe(){if(Uae)return kl;Uae=!0;var t=kl&&kl.__spreadArray||function(i,h,c){if(c||arguments.length===2)for(var p=0,b=h.length,g;p<b;p++)(g||!(p in h))&&(g||(g=Array.prototype.slice.call(h,0,p)),g[p]=h[p]);return i.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(kl,"__esModule",{value:!0}),kl.FileHandle=void 0;function e(i,h,c){return c===void 0&&(c=function(p){return p}),function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return new Promise(function(g,y){i[h].bind(i).apply(void 0,t(t([],p,!1),[function(M,x){return M?y(M):g(c(x))}],!1))})}}var r=function(){function i(h,c){this.vol=h,this.fd=c}return i.prototype.appendFile=function(h,c){return e(this.vol,"appendFile")(this.fd,h,c)},i.prototype.chmod=function(h){return e(this.vol,"fchmod")(this.fd,h)},i.prototype.chown=function(h,c){return e(this.vol,"fchown")(this.fd,h,c)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(h,c,p,b){return e(this.vol,"read",function(g){return{bytesRead:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.readFile=function(h){return e(this.vol,"readFile")(this.fd,h)},i.prototype.stat=function(h){return e(this.vol,"fstat")(this.fd,h)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(h){return e(this.vol,"ftruncate")(this.fd,h)},i.prototype.utimes=function(h,c){return e(this.vol,"futimes")(this.fd,h,c)},i.prototype.write=function(h,c,p,b){return e(this.vol,"write",function(g){return{bytesWritten:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.writeFile=function(h,c){return e(this.vol,"writeFile")(this.fd,h,c)},i}();kl.FileHandle=r;function a(i){return typeof Promise>"u"?null:{FileHandle:r,access:function(h,c){return e(i,"access")(h,c)},appendFile:function(h,c,p){return e(i,"appendFile")(h instanceof r?h.fd:h,c,p)},chmod:function(h,c){return e(i,"chmod")(h,c)},chown:function(h,c,p){return e(i,"chown")(h,c,p)},copyFile:function(h,c,p){return e(i,"copyFile")(h,c,p)},lchmod:function(h,c){return e(i,"lchmod")(h,c)},lchown:function(h,c,p){return e(i,"lchown")(h,c,p)},link:function(h,c){return e(i,"link")(h,c)},lstat:function(h,c){return e(i,"lstat")(h,c)},mkdir:function(h,c){return e(i,"mkdir")(h,c)},mkdtemp:function(h,c){return e(i,"mkdtemp")(h,c)},open:function(h,c,p){return e(i,"open",function(b){return new r(i,b)})(h,c,p)},readdir:function(h,c){return e(i,"readdir")(h,c)},readFile:function(h,c){return e(i,"readFile")(h instanceof r?h.fd:h,c)},readlink:function(h,c){return e(i,"readlink")(h,c)},realpath:function(h,c){return e(i,"realpath")(h,c)},rename:function(h,c){return e(i,"rename")(h,c)},rmdir:function(h){return e(i,"rmdir")(h)},stat:function(h,c){return e(i,"stat")(h,c)},symlink:function(h,c,p){return e(i,"symlink")(h,c,p)},truncate:function(h,c){return e(i,"truncate")(h,c)},unlink:function(h){return e(i,"unlink")(h)},utimes:function(h,c,p){return e(i,"utimes")(h,c,p)},writeFile:function(h,c,p){return e(i,"writeFile")(h instanceof r?h.fd:h,c,p)}}}return kl.default=a,kl}function GBe(){if(Fae)return ub;Fae=!0;var t=yr;Object.defineProperty(ub,"__esModule",{value:!0}),ub.unixify=h,ub.correctPath=c;var e=t.platform==="win32";function r(p){var b=p.length-1;if(b<2)return p;for(;a(p,b);)b--;return p.substr(0,b+1)}function a(p,b){var g=p[b];return b>0&&(g==="/"||e&&g==="\\")}function i(p,b){if(typeof p!="string")throw new TypeError("expected a string");return p=p.replace(/[\\\/]+/g,"/"),b!==!1&&(p=r(p)),p}function h(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(p=i(p,b),p.replace(/^([a-zA-Z]+:|\.\/)/,"")):p}function c(p){return h(p.replace(/^\\\\\?\\.:\\/,"\\"))}return ub}function Yae(){if(jae)return hi;jae=!0;var t=hi&&hi.__extends||function(){var Ke=function(ve,we){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ze,rt){ze.__proto__=rt}||function(ze,rt){for(var ft in rt)Object.prototype.hasOwnProperty.call(rt,ft)&&(ze[ft]=rt[ft])},Ke(ve,we)};return function(ve,we){if(typeof we!="function"&&we!==null)throw new TypeError("Class extends value "+String(we)+" is not a constructor or null");Ke(ve,we);function ze(){this.constructor=ve}ve.prototype=we===null?Object.create(we):(ze.prototype=we.prototype,new ze)}}(),e=hi&&hi.__spreadArray||function(Ke,ve,we){if(we||arguments.length===2)for(var ze=0,rt=ve.length,ft;ze<rt;ze++)(ft||!(ze in ve))&&(ft||(ft=Array.prototype.slice.call(ve,0,ze)),ft[ze]=ve[ze]);return Ke.concat(ft||Array.prototype.slice.call(ve))};Object.defineProperty(hi,"__esModule",{value:!0}),hi.FSWatcher=hi.StatWatcher=hi.Volume=hi.toUnixTimestamp=hi.bufferToEncoding=hi.dataToBuffer=hi.dataToStr=hi.pathToSteps=hi.filenameToSteps=hi.pathToFilename=hi.flagsToNumber=hi.FLAGS=void 0;var r=sn,a=HBe(),i=lB(),h=Wae(),c=dB(),p=Vae(),b=Gae(),g=WBe(),y=Ia,M=hb(),x=Si,E=Kae(),A=Hae(),I=gt,P=VBe(),N=r.resolve,L=M.constants.O_RDONLY,C=M.constants.O_WRONLY,Y=M.constants.O_RDWR,G=M.constants.O_CREAT,ee=M.constants.O_EXCL,D=M.constants.O_TRUNC,U=M.constants.O_APPEND,V=M.constants.O_SYNC,_=M.constants.O_DIRECTORY,n=M.constants.F_OK,s=M.constants.COPYFILE_EXCL,f=M.constants.COPYFILE_FICLONE_FORCE,u=r.posix?r.posix:r,l=u.sep,m=u.relative,w=u.join,d=u.dirname,o=b.default.platform==="win32",v=128,R={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},S=function(Ke){return"Expected options to be either an object or a string, but got "+Ke+" instead"},B="ENOENT",F="EBADF",$="EINVAL",re="EPERM",Q="EPROTO",Z="EEXIST",K="ENOTDIR",ce="EMFILE",te="EACCES",j="EISDIR",J="ENOTEMPTY",X="ENOSYS";function he(Ke,ve,we,ze){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze="");var rt="";switch(we&&(rt=" '"+we+"'"),ze&&(rt+=" -> '"+ze+"'"),Ke){case B:return"ENOENT: no such file or directory, "+ve+rt;case F:return"EBADF: bad file descriptor, "+ve+rt;case $:return"EINVAL: invalid argument, "+ve+rt;case re:return"EPERM: operation not permitted, "+ve+rt;case Q:return"EPROTO: protocol error, "+ve+rt;case Z:return"EEXIST: file already exists, "+ve+rt;case K:return"ENOTDIR: not a directory, "+ve+rt;case j:return"EISDIR: illegal operation on a directory, "+ve+rt;case te:return"EACCES: permission denied, "+ve+rt;case J:return"ENOTEMPTY: directory not empty, "+ve+rt;case ce:return"EMFILE: too many open files, "+ve+rt;case X:return"ENOSYS: function not implemented, "+ve+rt;default:return Ke+": error occurred, "+ve+rt}}function Te(Ke,ve,we,ze,rt){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze=""),rt===void 0&&(rt=Error);var ft=new rt(he(Ke,ve,we,ze));return ft.code=Ke,ft}var oe;(function(Ke){Ke[Ke.r=L]="r",Ke[Ke["r+"]=Y]="r+",Ke[Ke.rs=L|V]="rs",Ke[Ke.sr=Ke.rs]="sr",Ke[Ke["rs+"]=Y|V]="rs+",Ke[Ke["sr+"]=Ke["rs+"]]="sr+",Ke[Ke.w=C|G|D]="w",Ke[Ke.wx=C|G|D|ee]="wx",Ke[Ke.xw=Ke.wx]="xw",Ke[Ke["w+"]=Y|G|D]="w+",Ke[Ke["wx+"]=Y|G|D|ee]="wx+",Ke[Ke["xw+"]=Ke["wx+"]]="xw+",Ke[Ke.a=C|U|G]="a",Ke[Ke.ax=C|U|G|ee]="ax",Ke[Ke.xa=Ke.ax]="xa",Ke[Ke["a+"]=Y|U|G]="a+",Ke[Ke["ax+"]=Y|U|G|ee]="ax+",Ke[Ke["xa+"]=Ke["ax+"]]="xa+"})(oe=hi.FLAGS||(hi.FLAGS={}));function le(Ke){if(typeof Ke=="number")return Ke;if(typeof Ke=="string"){var ve=oe[Ke];if(typeof ve<"u")return ve}throw new A.TypeError("ERR_INVALID_OPT_VALUE","flags",Ke)}hi.flagsToNumber=le;function ot(Ke,ve){var we;if(ve){var ze=typeof ve;switch(ze){case"string":we=Object.assign({},Ke,{encoding:ve});break;case"object":we=Object.assign({},Ke,ve);break;default:throw TypeError(S(ze))}}else return Ke;return we.encoding!=="buffer"&&(0,E.assertEncoding)(we.encoding),we}function ge(Ke){return function(ve){return ot(Ke,ve)}}function Se(Ke){if(typeof Ke!="function")throw TypeError(R.CB);return Ke}function ut(Ke){return function(ve,we){return typeof ve=="function"?[Ke(),ve]:[Ke(ve),Se(we)]}}var Ze={encoding:"utf8"},Ge=ge(Ze),ct=ut(Ge),z={flag:"r"},T=ge(z),k={encoding:"utf8",mode:438,flag:oe[oe.w]},O=ge(k),q={encoding:"utf8",mode:438,flag:oe[oe.a]},H=ge(q),W=ut(H),fe=Ze,st=ge(fe),ue=ut(st),me={mode:511,recursive:!1},pe=function(Ke){return typeof Ke=="number"?Object.assign({},me,{mode:Ke}):Object.assign({},me,Ke)},be={recursive:!1},Qe=function(Ke){return Object.assign({},be,Ke)},se={encoding:"utf8",withFileTypes:!1},ye=ge(se),Ee=ut(ye),Fe={bigint:!1},de=function(Ke){return Ke===void 0&&(Ke={}),Object.assign({},Fe,Ke)},xe=function(Ke,ve){return typeof Ke=="function"?[de(),Ke]:[de(Ke),Se(ve)]};function lt(Ke){if(Ke.hostname!=="")throw new A.TypeError("ERR_INVALID_FILE_URL_HOST",b.default.platform);for(var ve=Ke.pathname,we=0;we<ve.length;we++)if(ve[we]==="%"){var ze=ve.codePointAt(we+2)|32;if(ve[we+1]==="2"&&ze===102)throw new A.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(ve)}function _e(Ke){if(typeof Ke!="string"&&!c.Buffer.isBuffer(Ke)){try{if(!(Ke instanceof vi.URL))throw new TypeError(R.PATH_STR)}catch{throw new TypeError(R.PATH_STR)}Ke=lt(Ke)}var ve=String(Ke);return Je(ve),ve}hi.pathToFilename=_e;var Ve=function(Ke,ve){return ve===void 0&&(ve=b.default.cwd()),N(ve,Ke)};if(o){var vt=Ve,Ye=GBe().unixify;Ve=function(Ke,ve){return Ye(vt(Ke,ve))}}function et(Ke,ve){var we=Ve(Ke,ve),ze=we.substr(1);return ze?ze.split(l):[]}hi.filenameToSteps=et;function mt(Ke){return et(_e(Ke))}hi.pathToSteps=mt;function We(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke.toString(ve):Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke).toString(ve):String(Ke)}hi.dataToStr=We;function nt(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke:Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke):(0,c.bufferFrom)(String(Ke),ve)}hi.dataToBuffer=nt;function bt(Ke,ve){return!ve||ve==="buffer"?Ke:Ke.toString(ve)}hi.bufferToEncoding=bt;function Je(Ke,ve){if((""+Ke).indexOf("\0")!==-1){var we=new Error("Path must be a string without null bytes");if(we.code=B,typeof ve!="function")throw we;return b.default.nextTick(ve,we),!1}return!0}function at(Ke,ve){if(typeof Ke=="number")return Ke;if(typeof Ke=="string")return parseInt(Ke,8);if(ve)return yt(ve)}function yt(Ke,ve){var we=at(Ke,ve);if(typeof we!="number"||isNaN(we))throw new TypeError(R.MODE_INT);return we}function Xe(Ke){return Ke>>>0===Ke}function it(Ke){if(!Xe(Ke))throw TypeError(R.FD)}function _t(Ke){if(typeof Ke=="string"&&+Ke==Ke)return+Ke;if(Ke instanceof Date)return Ke.getTime()/1e3;if(isFinite(Ke))return Ke<0?Date.now()/1e3:Ke;throw new Error("Cannot parse time: "+Ke)}hi.toUnixTimestamp=_t;function dt(Ke){if(typeof Ke!="number")throw TypeError(R.UID)}function Mt(Ke){if(typeof Ke!="number")throw TypeError(R.GID)}function qt(Ke){var ve={};function we(ze,rt){for(var ft in rt){var pt=rt[ft],xt=w(ze,ft);typeof pt=="string"?ve[xt]=pt:typeof pt=="object"&&pt!==null&&Object.keys(pt).length>0?we(xt,pt):ve[xt]=null}}return we("",Ke),ve}var Ut=function(){function Ke(ve){ve===void 0&&(ve={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,P.default)(this),this.statWatchers={},this.props=Object.assign({Node:a.Node,Link:a.Link,File:a.File},ve);var we=this.createLink();we.setNode(this.createNode(!0));var ze=this;this.StatWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}($t);var rt=Lt;this.ReadStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],er=0;er<arguments.length;er++)Kt[er]=arguments[er];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(rt);var ft=Nt;this.WriteStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],er=0;er<arguments.length;er++)Kt[er]=arguments[er];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(ft),this.FSWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(zt),this.root=we}return Ke.fromJSON=function(ve,we){var ze=new Ke;return ze.fromJSON(ve,we),ze},Ke.fromNestedJSON=function(ve,we){var ze=new Ke;return ze.fromNestedJSON(ve,we),ze},Object.defineProperty(Ke.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),Ke.prototype.createLink=function(ve,we,ze,rt){if(ze===void 0&&(ze=!1),!ve)return new this.props.Link(this,null,"");if(!we)throw new Error("createLink: name cannot be empty");return ve.createChild(we,this.createNode(ze,rt))},Ke.prototype.deleteLink=function(ve){var we=ve.parent;return we?(we.deleteChild(ve),!0):!1},Ke.prototype.newInoNumber=function(){var ve=this.releasedInos.pop();return ve||(this.ino=(this.ino+1)%4294967295,this.ino)},Ke.prototype.newFdNumber=function(){var ve=this.releasedFds.pop();return typeof ve=="number"?ve:Ke.fd--},Ke.prototype.createNode=function(ve,we){ve===void 0&&(ve=!1);var ze=new this.props.Node(this.newInoNumber(),we);return ve&&ze.setIsDirectory(),this.inodes[ze.ino]=ze,ze},Ke.prototype.getNode=function(ve){return this.inodes[ve]},Ke.prototype.deleteNode=function(ve){ve.del(),delete this.inodes[ve.ino],this.releasedInos.push(ve.ino)},Ke.prototype.genRndStr=function(){var ve=(Math.random()+1).toString(36).substr(2,6);return ve.length===6?ve:this.genRndStr()},Ke.prototype.getLink=function(ve){return this.root.walk(ve)},Ke.prototype.getLinkOrThrow=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,we,ve);return rt},Ke.prototype.getResolvedLink=function(ve){for(var we=typeof ve=="string"?et(ve):ve,ze=this.root,rt=0;rt<we.length;){var ft=we[rt];if(ze=ze.getChild(ft),!ze)return null;var pt=ze.getNode();if(pt.isSymlink()){we=pt.symlink.concat(we.slice(rt+1)),ze=this.root,rt=0;continue}rt++}return ze},Ke.prototype.getResolvedLinkOrThrow=function(ve,we){var ze=this.getResolvedLink(ve);if(!ze)throw Te(B,we,ve);return ze},Ke.prototype.resolveSymlinks=function(ve){return this.getResolvedLink(ve.steps.slice(1))},Ke.prototype.getLinkAsDirOrThrow=function(ve,we){var ze=this.getLinkOrThrow(ve,we);if(!ze.getNode().isDirectory())throw Te(K,we,ve);return ze},Ke.prototype.getLinkParent=function(ve){return this.root.walk(ve,ve.length-1)},Ke.prototype.getLinkParentAsDirOrThrow=function(ve,we){var ze=ve instanceof Array?ve:et(ve),rt=this.getLinkParent(ze);if(!rt)throw Te(B,we,l+ze.join(l));if(!rt.getNode().isDirectory())throw Te(K,we,l+ze.join(l));return rt},Ke.prototype.getFileByFd=function(ve){return this.fds[String(ve)]},Ke.prototype.getFileByFdOrThrow=function(ve,we){if(!Xe(ve))throw TypeError(R.FD);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,we);return ze},Ke.prototype.getNodeByIdOrCreate=function(ve,we,ze){if(typeof ve=="number"){var rt=this.getFileByFd(ve);if(!rt)throw Error("File nto found");return rt.node}else{var ft=mt(ve),pt=this.getLink(ft);if(pt)return pt.getNode();if(we&G){var xt=this.getLinkParent(ft);if(xt){var Kt=ft[ft.length-1];return pt=this.createLink(xt,Kt,!1,ze),pt.getNode()}}throw Te(B,"getNodeByIdOrCreate",_e(ve))}},Ke.prototype.wrapAsync=function(ve,we,ze){var rt=this;Se(ze),(0,p.default)(function(){var ft;try{ft=ve.apply(rt,we)}catch(pt){ze(pt);return}ze(null,ft)})},Ke.prototype._toJSON=function(ve,we,ze){var rt;ve===void 0&&(ve=this.root),we===void 0&&(we={});var ft=!0,pt=ve.children;ve.getNode().isFile()&&(pt=(rt={},rt[ve.getName()]=ve.parent.getChild(ve.getName()),rt),ve=ve.parent);for(var xt in pt){ft=!1;var Kt=ve.getChild(xt);if(!Kt)throw new Error("_toJSON: unexpected undefined");var er=Kt.getNode();if(er.isFile()){var ci=Kt.getPath();ze&&(ci=m(ze,ci)),we[ci]=er.getString()}else er.isDirectory()&&this._toJSON(Kt,we,ze)}var yn=ve.getPath();return ze&&(yn=m(ze,yn)),yn&&ft&&(we[yn]=null),we},Ke.prototype.toJSON=function(ve,we,ze){we===void 0&&(we={}),ze===void 0&&(ze=!1);var rt=[];if(ve){ve instanceof Array||(ve=[ve]);for(var ft=0,pt=ve;ft<pt.length;ft++){var xt=pt[ft],Kt=_e(xt),er=this.getResolvedLink(Kt);er&&rt.push(er)}}else rt.push(this.root);if(!rt.length)return we;for(var ci=0,yn=rt;ci<yn.length;ci++){var er=yn[ci];this._toJSON(er,we,ze?er.getPath():"")}return we},Ke.prototype.fromJSON=function(ve,we){we===void 0&&(we=b.default.cwd());for(var ze in ve){var rt=ve[ze];if(ze=Ve(ze,we),typeof rt=="string"){var ft=d(ze);this.mkdirpBase(ft,511),this.writeFileSync(ze,rt)}else this.mkdirpBase(ze,511)}},Ke.prototype.fromNestedJSON=function(ve,we){this.fromJSON(qt(ve),we)},Ke.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},Ke.prototype.mountSync=function(ve,we){this.fromJSON(we,ve)},Ke.prototype.openLink=function(ve,we,ze){if(ze===void 0&&(ze=!0),this.openFiles>=this.maxFiles)throw Te(ce,"open",ve.getPath());var rt=ve;if(ze&&(rt=this.resolveSymlinks(ve)),!rt)throw Te(B,"open",ve.getPath());var ft=rt.getNode();if(ft.isDirectory()){if((we&(L|Y|C))!==L)throw Te(j,"open",ve.getPath())}else if(we&_)throw Te(K,"open",ve.getPath());if(!(we&C)&&!ft.canRead())throw Te(te,"open",ve.getPath());var pt=new this.props.File(ve,ft,we,this.newFdNumber());return this.fds[pt.fd]=pt,this.openFiles++,we&D&&pt.truncate(),pt},Ke.prototype.openFile=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=et(ve),pt=rt?this.getResolvedLink(ft):this.getLink(ft);if(!pt&&we&G){var xt=this.getResolvedLink(ft.slice(0,ft.length-1));if(!xt)throw Te(B,"open",l+ft.join(l));we&G&&typeof ze=="number"&&(pt=this.createLink(xt,ft[ft.length-1],!1,ze))}if(pt)return this.openLink(pt,we,rt);throw Te(B,"open",ve)},Ke.prototype.openBase=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=this.openFile(ve,we,ze,rt);if(!ft)throw Te(B,"open",ve);return ft.fd},Ke.prototype.openSync=function(ve,we,ze){ze===void 0&&(ze=438);var rt=yt(ze),ft=_e(ve),pt=le(we);return this.openBase(ft,pt,rt)},Ke.prototype.open=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=438,pt=ze),ft=ft||438;var xt=yt(ft),Kt=_e(ve),er=le(we);this.wrapAsync(this.openBase,[Kt,er,xt],pt)},Ke.prototype.closeFile=function(ve){this.fds[ve.fd]&&(this.openFiles--,delete this.fds[ve.fd],this.releasedFds.push(ve.fd))},Ke.prototype.closeSync=function(ve){it(ve);var we=this.getFileByFdOrThrow(ve,"close");this.closeFile(we)},Ke.prototype.close=function(ve,we){it(ve),this.wrapAsync(this.closeSync,[ve],we)},Ke.prototype.openFileOrGetById=function(ve,we,ze){if(typeof ve=="number"){var rt=this.fds[ve];if(!rt)throw Te(B);return rt}else return this.openFile(_e(ve),we,ze)},Ke.prototype.readBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve);return pt.read(we,Number(ze),Number(rt),ft)},Ke.prototype.readSync=function(ve,we,ze,rt,ft){return it(ve),this.readBase(ve,we,ze,rt,ft)},Ke.prototype.read=function(ve,we,ze,rt,ft,pt){var xt=this;if(Se(pt),rt===0)return b.default.nextTick(function(){pt&&pt(null,0,we)});(0,p.default)(function(){try{var Kt=xt.readBase(ve,we,ze,rt,ft);pt(null,Kt,we)}catch(er){pt(er)}})},Ke.prototype.readFileBase=function(ve,we,ze){var rt,ft=typeof ve=="number",pt=ft&&Xe(ve),xt;if(pt)xt=ve;else{var Kt=_e(ve),er=et(Kt),ci=this.getResolvedLink(er);if(ci){var yn=ci.getNode();if(yn.isDirectory())throw Te(j,"open",ci.getPath())}xt=this.openSync(ve,we)}try{rt=bt(this.getFileByFdOrThrow(xt).getBuffer(),ze)}finally{pt||this.closeSync(xt)}return rt},Ke.prototype.readFileSync=function(ve,we){var ze=T(we),rt=le(ze.flag);return this.readFileBase(ve,rt,ze.encoding)},Ke.prototype.readFile=function(ve,we,ze){var rt=ut(T)(we,ze),ft=rt[0],pt=rt[1],xt=le(ft.flag);this.wrapAsync(this.readFileBase,[ve,xt,ft.encoding],pt)},Ke.prototype.writeBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve,"write");return pt.write(we,ze,rt,ft)},Ke.prototype.writeSync=function(ve,we,ze,rt,ft){it(ve);var pt,xt,Kt,er,ci=typeof we!="string";ci?(xt=(ze||0)|0,Kt=rt,er=ft):(er=ze,pt=rt);var yn=nt(we,pt);return ci?typeof Kt>"u"&&(Kt=yn.length):(xt=0,Kt=yn.length),this.writeBase(ve,yn,xt,Kt,er)},Ke.prototype.write=function(ve,we,ze,rt,ft,pt){var xt=this;it(ve);var Kt,er,ci,yn,Zs,Vw=typeof we,wP=typeof ze,_P=typeof rt,MP=typeof ft;Vw!=="string"?wP==="function"?Zs=ze:_P==="function"?(Kt=ze|0,Zs=rt):MP==="function"?(Kt=ze|0,er=rt,Zs=ft):(Kt=ze|0,er=rt,ci=ft,Zs=pt):wP==="function"?Zs=ze:_P==="function"?(ci=ze,Zs=rt):MP==="function"&&(ci=ze,yn=rt,Zs=ft);var Ib=nt(we,yn);Vw!=="string"?typeof er>"u"&&(er=Ib.length):(Kt=0,er=Ib.length);var Gw=Se(Zs);(0,p.default)(function(){try{var xP=xt.writeBase(ve,Ib,Kt,er,ci);Vw!=="string"?Gw(null,xP,Ib):Gw(null,xP,we)}catch(aue){Gw(aue)}})},Ke.prototype.writeFileBase=function(ve,we,ze,rt){var ft=typeof ve=="number",pt;ft?pt=ve:pt=this.openBase(_e(ve),ze,rt);var xt=0,Kt=we.length,er=ze&U?void 0:0;try{for(;Kt>0;){var ci=this.writeSync(pt,we,xt,Kt,er);xt+=ci,Kt-=ci,er!==void 0&&(er+=ci)}}finally{ft||this.closeSync(pt)}},Ke.prototype.writeFileSync=function(ve,we,ze){var rt=O(ze),ft=le(rt.flag),pt=yt(rt.mode),xt=nt(we,rt.encoding);this.writeFileBase(ve,xt,ft,pt)},Ke.prototype.writeFile=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=k,pt=ze);var xt=Se(pt),Kt=O(ft),er=le(Kt.flag),ci=yt(Kt.mode),yn=nt(we,Kt.encoding);this.wrapAsync(this.writeFileBase,[ve,yn,er,ci],xt)},Ke.prototype.linkBase=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,"link",ve,we);var ft=et(we),pt=this.getLinkParent(ft);if(!pt)throw Te(B,"link",ve,we);var xt=ft[ft.length-1];if(pt.getChild(xt))throw Te(Z,"link",ve,we);var Kt=rt.getNode();Kt.nlink++,pt.createChild(xt,Kt)},Ke.prototype.copyFileBase=function(ve,we,ze){var rt=this.readFileSync(ve);if(ze&s&&this.existsSync(we))throw Te(Z,"copyFile",ve,we);if(ze&f)throw Te(X,"copyFile",ve,we);this.writeFileBase(we,rt,oe.w,438)},Ke.prototype.copyFileSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);return this.copyFileBase(rt,ft,(ze||0)|0)},Ke.prototype.copyFile=function(ve,we,ze,rt){var ft=_e(ve),pt=_e(we),xt,Kt;typeof ze=="function"?(xt=0,Kt=ze):(xt=ze,Kt=rt),Se(Kt),this.wrapAsync(this.copyFileBase,[ft,pt,xt],Kt)},Ke.prototype.linkSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.linkBase(ze,rt)},Ke.prototype.link=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.linkBase,[rt,ft],ze)},Ke.prototype.unlinkBase=function(ve){var we=et(ve),ze=this.getLink(we);if(!ze)throw Te(B,"unlink",ve);if(ze.length)throw Error("Dir not empty...");this.deleteLink(ze);var rt=ze.getNode();rt.nlink--,rt.nlink<=0&&this.deleteNode(rt)},Ke.prototype.unlinkSync=function(ve){var we=_e(ve);this.unlinkBase(we)},Ke.prototype.unlink=function(ve,we){var ze=_e(ve);this.wrapAsync(this.unlinkBase,[ze],we)},Ke.prototype.symlinkBase=function(ve,we){var ze=et(we),rt=this.getLinkParent(ze);if(!rt)throw Te(B,"symlink",ve,we);var ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"symlink",ve,we);var pt=rt.createChild(ft);return pt.getNode().makeSymlink(et(ve)),pt},Ke.prototype.symlinkSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.symlinkBase(rt,ft)},Ke.prototype.symlink=function(ve,we,ze,rt){var ft=Se(typeof ze=="function"?ze:rt),pt=_e(ve),xt=_e(we);this.wrapAsync(this.symlinkBase,[pt,xt],ft)},Ke.prototype.realpathBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"realpath",ve);return(0,E.strToEncoding)(rt.getPath(),we)},Ke.prototype.realpathSync=function(ve,we){return this.realpathBase(_e(ve),st(we).encoding)},Ke.prototype.realpath=function(ve,we,ze){var rt=ue(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.realpathBase,[xt,ft.encoding],pt)},Ke.prototype.lstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getLink(et(ve));if(!ze)throw Te(B,"lstat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.lstatSync=function(ve,we){return this.lstatBase(_e(ve),de(we).bigint)},Ke.prototype.lstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.lstatBase,[_e(ve),ft.bigint],pt)},Ke.prototype.statBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getResolvedLink(et(ve));if(!ze)throw Te(B,"stat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.statSync=function(ve,we){return this.statBase(_e(ve),de(we).bigint)},Ke.prototype.stat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.statBase,[_e(ve),ft.bigint],pt)},Ke.prototype.fstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,"fstat");return i.default.build(ze.node,we)},Ke.prototype.fstatSync=function(ve,we){return this.fstatBase(ve,de(we).bigint)},Ke.prototype.fstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.fstatBase,[ve,ft.bigint],pt)},Ke.prototype.renameBase=function(ve,we){var ze=this.getLink(et(ve));if(!ze)throw Te(B,"rename",ve,we);var rt=et(we),ft=this.getLinkParent(rt);if(!ft)throw Te(B,"rename",ve,we);var pt=ze.parent;pt&&pt.deleteChild(ze);var xt=rt[rt.length-1];ze.steps=e(e([],ft.steps,!0),[xt],!1),ft.setChild(ze.getName(),ze)},Ke.prototype.renameSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.renameBase(ze,rt)},Ke.prototype.rename=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.renameBase,[rt,ft],ze)},Ke.prototype.existsBase=function(ve){return!!this.statBase(ve)},Ke.prototype.existsSync=function(ve){try{return this.existsBase(_e(ve))}catch{return!1}},Ke.prototype.exists=function(ve,we){var ze=this,rt=_e(ve);if(typeof we!="function")throw Error(R.CB);(0,p.default)(function(){try{we(ze.existsBase(rt))}catch{we(!1)}})},Ke.prototype.accessBase=function(ve,we){this.getLinkOrThrow(ve,"access")},Ke.prototype.accessSync=function(ve,we){we===void 0&&(we=n);var ze=_e(ve);we=we|0,this.accessBase(ze,we)},Ke.prototype.access=function(ve,we,ze){var rt=n,ft;typeof we!="function"?(rt=we|0,ft=Se(ze)):ft=we;var pt=_e(ve);this.wrapAsync(this.accessBase,[pt,rt],ft)},Ke.prototype.appendFileSync=function(ve,we,ze){ze===void 0&&(ze=q);var rt=H(ze);(!rt.flag||Xe(ve))&&(rt.flag="a"),this.writeFileSync(ve,we,rt)},Ke.prototype.appendFile=function(ve,we,ze,rt){var ft=W(ze,rt),pt=ft[0],xt=ft[1];(!pt.flag||Xe(ve))&&(pt.flag="a"),this.writeFile(ve,we,pt,xt)},Ke.prototype.readdirBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"readdir",ve);var ft=rt.getNode();if(!ft.isDirectory())throw Te(K,"scandir",ve);if(we.withFileTypes){var pt=[];for(var xt in rt.children){var Kt=rt.getChild(xt);Kt&&pt.push(h.default.build(Kt,we.encoding))}return!o&&we.encoding!=="buffer"&&pt.sort(function(yn,Zs){return yn.name<Zs.name?-1:yn.name>Zs.name?1:0}),pt}var er=[];for(var ci in rt.children)er.push((0,E.strToEncoding)(ci,we.encoding));return!o&&we.encoding!=="buffer"&&er.sort(),er},Ke.prototype.readdirSync=function(ve,we){var ze=ye(we),rt=_e(ve);return this.readdirBase(rt,ze)},Ke.prototype.readdir=function(ve,we,ze){var rt=Ee(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readdirBase,[xt,ft],pt)},Ke.prototype.readlinkBase=function(ve,we){var ze=this.getLinkOrThrow(ve,"readlink"),rt=ze.getNode();if(!rt.isSymlink())throw Te($,"readlink",ve);var ft=l+rt.symlink.join(l);return(0,E.strToEncoding)(ft,we)},Ke.prototype.readlinkSync=function(ve,we){var ze=Ge(we),rt=_e(ve);return this.readlinkBase(rt,ze.encoding)},Ke.prototype.readlink=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readlinkBase,[xt,ft.encoding],pt)},Ke.prototype.fsyncBase=function(ve){this.getFileByFdOrThrow(ve,"fsync")},Ke.prototype.fsyncSync=function(ve){this.fsyncBase(ve)},Ke.prototype.fsync=function(ve,we){this.wrapAsync(this.fsyncBase,[ve],we)},Ke.prototype.fdatasyncBase=function(ve){this.getFileByFdOrThrow(ve,"fdatasync")},Ke.prototype.fdatasyncSync=function(ve){this.fdatasyncBase(ve)},Ke.prototype.fdatasync=function(ve,we){this.wrapAsync(this.fdatasyncBase,[ve],we)},Ke.prototype.ftruncateBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"ftruncate");ze.truncate(we)},Ke.prototype.ftruncateSync=function(ve,we){this.ftruncateBase(ve,we)},Ke.prototype.ftruncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);this.wrapAsync(this.ftruncateBase,[ve,rt],ft)},Ke.prototype.truncateBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.ftruncateSync(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.truncateSync=function(ve,we){if(Xe(ve))return this.ftruncateSync(ve,we);this.truncateBase(ve,we)},Ke.prototype.truncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);if(Xe(ve))return this.ftruncate(ve,rt,ft);this.wrapAsync(this.truncateBase,[ve,rt],ft)},Ke.prototype.futimesBase=function(ve,we,ze){var rt=this.getFileByFdOrThrow(ve,"futimes"),ft=rt.node;ft.atime=new Date(we*1e3),ft.mtime=new Date(ze*1e3)},Ke.prototype.futimesSync=function(ve,we,ze){this.futimesBase(ve,_t(we),_t(ze))},Ke.prototype.futimes=function(ve,we,ze,rt){this.wrapAsync(this.futimesBase,[ve,_t(we),_t(ze)],rt)},Ke.prototype.utimesBase=function(ve,we,ze){var rt=this.openSync(ve,"r+");try{this.futimesBase(rt,we,ze)}finally{this.closeSync(rt)}},Ke.prototype.utimesSync=function(ve,we,ze){this.utimesBase(_e(ve),_t(we),_t(ze))},Ke.prototype.utimes=function(ve,we,ze,rt){this.wrapAsync(this.utimesBase,[_e(ve),_t(we),_t(ze)],rt)},Ke.prototype.mkdirBase=function(ve,we){var ze=et(ve);if(!ze.length)throw Te(Z,"mkdir",ve);var rt=this.getLinkParentAsDirOrThrow(ve,"mkdir"),ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"mkdir",ve);rt.createChild(ft,this.createNode(!0,we))},Ke.prototype.mkdirpBase=function(ve,we){for(var ze=et(ve),rt=this.root,ft=0;ft<ze.length;ft++){var pt=ze[ft];if(!rt.getNode().isDirectory())throw Te(K,"mkdir",rt.getPath());var xt=rt.getChild(pt);if(xt)if(xt.getNode().isDirectory())rt=xt;else throw Te(K,"mkdir",xt.getPath());else rt=rt.createChild(pt,this.createNode(!0,we))}},Ke.prototype.mkdirSync=function(ve,we){var ze=pe(we),rt=yt(ze.mode,511),ft=_e(ve);ze.recursive?this.mkdirpBase(ft,rt):this.mkdirBase(ft,rt)},Ke.prototype.mkdir=function(ve,we,ze){var rt=pe(we),ft=Se(typeof we=="function"?we:ze),pt=yt(rt.mode,511),xt=_e(ve);rt.recursive?this.wrapAsync(this.mkdirpBase,[xt,pt],ft):this.wrapAsync(this.mkdirBase,[xt,pt],ft)},Ke.prototype.mkdirpSync=function(ve,we){this.mkdirSync(ve,{mode:we,recursive:!0})},Ke.prototype.mkdirp=function(ve,we,ze){var rt=typeof we=="function"?void 0:we,ft=Se(typeof we=="function"?we:ze);this.mkdir(ve,{mode:rt,recursive:!0},ft)},Ke.prototype.mkdtempBase=function(ve,we,ze){ze===void 0&&(ze=5);var rt=ve+this.genRndStr();try{return this.mkdirBase(rt,511),(0,E.strToEncoding)(rt,we)}catch(ft){if(ft.code===Z){if(ze>1)return this.mkdtempBase(ve,we,ze-1);throw Error("Could not create temp dir.")}else throw ft}},Ke.prototype.mkdtempSync=function(ve,we){var ze=Ge(we).encoding;if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");return Je(ve),this.mkdtempBase(ve,ze)},Ke.prototype.mkdtemp=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0].encoding,pt=rt[1];if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");Je(ve)&&this.wrapAsync(this.mkdtempBase,[ve,ft],pt)},Ke.prototype.rmdirBase=function(ve,we){var ze=Qe(we),rt=this.getLinkAsDirOrThrow(ve,"rmdir");if(rt.length&&!ze.recursive)throw Te(J,"rmdir",ve);this.deleteLink(rt)},Ke.prototype.rmdirSync=function(ve,we){this.rmdirBase(_e(ve),we)},Ke.prototype.rmdir=function(ve,we,ze){var rt=Qe(we),ft=Se(typeof we=="function"?we:ze);this.wrapAsync(this.rmdirBase,[_e(ve),rt],ft)},Ke.prototype.fchmodBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"fchmod");ze.chmod(we)},Ke.prototype.fchmodSync=function(ve,we){this.fchmodBase(ve,yt(we))},Ke.prototype.fchmod=function(ve,we,ze){this.wrapAsync(this.fchmodBase,[ve,yt(we)],ze)},Ke.prototype.chmodBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.chmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.chmodBase(rt,ze)},Ke.prototype.chmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.chmodBase,[ft,rt],ze)},Ke.prototype.lchmodBase=function(ve,we){var ze=this.openBase(ve,Y,0,!1);try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.lchmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.lchmodBase(rt,ze)},Ke.prototype.lchmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.lchmodBase,[ft,rt],ze)},Ke.prototype.fchownBase=function(ve,we,ze){this.getFileByFdOrThrow(ve,"fchown").chown(we,ze)},Ke.prototype.fchownSync=function(ve,we,ze){dt(we),Mt(ze),this.fchownBase(ve,we,ze)},Ke.prototype.fchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.fchownBase,[ve,we,ze],rt)},Ke.prototype.chownBase=function(ve,we,ze){var rt=this.getResolvedLinkOrThrow(ve,"chown"),ft=rt.getNode();ft.chown(we,ze)},Ke.prototype.chownSync=function(ve,we,ze){dt(we),Mt(ze),this.chownBase(_e(ve),we,ze)},Ke.prototype.chown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.chownBase,[_e(ve),we,ze],rt)},Ke.prototype.lchownBase=function(ve,we,ze){this.getLinkOrThrow(ve,"lchown").getNode().chown(we,ze)},Ke.prototype.lchownSync=function(ve,we,ze){dt(we),Mt(ze),this.lchownBase(_e(ve),we,ze)},Ke.prototype.lchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.lchownBase,[_e(ve),we,ze],rt)},Ke.prototype.watchFile=function(ve,we,ze){var rt=_e(ve),ft=we,pt=ze;if(typeof ft=="function"&&(pt=we,ft=null),typeof pt!="function")throw Error('"watchFile()" requires a listener function');var xt=5007,Kt=!0;ft&&typeof ft=="object"&&(typeof ft.interval=="number"&&(xt=ft.interval),typeof ft.persistent=="boolean"&&(Kt=ft.persistent));var er=this.statWatchers[rt];return er||(er=new this.StatWatcher,er.start(rt,Kt,xt),this.statWatchers[rt]=er),er.addListener("change",pt),er},Ke.prototype.unwatchFile=function(ve,we){var ze=_e(ve),rt=this.statWatchers[ze];rt&&(typeof we=="function"?rt.removeListener("change",we):rt.removeAllListeners("change"),rt.listenerCount("change")===0&&(rt.stop(),delete this.statWatchers[ze]))},Ke.prototype.createReadStream=function(ve,we){return new this.ReadStream(ve,we)},Ke.prototype.createWriteStream=function(ve,we){return new this.WriteStream(ve,we)},Ke.prototype.watch=function(ve,we,ze){var rt=_e(ve),ft=we;typeof we=="function"&&(ze=we,ft=null);var pt=Ge(ft),xt=pt.persistent,Kt=pt.recursive,er=pt.encoding;xt===void 0&&(xt=!0),Kt===void 0&&(Kt=!1);var ci=new this.FSWatcher;return ci.start(rt,xt,Kt,er),ze&&ci.addListener("change",ze),ci},Ke.fd=2147483647,Ke}();hi.Volume=Ut;function Ft(Ke){Ke.emit("stop")}var $t=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze.onInterval=function(){try{var rt=ze.vol.statSync(ze.filename);ze.hasChanged(rt)&&(ze.emit("change",rt,ze.prev),ze.prev=rt)}finally{ze.loop()}},ze.vol=we,ze}return ve.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},ve.prototype.hasChanged=function(we){return we.mtimeMs>this.prev.mtimeMs||we.nlink!==this.prev.nlink},ve.prototype.start=function(we,ze,rt){ze===void 0&&(ze=!0),rt===void 0&&(rt=5007),this.filename=_e(we),this.setTimeout=ze?setTimeout.bind(typeof globalThis<"u"?globalThis:YBe):g.default,this.interval=rt,this.prev=this.vol.statSync(this.filename),this.loop()},ve.prototype.stop=function(){clearTimeout(this.timeoutRef),b.default.nextTick(Ft,this)},ve}(x.EventEmitter);hi.StatWatcher=$t;var Tt;function Zt(Ke){Tt=(0,c.bufferAllocUnsafe)(Ke),Tt.used=0}I.inherits(Lt,y.Readable),hi.ReadStream=Lt;function Lt(Ke,ve,we){if(!(this instanceof Lt))return new Lt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),we.highWaterMark===void 0&&(we.highWaterMark=64*1024),y.Readable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"r":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.end=we.end,this.autoClose=we.autoClose===void 0?!0:we.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Lt.prototype.open=function(){var Ke=this;this._vol.open(this.path,this.flags,this.mode,function(ve,we){if(ve){Ke.autoClose&&Ke.destroy&&Ke.destroy(),Ke.emit("error",ve);return}Ke.fd=we,Ke.emit("open",we),Ke.read()})},Lt.prototype._read=function(Ke){if(typeof this.fd!="number")return this.once("open",function(){this._read(Ke)});if(this.destroyed)return;(!Tt||Tt.length-Tt.used<v)&&Zt(this._readableState.highWaterMark);var ve=Tt,we=Math.min(Tt.length-Tt.used,Ke),ze=Tt.used;if(this.pos!==void 0&&(we=Math.min(this.end-this.pos+1,we)),we<=0)return this.push(null);var rt=this;this._vol.read(this.fd,Tt,Tt.used,we,this.pos,ft),this.pos!==void 0&&(this.pos+=we),Tt.used+=we;function ft(pt,xt){if(pt)rt.autoClose&&rt.destroy&&rt.destroy(),rt.emit("error",pt);else{var Kt=null;xt>0&&(rt.bytesRead+=xt,Kt=ve.slice(ze,ze+xt)),rt.push(Kt)}}},Lt.prototype._destroy=function(Ke,ve){this.close(function(we){ve(Ke||we)})},Lt.prototype.close=function(Ke){var ve=this;if(Ke&&this.once("close",Ke),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Ht);return}return b.default.nextTick(function(){return ve.emit("close")})}this.closed=!0,this._vol.close(this.fd,function(we){we?ve.emit("error",we):ve.emit("close")}),this.fd=null};function Ht(Ke){this.close()}I.inherits(Nt,y.Writable),hi.WriteStream=Nt;function Nt(Ke,ve,we){if(!(this instanceof Nt))return new Nt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),y.Writable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"w":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.autoClose=we.autoClose===void 0?!0:!!we.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}we.encoding&&this.setDefaultEncoding(we.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Nt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(Ke,ve){if(Ke){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",Ke);return}this.fd=ve,this.emit("open",ve)}.bind(this))},Nt.prototype._write=function(Ke,ve,we){if(!(Ke instanceof c.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(Ke,ve,we)});var ze=this;this._vol.write(this.fd,Ke,0,Ke.length,this.pos,function(rt,ft){if(rt)return ze.autoClose&&ze.destroy&&ze.destroy(),we(rt);ze.bytesWritten+=ft,we()}),this.pos!==void 0&&(this.pos+=Ke.length)},Nt.prototype._writev=function(Ke,ve){if(typeof this.fd!="number")return this.once("open",function(){this._writev(Ke,ve)});for(var we=this,ze=Ke.length,rt=new Array(ze),ft=0,pt=0;pt<ze;pt++){var xt=Ke[pt].chunk;rt[pt]=xt,ft+=xt.length}var Kt=c.Buffer.concat(rt);this._vol.write(this.fd,Kt,0,Kt.length,this.pos,function(er,ci){if(er)return we.destroy&&we.destroy(),ve(er);we.bytesWritten+=ci,ve()}),this.pos!==void 0&&(this.pos+=ft)},Nt.prototype._destroy=Lt.prototype._destroy,Nt.prototype.close=Lt.prototype.close,Nt.prototype.destroySoon=Nt.prototype.end;var zt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze._filename="",ze._filenameEncoded="",ze._recursive=!1,ze._encoding=E.ENCODING_UTF8,ze._onNodeChange=function(){ze._emit("change")},ze._onParentChild=function(rt){rt.getName()===ze._getName()&&ze._emit("rename")},ze._emit=function(rt){ze.emit("change",rt,ze._filenameEncoded)},ze._persist=function(){ze._timer=setTimeout(ze._persist,1e6)},ze._vol=we,ze}return ve.prototype._getName=function(){return this._steps[this._steps.length-1]},ve.prototype.start=function(we,ze,rt,ft){ze===void 0&&(ze=!0),rt===void 0&&(rt=!1),ft===void 0&&(ft=E.ENCODING_UTF8),this._filename=_e(we),this._steps=et(this._filename),this._filenameEncoded=(0,E.strToEncoding)(this._filename),this._recursive=rt,this._encoding=ft;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Kt){var pt=new Error("watch "+this._filename+" "+Kt.code);throw pt.code=Kt.code,pt.errno=Kt.code,pt}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var xt=this._link.parent;xt&&(xt.setMaxListeners(xt.getMaxListeners()+1),xt.on("child:delete",this._onParentChild)),ze&&this._persist()},ve.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var we=this._link.parent;we&&we.removeListener("child:delete",this._onParentChild)},ve}(x.EventEmitter);return hi.FSWatcher=zt,hi}function JBe(){if(zae)return Yh;zae=!0,Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.fsAsyncMethods=Yh.fsSyncMethods=Yh.fsProps=void 0;var t=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];Yh.fsProps=t;var e=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];Yh.fsSyncMethods=e;var r=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];return Yh.fsAsyncMethods=r,Yh}function XBe(){if(Zae)return na;Zae=!0;var t=na&&na.__assign||function(){return t=Object.assign||function(E){for(var A,I=1,P=arguments.length;I<P;I++){A=arguments[I];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])}return E},t.apply(this,arguments)};Object.defineProperty(na,"__esModule",{value:!0}),na.fs=na.createFsFromVolume=na.vol=na.Volume=void 0;var e=lB(),r=Wae(),a=Yae(),i=JBe(),h=i.fsSyncMethods,c=i.fsAsyncMethods,p=hb(),b=p.constants.F_OK,g=p.constants.R_OK,y=p.constants.W_OK,M=p.constants.X_OK;na.Volume=a.Volume,na.vol=new a.Volume;function x(E){for(var A={F_OK:b,R_OK:g,W_OK:y,X_OK:M,constants:p.constants,Stats:e.default,Dirent:r.default},I=0,P=h;I<P.length;I++){var N=P[I];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}for(var L=0,C=c;L<C.length;L++){var N=C[L];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}return A.StatWatcher=E.StatWatcher,A.FSWatcher=E.FSWatcher,A.WriteStream=E.WriteStream,A.ReadStream=E.ReadStream,A.promises=E.promises,A._toUnixTimestamp=a.toUnixTimestamp,A}return na.createFsFromVolume=x,na.fs=x(na.vol),na=t(t({},na),na.fs),na.semantic=!0,na}function $o(t){throw new Error(`Node.js fs ${t} is not supported by JSPM core in the browser`)}function Jae(t,e,r){let a=0,i=new TextDecoder;Jh.watch(t,"utf8",()=>{let{size:h}=Jh.fstatSync(e),c=Me.alloc(h-a);Jh.readSync(e,c,0,c.length,a),a=h,r(i.decode(c,{stream:!0}))})}function pB(t,e){if(t.protocol==="file:")return cB(t);if(t.protocol==="https:"||t.protocol==="http:"){let r="\\\\url\\"+t.href.replaceAll(/\//g,"\\\\");if(Xae(r))return r;if(e)throw new Error(`Cannot sync request URL ${t} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let a=await fetch(t);if(!a.ok)throw new Error(`Unable to fetch ${t.href}, ${a.status}`);let i=await a.arrayBuffer();return Qae(r,Me.from(i)),r})()}throw new Error("URL "+t+" not supported in JSPM FS implementation.")}function ePe(t){return function(e,...r){return e instanceof URL?t(pB(e,!0),...r):t(e,...r)}}function tPe(t){return async function(e,...r){return e instanceof URL?t(await pB(e),...r):t(e,...r)}}function rPe(t){return function(e,...r){let a=r[r.length-1];e instanceof URL&&typeof a=="function"?pB(e).then(i=>{t(i,...r)},a):t(e,...r)}}var fb,Tae,nw,Iae,nv,kae,Uf,Bae,Fn,Pae,ZBe,Zu,Oae,av,Nae,aw,Cae,Lae,ov,Dae,ho,$ae,ow,qae,KBe,kl,Uae,ub,Fae,hi,jae,YBe,Yh,zae,na,Zae,qd,ja,Jh,QBe,Yi,iPe,nPe,aPe,oPe,sPe,fPe,uPe,hPe,cPe,lPe,dPe,pPe,vPe,mPe,gPe,bPe,yPe,Xae,wPe,_Pe,MPe,xPe,SPe,EPe,APe,RPe,TPe,IPe,kPe,BPe,PPe,OPe,NPe,CPe,LPe,DPe,$Pe,qPe,UPe,FPe,jPe,zPe,ZPe,HPe,KPe,WPe,VPe,GPe,YPe,JPe,XPe,QPe,eOe,tOe,rOe,iOe,nOe,aOe,oOe,sOe,fOe,uOe,hOe,cOe,lOe,dOe,pOe,vOe,mOe,gOe,bOe,yOe,wOe,_Oe,MOe,xOe,SOe,EOe,AOe,ROe,Qae,TOe,IOe,kOe,BOe,POe,OOe,NOe,COe,LOe,DOe,$Oe,qOe,UOe,FOe,jOe,zOe,ZOe,HOe,mB=xi(()=>{"use strict";ie();ae();ne();ah();tB();ao();zo();iB();Ks();Z0();Hs();k8();iw();Dd();Tg();lo();th();Fo();Gf();nb();ob();fb={},Tae=!1;nw={},Iae=!1;nv={},kae=!1;Uf={},Bae=!1;Fn={},Pae=!1,ZBe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Zu={},Oae=!1;av={},Nae=!1;aw={},Cae=!1,Lae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ov={},Dae=!1;ho={},$ae=!1;ow={},qae=!1,KBe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;kl={},Uae=!1;ub={},Fae=!1;hi={},jae=!1,YBe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yh={},zae=!1;na={},Zae=!1;qd=XBe();qd.__esModule;qd.fs;qd.createFsFromVolume;qd.vol;qd.Volume;qd.semantic;ja=Yae();ja.__esModule;ja.FSWatcher;ja.StatWatcher;ja.Volume;ja.toUnixTimestamp;ja.bufferToEncoding;ja.dataToBuffer;ja.dataToStr;ja.pathToSteps;ja.filenameToSteps;ja.pathToFilename;ja.flagsToNumber;ja.FLAGS;ja.ReadStream;ja.WriteStream;({vol:Jh,createFsFromVolume:QBe}=qd);Jh.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Jh.releasedFds=[2,1,0];Jh.openSync("/dev/stdin","w");Jh.openSync("/dev/stdout","r");Jh.openSync("/dev/stderr","r");Jae("/dev/stdout",1,console.log);Jae("/dev/stderr",2,console.error);Yi=QBe(Jh);Yi.opendir=()=>$o("opendir");Yi.opendirSync=()=>$o("opendirSync");Yi.promises.opendir=()=>$o("promises.opendir");Yi.cp=()=>$o("cp");Yi.cpSync=()=>$o("cpSync");Yi.promises.cp=()=>$o("promises.cp");Yi.readv=()=>$o("readv");Yi.readvSync=()=>$o("readvSync");Yi.rm=()=>$o("rm");Yi.rmSync=()=>$o("rmSync");Yi.promises.rm=()=>$o("promises.rm");Yi.Dir=()=>$o("Dir");Yi.promises.watch=()=>$o("promises.watch");Yi.FileReadStream=Yi.ReadStream;Yi.FileWriteStream=Yi.WriteStream;Yi.promises.readFile=tPe(Yi.promises.readFile);Yi.readFile=rPe(Yi.readFile);Yi.readFileSync=ePe(Yi.readFileSync);({appendFile:iPe,appendFileSync:nPe,access:aPe,accessSync:oPe,chown:sPe,chownSync:fPe,chmod:uPe,chmodSync:hPe,close:cPe,closeSync:lPe,copyFile:dPe,copyFileSync:pPe,cp:vPe,cpSync:mPe,createReadStream:gPe,createWriteStream:bPe,exists:yPe,existsSync:Xae,fchown:wPe,fchownSync:_Pe,fchmod:MPe,fchmodSync:xPe,fdatasync:SPe,fdatasyncSync:EPe,fstat:APe,fstatSync:RPe,fsync:TPe,fsyncSync:IPe,ftruncate:kPe,ftruncateSync:BPe,futimes:PPe,futimesSync:OPe,lchown:NPe,lchownSync:CPe,lchmod:LPe,lchmodSync:DPe,link:$Pe,linkSync:qPe,lstat:UPe,lstatSync:FPe,mkdir:jPe,mkdirSync:zPe,mkdtemp:ZPe,mkdtempSync:HPe,open:KPe,openSync:WPe,opendir:VPe,opendirSync:GPe,readdir:YPe,readdirSync:JPe,read:XPe,readSync:QPe,readv:eOe,readvSync:tOe,readFile:rOe,readFileSync:iOe,readlink:nOe,readlinkSync:aOe,realpath:oOe,realpathSync:sOe,rename:fOe,renameSync:uOe,rm:hOe,rmSync:cOe,rmdir:lOe,rmdirSync:dOe,stat:pOe,statSync:vOe,symlink:mOe,symlinkSync:gOe,truncate:bOe,truncateSync:yOe,unwatchFile:wOe,unlink:_Oe,unlinkSync:MOe,utimes:xOe,utimesSync:SOe,watch:EOe,watchFile:AOe,writeFile:ROe,writeFileSync:Qae,write:TOe,writeSync:IOe,writev:kOe,writevSync:BOe,Dir:POe,Dirent:OOe,Stats:NOe,ReadStream:COe,WriteStream:LOe,FileReadStream:DOe,FileWriteStream:$Oe,_toUnixTimestamp:qOe,constants:{F_OK:UOe,R_OK:FOe,W_OK:jOe,X_OK:zOe},constants:ZOe,promises:HOe}=Yi)});var fw=ht((sw,eoe)=>{"use strict";ie();ae();ne();Object.defineProperty(sw,"__esModule",{value:!0});sw.default=KOe;function KOe(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}eoe.exports=sw.default});var roe=ht((uw,toe)=>{"use strict";ie();ae();ne();Object.defineProperty(uw,"__esModule",{value:!0});uw.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};toe.exports=uw.default});var aoe=ht(Bl=>{"use strict";ie();ae();ne();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.fallback=ioe;Bl.wrap=noe;var WOe=Bl.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,VOe=Bl.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,GOe=Bl.hasNextTick=typeof He=="object"&&typeof He.nextTick=="function";function ioe(t){setTimeout(t,0)}function noe(t){return(e,...r)=>t(()=>e(...r))}var cb;WOe?cb=queueMicrotask:VOe?cb=setImmediate:GOe?cb=He.nextTick:cb=ioe;Bl.default=noe(cb)});var hoe=ht((hw,uoe)=>{"use strict";ie();ae();ne();Object.defineProperty(hw,"__esModule",{value:!0});hw.default=tNe;var YOe=roe(),JOe=foe(YOe),XOe=aoe(),QOe=foe(XOe),eNe=Ud();function foe(t){return t&&t.__esModule?t:{default:t}}function tNe(t){return(0,eNe.isAsync)(t)?function(...e){let r=e.pop(),a=t.apply(this,e);return ooe(a,r)}:(0,JOe.default)(function(e,r){var a;try{a=t.apply(this,e)}catch(i){return r(i)}if(a&&typeof a.then=="function")return ooe(a,r);r(null,a)})}function ooe(t,e){return t.then(r=>{soe(e,null,r)},r=>{soe(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function soe(t,e,r){try{t(e,r)}catch(a){(0,QOe.default)(i=>{throw i},a)}}uoe.exports=hw.default});var Ud=ht(Xh=>{"use strict";ie();ae();ne();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.isAsyncIterable=Xh.isAsyncGenerator=Xh.isAsync=void 0;var rNe=hoe(),iNe=nNe(rNe);function nNe(t){return t&&t.__esModule?t:{default:t}}function coe(t){return t[Symbol.toStringTag]==="AsyncFunction"}function aNe(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function oNe(t){return typeof t[Symbol.asyncIterator]=="function"}function sNe(t){if(typeof t!="function")throw new Error("expected a function");return coe(t)?(0,iNe.default)(t):t}Xh.default=sNe;Xh.isAsync=coe;Xh.isAsyncGenerator=aNe;Xh.isAsyncIterable=oNe});var sv=ht((cw,loe)=>{"use strict";ie();ae();ne();Object.defineProperty(cw,"__esModule",{value:!0});cw.default=fNe;function fNe(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...a){return typeof a[e-1]=="function"?t.apply(this,a):new Promise((i,h)=>{a[e-1]=(c,...p)=>{if(c)return h(c);i(p.length>1?p:p[0])},t.apply(this,a)})}return r}loe.exports=cw.default});var poe=ht((lw,doe)=>{"use strict";ie();ae();ne();Object.defineProperty(lw,"__esModule",{value:!0});var uNe=fw(),hNe=gB(uNe),cNe=Ud(),lNe=gB(cNe),dNe=sv(),pNe=gB(dNe);function gB(t){return t&&t.__esModule?t:{default:t}}lw.default=(0,pNe.default)((t,e,r)=>{var a=(0,hNe.default)(e)?[]:{};t(e,(i,h,c)=>{(0,lNe.default)(i)((p,...b)=>{b.length<2&&([b]=b),a[h]=b,c(p)})},i=>r(i,a))},3);doe.exports=lw.default});var bB=ht((dw,voe)=>{"use strict";ie();ae();ne();Object.defineProperty(dw,"__esModule",{value:!0});dw.default=vNe;function vNe(t){function e(...r){if(t!==null){var a=t;t=null,a.apply(this,r)}}return Object.assign(e,t),e}voe.exports=dw.default});var goe=ht((pw,moe)=>{"use strict";ie();ae();ne();Object.defineProperty(pw,"__esModule",{value:!0});pw.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};moe.exports=pw.default});var woe=ht((vw,yoe)=>{"use strict";ie();ae();ne();Object.defineProperty(vw,"__esModule",{value:!0});vw.default=xNe;var mNe=fw(),gNe=boe(mNe),bNe=goe(),yNe=boe(bNe);function boe(t){return t&&t.__esModule?t:{default:t}}function wNe(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function _Ne(t){var e=-1;return function(){var a=t.next();return a.done?null:(e++,{value:a.value,key:e})}}function MNe(t){var e=t?Object.keys(t):[],r=-1,a=e.length;return function i(){var h=e[++r];return h==="__proto__"?i():r<a?{value:t[h],key:h}:null}}function xNe(t){if((0,gNe.default)(t))return wNe(t);var e=(0,yNe.default)(t);return e?_Ne(e):MNe(t)}yoe.exports=vw.default});var yB=ht((mw,_oe)=>{"use strict";ie();ae();ne();Object.defineProperty(mw,"__esModule",{value:!0});mw.default=SNe;function SNe(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}_oe.exports=mw.default});var bw=ht((gw,Moe)=>{"use strict";ie();ae();ne();Object.defineProperty(gw,"__esModule",{value:!0});var ENe={};gw.default=ENe;Moe.exports=gw.default});var Soe=ht((yw,xoe)=>{"use strict";ie();ae();ne();Object.defineProperty(yw,"__esModule",{value:!0});yw.default=INe;var ANe=bw(),RNe=TNe(ANe);function TNe(t){return t&&t.__esModule?t:{default:t}}function INe(t,e,r,a){let i=!1,h=!1,c=!1,p=0,b=0;function g(){p>=e||c||i||(c=!0,t.next().then(({value:x,done:E})=>{if(!(h||i)){if(c=!1,E){i=!0,p<=0&&a(null);return}p++,r(x,b,y),b++,g()}}).catch(M))}function y(x,E){if(p-=1,!h){if(x)return M(x);if(x===!1){i=!0,h=!0;return}if(E===RNe.default||i&&p<=0)return i=!0,a(null);g()}}function M(x){h||(c=!1,i=!0,a(x))}g()}xoe.exports=yw.default});var Toe=ht((ww,Roe)=>{"use strict";ie();ae();ne();Object.defineProperty(ww,"__esModule",{value:!0});var kNe=bB(),BNe=lb(kNe),PNe=woe(),ONe=lb(PNe),NNe=yB(),CNe=lb(NNe),Eoe=Ud(),LNe=Soe(),Aoe=lb(LNe),DNe=bw(),$Ne=lb(DNe);function lb(t){return t&&t.__esModule?t:{default:t}}ww.default=t=>(e,r,a)=>{if(a=(0,BNe.default)(a),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return a(null);if((0,Eoe.isAsyncGenerator)(e))return(0,Aoe.default)(e,t,r,a);if((0,Eoe.isAsyncIterable)(e))return(0,Aoe.default)(e[Symbol.asyncIterator](),t,r,a);var i=(0,ONe.default)(e),h=!1,c=!1,p=0,b=!1;function g(M,x){if(!c)if(p-=1,M)h=!0,a(M);else if(M===!1)h=!0,c=!0;else{if(x===$Ne.default||h&&p<=0)return h=!0,a(null);b||y()}}function y(){for(b=!0;p<t&&!h;){var M=i();if(M===null){h=!0,p<=0&&a(null);return}p+=1,r(M.value,M.key,(0,CNe.default)(g))}b=!1}y()};Roe.exports=ww.default});var _B=ht((_w,Ioe)=>{"use strict";ie();ae();ne();Object.defineProperty(_w,"__esModule",{value:!0});var qNe=Toe(),UNe=wB(qNe),FNe=Ud(),jNe=wB(FNe),zNe=sv(),ZNe=wB(zNe);function wB(t){return t&&t.__esModule?t:{default:t}}function HNe(t,e,r,a){return(0,UNe.default)(e)(t,(0,jNe.default)(r),a)}_w.default=(0,ZNe.default)(HNe,4);Ioe.exports=_w.default});var Poe=ht((Mw,Boe)=>{"use strict";ie();ae();ne();Object.defineProperty(Mw,"__esModule",{value:!0});var KNe=_B(),WNe=koe(KNe),VNe=sv(),GNe=koe(VNe);function koe(t){return t&&t.__esModule?t:{default:t}}function YNe(t,e,r){return(0,WNe.default)(t,1,e,r)}Mw.default=(0,GNe.default)(YNe,3);Boe.exports=Mw.default});var Coe=ht((xw,Noe)=>{"use strict";ie();ae();ne();Object.defineProperty(xw,"__esModule",{value:!0});xw.default=tCe;var JNe=poe(),XNe=Ooe(JNe),QNe=Poe(),eCe=Ooe(QNe);function Ooe(t){return t&&t.__esModule?t:{default:t}}function tCe(t,e){return(0,XNe.default)(eCe.default,t,e)}Noe.exports=xw.default});var Joe={};Ka(Joe,{Deflate:()=>lCe,DeflateRaw:()=>dCe,Gunzip:()=>pCe,Gzip:()=>vCe,Inflate:()=>mCe,InflateRaw:()=>gCe,Unzip:()=>bCe,Z_BEST_COMPRESSION:()=>yCe,Z_BEST_SPEED:()=>wCe,Z_BINARY:()=>_Ce,Z_BLOCK:()=>MCe,Z_BUF_ERROR:()=>xCe,Z_DATA_ERROR:()=>SCe,Z_DEFAULT_CHUNK:()=>ECe,Z_DEFAULT_COMPRESSION:()=>ACe,Z_DEFAULT_LEVEL:()=>RCe,Z_DEFAULT_MEMLEVEL:()=>TCe,Z_DEFAULT_STRATEGY:()=>ICe,Z_DEFAULT_WINDOWBITS:()=>kCe,Z_DEFLATED:()=>BCe,Z_ERRNO:()=>PCe,Z_FILTERED:()=>OCe,Z_FINISH:()=>NCe,Z_FIXED:()=>CCe,Z_FULL_FLUSH:()=>LCe,Z_HUFFMAN_ONLY:()=>DCe,Z_MAX_CHUNK:()=>$Ce,Z_MAX_LEVEL:()=>qCe,Z_MAX_MEMLEVEL:()=>UCe,Z_MAX_WINDOWBITS:()=>FCe,Z_MIN_CHUNK:()=>jCe,Z_MIN_LEVEL:()=>zCe,Z_MIN_MEMLEVEL:()=>ZCe,Z_MIN_WINDOWBITS:()=>HCe,Z_NEED_DICT:()=>KCe,Z_NO_COMPRESSION:()=>WCe,Z_NO_FLUSH:()=>VCe,Z_OK:()=>GCe,Z_PARTIAL_FLUSH:()=>YCe,Z_RLE:()=>JCe,Z_STREAM_END:()=>XCe,Z_STREAM_ERROR:()=>QCe,Z_SYNC_FLUSH:()=>eLe,Z_TEXT:()=>tLe,Z_TREES:()=>rLe,Z_UNKNOWN:()=>iLe,Zlib:()=>nLe,codes:()=>aLe,createDeflate:()=>oLe,createDeflateRaw:()=>sLe,createGunzip:()=>fLe,createGzip:()=>uLe,createInflate:()=>hLe,createInflateRaw:()=>cLe,createUnzip:()=>lLe,default:()=>At,deflate:()=>dLe,deflateRaw:()=>pLe,deflateRawSync:()=>vLe,deflateSync:()=>mLe,gunzip:()=>gLe,gunzipSync:()=>bLe,gzip:()=>yLe,gzipSync:()=>wLe,inflate:()=>_Le,inflateRaw:()=>MLe,inflateRawSync:()=>xLe,inflateSync:()=>SLe,unzip:()=>ELe,unzipSync:()=>ALe});function rCe(){if(Loe)return MB;Loe=!0;function t(){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}return MB=t,MB}function Sw(){if(Doe)return Ba;Doe=!0;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,h){return Object.prototype.hasOwnProperty.call(i,h)}Ba.assign=function(i){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var c=h.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var p in c)e(c,p)&&(i[p]=c[p])}}return i},Ba.shrinkBuf=function(i,h){return i.length===h?i:i.subarray?i.subarray(0,h):(i.length=h,i)};var r={arraySet:function(i,h,c,p,b){if(h.subarray&&i.subarray){i.set(h.subarray(c,c+p),b);return}for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){var h,c,p,b,g,y;for(p=0,h=0,c=i.length;h<c;h++)p+=i[h].length;for(y=new Uint8Array(p),b=0,h=0,c=i.length;h<c;h++)g=i[h],y.set(g,b),b+=g.length;return y}},a={arraySet:function(i,h,c,p,b){for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){return[].concat.apply([],i)}};return Ba.setTyped=function(i){i?(Ba.Buf8=Uint8Array,Ba.Buf16=Uint16Array,Ba.Buf32=Int32Array,Ba.assign(Ba,r)):(Ba.Buf8=Array,Ba.Buf16=Array,Ba.Buf32=Array,Ba.assign(Ba,a))},Ba.setTyped(t),Ba}function iCe(){if($oe)return Fd;$oe=!0;var t=Sw(),e=4,r=0,a=1,i=2;function h(H){for(var W=H.length;--W>=0;)H[W]=0}var c=0,p=1,b=2,g=3,y=258,M=29,x=256,E=x+1+M,A=30,I=19,P=2*E+1,N=15,L=16,C=7,Y=256,G=16,ee=17,D=18,U=[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],V=[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],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=512,f=new Array((E+2)*2);h(f);var u=new Array(A*2);h(u);var l=new Array(s);h(l);var m=new Array(y-g+1);h(m);var w=new Array(M);h(w);var d=new Array(A);h(d);function o(H,W,fe,st,ue){this.static_tree=H,this.extra_bits=W,this.extra_base=fe,this.elems=st,this.max_length=ue,this.has_stree=H&&H.length}var v,R,S;function B(H,W){this.dyn_tree=H,this.max_code=0,this.stat_desc=W}function F(H){return H<256?l[H]:l[256+(H>>>7)]}function $(H,W){H.pending_buf[H.pending++]=W&255,H.pending_buf[H.pending++]=W>>>8&255}function re(H,W,fe){H.bi_valid>L-fe?(H.bi_buf|=W<<H.bi_valid&65535,$(H,H.bi_buf),H.bi_buf=W>>L-H.bi_valid,H.bi_valid+=fe-L):(H.bi_buf|=W<<H.bi_valid&65535,H.bi_valid+=fe)}function Q(H,W,fe){re(H,fe[W*2],fe[W*2+1])}function Z(H,W){var fe=0;do fe|=H&1,H>>>=1,fe<<=1;while(--W>0);return fe>>>1}function K(H){H.bi_valid===16?($(H,H.bi_buf),H.bi_buf=0,H.bi_valid=0):H.bi_valid>=8&&(H.pending_buf[H.pending++]=H.bi_buf&255,H.bi_buf>>=8,H.bi_valid-=8)}function ce(H,W){var fe=W.dyn_tree,st=W.max_code,ue=W.stat_desc.static_tree,me=W.stat_desc.has_stree,pe=W.stat_desc.extra_bits,be=W.stat_desc.extra_base,Qe=W.stat_desc.max_length,se,ye,Ee,Fe,de,xe,lt=0;for(Fe=0;Fe<=N;Fe++)H.bl_count[Fe]=0;for(fe[H.heap[H.heap_max]*2+1]=0,se=H.heap_max+1;se<P;se++)ye=H.heap[se],Fe=fe[fe[ye*2+1]*2+1]+1,Fe>Qe&&(Fe=Qe,lt++),fe[ye*2+1]=Fe,!(ye>st)&&(H.bl_count[Fe]++,de=0,ye>=be&&(de=pe[ye-be]),xe=fe[ye*2],H.opt_len+=xe*(Fe+de),me&&(H.static_len+=xe*(ue[ye*2+1]+de)));if(lt!==0){do{for(Fe=Qe-1;H.bl_count[Fe]===0;)Fe--;H.bl_count[Fe]--,H.bl_count[Fe+1]+=2,H.bl_count[Qe]--,lt-=2}while(lt>0);for(Fe=Qe;Fe!==0;Fe--)for(ye=H.bl_count[Fe];ye!==0;)Ee=H.heap[--se],!(Ee>st)&&(fe[Ee*2+1]!==Fe&&(H.opt_len+=(Fe-fe[Ee*2+1])*fe[Ee*2],fe[Ee*2+1]=Fe),ye--)}}function te(H,W,fe){var st=new Array(N+1),ue=0,me,pe;for(me=1;me<=N;me++)st[me]=ue=ue+fe[me-1]<<1;for(pe=0;pe<=W;pe++){var be=H[pe*2+1];be!==0&&(H[pe*2]=Z(st[be]++,be))}}function j(){var H,W,fe,st,ue,me=new Array(N+1);for(fe=0,st=0;st<M-1;st++)for(w[st]=fe,H=0;H<1<<U[st];H++)m[fe++]=st;for(m[fe-1]=st,ue=0,st=0;st<16;st++)for(d[st]=ue,H=0;H<1<<V[st];H++)l[ue++]=st;for(ue>>=7;st<A;st++)for(d[st]=ue<<7,H=0;H<1<<V[st]-7;H++)l[256+ue++]=st;for(W=0;W<=N;W++)me[W]=0;for(H=0;H<=143;)f[H*2+1]=8,H++,me[8]++;for(;H<=255;)f[H*2+1]=9,H++,me[9]++;for(;H<=279;)f[H*2+1]=7,H++,me[7]++;for(;H<=287;)f[H*2+1]=8,H++,me[8]++;for(te(f,E+1,me),H=0;H<A;H++)u[H*2+1]=5,u[H*2]=Z(H,5);v=new o(f,U,x+1,E,N),R=new o(u,V,0,A,N),S=new o(new Array(0),_,0,I,C)}function J(H){var W;for(W=0;W<E;W++)H.dyn_ltree[W*2]=0;for(W=0;W<A;W++)H.dyn_dtree[W*2]=0;for(W=0;W<I;W++)H.bl_tree[W*2]=0;H.dyn_ltree[Y*2]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function X(H){H.bi_valid>8?$(H,H.bi_buf):H.bi_valid>0&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function he(H,W,fe,st){X(H),st&&($(H,fe),$(H,~fe)),t.arraySet(H.pending_buf,H.window,W,fe,H.pending),H.pending+=fe}function Te(H,W,fe,st){var ue=W*2,me=fe*2;return H[ue]<H[me]||H[ue]===H[me]&&st[W]<=st[fe]}function oe(H,W,fe){for(var st=H.heap[fe],ue=fe<<1;ue<=H.heap_len&&(ue<H.heap_len&&Te(W,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Te(W,st,H.heap[ue],H.depth));)H.heap[fe]=H.heap[ue],fe=ue,ue<<=1;H.heap[fe]=st}function le(H,W,fe){var st,ue,me=0,pe,be;if(H.last_lit!==0)do st=H.pending_buf[H.d_buf+me*2]<<8|H.pending_buf[H.d_buf+me*2+1],ue=H.pending_buf[H.l_buf+me],me++,st===0?Q(H,ue,W):(pe=m[ue],Q(H,pe+x+1,W),be=U[pe],be!==0&&(ue-=w[pe],re(H,ue,be)),st--,pe=F(st),Q(H,pe,fe),be=V[pe],be!==0&&(st-=d[pe],re(H,st,be)));while(me<H.last_lit);Q(H,Y,W)}function ot(H,W){var fe=W.dyn_tree,st=W.stat_desc.static_tree,ue=W.stat_desc.has_stree,me=W.stat_desc.elems,pe,be,Qe=-1,se;for(H.heap_len=0,H.heap_max=P,pe=0;pe<me;pe++)fe[pe*2]!==0?(H.heap[++H.heap_len]=Qe=pe,H.depth[pe]=0):fe[pe*2+1]=0;for(;H.heap_len<2;)se=H.heap[++H.heap_len]=Qe<2?++Qe:0,fe[se*2]=1,H.depth[se]=0,H.opt_len--,ue&&(H.static_len-=st[se*2+1]);for(W.max_code=Qe,pe=H.heap_len>>1;pe>=1;pe--)oe(H,fe,pe);se=me;do pe=H.heap[1],H.heap[1]=H.heap[H.heap_len--],oe(H,fe,1),be=H.heap[1],H.heap[--H.heap_max]=pe,H.heap[--H.heap_max]=be,fe[se*2]=fe[pe*2]+fe[be*2],H.depth[se]=(H.depth[pe]>=H.depth[be]?H.depth[pe]:H.depth[be])+1,fe[pe*2+1]=fe[be*2+1]=se,H.heap[1]=se++,oe(H,fe,1);while(H.heap_len>=2);H.heap[--H.heap_max]=H.heap[1],ce(H,W),te(fe,Qe,H.bl_count)}function ge(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),W[(fe+1)*2+1]=65535,st=0;st<=fe;st++)me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)&&(be<se?H.bl_tree[me*2]+=be:me!==0?(me!==ue&&H.bl_tree[me*2]++,H.bl_tree[G*2]++):be<=10?H.bl_tree[ee*2]++:H.bl_tree[D*2]++,be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4))}function Se(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),st=0;st<=fe;st++)if(me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)){if(be<se)do Q(H,me,H.bl_tree);while(--be!==0);else me!==0?(me!==ue&&(Q(H,me,H.bl_tree),be--),Q(H,G,H.bl_tree),re(H,be-3,2)):be<=10?(Q(H,ee,H.bl_tree),re(H,be-3,3)):(Q(H,D,H.bl_tree),re(H,be-11,7));be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4)}}function ut(H){var W;for(ge(H,H.dyn_ltree,H.l_desc.max_code),ge(H,H.dyn_dtree,H.d_desc.max_code),ot(H,H.bl_desc),W=I-1;W>=3&&H.bl_tree[n[W]*2+1]===0;W--);return H.opt_len+=3*(W+1)+5+5+4,W}function Ze(H,W,fe,st){var ue;for(re(H,W-257,5),re(H,fe-1,5),re(H,st-4,4),ue=0;ue<st;ue++)re(H,H.bl_tree[n[ue]*2+1],3);Se(H,H.dyn_ltree,W-1),Se(H,H.dyn_dtree,fe-1)}function Ge(H){var W=4093624447,fe;for(fe=0;fe<=31;fe++,W>>>=1)if(W&1&&H.dyn_ltree[fe*2]!==0)return r;if(H.dyn_ltree[9*2]!==0||H.dyn_ltree[10*2]!==0||H.dyn_ltree[13*2]!==0)return a;for(fe=32;fe<x;fe++)if(H.dyn_ltree[fe*2]!==0)return a;return r}var ct=!1;function z(H){ct||(j(),ct=!0),H.l_desc=new B(H.dyn_ltree,v),H.d_desc=new B(H.dyn_dtree,R),H.bl_desc=new B(H.bl_tree,S),H.bi_buf=0,H.bi_valid=0,J(H)}function T(H,W,fe,st){re(H,(c<<1)+(st?1:0),3),he(H,W,fe,!0)}function k(H){re(H,p<<1,3),Q(H,Y,f),K(H)}function O(H,W,fe,st){var ue,me,pe=0;H.level>0?(H.strm.data_type===i&&(H.strm.data_type=Ge(H)),ot(H,H.l_desc),ot(H,H.d_desc),pe=ut(H),ue=H.opt_len+3+7>>>3,me=H.static_len+3+7>>>3,me<=ue&&(ue=me)):ue=me=fe+5,fe+4<=ue&&W!==-1?T(H,W,fe,st):H.strategy===e||me===ue?(re(H,(p<<1)+(st?1:0),3),le(H,f,u)):(re(H,(b<<1)+(st?1:0),3),Ze(H,H.l_desc.max_code+1,H.d_desc.max_code+1,pe+1),le(H,H.dyn_ltree,H.dyn_dtree)),J(H),st&&X(H)}function q(H,W,fe){return H.pending_buf[H.d_buf+H.last_lit*2]=W>>>8&255,H.pending_buf[H.d_buf+H.last_lit*2+1]=W&255,H.pending_buf[H.l_buf+H.last_lit]=fe&255,H.last_lit++,W===0?H.dyn_ltree[fe*2]++:(H.matches++,W--,H.dyn_ltree[(m[fe]+x+1)*2]++,H.dyn_dtree[F(W)*2]++),H.last_lit===H.lit_bufsize-1}return Fd._tr_init=z,Fd._tr_stored_block=T,Fd._tr_flush_block=O,Fd._tr_tally=q,Fd._tr_align=k,Fd}function Goe(){if(qoe)return xB;qoe=!0;function t(e,r,a,i){for(var h=e&65535|0,c=e>>>16&65535|0,p=0;a!==0;){p=a>2e3?2e3:a,a-=p;do h=h+r[i++]|0,c=c+h|0;while(--p);h%=65521,c%=65521}return h|c<<16|0}return xB=t,xB}function Yoe(){if(Uoe)return SB;Uoe=!0;function t(){for(var a,i=[],h=0;h<256;h++){a=h;for(var c=0;c<8;c++)a=a&1?3988292384^a>>>1:a>>>1;i[h]=a}return i}var e=t();function r(a,i,h,c){var p=e,b=c+h;a^=-1;for(var g=c;g<b;g++)a=a>>>8^p[(a^i[g])&255];return a^-1}return SB=r,SB}function nCe(){return Foe||(Foe=!0,EB={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"}),EB}function aCe(){if(joe)return Ff;joe=!0;var t=Sw(),e=iCe(),r=Goe(),a=Yoe(),i=nCe(),h=0,c=1,p=3,b=4,g=5,y=0,M=1,x=-2,E=-3,A=-5,I=-1,P=1,N=2,L=3,C=4,Y=0,G=2,ee=8,D=9,U=15,V=8,_=29,n=256,s=n+1+_,f=30,u=19,l=2*s+1,m=15,w=3,d=258,o=d+w+1,v=32,R=42,S=69,B=73,F=91,$=103,re=113,Q=666,Z=1,K=2,ce=3,te=4,j=3;function J(se,ye){return se.msg=i[ye],ye}function X(se){return(se<<1)-(se>4?9:0)}function he(se){for(var ye=se.length;--ye>=0;)se[ye]=0}function Te(se){var ye=se.state,Ee=ye.pending;Ee>se.avail_out&&(Ee=se.avail_out),Ee!==0&&(t.arraySet(se.output,ye.pending_buf,ye.pending_out,Ee,se.next_out),se.next_out+=Ee,ye.pending_out+=Ee,se.total_out+=Ee,se.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function oe(se,ye){e._tr_flush_block(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ye),se.block_start=se.strstart,Te(se.strm)}function le(se,ye){se.pending_buf[se.pending++]=ye}function ot(se,ye){se.pending_buf[se.pending++]=ye>>>8&255,se.pending_buf[se.pending++]=ye&255}function ge(se,ye,Ee,Fe){var de=se.avail_in;return de>Fe&&(de=Fe),de===0?0:(se.avail_in-=de,t.arraySet(ye,se.input,se.next_in,de,Ee),se.state.wrap===1?se.adler=r(se.adler,ye,de,Ee):se.state.wrap===2&&(se.adler=a(se.adler,ye,de,Ee)),se.next_in+=de,se.total_in+=de,de)}function Se(se,ye){var Ee=se.max_chain_length,Fe=se.strstart,de,xe,lt=se.prev_length,_e=se.nice_match,Ve=se.strstart>se.w_size-o?se.strstart-(se.w_size-o):0,vt=se.window,Ye=se.w_mask,et=se.prev,mt=se.strstart+d,We=vt[Fe+lt-1],nt=vt[Fe+lt];se.prev_length>=se.good_match&&(Ee>>=2),_e>se.lookahead&&(_e=se.lookahead);do if(de=ye,!(vt[de+lt]!==nt||vt[de+lt-1]!==We||vt[de]!==vt[Fe]||vt[++de]!==vt[Fe+1])){Fe+=2,de++;do;while(vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&Fe<mt);if(xe=d-(mt-Fe),Fe=mt-d,xe>lt){if(se.match_start=ye,lt=xe,xe>=_e)break;We=vt[Fe+lt-1],nt=vt[Fe+lt]}}while((ye=et[ye&Ye])>Ve&&--Ee!==0);return lt<=se.lookahead?lt:se.lookahead}function ut(se){var ye=se.w_size,Ee,Fe,de,xe,lt;do{if(xe=se.window_size-se.lookahead-se.strstart,se.strstart>=ye+(ye-o)){t.arraySet(se.window,se.window,ye,ye,0),se.match_start-=ye,se.strstart-=ye,se.block_start-=ye,Fe=se.hash_size,Ee=Fe;do de=se.head[--Ee],se.head[Ee]=de>=ye?de-ye:0;while(--Fe);Fe=ye,Ee=Fe;do de=se.prev[--Ee],se.prev[Ee]=de>=ye?de-ye:0;while(--Fe);xe+=ye}if(se.strm.avail_in===0)break;if(Fe=ge(se.strm,se.window,se.strstart+se.lookahead,xe),se.lookahead+=Fe,se.lookahead+se.insert>=w)for(lt=se.strstart-se.insert,se.ins_h=se.window[lt],se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+w-1])&se.hash_mask,se.prev[lt&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=lt,lt++,se.insert--,!(se.lookahead+se.insert<w)););}while(se.lookahead<o&&se.strm.avail_in!==0)}function Ze(se,ye){var Ee=65535;for(Ee>se.pending_buf_size-5&&(Ee=se.pending_buf_size-5);;){if(se.lookahead<=1){if(ut(se),se.lookahead===0&&ye===h)return Z;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var Fe=se.block_start+Ee;if((se.strstart===0||se.strstart>=Fe)&&(se.lookahead=se.strstart-Fe,se.strstart=Fe,oe(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-o&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):(se.strstart>se.block_start&&(oe(se,!1),se.strm.avail_out===0),Z)}function Ge(se,ye){for(var Ee,Fe;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ee!==0&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee)),se.match_length>=w)if(Fe=e._tr_tally(se,se.strstart-se.match_start,se.match_length-w),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=w){se.match_length--;do se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else Fe=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function ct(se,ye){for(var Ee,Fe,de;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=w-1,Ee!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee),se.match_length<=5&&(se.strategy===P||se.match_length===w&&se.strstart-se.match_start>4096)&&(se.match_length=w-1)),se.prev_length>=w&&se.match_length<=se.prev_length){de=se.strstart+se.lookahead-w,Fe=e._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-w),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=de&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=w-1,se.strstart++,Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}else if(se.match_available){if(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),Fe&&oe(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Z}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function z(se,ye){for(var Ee,Fe,de,xe,lt=se.window;;){if(se.lookahead<=d){if(ut(se),se.lookahead<=d&&ye===h)return Z;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=w&&se.strstart>0&&(de=se.strstart-1,Fe=lt[de],Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de])){xe=se.strstart+d;do;while(Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&de<xe);se.match_length=d-(xe-de),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=w?(Ee=e._tr_tally(se,1,se.match_length-w),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function T(se,ye){for(var Ee;;){if(se.lookahead===0&&(ut(se),se.lookahead===0)){if(ye===h)return Z;break}if(se.match_length=0,Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function k(se,ye,Ee,Fe,de){this.good_length=se,this.max_lazy=ye,this.nice_length=Ee,this.max_chain=Fe,this.func=de}var O;O=[new k(0,0,0,0,Ze),new k(4,4,8,4,Ge),new k(4,5,16,8,Ge),new k(4,6,32,32,Ge),new k(4,4,16,16,ct),new k(8,16,32,32,ct),new k(8,16,128,128,ct),new k(8,32,128,256,ct),new k(32,128,258,1024,ct),new k(32,258,258,4096,ct)];function q(se){se.window_size=2*se.w_size,he(se.head),se.max_lazy_match=O[se.level].max_lazy,se.good_match=O[se.level].good_length,se.nice_match=O[se.level].nice_length,se.max_chain_length=O[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=w-1,se.match_available=0,se.ins_h=0}function H(){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=ee,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 t.Buf16(l*2),this.dyn_dtree=new t.Buf16((2*f+1)*2),this.bl_tree=new t.Buf16((2*u+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(m+1),this.heap=new t.Buf16(2*s+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*s+1),he(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 W(se){var ye;return!se||!se.state?J(se,x):(se.total_in=se.total_out=0,se.data_type=G,ye=se.state,ye.pending=0,ye.pending_out=0,ye.wrap<0&&(ye.wrap=-ye.wrap),ye.status=ye.wrap?R:re,se.adler=ye.wrap===2?0:1,ye.last_flush=h,e._tr_init(ye),y)}function fe(se){var ye=W(se);return ye===y&&q(se.state),ye}function st(se,ye){return!se||!se.state||se.state.wrap!==2?x:(se.state.gzhead=ye,y)}function ue(se,ye,Ee,Fe,de,xe){if(!se)return x;var lt=1;if(ye===I&&(ye=6),Fe<0?(lt=0,Fe=-Fe):Fe>15&&(lt=2,Fe-=16),de<1||de>D||Ee!==ee||Fe<8||Fe>15||ye<0||ye>9||xe<0||xe>C)return J(se,x);Fe===8&&(Fe=9);var _e=new H;return se.state=_e,_e.strm=se,_e.wrap=lt,_e.gzhead=null,_e.w_bits=Fe,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=de+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+w-1)/w),_e.window=new t.Buf8(_e.w_size*2),_e.head=new t.Buf16(_e.hash_size),_e.prev=new t.Buf16(_e.w_size),_e.lit_bufsize=1<<de+6,_e.pending_buf_size=_e.lit_bufsize*4,_e.pending_buf=new t.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ye,_e.strategy=xe,_e.method=Ee,fe(se)}function me(se,ye){return ue(se,ye,ee,U,V,Y)}function pe(se,ye){var Ee,Fe,de,xe;if(!se||!se.state||ye>g||ye<0)return se?J(se,x):x;if(Fe=se.state,!se.output||!se.input&&se.avail_in!==0||Fe.status===Q&&ye!==b)return J(se,se.avail_out===0?A:x);if(Fe.strm=se,Ee=Fe.last_flush,Fe.last_flush=ye,Fe.status===R)if(Fe.wrap===2)se.adler=0,le(Fe,31),le(Fe,139),le(Fe,8),Fe.gzhead?(le(Fe,(Fe.gzhead.text?1:0)+(Fe.gzhead.hcrc?2:0)+(Fe.gzhead.extra?4:0)+(Fe.gzhead.name?8:0)+(Fe.gzhead.comment?16:0)),le(Fe,Fe.gzhead.time&255),le(Fe,Fe.gzhead.time>>8&255),le(Fe,Fe.gzhead.time>>16&255),le(Fe,Fe.gzhead.time>>24&255),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,Fe.gzhead.os&255),Fe.gzhead.extra&&Fe.gzhead.extra.length&&(le(Fe,Fe.gzhead.extra.length&255),le(Fe,Fe.gzhead.extra.length>>8&255)),Fe.gzhead.hcrc&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending,0)),Fe.gzindex=0,Fe.status=S):(le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,j),Fe.status=re);else{var lt=ee+(Fe.w_bits-8<<4)<<8,_e=-1;Fe.strategy>=N||Fe.level<2?_e=0:Fe.level<6?_e=1:Fe.level===6?_e=2:_e=3,lt|=_e<<6,Fe.strstart!==0&&(lt|=v),lt+=31-lt%31,Fe.status=re,ot(Fe,lt),Fe.strstart!==0&&(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),se.adler=1}if(Fe.status===S)if(Fe.gzhead.extra){for(de=Fe.pending;Fe.gzindex<(Fe.gzhead.extra.length&65535)&&!(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size));)le(Fe,Fe.gzhead.extra[Fe.gzindex]&255),Fe.gzindex++;Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Fe.gzindex===Fe.gzhead.extra.length&&(Fe.gzindex=0,Fe.status=B)}else Fe.status=B;if(Fe.status===B)if(Fe.gzhead.name){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.name.length?xe=Fe.gzhead.name.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.gzindex=0,Fe.status=F)}else Fe.status=F;if(Fe.status===F)if(Fe.gzhead.comment){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.comment.length?xe=Fe.gzhead.comment.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.status=$)}else Fe.status=$;if(Fe.status===$&&(Fe.gzhead.hcrc?(Fe.pending+2>Fe.pending_buf_size&&Te(se),Fe.pending+2<=Fe.pending_buf_size&&(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),se.adler=0,Fe.status=re)):Fe.status=re),Fe.pending!==0){if(Te(se),se.avail_out===0)return Fe.last_flush=-1,y}else if(se.avail_in===0&&X(ye)<=X(Ee)&&ye!==b)return J(se,A);if(Fe.status===Q&&se.avail_in!==0)return J(se,A);if(se.avail_in!==0||Fe.lookahead!==0||ye!==h&&Fe.status!==Q){var Ve=Fe.strategy===N?T(Fe,ye):Fe.strategy===L?z(Fe,ye):O[Fe.level].func(Fe,ye);if((Ve===ce||Ve===te)&&(Fe.status=Q),Ve===Z||Ve===ce)return se.avail_out===0&&(Fe.last_flush=-1),y;if(Ve===K&&(ye===c?e._tr_align(Fe):ye!==g&&(e._tr_stored_block(Fe,0,0,!1),ye===p&&(he(Fe.head),Fe.lookahead===0&&(Fe.strstart=0,Fe.block_start=0,Fe.insert=0))),Te(se),se.avail_out===0))return Fe.last_flush=-1,y}return ye!==b?y:Fe.wrap<=0?M:(Fe.wrap===2?(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),le(Fe,se.adler>>16&255),le(Fe,se.adler>>24&255),le(Fe,se.total_in&255),le(Fe,se.total_in>>8&255),le(Fe,se.total_in>>16&255),le(Fe,se.total_in>>24&255)):(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),Te(se),Fe.wrap>0&&(Fe.wrap=-Fe.wrap),Fe.pending!==0?y:M)}function be(se){var ye;return!se||!se.state?x:(ye=se.state.status,ye!==R&&ye!==S&&ye!==B&&ye!==F&&ye!==$&&ye!==re&&ye!==Q?J(se,x):(se.state=null,ye===re?J(se,E):y))}function Qe(se,ye){var Ee=ye.length,Fe,de,xe,lt,_e,Ve,vt,Ye;if(!se||!se.state||(Fe=se.state,lt=Fe.wrap,lt===2||lt===1&&Fe.status!==R||Fe.lookahead))return x;for(lt===1&&(se.adler=r(se.adler,ye,Ee,0)),Fe.wrap=0,Ee>=Fe.w_size&&(lt===0&&(he(Fe.head),Fe.strstart=0,Fe.block_start=0,Fe.insert=0),Ye=new t.Buf8(Fe.w_size),t.arraySet(Ye,ye,Ee-Fe.w_size,Fe.w_size,0),ye=Ye,Ee=Fe.w_size),_e=se.avail_in,Ve=se.next_in,vt=se.input,se.avail_in=Ee,se.next_in=0,se.input=ye,ut(Fe);Fe.lookahead>=w;){de=Fe.strstart,xe=Fe.lookahead-(w-1);do Fe.ins_h=(Fe.ins_h<<Fe.hash_shift^Fe.window[de+w-1])&Fe.hash_mask,Fe.prev[de&Fe.w_mask]=Fe.head[Fe.ins_h],Fe.head[Fe.ins_h]=de,de++;while(--xe);Fe.strstart=de,Fe.lookahead=w-1,ut(Fe)}return Fe.strstart+=Fe.lookahead,Fe.block_start=Fe.strstart,Fe.insert=Fe.lookahead,Fe.lookahead=0,Fe.match_length=Fe.prev_length=w-1,Fe.match_available=0,se.next_in=Ve,se.input=vt,se.avail_in=_e,Fe.wrap=lt,y}return Ff.deflateInit=me,Ff.deflateInit2=ue,Ff.deflateReset=fe,Ff.deflateResetKeep=W,Ff.deflateSetHeader=st,Ff.deflate=pe,Ff.deflateEnd=be,Ff.deflateSetDictionary=Qe,Ff.deflateInfo="pako deflate (from Nodeca project)",Ff}function oCe(){if(zoe)return AB;zoe=!0;var t=30,e=12;return AB=function(a,i){var h,c,p,b,g,y,M,x,E,A,I,P,N,L,C,Y,G,ee,D,U,V,_,n,s,f;h=a.state,c=a.next_in,s=a.input,p=c+(a.avail_in-5),b=a.next_out,f=a.output,g=b-(i-a.avail_out),y=b+(a.avail_out-257),M=h.dmax,x=h.wsize,E=h.whave,A=h.wnext,I=h.window,P=h.hold,N=h.bits,L=h.lencode,C=h.distcode,Y=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{N<15&&(P+=s[c++]<<N,N+=8,P+=s[c++]<<N,N+=8),ee=L[P&Y];t:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D===0)f[b++]=ee&65535;else if(D&16){U=ee&65535,D&=15,D&&(N<D&&(P+=s[c++]<<N,N+=8),U+=P&(1<<D)-1,P>>>=D,N-=D),N<15&&(P+=s[c++]<<N,N+=8,P+=s[c++]<<N,N+=8),ee=C[P&G];r:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D&16){if(V=ee&65535,D&=15,N<D&&(P+=s[c++]<<N,N+=8,N<D&&(P+=s[c++]<<N,N+=8)),V+=P&(1<<D)-1,V>M){a.msg="invalid distance too far back",h.mode=t;break e}if(P>>>=D,N-=D,D=b-g,V>D){if(D=V-D,D>E&&h.sane){a.msg="invalid distance too far back",h.mode=t;break e}if(_=0,n=I,A===0){if(_+=x-D,D<U){U-=D;do f[b++]=I[_++];while(--D);_=b-V,n=f}}else if(A<D){if(_+=x+A-D,D-=A,D<U){U-=D;do f[b++]=I[_++];while(--D);if(_=0,A<U){D=A,U-=D;do f[b++]=I[_++];while(--D);_=b-V,n=f}}}else if(_+=A-D,D<U){U-=D;do f[b++]=I[_++];while(--D);_=b-V,n=f}for(;U>2;)f[b++]=n[_++],f[b++]=n[_++],f[b++]=n[_++],U-=3;U&&(f[b++]=n[_++],U>1&&(f[b++]=n[_++]))}else{_=b-V;do f[b++]=f[_++],f[b++]=f[_++],f[b++]=f[_++],U-=3;while(U>2);U&&(f[b++]=f[_++],U>1&&(f[b++]=f[_++]))}}else if(D&64){a.msg="invalid distance code",h.mode=t;break e}else{ee=C[(ee&65535)+(P&(1<<D)-1)];continue r}break}}else if(D&64)if(D&32){h.mode=e;break e}else{a.msg="invalid literal/length code",h.mode=t;break e}else{ee=L[(ee&65535)+(P&(1<<D)-1)];continue t}break}}while(c<p&&b<y);U=N>>3,c-=U,N-=U<<3,P&=(1<<N)-1,a.next_in=c,a.next_out=b,a.avail_in=c<p?5+(p-c):5-(c-p),a.avail_out=b<y?257+(y-b):257-(b-y),h.hold=P,h.bits=N},AB}function sCe(){if(Zoe)return RB;Zoe=!0;var t=Sw(),e=15,r=852,a=592,i=0,h=1,c=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return RB=function(x,E,A,I,P,N,L,C){var Y=C.bits,G=0,ee=0,D=0,U=0,V=0,_=0,n=0,s=0,f=0,u=0,l,m,w,d,o,v=null,R=0,S,B=new t.Buf16(e+1),F=new t.Buf16(e+1),$=null,re=0,Q,Z,K;for(G=0;G<=e;G++)B[G]=0;for(ee=0;ee<I;ee++)B[E[A+ee]]++;for(V=Y,U=e;U>=1&&B[U]===0;U--);if(V>U&&(V=U),U===0)return P[N++]=1<<24|64<<16|0,P[N++]=1<<24|64<<16|0,C.bits=1,0;for(D=1;D<U&&B[D]===0;D++);for(V<D&&(V=D),s=1,G=1;G<=e;G++)if(s<<=1,s-=B[G],s<0)return-1;if(s>0&&(x===i||U!==1))return-1;for(F[1]=0,G=1;G<e;G++)F[G+1]=F[G]+B[G];for(ee=0;ee<I;ee++)E[A+ee]!==0&&(L[F[E[A+ee]]++]=ee);if(x===i?(v=$=L,S=19):x===h?(v=p,R-=257,$=b,re-=257,S=256):(v=g,$=y,S=-1),u=0,ee=0,G=D,o=N,_=V,n=0,w=-1,f=1<<V,d=f-1,x===h&&f>r||x===c&&f>a)return 1;for(;;){Q=G-n,L[ee]<S?(Z=0,K=L[ee]):L[ee]>S?(Z=$[re+L[ee]],K=v[R+L[ee]]):(Z=96,K=0),l=1<<G-n,m=1<<_,D=m;do m-=l,P[o+(u>>n)+m]=Q<<24|Z<<16|K|0;while(m!==0);for(l=1<<G-1;u&l;)l>>=1;if(l!==0?(u&=l-1,u+=l):u=0,ee++,--B[G]===0){if(G===U)break;G=E[A+L[ee]]}if(G>V&&(u&d)!==w){for(n===0&&(n=V),o+=D,_=G-n,s=1<<_;_+n<U&&(s-=B[_+n],!(s<=0));)_++,s<<=1;if(f+=1<<_,x===h&&f>r||x===c&&f>a)return 1;w=u&d,P[w]=V<<24|_<<16|o-N|0}}return u!==0&&(P[o+u]=G-n<<24|64<<16|0),C.bits=V,0},RB}function fCe(){if(Hoe)return zs;Hoe=!0;var t=Sw(),e=Goe(),r=Yoe(),a=oCe(),i=sCe(),h=0,c=1,p=2,b=4,g=5,y=6,M=0,x=1,E=2,A=-2,I=-3,P=-4,N=-5,L=8,C=1,Y=2,G=3,ee=4,D=5,U=6,V=7,_=8,n=9,s=10,f=11,u=12,l=13,m=14,w=15,d=16,o=17,v=18,R=19,S=20,B=21,F=22,$=23,re=24,Q=25,Z=26,K=27,ce=28,te=29,j=30,J=31,X=32,he=852,Te=592,oe=15,le=oe;function ot(ue){return(ue>>>24&255)+(ue>>>8&65280)+((ue&65280)<<8)+((ue&255)<<24)}function ge(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Se(ue){var me;return!ue||!ue.state?A:(me=ue.state,ue.total_in=ue.total_out=me.total=0,ue.msg="",me.wrap&&(ue.adler=me.wrap&1),me.mode=C,me.last=0,me.havedict=0,me.dmax=32768,me.head=null,me.hold=0,me.bits=0,me.lencode=me.lendyn=new t.Buf32(he),me.distcode=me.distdyn=new t.Buf32(Te),me.sane=1,me.back=-1,M)}function ut(ue){var me;return!ue||!ue.state?A:(me=ue.state,me.wsize=0,me.whave=0,me.wnext=0,Se(ue))}function Ze(ue,me){var pe,be;return!ue||!ue.state||(be=ue.state,me<0?(pe=0,me=-me):(pe=(me>>4)+1,me<48&&(me&=15)),me&&(me<8||me>15))?A:(be.window!==null&&be.wbits!==me&&(be.window=null),be.wrap=pe,be.wbits=me,ut(ue))}function Ge(ue,me){var pe,be;return ue?(be=new ge,ue.state=be,be.window=null,pe=Ze(ue,me),pe!==M&&(ue.state=null),pe):A}function ct(ue){return Ge(ue,le)}var z=!0,T,k;function O(ue){if(z){var me;for(T=new t.Buf32(512),k=new t.Buf32(32),me=0;me<144;)ue.lens[me++]=8;for(;me<256;)ue.lens[me++]=9;for(;me<280;)ue.lens[me++]=7;for(;me<288;)ue.lens[me++]=8;for(i(c,ue.lens,0,288,T,0,ue.work,{bits:9}),me=0;me<32;)ue.lens[me++]=5;i(p,ue.lens,0,32,k,0,ue.work,{bits:5}),z=!1}ue.lencode=T,ue.lenbits=9,ue.distcode=k,ue.distbits=5}function q(ue,me,pe,be){var Qe,se=ue.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new t.Buf8(se.wsize)),be>=se.wsize?(t.arraySet(se.window,me,pe-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(Qe=se.wsize-se.wnext,Qe>be&&(Qe=be),t.arraySet(se.window,me,pe-be,Qe,se.wnext),be-=Qe,be?(t.arraySet(se.window,me,pe-be,be,0),se.wnext=be,se.whave=se.wsize):(se.wnext+=Qe,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=Qe))),0}function H(ue,me){var pe,be,Qe,se,ye,Ee,Fe,de,xe,lt,_e,Ve,vt,Ye,et=0,mt,We,nt,bt,Je,at,yt,Xe,it=new t.Buf8(4),_t,dt,Mt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ue||!ue.state||!ue.output||!ue.input&&ue.avail_in!==0)return A;pe=ue.state,pe.mode===u&&(pe.mode=l),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,lt=Ee,_e=Fe,Xe=M;e:for(;;)switch(pe.mode){case C:if(pe.wrap===0){pe.mode=l;break}for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.wrap&2&&de===35615){pe.check=0,it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0),de=0,xe=0,pe.mode=Y;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(pe.wrap&1)||(((de&255)<<8)+(de>>8))%31){ue.msg="incorrect header check",pe.mode=j;break}if((de&15)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(de>>>=4,xe-=4,yt=(de&15)+8,pe.wbits===0)pe.wbits=yt;else if(yt>pe.wbits){ue.msg="invalid window size",pe.mode=j;break}pe.dmax=1<<yt,ue.adler=pe.check=1,pe.mode=de&512?s:u,de=0,xe=0;break;case Y:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.flags=de,(pe.flags&255)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(pe.flags&57344){ue.msg="unknown header flags set",pe.mode=j;break}pe.head&&(pe.head.text=de>>8&1),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=G;case G:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.time=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,it[2]=de>>>16&255,it[3]=de>>>24&255,pe.check=r(pe.check,it,4,0)),de=0,xe=0,pe.mode=ee;case ee:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.xflags=de&255,pe.head.os=de>>8),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=D;case D:if(pe.flags&1024){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length=de,pe.head&&(pe.head.extra_len=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0}else pe.head&&(pe.head.extra=null);pe.mode=U;case U:if(pe.flags&1024&&(Ve=pe.length,Ve>Ee&&(Ve=Ee),Ve&&(pe.head&&(yt=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=new Array(pe.head.extra_len)),t.arraySet(pe.head.extra,be,se,Ve,yt)),pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,pe.length-=Ve),pe.length))break e;pe.length=0,pe.mode=V;case V:if(pe.flags&2048){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.name+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.name=null);pe.length=0,pe.mode=_;case _:if(pe.flags&4096){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.comment+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.comment=null);pe.mode=n;case n:if(pe.flags&512){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.check&65535)){ue.msg="header crc mismatch",pe.mode=j;break}de=0,xe=0}pe.head&&(pe.head.hcrc=pe.flags>>9&1,pe.head.done=!0),ue.adler=pe.check=0,pe.mode=u;break;case s:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}ue.adler=pe.check=ot(de),de=0,xe=0,pe.mode=f;case f:if(pe.havedict===0)return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,E;ue.adler=pe.check=1,pe.mode=u;case u:if(me===g||me===y)break e;case l:if(pe.last){de>>>=xe&7,xe-=xe&7,pe.mode=K;break}for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}switch(pe.last=de&1,de>>>=1,xe-=1,de&3){case 0:pe.mode=m;break;case 1:if(O(pe),pe.mode=S,me===y){de>>>=2,xe-=2;break e}break;case 2:pe.mode=o;break;case 3:ue.msg="invalid block type",pe.mode=j}de>>>=2,xe-=2;break;case m:for(de>>>=xe&7,xe-=xe&7;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if((de&65535)!==(de>>>16^65535)){ue.msg="invalid stored block lengths",pe.mode=j;break}if(pe.length=de&65535,de=0,xe=0,pe.mode=w,me===y)break e;case w:pe.mode=d;case d:if(Ve=pe.length,Ve){if(Ve>Ee&&(Ve=Ee),Ve>Fe&&(Ve=Fe),Ve===0)break e;t.arraySet(Qe,be,se,Ve,ye),Ee-=Ve,se+=Ve,Fe-=Ve,ye+=Ve,pe.length-=Ve;break}pe.mode=u;break;case o:for(;xe<14;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.nlen=(de&31)+257,de>>>=5,xe-=5,pe.ndist=(de&31)+1,de>>>=5,xe-=5,pe.ncode=(de&15)+4,de>>>=4,xe-=4,pe.nlen>286||pe.ndist>30){ue.msg="too many length or distance symbols",pe.mode=j;break}pe.have=0,pe.mode=v;case v:for(;pe.have<pe.ncode;){for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.lens[Mt[pe.have++]]=de&7,de>>>=3,xe-=3}for(;pe.have<19;)pe.lens[Mt[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,_t={bits:pe.lenbits},Xe=i(h,pe.lens,0,19,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid code lengths set",pe.mode=j;break}pe.have=0,pe.mode=R;case R:for(;pe.have<pe.nlen+pe.ndist;){for(;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(nt<16)de>>>=mt,xe-=mt,pe.lens[pe.have++]=nt;else{if(nt===16){for(dt=mt+2;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de>>>=mt,xe-=mt,pe.have===0){ue.msg="invalid bit length repeat",pe.mode=j;break}yt=pe.lens[pe.have-1],Ve=3+(de&3),de>>>=2,xe-=2}else if(nt===17){for(dt=mt+3;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=3+(de&7),de>>>=3,xe-=3}else{for(dt=mt+7;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=11+(de&127),de>>>=7,xe-=7}if(pe.have+Ve>pe.nlen+pe.ndist){ue.msg="invalid bit length repeat",pe.mode=j;break}for(;Ve--;)pe.lens[pe.have++]=yt}}if(pe.mode===j)break;if(pe.lens[256]===0){ue.msg="invalid code -- missing end-of-block",pe.mode=j;break}if(pe.lenbits=9,_t={bits:pe.lenbits},Xe=i(c,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid literal/lengths set",pe.mode=j;break}if(pe.distbits=6,pe.distcode=pe.distdyn,_t={bits:pe.distbits},Xe=i(p,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,_t),pe.distbits=_t.bits,Xe){ue.msg="invalid distances set",pe.mode=j;break}if(pe.mode=S,me===y)break e;case S:pe.mode=B;case B:if(Ee>=6&&Fe>=258){ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,a(ue,_e),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,pe.mode===u&&(pe.back=-1);break}for(pe.back=0;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(We&&!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.lencode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,pe.length=nt,We===0){pe.mode=Z;break}if(We&32){pe.back=-1,pe.mode=u;break}if(We&64){ue.msg="invalid literal/length code",pe.mode=j;break}pe.extra=We&15,pe.mode=F;case F:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=$;case $:for(;et=pe.distcode[de&(1<<pe.distbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.distcode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,We&64){ue.msg="invalid distance code",pe.mode=j;break}pe.offset=nt,pe.extra=We&15,pe.mode=re;case re:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.offset+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ue.msg="invalid distance too far back",pe.mode=j;break}pe.mode=Q;case Q:if(Fe===0)break e;if(Ve=_e-Fe,pe.offset>Ve){if(Ve=pe.offset-Ve,Ve>pe.whave&&pe.sane){ue.msg="invalid distance too far back",pe.mode=j;break}Ve>pe.wnext?(Ve-=pe.wnext,vt=pe.wsize-Ve):vt=pe.wnext-Ve,Ve>pe.length&&(Ve=pe.length),Ye=pe.window}else Ye=Qe,vt=ye-pe.offset,Ve=pe.length;Ve>Fe&&(Ve=Fe),Fe-=Ve,pe.length-=Ve;do Qe[ye++]=Ye[vt++];while(--Ve);pe.length===0&&(pe.mode=B);break;case Z:if(Fe===0)break e;Qe[ye++]=pe.length,Fe--,pe.mode=B;break;case K:if(pe.wrap){for(;xe<32;){if(Ee===0)break e;Ee--,de|=be[se++]<<xe,xe+=8}if(_e-=Fe,ue.total_out+=_e,pe.total+=_e,_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ye-_e):e(pe.check,Qe,_e,ye-_e)),_e=Fe,(pe.flags?de:ot(de))!==pe.check){ue.msg="incorrect data check",pe.mode=j;break}de=0,xe=0}pe.mode=ce;case ce:if(pe.wrap&&pe.flags){for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.total&4294967295)){ue.msg="incorrect length check",pe.mode=j;break}de=0,xe=0}pe.mode=te;case te:Xe=x;break e;case j:Xe=I;break e;case J:return P;case X:default:return A}return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,(pe.wsize||_e!==ue.avail_out&&pe.mode<j&&(pe.mode<K||me!==b))&&q(ue,ue.output,ue.next_out,_e-ue.avail_out),lt-=ue.avail_in,_e-=ue.avail_out,ue.total_in+=lt,ue.total_out+=_e,pe.total+=_e,pe.wrap&&_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ue.next_out-_e):e(pe.check,Qe,_e,ue.next_out-_e)),ue.data_type=pe.bits+(pe.last?64:0)+(pe.mode===u?128:0)+(pe.mode===S||pe.mode===w?256:0),(lt===0&&_e===0||me===b)&&Xe===M&&(Xe=N),Xe}function W(ue){if(!ue||!ue.state)return A;var me=ue.state;return me.window&&(me.window=null),ue.state=null,M}function fe(ue,me){var pe;return!ue||!ue.state||(pe=ue.state,!(pe.wrap&2))?A:(pe.head=me,me.done=!1,M)}function st(ue,me){var pe=me.length,be,Qe,se;return!ue||!ue.state||(be=ue.state,be.wrap!==0&&be.mode!==f)?A:be.mode===f&&(Qe=1,Qe=e(Qe,me,pe,0),Qe!==be.check)?I:(se=q(ue,me,pe,pe),se?(be.mode=J,P):(be.havedict=1,M))}return zs.inflateReset=ut,zs.inflateReset2=Ze,zs.inflateResetKeep=Se,zs.inflateInit=ct,zs.inflateInit2=Ge,zs.inflate=H,zs.inflateEnd=W,zs.inflateGetHeader=fe,zs.inflateSetDictionary=st,zs.inflateInfo="pako inflate (from Nodeca project)",zs}function uCe(){return Koe||(Koe=!0,TB={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),TB}function hCe(){if(Woe)return Dt;Woe=!0;var t=ii.Buffer,e=yr,r=or,a=rCe(),i=aCe(),h=fCe(),c=uCe();for(var p in c)Dt[p]=c[p];Dt.NONE=0,Dt.DEFLATE=1,Dt.INFLATE=2,Dt.GZIP=3,Dt.GUNZIP=4,Dt.DEFLATERAW=5,Dt.INFLATERAW=6,Dt.UNZIP=7;var b=31,g=139;function y(M){if(typeof M!="number"||M<Dt.DEFLATE||M>Dt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=M,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return y.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,r(this.init_done,"close before init"),r(this.mode<=Dt.UNZIP),this.mode===Dt.DEFLATE||this.mode===Dt.GZIP||this.mode===Dt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===Dt.INFLATE||this.mode===Dt.GUNZIP||this.mode===Dt.INFLATERAW||this.mode===Dt.UNZIP)&&h.inflateEnd(this.strm),this.mode=Dt.NONE,this.dictionary=null},y.prototype.write=function(M,x,E,A,I,P,N){return this._write(!0,M,x,E,A,I,P,N)},y.prototype.writeSync=function(M,x,E,A,I,P,N){return this._write(!1,M,x,E,A,I,P,N)},y.prototype._write=function(M,x,E,A,I,P,N,L){if(r.equal(arguments.length,8),r(this.init_done,"write before init"),r(this.mode!==Dt.NONE,"already finalized"),r.equal(!1,this.write_in_progress,"write already in progress"),r.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,r.equal(!1,x===void 0,"must provide flush value"),this.write_in_progress=!0,x!==Dt.Z_NO_FLUSH&&x!==Dt.Z_PARTIAL_FLUSH&&x!==Dt.Z_SYNC_FLUSH&&x!==Dt.Z_FULL_FLUSH&&x!==Dt.Z_FINISH&&x!==Dt.Z_BLOCK)throw new Error("Invalid flush value");if(E==null&&(E=t.alloc(0),I=0,A=0),this.strm.avail_in=I,this.strm.input=E,this.strm.next_in=A,this.strm.avail_out=L,this.strm.output=P,this.strm.next_out=N,this.flush=x,!M)return this._process(),this._checkError()?this._afterSync():void 0;var C=this;return e.nextTick(function(){C._process(),C._after()}),this},y.prototype._afterSync=function(){var M=this.strm.avail_out,x=this.strm.avail_in;return this.write_in_progress=!1,[x,M]},y.prototype._process=function(){var M=null;switch(this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case Dt.UNZIP:switch(this.strm.avail_in>0&&(M=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(M===null)break;if(this.strm.input[M]===b){if(this.gzip_id_bytes_read=1,M++,this.strm.avail_in===1)break}else{this.mode=Dt.INFLATE;break}case 1:if(M===null)break;this.strm.input[M]===g?(this.gzip_id_bytes_read=2,this.mode=Dt.GUNZIP):this.mode=Dt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===Dt.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===Dt.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===Dt.Z_DATA_ERROR&&(this.err=Dt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Dt.GUNZIP&&this.err===Dt.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},y.prototype._checkError=function(){switch(this.err){case Dt.Z_OK:case Dt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===Dt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Dt.Z_STREAM_END:break;case Dt.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},y.prototype._after=function(){if(this._checkError()){var M=this.strm.avail_out,x=this.strm.avail_in;this.write_in_progress=!1,this.callback(x,M),this.pending_close&&this.close()}},y.prototype._error=function(M){this.strm.msg&&(M=this.strm.msg),this.onerror(M,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},y.prototype.init=function(M,x,E,A,I){r(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),r(M>=8&&M<=15,"invalid windowBits"),r(x>=-1&&x<=9,"invalid compression level"),r(E>=1&&E<=9,"invalid memlevel"),r(A===Dt.Z_FILTERED||A===Dt.Z_HUFFMAN_ONLY||A===Dt.Z_RLE||A===Dt.Z_FIXED||A===Dt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(x,M,E,A,I),this._setDictionary()},y.prototype.params=function(){throw new Error("deflateParams Not supported")},y.prototype.reset=function(){this._reset(),this._setDictionary()},y.prototype._init=function(M,x,E,A,I){switch(this.level=M,this.windowBits=x,this.memLevel=E,this.strategy=A,this.flush=Dt.Z_NO_FLUSH,this.err=Dt.Z_OK,(this.mode===Dt.GZIP||this.mode===Dt.GUNZIP)&&(this.windowBits+=16),this.mode===Dt.UNZIP&&(this.windowBits+=32),(this.mode===Dt.DEFLATERAW||this.mode===Dt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,Dt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:case Dt.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Dt.Z_OK&&this._error("Init error"),this.dictionary=I,this.write_in_progress=!1,this.init_done=!0},y.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==Dt.Z_OK&&this._error("Failed to set dictionary")}},y.prototype._reset=function(){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:case Dt.GZIP:this.err=i.deflateReset(this.strm);break;case Dt.INFLATE:case Dt.INFLATERAW:case Dt.GUNZIP:this.err=h.inflateReset(this.strm);break}this.err!==Dt.Z_OK&&this._error("Failed to reset stream")},Dt.Zlib=y,Dt}function cCe(){if(Voe)return rr;Voe=!0;var t=yr,e=ii.Buffer,r=Ia.Transform,a=hCe(),i=gt,h=or.ok,c=ii.kMaxLength,p="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16*1024,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var b=Object.keys(a),g=0;g<b.length;g++){var y=b[g];y.match(/^Z/)&&Object.defineProperty(rr,y,{enumerable:!0,value:a[y],writable:!1})}for(var M={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},x=Object.keys(M),E=0;E<x.length;E++){var A=x[E];M[M[A]]=A}Object.defineProperty(rr,"codes",{enumerable:!0,value:Object.freeze(M),writable:!1}),rr.Deflate=N,rr.Inflate=L,rr.Gzip=C,rr.Gunzip=Y,rr.DeflateRaw=G,rr.InflateRaw=ee,rr.Unzip=D,rr.createDeflate=function(s){return new N(s)},rr.createInflate=function(s){return new L(s)},rr.createDeflateRaw=function(s){return new G(s)},rr.createInflateRaw=function(s){return new ee(s)},rr.createGzip=function(s){return new C(s)},rr.createGunzip=function(s){return new Y(s)},rr.createUnzip=function(s){return new D(s)},rr.deflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new N(f),s,u)},rr.deflateSync=function(s,f){return P(new N(f),s)},rr.gzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new C(f),s,u)},rr.gzipSync=function(s,f){return P(new C(f),s)},rr.deflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new G(f),s,u)},rr.deflateRawSync=function(s,f){return P(new G(f),s)},rr.unzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new D(f),s,u)},rr.unzipSync=function(s,f){return P(new D(f),s)},rr.inflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new L(f),s,u)},rr.inflateSync=function(s,f){return P(new L(f),s)},rr.gunzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new Y(f),s,u)},rr.gunzipSync=function(s,f){return P(new Y(f),s)},rr.inflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),I(new ee(f),s,u)},rr.inflateRawSync=function(s,f){return P(new ee(f),s)};function I(s,f,u){var l=[],m=0;s.on("error",d),s.on("end",o),s.end(f),w();function w(){for(var v;(v=s.read())!==null;)l.push(v),m+=v.length;s.once("readable",w)}function d(v){s.removeListener("end",o),s.removeListener("readable",w),u(v)}function o(){var v,R=null;m>=c?R=new RangeError(p):v=e.concat(l,m),l=[],s.close(),u(R,v)}}function P(s,f){if(typeof f=="string"&&(f=e.from(f)),!e.isBuffer(f))throw new TypeError("Not a string or buffer");var u=s._finishFlushFlag;return s._processChunk(f,u)}function N(s){if(!(this instanceof N))return new N(s);V.call(this,s,a.DEFLATE)}function L(s){if(!(this instanceof L))return new L(s);V.call(this,s,a.INFLATE)}function C(s){if(!(this instanceof C))return new C(s);V.call(this,s,a.GZIP)}function Y(s){if(!(this instanceof Y))return new Y(s);V.call(this,s,a.GUNZIP)}function G(s){if(!(this instanceof G))return new G(s);V.call(this,s,a.DEFLATERAW)}function ee(s){if(!(this instanceof ee))return new ee(s);V.call(this,s,a.INFLATERAW)}function D(s){if(!(this instanceof D))return new D(s);V.call(this,s,a.UNZIP)}function U(s){return s===a.Z_NO_FLUSH||s===a.Z_PARTIAL_FLUSH||s===a.Z_SYNC_FLUSH||s===a.Z_FULL_FLUSH||s===a.Z_FINISH||s===a.Z_BLOCK}function V(s,f){var u=this;if(this._opts=s=s||{},this._chunkSize=s.chunkSize||rr.Z_DEFAULT_CHUNK,r.call(this,s),s.flush&&!U(s.flush))throw new Error("Invalid flush flag: "+s.flush);if(s.finishFlush&&!U(s.finishFlush))throw new Error("Invalid flush flag: "+s.finishFlush);if(this._flushFlag=s.flush||a.Z_NO_FLUSH,this._finishFlushFlag=typeof s.finishFlush<"u"?s.finishFlush:a.Z_FINISH,s.chunkSize&&(s.chunkSize<rr.Z_MIN_CHUNK||s.chunkSize>rr.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+s.chunkSize);if(s.windowBits&&(s.windowBits<rr.Z_MIN_WINDOWBITS||s.windowBits>rr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+s.windowBits);if(s.level&&(s.level<rr.Z_MIN_LEVEL||s.level>rr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+s.level);if(s.memLevel&&(s.memLevel<rr.Z_MIN_MEMLEVEL||s.memLevel>rr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+s.memLevel);if(s.strategy&&s.strategy!=rr.Z_FILTERED&&s.strategy!=rr.Z_HUFFMAN_ONLY&&s.strategy!=rr.Z_RLE&&s.strategy!=rr.Z_FIXED&&s.strategy!=rr.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+s.strategy);if(s.dictionary&&!e.isBuffer(s.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(f);var l=this;this._hadError=!1,this._handle.onerror=function(d,o){_(l),l._hadError=!0;var v=new Error(d);v.errno=o,v.code=rr.codes[o],l.emit("error",v)};var m=rr.Z_DEFAULT_COMPRESSION;typeof s.level=="number"&&(m=s.level);var w=rr.Z_DEFAULT_STRATEGY;typeof s.strategy=="number"&&(w=s.strategy),this._handle.init(s.windowBits||rr.Z_DEFAULT_WINDOWBITS,m,s.memLevel||rr.Z_DEFAULT_MEMLEVEL,w,s.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=m,this._strategy=w,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!u._handle},configurable:!0,enumerable:!0})}i.inherits(V,r),V.prototype.params=function(s,f,u){if(s<rr.Z_MIN_LEVEL||s>rr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+s);if(f!=rr.Z_FILTERED&&f!=rr.Z_HUFFMAN_ONLY&&f!=rr.Z_RLE&&f!=rr.Z_FIXED&&f!=rr.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+f);if(this._level!==s||this._strategy!==f){var l=this;this.flush(a.Z_SYNC_FLUSH,function(){h(l._handle,"zlib binding closed"),l._handle.params(s,f),l._hadError||(l._level=s,l._strategy=f,u&&u())})}else t.nextTick(u)},V.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(s){this._transform(e.alloc(0),"",s)},V.prototype.flush=function(s,f){var u=this,l=this._writableState;(typeof s=="function"||s===void 0&&!f)&&(f=s,s=a.Z_FULL_FLUSH),l.ended?f&&t.nextTick(f):l.ending?f&&this.once("end",f):l.needDrain?f&&this.once("drain",function(){return u.flush(s,f)}):(this._flushFlag=s,this.write(e.alloc(0),"",f))},V.prototype.close=function(s){_(this,s),t.nextTick(n,this)};function _(s,f){f&&t.nextTick(f),s._handle&&(s._handle.close(),s._handle=null)}function n(s){s.emit("close")}return V.prototype._transform=function(s,f,u){var l,m=this._writableState,w=m.ending||m.ended,d=w&&(!s||m.length===s.length);if(s!==null&&!e.isBuffer(s))return u(new Error("invalid input"));if(!this._handle)return u(new Error("zlib binding closed"));d?l=this._finishFlushFlag:(l=this._flushFlag,s.length>=m.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),this._processChunk(s,l,u)},V.prototype._processChunk=function(s,f,u){var l=s&&s.length,m=this._chunkSize-this._offset,w=0,d=this,o=typeof u=="function";if(!o){var v=[],R=0,S;this.on("error",function(Q){S=Q}),h(this._handle,"zlib binding closed");do var B=this._handle.writeSync(f,s,w,l,this._buffer,this._offset,m);while(!this._hadError&&re(B[0],B[1]));if(this._hadError)throw S;if(R>=c)throw _(this),new RangeError(p);var F=e.concat(v,R);return _(this),F}h(this._handle,"zlib binding closed");var $=this._handle.write(f,s,w,l,this._buffer,this._offset,m);$.buffer=s,$.callback=re;function re(Q,Z){if(this&&(this.buffer=null,this.callback=null),!d._hadError){var K=m-Z;if(h(K>=0,"have should not go down"),K>0){var ce=d._buffer.slice(d._offset,d._offset+K);d._offset+=K,o?d.push(ce):(v.push(ce),R+=ce.length)}if((Z===0||d._offset>=d._chunkSize)&&(m=d._chunkSize,d._offset=0,d._buffer=e.allocUnsafe(d._chunkSize)),Z===0){if(w+=l-Q,l=Q,!o)return!0;var te=d._handle.write(f,s,w,l,d._buffer,d._offset,d._chunkSize);te.callback=re,te.buffer=s;return}if(!o)return!1;u()}}},i.inherits(N,V),i.inherits(L,V),i.inherits(C,V),i.inherits(Y,V),i.inherits(G,V),i.inherits(ee,V),i.inherits(D,V),rr}var MB,Loe,Ba,Doe,Fd,$oe,xB,qoe,SB,Uoe,EB,Foe,Ff,joe,AB,zoe,RB,Zoe,zs,Hoe,TB,Koe,Dt,Woe,rr,Voe,At,lCe,dCe,pCe,vCe,mCe,gCe,bCe,yCe,wCe,_Ce,MCe,xCe,SCe,ECe,ACe,RCe,TCe,ICe,kCe,BCe,PCe,OCe,NCe,CCe,LCe,DCe,$Ce,qCe,UCe,FCe,jCe,zCe,ZCe,HCe,KCe,WCe,VCe,GCe,YCe,JCe,XCe,QCe,eLe,tLe,rLe,iLe,nLe,aLe,oLe,sLe,fLe,uLe,hLe,cLe,lLe,dLe,pLe,vLe,mLe,gLe,bLe,yLe,wLe,_Le,MLe,xLe,SLe,ELe,ALe,Xoe=xi(()=>{"use strict";ie();ae();ne();ah();k8();tB();Ks();ao();Tg();zo();Hs();th();Fo();Gf();Z0();MB={},Loe=!1;Ba={},Doe=!1;Fd={},$oe=!1;xB={},qoe=!1;SB={},Uoe=!1;EB={},Foe=!1;Ff={},joe=!1;AB={},zoe=!1;RB={},Zoe=!1;zs={},Hoe=!1;TB={},Koe=!1;Dt={},Woe=!1;rr={},Voe=!1;At=cCe();At.codes;At.Deflate;At.Inflate;At.Gzip;At.Gunzip;At.DeflateRaw;At.InflateRaw;At.Unzip;At.createDeflate;At.createInflate;At.createDeflateRaw;At.createInflateRaw;At.createGzip;At.createGunzip;At.createUnzip;At.deflate;At.deflateSync;At.gzip;At.gzipSync;At.deflateRaw;At.deflateRawSync;At.unzip;At.unzipSync;At.inflate;At.inflateSync;At.gunzip;At.gunzipSync;At.inflateRaw;At.inflateRawSync;lCe=At.Deflate,dCe=At.DeflateRaw,pCe=At.Gunzip,vCe=At.Gzip,mCe=At.Inflate,gCe=At.InflateRaw,bCe=At.Unzip,yCe=At.Z_BEST_COMPRESSION,wCe=At.Z_BEST_SPEED,_Ce=At.Z_BINARY,MCe=At.Z_BLOCK,xCe=At.Z_BUF_ERROR,SCe=At.Z_DATA_ERROR,ECe=At.Z_DEFAULT_CHUNK,ACe=At.Z_DEFAULT_COMPRESSION,RCe=At.Z_DEFAULT_LEVEL,TCe=At.Z_DEFAULT_MEMLEVEL,ICe=At.Z_DEFAULT_STRATEGY,kCe=At.Z_DEFAULT_WINDOWBITS,BCe=At.Z_DEFLATED,PCe=At.Z_ERRNO,OCe=At.Z_FILTERED,NCe=At.Z_FINISH,CCe=At.Z_FIXED,LCe=At.Z_FULL_FLUSH,DCe=At.Z_HUFFMAN_ONLY,$Ce=At.Z_MAX_CHUNK,qCe=At.Z_MAX_LEVEL,UCe=At.Z_MAX_MEMLEVEL,FCe=At.Z_MAX_WINDOWBITS,jCe=At.Z_MIN_CHUNK,zCe=At.Z_MIN_LEVEL,ZCe=At.Z_MIN_MEMLEVEL,HCe=At.Z_MIN_WINDOWBITS,KCe=At.Z_NEED_DICT,WCe=At.Z_NO_COMPRESSION,VCe=At.Z_NO_FLUSH,GCe=At.Z_OK,YCe=At.Z_PARTIAL_FLUSH,JCe=At.Z_RLE,XCe=At.Z_STREAM_END,QCe=At.Z_STREAM_ERROR,eLe=At.Z_SYNC_FLUSH,tLe=At.Z_TEXT,rLe=At.Z_TREES,iLe=At.Z_UNKNOWN,nLe=At.Zlib,aLe=At.codes,oLe=At.createDeflate,sLe=At.createDeflateRaw,fLe=At.createGunzip,uLe=At.createGzip,hLe=At.createInflate,cLe=At.createInflateRaw,lLe=At.createUnzip,dLe=At.deflate,pLe=At.deflateRaw,vLe=At.deflateRawSync,mLe=At.deflateSync,gLe=At.gunzip,bLe=At.gunzipSync,yLe=At.gzip,wLe=At.gzipSync,_Le=At.inflate,MLe=At.inflateRaw,xLe=At.inflateRawSync,SLe=At.inflateSync,ELe=At.unzip,ALe=At.unzipSync});var tse=ht((pmt,ese)=>{"use strict";ie();ae();ne();var fv=[],db=[],IB=function(){};function BB(t){return~fv.indexOf(t)?!1:(fv.push(t),!0)}function PB(t){IB=t}function RLe(t){for(var e=[],r=0;r<fv.length;r++){if(fv[r].async){e.push(fv[r]);continue}if(fv[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(c){return c(t)})).then(function(c){i(c.some(Boolean))})}):!1}function OB(t){return~db.indexOf(t)?!1:(db.push(t),!0)}function kB(){IB.apply(IB,arguments)}function Qoe(t){for(var e=0;e<db.length;e++)t=db[e].apply(db[e],arguments);return t}function NB(t,e){var r=Object.prototype.hasOwnProperty;for(var a in e)r.call(e,a)&&(t[a]=e[a]);return t}function TLe(t){return t.enabled=!1,t.modify=OB,t.set=PB,t.use=BB,NB(function(){return!1},t)}function ILe(t){function e(){var r=Array.prototype.slice.call(arguments,0);return kB.call(kB,t,Qoe(r,t)),!0}return t.enabled=!0,t.modify=OB,t.set=PB,t.use=BB,NB(e,t)}ese.exports=function(e){return e.introduce=NB,e.enabled=RLe,e.process=Qoe,e.modify=OB,e.write=kB,e.nope=TLe,e.yep=ILe,e.set=PB,e.use=BB,e}});var ise=ht((bmt,rse)=>{"use strict";ie();ae();ne();var kLe=tse(),BLe=kLe(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});rse.exports=BLe});var pb=ht((Mmt,nse)=>{"use strict";ie();ae();ne();nse.exports=ise()});var ase={};Ka(ase,{StringDecoder:()=>PLe,default:()=>En});var PLe,ose=xi(()=>{"use strict";ie();ae();ne();Gf();Gf();PLe=En.StringDecoder});var fse=ht((Bmt,sse)=>{"use strict";ie();ae();ne();var CB=(mB(),Qr(vB)),OLe=(ose(),Qr(ase)),NLe=OLe.StringDecoder,CLe=Ph(),LLe=CLe.Stream;function DLe(){}sse.exports=function(t,e){var r=Me.alloc(65536),a=new NLe("utf8"),i=new LLe,h="",c=0,p=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=function(){i.destroyed=!0,i.emit("end"),i.emit("close")},CB.open(t.file,"a+","0644",function(b,g){if(b){e?e(b):i.emit("error",b),i.destroy();return}(function y(){if(i.destroyed){CB.close(g,DLe);return}return CB.read(g,r,0,r.length,c,function(M,x){if(M){e?e(M):i.emit("error",M),i.destroy();return}if(!x)return h&&((t.start==null||p>t.start)&&(e?e(null,h):i.emit("line",h)),p++,h=""),setTimeout(y,1e3);var E=a.write(r.slice(0,x));e||i.emit("data",E),E=(h+E).split(/\n+/);for(var A=E.length-1,I=0;I<A;I++)(t.start==null||p>t.start)&&(e?e(null,E[I]):i.emit("line",E[I])),p++;return h=E[A],c+=x,y()})})()}),e?i.destroy:i}});var mse=ht((Cmt,vse)=>{"use strict";ie();ae();ne();function Qh(t){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qh(t)}function $Le(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function use(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,ULe(a.key),a)}}function qLe(t,e,r){return e&&use(t.prototype,e),r&&use(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ULe(t){var e=FLe(t,"string");return Qh(e)=="symbol"?e:String(e)}function FLe(t,e){if(Qh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Qh(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jLe(t,e,r){return e=Ew(e),zLe(t,lse()?Reflect.construct(e,r||[],Ew(t).constructor):e.apply(t,r))}function zLe(t,e){if(e&&(Qh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dse(t)}function lse(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lse=function(){return!!t})()}function Ew(t){return Ew=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ew(t)}function dse(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZLe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LB(t,e)}function LB(t,e){return LB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},LB(t,e)}var co=(mB(),Qr(vB)),aa=(iB(),Qr(mae)),hse=Coe(),HLe=(Xoe(),Qr(Joe)),KLe=on(),WLe=KLe.MESSAGE,pse=Ph(),VLe=pse.Stream,cse=pse.PassThrough,GLe=ev(),jf=pb()("winston:file"),YLe=(Id(),Qr(Td)),JLe=fse();vse.exports=function(t){ZLe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$Le(this,e),r=jLe(this,e,[a]),r.name=a.name||"file";function i(h){for(var c=arguments.length,p=new Array(c>1?c-1:0),b=1;b<c;b++)p[b-1]=arguments[b];p.slice(1).forEach(function(g){if(a[g])throw new Error("Cannot set ".concat(g," and ").concat(h," together"))})}if(r._stream=new cse,r._stream.setMaxListeners(30),r._onError=r._onError.bind(dse(r)),a.filename||a.dirname)i("filename or dirname","stream"),r._basename=r.filename=a.filename?aa.basename(a.filename):"winston.log",r.dirname=a.dirname||aa.dirname(a.filename),r.options=a.options||{flags:"a"};else if(a.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),i("stream","filename","maxsize"),r._dest=r._stream.pipe(r._setupStream(a.stream)),r.dirname=aa.dirname(r._dest.path);else throw new Error("Cannot log to file without filename or stream.");return r.maxsize=a.maxsize||null,r.rotationFormat=a.rotationFormat||!1,r.zippedArchive=a.zippedArchive||!1,r.maxFiles=a.maxFiles||null,r.eol=typeof a.eol=="string"?a.eol:YLe.EOL,r.tailable=a.tailable||!1,r.lazy=a.lazy||!1,r._size=0,r._pendingSize=0,r._created=0,r._drain=!1,r._opening=!1,r._ending=!1,r._fileExist=!1,r.dirname&&r._createLogDirIfNotExist(r.dirname),r.lazy||r.open(),r}return qLe(e,[{key:"finishIfEnding",value:function(){var a=this;this._ending&&(this._opening?this.once("open",function(){a._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})}):(this._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})))}},{key:"log",value:function(a){var i=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return h(),!0;if(this._drain){this._stream.once("drain",function(){i._drain=!1,i.log(a,h)});return}if(this._rotate){this._stream.once("rotate",function(){i._rotate=!1,i.log(a,h)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",function(){i._fileExist=!0,i.log(a,h)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",function(){i._opening||i.open(),i.once("open",function(){i.log(a,h)})});return}}var c="".concat(a[WLe]).concat(this.eol),p=Me.byteLength(c);function b(){var y=this;if(this._size+=p,this._pendingSize-=p,jf("logged %s %s",this._size,c),this.emit("logged",a),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(function(){y.emit("fileclosed")});return}this._rotate=!0,this._endStream(function(){return y._rotateFile()})}}this._pendingSize+=p,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var g=this._stream.write(c,b.bind(this));return g?h():(this._drain=!0,this._stream.once("drain",function(){i._drain=!1,h()})),jf("written",g,this._drain),this.finishIfEnding(),g}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=E(a);var h=aa.join(this.dirname,this.filename),c="",p=[],b=0,g=co.createReadStream(h,{encoding:"utf8"});g.on("error",function(A){if(g.readable&&g.destroy(),!!i)return A.code!=="ENOENT"?i(A):i(null,p)}),g.on("data",function(A){A=(c+A).split(/\n+/);for(var I=A.length-1,P=0;P<I;P++)(!a.start||b>=a.start)&&y(A[P]),b++;c=A[I]}),g.on("close",function(){c&&y(c,!0),a.order==="desc"&&(p=p.reverse()),i&&i(null,p)});function y(A,I){try{var P=JSON.parse(A);x(P)&&M(P)}catch(N){I||g.emit("error",N)}}function M(A){if(a.rows&&p.length>=a.rows&&a.order!=="desc"){g.readable&&g.destroy();return}a.fields&&(A=a.fields.reduce(function(I,P){return I[P]=A[P],I},{})),a.order==="desc"&&p.length>=a.rows&&p.shift(),p.push(A)}function x(A){if(A&&Qh(A)==="object"){var I=new Date(A.timestamp);if(!(a.from&&I<a.from||a.until&&I>a.until||a.level&&a.level!==A.level))return!0}}function E(A){return A=A||{},A.rows=A.rows||A.limit||10,A.start=A.start||0,A.until=A.until||new Date,Qh(A.until)!=="object"&&(A.until=new Date(A.until)),A.from=A.from||A.until-24*60*60*1e3,Qh(A.from)!=="object"&&(A.from=new Date(A.from)),A.order=A.order||"desc",A}}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=aa.join(this.dirname,this.filename),h=new VLe,c={file:i,start:a.start};return h.destroy=JLe(c,function(p,b){if(p)return h.emit("error",p);try{h.emit("data",b),b=JSON.parse(b),h.emit("log",b)}catch(g){h.emit("error",g)}}),h}},{key:"open",value:function(){var a=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(i,h){if(i)return a.emit("error",i);jf("stat done: %s { size: %s }",a.filename,h),a._size=h,a._dest=a._createStream(a._stream),a._opening=!1,a.once("open",function(){a._stream.eventNames().includes("rotate")?a._stream.emit("rotate"):a._rotate=!1})})))}},{key:"stat",value:function(a){var i=this,h=this._getFile(),c=aa.join(this.dirname,h);co.stat(c,function(p,b){if(p&&p.code==="ENOENT")return jf("ENOENT\xA0ok",c),i.filename=h,a(null,0);if(p)return jf("err ".concat(p.code," ").concat(c)),a(p);if(!b||i._needsNewFile(b.size))return i._incFile(function(){return i.stat(a)});i.filename=h,a(null,b.size)})}},{key:"close",value:function(a){var i=this;this._stream&&this._stream.end(function(){a&&a(),i.emit("flush"),i.emit("closed")})}},{key:"_needsNewFile",value:function(a){return a=a||this._size,this.maxsize&&a>=this.maxsize}},{key:"_onError",value:function(a){this.emit("error",a)}},{key:"_setupStream",value:function(a){return a.on("error",this._onError),a}},{key:"_cleanupStream",value:function(a){return a.removeListener("error",this._onError),a.destroy(),a}},{key:"_rotateFile",value:function(){var a=this;this._incFile(function(){return a.open()})}},{key:"_endStream",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){a._cleanupStream(a._dest),i()})):i()}},{key:"_createStream",value:function(a){var i=this,h=aa.join(this.dirname,this.filename);jf("create stream start",h,this.options);var c=co.createWriteStream(h,this.options).on("error",function(p){return jf(p)}).on("close",function(){return jf("close",c.path,c.bytesWritten)}).on("open",function(){jf("file open ok",h),i.emit("open",h),a.pipe(c),i.rotatedWhileOpening&&(i._stream=new cse,i._stream.setMaxListeners(30),i._rotateFile(),i.rotatedWhileOpening=!1,i._cleanupStream(c),a.end())});return jf("create stream ok",h),c}},{key:"_incFile",value:function(a){jf("_incFile",this.filename);var i=aa.extname(this._basename),h=aa.basename(this._basename,i),c=[];this.zippedArchive&&c.push(function(p){var b=this._created>0&&!this.tailable?this._created:"";this._compressFile(aa.join(this.dirname,"".concat(h).concat(b).concat(i)),aa.join(this.dirname,"".concat(h).concat(b).concat(i,".gz")),p)}.bind(this)),c.push(function(p){this.tailable?this._checkMaxFilesTailable(i,h,p):(this._created+=1,this._checkMaxFilesIncrementing(i,h,p))}.bind(this)),hse(c,a)}},{key:"_getFile",value:function(){var a=aa.extname(this._basename),i=aa.basename(this._basename,a),h=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?"".concat(i).concat(h).concat(a):"".concat(i).concat(a)}},{key:"_checkMaxFilesIncrementing",value:function(a,i,h){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(h);var c=this._created-this.maxFiles,p=c!==0?c:"",b=this.zippedArchive?".gz":"",g="".concat(i).concat(p).concat(a).concat(b),y=aa.join(this.dirname,g);co.unlink(y,h)}},{key:"_checkMaxFilesTailable",value:function(a,i,h){var c=this,p=[];if(this.maxFiles){for(var b=this.zippedArchive?".gz":"",g=this.maxFiles-1;g>1;g--)p.push(function(y,M){var x=this,E="".concat(i).concat(y-1).concat(a).concat(b),A=aa.join(this.dirname,E);co.exists(A,function(I){if(!I)return M(null);E="".concat(i).concat(y).concat(a).concat(b),co.rename(A,aa.join(x.dirname,E),M)})}.bind(this,g));hse(p,function(){co.rename(aa.join(c.dirname,"".concat(i).concat(a).concat(b)),aa.join(c.dirname,"".concat(i,"1").concat(a).concat(b)),h)})}}},{key:"_compressFile",value:function(a,i,h){co.access(a,co.F_OK,function(c){if(c)return h();var p=HLe.createGzip(),b=co.createReadStream(a),g=co.createWriteStream(i);g.on("finish",function(){co.unlink(a,h)}),b.pipe(p).pipe(g)})}},{key:"_createLogDirIfNotExist",value:function(a){co.existsSync(a)||co.mkdirSync(a,{recursive:!0})}}]),e}(GLe)});var Ese={};Ka(Ese,{Agent:()=>iDe,ClientRequest:()=>nDe,IncomingMessage:()=>aDe,METHODS:()=>oDe,STATUS_CODES:()=>sDe,default:()=>zf,get:()=>fDe,globalAgent:()=>uDe,request:()=>hDe});function xse(){if(gse)return qo;gse=!0,qo.fetch=a(jd.fetch)&&a(jd.ReadableStream),qo.writableStream=a(jd.WritableStream),qo.abortController=a(jd.AbortController);var t;function e(){if(t!==void 0)return t;if(jd.XMLHttpRequest){t=new jd.XMLHttpRequest;try{t.open("GET",jd.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var h=e();if(!h)return!1;try{return h.responseType=i,h.responseType===i}catch{}return!1}qo.arraybuffer=qo.fetch||r("arraybuffer"),qo.msstream=!qo.fetch&&r("ms-stream"),qo.mozchunkedarraybuffer=!qo.fetch&&r("moz-chunked-arraybuffer"),qo.overrideMimeType=qo.fetch||(e()?a(e().overrideMimeType):!1);function a(i){return typeof i=="function"}return t=null,qo}function Sse(){if(bse)return Aw;bse=!0;var t=ii.Buffer,e=yr,r=xse(),a=Mr(),i=rp(),h=Aw.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=Aw.IncomingMessage=function(p,b,g,y){var M=this||Rw;if(i.Readable.call(M),M._mode=g,M.headers={},M.rawHeaders=[],M.trailers={},M.rawTrailers=[],M.on("end",function(){e.nextTick(function(){M.emit("close")})}),g==="fetch"){let L=function(){E.read().then(function(C){if(!M._destroyed){if(y(C.done),C.done){M.push(null);return}M.push(t.from(C.value)),L()}}).catch(function(C){y(!0),M._destroyed||M.emit("error",C)})};var N=L;if(M._fetchResponse=b,M.url=b.url,M.statusCode=b.status,M.statusMessage=b.statusText,b.headers.forEach(function(C,Y){M.headers[Y.toLowerCase()]=C,M.rawHeaders.push(Y,C)}),r.writableStream){var x=new WritableStream({write:function(C){return y(!1),new Promise(function(Y,G){M._destroyed?G():M.push(t.from(C))?Y():M._resumeFetch=Y})},close:function(){y(!0),M._destroyed||M.push(null)},abort:function(C){y(!0),M._destroyed||M.emit("error",C)}});try{b.body.pipeTo(x).catch(function(C){y(!0),M._destroyed||M.emit("error",C)});return}catch{}}var E=b.body.getReader();L()}else{M._xhr=p,M._pos=0,M.url=p.responseURL,M.statusCode=p.status,M.statusMessage=p.statusText;var A=p.getAllResponseHeaders().split(/\r?\n/);if(A.forEach(function(L){var C=L.match(/^([^:]+):\s*(.*)/);if(C){var Y=C[1].toLowerCase();Y==="set-cookie"?(M.headers[Y]===void 0&&(M.headers[Y]=[]),M.headers[Y].push(C[2])):M.headers[Y]!==void 0?M.headers[Y]+=", "+C[2]:M.headers[Y]=C[2],M.rawHeaders.push(C[1],C[2])}}),M._charset="x-user-defined",!r.overrideMimeType){var I=M.rawHeaders["mime-type"];if(I){var P=I.match(/;\s*charset=([^;])(;|$)/);P&&(M._charset=P[1].toLowerCase())}M._charset||(M._charset="utf-8")}}};return a(c,i.Readable),c.prototype._read=function(){var p=this||Rw,b=p._resumeFetch;b&&(p._resumeFetch=null,b())},c.prototype._onXHRProgress=function(p){var b=this||Rw,g=b._xhr,y=null;switch(b._mode){case"text":if(y=g.responseText,y.length>b._pos){var M=y.substr(b._pos);if(b._charset==="x-user-defined"){for(var x=t.alloc(M.length),E=0;E<M.length;E++)x[E]=M.charCodeAt(E)&255;b.push(x)}else b.push(M,b._charset);b._pos=y.length}break;case"arraybuffer":if(g.readyState!==h.DONE||!g.response)break;y=g.response,b.push(t.from(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=g.response,g.readyState!==h.LOADING||!y)break;b.push(t.from(new Uint8Array(y)));break;case"ms-stream":if(y=g.response,g.readyState!==h.LOADING)break;var A=new Rw.MSStreamReader;A.onprogress=function(){A.result.byteLength>b._pos&&(b.push(t.from(new Uint8Array(A.result.slice(b._pos)))),b._pos=A.result.byteLength)},A.onload=function(){p(!0),b.push(null)},A.readAsArrayBuffer(y);break}b._xhr.readyState===h.DONE&&b._mode!=="ms-stream"&&(p(!0),b.push(null))},Aw}function XLe(){if(yse)return DB;yse=!0;var t=ii.Buffer,e=yr,r=xse(),a=Mr(),i=Sse(),h=rp(),c=i.IncomingMessage,p=i.readyStates;function b(x,E){return r.fetch&&E?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&x?"arraybuffer":"text"}var g=DB=function(x){var E=this||oa;h.Writable.call(E),E._opts=x,E._body=[],E._headers={},x.auth&&E.setHeader("Authorization","Basic "+t.from(x.auth).toString("base64")),Object.keys(x.headers).forEach(function(P){E.setHeader(P,x.headers[P])});var A,I=!0;if(x.mode==="disable-fetch"||"requestTimeout"in x&&!r.abortController)I=!1,A=!0;else if(x.mode==="prefer-streaming")A=!1;else if(x.mode==="allow-wrong-content-type")A=!r.overrideMimeType;else if(!x.mode||x.mode==="default"||x.mode==="prefer-fast")A=!0;else throw new Error("Invalid value for opts.mode");E._mode=b(A,I),E._fetchTimer=null,E._socketTimeout=null,E._socketTimer=null,E.on("finish",function(){E._onFinish()})};a(g,h.Writable),g.prototype.setHeader=function(x,E){var A=this||oa,I=x.toLowerCase();M.indexOf(I)===-1&&(A._headers[I]={name:x,value:E})},g.prototype.getHeader=function(x){var E=(this||oa)._headers[x.toLowerCase()];return E?E.value:null},g.prototype.removeHeader=function(x){var E=this||oa;delete E._headers[x.toLowerCase()]},g.prototype._onFinish=function(){var x=this||oa;if(!x._destroyed){var E=x._opts;"timeout"in E&&E.timeout!==0&&x.setTimeout(E.timeout);var A=x._headers,I=null;E.method!=="GET"&&E.method!=="HEAD"&&(I=new Blob(x._body,{type:(A["content-type"]||{}).value||""}));var P=[];if(Object.keys(A).forEach(function(Y){var G=A[Y].name,ee=A[Y].value;Array.isArray(ee)?ee.forEach(function(D){P.push([G,D])}):P.push([G,ee])}),x._mode==="fetch"){var N=null;if(r.abortController){var L=new AbortController;N=L.signal,x._fetchAbortController=L,"requestTimeout"in E&&E.requestTimeout!==0&&(x._fetchTimer=oa.setTimeout(function(){x.emit("requestTimeout"),x._fetchAbortController&&x._fetchAbortController.abort()},E.requestTimeout))}oa.fetch(x._opts.url,{method:x._opts.method,headers:P,body:I||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:N}).then(function(Y){x._fetchResponse=Y,x._resetTimers(!1),x._connect()},function(Y){x._resetTimers(!0),x._destroyed||x.emit("error",Y)})}else{var C=x._xhr=new oa.XMLHttpRequest;try{C.open(x._opts.method,x._opts.url,!0)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}"responseType"in C&&(C.responseType=x._mode),"withCredentials"in C&&(C.withCredentials=!!E.withCredentials),x._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(C.timeout=E.requestTimeout,C.ontimeout=function(){x.emit("requestTimeout")}),P.forEach(function(Y){C.setRequestHeader(Y[0],Y[1])}),x._response=null,C.onreadystatechange=function(){switch(C.readyState){case p.LOADING:case p.DONE:x._onXHRProgress();break}},x._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){x._onXHRProgress()}),C.onerror=function(){x._destroyed||(x._resetTimers(!0),x.emit("error",new Error("XHR error")))};try{C.send(I)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}}}};function y(x){try{var E=x.status;return E!==null&&E!==0}catch{return!1}}g.prototype._onXHRProgress=function(){var x=this||oa;x._resetTimers(!1),!(!y(x._xhr)||x._destroyed)&&(x._response||x._connect(),x._response._onXHRProgress(x._resetTimers.bind(x)))},g.prototype._connect=function(){var x=this||oa;x._destroyed||(x._response=new c(x._xhr,x._fetchResponse,x._mode,x._resetTimers.bind(x)),x._response.on("error",function(E){x.emit("error",E)}),x.emit("response",x._response))},g.prototype._write=function(x,E,A){var I=this||oa;I._body.push(x),A()},g.prototype._resetTimers=function(x){var E=this||oa;oa.clearTimeout(E._socketTimer),E._socketTimer=null,x?(oa.clearTimeout(E._fetchTimer),E._fetchTimer=null):E._socketTimeout&&(E._socketTimer=oa.setTimeout(function(){E.emit("timeout")},E._socketTimeout))},g.prototype.abort=g.prototype.destroy=function(x){var E=this||oa;E._destroyed=!0,E._resetTimers(!0),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort(),x&&E.emit("error",x)},g.prototype.end=function(x,E,A){var I=this||oa;typeof x=="function"&&(A=x,x=void 0),h.Writable.prototype.end.call(I,x,E,A)},g.prototype.setTimeout=function(x,E){var A=this||oa;E&&A.once("timeout",E),A._socketTimeout=x,A._resetTimers(!1)},g.prototype.flushHeaders=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var M=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return DB}function QLe(){if(wse)return $B;wse=!0,$B=e;var t=Object.prototype.hasOwnProperty;function e(){for(var r={},a=0;a<arguments.length;a++){var i=arguments[a];for(var h in i)t.call(i,h)&&(r[h]=i[h])}return r}return $B}function eDe(){return _se||(_se=!0,qB={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),qB}function rDe(){if(Mse)return UB;Mse=!0;var t=XLe(),e=Sse(),r=QLe(),a=eDe(),i=vi,h=UB;return h.request=function(c,p){typeof c=="string"?c=i.parse(c):c=r(c);var b=tDe.location.protocol.search(/^https?:$/)===-1?"http:":"",g=c.protocol||b,y=c.hostname||c.host,M=c.port,x=c.path||"/";y&&y.indexOf(":")!==-1&&(y="["+y+"]"),c.url=(y?g+"//"+y:"")+(M?":"+M:"")+x,c.method=(c.method||"GET").toUpperCase(),c.headers=c.headers||{};var E=new t(c);return p&&E.on("response",p),E},h.get=function(p,b){var g=h.request(p,b);return g.end(),g},h.ClientRequest=t,h.IncomingMessage=e.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=a,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],UB}var qo,gse,jd,Aw,bse,Rw,DB,yse,oa,$B,wse,qB,_se,UB,Mse,tDe,zf,iDe,nDe,aDe,oDe,sDe,fDe,uDe,hDe,FB=xi(()=>{"use strict";ie();ae();ne();ah();sy();Ks();iw();Hs();th();zo();Fo();Gf();nb();ob();Dd();qo={},gse=!1,jd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Aw={},bse=!1,Rw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;DB={},yse=!1,oa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$B={},wse=!1;qB={},_se=!1;UB={},Mse=!1,tDe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zf=rDe(),iDe=zf.Agent,nDe=zf.ClientRequest,aDe=zf.IncomingMessage,oDe=zf.METHODS,sDe=zf.STATUS_CODES,fDe=zf.get,uDe=zf.globalAgent,hDe=zf.request});var Tse={};Ka(Tse,{Agent:()=>lDe,ClientRequest:()=>dDe,IncomingMessage:()=>pDe,METHODS:()=>vDe,STATUS_CODES:()=>mDe,default:()=>ec,get:()=>gDe,globalAgent:()=>bDe,request:()=>yDe});function cDe(){if(Ase)return jB;Ase=!0;var t=zf,e=vi,r=jB;for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.request=function(h,c){return h=i(h),t.request.call(this||Rse,h,c)},r.get=function(h,c){return h=i(h),t.get.call(this||Rse,h,c)};function i(h){if(typeof h=="string"&&(h=e.parse(h)),h.protocol||(h.protocol="https:"),h.protocol!=="https:")throw new Error('Protocol "'+h.protocol+'" not supported. Expected "https:"');return h}return jB}var jB,Ase,Rse,ec,lDe,dDe,pDe,vDe,mDe,gDe,bDe,yDe,Ise=xi(()=>{"use strict";ie();ae();ne();FB();iw();ah();Hs();th();zo();Fo();Ks();Gf();sy();nb();ob();Dd();jB={},Ase=!1,Rse=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ec=cDe(),lDe=ec.Agent,dDe=ec.ClientRequest,pDe=ec.IncomingMessage,vDe=ec.METHODS,mDe=ec.STATUS_CODES,gDe=ec.get,bDe=ec.globalAgent,yDe=ec.request});var Cse=ht((mgt,Nse)=>{"use strict";ie();ae();ne();function uv(t){"@babel/helpers - typeof";return uv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uv(t)}function kse(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function zB(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kse(Object(r),!0).forEach(function(a){wDe(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kse(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function wDe(t,e,r){return e=Pse(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bse(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Pse(a.key),a)}}function MDe(t,e,r){return e&&Bse(t.prototype,e),r&&Bse(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pse(t){var e=xDe(t,"string");return uv(e)=="symbol"?e:String(e)}function xDe(t,e){if(uv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(uv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SDe(t,e,r){return e=Tw(e),EDe(t,Ose()?Reflect.construct(e,r||[],Tw(t).constructor):e.apply(t,r))}function EDe(t,e){if(e&&(uv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ADe(t)}function ADe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ose(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ose=function(){return!!t})()}function Tw(t){return Tw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tw(t)}function RDe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ZB(t,e)}function ZB(t,e){return ZB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},ZB(t,e)}var TDe=(FB(),Qr(Ese)),IDe=(Ise(),Qr(Tse)),kDe=Ph(),BDe=kDe.Stream,PDe=ev(),ODe=Y1(),NDe=ODe.configure;Nse.exports=function(t){RDe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return _De(this,e),r=SDe(this,e,[a]),r.options=a,r.name=a.name||"http",r.ssl=!!a.ssl,r.host=a.host||"localhost",r.port=a.port,r.auth=a.auth,r.path=a.path||"",r.maximumDepth=a.maximumDepth,r.agent=a.agent,r.headers=a.headers||{},r.headers["content-type"]="application/json",r.batch=a.batch||!1,r.batchInterval=a.batchInterval||5e3,r.batchCount=a.batchCount||10,r.batchOptions=[],r.batchTimeoutID=-1,r.batchCallback={},r.port||(r.port=r.ssl?443:80),r}return MDe(e,[{key:"log",value:function(a,i){var h=this;this._request(a,null,null,function(c,p){p&&p.statusCode!==200&&(c=new Error("Invalid HTTP Status Code: ".concat(p.statusCode))),c?h.emit("warn",c):h.emit("logged",a)}),i&&setImmediate(i)}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a={method:"query",params:this.normalizeQuery(a)};var h=a.params.auth||null;delete a.params.auth;var c=a.params.path||null;delete a.params.path,this._request(a,h,c,function(p,b,g){if(b&&b.statusCode!==200&&(p=new Error("Invalid HTTP Status Code: ".concat(b.statusCode))),p)return i(p);if(typeof g=="string")try{g=JSON.parse(g)}catch(y){return i(y)}i(null,g)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new BDe;a={method:"stream",params:a};var h=a.params.path||null;delete a.params.path;var c=a.params.auth||null;delete a.params.auth;var p="",b=this._request(a,c,h);return i.destroy=function(){return b.destroy()},b.on("data",function(g){g=(p+g).split(/\n+/);for(var y=g.length-1,M=0;M<y;M++)try{i.emit("log",JSON.parse(g[M]))}catch(x){i.emit("error",x)}p=g[y]}),b.on("error",function(g){return i.emit("error",g)}),i}},{key:"_request",value:function(a,i,h,c){a=a||{},i=i||this.auth,h=h||this.path||"",this.batch?this._doBatch(a,c,i,h):this._doRequest(a,c,i,h)}},{key:"_doBatch",value:function(a,i,h,c){if(this.batchOptions.push(a),this.batchOptions.length===1){var p=this;this.batchCallback=i,this.batchTimeoutID=setTimeout(function(){p.batchTimeoutID=-1,p._doBatchRequest(p.batchCallback,h,c)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,h,c)}},{key:"_doBatchRequest",value:function(a,i,h){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var c=this.batchOptions.slice();this.batchOptions=[],this._doRequest(c,a,i,h)}},{key:"_doRequest",value:function(a,i,h,c){var p=Object.assign({},this.headers);h&&h.bearer&&(p.Authorization="Bearer ".concat(h.bearer));var b=(this.ssl?IDe:TDe).request(zB(zB({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(c.replace(/^\//,"")),headers:p,auth:h&&h.username&&h.password?"".concat(h.username,":").concat(h.password):"",agent:this.agent}));b.on("error",i),b.on("response",function(y){return y.on("end",function(){return i(null,y)}).resume()});var g=NDe(zB({},this.maximumDepth&&{maximumDepth:this.maximumDepth}));b.end(Me.from(g(a,this.options.replacer),"utf8"))}}]),e}(PDe)});var HB=ht((wgt,Lse)=>{"use strict";ie();ae();ne();var Hu=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Hu.writable=t=>Hu(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Hu.readable=t=>Hu(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Hu.duplex=t=>Hu.writable(t)&&Hu.readable(t);Hu.transform=t=>Hu.duplex(t)&&typeof t._transform=="function";Lse.exports=Hu});var Use=ht((Sgt,qse)=>{"use strict";ie();ae();ne();function hv(t){"@babel/helpers - typeof";return hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hv(t)}function CDe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dse(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,DDe(a.key),a)}}function LDe(t,e,r){return e&&Dse(t.prototype,e),r&&Dse(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function DDe(t){var e=$De(t,"string");return hv(e)=="symbol"?e:String(e)}function $De(t,e){if(hv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(hv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qDe(t,e,r){return e=Iw(e),UDe(t,$se()?Reflect.construct(e,r||[],Iw(t).constructor):e.apply(t,r))}function UDe(t,e){if(e&&(hv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FDe(t)}function FDe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $se(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($se=function(){return!!t})()}function Iw(t){return Iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Iw(t)}function jDe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&KB(t,e)}function KB(t,e){return KB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},KB(t,e)}var zDe=HB(),ZDe=on(),HDe=ZDe.MESSAGE,KDe=(Id(),Qr(Td)),WDe=ev();qse.exports=function(t){jDe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(CDe(this,e),r=qDe(this,e,[a]),!a.stream||!zDe(a.stream))throw new Error("options.stream is required.");return r._stream=a.stream,r._stream.setMaxListeners(1/0),r.isObjectMode=a.stream._writableState.objectMode,r.eol=typeof a.eol=="string"?a.eol:KDe.EOL,r}return LDe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.isObjectMode){this._stream.write(a),i&&i();return}this._stream.write("".concat(a[HDe]).concat(this.eol)),i&&i()}}]),e}(WDe)});var Fse=ht(vb=>{"use strict";ie();ae();ne();Object.defineProperty(vb,"Console",{configurable:!0,enumerable:!0,get:function(){return Mne()}});Object.defineProperty(vb,"File",{configurable:!0,enumerable:!0,get:function(){return mse()}});Object.defineProperty(vb,"Http",{configurable:!0,enumerable:!0,get:function(){return Cse()}});Object.defineProperty(vb,"Stream",{configurable:!0,enumerable:!0,get:function(){return Use()}})});var Bw=ht(mb=>{"use strict";ie();ae();ne();var kw=Ok(),VDe=on(),WB=VDe.configs;mb.cli=kw.levels(WB.cli);mb.npm=kw.levels(WB.npm);mb.syslog=kw.levels(WB.syslog);mb.addColors=kw.levels});var zse=ht((Pw,jse)=>{"use strict";ie();ae();ne();Object.defineProperty(Pw,"__esModule",{value:!0});var GDe=fw(),YDe=zd(GDe),JDe=bw(),XDe=zd(JDe),QDe=_B(),e$e=zd(QDe),t$e=bB(),r$e=zd(t$e),i$e=yB(),n$e=zd(i$e),a$e=Ud(),o$e=zd(a$e),s$e=sv(),f$e=zd(s$e);function zd(t){return t&&t.__esModule?t:{default:t}}function u$e(t,e,r){r=(0,r$e.default)(r);var a=0,i=0,{length:h}=t,c=!1;h===0&&r(null);function p(b,g){b===!1&&(c=!0),c!==!0&&(b?r(b):(++i===h||g===XDe.default)&&r(null))}for(;a<h;a++)e(t[a],a,(0,n$e.default)(p))}function h$e(t,e,r){return(0,e$e.default)(t,1/0,e,r)}function c$e(t,e,r){var a=(0,YDe.default)(t)?u$e:h$e;return a(t,(0,o$e.default)(e),r)}Pw.default=(0,f$e.default)(c$e,3);jse.exports=Pw.default});var Hse=ht((Ow,Zse)=>{"use strict";ie();ae();ne();Object.defineProperty(Ow,"__esModule",{value:!0});Ow.default=l$e;function l$e(t){return(e,r,a)=>t(e,a)}Zse.exports=Ow.default});var Lw=ht((Cw,Kse)=>{"use strict";ie();ae();ne();Object.defineProperty(Cw,"__esModule",{value:!0});var d$e=zse(),p$e=Nw(d$e),v$e=Hse(),m$e=Nw(v$e),g$e=Ud(),b$e=Nw(g$e),y$e=sv(),w$e=Nw(y$e);function Nw(t){return t&&t.__esModule?t:{default:t}}function _$e(t,e,r){return(0,p$e.default)(t,(0,m$e.default)((0,b$e.default)(e)),r)}Cw.default=(0,w$e.default)(_$e,3);Kse.exports=Cw.default});var Vse=ht((Hgt,Wse)=>{"use strict";ie();ae();ne();var M$e=Object.prototype.toString;Wse.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),a=M$e.call(e).slice(8,-1);return a==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=a,r||"anonymous"}});var VB=ht((Ggt,Gse)=>{"use strict";ie();ae();ne();var x$e=Vse();Gse.exports=function(e){var r=0,a;function i(){return r||(r=1,a=e.apply(this,arguments),e=null),a}return i.displayName=x$e(e),i}});var GB=ht(bb=>{"use strict";ie();ae();ne();bb.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},a=Error.prepareStackTrace;Error.prepareStackTrace=function(h,c){return c},Error.captureStackTrace(r,t||bb.get);var i=r.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=e,i};bb.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
|
|
121
|
+
`).slice(1);return r.map(function(a){if(a.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:a,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=a.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var h=null,c=null,p=null,b=null,g=null,y=i[5]==="native";if(i[1]){p=i[1];var M=p.lastIndexOf(".");if(p[M-1]=="."&&M--,M>0){h=p.substr(0,M),c=p.substr(M+1);var x=h.indexOf(".Module");x>0&&(p=p.substr(x+1),h=h.substr(0,x))}b=null}c&&(b=h,g=c),c==="<anonymous>"&&(g=null,p=null);var E={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:p,typeName:b,methodName:g,columnNumber:parseInt(i[4],10)||null,native:y};return e._createParsedCallSite(E)}}).filter(function(a){return!!a})};function gb(t){for(var e in t)this[e]=t[e]}var S$e=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],E$e=["topLevel","eval","native","constructor"];S$e.forEach(function(t){gb.prototype[t]=null,gb.prototype["get"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});E$e.forEach(function(t){gb.prototype[t]=!1,gb.prototype["is"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});bb._createParsedCallSite=function(t){return new gb(t)}});var Qse=ht((i2t,Xse)=>{"use strict";ie();ae();ne();function cv(t){"@babel/helpers - typeof";return cv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cv(t)}function A$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yse(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,T$e(a.key),a)}}function R$e(t,e,r){return e&&Yse(t.prototype,e),r&&Yse(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T$e(t){var e=I$e(t,"string");return cv(e)=="symbol"?e:String(e)}function I$e(t,e){if(cv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(cv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function k$e(t,e,r){return e=Dw(e),B$e(t,Jse()?Reflect.construct(e,r||[],Dw(t).constructor):e.apply(t,r))}function B$e(t,e){if(e&&(cv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P$e(t)}function P$e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jse(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jse=function(){return!!t})()}function Dw(t){return Dw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dw(t)}function O$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&YB(t,e)}function YB(t,e){return YB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},YB(t,e)}var N$e=Ph(),C$e=N$e.Writable;Xse.exports=function(t){O$e(e,t);function e(r){var a;if(A$e(this,e),a=k$e(this,e,[{objectMode:!0}]),!r)throw new Error("ExceptionStream requires a TransportStream instance.");return a.handleExceptions=!0,a.transport=r,a}return R$e(e,[{key:"_write",value:function(a,i,h){return a.exception?this.transport.log(a,h):(h(),!0)}}]),e}(C$e)});var XB=ht((s2t,ife)=>{"use strict";ie();ae();ne();function yb(t){"@babel/helpers - typeof";return yb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yb(t)}function L$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function efe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,$$e(a.key),a)}}function D$e(t,e,r){return e&&efe(t.prototype,e),r&&efe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $$e(t){var e=q$e(t,"string");return yb(e)=="symbol"?e:String(e)}function q$e(t,e){if(yb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(yb(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tfe=(Id(),Qr(Td)),U$e=Lw(),JB=pb()("winston:exception"),F$e=VB(),rfe=GB(),j$e=Qse();ife.exports=function(){function t(e){if(L$e(this,t),!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}return D$e(t,[{key:"handle",value:function(){for(var r=this,a=arguments.length,i=new Array(a),h=0;h<a;h++)i[h]=arguments[h];i.forEach(function(c){if(Array.isArray(c))return c.forEach(function(p){return r._addHandler(p)});r._addHandler(c)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),He.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var r=this;this.catcher&&(He.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(a){return r.logger.unpipe(a)}))}},{key:"getAllInfo",value:function(r){var a=null;return r&&(a=typeof r=="string"?r:r.message),{error:r,level:"error",message:["uncaughtException: ".concat(a||"(no error message)"),r&&r.stack||" No stack trace"].join(`
|
|
122
|
+
`),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:tfe.loadavg(),uptime:tfe.uptime()}}},{key:"getTrace",value:function(r){var a=r?rfe.parse(r):rfe.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleExceptions=!0;var a=new j$e(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_uncaughtException",value:function(r){var a=this.getAllInfo(r),i=this._getExceptionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,c;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),h=!1);function p(){JB("doExit",h),JB("process._exiting",He._exiting),h&&!He._exiting&&(c&&clearTimeout(c),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);U$e(i,function(b,g){var y=F$e(g),M=b.transport||b;function x(E){return function(){JB(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(c=setTimeout(p,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleExceptions})}}]),t}()});var sfe=ht((c2t,ofe)=>{"use strict";ie();ae();ne();function lv(t){"@babel/helpers - typeof";return lv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lv(t)}function z$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nfe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,H$e(a.key),a)}}function Z$e(t,e,r){return e&&nfe(t.prototype,e),r&&nfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function H$e(t){var e=K$e(t,"string");return lv(e)=="symbol"?e:String(e)}function K$e(t,e){if(lv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(lv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function W$e(t,e,r){return e=$w(e),V$e(t,afe()?Reflect.construct(e,r||[],$w(t).constructor):e.apply(t,r))}function V$e(t,e){if(e&&(lv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G$e(t)}function G$e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function afe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(afe=function(){return!!t})()}function $w(t){return $w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$w(t)}function Y$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&QB(t,e)}function QB(t,e){return QB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},QB(t,e)}var J$e=Ph(),X$e=J$e.Writable;ofe.exports=function(t){Y$e(e,t);function e(r){var a;if(z$e(this,e),a=W$e(this,e,[{objectMode:!0}]),!r)throw new Error("RejectionStream requires a TransportStream instance.");return a.handleRejections=!0,a.transport=r,a}return Z$e(e,[{key:"_write",value:function(a,i,h){return a.rejection?this.transport.log(a,h):(h(),!0)}}]),e}(X$e)});var tP=ht((v2t,cfe)=>{"use strict";ie();ae();ne();function wb(t){"@babel/helpers - typeof";return wb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wb(t)}function Q$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ffe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,tqe(a.key),a)}}function eqe(t,e,r){return e&&ffe(t.prototype,e),r&&ffe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function tqe(t){var e=rqe(t,"string");return wb(e)=="symbol"?e:String(e)}function rqe(t,e){if(wb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(wb(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ufe=(Id(),Qr(Td)),iqe=Lw(),eP=pb()("winston:rejection"),nqe=VB(),hfe=GB(),aqe=sfe();cfe.exports=function(){function t(e){if(Q$e(this,t),!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}return eqe(t,[{key:"handle",value:function(){for(var r=this,a=arguments.length,i=new Array(a),h=0;h<a;h++)i[h]=arguments[h];i.forEach(function(c){if(Array.isArray(c))return c.forEach(function(p){return r._addHandler(p)});r._addHandler(c)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),He.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var r=this;this.catcher&&(He.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(a){return r.logger.unpipe(a)}))}},{key:"getAllInfo",value:function(r){var a=null;return r&&(a=typeof r=="string"?r:r.message),{error:r,level:"error",message:["unhandledRejection: ".concat(a||"(no error message)"),r&&r.stack||" No stack trace"].join(`
|
|
123
|
+
`),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:ufe.loadavg(),uptime:ufe.uptime()}}},{key:"getTrace",value:function(r){var a=r?hfe.parse(r):hfe.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleRejections=!0;var a=new aqe(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_unhandledRejection",value:function(r){var a=this.getAllInfo(r),i=this._getRejectionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,c;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),h=!1);function p(){eP("doExit",h),eP("process._exiting",He._exiting),h&&!He._exiting&&(c&&clearTimeout(c),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);iqe(i,function(b,g){var y=nqe(g),M=b.transport||b;function x(E){return function(){eP(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(c=setTimeout(p,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleRejections})}}]),t}()});var vfe=ht((y2t,pfe)=>{"use strict";ie();ae();ne();var oqe=(ao(),Qr(Af)),lfe=sg(),{LEVEL:dfe}=on(),_b=pfe.exports=function(e={}){lfe.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",r=>{this.levels=r.levels,this.parent=r}),this.once("unpipe",r=>{r===this.parent&&(this.parent=null,this.close&&this.close())})};oqe.inherits(_b,lfe);_b.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[e[dfe]]){if(e&&!this.format)return this.log(e,a);let h,c;try{c=this.format.transform(Object.assign({},e),this.format.options)}catch(p){h=p}if(h||!c){if(a(),h)throw h;return}return this.log(c,a)}return this._writableState.sync=!1,a(null)};_b.prototype._writev=function(e,r){if(this.logv){let a=e.filter(this._accept,this);return a.length?this.logv(a,r):r(null)}for(let a=0;a<e.length;a++){if(!this._accept(e[a]))continue;if(e[a].chunk&&!this.format){this.log(e[a].chunk,e[a].callback);continue}let i,h;try{h=this.format.transform(Object.assign({},e[a].chunk),this.format.options)}catch(c){i=c}if(i||!h){if(e[a].callback(),i)throw r(null),i}else this.log(h,e[a].callback)}return r(null)};_b.prototype._accept=function(e){let r=e.chunk;if(this.silent)return!1;let a=this.level||this.parent&&this.parent.level;return!!((r.exception===!0||!a||this.levels[a]>=this.levels[r[dfe]])&&(this.handleExceptions||r.exception!==!0))};_b.prototype._nop=function(){}});var bfe=ht((x2t,gfe)=>{"use strict";ie();ae();ne();var sqe=(ao(),Qr(Af)),{LEVEL:rP}=on(),mfe=vfe(),Mb=gfe.exports=function(e={}){if(mfe.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function r(a){this.emit("error",a,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=r.bind(this),this.transport.on("error",this.transport.__winstonError))};sqe.inherits(Mb,mfe);Mb.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);(!this.level||this.levels[this.level]>=this.levels[e[rP]])&&this.transport.log(e[rP],e.message,e,this._nop),a(null)};Mb.prototype._writev=function(e,r){for(let a=0;a<e.length;a++)this._accept(e[a])&&(this.transport.log(e[a].chunk[rP],e[a].chunk.message,e[a].chunk,this._nop),e[a].callback());return r(null)};Mb.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
124
|
+
`))};Mb.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var _fe=ht((R2t,wfe)=>{"use strict";ie();ae();ne();function Zd(t){"@babel/helpers - typeof";return Zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zd(t)}function fqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yfe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,hqe(a.key),a)}}function uqe(t,e,r){return e&&yfe(t.prototype,e),r&&yfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function hqe(t){var e=cqe(t,"string");return Zd(e)=="symbol"?e:String(e)}function cqe(t,e){if(Zd(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Zd(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var lqe=function(){function t(e){fqe(this,t);var r=qw();if(Zd(e)!=="object"||Array.isArray(e)||!(e instanceof r))throw new Error("Logger is required for profiling");this.logger=e,this.start=Date.now()}return uqe(t,[{key:"done",value:function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];typeof a[a.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),a.pop());var h=Zd(a[a.length-1])==="object"?a.pop():{};return h.level=h.level||"info",h.durationMs=Date.now()-this.start,this.logger.write(h)}}]),t}();wfe.exports=lqe});var xfe=ht((B2t,Mfe)=>{"use strict";ie();ae();ne();var iP=class t extends Error{constructor(e){super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
125
125
|
Found: ${e.toString().split(`
|
|
126
126
|
`)[0]}
|
|
127
|
-
`),Error.captureStackTrace(this,t)}};Mfe.exports=t=>{if(t.length>2)throw new iP(t);function e(a={}){this.options=a}e.prototype.transform=t;function r(a){return new e(a)}return r.Format=e,r}});var Efe=ht((
|
|
127
|
+
`),Error.captureStackTrace(this,t)}};Mfe.exports=t=>{if(t.length>2)throw new iP(t);function e(a={}){this.options=a}e.prototype.transform=t;function r(a){return new e(a)}return r.Format=e,r}});var Efe=ht((C2t,Sfe)=>{"use strict";ie();ae();ne();var dqe=xfe(),{MESSAGE:pqe}=on(),vqe=Y1();function mqe(t,e){return typeof e=="bigint"?e.toString():e}Sfe.exports=dqe((t,e)=>{let r=vqe.configure(e);return t[pqe]=r(t,e.replacer||mqe,e.space),t})});var qw=ht((q2t,Cfe)=>{"use strict";ie();ae();ne();function Zf(t,e,r){return e=kfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tc(t){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tc(t)}function gqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Afe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,kfe(a.key),a)}}function bqe(t,e,r){return e&&Afe(t.prototype,e),r&&Afe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function kfe(t){var e=yqe(t,"string");return tc(e)=="symbol"?e:String(e)}function yqe(t,e){if(tc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(tc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wqe(t,e,r){return e=Uw(e),_qe(t,Bfe()?Reflect.construct(e,r||[],Uw(t).constructor):e.apply(t,r))}function _qe(t,e){if(e&&(tc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mqe(t)}function Mqe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bfe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Bfe=function(){return!!t})()}function Uw(t){return Uw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uw(t)}function xqe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aP(t,e)}function aP(t,e){return aP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},aP(t,e)}var Pfe=Ph(),Sqe=Pfe.Stream,Eqe=Pfe.Transform,Rfe=Lw(),Ofe=on(),Ku=Ofe.LEVEL,Tfe=Ofe.SPLAT,Ife=HB(),Aqe=XB(),Rqe=tP(),Tqe=bfe(),Iqe=_fe(),kqe=Nk(),Bqe=kqe.warn,Pqe=Bw(),Oqe=/%[scdjifoO%]/g,Nfe=function(t){xqe(e,t);function e(r){var a;return gqe(this,e),a=wqe(this,e,[{objectMode:!0}]),a.configure(r),a}return bqe(e,[{key:"child",value:function(a){var i=this;return Object.create(i,{write:{value:function(c){var p=Object.assign({},a,c);c instanceof Error&&(p.stack=c.stack,p.message=c.message),i.write(p)}}})}},{key:"configure",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=i.silent,c=i.format,p=i.defaultMeta,b=i.levels,g=i.level,y=g===void 0?"info":g,M=i.exitOnError,x=M===void 0?!0:M,E=i.transports,A=i.colors,I=i.emitErrs,P=i.formatters,N=i.padLevels,L=i.rewriters,C=i.stripColors,Y=i.exceptionHandlers,G=i.rejectionHandlers;if(this.transports.length&&this.clear(),this.silent=h,this.format=c||this.format||Efe()(),this.defaultMeta=p||null,this.levels=b||this.levels||Pqe.npm.levels,this.level=y,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new Aqe(this),this.rejections=new Rqe(this),this.profilers={},this.exitOnError=x,E&&(E=Array.isArray(E)?E:[E],E.forEach(function(ee){return a.add(ee)})),A||I||P||N||L||C)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
128
128
|
`));Y&&this.exceptions.handle(Y),G&&this.rejections.handle(G)}},{key:"isLevelEnabled",value:function(a){var i=this,h=nP(this.levels,a);if(h===null)return!1;var c=nP(this.levels,this.level);if(c===null)return!1;if(!this.transports||this.transports.length===0)return c>=h;var p=this.transports.findIndex(function(b){var g=nP(i.levels,b.level);return g===null&&(g=c),g>=h});return p!==-1}},{key:"log",value:function(a,i){for(var h=arguments.length,c=new Array(h>2?h-2:0),p=2;p<h;p++)c[p-2]=arguments[p];if(arguments.length===1)return a[Ku]=a.level,this._addDefaultMeta(a),this.write(a),this;if(arguments.length===2)return i&&tc(i)==="object"?(i[Ku]=i.level=a,this._addDefaultMeta(i),this.write(i),this):(i=Zf(Zf(Zf({},Ku,a),"level",a),"message",i),this._addDefaultMeta(i),this.write(i),this);var b=c[0];if(tc(b)==="object"&&b!==null){var g=i&&i.match&&i.match(Oqe);if(!g){var y=Object.assign({},this.defaultMeta,b,Zf(Zf(Zf(Zf({},Ku,a),Tfe,c),"level",a),"message",i));return b.message&&(y.message="".concat(y.message," ").concat(b.message)),b.stack&&(y.stack=b.stack),this.write(y),this}}return this.write(Object.assign({},this.defaultMeta,Zf(Zf(Zf(Zf({},Ku,a),Tfe,c),"level",a),"message",i))),this}},{key:"_transform",value:function(a,i,h){if(this.silent)return h();a[Ku]||(a[Ku]=a.level),!this.levels[a[Ku]]&&this.levels[a[Ku]]!==0&&console.error("[winston] Unknown logger level: %s",a[Ku]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",a);try{this.push(this.format.transform(a,this.format.options))}finally{this._writableState.sync=!1,h()}}},{key:"_final",value:function(a){var i=this.transports.slice();Rfe(i,function(h,c){if(!h||h.finished)return setImmediate(c);h.once("finish",c),h.end()},a)}},{key:"add",value:function(a){var i=!Ife(a)||a.log.length>2?new Tqe({transport:a}):a;if(!i._writableState||!i._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",i),this._onEvent("warn",i),this.pipe(i),a.handleExceptions&&this.exceptions.handle(),a.handleRejections&&this.rejections.handle(),this}},{key:"remove",value:function(a){if(!a)return this;var i=a;return(!Ife(a)||a.log.length>2)&&(i=this.transports.filter(function(h){return h.transport===a})[0]),i&&this.unpipe(i),this}},{key:"clear",value:function(){return this.unpipe(),this}},{key:"close",value:function(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}},{key:"setLevels",value:function(){Bqe.deprecated("setLevels")}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=a||{};var h={},c=Object.assign({},a.query||{});function p(g,y){a.query&&typeof g.formatQuery=="function"&&(a.query=g.formatQuery(c)),g.query(a,function(M,x){if(M)return y(M);typeof g.formatResults=="function"&&(x=g.formatResults(x,a.format)),y(null,x)})}function b(g,y){p(g,function(M,x){y&&(x=M||x,x&&(h[g.name]=x),y()),y=null})}Rfe(this.transports.filter(function(g){return!!g.query}),b,function(){return i(null,h)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new Sqe,h=[];return i._streams=h,i.destroy=function(){for(var c=h.length;c--;)h[c].destroy()},this.transports.filter(function(c){return!!c.stream}).forEach(function(c){var p=c.stream(a);p&&(h.push(p),p.on("log",function(b){b.transport=b.transport||[],b.transport.push(c.name),i.emit("log",b)}),p.on("error",function(b){b.transport=b.transport||[],b.transport.push(c.name),i.emit("error",b)}))}),i}},{key:"startTimer",value:function(){return new Iqe(this)}},{key:"profile",value:function(a){var i=Date.now();if(this.profilers[a]){var h=this.profilers[a];delete this.profilers[a];for(var c=arguments.length,p=new Array(c>1?c-1:0),b=1;b<c;b++)p[b-1]=arguments[b];typeof p[p.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),p.pop());var g=tc(p[p.length-1])==="object"?p.pop():{};return g.level=g.level||"info",g.durationMs=i-h,g.message=g.message||a,this.write(g)}return this.profilers[a]=i,this}},{key:"handleExceptions",value:function(){var a;console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),(a=this.exceptions).handle.apply(a,arguments)}},{key:"unhandleExceptions",value:function(){var a;console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),(a=this.exceptions).unhandle.apply(a,arguments)}},{key:"cli",value:function(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
129
|
-
`))}},{key:"_onEvent",value:function(a,i){function h(c){a==="error"&&!this.transports.includes(i)&&this.add(i),this.emit(a,c,i)}i["__winston"+a]||(i["__winston"+a]=h.bind(this),i.on(a,i["__winston"+a]))}},{key:"_addDefaultMeta",value:function(a){this.defaultMeta&&Object.assign(a,this.defaultMeta)}}]),e}(Eqe);function nP(t,e){var r=t[e];return!r&&r!==0?null:r}Object.defineProperty(Nfe.prototype,"transports",{configurable:!1,enumerable:!0,get:function(){var e=this._readableState.pipes;return Array.isArray(e)?e:[e].filter(Boolean)}});Cfe.exports=Nfe});var sP=ht((j2t,$fe)=>{"use strict";ie();ae();ne();function dv(t){"@babel/helpers - typeof";return dv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dv(t)}function Lfe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Cqe(a.key),a)}}function Nqe(t,e,r){return e&&Lfe(t.prototype,e),r&&Lfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Cqe(t){var e=Lqe(t,"string");return dv(e)=="symbol"?e:String(e)}function Lqe(t,e){if(dv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(dv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $qe(t,e,r){return e=Fw(e),qqe(t,Dfe()?Reflect.construct(e,r||[],Fw(t).constructor):e.apply(t,r))}function qqe(t,e){if(e&&(dv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uqe(t)}function Uqe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dfe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dfe=function(){return!!t})()}function Fw(t){return Fw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fw(t)}function Fqe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oP(t,e)}function oP(t,e){return oP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},oP(t,e)}var jqe=on(),zqe=jqe.LEVEL,Zqe=Bw(),Hqe=qw(),Kqe=pb()("winston:create-logger");function Wqe(t){return"is"+t.charAt(0).toUpperCase()+t.slice(1)+"Enabled"}$fe.exports=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.levels=t.levels||Zqe.npm.levels;var e=function(a){Fqe(i,a);function i(h){return Dqe(this,i),$qe(this,i,[h])}return Nqe(i)}(Hqe),r=new e(t);return Object.keys(t.levels).forEach(function(a){if(Kqe('Define prototype method for "%s"',a),a==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}e.prototype[a]=function(){for(var i=this||r,h=arguments.length,c=new Array(h),p=0;p<h;p++)c[p]=arguments[p];if(c.length===1){var b=c[0],g=b&&b.message&&b||{message:b};return g.level=g[zqe]=a,i._addDefaultMeta(g),i.write(g),this||r}return c.length===0?(i.log(a,""),i):i.log.apply(i,[a].concat(c))},e.prototype[Wqe(a)]=function(){return(this||r).isLevelEnabled(a)}}),r}});var Ffe=ht((K2t,Ufe)=>{"use strict";ie();ae();ne();function xb(t){"@babel/helpers - typeof";return xb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xb(t)}function Vqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qfe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Yqe(a.key),a)}}function Gqe(t,e,r){return e&&qfe(t.prototype,e),r&&qfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yqe(t){var e=Jqe(t,"string");return xb(e)=="symbol"?e:String(e)}function Jqe(t,e){if(xb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(xb(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xqe=sP();Ufe.exports=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vqe(this,t),this.loggers=new Map,this.options=e}return Gqe(t,[{key:"add",value:function(r,a){var i=this;if(!this.loggers.has(r)){a=Object.assign({},a||this.options);var h=a.transports||this.options.transports;h?a.transports=Array.isArray(h)?h.slice():[h]:a.transports=[];var c=Xqe(a);c.on("close",function(){return i._delete(r)}),this.loggers.set(r,c)}return this.loggers.get(r)}},{key:"get",value:function(r,a){return this.add(r,a)}},{key:"has",value:function(r){return!!this.loggers.has(r)}},{key:"close",value:function(r){var a=this;if(r)return this._removeLogger(r);this.loggers.forEach(function(i,h){return a._removeLogger(h)})}},{key:"_removeLogger",value:function(r){if(this.loggers.has(r)){var a=this.loggers.get(r);a.close(),this._delete(r)}}},{key:"_delete",value:function(r){this.loggers.delete(r)}}]),t}()});var zfe=ht(zi=>{"use strict";ie();ae();ne();var jfe=Ok(),Qqe=Nk(),Sb=Qqe.warn;zi.version=hne().version;zi.transports=Fse();zi.config=Bw();zi.addColors=jfe.levels;zi.format=jfe.format;zi.createLogger=sP();zi.Logger=qw();zi.ExceptionHandler=XB();zi.RejectionHandler=tP();zi.Container=Ffe();zi.Transport=ev();zi.loggers=new zi.Container;var Hf=zi.createLogger();Object.keys(zi.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(t){return zi[t]=function(){return Hf[t].apply(Hf,arguments)}});Object.defineProperty(zi,"level",{get:function(){return Hf.level},set:function(e){Hf.level=e}});Object.defineProperty(zi,"exceptions",{get:function(){return Hf.exceptions}});Object.defineProperty(zi,"rejections",{get:function(){return Hf.rejections}});["exitOnError"].forEach(function(t){Object.defineProperty(zi,t,{get:function(){return Hf[t]},set:function(r){Hf[t]=r}})});Object.defineProperty(zi,"default",{get:function(){return{exceptionHandlers:Hf.exceptionHandlers,rejectionHandlers:Hf.rejectionHandlers,transports:Hf.transports}}});Sb.deprecated(zi,"setLevels");Sb.forFunctions(zi,"useFormat",["cli"]);Sb.forProperties(zi,"useFormat",["padLevels","stripColors"]);Sb.forFunctions(zi,"deprecated",["addRewriter","addFilter","clone","extend"]);Sb.forProperties(zi,"deprecated",["emitErrs","levelLength"])});var Xfe=ht((vyt,cP)=>{"use strict";ie();ae();ne();var iUe=Object.prototype.hasOwnProperty,Za="~";function Ab(){}Object.create&&(Ab.prototype=Object.create(null),new Ab().__proto__||(Za=!1));function nUe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Jfe(t,e,r,a,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var h=new nUe(r,a||t,i),c=Za?Za+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],h]:t._events[c].push(h):(t._events[c]=h,t._eventsCount++),t}function Kw(t,e){--t._eventsCount===0?t._events=new Ab:delete t._events[e]}function Pa(){this._events=new Ab,this._eventsCount=0}Pa.prototype.eventNames=function(){var e=[],r,a;if(this._eventsCount===0)return e;for(a in r=this._events)iUe.call(r,a)&&e.push(Za?a.slice(1):a);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Pa.prototype.listeners=function(e){var r=Za?Za+e:e,a=this._events[r];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,h=a.length,c=new Array(h);i<h;i++)c[i]=a[i].fn;return c};Pa.prototype.listenerCount=function(e){var r=Za?Za+e:e,a=this._events[r];return a?a.fn?1:a.length:0};Pa.prototype.emit=function(e,r,a,i,h,c){var p=Za?Za+e:e;if(!this._events[p])return!1;var b=this._events[p],g=arguments.length,y,M;if(b.fn){switch(b.once&&this.removeListener(e,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,r),!0;case 3:return b.fn.call(b.context,r,a),!0;case 4:return b.fn.call(b.context,r,a,i),!0;case 5:return b.fn.call(b.context,r,a,i,h),!0;case 6:return b.fn.call(b.context,r,a,i,h,c),!0}for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];b.fn.apply(b.context,y)}else{var x=b.length,E;for(M=0;M<x;M++)switch(b[M].once&&this.removeListener(e,b[M].fn,void 0,!0),g){case 1:b[M].fn.call(b[M].context);break;case 2:b[M].fn.call(b[M].context,r);break;case 3:b[M].fn.call(b[M].context,r,a);break;case 4:b[M].fn.call(b[M].context,r,a,i);break;default:if(!y)for(E=1,y=new Array(g-1);E<g;E++)y[E-1]=arguments[E];b[M].fn.apply(b[M].context,y)}}return!0};Pa.prototype.on=function(e,r,a){return Jfe(this,e,r,a,!1)};Pa.prototype.once=function(e,r,a){return Jfe(this,e,r,a,!0)};Pa.prototype.removeListener=function(e,r,a,i){var h=Za?Za+e:e;if(!this._events[h])return this;if(!r)return Kw(this,h),this;var c=this._events[h];if(c.fn)c.fn===r&&(!i||c.once)&&(!a||c.context===a)&&Kw(this,h);else{for(var p=0,b=[],g=c.length;p<g;p++)(c[p].fn!==r||i&&!c[p].once||a&&c[p].context!==a)&&b.push(c[p]);b.length?this._events[h]=b.length===1?b[0]:b:Kw(this,h)}return this};Pa.prototype.removeAllListeners=function(e){var r;return e?(r=Za?Za+e:e,this._events[r]&&Kw(this,r)):(this._events=new Ab,this._eventsCount=0),this};Pa.prototype.off=Pa.prototype.removeListener;Pa.prototype.addListener=Pa.prototype.on;Pa.prefixed=Za;Pa.EventEmitter=Pa;typeof cP<"u"&&(cP.exports=Pa)});ie();ae();ne();ie();ae();ne();var uT={};Ka(uT,{AVSCTap:()=>Eg,AlgorandSigner:()=>mg,AptosSigner:()=>bg,ArconnectSigner:()=>ul,Arweave:()=>xW.default,ArweaveSigner:()=>zc,Bundle:()=>I8,BundleItem:()=>fT,CryptoDriver:()=>v3,Curve25519:()=>So,DataItem:()=>v1,EthereumSigner:()=>Bo,HexInjectedSolanaSigner:()=>J0,HexSolanaSigner:()=>gg,InjectedAptosSigner:()=>X0,InjectedEthereumSigner:()=>fR,InjectedSolanaSigner:()=>A0,InjectedTypedEthereumSigner:()=>nT,KyveSigner:()=>_g,MAX_TAG_BYTES:()=>A8,MIN_BINARY_SIZE:()=>R8,MultiSignatureAptosSigner:()=>Q0,NearSigner:()=>vg,PolygonSigner:()=>pg,Rsa4096:()=>S0,SIG_CONFIG:()=>Kr,SignatureConfig:()=>wr,Signer:()=>Qw,SolanaSigner:()=>Ih,Transaction:()=>MW.default,TypedEthereumSigner:()=>ed,bundleAndSignData:()=>Q4e,byteArrayToLong:()=>bn,concatBuffers:()=>Bi.concatBuffers,createData:()=>Rg,deepHash:()=>$c,deserializeTags:()=>p1,exportForTesting:()=>G4e,getCryptoDriver:()=>Mn,getSignatureAndId:()=>UX,indexToType:()=>Mg,keccak256:()=>tT,longTo16ByteArray:()=>J4e,longTo32ByteArray:()=>E8,longTo8ByteArray:()=>S8,longToNByteArray:()=>Sg,secp256k1:()=>Y0,serializeTags:()=>oT,shortTo2ByteArray:()=>aT,sign:()=>T8,stringToBuffer:()=>Bi.stringToBuffer,unbundleData:()=>X4e});ie();ae();ne();ie();ae();ne();ie();ae();ne();var Qw=class{publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,a,i){throw new Error("You must implement verify method on child")}};ie();ae();ne();ie();ae();ne();var LK=mi(Uo(),1);ie();ae();ne();var wr;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM",t[t.KYVE=101]="KYVE"})(wr||(wr={}));var Kr={[wr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[wr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[wr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[wr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[wr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[wr.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[wr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"},[wr.KYVE]:{sigLength:65,pubLength:65,sigName:"kyve"}};ie();ae();ne();lu();var Yn=BigInt(0),ai=BigInt(1),Cc=BigInt(2),Tge=BigInt(8),TK=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),Wi=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:TK,n:TK,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});var OK=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),Sm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),mje=BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),Ige=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),kge=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Bge=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Pge=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Cn=class t{constructor(e,r,a,i){this.x=e,this.y=r,this.z=a,this.t=i}static fromAffine(e){if(!(e instanceof _n))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(_n.ZERO)?t.ZERO:new t(e.x,e.y,ai,Et(e.x*e.y))}static toAffineBatch(e){let r=Cge(e.map(a=>a.z));return e.map((a,i)=>a.toAffine(r[i]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){kK(e);let{x:r,y:a,z:i}=this,{x:h,y:c,z:p}=e,b=Et(r*p),g=Et(h*i),y=Et(a*p),M=Et(c*i);return b===g&&y===M}negate(){return new t(Et(-this.x),this.y,this.z,Et(-this.t))}double(){let{x:e,y:r,z:a}=this,{a:i}=Wi,h=Et(e*e),c=Et(r*r),p=Et(Cc*Et(a*a)),b=Et(i*h),g=e+r,y=Et(Et(g*g)-h-c),M=b+c,x=M-p,E=b-c,A=Et(y*x),I=Et(M*E),P=Et(y*E),N=Et(x*M);return new t(A,I,N,P)}add(e){kK(e);let{x:r,y:a,z:i,t:h}=this,{x:c,y:p,z:b,t:g}=e,y=Et((a-r)*(p+c)),M=Et((a+r)*(p-c)),x=Et(M-y);if(x===Yn)return this.double();let E=Et(i*Cc*g),A=Et(h*Cc*b),I=A+E,P=M+y,N=A-E,L=Et(I*x),C=Et(P*N),Y=Et(I*N),G=Et(x*P);return new t(L,C,G,Y)}subtract(e){return this.add(e.negate())}precomputeWindow(e){let r=1+256/e,a=[],i=this,h=i;for(let c=0;c<r;c++){h=i,a.push(h);for(let p=1;p<2**(e-1);p++)h=h.add(i),a.push(h);i=h.double()}return a}wNAF(e,r){!r&&this.equals(t.BASE)&&(r=_n.BASE);let a=r&&r._WINDOW_SIZE||1;if(256%a)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=r&&cE.get(r);i||(i=this.precomputeWindow(a),r&&a!==1&&(i=t.normalizeZ(i),cE.set(r,i)));let h=t.ZERO,c=t.BASE,p=1+256/a,b=2**(a-1),g=BigInt(2**a-1),y=2**a,M=BigInt(a);for(let x=0;x<p;x++){let E=x*b,A=Number(e&g);e>>=M,A>b&&(A-=y,e+=ai);let I=E,P=E+Math.abs(A)-1,N=x%2!==0,L=A<0;A===0?c=c.add(IK(N,i[I])):h=h.add(IK(L,i[P]))}return t.normalizeZ([h,c])[0]}multiply(e,r){return this.wNAF(i3(e,Wi.l),r)}multiplyUnsafe(e){let r=i3(e,Wi.l,!1),a=t.BASE,i=t.ZERO;if(r===Yn)return i;if(this.equals(i)||r===ai)return this;if(this.equals(a))return this.wNAF(r);let h=i,c=this;for(;r>Yn;)r&ai&&(h=h.add(c)),c=c.double(),r>>=ai;return h}isSmallOrder(){return this.multiplyUnsafe(Wi.h).equals(t.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(Wi.l/Cc).double();return Wi.l%Cc&&(e=e.add(this)),e.equals(t.ZERO)}toAffine(e){let{x:r,y:a,z:i}=this,h=this.equals(t.ZERO);e==null&&(e=h?Tge:n3(i));let c=Et(r*e),p=Et(a*e),b=Et(i*e);if(h)return _n.ZERO;if(b!==ai)throw new Error("invZ was invalid");return new _n(c,p)}fromRistrettoBytes(){fE()}toRistrettoBytes(){fE()}fromRistrettoHash(){fE()}};Cn.BASE=new Cn(Wi.Gx,Wi.Gy,ai,Et(Wi.Gx*Wi.Gy));Cn.ZERO=new Cn(Yn,ai,ai,Yn);function IK(t,e){let r=e.negate();return t?r:e}function kK(t){if(!(t instanceof Cn))throw new TypeError("ExtendedPoint expected")}function sE(t){if(!(t instanceof M0))throw new TypeError("RistrettoPoint expected")}function fE(){throw new Error("Legacy method: switch to RistrettoPoint")}var M0=class t{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){let{d:r}=Wi,a=Et(Sm*e*e),i=Et((a+ai)*Bge),h=BigInt(-1),c=Et((h-r*a)*Et(a+r)),{isValid:p,value:b}=dE(i,c),g=Et(b*e);Nc(g)||(g=Et(-g)),p||(b=g),p||(h=a);let y=Et(h*(a-ai)*Pge-c),M=b*b,x=Et((b+b)*c),E=Et(y*Ige),A=Et(ai-M),I=Et(ai+M);return new Cn(Et(x*I),Et(A*E),Et(E*I),Et(x*A))}static hashToCurve(e){e=Lc(e,64);let r=uE(e.slice(0,32)),a=this.calcElligatorRistrettoMap(r),i=uE(e.slice(32,64)),h=this.calcElligatorRistrettoMap(i);return new t(a.add(h))}static fromHex(e){e=Lc(e,32);let{a:r,d:a}=Wi,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",h=uE(e);if(!Dge(Am(h),e)||Nc(h))throw new Error(i);let c=Et(h*h),p=Et(ai+r*c),b=Et(ai-r*c),g=Et(p*p),y=Et(b*b),M=Et(r*a*g-y),{isValid:x,value:E}=PK(Et(M*y)),A=Et(E*b),I=Et(E*A*M),P=Et((h+h)*A);Nc(P)&&(P=Et(-P));let N=Et(p*I),L=Et(P*N);if(!x||Nc(L)||N===Yn)throw new Error(i);return new t(new Cn(P,N,ai,L))}toRawBytes(){let{x:e,y:r,z:a,t:i}=this.ep,h=Et(Et(a+r)*Et(a-r)),c=Et(e*r),p=Et(c*c),{value:b}=PK(Et(h*p)),g=Et(b*h),y=Et(b*c),M=Et(g*y*i),x;if(Nc(i*M)){let A=Et(r*Sm),I=Et(e*Sm);e=A,r=I,x=Et(g*kge)}else x=y;Nc(e*M)&&(r=Et(-r));let E=Et((a-r)*x);return Nc(E)&&(E=Et(-E)),Am(E)}toHex(){return Rm(this.toRawBytes())}toString(){return this.toHex()}equals(e){sE(e);let r=this.ep,a=e.ep,i=Et(r.x*a.y)===Et(r.y*a.x),h=Et(r.y*a.y)===Et(r.x*a.x);return i||h}add(e){return sE(e),new t(this.ep.add(e.ep))}subtract(e){return sE(e),new t(this.ep.subtract(e.ep))}multiply(e){return new t(this.ep.multiply(e))}multiplyUnsafe(e){return new t(this.ep.multiplyUnsafe(e))}};M0.BASE=new M0(Cn.BASE);M0.ZERO=new M0(Cn.ZERO);var cE=new WeakMap,_n=class t{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,cE.delete(this)}static fromHex(e,r=!0){let{d:a,P:i}=Wi;e=Lc(e,32);let h=e.slice();h[31]=e[31]&-129;let c=Tm(h);if(r&&c>=i)throw new Error("Expected 0 < hex < P");if(!r&&c>=OK)throw new Error("Expected 0 < hex < 2**256");let p=Et(c*c),b=Et(p-ai),g=Et(a*p+ai),{isValid:y,value:M}=dE(b,g);if(!y)throw new Error("Point.fromHex: invalid y coordinate");let x=(M&ai)===ai;return(e[31]&128)!==0!==x&&(M=Et(-M)),new t(M,c)}static async fromPrivateKey(e){return(await pE(e)).point}toRawBytes(){let e=Am(this.y);return e[31]|=this.x&ai?128:0,e}toHex(){return Rm(this.toRawBytes())}toX25519(){let{y:e}=this,r=Et((ai+e)*n3(ai-e));return Am(r)}isTorsionFree(){return Cn.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new t(Et(-this.x),this.y)}add(e){return Cn.fromAffine(this).add(Cn.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Cn.fromAffine(this).multiply(e,this).toAffine()}};_n.BASE=new _n(Wi.Gx,Wi.Gy);_n.ZERO=new _n(Yn,ai);var Em=class t{constructor(e,r){this.r=e,this.s=r,this.assertValidity()}static fromHex(e){let r=Lc(e,64),a=_n.fromHex(r.slice(0,32),!1),i=Tm(r.slice(32,64));return new t(a,i)}assertValidity(){let{r:e,s:r}=this;if(!(e instanceof _n))throw new Error("Expected Point instance");return i3(r,Wi.l,!1),this}toRawBytes(){let e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(Am(this.s),32),e}toHex(){return Rm(this.toRawBytes())}};function BK(...t){if(!t.every(a=>a instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(t.length===1)return t[0];let e=t.reduce((a,i)=>a+i.length,0),r=new Uint8Array(e);for(let a=0,i=0;a<t.length;a++){let h=t[a];r.set(h,i),i+=h.length}return r}var Oge=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Rm(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Oge[t[r]];return e}function lE(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let a=r*2,i=t.slice(a,a+2),h=Number.parseInt(i,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");e[r]=h}return e}function NK(t){let r=t.toString(16).padStart(64,"0");return lE(r)}function Am(t){return NK(t).reverse()}function Nc(t){return(Et(t)&ai)===ai}function Tm(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Rm(Uint8Array.from(t).reverse()))}var Nge=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function uE(t){return Et(Tm(t)&Nge)}function Et(t,e=Wi.P){let r=t%e;return r>=Yn?r:e+r}function n3(t,e=Wi.P){if(t===Yn||e<=Yn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Et(t,e),a=e,i=Yn,h=ai,c=ai,p=Yn;for(;r!==Yn;){let g=a/r,y=a%r,M=i-c*g,x=h-p*g;a=r,r=y,i=c,h=p,c=M,p=x}if(a!==ai)throw new Error("invert: does not exist");return Et(i,e)}function Cge(t,e=Wi.P){let r=new Array(t.length),a=t.reduce((h,c,p)=>c===Yn?h:(r[p]=h,Et(h*c,e)),ai),i=n3(a,e);return t.reduceRight((h,c,p)=>c===Yn?h:(r[p]=Et(h*r[p],e),Et(h*c,e)),i),r}function du(t,e){let{P:r}=Wi,a=t;for(;e-- >Yn;)a*=a,a%=r;return a}function Lge(t){let{P:e}=Wi,r=BigInt(5),a=BigInt(10),i=BigInt(20),h=BigInt(40),c=BigInt(80),b=t*t%e*t%e,g=du(b,Cc)*b%e,y=du(g,ai)*t%e,M=du(y,r)*y%e,x=du(M,a)*M%e,E=du(x,i)*x%e,A=du(E,h)*E%e,I=du(A,c)*A%e,P=du(I,c)*A%e,N=du(P,a)*M%e;return{pow_p_5_8:du(N,Cc)*t%e,b2:b}}function dE(t,e){let r=Et(e*e*e),a=Et(r*r*e),i=Lge(t*a).pow_p_5_8,h=Et(t*r*i),c=Et(e*h*h),p=h,b=Et(h*Sm),g=c===t,y=c===Et(-t),M=c===Et(-t*Sm);return g&&(h=p),(y||M)&&(h=b),Nc(h)&&(h=Et(-h)),{isValid:g||y,value:h}}function PK(t){return dE(ai,t)}function r3(t){return Et(Tm(t),Wi.l)}function Dge(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Lc(t,e){let r=t instanceof Uint8Array?Uint8Array.from(t):lE(t);if(typeof e=="number"&&r.length!==e)throw new Error(`Expected ${e} bytes`);return r}function i3(t,e,r=!0){if(!e)throw new TypeError("Specify max value");if(typeof t=="number"&&Number.isSafeInteger(t)&&(t=BigInt(t)),typeof t=="bigint"&&t<e){if(r){if(Yn<t)return t}else if(Yn<=t)return t}throw new TypeError("Expected valid scalar: 0 < scalar < max")}function $ge(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function qge(t){if(t=typeof t=="bigint"||typeof t=="number"?NK(i3(t,OK)):Lc(t),t.length!==32)throw new Error("Expected 32 bytes");return t}function Uge(t){let e=$ge(t.slice(0,32)),r=t.slice(32,64),a=r3(e),i=_n.BASE.multiply(a),h=i.toRawBytes();return{head:e,prefix:r,scalar:a,point:i,pointBytes:h}}var hE;async function pE(t){return Uge(await kp.sha512(qge(t)))}async function CK(t,e){t=Lc(t);let{prefix:r,scalar:a,pointBytes:i}=await pE(e),h=r3(await kp.sha512(r,t)),c=_n.BASE.multiply(h),p=r3(await kp.sha512(c.toRawBytes(),i,t)),b=Et(h+p*a,Wi.l);return new Em(c,b).toRawBytes()}function Fge(t,e,r){e=Lc(e),r instanceof _n||(r=_n.fromHex(r,!1));let{r:a,s:i}=t instanceof Em?t.assertValidity():Em.fromHex(t),h=Cn.BASE.multiplyUnsafe(i);return{r:a,s:i,SB:h,pub:r,msg:e}}function jge(t,e,r,a){let i=r3(a),h=Cn.fromAffine(t).multiplyUnsafe(i);return Cn.fromAffine(e).add(h).subtract(r).multiplyUnsafe(Wi.h).equals(Cn.ZERO)}async function Dc(t,e,r){let{r:a,SB:i,msg:h,pub:c}=Fge(t,e,r),p=await kp.sha512(a.toRawBytes(),c.toRawBytes(),h);return jge(c,a,i,p)}_n.BASE._setWindowSize(8);var Oc={node:xm,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},kp={bytesToHex:Rm,hexToBytes:lE,concatBytes:BK,getExtendedPublicKey:pE,mod:Et,invert:n3,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if(t=Lc(t),t.length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Et(Tm(t),Wi.l-ai)+ai},randomBytes:(t=32)=>{if(Oc.web)return Oc.web.getRandomValues(new Uint8Array(t));if(Oc.node){let{randomBytes:e}=Oc.node;return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>kp.randomBytes(32),sha512:async(...t)=>{let e=BK(...t);if(Oc.web){let r=await Oc.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(r)}else{if(Oc.node)return Uint8Array.from(Oc.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(t=8,e=_n.BASE){let r=e.equals(_n.BASE)?e:new _n(e.x,e.y);return r._setWindowSize(t),r.multiply(Cc),r},sha512Sync:void 0};Object.defineProperties(kp,{sha512Sync:{configurable:!1,get(){return hE},set(t){hE||(hE=t)}}});var So=class{_key;pk;ownerLength=Kr[2].pubLength;signatureLength=Kr[2].sigLength;_publicKey;get publicKey(){return this._publicKey}signatureType=2;constructor(e,r){this._key=e,this.pk=r}get key(){throw new Error("You must implement `key`")}sign(e){return CK(Me.from(e),Me.from(this.key))}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=LK.default.toBuffer(e)),Dc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Bi=mi(pf(),1);ie();ae();ne();lu();async function $c(t){if(typeof t[Symbol.asyncIterator]=="function"){let i=t,h=df("sha384"),c=0;for await(let g of i)c+=g.byteLength,h.update(g);let p=(0,Bi.concatBuffers)([(0,Bi.stringToBuffer)("blob"),(0,Bi.stringToBuffer)(c.toString())]),b=(0,Bi.concatBuffers)([await Mn().hash(p,"SHA-384"),h.digest()]);return await Mn().hash(b,"SHA-384")}else if(Array.isArray(t)){let i=(0,Bi.concatBuffers)([(0,Bi.stringToBuffer)("list"),(0,Bi.stringToBuffer)(t.length.toString())]);return await WK(t,await Mn().hash(i,"SHA-384"))}let e=t,r=(0,Bi.concatBuffers)([(0,Bi.stringToBuffer)("blob"),(0,Bi.stringToBuffer)(e.byteLength.toString())]),a=(0,Bi.concatBuffers)([await Mn().hash(r,"SHA-384"),await Mn().hash(e,"SHA-384")]);return await Mn().hash(a,"SHA-384")}async function WK(t,e){if(t.length<1)return e;let r=(0,Bi.concatBuffers)([e,await $c(t[0])]),a=await Mn().hash(r,"SHA-384");return await WK(t.slice(1),a)}var p3=mi(yE(),1),MW=mi(Cm(),1),xW=mi(_W(),1),T2e=p3.default.default?p3.default.default:p3.default,v3=class extends T2e{getPublicKey(e){throw new Error("Unimplemented")}},I2e;function Mn(){return I2e??=new v3}var SW=mi(Uo(),1);lu();var S0=class{_key;pk;signatureType=1;ownerLength=Kr[1].pubLength;signatureLength=Kr[1].sigLength;_publicKey;get publicKey(){return this._publicKey}constructor(e,r){this._key=e,this.pk=r,r||(this.pk=Mn().getPublicKey(JSON.parse(e)))}sign(e){return aE("sha256").update(e).sign({key:this._key,padding:nE.RSA_PKCS1_PSS_PADDING})}static async verify(e,r,a){return await Mn().verify(Me.isBuffer(e)?SW.default.encode(e):e,r,a)}};var lV=mi(cV(),1),dV=mi(Uo(),1);var zc=class extends S0{jwk;constructor(e){super((0,lV.jwkTopem)(e),e.n),this.jwk=e}get publicKey(){if(!this.pk)throw new Error("ArweaveSigner - pk is undefined");return dV.default.toBuffer(this.pk)}sign(e){return Mn().sign(this.jwk,e)}static async verify(e,r,a){return await Mn().verify(e,r,a)}};ie();ae();ne();var pV=mi(Uo(),1);var A0=class{_publicKey;ownerLength=Kr[2].pubLength;signatureLength=Kr[2].sigLength;signatureType=2;pem;provider;constructor(e){if(this.provider=e,!this.provider.publicKey)throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");this._publicKey=this.provider.publicKey.toBuffer()}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");return await this.provider.signMessage(e)}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=pV.default.toBuffer(e)),Dc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var EV=mi(vV());ie();ae();ne();ie();ae();ne();ie();ae();ne();var mV="logger/5.7.0";var gV=!1,bV=!1,S3={debug:1,default:2,info:2,warning:3,error:4,off:5},yV=S3.default,dA=null;function ube(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var wV=ube(),pA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(pA||(pA={}));var mf;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(mf||(mf={}));var _V="0123456789abcdef",tr=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let a=e.toLowerCase();S3[a]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(yV>S3[a])&&console.log.apply(console,r)}debug(...e){this._log(t.levels.DEBUG,e)}info(...e){this._log(t.levels.INFO,e)}warn(...e){this._log(t.levels.WARNING,e)}makeError(e,r,a){if(bV)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),a||(a={});let i=[];Object.keys(a).forEach(b=>{let g=a[b];try{if(g instanceof Uint8Array){let y="";for(let M=0;M<g.length;M++)y+=_V[g[M]>>4],y+=_V[g[M]&15];i.push(b+"=Uint8Array(0x"+y+")")}else i.push(b+"="+JSON.stringify(g))}catch{i.push(b+"="+JSON.stringify(a[b].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let h=e,c="";switch(r){case mf.NUMERIC_FAULT:{c="NUMERIC_FAULT";let b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case mf.CALL_EXCEPTION:case mf.INSUFFICIENT_FUNDS:case mf.MISSING_NEW:case mf.NONCE_EXPIRED:case mf.REPLACEMENT_UNDERPRICED:case mf.TRANSACTION_REPLACED:case mf.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let p=new Error(e);return p.reason=h,p.code=r,Object.keys(a).forEach(function(b){p[b]=a[b]}),p}throwError(e,r,a){throw this.makeError(e,r,a)}throwArgumentError(e,r,a){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:a})}assert(e,r,a,i){e||this.throwError(r,a,i)}assertArgument(e,r,a,i){e||this.throwArgumentError(r,a,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),wV&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:wV})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,a){a?a=": "+a:a="",e<r&&this.throwError("missing argument"+a,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+a,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return dA||(dA=new t(mV)),dA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gV){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}bV=!!e,gV=!!r}static setLogLevel(e){let r=S3[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}yV=r}static from(e){return new t(e)}};tr.errors=mf;tr.levels=pA;ie();ae();ne();var MV="bytes/5.7.0";var xn=new tr(MV);function SV(t){return!!t.toHexString}function Fp(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return Fp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Fm(t){return Dn(t)&&!(t.length%2)||jm(t)}function xV(t){return typeof t=="number"&&t==t&&t%1===0}function jm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!xV(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!xV(r)||r<0||r>=256)return!1}return!0}function Ct(t,e){if(e||(e={}),typeof t=="number"){xn.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Fp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),SV(t)&&(t=t.toHexString()),Dn(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":xn.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let i=0;i<r.length;i+=2)a.push(parseInt(r.substring(i,i+2),16));return Fp(new Uint8Array(a))}return jm(t)?Fp(new Uint8Array(t)):xn.throwArgumentError("invalid arrayify value","value",t)}function Ro(t){let e=t.map(i=>Ct(i)),r=e.reduce((i,h)=>i+h.length,0),a=new Uint8Array(r);return e.reduce((i,h)=>(a.set(h,i),i+h.length),0),Fp(a)}function vu(t){let e=Ct(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function hbe(t,e){t=Ct(t),t.length>e&&xn.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),Fp(r)}function Dn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var vA="0123456789abcdef";function fr(t,e){if(e||(e={}),typeof t=="number"){xn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=vA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),SV(t))return t.toHexString();if(Dn(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":xn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(jm(t)){let r="0x";for(let a=0;a<t.length;a++){let i=t[a];r+=vA[(i&240)>>4]+vA[i&15]}return r}return xn.throwArgumentError("invalid hexlify value","value",t)}function zm(t){if(typeof t!="string")t=fr(t);else if(!Dn(t)||t.length%2)return null;return(t.length-2)/2}function _h(t,e,r){return typeof t!="string"?t=fr(t):(!Dn(t)||t.length%2)&&xn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Zc(t){let e="0x";return t.forEach(r=>{e+=fr(r).substring(2)}),e}function Ea(t,e){for(typeof t!="string"?t=fr(t):Dn(t)||xn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&xn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Hc(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Fm(t)){let r=Ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=fr(r.slice(0,32)),e.s=fr(r.slice(32,64))):r.length===65?(e.r=fr(r.slice(0,32)),e.s=fr(r.slice(32,64)),e.v=r[64]):xn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:xn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=fr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=hbe(Ct(e._vs),32);e._vs=fr(i);let h=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=h:e.recoveryParam!==h&&xn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=fr(i);e.s==null?e.s=c:e.s!==c&&xn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?xn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&xn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Dn(e.r)?xn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ea(e.r,32),e.s==null||!Dn(e.s)?xn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ea(e.s,32);let r=Ct(e.s);r[0]>=128&&xn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let a=fr(r);e._vs&&(Dn(e._vs)||xn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ea(e._vs,32)),e._vs==null?e._vs=a:e._vs!==a&&xn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function mA(t){return t=Hc(t),fr(Ro([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}function tn(t){return"0x"+EV.default.keccak_256(Ct(t))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var BV=mi(RV());ie();ae();ne();var TV="bignumber/5.7.0";var E3=BV.default.BN,Mh=new tr(TV),bA={},IV=9007199254740991;var kV=!1,rn=class t{constructor(e,r){e!==bA&&Mh.throwError("cannot call constructor directly; use BigNumber.from",tr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ro(Jr(this).fromTwos(e))}toTwos(e){return ro(Jr(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return ro(Jr(this).add(Jr(e)))}sub(e){return ro(Jr(this).sub(Jr(e)))}div(e){return t.from(e).isZero()&&ws("division-by-zero","div"),ro(Jr(this).div(Jr(e)))}mul(e){return ro(Jr(this).mul(Jr(e)))}mod(e){let r=Jr(e);return r.isNeg()&&ws("division-by-zero","mod"),ro(Jr(this).umod(r))}pow(e){let r=Jr(e);return r.isNeg()&&ws("negative-power","pow"),ro(Jr(this).pow(r))}and(e){let r=Jr(e);return(this.isNegative()||r.isNeg())&&ws("unbound-bitwise-result","and"),ro(Jr(this).and(r))}or(e){let r=Jr(e);return(this.isNegative()||r.isNeg())&&ws("unbound-bitwise-result","or"),ro(Jr(this).or(r))}xor(e){let r=Jr(e);return(this.isNegative()||r.isNeg())&&ws("unbound-bitwise-result","xor"),ro(Jr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&ws("negative-width","mask"),ro(Jr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ws("negative-width","shl"),ro(Jr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ws("negative-width","shr"),ro(Jr(this).shrn(e))}eq(e){return Jr(this).eq(Jr(e))}lt(e){return Jr(this).lt(Jr(e))}lte(e){return Jr(this).lte(Jr(e))}gt(e){return Jr(this).gt(Jr(e))}gte(e){return Jr(this).gte(Jr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Jr(this).isZero()}toNumber(){try{return Jr(this).toNumber()}catch{ws("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Mh.throwError("this platform does not support BigInt",tr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kV||(kV=!0,Mh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Mh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",tr.errors.UNEXPECTED_ARGUMENT,{}):Mh.throwError("BigNumber.toString does not accept parameters",tr.errors.UNEXPECTED_ARGUMENT,{})),Jr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(bA,Zm(e)):e.match(/^-?[0-9]+$/)?new t(bA,Zm(new E3(e))):Mh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&ws("underflow","BigNumber.from",e),(e>=IV||e<=-IV)&&ws("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(jm(r))return t.from(fr(r));if(r)if(r.toHexString){let a=r.toHexString();if(typeof a=="string")return t.from(a)}else{let a=r._hex;if(a==null&&r.type==="BigNumber"&&(a=r.hex),typeof a=="string"&&(Dn(a)||a[0]==="-"&&Dn(a.substring(1))))return t.from(a)}return Mh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function Zm(t){if(typeof t!="string")return Zm(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Mh.throwArgumentError("invalid hex","value",t),t=Zm(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function ro(t){return rn.from(Zm(t))}function Jr(t){let e=rn.from(t).toHexString();return e[0]==="-"?new E3("-"+e.substring(3),16):new E3(e.substring(2),16)}function ws(t,e,r){let a={fault:t,operation:e};return r!=null&&(a.value=r),Mh.throwError(t,tr.errors.NUMERIC_FAULT,a)}function yA(t){return new E3(t,36).toString(16)}ie();ae();ne();ie();ae();ne();var PV="strings/5.7.0";var OV=new tr(PV),mu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(mu||(mu={}));var R0;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(R0||(R0={}));function lbe(t,e,r,a,i){return OV.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function NV(t,e,r,a,i){if(t===R0.BAD_PREFIX||t===R0.UNEXPECTED_CONTINUE){let h=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)h++;return h}return t===R0.OVERRUN?r.length-e-1:0}function dbe(t,e,r,a,i){return t===R0.OVERLONG?(a.push(i),0):(a.push(65533),NV(t,e,r,a,i))}var pbe=Object.freeze({error:lbe,ignore:NV,replace:dbe});function Na(t,e=mu.current){e!=mu.current&&(OV.checkNormalize(),t=t.normalize(e));let r=[];for(let a=0;a<t.length;a++){let i=t.charCodeAt(a);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){a++;let h=t.charCodeAt(a);if(a>=t.length||(h&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(h&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ct(r)}function jp(t){return tn(Na(t))}ie();ae();ne();var CV="hash/5.7.0";ie();ae();ne();var LV=`Ethereum Signed Message:
|
|
129
|
+
`))}},{key:"_onEvent",value:function(a,i){function h(c){a==="error"&&!this.transports.includes(i)&&this.add(i),this.emit(a,c,i)}i["__winston"+a]||(i["__winston"+a]=h.bind(this),i.on(a,i["__winston"+a]))}},{key:"_addDefaultMeta",value:function(a){this.defaultMeta&&Object.assign(a,this.defaultMeta)}}]),e}(Eqe);function nP(t,e){var r=t[e];return!r&&r!==0?null:r}Object.defineProperty(Nfe.prototype,"transports",{configurable:!1,enumerable:!0,get:function(){var e=this._readableState.pipes;return Array.isArray(e)?e:[e].filter(Boolean)}});Cfe.exports=Nfe});var sP=ht((z2t,$fe)=>{"use strict";ie();ae();ne();function dv(t){"@babel/helpers - typeof";return dv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dv(t)}function Lfe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Cqe(a.key),a)}}function Nqe(t,e,r){return e&&Lfe(t.prototype,e),r&&Lfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Cqe(t){var e=Lqe(t,"string");return dv(e)=="symbol"?e:String(e)}function Lqe(t,e){if(dv(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(dv(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $qe(t,e,r){return e=Fw(e),qqe(t,Dfe()?Reflect.construct(e,r||[],Fw(t).constructor):e.apply(t,r))}function qqe(t,e){if(e&&(dv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uqe(t)}function Uqe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dfe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dfe=function(){return!!t})()}function Fw(t){return Fw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fw(t)}function Fqe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oP(t,e)}function oP(t,e){return oP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},oP(t,e)}var jqe=on(),zqe=jqe.LEVEL,Zqe=Bw(),Hqe=qw(),Kqe=pb()("winston:create-logger");function Wqe(t){return"is"+t.charAt(0).toUpperCase()+t.slice(1)+"Enabled"}$fe.exports=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.levels=t.levels||Zqe.npm.levels;var e=function(a){Fqe(i,a);function i(h){return Dqe(this,i),$qe(this,i,[h])}return Nqe(i)}(Hqe),r=new e(t);return Object.keys(t.levels).forEach(function(a){if(Kqe('Define prototype method for "%s"',a),a==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}e.prototype[a]=function(){for(var i=this||r,h=arguments.length,c=new Array(h),p=0;p<h;p++)c[p]=arguments[p];if(c.length===1){var b=c[0],g=b&&b.message&&b||{message:b};return g.level=g[zqe]=a,i._addDefaultMeta(g),i.write(g),this||r}return c.length===0?(i.log(a,""),i):i.log.apply(i,[a].concat(c))},e.prototype[Wqe(a)]=function(){return(this||r).isLevelEnabled(a)}}),r}});var Ffe=ht((W2t,Ufe)=>{"use strict";ie();ae();ne();function xb(t){"@babel/helpers - typeof";return xb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xb(t)}function Vqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qfe(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Yqe(a.key),a)}}function Gqe(t,e,r){return e&&qfe(t.prototype,e),r&&qfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yqe(t){var e=Jqe(t,"string");return xb(e)=="symbol"?e:String(e)}function Jqe(t,e){if(xb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(xb(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xqe=sP();Ufe.exports=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vqe(this,t),this.loggers=new Map,this.options=e}return Gqe(t,[{key:"add",value:function(r,a){var i=this;if(!this.loggers.has(r)){a=Object.assign({},a||this.options);var h=a.transports||this.options.transports;h?a.transports=Array.isArray(h)?h.slice():[h]:a.transports=[];var c=Xqe(a);c.on("close",function(){return i._delete(r)}),this.loggers.set(r,c)}return this.loggers.get(r)}},{key:"get",value:function(r,a){return this.add(r,a)}},{key:"has",value:function(r){return!!this.loggers.has(r)}},{key:"close",value:function(r){var a=this;if(r)return this._removeLogger(r);this.loggers.forEach(function(i,h){return a._removeLogger(h)})}},{key:"_removeLogger",value:function(r){if(this.loggers.has(r)){var a=this.loggers.get(r);a.close(),this._delete(r)}}},{key:"_delete",value:function(r){this.loggers.delete(r)}}]),t}()});var zfe=ht(zi=>{"use strict";ie();ae();ne();var jfe=Ok(),Qqe=Nk(),Sb=Qqe.warn;zi.version=hne().version;zi.transports=Fse();zi.config=Bw();zi.addColors=jfe.levels;zi.format=jfe.format;zi.createLogger=sP();zi.Logger=qw();zi.ExceptionHandler=XB();zi.RejectionHandler=tP();zi.Container=Ffe();zi.Transport=ev();zi.loggers=new zi.Container;var Hf=zi.createLogger();Object.keys(zi.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(t){return zi[t]=function(){return Hf[t].apply(Hf,arguments)}});Object.defineProperty(zi,"level",{get:function(){return Hf.level},set:function(e){Hf.level=e}});Object.defineProperty(zi,"exceptions",{get:function(){return Hf.exceptions}});Object.defineProperty(zi,"rejections",{get:function(){return Hf.rejections}});["exitOnError"].forEach(function(t){Object.defineProperty(zi,t,{get:function(){return Hf[t]},set:function(r){Hf[t]=r}})});Object.defineProperty(zi,"default",{get:function(){return{exceptionHandlers:Hf.exceptionHandlers,rejectionHandlers:Hf.rejectionHandlers,transports:Hf.transports}}});Sb.deprecated(zi,"setLevels");Sb.forFunctions(zi,"useFormat",["cli"]);Sb.forProperties(zi,"useFormat",["padLevels","stripColors"]);Sb.forFunctions(zi,"deprecated",["addRewriter","addFilter","clone","extend"]);Sb.forProperties(zi,"deprecated",["emitErrs","levelLength"])});var Xfe=ht((myt,cP)=>{"use strict";ie();ae();ne();var iUe=Object.prototype.hasOwnProperty,Za="~";function Ab(){}Object.create&&(Ab.prototype=Object.create(null),new Ab().__proto__||(Za=!1));function nUe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Jfe(t,e,r,a,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var h=new nUe(r,a||t,i),c=Za?Za+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],h]:t._events[c].push(h):(t._events[c]=h,t._eventsCount++),t}function Kw(t,e){--t._eventsCount===0?t._events=new Ab:delete t._events[e]}function Pa(){this._events=new Ab,this._eventsCount=0}Pa.prototype.eventNames=function(){var e=[],r,a;if(this._eventsCount===0)return e;for(a in r=this._events)iUe.call(r,a)&&e.push(Za?a.slice(1):a);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Pa.prototype.listeners=function(e){var r=Za?Za+e:e,a=this._events[r];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,h=a.length,c=new Array(h);i<h;i++)c[i]=a[i].fn;return c};Pa.prototype.listenerCount=function(e){var r=Za?Za+e:e,a=this._events[r];return a?a.fn?1:a.length:0};Pa.prototype.emit=function(e,r,a,i,h,c){var p=Za?Za+e:e;if(!this._events[p])return!1;var b=this._events[p],g=arguments.length,y,M;if(b.fn){switch(b.once&&this.removeListener(e,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,r),!0;case 3:return b.fn.call(b.context,r,a),!0;case 4:return b.fn.call(b.context,r,a,i),!0;case 5:return b.fn.call(b.context,r,a,i,h),!0;case 6:return b.fn.call(b.context,r,a,i,h,c),!0}for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];b.fn.apply(b.context,y)}else{var x=b.length,E;for(M=0;M<x;M++)switch(b[M].once&&this.removeListener(e,b[M].fn,void 0,!0),g){case 1:b[M].fn.call(b[M].context);break;case 2:b[M].fn.call(b[M].context,r);break;case 3:b[M].fn.call(b[M].context,r,a);break;case 4:b[M].fn.call(b[M].context,r,a,i);break;default:if(!y)for(E=1,y=new Array(g-1);E<g;E++)y[E-1]=arguments[E];b[M].fn.apply(b[M].context,y)}}return!0};Pa.prototype.on=function(e,r,a){return Jfe(this,e,r,a,!1)};Pa.prototype.once=function(e,r,a){return Jfe(this,e,r,a,!0)};Pa.prototype.removeListener=function(e,r,a,i){var h=Za?Za+e:e;if(!this._events[h])return this;if(!r)return Kw(this,h),this;var c=this._events[h];if(c.fn)c.fn===r&&(!i||c.once)&&(!a||c.context===a)&&Kw(this,h);else{for(var p=0,b=[],g=c.length;p<g;p++)(c[p].fn!==r||i&&!c[p].once||a&&c[p].context!==a)&&b.push(c[p]);b.length?this._events[h]=b.length===1?b[0]:b:Kw(this,h)}return this};Pa.prototype.removeAllListeners=function(e){var r;return e?(r=Za?Za+e:e,this._events[r]&&Kw(this,r)):(this._events=new Ab,this._eventsCount=0),this};Pa.prototype.off=Pa.prototype.removeListener;Pa.prototype.addListener=Pa.prototype.on;Pa.prefixed=Za;Pa.EventEmitter=Pa;typeof cP<"u"&&(cP.exports=Pa)});ie();ae();ne();ie();ae();ne();var uT={};Ka(uT,{AVSCTap:()=>Eg,AlgorandSigner:()=>mg,AptosSigner:()=>bg,ArconnectSigner:()=>ul,Arweave:()=>xW.default,ArweaveSigner:()=>zc,Bundle:()=>I8,BundleItem:()=>fT,CryptoDriver:()=>v3,Curve25519:()=>So,DataItem:()=>v1,EthereumSigner:()=>Bo,HexInjectedSolanaSigner:()=>J0,HexSolanaSigner:()=>gg,InjectedAptosSigner:()=>X0,InjectedEthereumSigner:()=>fR,InjectedSolanaSigner:()=>A0,InjectedTypedEthereumSigner:()=>nT,KyveSigner:()=>_g,MAX_TAG_BYTES:()=>A8,MIN_BINARY_SIZE:()=>R8,MultiSignatureAptosSigner:()=>Q0,NearSigner:()=>vg,PolygonSigner:()=>pg,Rsa4096:()=>S0,SIG_CONFIG:()=>Kr,SignatureConfig:()=>wr,Signer:()=>Qw,SolanaSigner:()=>Ih,Transaction:()=>MW.default,TypedEthereumSigner:()=>ed,bundleAndSignData:()=>Q4e,byteArrayToLong:()=>bn,concatBuffers:()=>Bi.concatBuffers,createData:()=>Rg,deepHash:()=>$c,deserializeTags:()=>p1,exportForTesting:()=>G4e,getCryptoDriver:()=>Mn,getSignatureAndId:()=>UX,indexToType:()=>Mg,keccak256:()=>tT,longTo16ByteArray:()=>J4e,longTo32ByteArray:()=>E8,longTo8ByteArray:()=>S8,longToNByteArray:()=>Sg,secp256k1:()=>Y0,serializeTags:()=>oT,shortTo2ByteArray:()=>aT,sign:()=>T8,stringToBuffer:()=>Bi.stringToBuffer,unbundleData:()=>X4e});ie();ae();ne();ie();ae();ne();ie();ae();ne();var Qw=class{publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,a,i){throw new Error("You must implement verify method on child")}};ie();ae();ne();ie();ae();ne();var LK=mi(Uo(),1);ie();ae();ne();var wr;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM",t[t.KYVE=101]="KYVE"})(wr||(wr={}));var Kr={[wr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[wr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[wr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[wr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[wr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[wr.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[wr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"},[wr.KYVE]:{sigLength:65,pubLength:65,sigName:"kyve"}};ie();ae();ne();lu();var Yn=BigInt(0),ai=BigInt(1),Cc=BigInt(2),Tge=BigInt(8),TK=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),Wi=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:TK,n:TK,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});var OK=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),Sm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),mje=BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),Ige=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),kge=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Bge=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Pge=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Cn=class t{constructor(e,r,a,i){this.x=e,this.y=r,this.z=a,this.t=i}static fromAffine(e){if(!(e instanceof _n))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(_n.ZERO)?t.ZERO:new t(e.x,e.y,ai,Et(e.x*e.y))}static toAffineBatch(e){let r=Cge(e.map(a=>a.z));return e.map((a,i)=>a.toAffine(r[i]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){kK(e);let{x:r,y:a,z:i}=this,{x:h,y:c,z:p}=e,b=Et(r*p),g=Et(h*i),y=Et(a*p),M=Et(c*i);return b===g&&y===M}negate(){return new t(Et(-this.x),this.y,this.z,Et(-this.t))}double(){let{x:e,y:r,z:a}=this,{a:i}=Wi,h=Et(e*e),c=Et(r*r),p=Et(Cc*Et(a*a)),b=Et(i*h),g=e+r,y=Et(Et(g*g)-h-c),M=b+c,x=M-p,E=b-c,A=Et(y*x),I=Et(M*E),P=Et(y*E),N=Et(x*M);return new t(A,I,N,P)}add(e){kK(e);let{x:r,y:a,z:i,t:h}=this,{x:c,y:p,z:b,t:g}=e,y=Et((a-r)*(p+c)),M=Et((a+r)*(p-c)),x=Et(M-y);if(x===Yn)return this.double();let E=Et(i*Cc*g),A=Et(h*Cc*b),I=A+E,P=M+y,N=A-E,L=Et(I*x),C=Et(P*N),Y=Et(I*N),G=Et(x*P);return new t(L,C,G,Y)}subtract(e){return this.add(e.negate())}precomputeWindow(e){let r=1+256/e,a=[],i=this,h=i;for(let c=0;c<r;c++){h=i,a.push(h);for(let p=1;p<2**(e-1);p++)h=h.add(i),a.push(h);i=h.double()}return a}wNAF(e,r){!r&&this.equals(t.BASE)&&(r=_n.BASE);let a=r&&r._WINDOW_SIZE||1;if(256%a)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=r&&cE.get(r);i||(i=this.precomputeWindow(a),r&&a!==1&&(i=t.normalizeZ(i),cE.set(r,i)));let h=t.ZERO,c=t.BASE,p=1+256/a,b=2**(a-1),g=BigInt(2**a-1),y=2**a,M=BigInt(a);for(let x=0;x<p;x++){let E=x*b,A=Number(e&g);e>>=M,A>b&&(A-=y,e+=ai);let I=E,P=E+Math.abs(A)-1,N=x%2!==0,L=A<0;A===0?c=c.add(IK(N,i[I])):h=h.add(IK(L,i[P]))}return t.normalizeZ([h,c])[0]}multiply(e,r){return this.wNAF(i3(e,Wi.l),r)}multiplyUnsafe(e){let r=i3(e,Wi.l,!1),a=t.BASE,i=t.ZERO;if(r===Yn)return i;if(this.equals(i)||r===ai)return this;if(this.equals(a))return this.wNAF(r);let h=i,c=this;for(;r>Yn;)r&ai&&(h=h.add(c)),c=c.double(),r>>=ai;return h}isSmallOrder(){return this.multiplyUnsafe(Wi.h).equals(t.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(Wi.l/Cc).double();return Wi.l%Cc&&(e=e.add(this)),e.equals(t.ZERO)}toAffine(e){let{x:r,y:a,z:i}=this,h=this.equals(t.ZERO);e==null&&(e=h?Tge:n3(i));let c=Et(r*e),p=Et(a*e),b=Et(i*e);if(h)return _n.ZERO;if(b!==ai)throw new Error("invZ was invalid");return new _n(c,p)}fromRistrettoBytes(){fE()}toRistrettoBytes(){fE()}fromRistrettoHash(){fE()}};Cn.BASE=new Cn(Wi.Gx,Wi.Gy,ai,Et(Wi.Gx*Wi.Gy));Cn.ZERO=new Cn(Yn,ai,ai,Yn);function IK(t,e){let r=e.negate();return t?r:e}function kK(t){if(!(t instanceof Cn))throw new TypeError("ExtendedPoint expected")}function sE(t){if(!(t instanceof M0))throw new TypeError("RistrettoPoint expected")}function fE(){throw new Error("Legacy method: switch to RistrettoPoint")}var M0=class t{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){let{d:r}=Wi,a=Et(Sm*e*e),i=Et((a+ai)*Bge),h=BigInt(-1),c=Et((h-r*a)*Et(a+r)),{isValid:p,value:b}=dE(i,c),g=Et(b*e);Nc(g)||(g=Et(-g)),p||(b=g),p||(h=a);let y=Et(h*(a-ai)*Pge-c),M=b*b,x=Et((b+b)*c),E=Et(y*Ige),A=Et(ai-M),I=Et(ai+M);return new Cn(Et(x*I),Et(A*E),Et(E*I),Et(x*A))}static hashToCurve(e){e=Lc(e,64);let r=uE(e.slice(0,32)),a=this.calcElligatorRistrettoMap(r),i=uE(e.slice(32,64)),h=this.calcElligatorRistrettoMap(i);return new t(a.add(h))}static fromHex(e){e=Lc(e,32);let{a:r,d:a}=Wi,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",h=uE(e);if(!Dge(Am(h),e)||Nc(h))throw new Error(i);let c=Et(h*h),p=Et(ai+r*c),b=Et(ai-r*c),g=Et(p*p),y=Et(b*b),M=Et(r*a*g-y),{isValid:x,value:E}=PK(Et(M*y)),A=Et(E*b),I=Et(E*A*M),P=Et((h+h)*A);Nc(P)&&(P=Et(-P));let N=Et(p*I),L=Et(P*N);if(!x||Nc(L)||N===Yn)throw new Error(i);return new t(new Cn(P,N,ai,L))}toRawBytes(){let{x:e,y:r,z:a,t:i}=this.ep,h=Et(Et(a+r)*Et(a-r)),c=Et(e*r),p=Et(c*c),{value:b}=PK(Et(h*p)),g=Et(b*h),y=Et(b*c),M=Et(g*y*i),x;if(Nc(i*M)){let A=Et(r*Sm),I=Et(e*Sm);e=A,r=I,x=Et(g*kge)}else x=y;Nc(e*M)&&(r=Et(-r));let E=Et((a-r)*x);return Nc(E)&&(E=Et(-E)),Am(E)}toHex(){return Rm(this.toRawBytes())}toString(){return this.toHex()}equals(e){sE(e);let r=this.ep,a=e.ep,i=Et(r.x*a.y)===Et(r.y*a.x),h=Et(r.y*a.y)===Et(r.x*a.x);return i||h}add(e){return sE(e),new t(this.ep.add(e.ep))}subtract(e){return sE(e),new t(this.ep.subtract(e.ep))}multiply(e){return new t(this.ep.multiply(e))}multiplyUnsafe(e){return new t(this.ep.multiplyUnsafe(e))}};M0.BASE=new M0(Cn.BASE);M0.ZERO=new M0(Cn.ZERO);var cE=new WeakMap,_n=class t{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,cE.delete(this)}static fromHex(e,r=!0){let{d:a,P:i}=Wi;e=Lc(e,32);let h=e.slice();h[31]=e[31]&-129;let c=Tm(h);if(r&&c>=i)throw new Error("Expected 0 < hex < P");if(!r&&c>=OK)throw new Error("Expected 0 < hex < 2**256");let p=Et(c*c),b=Et(p-ai),g=Et(a*p+ai),{isValid:y,value:M}=dE(b,g);if(!y)throw new Error("Point.fromHex: invalid y coordinate");let x=(M&ai)===ai;return(e[31]&128)!==0!==x&&(M=Et(-M)),new t(M,c)}static async fromPrivateKey(e){return(await pE(e)).point}toRawBytes(){let e=Am(this.y);return e[31]|=this.x&ai?128:0,e}toHex(){return Rm(this.toRawBytes())}toX25519(){let{y:e}=this,r=Et((ai+e)*n3(ai-e));return Am(r)}isTorsionFree(){return Cn.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new t(Et(-this.x),this.y)}add(e){return Cn.fromAffine(this).add(Cn.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Cn.fromAffine(this).multiply(e,this).toAffine()}};_n.BASE=new _n(Wi.Gx,Wi.Gy);_n.ZERO=new _n(Yn,ai);var Em=class t{constructor(e,r){this.r=e,this.s=r,this.assertValidity()}static fromHex(e){let r=Lc(e,64),a=_n.fromHex(r.slice(0,32),!1),i=Tm(r.slice(32,64));return new t(a,i)}assertValidity(){let{r:e,s:r}=this;if(!(e instanceof _n))throw new Error("Expected Point instance");return i3(r,Wi.l,!1),this}toRawBytes(){let e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(Am(this.s),32),e}toHex(){return Rm(this.toRawBytes())}};function BK(...t){if(!t.every(a=>a instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(t.length===1)return t[0];let e=t.reduce((a,i)=>a+i.length,0),r=new Uint8Array(e);for(let a=0,i=0;a<t.length;a++){let h=t[a];r.set(h,i),i+=h.length}return r}var Oge=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Rm(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Oge[t[r]];return e}function lE(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let a=r*2,i=t.slice(a,a+2),h=Number.parseInt(i,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");e[r]=h}return e}function NK(t){let r=t.toString(16).padStart(64,"0");return lE(r)}function Am(t){return NK(t).reverse()}function Nc(t){return(Et(t)&ai)===ai}function Tm(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Rm(Uint8Array.from(t).reverse()))}var Nge=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function uE(t){return Et(Tm(t)&Nge)}function Et(t,e=Wi.P){let r=t%e;return r>=Yn?r:e+r}function n3(t,e=Wi.P){if(t===Yn||e<=Yn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Et(t,e),a=e,i=Yn,h=ai,c=ai,p=Yn;for(;r!==Yn;){let g=a/r,y=a%r,M=i-c*g,x=h-p*g;a=r,r=y,i=c,h=p,c=M,p=x}if(a!==ai)throw new Error("invert: does not exist");return Et(i,e)}function Cge(t,e=Wi.P){let r=new Array(t.length),a=t.reduce((h,c,p)=>c===Yn?h:(r[p]=h,Et(h*c,e)),ai),i=n3(a,e);return t.reduceRight((h,c,p)=>c===Yn?h:(r[p]=Et(h*r[p],e),Et(h*c,e)),i),r}function du(t,e){let{P:r}=Wi,a=t;for(;e-- >Yn;)a*=a,a%=r;return a}function Lge(t){let{P:e}=Wi,r=BigInt(5),a=BigInt(10),i=BigInt(20),h=BigInt(40),c=BigInt(80),b=t*t%e*t%e,g=du(b,Cc)*b%e,y=du(g,ai)*t%e,M=du(y,r)*y%e,x=du(M,a)*M%e,E=du(x,i)*x%e,A=du(E,h)*E%e,I=du(A,c)*A%e,P=du(I,c)*A%e,N=du(P,a)*M%e;return{pow_p_5_8:du(N,Cc)*t%e,b2:b}}function dE(t,e){let r=Et(e*e*e),a=Et(r*r*e),i=Lge(t*a).pow_p_5_8,h=Et(t*r*i),c=Et(e*h*h),p=h,b=Et(h*Sm),g=c===t,y=c===Et(-t),M=c===Et(-t*Sm);return g&&(h=p),(y||M)&&(h=b),Nc(h)&&(h=Et(-h)),{isValid:g||y,value:h}}function PK(t){return dE(ai,t)}function r3(t){return Et(Tm(t),Wi.l)}function Dge(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Lc(t,e){let r=t instanceof Uint8Array?Uint8Array.from(t):lE(t);if(typeof e=="number"&&r.length!==e)throw new Error(`Expected ${e} bytes`);return r}function i3(t,e,r=!0){if(!e)throw new TypeError("Specify max value");if(typeof t=="number"&&Number.isSafeInteger(t)&&(t=BigInt(t)),typeof t=="bigint"&&t<e){if(r){if(Yn<t)return t}else if(Yn<=t)return t}throw new TypeError("Expected valid scalar: 0 < scalar < max")}function $ge(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function qge(t){if(t=typeof t=="bigint"||typeof t=="number"?NK(i3(t,OK)):Lc(t),t.length!==32)throw new Error("Expected 32 bytes");return t}function Uge(t){let e=$ge(t.slice(0,32)),r=t.slice(32,64),a=r3(e),i=_n.BASE.multiply(a),h=i.toRawBytes();return{head:e,prefix:r,scalar:a,point:i,pointBytes:h}}var hE;async function pE(t){return Uge(await kp.sha512(qge(t)))}async function CK(t,e){t=Lc(t);let{prefix:r,scalar:a,pointBytes:i}=await pE(e),h=r3(await kp.sha512(r,t)),c=_n.BASE.multiply(h),p=r3(await kp.sha512(c.toRawBytes(),i,t)),b=Et(h+p*a,Wi.l);return new Em(c,b).toRawBytes()}function Fge(t,e,r){e=Lc(e),r instanceof _n||(r=_n.fromHex(r,!1));let{r:a,s:i}=t instanceof Em?t.assertValidity():Em.fromHex(t),h=Cn.BASE.multiplyUnsafe(i);return{r:a,s:i,SB:h,pub:r,msg:e}}function jge(t,e,r,a){let i=r3(a),h=Cn.fromAffine(t).multiplyUnsafe(i);return Cn.fromAffine(e).add(h).subtract(r).multiplyUnsafe(Wi.h).equals(Cn.ZERO)}async function Dc(t,e,r){let{r:a,SB:i,msg:h,pub:c}=Fge(t,e,r),p=await kp.sha512(a.toRawBytes(),c.toRawBytes(),h);return jge(c,a,i,p)}_n.BASE._setWindowSize(8);var Oc={node:xm,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},kp={bytesToHex:Rm,hexToBytes:lE,concatBytes:BK,getExtendedPublicKey:pE,mod:Et,invert:n3,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if(t=Lc(t),t.length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Et(Tm(t),Wi.l-ai)+ai},randomBytes:(t=32)=>{if(Oc.web)return Oc.web.getRandomValues(new Uint8Array(t));if(Oc.node){let{randomBytes:e}=Oc.node;return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>kp.randomBytes(32),sha512:async(...t)=>{let e=BK(...t);if(Oc.web){let r=await Oc.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(r)}else{if(Oc.node)return Uint8Array.from(Oc.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(t=8,e=_n.BASE){let r=e.equals(_n.BASE)?e:new _n(e.x,e.y);return r._setWindowSize(t),r.multiply(Cc),r},sha512Sync:void 0};Object.defineProperties(kp,{sha512Sync:{configurable:!1,get(){return hE},set(t){hE||(hE=t)}}});var So=class{_key;pk;ownerLength=Kr[2].pubLength;signatureLength=Kr[2].sigLength;_publicKey;get publicKey(){return this._publicKey}signatureType=2;constructor(e,r){this._key=e,this.pk=r}get key(){throw new Error("You must implement `key`")}sign(e){return CK(Me.from(e),Me.from(this.key))}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=LK.default.toBuffer(e)),Dc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Bi=mi(pf(),1);ie();ae();ne();lu();async function $c(t){if(typeof t[Symbol.asyncIterator]=="function"){let i=t,h=df("sha384"),c=0;for await(let g of i)c+=g.byteLength,h.update(g);let p=(0,Bi.concatBuffers)([(0,Bi.stringToBuffer)("blob"),(0,Bi.stringToBuffer)(c.toString())]),b=(0,Bi.concatBuffers)([await Mn().hash(p,"SHA-384"),h.digest()]);return await Mn().hash(b,"SHA-384")}else if(Array.isArray(t)){let i=(0,Bi.concatBuffers)([(0,Bi.stringToBuffer)("list"),(0,Bi.stringToBuffer)(t.length.toString())]);return await WK(t,await Mn().hash(i,"SHA-384"))}let e=t,r=(0,Bi.concatBuffers)([(0,Bi.stringToBuffer)("blob"),(0,Bi.stringToBuffer)(e.byteLength.toString())]),a=(0,Bi.concatBuffers)([await Mn().hash(r,"SHA-384"),await Mn().hash(e,"SHA-384")]);return await Mn().hash(a,"SHA-384")}async function WK(t,e){if(t.length<1)return e;let r=(0,Bi.concatBuffers)([e,await $c(t[0])]),a=await Mn().hash(r,"SHA-384");return await WK(t.slice(1),a)}var p3=mi(yE(),1),MW=mi(Cm(),1),xW=mi(_W(),1),T2e=p3.default.default?p3.default.default:p3.default,v3=class extends T2e{getPublicKey(e){throw new Error("Unimplemented")}},I2e;function Mn(){return I2e??=new v3}var SW=mi(Uo(),1);lu();var S0=class{_key;pk;signatureType=1;ownerLength=Kr[1].pubLength;signatureLength=Kr[1].sigLength;_publicKey;get publicKey(){return this._publicKey}constructor(e,r){this._key=e,this.pk=r,r||(this.pk=Mn().getPublicKey(JSON.parse(e)))}sign(e){return aE("sha256").update(e).sign({key:this._key,padding:nE.RSA_PKCS1_PSS_PADDING})}static async verify(e,r,a){return await Mn().verify(Me.isBuffer(e)?SW.default.encode(e):e,r,a)}};var lV=mi(cV(),1),dV=mi(Uo(),1);var zc=class extends S0{jwk;constructor(e){super((0,lV.jwkTopem)(e),e.n),this.jwk=e}get publicKey(){if(!this.pk)throw new Error("ArweaveSigner - pk is undefined");return dV.default.toBuffer(this.pk)}sign(e){return Mn().sign(this.jwk,e)}static async verify(e,r,a){return await Mn().verify(e,r,a)}};ie();ae();ne();var pV=mi(Uo(),1);var A0=class{_publicKey;ownerLength=Kr[2].pubLength;signatureLength=Kr[2].sigLength;signatureType=2;pem;provider;constructor(e){if(this.provider=e,!this.provider.publicKey)throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");this._publicKey=this.provider.publicKey.toBuffer()}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");return await this.provider.signMessage(e)}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=pV.default.toBuffer(e)),Dc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var EV=mi(vV());ie();ae();ne();ie();ae();ne();ie();ae();ne();var mV="logger/5.7.0";var gV=!1,bV=!1,S3={debug:1,default:2,info:2,warning:3,error:4,off:5},yV=S3.default,dA=null;function ube(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var wV=ube(),pA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(pA||(pA={}));var mf;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(mf||(mf={}));var _V="0123456789abcdef",tr=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let a=e.toLowerCase();S3[a]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(yV>S3[a])&&console.log.apply(console,r)}debug(...e){this._log(t.levels.DEBUG,e)}info(...e){this._log(t.levels.INFO,e)}warn(...e){this._log(t.levels.WARNING,e)}makeError(e,r,a){if(bV)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),a||(a={});let i=[];Object.keys(a).forEach(b=>{let g=a[b];try{if(g instanceof Uint8Array){let y="";for(let M=0;M<g.length;M++)y+=_V[g[M]>>4],y+=_V[g[M]&15];i.push(b+"=Uint8Array(0x"+y+")")}else i.push(b+"="+JSON.stringify(g))}catch{i.push(b+"="+JSON.stringify(a[b].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let h=e,c="";switch(r){case mf.NUMERIC_FAULT:{c="NUMERIC_FAULT";let b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case mf.CALL_EXCEPTION:case mf.INSUFFICIENT_FUNDS:case mf.MISSING_NEW:case mf.NONCE_EXPIRED:case mf.REPLACEMENT_UNDERPRICED:case mf.TRANSACTION_REPLACED:case mf.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let p=new Error(e);return p.reason=h,p.code=r,Object.keys(a).forEach(function(b){p[b]=a[b]}),p}throwError(e,r,a){throw this.makeError(e,r,a)}throwArgumentError(e,r,a){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:a})}assert(e,r,a,i){e||this.throwError(r,a,i)}assertArgument(e,r,a,i){e||this.throwArgumentError(r,a,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),wV&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:wV})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,a){a?a=": "+a:a="",e<r&&this.throwError("missing argument"+a,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+a,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return dA||(dA=new t(mV)),dA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gV){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}bV=!!e,gV=!!r}static setLogLevel(e){let r=S3[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}yV=r}static from(e){return new t(e)}};tr.errors=mf;tr.levels=pA;ie();ae();ne();var MV="bytes/5.7.0";var xn=new tr(MV);function SV(t){return!!t.toHexString}function Fp(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return Fp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Fm(t){return Dn(t)&&!(t.length%2)||jm(t)}function xV(t){return typeof t=="number"&&t==t&&t%1===0}function jm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!xV(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!xV(r)||r<0||r>=256)return!1}return!0}function Ct(t,e){if(e||(e={}),typeof t=="number"){xn.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Fp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),SV(t)&&(t=t.toHexString()),Dn(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":xn.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let i=0;i<r.length;i+=2)a.push(parseInt(r.substring(i,i+2),16));return Fp(new Uint8Array(a))}return jm(t)?Fp(new Uint8Array(t)):xn.throwArgumentError("invalid arrayify value","value",t)}function Ro(t){let e=t.map(i=>Ct(i)),r=e.reduce((i,h)=>i+h.length,0),a=new Uint8Array(r);return e.reduce((i,h)=>(a.set(h,i),i+h.length),0),Fp(a)}function vu(t){let e=Ct(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function hbe(t,e){t=Ct(t),t.length>e&&xn.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),Fp(r)}function Dn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var vA="0123456789abcdef";function fr(t,e){if(e||(e={}),typeof t=="number"){xn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=vA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),SV(t))return t.toHexString();if(Dn(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":xn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(jm(t)){let r="0x";for(let a=0;a<t.length;a++){let i=t[a];r+=vA[(i&240)>>4]+vA[i&15]}return r}return xn.throwArgumentError("invalid hexlify value","value",t)}function zm(t){if(typeof t!="string")t=fr(t);else if(!Dn(t)||t.length%2)return null;return(t.length-2)/2}function _h(t,e,r){return typeof t!="string"?t=fr(t):(!Dn(t)||t.length%2)&&xn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Zc(t){let e="0x";return t.forEach(r=>{e+=fr(r).substring(2)}),e}function Ea(t,e){for(typeof t!="string"?t=fr(t):Dn(t)||xn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&xn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Hc(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Fm(t)){let r=Ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=fr(r.slice(0,32)),e.s=fr(r.slice(32,64))):r.length===65?(e.r=fr(r.slice(0,32)),e.s=fr(r.slice(32,64)),e.v=r[64]):xn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:xn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=fr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=hbe(Ct(e._vs),32);e._vs=fr(i);let h=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=h:e.recoveryParam!==h&&xn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=fr(i);e.s==null?e.s=c:e.s!==c&&xn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?xn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&xn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Dn(e.r)?xn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ea(e.r,32),e.s==null||!Dn(e.s)?xn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ea(e.s,32);let r=Ct(e.s);r[0]>=128&&xn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let a=fr(r);e._vs&&(Dn(e._vs)||xn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ea(e._vs,32)),e._vs==null?e._vs=a:e._vs!==a&&xn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function mA(t){return t=Hc(t),fr(Ro([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}function tn(t){return"0x"+EV.default.keccak_256(Ct(t))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var BV=mi(RV());ie();ae();ne();var TV="bignumber/5.7.0";var E3=BV.default.BN,Mh=new tr(TV),bA={},IV=9007199254740991;var kV=!1,rn=class t{constructor(e,r){e!==bA&&Mh.throwError("cannot call constructor directly; use BigNumber.from",tr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ro(Jr(this).fromTwos(e))}toTwos(e){return ro(Jr(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return ro(Jr(this).add(Jr(e)))}sub(e){return ro(Jr(this).sub(Jr(e)))}div(e){return t.from(e).isZero()&&ws("division-by-zero","div"),ro(Jr(this).div(Jr(e)))}mul(e){return ro(Jr(this).mul(Jr(e)))}mod(e){let r=Jr(e);return r.isNeg()&&ws("division-by-zero","mod"),ro(Jr(this).umod(r))}pow(e){let r=Jr(e);return r.isNeg()&&ws("negative-power","pow"),ro(Jr(this).pow(r))}and(e){let r=Jr(e);return(this.isNegative()||r.isNeg())&&ws("unbound-bitwise-result","and"),ro(Jr(this).and(r))}or(e){let r=Jr(e);return(this.isNegative()||r.isNeg())&&ws("unbound-bitwise-result","or"),ro(Jr(this).or(r))}xor(e){let r=Jr(e);return(this.isNegative()||r.isNeg())&&ws("unbound-bitwise-result","xor"),ro(Jr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&ws("negative-width","mask"),ro(Jr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ws("negative-width","shl"),ro(Jr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ws("negative-width","shr"),ro(Jr(this).shrn(e))}eq(e){return Jr(this).eq(Jr(e))}lt(e){return Jr(this).lt(Jr(e))}lte(e){return Jr(this).lte(Jr(e))}gt(e){return Jr(this).gt(Jr(e))}gte(e){return Jr(this).gte(Jr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Jr(this).isZero()}toNumber(){try{return Jr(this).toNumber()}catch{ws("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Mh.throwError("this platform does not support BigInt",tr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kV||(kV=!0,Mh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Mh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",tr.errors.UNEXPECTED_ARGUMENT,{}):Mh.throwError("BigNumber.toString does not accept parameters",tr.errors.UNEXPECTED_ARGUMENT,{})),Jr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(bA,Zm(e)):e.match(/^-?[0-9]+$/)?new t(bA,Zm(new E3(e))):Mh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&ws("underflow","BigNumber.from",e),(e>=IV||e<=-IV)&&ws("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(jm(r))return t.from(fr(r));if(r)if(r.toHexString){let a=r.toHexString();if(typeof a=="string")return t.from(a)}else{let a=r._hex;if(a==null&&r.type==="BigNumber"&&(a=r.hex),typeof a=="string"&&(Dn(a)||a[0]==="-"&&Dn(a.substring(1))))return t.from(a)}return Mh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function Zm(t){if(typeof t!="string")return Zm(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Mh.throwArgumentError("invalid hex","value",t),t=Zm(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function ro(t){return rn.from(Zm(t))}function Jr(t){let e=rn.from(t).toHexString();return e[0]==="-"?new E3("-"+e.substring(3),16):new E3(e.substring(2),16)}function ws(t,e,r){let a={fault:t,operation:e};return r!=null&&(a.value=r),Mh.throwError(t,tr.errors.NUMERIC_FAULT,a)}function yA(t){return new E3(t,36).toString(16)}ie();ae();ne();ie();ae();ne();var PV="strings/5.7.0";var OV=new tr(PV),mu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(mu||(mu={}));var R0;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(R0||(R0={}));function lbe(t,e,r,a,i){return OV.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function NV(t,e,r,a,i){if(t===R0.BAD_PREFIX||t===R0.UNEXPECTED_CONTINUE){let h=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)h++;return h}return t===R0.OVERRUN?r.length-e-1:0}function dbe(t,e,r,a,i){return t===R0.OVERLONG?(a.push(i),0):(a.push(65533),NV(t,e,r,a,i))}var pbe=Object.freeze({error:lbe,ignore:NV,replace:dbe});function Na(t,e=mu.current){e!=mu.current&&(OV.checkNormalize(),t=t.normalize(e));let r=[];for(let a=0;a<t.length;a++){let i=t.charCodeAt(a);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){a++;let h=t.charCodeAt(a);if(a>=t.length||(h&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(h&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ct(r)}function jp(t){return tn(Na(t))}ie();ae();ne();var CV="hash/5.7.0";ie();ae();ne();var LV=`Ethereum Signed Message:
|
|
130
130
|
`;function Kc(t){return typeof t=="string"&&(t=Na(t)),tn(Ro([Na(LV),Na(String(t.length)),t]))}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var DV="rlp/5.7.0";var vbe=new tr(DV);function $V(t){let e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function qV(t){if(Array.isArray(t)){let a=[];if(t.forEach(function(h){a=a.concat(qV(h))}),a.length<=55)return a.unshift(192+a.length),a;let i=$V(a.length);return i.unshift(247+i.length),i.concat(a)}Fm(t)||vbe.throwArgumentError("RLP object must be BytesLike","object",t);let e=Array.prototype.slice.call(Ct(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let r=$V(e.length);return r.unshift(183+r.length),r.concat(e)}function Hm(t){return fr(qV(t))}ie();ae();ne();var UV="address/5.7.0";var Km=new tr(UV);function FV(t){Dn(t,20)||Km.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let a=Ct(tn(r));for(let i=0;i<40;i+=2)a[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(a[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}var gbe=9007199254740991;function bbe(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}var wA={};for(let t=0;t<10;t++)wA[String(t)]=String(t);for(let t=0;t<26;t++)wA[String.fromCharCode(65+t)]=String(10+t);var jV=Math.floor(bbe(gbe));function ybe(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(a=>wA[a]).join("");for(;e.length>=jV;){let a=e.substring(0,jV);e=parseInt(a,10)%97+e.substring(a.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Aa(t){let e=null;if(typeof t!="string"&&Km.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=FV(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Km.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ybe(t)&&Km.throwArgumentError("bad icap checksum","address",t),e=yA(t.substring(4));e.length<40;)e="0"+e;e=FV("0x"+e)}else Km.throwArgumentError("invalid address","address",t);return e}ie();ae();ne();ie();ae();ne();var zV="properties/5.7.0";var wbe=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},A3=new tr(zV);function hr(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function xh(t){return wbe(this,void 0,void 0,function*(){let e=Object.keys(t).map(a=>{let i=t[a];return Promise.resolve(i).then(h=>({key:a,value:h}))});return(yield Promise.all(e)).reduce((a,i)=>(a[i.key]=i.value,a),{})})}function ZV(t,e){(!t||typeof t!="object")&&A3.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||A3.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Vm(t){let e={};for(let r in t)e[r]=t[r];return e}var _be={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function HV(t){if(t==null||_be[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;let e=Object.keys(t);for(let r=0;r<e.length;r++){let a=null;try{a=t[e[r]]}catch{continue}if(!HV(a))return!1}return!0}return A3.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Mbe(t){if(HV(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>Wm(e)));if(typeof t=="object"){let e={};for(let r in t){let a=t[r];a!==void 0&&hr(e,r,Wm(a))}return e}return A3.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Wm(t){return Mbe(t)}var T0=class{constructor(e){for(let r in e)this[r]=Wm(e[r])}};var xbe=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},nn=new tr(CV),GV=new Uint8Array(32);GV.fill(0);var Sbe=rn.from(-1),YV=rn.from(0),JV=rn.from(1),Ebe=rn.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Abe(t){let e=Ct(t),r=e.length%32;return r?Zc([e,GV.slice(r)]):fr(e)}var Rbe=Ea(JV.toHexString(),32),Tbe=Ea(YV.toHexString(),32),KV={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},_A=["name","version","chainId","verifyingContract","salt"];function WV(t){return function(e){return typeof e!="string"&&nn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}var Ibe={name:WV("name"),version:WV("version"),chainId:function(t){try{return rn.from(t).toString()}catch{}return nn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Aa(t).toLowerCase()}catch{}return nn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{let e=Ct(t);if(e.length!==32)throw new Error("bad length");return fr(e)}catch{}return nn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function MA(t){{let e=t.match(/^(u?)int(\d*)$/);if(e){let r=e[1]==="",a=parseInt(e[2]||"256");(a%8!==0||a>256||e[2]&&e[2]!==String(a))&&nn.throwArgumentError("invalid numeric width","type",t);let i=Ebe.mask(r?a-1:a),h=r?i.add(JV).mul(Sbe):YV;return function(c){let p=rn.from(c);return(p.lt(h)||p.gt(i))&&nn.throwArgumentError(`value out-of-bounds for ${t}`,"value",c),Ea(p.toTwos(256).toHexString(),32)}}}{let e=t.match(/^bytes(\d+)$/);if(e){let r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&nn.throwArgumentError("invalid bytes width","type",t),function(a){return Ct(a).length!==r&&nn.throwArgumentError(`invalid length for ${t}`,"value",a),Abe(a)}}}switch(t){case"address":return function(e){return Ea(Aa(e),32)};case"bool":return function(e){return e?Rbe:Tbe};case"bytes":return function(e){return tn(e)};case"string":return function(e){return jp(e)}}return null}function VV(t,e){return`${t}(${e.map(({name:r,type:a})=>a+" "+r).join(",")})`}var I0=class t{constructor(e){hr(this,"types",Object.freeze(Wm(e))),hr(this,"_encoderCache",{}),hr(this,"_types",{});let r={},a={},i={};Object.keys(e).forEach(p=>{r[p]={},a[p]=[],i[p]={}});for(let p in e){let b={};e[p].forEach(g=>{b[g.name]&&nn.throwArgumentError(`duplicate variable name ${JSON.stringify(g.name)} in ${JSON.stringify(p)}`,"types",e),b[g.name]=!0;let y=g.type.match(/^([^\x5b]*)(\x5b|$)/)[1];y===p&&nn.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",e),!MA(y)&&(a[y]||nn.throwArgumentError(`unknown type ${JSON.stringify(y)}`,"types",e),a[y].push(p),r[p][y]=!0)})}let h=Object.keys(a).filter(p=>a[p].length===0);h.length===0?nn.throwArgumentError("missing primary type","types",e):h.length>1&&nn.throwArgumentError(`ambiguous primary types or unused types: ${h.map(p=>JSON.stringify(p)).join(", ")}`,"types",e),hr(this,"primaryType",h[0]);function c(p,b){b[p]&&nn.throwArgumentError(`circular type reference to ${JSON.stringify(p)}`,"types",e),b[p]=!0,Object.keys(r[p]).forEach(g=>{a[g]&&(c(g,b),Object.keys(b).forEach(y=>{i[y][g]=!0}))}),delete b[p]}c(this.primaryType,{});for(let p in i){let b=Object.keys(i[p]);b.sort(),this._types[p]=VV(p,e[p])+b.map(g=>VV(g,e[g])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{let i=MA(e);if(i)return i}let r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let i=r[1],h=this.getEncoder(i),c=parseInt(r[3]);return p=>{c>=0&&p.length!==c&&nn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",p);let b=p.map(h);return this._types[i]&&(b=b.map(tn)),tn(Zc(b))}}let a=this.types[e];if(a){let i=jp(this._types[e]);return h=>{let c=a.map(({name:p,type:b})=>{let g=this.getEncoder(b)(h[p]);return this._types[b]?tn(g):g});return c.unshift(i),Zc(c)}}return nn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let r=this._types[e];return r||nn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return tn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,a){if(MA(e))return a(e,r);let i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let c=i[1],p=parseInt(i[3]);return p>=0&&r.length!==p&&nn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(b=>this._visit(c,b,a))}let h=this.types[e];return h?h.reduce((c,{name:p,type:b})=>(c[p]=this._visit(b,r[p],a),c),{}):nn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new t(e)}static getPrimaryType(e){return t.from(e).primaryType}static hashStruct(e,r,a){return t.from(r).hashStruct(e,a)}static hashDomain(e){let r=[];for(let a in e){let i=KV[a];i||nn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(a)}`,"domain",e),r.push({name:a,type:i})}return r.sort((a,i)=>_A.indexOf(a.name)-_A.indexOf(i.name)),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,a){return Zc(["0x1901",t.hashDomain(e),t.from(r).hash(a)])}static hash(e,r,a){return tn(t.encode(e,r,a))}static resolveNames(e,r,a,i){return xbe(this,void 0,void 0,function*(){e=Vm(e);let h={};e.verifyingContract&&!Dn(e.verifyingContract,20)&&(h[e.verifyingContract]="0x");let c=t.from(r);c.visit(a,(p,b)=>(p==="address"&&!Dn(b,20)&&(h[b]="0x"),b));for(let p in h)h[p]=yield i(p);return e.verifyingContract&&h[e.verifyingContract]&&(e.verifyingContract=h[e.verifyingContract]),a=c.visit(a,(p,b)=>p==="address"&&h[b]?h[b]:b),{domain:e,value:a}})}static getPayload(e,r,a){t.hashDomain(e);let i={},h=[];_A.forEach(b=>{let g=e[b];g!=null&&(i[b]=Ibe[b](g),h.push({name:b,type:KV[b]}))});let c=t.from(r),p=Vm(r);return p.EIP712Domain?nn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):p.EIP712Domain=h,c.encode(a),{types:p,domain:i,primaryType:c.primaryType,message:c.visit(a,(b,g)=>{if(b.match(/^bytes(\d*)/))return fr(Ct(g));if(b.match(/^u?int/))return rn.from(g).toString();switch(b){case"address":return g.toLowerCase();case"bool":return!!g;case"string":return typeof g!="string"&&nn.throwArgumentError("invalid string","value",g),g}return nn.throwArgumentError("unsupported type","type",b)})}}};ie();ae();ne();ie();ae();ne();var kr=mi(QV()),xu=mi(Gp());function Yp(t,e,r){return r={path:e,exports:{},require:function(a,i){return Xye(a,i??r.path)}},t(r,r.exports),r.exports}function Xye(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var CA=NG;function NG(t,e){if(!t)throw new Error(e||"Assertion failed")}NG.equal=function(e,r,a){if(e!=r)throw new Error(a||"Assertion failed: "+e+" != "+r)};var wf=Yp(function(t,e){"use strict";var r=e;function a(c,p){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var g=0;g<c.length;g++)b[g]=c[g]|0;return b}if(p==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var g=0;g<c.length;g+=2)b.push(parseInt(c[g]+c[g+1],16))}else for(var g=0;g<c.length;g++){var y=c.charCodeAt(g),M=y>>8,x=y&255;M?b.push(M,x):b.push(x)}return b}r.toArray=a;function i(c){return c.length===1?"0"+c:c}r.zero2=i;function h(c){for(var p="",b=0;b<c.length;b++)p+=i(c[b].toString(16));return p}r.toHex=h,r.encode=function(p,b){return b==="hex"?h(p):p}}),To=Yp(function(t,e){"use strict";var r=e;r.assert=CA,r.toArray=wf.toArray,r.zero2=wf.zero2,r.toHex=wf.toHex,r.encode=wf.encode;function a(b,g,y){var M=new Array(Math.max(b.bitLength(),y)+1);M.fill(0);for(var x=1<<g+1,E=b.clone(),A=0;A<M.length;A++){var I,P=E.andln(x-1);E.isOdd()?(P>(x>>1)-1?I=(x>>1)-P:I=P,E.isubn(I)):I=0,M[A]=I,E.iushrn(1)}return M}r.getNAF=a;function i(b,g){var y=[[],[]];b=b.clone(),g=g.clone();for(var M=0,x=0,E;b.cmpn(-M)>0||g.cmpn(-x)>0;){var A=b.andln(3)+M&3,I=g.andln(3)+x&3;A===3&&(A=-1),I===3&&(I=-1);var P;A&1?(E=b.andln(7)+M&7,(E===3||E===5)&&I===2?P=-A:P=A):P=0,y[0].push(P);var N;I&1?(E=g.andln(7)+x&7,(E===3||E===5)&&A===2?N=-I:N=I):N=0,y[1].push(N),2*M===P+1&&(M=1-M),2*x===N+1&&(x=1-x),b.iushrn(1),g.iushrn(1)}return y}r.getJSF=i;function h(b,g,y){var M="_"+g;b.prototype[g]=function(){return this[M]!==void 0?this[M]:this[M]=y.call(this)}}r.cachedProperty=h;function c(b){return typeof b=="string"?r.toArray(b,"hex"):b}r.parseBytes=c;function p(b){return new kr.default(b,"hex","le")}r.intFromLE=p}),B3=To.getNAF,Qye=To.getJSF,P3=To.assert;function Gc(t,e){this.type=t,this.p=new kr.default(e.p,16),this.red=e.prime?kr.default.red(e.prime):kr.default.mont(this.p),this.zero=new kr.default(0).toRed(this.red),this.one=new kr.default(1).toRed(this.red),this.two=new kr.default(2).toRed(this.red),this.n=e.n&&new kr.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var B0=Gc;Gc.prototype.point=function(){throw new Error("Not implemented")};Gc.prototype.validate=function(){throw new Error("Not implemented")};Gc.prototype._fixedNafMul=function(e,r){P3(e.precomputed);var a=e._getDoubles(),i=B3(r,1,this._bitLength),h=(1<<a.step+1)-(a.step%2===0?2:1);h/=3;var c=[],p,b;for(p=0;p<i.length;p+=a.step){b=0;for(var g=p+a.step-1;g>=p;g--)b=(b<<1)+i[g];c.push(b)}for(var y=this.jpoint(null,null,null),M=this.jpoint(null,null,null),x=h;x>0;x--){for(p=0;p<c.length;p++)b=c[p],b===x?M=M.mixedAdd(a.points[p]):b===-x&&(M=M.mixedAdd(a.points[p].neg()));y=y.add(M)}return y.toP()};Gc.prototype._wnafMul=function(e,r){var a=4,i=e._getNAFPoints(a);a=i.wnd;for(var h=i.points,c=B3(r,a,this._bitLength),p=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var g=0;b>=0&&c[b]===0;b--)g++;if(b>=0&&g++,p=p.dblp(g),b<0)break;var y=c[b];P3(y!==0),e.type==="affine"?y>0?p=p.mixedAdd(h[y-1>>1]):p=p.mixedAdd(h[-y-1>>1].neg()):y>0?p=p.add(h[y-1>>1]):p=p.add(h[-y-1>>1].neg())}return e.type==="affine"?p.toP():p};Gc.prototype._wnafMulAdd=function(e,r,a,i,h){var c=this._wnafT1,p=this._wnafT2,b=this._wnafT3,g=0,y,M,x;for(y=0;y<i;y++){x=r[y];var E=x._getNAFPoints(e);c[y]=E.wnd,p[y]=E.points}for(y=i-1;y>=1;y-=2){var A=y-1,I=y;if(c[A]!==1||c[I]!==1){b[A]=B3(a[A],c[A],this._bitLength),b[I]=B3(a[I],c[I],this._bitLength),g=Math.max(b[A].length,g),g=Math.max(b[I].length,g);continue}var P=[r[A],null,null,r[I]];r[A].y.cmp(r[I].y)===0?(P[1]=r[A].add(r[I]),P[2]=r[A].toJ().mixedAdd(r[I].neg())):r[A].y.cmp(r[I].y.redNeg())===0?(P[1]=r[A].toJ().mixedAdd(r[I]),P[2]=r[A].add(r[I].neg())):(P[1]=r[A].toJ().mixedAdd(r[I]),P[2]=r[A].toJ().mixedAdd(r[I].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],L=Qye(a[A],a[I]);for(g=Math.max(L[0].length,g),b[A]=new Array(g),b[I]=new Array(g),M=0;M<g;M++){var C=L[0][M]|0,Y=L[1][M]|0;b[A][M]=N[(C+1)*3+(Y+1)],b[I][M]=0,p[A]=P}}var G=this.jpoint(null,null,null),ee=this._wnafT4;for(y=g;y>=0;y--){for(var D=0;y>=0;){var U=!0;for(M=0;M<i;M++)ee[M]=b[M][y]|0,ee[M]!==0&&(U=!1);if(!U)break;D++,y--}if(y>=0&&D++,G=G.dblp(D),y<0)break;for(M=0;M<i;M++){var V=ee[M];V!==0&&(V>0?x=p[M][V-1>>1]:V<0&&(x=p[M][-V-1>>1].neg()),x.type==="affine"?G=G.mixedAdd(x):G=G.add(x))}}for(y=0;y<i;y++)p[y]=null;return h?G:G.toP()};function Ms(t,e){this.curve=t,this.type=e,this.precomputed=null}Gc.BasePoint=Ms;Ms.prototype.eq=function(){throw new Error("Not implemented")};Ms.prototype.validate=function(){return this.curve.validate(this)};Gc.prototype.decodePoint=function(e,r){e=To.toArray(e,r);var a=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*a){e[0]===6?P3(e[e.length-1]%2===0):e[0]===7&&P3(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+a),e.slice(1+a,1+2*a));return i}else if((e[0]===2||e[0]===3)&&e.length-1===a)return this.pointFromX(e.slice(1,1+a),e[0]===3);throw new Error("Unknown point format")};Ms.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Ms.prototype._encode=function(e){var r=this.curve.p.byteLength(),a=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(a):[4].concat(a,this.getY().toArray("be",r))};Ms.prototype.encode=function(e,r){return To.encode(this._encode(r),e)};Ms.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};Ms.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};Ms.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],i=this,h=0;h<r;h+=e){for(var c=0;c<e;c++)i=i.dbl();a.push(i)}return{step:e,points:a}};Ms.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],a=(1<<e)-1,i=a===1?null:this.dbl(),h=1;h<a;h++)r[h]=r[h-1].add(i);return{wnd:e,points:r}};Ms.prototype._getBeta=function(){return null};Ms.prototype.dblp=function(e){for(var r=this,a=0;a<e;a++)r=r.dbl();return r};var LA=Yp(function(t){typeof Object.create=="function"?t.exports=function(r,a){a&&(r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,a){if(a){r.super_=a;var i=function(){};i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r}}}),e6e=To.assert;function xs(t){B0.call(this,"short",t),this.a=new kr.default(t.a,16).toRed(this.red),this.b=new kr.default(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}LA(xs,B0);var t6e=xs;xs.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,a;if(e.beta)r=new kr.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)a=new kr.default(e.lambda,16);else{var h=this._getEndoRoots(this.n);this.g.mul(h[0]).x.cmp(this.g.x.redMul(r))===0?a=h[0]:(a=h[1],e6e(this.g.mul(a).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(p){return{a:new kr.default(p.a,16),b:new kr.default(p.b,16)}}):c=this._getEndoBasis(a),{beta:r,lambda:a,basis:c}}};xs.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:kr.default.mont(e),a=new kr.default(2).toRed(r).redInvm(),i=a.redNeg(),h=new kr.default(3).toRed(r).redNeg().redSqrt().redMul(a),c=i.redAdd(h).fromRed(),p=i.redSub(h).fromRed();return[c,p]};xs.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,i=this.n.clone(),h=new kr.default(1),c=new kr.default(0),p=new kr.default(0),b=new kr.default(1),g,y,M,x,E,A,I,P=0,N,L;a.cmpn(0)!==0;){var C=i.div(a);N=i.sub(C.mul(a)),L=p.sub(C.mul(h));var Y=b.sub(C.mul(c));if(!M&&N.cmp(r)<0)g=I.neg(),y=h,M=N.neg(),x=L;else if(M&&++P===2)break;I=N,i=a,a=N,p=h,h=L,b=c,c=Y}E=N.neg(),A=L;var G=M.sqr().add(x.sqr()),ee=E.sqr().add(A.sqr());return ee.cmp(G)>=0&&(E=g,A=y),M.negative&&(M=M.neg(),x=x.neg()),E.negative&&(E=E.neg(),A=A.neg()),[{a:M,b:x},{a:E,b:A}]};xs.prototype._endoSplit=function(e){var r=this.endo.basis,a=r[0],i=r[1],h=i.b.mul(e).divRound(this.n),c=a.b.neg().mul(e).divRound(this.n),p=h.mul(a.a),b=c.mul(i.a),g=h.mul(a.b),y=c.mul(i.b),M=e.sub(p).sub(b),x=g.add(y).neg();return{k1:M,k2:x}};xs.prototype.pointFromX=function(e,r){e=new kr.default(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=a.redSqrt();if(i.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var h=i.fromRed().isOdd();return(r&&!h||!r&&h)&&(i=i.redNeg()),this.point(e,i)};xs.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,a=e.y,i=this.a.redMul(r),h=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return a.redSqr().redISub(h).cmpn(0)===0};xs.prototype._endoWnafMulAdd=function(e,r,a){for(var i=this._endoWnafT1,h=this._endoWnafT2,c=0;c<e.length;c++){var p=this._endoSplit(r[c]),b=e[c],g=b._getBeta();p.k1.negative&&(p.k1.ineg(),b=b.neg(!0)),p.k2.negative&&(p.k2.ineg(),g=g.neg(!0)),i[c*2]=b,i[c*2+1]=g,h[c*2]=p.k1,h[c*2+1]=p.k2}for(var y=this._wnafMulAdd(1,i,h,c*2,a),M=0;M<c*2;M++)i[M]=null,h[M]=null;return y};function Xn(t,e,r,a){B0.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new kr.default(e,16),this.y=new kr.default(r,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}LA(Xn,B0.BasePoint);xs.prototype.point=function(e,r,a){return new Xn(this,e,r,a)};xs.prototype.pointFromJSON=function(e,r){return Xn.fromJSON(this,e,r)};Xn.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var a=this.curve,i=function(h){return a.point(h.x.redMul(a.endo.beta),h.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};Xn.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Xn.fromJSON=function(e,r,a){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],a);if(!r[2])return i;function h(p){return e.point(p[0],p[1],a)}var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(h))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(h))}},i};Xn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Xn.prototype.isInfinity=function(){return this.inf};Xn.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var a=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,i)};Xn.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,a=this.x.redSqr(),i=e.redInvm(),h=a.redAdd(a).redIAdd(a).redIAdd(r).redMul(i),c=h.redSqr().redISub(this.x.redAdd(this.x)),p=h.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,p)};Xn.prototype.getX=function(){return this.x.fromRed()};Xn.prototype.getY=function(){return this.y.fromRed()};Xn.prototype.mul=function(e){return e=new kr.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Xn.prototype.mulAdd=function(e,r,a){var i=[this,r],h=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(i,h):this.curve._wnafMulAdd(1,i,h,2)};Xn.prototype.jmulAdd=function(e,r,a){var i=[this,r],h=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(i,h,!0):this.curve._wnafMulAdd(1,i,h,2,!0)};Xn.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Xn.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var a=this.precomputed,i=function(h){return h.neg()};r.precomputed={naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(i)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(i)}}}return r};Xn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ca(t,e,r,a){B0.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&a===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new kr.default(0)):(this.x=new kr.default(e,16),this.y=new kr.default(r,16),this.z=new kr.default(a,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.zOne=this.z===this.curve.one}LA(ca,B0.BasePoint);xs.prototype.jpoint=function(e,r,a){return new ca(this,e,r,a)};ca.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),a=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(a,i)};ca.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ca.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),a=this.z.redSqr(),i=this.x.redMul(r),h=e.x.redMul(a),c=this.y.redMul(r.redMul(e.z)),p=e.y.redMul(a.redMul(this.z)),b=i.redSub(h),g=c.redSub(p);if(b.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=b.redSqr(),M=y.redMul(b),x=i.redMul(y),E=g.redSqr().redIAdd(M).redISub(x).redISub(x),A=g.redMul(x.redISub(E)).redISub(c.redMul(M)),I=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(E,A,I)};ca.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),a=this.x,i=e.x.redMul(r),h=this.y,c=e.y.redMul(r).redMul(this.z),p=a.redSub(i),b=h.redSub(c);if(p.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=p.redSqr(),y=g.redMul(p),M=a.redMul(g),x=b.redSqr().redIAdd(y).redISub(M).redISub(M),E=b.redMul(M.redISub(x)).redISub(h.redMul(y)),A=this.z.redMul(p);return this.curve.jpoint(x,E,A)};ca.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var a=this;for(r=0;r<e;r++)a=a.dbl();return a}var i=this.curve.a,h=this.curve.tinv,c=this.x,p=this.y,b=this.z,g=b.redSqr().redSqr(),y=p.redAdd(p);for(r=0;r<e;r++){var M=c.redSqr(),x=y.redSqr(),E=x.redSqr(),A=M.redAdd(M).redIAdd(M).redIAdd(i.redMul(g)),I=c.redMul(x),P=A.redSqr().redISub(I.redAdd(I)),N=I.redISub(P),L=A.redMul(N);L=L.redIAdd(L).redISub(E);var C=y.redMul(b);r+1<e&&(g=g.redMul(E)),c=P,b=C,y=L}return this.curve.jpoint(c,y.redMul(h),b)};ca.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ca.prototype._zeroDbl=function(){var e,r,a;if(this.zOne){var i=this.x.redSqr(),h=this.y.redSqr(),c=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(i).redISub(c);p=p.redIAdd(p);var b=i.redAdd(i).redIAdd(i),g=b.redSqr().redISub(p).redISub(p),y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),e=g,r=b.redMul(p.redISub(g)).redISub(y),a=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),x=this.y.redSqr(),E=x.redSqr(),A=this.x.redAdd(x).redSqr().redISub(M).redISub(E);A=A.redIAdd(A);var I=M.redAdd(M).redIAdd(M),P=I.redSqr(),N=E.redIAdd(E);N=N.redIAdd(N),N=N.redIAdd(N),e=P.redISub(A).redISub(A),r=I.redMul(A.redISub(e)).redISub(N),a=this.y.redMul(this.z),a=a.redIAdd(a)}return this.curve.jpoint(e,r,a)};ca.prototype._threeDbl=function(){var e,r,a;if(this.zOne){var i=this.x.redSqr(),h=this.y.redSqr(),c=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(i).redISub(c);p=p.redIAdd(p);var b=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=b.redSqr().redISub(p).redISub(p);e=g;var y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),r=b.redMul(p.redISub(g)).redISub(y),a=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),x=this.y.redSqr(),E=this.x.redMul(x),A=this.x.redSub(M).redMul(this.x.redAdd(M));A=A.redAdd(A).redIAdd(A);var I=E.redIAdd(E);I=I.redIAdd(I);var P=I.redAdd(I);e=A.redSqr().redISub(P),a=this.y.redAdd(this.z).redSqr().redISub(x).redISub(M);var N=x.redSqr();N=N.redIAdd(N),N=N.redIAdd(N),N=N.redIAdd(N),r=A.redMul(I.redISub(e)).redISub(N)}return this.curve.jpoint(e,r,a)};ca.prototype._dbl=function(){var e=this.curve.a,r=this.x,a=this.y,i=this.z,h=i.redSqr().redSqr(),c=r.redSqr(),p=a.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(h)),g=r.redAdd(r);g=g.redIAdd(g);var y=g.redMul(p),M=b.redSqr().redISub(y.redAdd(y)),x=y.redISub(M),E=p.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var A=b.redMul(x).redISub(E),I=a.redAdd(a).redMul(i);return this.curve.jpoint(M,A,I)};ca.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),a=this.z.redSqr(),i=r.redSqr(),h=e.redAdd(e).redIAdd(e),c=h.redSqr(),p=this.x.redAdd(r).redSqr().redISub(e).redISub(i);p=p.redIAdd(p),p=p.redAdd(p).redIAdd(p),p=p.redISub(c);var b=p.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=h.redIAdd(p).redSqr().redISub(c).redISub(b).redISub(g),M=r.redMul(y);M=M.redIAdd(M),M=M.redIAdd(M);var x=this.x.redMul(b).redISub(M);x=x.redIAdd(x),x=x.redIAdd(x);var E=this.y.redMul(y.redMul(g.redISub(y)).redISub(p.redMul(b)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var A=this.z.redAdd(p).redSqr().redISub(a).redISub(b);return this.curve.jpoint(x,E,A)};ca.prototype.mul=function(e,r){return e=new kr.default(e,r),this.curve._wnafMul(this,e)};ca.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),a=e.z.redSqr();if(this.x.redMul(a).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),h=a.redMul(e.z);return this.y.redMul(h).redISub(e.y.redMul(i)).cmpn(0)===0};ca.prototype.eqXToP=function(e){var r=this.z.redSqr(),a=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(a)===0)return!0;for(var i=e.clone(),h=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(h),this.x.cmp(a)===0)return!0}};ca.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ca.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var I3=Yp(function(t,e){"use strict";var r=e;r.base=B0,r.short=t6e,r.mont=null,r.edwards=null}),k3=Yp(function(t,e){"use strict";var r=e,a=To.assert;function i(p){p.type==="short"?this.curve=new I3.short(p):p.type==="edwards"?this.curve=new I3.edwards(p):this.curve=new I3.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function h(p,b){Object.defineProperty(r,p,{configurable:!0,enumerable:!0,get:function(){var g=new i(b);return Object.defineProperty(r,p,{configurable:!0,enumerable:!0,value:g}),g}})}h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:xu.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:xu.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:xu.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:xu.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:xu.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xu.default.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xu.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:xu.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Vc(t){if(!(this instanceof Vc))return new Vc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=wf.toArray(t.entropy,t.entropyEnc||"hex"),r=wf.toArray(t.nonce,t.nonceEnc||"hex"),a=wf.toArray(t.pers,t.persEnc||"hex");CA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,a)}var CG=Vc;Vc.prototype._init=function(e,r,a){var i=e.concat(r).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var h=0;h<this.V.length;h++)this.K[h]=0,this.V[h]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};Vc.prototype._hmac=function(){return new xu.default.hmac(this.hash,this.K)};Vc.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};Vc.prototype.reseed=function(e,r,a,i){typeof r!="string"&&(i=a,a=r,r=null),e=wf.toArray(e,r),a=wf.toArray(a,i),CA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(a||[])),this._reseed=1};Vc.prototype.generate=function(e,r,a,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=a,a=r,r=null),a&&(a=wf.toArray(a,i||"hex"),this._update(a));for(var h=[];h.length<e;)this.V=this._hmac().update(this.V).digest(),h=h.concat(this.V);var c=h.slice(0,e);return this._update(a),this._reseed++,wf.encode(c,r)};var NA=To.assert;function Ra(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var DA=Ra;Ra.fromPublic=function(e,r,a){return r instanceof Ra?r:new Ra(e,{pub:r,pubEnc:a})};Ra.fromPrivate=function(e,r,a){return r instanceof Ra?r:new Ra(e,{priv:r,privEnc:a})};Ra.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Ra.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Ra.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Ra.prototype._importPrivate=function(e,r){this.priv=new kr.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Ra.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?NA(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&NA(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Ra.prototype.derive=function(e){return e.validate()||NA(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Ra.prototype.sign=function(e,r,a){return this.ec.sign(e,this,r,a)};Ra.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Ra.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var r6e=To.assert;function O3(t,e){if(t instanceof O3)return t;this._importDER(t,e)||(r6e(t.r&&t.s,"Signature without r or s"),this.r=new kr.default(t.r,16),this.s=new kr.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var N3=O3;function i6e(){this.place=0}function PA(t,e){var r=t[e.place++];if(!(r&128))return r;var a=r&15;if(a===0||a>4)return!1;for(var i=0,h=0,c=e.place;h<a;h++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}function OG(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}O3.prototype._importDER=function(e,r){e=To.toArray(e,r);var a=new i6e;if(e[a.place++]!==48)return!1;var i=PA(e,a);if(i===!1||i+a.place!==e.length||e[a.place++]!==2)return!1;var h=PA(e,a);if(h===!1)return!1;var c=e.slice(a.place,h+a.place);if(a.place+=h,e[a.place++]!==2)return!1;var p=PA(e,a);if(p===!1||e.length!==p+a.place)return!1;var b=e.slice(a.place,p+a.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new kr.default(c),this.s=new kr.default(b),this.recoveryParam=null,!0};function OA(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}O3.prototype.toDER=function(e){var r=this.r.toArray(),a=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),a[0]&128&&(a=[0].concat(a)),r=OG(r),a=OG(a);!a[0]&&!(a[1]&128);)a=a.slice(1);var i=[2];OA(i,r.length),i=i.concat(r),i.push(2),OA(i,a.length);var h=i.concat(a),c=[48];return OA(c,h.length),c=c.concat(h),To.encode(c,e)};var n6e=function(){throw new Error("unsupported")},LG=To.assert;function _s(t){if(!(this instanceof _s))return new _s(t);typeof t=="string"&&(LG(Object.prototype.hasOwnProperty.call(k3,t),"Unknown curve "+t),t=k3[t]),t instanceof k3.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 a6e=_s;_s.prototype.keyPair=function(e){return new DA(this,e)};_s.prototype.keyFromPrivate=function(e,r){return DA.fromPrivate(this,e,r)};_s.prototype.keyFromPublic=function(e,r){return DA.fromPublic(this,e,r)};_s.prototype.genKeyPair=function(e){e||(e={});for(var r=new CG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||n6e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),i=this.n.sub(new kr.default(2));;){var h=new kr.default(r.generate(a));if(!(h.cmp(i)>0))return h.iaddn(1),this.keyFromPrivate(h)}};_s.prototype._truncateToN=function(e,r){var a=e.byteLength()*8-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};_s.prototype.sign=function(e,r,a,i){typeof a=="object"&&(i=a,a=null),i||(i={}),r=this.keyFromPrivate(r,a),e=this._truncateToN(new kr.default(e,16));for(var h=this.n.byteLength(),c=r.getPrivate().toArray("be",h),p=e.toArray("be",h),b=new CG({hash:this.hash,entropy:c,nonce:p,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new kr.default(1)),y=0;;y++){var M=i.k?i.k(y):new kr.default(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(g)>=0)){var x=this.g.mul(M);if(!x.isInfinity()){var E=x.getX(),A=E.umod(this.n);if(A.cmpn(0)!==0){var I=M.invm(this.n).mul(A.mul(r.getPrivate()).iadd(e));if(I=I.umod(this.n),I.cmpn(0)!==0){var P=(x.getY().isOdd()?1:0)|(E.cmp(A)!==0?2:0);return i.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),P^=1),new N3({r:A,s:I,recoveryParam:P})}}}}}};_s.prototype.verify=function(e,r,a,i){e=this._truncateToN(new kr.default(e,16)),a=this.keyFromPublic(a,i),r=new N3(r,"hex");var h=r.r,c=r.s;if(h.cmpn(1)<0||h.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var p=c.invm(this.n),b=p.mul(e).umod(this.n),g=p.mul(h).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(b,a.getPublic(),g),y.isInfinity()?!1:y.eqXToP(h)):(y=this.g.mulAdd(b,a.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(h)===0)};_s.prototype.recoverPubKey=function(t,e,r,a){LG((3&r)===r,"The recovery param is more than two bits"),e=new N3(e,a);var i=this.n,h=new kr.default(t),c=e.r,p=e.s,b=r&1,g=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var y=e.r.invm(i),M=i.sub(h).mul(y).umod(i),x=p.mul(y).umod(i);return this.g.mulAdd(M,c,x)};_s.prototype.getKeyRecoveryParam=function(t,e,r,a){if(e=new N3(e,a),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var h;try{h=this.recoverPubKey(t,e,i)}catch{continue}if(h.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var o6e=Yp(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=To,r.rand=function(){throw new Error("unsupported")},r.curve=I3,r.curves=k3,r.ec=a6e,r.eddsa=null}),DG=o6e.ec;ie();ae();ne();var $G="signing-key/5.7.0";var qA=new tr($G),$A=null;function Su(){return $A||($A=new DG("secp256k1")),$A}var Eu=class{constructor(e){hr(this,"curve","secp256k1"),hr(this,"privateKey",fr(e)),zm(this.privateKey)!==32&&qA.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=Su().keyFromPrivate(Ct(this.privateKey));hr(this,"publicKey","0x"+r.getPublic(!1,"hex")),hr(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),hr(this,"_isSigningKey",!0)}_addPoint(e){let r=Su().keyFromPublic(Ct(this.publicKey)),a=Su().keyFromPublic(Ct(e));return"0x"+r.pub.add(a.pub).encodeCompressed("hex")}signDigest(e){let r=Su().keyFromPrivate(Ct(this.privateKey)),a=Ct(e);a.length!==32&&qA.throwArgumentError("bad digest length","digest",e);let i=r.sign(a,{canonical:!0});return Hc({recoveryParam:i.recoveryParam,r:Ea("0x"+i.r.toString(16),32),s:Ea("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=Su().keyFromPrivate(Ct(this.privateKey)),a=Su().keyFromPublic(Ct(UA(e)));return Ea("0x"+r.derive(a.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function C3(t,e){let r=Hc(e),a={r:Ct(r.r),s:Ct(r.s)};return"0x"+Su().recoverPubKey(Ct(t),a,r.recoveryParam).encode("hex",!1)}function UA(t,e){let r=Ct(t);if(r.length===32){let a=new Eu(r);return e?"0x"+Su().keyFromPrivate(r).getPublic(!0,"hex"):a.publicKey}else{if(r.length===33)return e?fr(r):"0x"+Su().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Su().keyFromPublic(r).getPublic(!0,"hex"):fr(r)}return qA.throwArgumentError("invalid public or private key","key","[REDACTED]")}ie();ae();ne();ie();ae();ne();var qG="transactions/5.7.0";var _f=new tr(qG),UG;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(UG||(UG={}));var s6e=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],f6e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Ss(t){let e=UA(t);return Aa(_h(tn(_h(e,1)),12))}function jA(t,e){return Ss(C3(Ct(t),e))}function Io(t,e){let r=vu(rn.from(t).toHexString());return r.length>32&&_f.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function FA(t,e){return{address:Aa(t),storageKeys:(e||[]).map((r,a)=>(zm(r)!==32&&_f.throwArgumentError("invalid access list storageKey",`accessList[${t}:${a}]`,r),r.toLowerCase()))}}function u6e(t){if(Array.isArray(t))return t.map((r,a)=>Array.isArray(r)?(r.length>2&&_f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${a}]`,r),FA(r[0],r[1])):FA(r.address,r.storageKeys));let e=Object.keys(t).map(r=>{let a=t[r].reduce((i,h)=>(i[h]=!0,i),{});return FA(r,Object.keys(a).sort())});return e.sort((r,a)=>r.address.localeCompare(a.address)),e}function FG(t){return u6e(t).map(e=>[e.address,e.storageKeys])}function h6e(t,e){if(t.gasPrice!=null){let a=rn.from(t.gasPrice),i=rn.from(t.maxFeePerGas||0);a.eq(i)||_f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:a,maxFeePerGas:i})}let r=[Io(t.chainId||0,"chainId"),Io(t.nonce||0,"nonce"),Io(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Io(t.maxFeePerGas||0,"maxFeePerGas"),Io(t.gasLimit||0,"gasLimit"),t.to!=null?Aa(t.to):"0x",Io(t.value||0,"value"),t.data||"0x",FG(t.accessList||[])];if(e){let a=Hc(e);r.push(Io(a.recoveryParam,"recoveryParam")),r.push(vu(a.r)),r.push(vu(a.s))}return Zc(["0x02",Hm(r)])}function c6e(t,e){let r=[Io(t.chainId||0,"chainId"),Io(t.nonce||0,"nonce"),Io(t.gasPrice||0,"gasPrice"),Io(t.gasLimit||0,"gasLimit"),t.to!=null?Aa(t.to):"0x",Io(t.value||0,"value"),t.data||"0x",FG(t.accessList||[])];if(e){let a=Hc(e);r.push(Io(a.recoveryParam,"recoveryParam")),r.push(vu(a.r)),r.push(vu(a.s))}return Zc(["0x01",Hm(r)])}function l6e(t,e){ZV(t,f6e);let r=[];s6e.forEach(function(c){let p=t[c.name]||[],b={};c.numeric&&(b.hexPad="left"),p=Ct(fr(p,b)),c.length&&p.length!==c.length&&p.length>0&&_f.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,p),c.maxLength&&(p=vu(p),p.length>c.maxLength&&_f.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,p)),r.push(fr(p))});let a=0;if(t.chainId!=null?(a=t.chainId,typeof a!="number"&&_f.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Fm(e)&&e.v>28&&(a=Math.floor((e.v-35)/2)),a!==0&&(r.push(fr(a)),r.push("0x"),r.push("0x")),!e)return Hm(r);let i=Hc(e),h=27+i.recoveryParam;return a!==0?(r.pop(),r.pop(),r.pop(),h+=a*2+8,i.v>28&&i.v!==h&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==h&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(fr(h)),r.push(vu(Ct(i.r))),r.push(vu(Ct(i.s))),Hm(r)}function zA(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&_f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),l6e(t,e);switch(t.type){case 1:return c6e(t,e);case 2:return h6e(t,e);default:break}return _f.throwError(`unsupported transaction type: ${t.type}`,tr.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}ie();ae();ne();ie();ae();ne();ie();ae();ne();var jG="abstract-provider/5.7.0";var d6e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},p6e=new tr(jG);var L3=class t{constructor(){p6e.checkAbstract(new.target,t),hr(this,"_isProvider",!0)}getFeeData(){return d6e(this,void 0,void 0,function*(){let{block:e,gasPrice:r}=yield xh({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(c=>null)}),a=null,i=null,h=null;return e&&e.baseFeePerGas&&(a=e.baseFeePerGas,h=rn.from("1500000000"),i=e.baseFeePerGas.mul(2).add(h)),{lastBaseFeePerGas:a,maxFeePerGas:i,maxPriorityFeePerGas:h,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}};ie();ae();ne();ie();ae();ne();var zG="abstract-signer/5.7.0";var Mf=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},xf=new tr(zG),v6e=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],m6e=[tr.errors.INSUFFICIENT_FUNDS,tr.errors.NONCE_EXPIRED,tr.errors.REPLACEMENT_UNDERPRICED],D3=class t{constructor(){xf.checkAbstract(new.target,t),hr(this,"_isSigner",!0)}getBalance(e){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Mf(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let r=yield xh(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Mf(this,void 0,void 0,function*(){this._checkProvider("call");let a=yield xh(this.checkTransaction(e));return yield this.provider.call(a,r)})}sendTransaction(e){return Mf(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let r=yield this.populateTransaction(e),a=yield this.signTransaction(r);return yield this.provider.sendTransaction(a)})}getChainId(){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Mf(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let a in e)v6e.indexOf(a)===-1&&xf.throwArgumentError("invalid transaction key: "+a,"transaction",e);let r=Vm(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(a=>(a[0].toLowerCase()!==a[1].toLowerCase()&&xf.throwArgumentError("from address mismatch","transaction",e),a[0])),r}populateTransaction(e){return Mf(this,void 0,void 0,function*(){let r=yield xh(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Mf(this,void 0,void 0,function*(){if(i==null)return null;let h=yield this.resolveName(i);return h==null&&xf.throwArgumentError("provided ENS name resolves to null","tx.to",i),h})),r.to.catch(i=>{}));let a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?xf.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&a&&xf.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{let i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){let h=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=h,r.maxPriorityFeePerGas=h}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(a&&xf.throwError("network does not support EIP-1559",tr.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):xf.throwError("failed to get consistent fee data",tr.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(m6e.indexOf(i.code)>=0)throw i;return xf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",tr.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&xf.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield xh(r)})}_checkProvider(e){this.provider||xf.throwError("missing provider",tr.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};ie();ae();ne();ie();ae();ne();var $3=class{constructor(e){hr(this,"alphabet",e),hr(this,"base",e.length),hr(this,"_alphabetMap",{}),hr(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=Ct(e);if(r.length===0)return"";let a=[0];for(let h=0;h<r.length;++h){let c=r[h];for(let p=0;p<a.length;++p)c+=a[p]<<8,a[p]=c%this.base,c=c/this.base|0;for(;c>0;)a.push(c%this.base),c=c/this.base|0}let i="";for(let h=0;r[h]===0&&h<r.length-1;++h)i+=this._leader;for(let h=a.length-1;h>=0;--h)i+=this.alphabet[a[h]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let a=0;a<e.length;a++){let i=this._alphabetMap[e[a]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let h=i;for(let c=0;c<r.length;++c)h+=r[c]*this.base,r[c]=h&255,h>>=8;for(;h>0;)r.push(h&255),h>>=8}for(let a=0;e[a]===this._leader&&a<e.length-1;++a)r.push(0);return Ct(new Uint8Array(r.reverse()))}},IYe=new $3("abcdefghijklmnopqrstuvwxyz234567"),ZA=new $3("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Jm=mi(Gp());ie();ae();ne();var Yc;(function(t){t.sha256="sha256",t.sha512="sha512"})(Yc||(Yc={}));ie();ae();ne();var ZG="sha2/5.7.0";var g6e=new tr(ZG);function HA(t){return"0x"+Jm.default.ripemd160().update(Ct(t)).digest("hex")}function P0(t){return"0x"+Jm.default.sha256().update(Ct(t)).digest("hex")}function O0(t,e,r){return Yc[t]||g6e.throwError("unsupported algorithm "+t,tr.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+Jm.default.hmac(Jm.default[t],Ct(e)).update(Ct(r)).digest("hex")}function N0(t,e,r,a,i){t=Ct(t),e=Ct(e);let h,c=1,p=new Uint8Array(a),b=new Uint8Array(e.length+4);b.set(e);let g,y;for(let M=1;M<=c;M++){b[e.length]=M>>24&255,b[e.length+1]=M>>16&255,b[e.length+2]=M>>8&255,b[e.length+3]=M&255;let x=Ct(O0(i,t,b));h||(h=x.length,y=new Uint8Array(h),c=Math.ceil(a/h),g=a-(c-1)*h),y.set(x);for(let I=1;I<r;I++){x=Ct(O0(i,t,x));for(let P=0;P<h;P++)y[P]^=x[P]}let E=(M-1)*h,A=M===c?g:h;p.set(Ct(y).slice(0,A),E)}return fr(p)}ie();ae();ne();ie();ae();ne();ie();ae();ne();var HG="wordlists/5.7.0";var b6e=!1,y6e=new tr(HG),Jp=class t{constructor(e){y6e.checkAbstract(new.target,t),hr(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){let r=[];for(let a=0;a<2048;a++){let i=e.getWord(a);if(a!==e.getWordIndex(i))return"0x";r.push(i)}return jp(r.join(`
|
|
131
131
|
`)+`
|
|
132
132
|
`)}static register(e,r){if(r||(r=e.locale),b6e)try{let a=window;a._ethers&&a._ethers.wordlists&&(a._ethers.wordlists[r]||hr(a._ethers.wordlists,r,e))}catch{}}};ie();ae();ne();ie();ae();ne();var w6e="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",Xm=null;function KG(t){if(Xm==null&&(Xm=w6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Jp.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw Xm=null,new Error("BIP39 Wordlist for en (English) FAILED")}var KA=class extends Jp{constructor(){super("en")}getWord(e){return KG(this),Xm[e]}getWordIndex(e){return KG(this),Xm.indexOf(e)}},WA=new KA;Jp.register(WA);var q3={en:WA};ie();ae();ne();var WG="hdnode/5.7.0";var F3=new tr(WG),_6e=rn.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),M6e=Na("Bitcoin seed"),Qm=2147483648;function GG(t){return(1<<t)-1<<8-t}function x6e(t){return(1<<t)-1}function U3(t){return Ea(fr(t),32)}function VG(t){return ZA.encode(Ro([t,_h(P0(P0(t)),0,4)]))}function VA(t){if(t==null)return q3.en;if(typeof t=="string"){let e=q3[t];return e==null&&F3.throwArgumentError("unknown locale","wordlist",t),e}return t}var Xp={},C0="m/44'/60'/0'/0/0",Jc=class t{constructor(e,r,a,i,h,c,p,b){if(e!==Xp)throw new Error("HDNode constructor cannot be called directly");if(r){let g=new Eu(r);hr(this,"privateKey",g.privateKey),hr(this,"publicKey",g.compressedPublicKey)}else hr(this,"privateKey",null),hr(this,"publicKey",fr(a));hr(this,"parentFingerprint",i),hr(this,"fingerprint",_h(HA(P0(this.publicKey)),0,4)),hr(this,"address",Ss(this.publicKey)),hr(this,"chainCode",h),hr(this,"index",c),hr(this,"depth",p),b==null?(hr(this,"mnemonic",null),hr(this,"path",null)):typeof b=="string"?(hr(this,"mnemonic",null),hr(this,"path",b)):(hr(this,"mnemonic",b),hr(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return VG(Ro([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",fr(this.depth),this.parentFingerprint,Ea(fr(this.index),4),this.chainCode,this.privateKey!=null?Ro(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new t(Xp,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Qm));let a=new Uint8Array(37);if(e&Qm){if(!this.privateKey)throw new Error("cannot derive child of neutered node");a.set(Ct(this.privateKey),1),r&&(r+="'")}else a.set(Ct(this.publicKey));for(let M=24;M>=0;M-=8)a[33+(M>>3)]=e>>24-M&255;let i=Ct(O0(Yc.sha512,this.chainCode,a)),h=i.slice(0,32),c=i.slice(32),p=null,b=null;this.privateKey?p=U3(rn.from(h).add(this.privateKey).mod(_6e)):b=new Eu(fr(h))._addPoint(this.publicKey);let g=r,y=this.mnemonic;return y&&(g=Object.freeze({phrase:y.phrase,path:r,locale:y.locale||"en"})),new t(Xp,p,b,this.fingerprint,U3(c),e,this.depth+1,g)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let a=this;for(let i=0;i<r.length;i++){let h=r[i];if(h.match(/^[0-9]+'$/)){let c=parseInt(h.substring(0,h.length-1));if(c>=Qm)throw new Error("invalid path index - "+h);a=a._derive(Qm+c)}else if(h.match(/^[0-9]+$/)){let c=parseInt(h);if(c>=Qm)throw new Error("invalid path index - "+h);a=a._derive(c)}else throw new Error("invalid path component - "+h)}return a}static _fromSeed(e,r){let a=Ct(e);if(a.length<16||a.length>64)throw new Error("invalid seed");let i=Ct(O0(Yc.sha512,M6e,a));return new t(Xp,U3(i.slice(0,32)),null,"0x00000000",U3(i.slice(32)),0,0,r)}static fromMnemonic(e,r,a){return a=VA(a),e=eg(GA(e,a),a),t._fromSeed(S6e(e,r),{phrase:e,path:"m",locale:a.locale})}static fromSeed(e){return t._fromSeed(e,null)}static fromExtendedKey(e){let r=ZA.decode(e);(r.length!==82||VG(r.slice(0,78))!==e)&&F3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let a=r[4],i=fr(r.slice(5,9)),h=parseInt(fr(r.slice(9,13)).substring(2),16),c=fr(r.slice(13,45)),p=r.slice(45,78);switch(fr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(Xp,null,fr(p),i,c,h,a,null);case"0x0488ade4":case"0x04358394 ":if(p[0]!==0)break;return new t(Xp,fr(p.slice(1)),null,i,c,h,a,null)}return F3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function S6e(t,e){e||(e="");let r=Na("mnemonic"+e,mu.NFKD);return N0(Na(t,mu.NFKD),r,2048,64,"sha512")}function GA(t,e){e=VA(e),F3.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let a=Ct(new Uint8Array(Math.ceil(11*r.length/8))),i=0;for(let g=0;g<r.length;g++){let y=e.getWordIndex(r[g].normalize("NFKD"));if(y===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)y&1<<10-M&&(a[i>>3]|=1<<7-i%8),i++}let h=32*r.length/3,c=r.length/3,p=GG(c);if((Ct(P0(a.slice(0,h/8)))[0]&p)!==(a[a.length-1]&p))throw new Error("invalid checksum");return fr(a.slice(0,h/8))}function eg(t,e){if(e=VA(e),t=Ct(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],a=11;for(let c=0;c<t.length;c++)a>8?(r[r.length-1]<<=8,r[r.length-1]|=t[c],a-=8):(r[r.length-1]<<=a,r[r.length-1]|=t[c]>>8-a,r.push(t[c]&x6e(8-a)),a+=3);let i=t.length/4,h=Ct(P0(t))[0]&GG(i);return r[r.length-1]<<=i,r[r.length-1]|=h>>8-i,e.join(r.map(c=>e.getWord(c)))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var YG="random/5.7.0";var YA=new tr(YG);function E6e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var JG=E6e(),j3=JG.crypto||JG.msCrypto;(!j3||!j3.getRandomValues)&&(YA.warn("WARNING: Missing strong random number source"),j3={getRandomValues:function(t){return YA.throwError("no secure random source avaialble",tr.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Xc(t){(t<=0||t>1024||t%1||t!=t)&&YA.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return j3.getRandomValues(e),Ct(e)}ie();ae();ne();ie();ae();ne();var QA=mi(XA());ie();ae();ne();var z3="json-wallets/5.7.0";ie();ae();ne();function Rh(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Ct(t)}function Qp(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function tg(t){return typeof t=="string"?Na(t,mu.NFKC):Ct(t)}function an(t,e){let r=t,a=e.toLowerCase().split("/");for(let i=0;i<a.length;i++){let h=null;for(let c in r)if(c.toLowerCase()===a[i]){h=r[c];break}if(h===null)return null;r=h}return r}function QG(t){let e=Ct(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=fr(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var A6e=new tr(z3),eR=class extends T0{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function tR(t,e){let r=JSON.parse(t);e=tg(e);let a=Aa(an(r,"ethaddr")),i=Rh(an(r,"encseed"));(!i||i.length%16!==0)&&A6e.throwArgumentError("invalid encseed","json",t);let h=Ct(N0(e,e,2e3,32,"sha256")).slice(0,16),c=i.slice(0,16),p=i.slice(16),b=new QA.default.ModeOfOperation.cbc(h,c),g=QA.default.padding.pkcs7.strip(Ct(b.decrypt(p))),y="";for(let E=0;E<g.length;E++)y+=String.fromCharCode(g[E]);let M=Na(y),x=tn(M);return new eR({_isCrowdsaleAccount:!0,address:a,privateKey:x})}ie();ae();ne();function rR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function iR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}ie();ae();ne();var Th=mi(XA()),Z3=mi(tY());var R6e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},aR=new tr(z3);function rY(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var oR=class extends T0{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function T6e(t,e,r){if(an(t,"crypto/cipher")==="aes-128-ctr"){let i=Rh(an(t,"crypto/cipherparams/iv")),h=new Th.default.Counter(i),c=new Th.default.ModeOfOperation.ctr(e,h);return Ct(c.decrypt(r))}return null}function iY(t,e){let r=Rh(an(t,"crypto/ciphertext"));if(fr(tn(Ro([e.slice(16,32),r]))).substring(2)!==an(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let i=T6e(t,e.slice(0,16),r);i||aR.throwError("unsupported cipher",tr.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let h=e.slice(32,64),c=Ss(i);if(t.address){let b=t.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),Aa(b)!==c)throw new Error("address mismatch")}let p={_isKeystoreAccount:!0,address:c,privateKey:fr(i)};if(an(t,"x-ethers/version")==="0.1"){let b=Rh(an(t,"x-ethers/mnemonicCiphertext")),g=Rh(an(t,"x-ethers/mnemonicCounter")),y=new Th.default.Counter(g),M=new Th.default.ModeOfOperation.ctr(h,y),x=an(t,"x-ethers/path")||C0,E=an(t,"x-ethers/locale")||"en",A=Ct(M.decrypt(b));try{let I=eg(A,E),P=Jc.fromMnemonic(I,null,E).derivePath(x);if(P.privateKey!=p.privateKey)throw new Error("mnemonic mismatch");p.mnemonic=P.mnemonic}catch(I){if(I.code!==tr.errors.INVALID_ARGUMENT||I.argument!=="wordlist")throw I}}return new oR(p)}function nY(t,e,r,a,i){return Ct(N0(t,e,r,a,i))}function I6e(t,e,r,a,i){return Promise.resolve(nY(t,e,r,a,i))}function aY(t,e,r,a,i){let h=tg(e),c=an(t,"crypto/kdf");if(c&&typeof c=="string"){let p=function(b,g){return aR.throwArgumentError("invalid key-derivation function parameters",b,g)};if(c.toLowerCase()==="scrypt"){let b=Rh(an(t,"crypto/kdfparams/salt")),g=parseInt(an(t,"crypto/kdfparams/n")),y=parseInt(an(t,"crypto/kdfparams/r")),M=parseInt(an(t,"crypto/kdfparams/p"));(!g||!y||!M)&&p("kdf",c),g&g-1&&p("N",g);let x=parseInt(an(t,"crypto/kdfparams/dklen"));return x!==32&&p("dklen",x),a(h,b,g,y,M,64,i)}else if(c.toLowerCase()==="pbkdf2"){let b=Rh(an(t,"crypto/kdfparams/salt")),g=null,y=an(t,"crypto/kdfparams/prf");y==="hmac-sha256"?g="sha256":y==="hmac-sha512"?g="sha512":p("prf",y);let M=parseInt(an(t,"crypto/kdfparams/c")),x=parseInt(an(t,"crypto/kdfparams/dklen"));return x!==32&&p("dklen",x),r(h,b,M,x,g)}}return aR.throwArgumentError("unsupported key-derivation function","kdf",c)}function oY(t,e){let r=JSON.parse(t),a=aY(r,e,nY,Z3.default.syncScrypt);return iY(r,a)}function sY(t,e,r){return R6e(this,void 0,void 0,function*(){let a=JSON.parse(t),i=yield aY(a,e,I6e,Z3.default.scrypt,r);return iY(a,i)})}function sR(t,e,r,a){try{if(Aa(t.address)!==Ss(t.privateKey))throw new Error("address/privateKey mismatch");if(rY(t)){let P=t.mnemonic;if(Jc.fromMnemonic(P.phrase,null,P.locale).derivePath(P.path||C0).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(P){return Promise.reject(P)}typeof r=="function"&&!a&&(a=r,r={}),r||(r={});let i=Ct(t.privateKey),h=tg(e),c=null,p=null,b=null;if(rY(t)){let P=t.mnemonic;c=Ct(GA(P.phrase,P.locale||"en")),p=P.path||C0,b=P.locale||"en"}let g=r.client;g||(g="ethers.js");let y=null;r.salt?y=Ct(r.salt):y=Xc(32);let M=null;if(r.iv){if(M=Ct(r.iv),M.length!==16)throw new Error("invalid iv")}else M=Xc(16);let x=null;if(r.uuid){if(x=Ct(r.uuid),x.length!==16)throw new Error("invalid uuid")}else x=Xc(16);let E=1<<17,A=8,I=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(A=r.scrypt.r),r.scrypt.p&&(I=r.scrypt.p)),Z3.default.scrypt(h,y,E,A,I,64,a).then(P=>{P=Ct(P);let N=P.slice(0,16),L=P.slice(16,32),C=P.slice(32,64),Y=new Th.default.Counter(M),G=new Th.default.ModeOfOperation.ctr(N,Y),ee=Ct(G.encrypt(i)),D=tn(Ro([L,ee])),U={address:t.address.substring(2).toLowerCase(),id:QG(x),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:fr(M).substring(2)},ciphertext:fr(ee).substring(2),kdf:"scrypt",kdfparams:{salt:fr(y).substring(2),n:E,dklen:32,p:I,r:A},mac:D.substring(2)}};if(c){let V=Xc(16),_=new Th.default.Counter(V),n=new Th.default.ModeOfOperation.ctr(C,_),s=Ct(n.encrypt(c)),f=new Date,u=f.getUTCFullYear()+"-"+Qp(f.getUTCMonth()+1,2)+"-"+Qp(f.getUTCDate(),2)+"T"+Qp(f.getUTCHours(),2)+"-"+Qp(f.getUTCMinutes(),2)+"-"+Qp(f.getUTCSeconds(),2)+".0Z";U["x-ethers"]={client:g,gethFilename:"UTC--"+u+"--"+U.address,mnemonicCounter:fr(V).substring(2),mnemonicCiphertext:fr(s).substring(2),path:p,locale:b,version:"0.1"}}return JSON.stringify(U)})}function fY(t,e,r){if(rR(t)){r&&r(0);let a=tR(t,e);return r&&r(1),Promise.resolve(a)}return iR(t)?sY(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function uY(t,e){if(rR(t))return tR(t,e);if(iR(t))return oY(t,e);throw new Error("invalid JSON wallet")}ie();ae();ne();var hY="wallet/5.7.0";var cY=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},e1=new tr(hY);function k6e(t){return t!=null&&Dn(t.privateKey,32)&&t.address!=null}function B6e(t){let e=t.mnemonic;return e&&e.phrase}var t1=class t extends D3{constructor(e,r){if(super(),k6e(e)){let a=new Eu(e.privateKey);if(hr(this,"_signingKey",()=>a),hr(this,"address",Ss(this.publicKey)),this.address!==Aa(e.address)&&e1.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),B6e(e)){let i=e.mnemonic;hr(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||C0,locale:i.locale||"en"}));let h=this.mnemonic,c=Jc.fromMnemonic(h.phrase,null,h.locale).derivePath(h.path);Ss(c.privateKey)!==this.address&&e1.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else hr(this,"_mnemonic",()=>null)}else{if(Eu.isSigningKey(e))e.curve!=="secp256k1"&&e1.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),hr(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let a=new Eu(e);hr(this,"_signingKey",()=>a)}hr(this,"_mnemonic",()=>null),hr(this,"address",Ss(this.publicKey))}r&&!L3.isProvider(r)&&e1.throwArgumentError("invalid provider","provider",r),hr(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new t(this,e)}signTransaction(e){return xh(e).then(r=>{r.from!=null&&(Aa(r.from)!==this.address&&e1.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let a=this._signingKey().signDigest(tn(zA(r)));return zA(r,a)})}signMessage(e){return cY(this,void 0,void 0,function*(){return mA(this._signingKey().signDigest(Kc(e)))})}_signTypedData(e,r,a){return cY(this,void 0,void 0,function*(){let i=yield I0.resolveNames(e,r,a,h=>(this.provider==null&&e1.throwError("cannot resolve ENS names without a provider",tr.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:h}),this.provider.resolveName(h)));return mA(this._signingKey().signDigest(I0.hash(i.domain,r,i.value)))})}encrypt(e,r,a){if(typeof r=="function"&&!a&&(a=r,r={}),a&&typeof a!="function")throw new Error("invalid callback");return r||(r={}),sR(this,e,r,a)}static createRandom(e){let r=Xc(16);e||(e={}),e.extraEntropy&&(r=Ct(_h(tn(Ro([r,e.extraEntropy])),0,16)));let a=eg(r,e.locale);return t.fromMnemonic(a,e.path,e.locale)}static fromEncryptedJson(e,r,a){return fY(e,r,a).then(i=>new t(i))}static fromEncryptedJsonSync(e,r){return new t(uY(e,r))}static fromMnemonic(e,r,a){return r||(r=C0),new t(Jc.fromMnemonic(e,null,a).derivePath(r))}};function lY(t,e){return jA(Kc(t),e)}function H3(t,e,r,a){return jA(I0.hash(t,e,r),a)}var fR=class{signer;publicKey;ownerLength=Kr[wr.ETHEREUM].pubLength;signatureLength=Kr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;constructor(e){this.signer=e.getSigner()}async setPublicKey(){let e="sign this message to connect to Bundlr.Network",r=await this.signer.signMessage(e),a=await Kc(e),i=C3(Ct(a),r);this.publicKey=Me.from(Ct(i))}async sign(e){this.publicKey||await this.setPublicKey();let r=await this.signer.signMessage(e);return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=Ss(e);return lY(r,a)===i}};ie();ae();ne();var r1=mi(bY(),1),Ih=class extends So{get publicKey(){return r1.default.decode(this.pk)}get key(){return r1.default.decode(this._key)}constructor(e){let r=r1.default.decode(e);super(r1.default.encode(r.subarray(0,32)),r1.default.encode(r.subarray(32,64)))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var DX=mi(Uo(),1),rT=mi(RR(),1);ie();ae();ne();lo();var kX=mi(IX(),1);function tT(t){return t=BX(t),(0,kX.default)("keccak256").update(t).digest()}function BX(t){if(!Me.isBuffer(t))if(Array.isArray(t))t=Me.from(t);else if(typeof t=="string")PX(t)?t=Me.from(x8(OX(t)),"hex"):t=Me.from(t);else if(typeof t=="number")t=CX(t);else if(typeof t=="bigint")t=V4e(t);else if(t==null)t=Me.allocUnsafe(0);else throw new Error("invalid type");return t}function PX(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function x8(t){if(typeof t!="string")throw new Error(`while padding to even, value must be string, is currently ${typeof t}, while padToEven.`);return t.length%2&&(t=`0${t}`),t}function OX(t){return typeof t!="string"?t:NX(t)?t.slice(2):t}function NX(t){if(typeof t!="string")throw new Error("value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.startsWith("0x")}function CX(t){let e=LX(t);return Me.from(x8(e.slice(2)),"hex")}function LX(t){return`0x${t.toString(16)}`}function V4e(t){let e=t.toString(16);return Me.from(x8(e),"hex")}typeof window<"u"&&(window.keccak256=tT);var dg=tT,G4e={intToBuffer:CX,intToHex:LX,isHexPrefixed:NX,stripHexPrefix:OX,padToEven:x8,isHexString:PX,toBuffer:BX};var Y0=class{_key;ownerLength=Kr[wr.ETHEREUM].pubLength;signatureLength=Kr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;pk;constructor(e,r){this._key=e,this.pk=r.toString("hex")}get publicKey(){throw new Error("You must implement `publicKey`")}get key(){return Me.from(this._key,"hex")}static async verify(e,r,a){let i=e;typeof e=="string"&&(i=DX.default.toBuffer(e));let h=!1;try{h=rT.default.ecdsaVerify(a,dg(Me.from(r)),i)}catch{}return h}async sign(e){return rT.default.ecdsaSign(dg(Me.from(e)),Me.from(this.key)).signature}};var iT=mi(RR(),1),$X=mi(Uo(),1);var Bo=class extends Y0{get publicKey(){return Me.from(this.pk,"hex")}constructor(e){e.startsWith("0x")&&(e=e.slice(2));let r=Me.from(e,"hex"),a=iT.default.publicKeyCreate(r,!1);super(e,Me.from(a))}async sign(e){return new t1(this._key).signMessage(e).then(a=>Me.from(a.slice(2),"hex"))}static async verify(e,r,a){return iT.default.ecdsaVerify(a.length===65?a.slice(0,-1):a,Ct(Kc(r)),typeof e=="string"?$X.default.toBuffer(e):e)}};var pg=class extends Bo{};ie();ae();ne();var vg=class extends Ih{constructor(e){super(e.replace("ed25519:",""))}};ie();ae();ne();var mg=class extends So{get publicKey(){return Me.from(this.pk)}get key(){return Me.from(this._key)}constructor(e,r){super(e.subarray(0,32),r)}};ie();ae();ne();var J0=class extends A0{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Me.from(Me.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,Me.from(Me.from(r).toString("hex")),a)}};ie();ae();ne();var gg=class extends Ih{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Me.from(Me.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,Me.from(Me.from(r).toString("hex")),a)}};ie();ae();ne();var bg=class extends So{constructor(e,r){super(e,r)}get publicKey(){return Me.from(this.pk.slice(2),"hex")}get key(){return Me.from(this._key.slice(2),"hex")}};ie();ae();ne();var X0=class{_publicKey;ownerLength=Kr[wr.INJECTEDAPTOS].pubLength;signatureLength=Kr[wr.INJECTEDAPTOS].sigLength;signatureType=wr.INJECTEDAPTOS;pem;provider;constructor(e,r){this.provider=e,this._publicKey=r}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");let a=(await this.provider.signMessage({message:Me.from(e).toString("hex"),nonce:"bundlr"})).signature;return typeof a=="string"?Me.from(a,"hex"):a.data.toUint8Array()}static async verify(e,r,a){let i=e;return Dc(Me.from(a),Me.from(`APTOS
|
|
133
133
|
message: ${Me.from(r).toString("hex")}
|
|
134
|
-
nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength=Kr[wr.MULTIAPTOS].pubLength;signatureLength=Kr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let p=Me.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&p.set(r[b++],g*64);return p.set(h,this.signatureLength-4),p}static async verify(e,r,a){let h=Kr[wr.MULTIAPTOS].sigLength-4,c=a.slice(0,h),p=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((p[y]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await Dc(Me.from(E),Me.from(r),Me.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Bo{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+dg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new t1(e)}get publicKey(){return Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},yg={name:"Bundlr",version:"1"},wg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var nT=class{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var qX=mi(Uo(),1);var ul=class{signer;publicKey;ownerLength=Kr[wr.ARWEAVE].pubLength;signatureLength=Kr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=qX.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await Mn().verify(e,r,a)}};ie();ae();ne();var _g=class extends Bo{signatureType=wr.KYVE};var Mg={1:zc,2:So,3:Bo,4:J0,5:X0,6:Q0,7:ed};ie();ae();ne();ie();ae();ne();async function Y4e(t){return $c([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var xg=Y4e;ie();ae();ne();ie();ae();ne();function Sg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function S8(t){return Sg(8,t)}function aT(t){return Sg(2,t)}function J4e(t){return Sg(16,t)}function E8(t){return Sg(32,t)}function bn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Ag=mi(Uo(),1);ie();ae();ne();var Bs=mi(Uo(),1);lo();ie();ae();ne();var Eg=class{buf;pos;constructor(e=Me.alloc(A8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Me.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,p,b;for(h=0,c=r;h<c;h++)p=e.charCodeAt(h),p<128?a[i++]=p:p<2048?(a[i++]=p>>6|192,a[i++]=p&63|128):(p&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(p=65536+((p&1023)<<10)+(b&1023),h++,a[i++]=p>>18|240,a[i++]=p>>12&63|128,a[i++]=p>>6&63|128,a[i++]=p&63|128):(a[i++]=p>>12|224,a[i++]=p>>6&63|128,a[i++]=p&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,c,p;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,p=268435456;do i=a[this.pos++],c+=(i&127)*p,p*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function oT(t){if(t?.length===0)return Me.allocUnsafe(0);let e=new Eg;return e.writeTags(t),e.toBuffer()}function p1(t){return new Eg(t).readTags()}lu();var R8=80,A8=4096,v1=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=bn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return Bs.default.encode(this.rawId)}set id(e){this._id=Bs.default.toBuffer(e)}get rawId(){return df("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Bs.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Kr[this.signatureType].sigLength}get owner(){return Bs.default.encode(this.rawOwner)}get ownerLength(){return Kr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get target(){return Bs.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get anchor(){return Bs.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=bn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(bn(this.binary.subarray(e,e+8))==0)return[];let a=bn(this.binary.subarray(e+8,e+16));return p1(Me.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:Bs.default.encode(r.name),value:Bs.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=bn(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=bn(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return Bs.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await T8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Me.from(await Mn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:Bs.default.encode(e.name),value:Bs.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<R8)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=bn(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),p=bn(c);if(p>A8)return!1;if(h>0)try{if(p1(Me.from(e.subarray(i+16,i+16+p))).length!==h)return!1}catch{return!1}let b=Mg[a],g=await xg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return xg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},m1=v1;lu();var ku=32,I8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=ku;r<ku+64*this.length;r+=64)e.push(bn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=ku;r<ku+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Ag.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Ag.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,Ag.default)(df("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=ku;a<ku+64*this.length;a+=64){let i=bn(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(Me.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,c;for(let y=ku;y<ku+64*this.length;y+=64){if(h=bn(this.binary.subarray(y,y+32)),i++===e){c=this.binary.subarray(y+32,y+64);break}r+=h}let p=a+r,b=this.binary.subarray(p,p+h),g=new m1(b);return g.rawId=c,g}getById(e){let r=Ag.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new m1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return bn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=ku;h<ku+64*this.length;h+=64){let c=bn(this.binary.subarray(h,h+32)),p=this.binary.subarray(h+32,h+64);if(p.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+c);r+=c;let y=new m1(g);y.rawId=p,e[i]=y,i++}return e}},sT=I8;function X4e(t){return new sT(t)}async function Q4e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,c)=>{let p=h.isSigned()?h.rawId:await T8(h,e),b=new Uint8Array(64);return b.set(E8(h.getRaw().byteLength),0),b.set(p,32),r.set(b,64*c),h.getRaw()})).then(h=>Me.concat(h)),i=Me.concat([Me.from(E8(t.length)),Me.from(r),a]);return new sT(i)}async function UX(t,e){let r=await xg(t),a=await e.sign(r),i=await Mn().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function T8(t,e){let{signature:r,id:a}=await UX(t,e);return t.getRaw().set(r,2),a}ie();ae();ne();var FX=mi(Uo(),1);function Rg(t,e,r){let a=e.publicKey,i=r?.target?FX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?oT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?Me.from(t):Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(aT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set(S8(r?.tags?.length??0),P);let N=S8(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new m1(E)}ie();ae();ne();ie();ae();ne();var fT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var lT={};Ka(lT,{default:()=>rwe,processStream:()=>KX,streamExportForTesting:()=>iwe,streamSigner:()=>twe});ie();ae();ne();k8();var td=mi(Uo(),1);lu();async function KX(t){let e=WX(t),r=(await e.next()).value;r=await Ca(e,r,32);let a=bn(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await Ca(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[bn(r.subarray(b,b+32)),(0,td.default)(Me.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,p=[];for(let[b,g]of h){r=await Ca(e,r,R8),r=await Ca(e,r,2);let y=bn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Kr[y];r=await Ca(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await Ca(e,r,x);let I=r.subarray(0,x);r=r.subarray(x),r=await Ca(e,r,1);let P=r[0]===1;P&&(r=await Ca(e,r,33));let N=P?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(P?33:1),r=await Ca(e,r,1);let L=r[0]===1;L&&(r=await Ca(e,r,33));let C=L?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(L?33:1),r=await Ca(e,r,8);let Y=bn(r.subarray(0,8));r=r.subarray(8),r=await Ca(e,r,8);let G=bn(r.subarray(0,8));r=r.subarray(8),r=await Ca(e,r,G);let ee=r.subarray(0,G),D=Y!==0&&G!==0?p1(Me.from(ee)):[];if(D.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let U=new ZX;U._transform=function(f,u,l){this.push(f),l()};let V=$c([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(y.toString()),I,N,C,ee,U]),_=2+M+x+(P?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)U.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(U.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?U.write(r.subarray(0,r.byteLength-(f-n))):U.write(r)}r=r.subarray(r.byteLength-(f-n))}if(U.end(),g!==(0,td.default)(df("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await Mg[y].verify(I,await V,A))throw new Error("Invalid signature");p.push({id:g,sigName:E,signature:(0,td.default)(Me.from(A)),target:(0,td.default)(Me.from(N)),anchor:(0,td.default)(Me.from(C)),owner:(0,td.default)(Me.from(I)),tags:D,dataOffset:c+_,dataSize:n}),c+=_+n}return p}async function twe(t,e,r,a){let i=Rg("",r,a),h=new HX,c=[(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],p=await $c(c),b=Me.from(await r.sign(p));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function Ca(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return Ca(t,Me.concat([Me.from(e),Me.from(i)]),r)}async function*WX(t){for await(let e of t)yield e}var rwe=KX,iwe={readBytes:Ca,getReader:WX};var nwe={...uT,stream:lT};globalThis.arbundles??=nwe;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var si;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(si||(si={}));var pT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(pT||(pT={}));var Yt=si.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hl=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Pt=si.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),awe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Po=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,si.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Po.create=t=>new Po(t);var y1=(t,e)=>{let r;switch(t.code){case Pt.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Pt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,si.jsonStringifyReplacer)}`;break;case Pt.unrecognized_keys:r=`Unrecognized key(s) in object: ${si.joinValues(t.keys,", ")}`;break;case Pt.invalid_union:r="Invalid input";break;case Pt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${si.joinValues(t.options)}`;break;case Pt.invalid_enum_value:r=`Invalid enum value. Expected ${si.joinValues(t.options)}, received '${t.received}'`;break;case Pt.invalid_arguments:r="Invalid function arguments";break;case Pt.invalid_return_type:r="Invalid function return type";break;case Pt.invalid_date:r="Invalid date";break;case Pt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:si.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Pt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Pt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Pt.custom:r="Invalid input";break;case Pt.invalid_intersection_types:r="Intersection results could not be merged";break;case Pt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Pt.not_finite:r="Number must be finite";break;default:r=e.defaultError,si.assertNever(t)}return{message:r}},YX=y1;function owe(t){YX=t}function B8(){return YX}var P8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},swe=[];function Wt(t,e){let r=B8(),a=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===y1?void 0:y1].filter(i=>!!i)});t.common.issues.push(a)}var ka=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return vr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return vr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},vr=Object.freeze({status:"aborted"}),b1=t=>({status:"dirty",value:t}),La=t=>({status:"valid",value:t}),vT=t=>t.status==="aborted",mT=t=>t.status==="dirty",Bg=t=>t.status==="valid",Pg=t=>typeof Promise<"u"&&t instanceof Promise;function O8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function JX(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ir;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ir||(ir={}));var Ig,kg,Os=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},VX=(t,e)=>{if(Bg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Po(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,p)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:c.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Pr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return hl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ka,ctx:{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Pg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return VX(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(Pg(i)?i:Promise.resolve(i));return VX(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),p=()=>h.addIssue({code:Pt.custom,...a(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(p(),!1)):c?!0:(p(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new Oo({schema:this,typeName:lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ps.create(this,this._def)}nullable(){return Pu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ch.create(this,this._def)}promise(){return dl.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Oo({...Br(this._def),schema:this,typeName:lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:lr.ZodDefault})}brand(){return new Og({typeName:lr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:lr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ng.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fwe=/^c[^\s-]{8,}$/i,uwe=/^[0-9a-z]+$/,hwe=/^[0-9A-HJKMNP-TV-Z]{26}$/,cwe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,lwe=/^[a-z0-9_-]{21}$/i,dwe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pwe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vwe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dT,mwe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gwe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,bwe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ywe=new RegExp(`^${XX}$`);function QX(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function wwe(t){return new RegExp(`^${QX(t)}$`)}function eQ(t){let e=`${XX}T${QX(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function _we(t,e){return!!((e==="v4"||!e)&&mwe.test(t)||(e==="v6"||!e)&&gwe.test(t))}var cl=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.string,received:h.parsedType}),vr}let a=new ka,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,p=e.data.length<h.value;(c||p)&&(i=this._getOrReturnCtx(e,i),c?Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")pwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")dT||(dT=new RegExp(vwe,"u")),dT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")cwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")lwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")fwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")uwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")hwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Pt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Pt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?eQ(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?ywe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?wwe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?dwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?_we(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?bwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Pt.invalid_string,message:h.message}),a.dirty()):si.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Pt.invalid_string,...ir.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ir.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ir.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ir.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ir.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ir.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ir.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ir.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ir.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ir.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ir.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...ir.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ir.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ir.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ir.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ir.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ir.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ir.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ir.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ir.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ir.errToObj(r)})}nonempty(e){return this.min(1,ir.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cl.create=t=>{var e;return new cl({checks:[],typeName:lr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function Mwe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var rd=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.number,received:h.parsedType}),vr}let a,i=new ka;for(let h of this._def.checks)h.kind==="int"?si.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?Mwe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_finite,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ir.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ir.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ir.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ir.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&si.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:lr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.bigint,received:h.parsedType}),vr}let a,i=new ka;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:lr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Pr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.boolean,received:a.parsedType}),vr}return La(e.data)}};nd.create=t=>new nd({typeName:lr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.date,received:h.parsedType}),vr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_date}),vr}let a=new ka,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):si.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ir.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ir.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:lr.ZodDate,...Br(t)});var w1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.symbol){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.symbol,received:a.parsedType}),vr}return La(e.data)}};w1.create=t=>new w1({typeName:lr.ZodSymbol,...Br(t)});var od=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.undefined,received:a.parsedType}),vr}return La(e.data)}};od.create=t=>new od({typeName:lr.ZodUndefined,...Br(t)});var sd=class extends Pr{_parse(e){if(this._getType(e)!==Yt.null){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.null,received:a.parsedType}),vr}return La(e.data)}};sd.create=t=>new sd({typeName:lr.ZodNull,...Br(t)});var ll=class extends Pr{constructor(){super(...arguments),this._any=!0}_parse(e){return La(e.data)}};ll.create=t=>new ll({typeName:lr.ZodAny,...Br(t)});var Nh=class extends Pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return La(e.data)}};Nh.create=t=>new Nh({typeName:lr.ZodUnknown,...Br(t)});var Rf=class extends Pr{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Pt.invalid_type,expected:Yt.never,received:r.parsedType}),vr}};Rf.create=t=>new Rf({typeName:lr.ZodNever,...Br(t)});var _1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.void,received:a.parsedType}),vr}return La(e.data)}};_1.create=t=>new _1({typeName:lr.ZodVoid,...Br(t)});var Ch=class t extends Pr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Pt.invalid_type,expected:Yt.array,received:r.parsedType}),vr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Wt(r,{code:c?Pt.too_big:Pt.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new Os(r,c,r.path,p)))).then(c=>ka.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new Os(r,c,r.path,p)));return ka.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ir.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ir.toString(r)}})}nonempty(e){return this.min(1,e)}};Ch.create=(t,e)=>new Ch({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lr.ZodArray,...Br(e)});function g1(t){if(t instanceof oo){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Ps.create(g1(a))}return new oo({...t._def,shape:()=>e})}else return t instanceof Ch?new Ch({...t._def,type:g1(t.element)}):t instanceof Ps?Ps.create(g1(t.unwrap())):t instanceof Pu?Pu.create(g1(t.unwrap())):t instanceof Bu?Bu.create(t.items.map(e=>g1(e))):t}var oo=class t extends Pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=si.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Pt.invalid_type,expected:Yt.object,received:g.parsedType}),vr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof Rf&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||p.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new Os(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Rf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Wt(i,{code:Pt.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new Os(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>ka.mergeObjectSync(a,g)):ka.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return ir.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=ir.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return si.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return si.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return g1(this)}partial(e){let r={};return si.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return si.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Ps;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return tQ(si.objectKeys(this.shape))}};oo.create=(t,e)=>new oo({shape:()=>t,unknownKeys:"strip",catchall:Rf.create(),typeName:lr.ZodObject,...Br(e)});oo.strictCreate=(t,e)=>new oo({shape:()=>t,unknownKeys:"strict",catchall:Rf.create(),typeName:lr.ZodObject,...Br(e)});oo.lazycreate=(t,e)=>new oo({shape:t,unknownKeys:"strip",catchall:Rf.create(),typeName:lr.ZodObject,...Br(e)});var fd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let p of h)if(p.result.status==="valid")return p.result;for(let p of h)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let c=h.map(p=>new Po(p.ctx.common.issues));return Wt(r,{code:Pt.invalid_union,unionErrors:c}),vr}if(r.common.async)return Promise.all(a.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let p=c.map(b=>new Po(b));return Wt(r,{code:Pt.invalid_union,unionErrors:p}),vr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:lr.ZodUnion,...Br(e)});var Oh=t=>t instanceof hd?Oh(t.schema):t instanceof Oo?Oh(t.innerType()):t instanceof cd?[t.value]:t instanceof ld?t.options:t instanceof dd?si.objectValues(t.enum):t instanceof pd?Oh(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Ps?[void 0,...Oh(t.unwrap())]:t instanceof Pu?[null,...Oh(t.unwrap())]:t instanceof Og||t instanceof md?Oh(t.unwrap()):t instanceof vd?Oh(t._def.innerType):[],N8=class t extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Pt.invalid_type,expected:Yt.object,received:r.parsedType}),vr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),vr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Oh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new t({typeName:lr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(a)})}};function gT(t,e){let r=hl(t),a=hl(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&a===Yt.object){let i=si.objectKeys(e),h=si.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=gT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Yt.array&&a===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=gT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&a===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,c)=>{if(vT(h)||vT(c))return vr;let p=gT(h.value,c.value);return p.valid?((mT(h)||mT(c))&&r.dirty(),{status:r.value,value:p.data}):(Wt(a,{code:Pt.invalid_intersection_types}),vr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:lr.ZodIntersection,...Br(r)});var Bu=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.array)return Wt(a,{code:Pt.invalid_type,expected:Yt.array,received:a.parsedType}),vr;if(a.data.length<this._def.items.length)return Wt(a,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vr;!this._def.rest&&a.data.length>this._def.items.length&&(Wt(a,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new Os(a,c,a.path,p)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>ka.mergeArray(r,c)):ka.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Bu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bu({items:t,typeName:lr.ZodTuple,rest:null,...Br(e)})};var C8=class t extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.object)return Wt(a,{code:Pt.invalid_type,expected:Yt.object,received:a.parsedType}),vr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Os(a,p,a.path,p)),value:c._parse(new Os(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?ka.mergeObjectAsync(r,i):ka.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Pr?new t({keyType:e,valueType:r,typeName:lr.ZodRecord,...Br(a)}):new t({keyType:cl.create(),valueType:e,typeName:lr.ZodRecord,...Br(r)})}},M1=class extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.map)return Wt(a,{code:Pt.invalid_type,expected:Yt.map,received:a.parsedType}),vr;let i=this._def.keyType,h=this._def.valueType,c=[...a.data.entries()].map(([p,b],g)=>({key:i._parse(new Os(a,p,a.path,[g,"key"])),value:h._parse(new Os(a,b,a.path,[g,"value"]))}));if(a.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let b of c){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}}}};M1.create=(t,e,r)=>new M1({valueType:e,keyType:t,typeName:lr.ZodMap,...Br(r)});var x1=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.set)return Wt(a,{code:Pt.invalid_type,expected:Yt.set,received:a.parsedType}),vr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Wt(a,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Wt(a,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return vr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Os(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ir.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};x1.create=(t,e)=>new x1({valueType:t,minSize:null,maxSize:null,typeName:lr.ZodSet,...Br(e)});var L8=class t extends Pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Pt.invalid_type,expected:Yt.function,received:r.parsedType}),vr;function a(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),y1].filter(g=>!!g),issueData:{code:Pt.invalid_arguments,argumentsError:b}})}function i(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),y1].filter(g=>!!g),issueData:{code:Pt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof dl){let p=this;return La(async function(...b){let g=new Po([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return La(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Po([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Po([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Bu.create(e).rest(Nh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Bu.create([]).rest(Nh.create()),returns:r||Nh.create(),typeName:lr.ZodFunction,...Br(a)})}},hd=class extends Pr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:lr.ZodLazy,...Br(e)});var cd=class extends Pr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Pt.invalid_literal,expected:this._def.value}),vr}return{status:"valid",value:e.data}}get value(){return this._def.value}};cd.create=(t,e)=>new cd({value:t,typeName:lr.ZodLiteral,...Br(e)});function tQ(t,e){return new ld({values:t,typeName:lr.ZodEnum,...Br(e)})}var ld=class t extends Pr{constructor(){super(...arguments),Ig.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{expected:si.joinValues(a),received:r.parsedType,code:Pt.invalid_type}),vr}if(O8(this,Ig,"f")||JX(this,Ig,new Set(this._def.values),"f"),!O8(this,Ig,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{received:r.data,code:Pt.invalid_enum_value,options:a}),vr}return La(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};Ig=new WeakMap;ld.create=tQ;var dd=class extends Pr{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=si.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Yt.string&&a.parsedType!==Yt.number){let i=si.objectValues(r);return Wt(a,{expected:si.joinValues(i),received:a.parsedType,code:Pt.invalid_type}),vr}if(O8(this,kg,"f")||JX(this,kg,new Set(si.getValidEnumValues(this._def.values)),"f"),!O8(this,kg,"f").has(e.data)){let i=si.objectValues(r);return Wt(a,{received:a.data,code:Pt.invalid_enum_value,options:i}),vr}return La(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:lr.ZodNativeEnum,...Br(e)});var dl=class extends Pr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Pt.invalid_type,expected:Yt.promise,received:r.parsedType}),vr;let a=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return La(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dl.create=(t,e)=>new dl({type:t,typeName:lr.ZodPromise,...Br(e)});var Oo=class extends Pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Wt(a,c),c.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(a.data,h);if(a.common.async)return Promise.resolve(c).then(async p=>{if(r.value==="aborted")return vr;let b=await this._def.schema._parseAsync({data:p,path:a.path,parent:a});return b.status==="aborted"?vr:b.status==="dirty"||r.value==="dirty"?b1(b.value):b});{if(r.value==="aborted")return vr;let p=this._def.schema._parseSync({data:c,path:a.path,parent:a});return p.status==="aborted"?vr:p.status==="dirty"||r.value==="dirty"?b1(p.value):p}}if(i.type==="refinement"){let c=p=>{let b=i.refinement(p,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(a.common.async===!1){let p=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return p.status==="aborted"?vr:(p.status==="dirty"&&r.dirty(),c(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(p=>p.status==="aborted"?vr:(p.status==="dirty"&&r.dirty(),c(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Bg(c))return c;let p=i.transform(c.value,h);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>Bg(c)?Promise.resolve(i.transform(c.value,h)).then(p=>({status:r.value,value:p})):c);si.assertNever(i)}};Oo.create=(t,e,r)=>new Oo({schema:t,typeName:lr.ZodEffects,effect:e,...Br(r)});Oo.createWithPreprocess=(t,e,r)=>new Oo({schema:e,effect:{type:"preprocess",transform:t},typeName:lr.ZodEffects,...Br(r)});var Ps=class extends Pr{_parse(e){return this._getType(e)===Yt.undefined?La(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ps.create=(t,e)=>new Ps({innerType:t,typeName:lr.ZodOptional,...Br(e)});var Pu=class extends Pr{_parse(e){return this._getType(e)===Yt.null?La(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pu.create=(t,e)=>new Pu({innerType:t,typeName:lr.ZodNullable,...Br(e)});var pd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Yt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:lr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Pg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Po(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Po(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:lr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var S1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.nan){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.nan,received:a.parsedType}),vr}return{status:"valid",value:e.data}}};S1.create=t=>new S1({typeName:lr.ZodNaN,...Br(t)});var xwe=Symbol("zod_brand"),Og=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Ng=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?vr:h.status==="dirty"?(r.dirty(),b1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?vr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:lr.ZodPipeline})}},md=class extends Pr{_parse(e){let r=this._def.innerType._parse(e),a=i=>(Bg(i)&&(i.value=Object.freeze(i.value)),i);return Pg(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:lr.ZodReadonly,...Br(e)});function rQ(t,e={},r){return t?ll.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):ll.create()}var Swe={object:oo.lazycreate},lr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lr||(lr={}));var Ewe=(t,e={message:`Input not instance of ${t.name}`})=>rQ(r=>r instanceof t,e),iQ=cl.create,nQ=rd.create,Awe=S1.create,Rwe=id.create,aQ=nd.create,Twe=ad.create,Iwe=w1.create,kwe=od.create,Bwe=sd.create,Pwe=ll.create,Owe=Nh.create,Nwe=Rf.create,Cwe=_1.create,Lwe=Ch.create,Dwe=oo.create,$we=oo.strictCreate,qwe=fd.create,Uwe=N8.create,Fwe=ud.create,jwe=Bu.create,zwe=C8.create,Zwe=M1.create,Hwe=x1.create,Kwe=L8.create,Wwe=hd.create,Vwe=cd.create,Gwe=ld.create,Ywe=dd.create,Jwe=dl.create,GX=Oo.create,Xwe=Ps.create,Qwe=Pu.create,e5e=Oo.createWithPreprocess,t5e=Ng.create,r5e=()=>iQ().optional(),i5e=()=>nQ().optional(),n5e=()=>aQ().optional(),a5e={string:t=>cl.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},o5e=vr,Qt=Object.freeze({__proto__:null,defaultErrorMap:y1,setErrorMap:owe,getErrorMap:B8,makeIssue:P8,EMPTY_PATH:swe,addIssueToContext:Wt,ParseStatus:ka,INVALID:vr,DIRTY:b1,OK:La,isAborted:vT,isDirty:mT,isValid:Bg,isAsync:Pg,get util(){return si},get objectUtil(){return pT},ZodParsedType:Yt,getParsedType:hl,ZodType:Pr,datetimeRegex:eQ,ZodString:cl,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:w1,ZodUndefined:od,ZodNull:sd,ZodAny:ll,ZodUnknown:Nh,ZodNever:Rf,ZodVoid:_1,ZodArray:Ch,ZodObject:oo,ZodUnion:fd,ZodDiscriminatedUnion:N8,ZodIntersection:ud,ZodTuple:Bu,ZodRecord:C8,ZodMap:M1,ZodSet:x1,ZodFunction:L8,ZodLazy:hd,ZodLiteral:cd,ZodEnum:ld,ZodNativeEnum:dd,ZodPromise:dl,ZodEffects:Oo,ZodTransformer:Oo,ZodOptional:Ps,ZodNullable:Pu,ZodDefault:pd,ZodCatch:vd,ZodNaN:S1,BRAND:xwe,ZodBranded:Og,ZodPipeline:Ng,ZodReadonly:md,custom:rQ,Schema:Pr,ZodSchema:Pr,late:Swe,get ZodFirstPartyTypeKind(){return lr},coerce:a5e,any:Pwe,array:Lwe,bigint:Rwe,boolean:aQ,date:Twe,discriminatedUnion:Uwe,effect:GX,enum:Gwe,function:Kwe,instanceof:Ewe,intersection:Fwe,lazy:Wwe,literal:Vwe,map:Zwe,nan:Awe,nativeEnum:Ywe,never:Nwe,null:Bwe,nullable:Qwe,number:nQ,object:Dwe,oboolean:n5e,onumber:i5e,optional:Xwe,ostring:r5e,pipeline:t5e,preprocess:e5e,promise:Jwe,record:zwe,set:Hwe,strictObject:$we,string:iQ,symbol:Iwe,transformer:GX,tuple:jwe,undefined:kwe,union:qwe,unknown:Owe,void:Cwe,NEVER:o5e,ZodIssueCode:Pt,quotelessJson:awe,ZodError:Po});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),jft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),zft=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),Zft=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",Hft="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",s5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",Kft=s5e,Lh="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",$8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",bT=1e6,oQ="4uMwpOuU-YF9pKbqC73tmMCf2OLFUY8U0gCWEUCy-4M",sQ="s9drxRd-ylbJVtAi14tGmF7e42kA69PgfKUtgtmvAmU",fQ="fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY",uQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var gd=Qt.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),hQ=Qt.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),f5e=Qt.string(),lQ=Qt.array(Qt.string()),q8=Qt.object({transactionId:gd.describe("The Target ID of the undername"),ttlSeconds:Qt.number(),priority:Qt.number().optional()}),yT=Qt.record(Qt.string(),q8),wT=Qt.array(gd.describe("Controller address")),_T=Qt.record(gd.describe("Holder address"),Qt.number()),MT=Qt.object({Name:Qt.string().describe("The name of the ANT."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),Description:Qt.string().describe("The description for the ANT."),Keywords:lQ.describe("The keywords for the ANT."),Denomination:Qt.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:gd.describe("The Owners address."),Controllers:wT.describe("Controllers of the ANT who have administrative privileges."),Records:yT.describe("Records associated with the ANT."),Balances:_T.describe("Balance details for each address holding the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),TotalSupply:Qt.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:Qt.boolean().describe("Flag indicating whether the ANT has been initialized.")}),u5e=["balance","balances","totalSupply","info","controllers","record","records","state"],h5e=["_eval","_default","transfer","addController","removeController","setRecord","removeRecord","setName","setTicker","setDescription","setKeywords","setLogo","initializeState","releaseName","reassignName","approvePrimaryName","removePrimaryNames"],c5e=[...u5e,...h5e],cQ=Qt.array(Qt.string({description:"Handler Name"})).refine(t=>c5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),dQ=Qt.object({Name:Qt.string().describe("The name of the ANT."),Owner:gd.describe("The Owners address."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),"Total-Supply":hQ.describe("Total supply of the ANT in circulation."),Description:f5e.describe("The description for the ANT."),Keywords:lQ.describe("The keywords for the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),Denomination:hQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:cQ.optional().describe("List of handlers for the ANT."),HandlerNames:cQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function Qft(t){return MT.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var l5e=Object.create,iI=Object.defineProperty,d5e=Object.getOwnPropertyDescriptor,qQ=Object.getOwnPropertyNames,p5e=Object.getPrototypeOf,v5e=Object.prototype.hasOwnProperty,No=(t,e)=>function(){return e||(0,t[qQ(t)[0]])((e={exports:{}}).exports,e),e.exports},UQ=(t,e)=>{for(var r in e)iI(t,r,{get:e[r],enumerable:!0})},m5e=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qQ(e))!v5e.call(t,i)&&i!==r&&iI(t,i,{get:()=>e[i],enumerable:!(a=d5e(e,i))||a.enumerable});return t},nI=(t,e,r)=>(r=t!=null?l5e(p5e(t)):{},m5e(e||!t||!t.__esModule?iI(r,"default",{value:t,enumerable:!0}):r,t)),g5e=No({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),b5e=No({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),aI=No({"node_modules/obliterator/foreach.js"(t,e){var r=b5e(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,p){var b,g,y,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof p!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||a&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,M=c.length;y<M;y++)p(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(p);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,y=0;x=b.next(),x.done!==!0;)p(x.value,y),y++;return}for(g in c)c.hasOwnProperty(g)&&p(c[g],g)}}}),oI=No({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var p={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,I,P;for(I=0,P=b.length;I<P;I++)A=g?g(b[I]):b[I],E=t.getNumberType(A),x=p[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),FQ=No({"node_modules/mnemonist/utils/iterables.js"(t){var e=aI(),r=oI();function a(p){return Array.isArray(p)||r.isTypedArray(p)}function i(p){if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size}function h(p){var b=i(p),g=typeof b=="number"?new Array(b):[],y=0;return e(p,function(M){g[y++]=M}),g}function c(p){var b=i(p),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(p,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),y5e=No({"node_modules/mnemonist/lru-cache.js"(t,e){var r=g5e(),a=aI(),i=oI(),h=FQ();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(p){var b=this.head;if(this.head===p)return this;var g=this.backward[p],y=this.forward[p];return this.tail===p?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=p,this.head=p,this.forward[p]=b,this},c.prototype.set=function(p,b){var g=this.items[p];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[p]=g,this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items[p];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[p]=M,this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return p in this.items},c.prototype.get=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(p,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)p.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var p=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(p>=b)return{done:!0};var E=y[g],A=M[g];return p++,p<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var p=new Map,b=this.entries(),g;g=b.next(),!g.done;)p.set(g.value[0],g.value[1]);return Object.defineProperty(p,"constructor",{value:c,enumerable:!1}),p},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),w5e=No({"node_modules/mnemonist/lru-map.js"(t,e){var r=y5e(),a=aI(),i=oI(),h=FQ();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(p,b){var g=this.items.get(p);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(p,g),this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items.get(p);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(p,M),this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return this.items.has(p)},c.prototype.get=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),_5e=No({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,c=h*7,p=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),I=(E[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return A*p;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,I){var P=E>=A*1.5;return Math.round(x/A)+" "+I+(P?"s":"")}}}),M5e=No({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=p,h.enabled=g,h.humanize=_5e(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let I=0;I<E.length;I++)A=(A<<5)-A+E.charCodeAt(I),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,I=null,P,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ee=G-(A||G);Y.diff=ee,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let D=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";D++;let n=h.formatters[_];if(typeof n=="function"){let s=C[D];V=n.call(Y,s),C.splice(D,1),D--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>I!==null?I:(P!==h.namespaces&&(P=h.namespaces,N=h.enabled(E)),N),set:C=>{I=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let I=h(this.namespace+(typeof A>"u"?":":A)+E);return I.log=this.log,I}function p(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,I=(typeof E=="string"?E:"").split(/[\s,]+/),P=I.length;for(A=0;A<P;A++)I[A]&&(E=I[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,I;for(A=0,I=h.skips.length;A<I;A++)if(h.skips[A].test(E))return!1;for(A=0,I=h.names.length;A<I;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),x5e=No({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=M5e()(t);var{formatters:p}=e.exports;p.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),S5e=No({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=p(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function y(A){var I,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)I=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}}),E5e=No({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=I,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=I,p/=256,y-=8);e[a+A-I]|=P*128}}}),A5e=No({"node_modules/buffer/index.js"(t){"use strict";var e=S5e(),r=E5e(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,p.prototype),k}function p(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}p.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}p.alloc=function(T,k,O){return y(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!p.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==p.prototype},p.compare=function(k,O){if(ut(k,Uint8Array)&&(k=p.from(k,k.offset,k.byteLength)),ut(O,Uint8Array)&&(O=p.from(O,O.offset,O.byteLength)),!p.isBuffer(k)||!p.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===O)return 0;let q=k.length,H=O.length;for(let W=0,fe=Math.min(q,H);W<fe;++W)if(k[W]!==O[W]){q=k[W],H=O[W];break}return q<H?-1:H<q?1:0},p.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(k,O){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return p.alloc(0);let q;if(O===void 0)for(O=0,q=0;q<k.length;++q)O+=k[q].length;let H=p.allocUnsafe(O),W=0;for(q=0;q<k.length;++q){let fe=k[q];if(ut(fe,Uint8Array))W+fe.length>H.length?(p.isBuffer(fe)||(fe=p.from(fe)),fe.copy(H,W)):Uint8Array.prototype.set.call(H,fe,W);else if(p.isBuffer(fe))fe.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return H};function C(T,k){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return w(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}p.prototype.swap16=function(){let k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<k;O+=2)G(this,O,O+1);return this},p.prototype.swap32=function(){let k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<k;O+=4)G(this,O,O+3),G(this,O+1,O+2);return this},p.prototype.swap64=function(){let k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<k;O+=8)G(this,O,O+7),G(this,O+1,O+6),G(this,O+2,O+5),G(this,O+3,O+4);return this},p.prototype.toString=function(){let k=this.length;return k===0?"":arguments.length===0?u(this,0,k):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(k){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:p.compare(this,k)===0},p.prototype.inspect=function(){let k="",O=t.INSPECT_MAX_BYTES;return k=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(k+=" ... "),"<Buffer "+k+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(k,O,q,H,W){if(ut(k,Uint8Array)&&(k=p.from(k,k.offset,k.byteLength)),!p.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(O===void 0&&(O=0),q===void 0&&(q=k?k.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),O<0||q>k.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&O>=q)return 0;if(H>=W)return-1;if(O>=q)return 1;if(O>>>=0,q>>>=0,H>>>=0,W>>>=0,this===k)return 0;let fe=W-H,st=q-O,ue=Math.min(fe,st),me=this.slice(H,W),pe=k.slice(O,q);for(let be=0;be<ue;++be)if(me[be]!==pe[be]){fe=me[be],st=pe[be];break}return fe<st?-1:st<fe?1:0};function ee(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=p.from(k,q)),p.isBuffer(k))return k.length===0?-1:D(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):D(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,k,O,q,H){let W=1,fe=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(k,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(k,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(k,O,q){return this.indexOf(k,O,q)!==-1},p.prototype.indexOf=function(k,O,q){return ee(this,k,O,q,!0)},p.prototype.lastIndexOf=function(k,O,q){return ee(this,k,O,q,!1)};function U(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(k.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,k,O,q){return Se(oe(k,T.length-O),T,O,q)}function _(T,k,O,q){return Se(le(k),T,O,q)}function n(T,k,O,q){return Se(ge(k),T,O,q)}function s(T,k,O,q){return Se(ot(k,T.length-O),T,O,q)}p.prototype.write=function(k,O,q,H){if(O===void 0)H="utf8",q=this.length,O=0;else if(q===void 0&&typeof O=="string")H=O,q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(q)?(q=q>>>0,H===void 0&&(H="utf8")):(H=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-O;if((q===void 0||q>W)&&(q=W),k.length>0&&(q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let fe=!1;for(;;)switch(H){case"hex":return U(this,k,O,q);case"utf8":case"utf-8":return V(this,k,O,q);case"ascii":case"latin1":case"binary":return _(this,k,O,q);case"base64":return n(this,k,O,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,k,O,q);default:if(fe)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),fe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function w(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function v(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(k,O){let q=this.length;k=~~k,O=O===void 0?q:~~O,k<0?(k+=q,k<0&&(k=0)):k>q&&(k=q),O<0?(O+=q,O<0&&(O=0)):O>q&&(O=q),O<k&&(O=k);let H=this.subarray(k,O);return Object.setPrototypeOf(H,p.prototype),H};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[k+fe]*W;return H},p.prototype.readUintBE=p.prototype.readUIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k+--O],W=1;for(;O>0&&(W*=256);)H+=this[k+--O]*W;return H},p.prototype.readUint8=p.prototype.readUInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]|this[k+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]<<8|this[k+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},p.prototype.readBigUInt64LE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,W=this[++k]+this[++k]*2**8+this[++k]*2**16+q*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],W=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q;return(BigInt(H)<<BigInt(32))+BigInt(W)}),p.prototype.readIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[k+fe]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*O)),H},p.prototype.readIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=O,W=1,fe=this[k+--H];for(;H>0&&(W*=256);)fe+=this[k+--H]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*O)),fe},p.prototype.readInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},p.prototype.readInt16LE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k]|this[k+1]<<8;return q&32768?q|4294901760:q},p.prototype.readInt16BE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k+1]|this[k]<<8;return q&32768?q|4294901760:q},p.prototype.readInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},p.prototype.readInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},p.prototype.readBigInt64LE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(q<<24);return(BigInt(H)<<BigInt(32))+BigInt(O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),p.prototype.readBigInt64BE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=(O<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(H)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q)}),p.prototype.readFloatLE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!0,23,4)},p.prototype.readFloatBE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!1,23,4)},p.prototype.readDoubleLE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!0,52,8)},p.prototype.readDoubleBE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!1,52,8)};function S(T,k,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=1,fe=0;for(this[O]=k&255;++fe<q&&(W*=256);)this[O+fe]=k/W&255;return O+q},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=q-1,fe=1;for(this[O+W]=k&255;--W>=0&&(fe*=256);)this[O+W]=k/fe&255;return O+q},p.prototype.writeUint8=p.prototype.writeUInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,255,0),this[O]=k&255,O+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k&255,this[O+1]=k>>>8,O+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k>>>8,this[O+1]=k&255,O+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O+3]=k>>>24,this[O+2]=k>>>16,this[O+1]=k>>>8,this[O]=k&255,O+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=ct(function(k,O=0){return B(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(k,O=0){return F(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=0,fe=1,st=0;for(this[O]=k&255;++W<q&&(fe*=256);)k<0&&st===0&&this[O+W-1]!==0&&(st=1),this[O+W]=(k/fe>>0)-st&255;return O+q},p.prototype.writeIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=q-1,fe=1,st=0;for(this[O+W]=k&255;--W>=0&&(fe*=256);)k<0&&st===0&&this[O+W+1]!==0&&(st=1),this[O+W]=(k/fe>>0)-st&255;return O+q},p.prototype.writeInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,127,-128),k<0&&(k=255+k+1),this[O]=k&255,O+1},p.prototype.writeInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k&255,this[O+1]=k>>>8,O+2},p.prototype.writeInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k>>>8,this[O+1]=k&255,O+2},p.prototype.writeInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),this[O]=k&255,this[O+1]=k>>>8,this[O+2]=k>>>16,this[O+3]=k>>>24,O+4},p.prototype.writeInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4},p.prototype.writeBigInt64LE=ct(function(k,O=0){return B(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(k,O=0){return F(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}p.prototype.writeFloatLE=function(k,O,q){return re(this,k,O,!0,q)},p.prototype.writeFloatBE=function(k,O,q){return re(this,k,O,!1,q)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(k,O,q){return Q(this,k,O,!0,q)},p.prototype.writeDoubleBE=function(k,O,q){return Q(this,k,O,!1,q)},p.prototype.copy=function(k,O,q,H){if(!p.isBuffer(k))throw new TypeError("argument should be a Buffer");if(q||(q=0),!H&&H!==0&&(H=this.length),O>=k.length&&(O=k.length),O||(O=0),H>0&&H<q&&(H=q),H===q||k.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),k.length-O<H-q&&(H=k.length-O+q);let W=H-q;return this===k&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,q,H):Uint8Array.prototype.set.call(k,this.subarray(q,H),O),W},p.prototype.fill=function(k,O,q,H){if(typeof k=="string"){if(typeof O=="string"?(H=O,O=0,q=this.length):typeof q=="string"&&(H=q,q=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!p.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(k.length===1){let fe=k.charCodeAt(0);(H==="utf8"&&fe<128||H==="latin1")&&(k=fe)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(O<0||this.length<O||this.length<q)throw new RangeError("Out of range index");if(q<=O)return this;O=O>>>0,q=q===void 0?this.length:q>>>0,k||(k=0);let W;if(typeof k=="number")for(W=O;W<q;++W)this[W]=k;else{let fe=p.isBuffer(k)?k:p.from(k,H),st=fe.length;if(st===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(W=0;W<q-O;++W)this[W+O]=fe[W%st]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function te(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let fe=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${k}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((k-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),R5e={"@@functional/placeholder":!0};function Vi(t){return t===R5e}function Da(t){return function e(r){return arguments.length===0||Vi(r)?e:t.apply(this,arguments)}}function $n(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:Da(function(i){return t(r,i)});default:return Vi(r)&&Vi(a)?e:Vi(r)?Da(function(i){return t(i,a)}):Vi(a)?Da(function(i){return t(r,i)}):t(r,a)}}}function m4(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function jQ(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,p=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Vi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Vi(b)?p=!0:h-=1,c+=1}return!p&&h<=0?r.apply(this,a):m4(Math.max(0,h),jQ(t,a,r))}}var T5e=$n(function(t,e){return t===1?Da(e):m4(t,jQ(t,[],e))}),zQ=T5e;function sI(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:$n(function(h,c){return t(r,h,c)});case 2:return Vi(r)&&Vi(a)?e:Vi(r)?$n(function(h,c){return t(h,a,c)}):Vi(a)?$n(function(h,c){return t(r,h,c)}):Da(function(h){return t(r,a,h)});default:return Vi(r)&&Vi(a)&&Vi(i)?e:Vi(r)&&Vi(a)?$n(function(h,c){return t(h,c,i)}):Vi(r)&&Vi(i)?$n(function(h,c){return t(h,a,c)}):Vi(a)&&Vi(i)?$n(function(h,c){return t(r,h,c)}):Vi(r)?Da(function(h){return t(h,a,i)}):Vi(a)?Da(function(h){return t(r,h,i)}):Vi(i)?Da(function(h){return t(r,a,h)}):t(r,a,i)}}}var fI=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function I5e(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function uI(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!fI(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(I5e(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function k5e(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var Vg={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function pQ(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function vQ(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function B5e(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function K8(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function P5e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var xT=typeof Object.is=="function"?Object.is:P5e,mQ=Object.prototype.toString,O5e=function(){return mQ.call(arguments)==="[object Arguments]"?function(t){return mQ.call(t)==="[object Arguments]"}:function(t){return K8("callee",t)}}(),N5e=O5e,C5e=!{toString:null}.propertyIsEnumerable("toString"),gQ=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],bQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),L5e=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},D5e=Da(typeof Object.keys=="function"&&!bQ?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=bQ&&N5e(t);for(e in t)K8(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(C5e)for(r=gQ.length-1;r>=0;)e=gQ[r],K8(e,t)&&!L5e(a,e)&&(a[a.length]=e),r-=1;return a}),P1=D5e,$5e=Da(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),yQ=$5e;function wQ(t,e,r,a){var i=pQ(t),h=pQ(e);function c(p,b){return hI(p,b,r.slice(),a.slice())}return!vQ(function(p,b){return!vQ(c,b,p)},h,i)}function hI(t,e,r,a){if(xT(t,e))return!0;var i=yQ(t);if(i!==yQ(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&B5e(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&xT(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!xT(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:wQ(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:wQ(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=P1(t);if(c.length!==P1(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(K8(g,e)&&hI(e[g],t[g],p,b)))return!1;h-=1}return!0}var q5e=$n(function(t,e){return hI(t,e,[],[])}),ZQ=q5e;function U5e(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(ZQ(t[r],e))return r;r+=1}return-1}function F5e(t,e){return U5e(e,t,0)>=0}function Kg(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function ST(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var Cg=function(t){return(t<10?"0":"")+t},j5e=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+Cg(t.getUTCMonth()+1)+"-"+Cg(t.getUTCDate())+"T"+Cg(t.getUTCHours())+":"+Cg(t.getUTCMinutes())+":"+Cg(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},z5e=j5e;function Z5e(t){return function(){return!t.apply(this,arguments)}}function HQ(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function H5e(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function K5e(t){return Object.prototype.toString.call(t)==="[object Object]"}var W5e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function V5e(t){return function(e){return new W5e(t,e)}}var G5e=$n(uI(["fantasy-land/filter","filter"],V5e,function(t,e){return K5e(e)?HQ(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},P1(e)):H5e(t,e)})),Y5e=G5e,J5e=$n(function(t,e){return Y5e(Z5e(t),e)}),X5e=J5e;function KQ(t,e){var r=function(h){var c=e.concat([t]);return F5e(h,c)?"<Circular>":KQ(h,c)},a=function(h,c){return Kg(function(p){return ST(p)+": "+r(h[p])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Kg(r,t).join(", ")+"))";case"[object Array]":return"["+Kg(r,t).concat(a(t,X5e(function(h){return/^\d+$/.test(h)},P1(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):ST(z5e(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":ST(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,P1(t)).join(", ")+"}"}}var Q5e=Da(function(t){return KQ(t,[])}),_Q=Q5e,e7e=$n(function(t,e){if(t===e)return e;function r(p,b){if(p>b!=b>p)return b>p?b:p}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=_Q(t),c=r(h,_Q(e));return c!==void 0&&c===h?t:e}),t7e=e7e,r7e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),i7e=function(t){return function(e){return new r7e(t,e)}},n7e=i7e,a7e=$n(uI(["fantasy-land/map","map"],n7e,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return zQ(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return HQ(function(r,a){return r[a]=t(e[a]),r},{},P1(e));default:return Kg(t,e)}})),o7e=a7e,WQ=Number.isInteger||function(t){return t<<0===t};function VQ(t){return Object.prototype.toString.call(t)==="[object String]"}function GQ(t,e){var r=t<0?e.length+t:t;return VQ(e)?e.charAt(r):e[r]}var s7e=$n(function(t,e){if(e!=null)return WQ(t)?GQ(t,e):e[t]}),g4=s7e,f7e=$n(function(t,e){return o7e(g4(t),e)}),u7e=f7e,h7e=Da(function(t){return fI(t)?!0:!t||typeof t!="object"||VQ(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),c7e=h7e,MQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function l7e(t,e,r){return function(a,i,h){if(c7e(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[MQ]!=null)return r(a,i,h[MQ]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function d7e(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var p7e=$n(function(t,e){return m4(t.length,function(){return t.apply(e,arguments)})}),v7e=p7e;function m7e(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function g7e(t,e,r,a){return t["@@transducer/result"](r[a](v7e(t["@@transducer/step"],t),e))}var b7e=l7e(d7e,g7e,m7e),y7e=b7e,w7e=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function _7e(t){return new w7e(t)}var M7e=sI(function(t,e,r){return y7e(typeof t=="function"?_7e(t):t,e,r)}),YQ=M7e;function x7e(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function JQ(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return fI(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var S7e=sI(JQ("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),E7e=S7e,A7e=Da(JQ("tail",E7e(1,1/0))),R7e=A7e;function XQ(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return m4(arguments[0].length,YQ(x7e,arguments[0],R7e(arguments)))}var T7e=$n(function(t,e){return zQ(YQ(t7e,0,u7e("length",e)),function(){var r=arguments,a=this;return t.apply(a,Kg(function(i){return i.apply(a,r)},e))})}),I7e=T7e,k7e=$n(function(t,e){return e==null||e!==e?t:e}),PT=k7e,B7e=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=k5e(this.xf["@@transducer/step"](e,r))),e},t}();function P7e(t){return function(e){return new B7e(t,e)}}var O7e=$n(uI(["find"],P7e,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),N7e=O7e,C7e=Da(function(t){return I7e(function(){return Array.prototype.slice.call(arguments,0)},t)}),L7e=C7e;function D7e(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];WQ(i)?r=GQ(i,r):r=r[i]}return r}var $7e=$n(D7e),QQ=$7e,q7e=sI(function(t,e,r){return ZQ(t,g4(e,r))}),U7e=q7e,W8=class extends Error{name="InvalidSchedulerLocation"},F7e=class extends Error{name="SchedulerTagNotFound"},j7e=class extends Error{name="TransactionNotFound"},z7e="Url",Z7e="Time-To-Live",H7e="Scheduler",OT=t=>XQ(PT([]),N7e(U7e(t,"name")),PT({}),g4("value")),eee=t=>XQ(e=>{if(!e)throw new j7e(t);return e},g4("tags"),PT([]));function tee({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function K7e({fetch:t,GRAPHQL_URL:e}){let r=tee({fetch:t,GRAPHQL_URL:e}),a=ree({fetch:t,GRAPHQL_URL:e}),i=`
|
|
134
|
+
nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength=Kr[wr.MULTIAPTOS].pubLength;signatureLength=Kr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let p=Me.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&p.set(r[b++],g*64);return p.set(h,this.signatureLength-4),p}static async verify(e,r,a){let h=Kr[wr.MULTIAPTOS].sigLength-4,c=a.slice(0,h),p=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((p[y]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await Dc(Me.from(E),Me.from(r),Me.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Bo{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+dg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new t1(e)}get publicKey(){return Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},yg={name:"Bundlr",version:"1"},wg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var nT=class{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var qX=mi(Uo(),1);var ul=class{signer;publicKey;ownerLength=Kr[wr.ARWEAVE].pubLength;signatureLength=Kr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=qX.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await Mn().verify(e,r,a)}};ie();ae();ne();var _g=class extends Bo{signatureType=wr.KYVE};var Mg={1:zc,2:So,3:Bo,4:J0,5:X0,6:Q0,7:ed};ie();ae();ne();ie();ae();ne();async function Y4e(t){return $c([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var xg=Y4e;ie();ae();ne();ie();ae();ne();function Sg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function S8(t){return Sg(8,t)}function aT(t){return Sg(2,t)}function J4e(t){return Sg(16,t)}function E8(t){return Sg(32,t)}function bn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Ag=mi(Uo(),1);ie();ae();ne();var Bs=mi(Uo(),1);lo();ie();ae();ne();var Eg=class{buf;pos;constructor(e=Me.alloc(A8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Me.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,p,b;for(h=0,c=r;h<c;h++)p=e.charCodeAt(h),p<128?a[i++]=p:p<2048?(a[i++]=p>>6|192,a[i++]=p&63|128):(p&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(p=65536+((p&1023)<<10)+(b&1023),h++,a[i++]=p>>18|240,a[i++]=p>>12&63|128,a[i++]=p>>6&63|128,a[i++]=p&63|128):(a[i++]=p>>12|224,a[i++]=p>>6&63|128,a[i++]=p&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,c,p;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,p=268435456;do i=a[this.pos++],c+=(i&127)*p,p*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function oT(t){if(t?.length===0)return Me.allocUnsafe(0);let e=new Eg;return e.writeTags(t),e.toBuffer()}function p1(t){return new Eg(t).readTags()}lu();var R8=80,A8=4096,v1=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=bn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return Bs.default.encode(this.rawId)}set id(e){this._id=Bs.default.toBuffer(e)}get rawId(){return df("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Bs.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Kr[this.signatureType].sigLength}get owner(){return Bs.default.encode(this.rawOwner)}get ownerLength(){return Kr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get target(){return Bs.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get anchor(){return Bs.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=bn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(bn(this.binary.subarray(e,e+8))==0)return[];let a=bn(this.binary.subarray(e+8,e+16));return p1(Me.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:Bs.default.encode(r.name),value:Bs.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=bn(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=bn(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return Bs.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await T8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Me.from(await Mn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:Bs.default.encode(e.name),value:Bs.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<R8)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=bn(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),p=bn(c);if(p>A8)return!1;if(h>0)try{if(p1(Me.from(e.subarray(i+16,i+16+p))).length!==h)return!1}catch{return!1}let b=Mg[a],g=await xg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return xg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},m1=v1;lu();var ku=32,I8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=ku;r<ku+64*this.length;r+=64)e.push(bn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=ku;r<ku+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Ag.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Ag.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,Ag.default)(df("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=ku;a<ku+64*this.length;a+=64){let i=bn(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(Me.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,c;for(let y=ku;y<ku+64*this.length;y+=64){if(h=bn(this.binary.subarray(y,y+32)),i++===e){c=this.binary.subarray(y+32,y+64);break}r+=h}let p=a+r,b=this.binary.subarray(p,p+h),g=new m1(b);return g.rawId=c,g}getById(e){let r=Ag.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new m1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return bn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=ku;h<ku+64*this.length;h+=64){let c=bn(this.binary.subarray(h,h+32)),p=this.binary.subarray(h+32,h+64);if(p.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+c);r+=c;let y=new m1(g);y.rawId=p,e[i]=y,i++}return e}},sT=I8;function X4e(t){return new sT(t)}async function Q4e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,c)=>{let p=h.isSigned()?h.rawId:await T8(h,e),b=new Uint8Array(64);return b.set(E8(h.getRaw().byteLength),0),b.set(p,32),r.set(b,64*c),h.getRaw()})).then(h=>Me.concat(h)),i=Me.concat([Me.from(E8(t.length)),Me.from(r),a]);return new sT(i)}async function UX(t,e){let r=await xg(t),a=await e.sign(r),i=await Mn().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function T8(t,e){let{signature:r,id:a}=await UX(t,e);return t.getRaw().set(r,2),a}ie();ae();ne();var FX=mi(Uo(),1);function Rg(t,e,r){let a=e.publicKey,i=r?.target?FX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?oT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?Me.from(t):Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(aT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set(S8(r?.tags?.length??0),P);let N=S8(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new m1(E)}ie();ae();ne();ie();ae();ne();var fT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var lT={};Ka(lT,{default:()=>rwe,processStream:()=>KX,streamExportForTesting:()=>iwe,streamSigner:()=>twe});ie();ae();ne();k8();var td=mi(Uo(),1);lu();async function KX(t){let e=WX(t),r=(await e.next()).value;r=await Ca(e,r,32);let a=bn(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await Ca(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[bn(r.subarray(b,b+32)),(0,td.default)(Me.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,p=[];for(let[b,g]of h){r=await Ca(e,r,R8),r=await Ca(e,r,2);let y=bn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Kr[y];r=await Ca(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await Ca(e,r,x);let I=r.subarray(0,x);r=r.subarray(x),r=await Ca(e,r,1);let P=r[0]===1;P&&(r=await Ca(e,r,33));let N=P?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(P?33:1),r=await Ca(e,r,1);let L=r[0]===1;L&&(r=await Ca(e,r,33));let C=L?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(L?33:1),r=await Ca(e,r,8);let Y=bn(r.subarray(0,8));r=r.subarray(8),r=await Ca(e,r,8);let G=bn(r.subarray(0,8));r=r.subarray(8),r=await Ca(e,r,G);let ee=r.subarray(0,G),D=Y!==0&&G!==0?p1(Me.from(ee)):[];if(D.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let U=new ZX;U._transform=function(f,u,l){this.push(f),l()};let V=$c([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(y.toString()),I,N,C,ee,U]),_=2+M+x+(P?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)U.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(U.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?U.write(r.subarray(0,r.byteLength-(f-n))):U.write(r)}r=r.subarray(r.byteLength-(f-n))}if(U.end(),g!==(0,td.default)(df("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await Mg[y].verify(I,await V,A))throw new Error("Invalid signature");p.push({id:g,sigName:E,signature:(0,td.default)(Me.from(A)),target:(0,td.default)(Me.from(N)),anchor:(0,td.default)(Me.from(C)),owner:(0,td.default)(Me.from(I)),tags:D,dataOffset:c+_,dataSize:n}),c+=_+n}return p}async function twe(t,e,r,a){let i=Rg("",r,a),h=new HX,c=[(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],p=await $c(c),b=Me.from(await r.sign(p));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function Ca(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return Ca(t,Me.concat([Me.from(e),Me.from(i)]),r)}async function*WX(t){for await(let e of t)yield e}var rwe=KX,iwe={readBytes:Ca,getReader:WX};var nwe={...uT,stream:lT};globalThis.arbundles??=nwe;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var si;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(si||(si={}));var pT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(pT||(pT={}));var Yt=si.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hl=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Pt=si.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),awe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Po=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,si.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Po.create=t=>new Po(t);var y1=(t,e)=>{let r;switch(t.code){case Pt.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Pt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,si.jsonStringifyReplacer)}`;break;case Pt.unrecognized_keys:r=`Unrecognized key(s) in object: ${si.joinValues(t.keys,", ")}`;break;case Pt.invalid_union:r="Invalid input";break;case Pt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${si.joinValues(t.options)}`;break;case Pt.invalid_enum_value:r=`Invalid enum value. Expected ${si.joinValues(t.options)}, received '${t.received}'`;break;case Pt.invalid_arguments:r="Invalid function arguments";break;case Pt.invalid_return_type:r="Invalid function return type";break;case Pt.invalid_date:r="Invalid date";break;case Pt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:si.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Pt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Pt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Pt.custom:r="Invalid input";break;case Pt.invalid_intersection_types:r="Intersection results could not be merged";break;case Pt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Pt.not_finite:r="Number must be finite";break;default:r=e.defaultError,si.assertNever(t)}return{message:r}},YX=y1;function owe(t){YX=t}function B8(){return YX}var P8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},swe=[];function Wt(t,e){let r=B8(),a=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===y1?void 0:y1].filter(i=>!!i)});t.common.issues.push(a)}var ka=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return vr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return vr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},vr=Object.freeze({status:"aborted"}),b1=t=>({status:"dirty",value:t}),La=t=>({status:"valid",value:t}),vT=t=>t.status==="aborted",mT=t=>t.status==="dirty",Bg=t=>t.status==="valid",Pg=t=>typeof Promise<"u"&&t instanceof Promise;function O8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function JX(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ir;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ir||(ir={}));var Ig,kg,Os=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},VX=(t,e)=>{if(Bg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Po(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,p)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:c.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Pr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return hl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ka,ctx:{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Pg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return VX(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(Pg(i)?i:Promise.resolve(i));return VX(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),p=()=>h.addIssue({code:Pt.custom,...a(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(p(),!1)):c?!0:(p(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new Oo({schema:this,typeName:lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ps.create(this,this._def)}nullable(){return Pu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ch.create(this,this._def)}promise(){return dl.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Oo({...Br(this._def),schema:this,typeName:lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:lr.ZodDefault})}brand(){return new Og({typeName:lr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:lr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ng.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fwe=/^c[^\s-]{8,}$/i,uwe=/^[0-9a-z]+$/,hwe=/^[0-9A-HJKMNP-TV-Z]{26}$/,cwe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,lwe=/^[a-z0-9_-]{21}$/i,dwe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pwe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vwe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dT,mwe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gwe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,bwe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ywe=new RegExp(`^${XX}$`);function QX(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function wwe(t){return new RegExp(`^${QX(t)}$`)}function eQ(t){let e=`${XX}T${QX(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function _we(t,e){return!!((e==="v4"||!e)&&mwe.test(t)||(e==="v6"||!e)&&gwe.test(t))}var cl=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.string,received:h.parsedType}),vr}let a=new ka,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,p=e.data.length<h.value;(c||p)&&(i=this._getOrReturnCtx(e,i),c?Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")pwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")dT||(dT=new RegExp(vwe,"u")),dT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")cwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")lwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")fwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")uwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")hwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Pt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Pt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?eQ(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?ywe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?wwe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?dwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?_we(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?bwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Pt.invalid_string,message:h.message}),a.dirty()):si.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Pt.invalid_string,...ir.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ir.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ir.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ir.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ir.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ir.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ir.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ir.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ir.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ir.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ir.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...ir.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ir.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ir.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ir.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ir.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ir.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ir.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ir.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ir.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ir.errToObj(r)})}nonempty(e){return this.min(1,ir.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cl.create=t=>{var e;return new cl({checks:[],typeName:lr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function Mwe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var rd=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.number,received:h.parsedType}),vr}let a,i=new ka;for(let h of this._def.checks)h.kind==="int"?si.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?Mwe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_finite,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ir.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ir.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ir.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ir.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&si.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:lr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.bigint,received:h.parsedType}),vr}let a,i=new ka;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:lr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Pr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.boolean,received:a.parsedType}),vr}return La(e.data)}};nd.create=t=>new nd({typeName:lr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.date,received:h.parsedType}),vr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_date}),vr}let a=new ka,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):si.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ir.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ir.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:lr.ZodDate,...Br(t)});var w1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.symbol){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.symbol,received:a.parsedType}),vr}return La(e.data)}};w1.create=t=>new w1({typeName:lr.ZodSymbol,...Br(t)});var od=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.undefined,received:a.parsedType}),vr}return La(e.data)}};od.create=t=>new od({typeName:lr.ZodUndefined,...Br(t)});var sd=class extends Pr{_parse(e){if(this._getType(e)!==Yt.null){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.null,received:a.parsedType}),vr}return La(e.data)}};sd.create=t=>new sd({typeName:lr.ZodNull,...Br(t)});var ll=class extends Pr{constructor(){super(...arguments),this._any=!0}_parse(e){return La(e.data)}};ll.create=t=>new ll({typeName:lr.ZodAny,...Br(t)});var Nh=class extends Pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return La(e.data)}};Nh.create=t=>new Nh({typeName:lr.ZodUnknown,...Br(t)});var Rf=class extends Pr{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Pt.invalid_type,expected:Yt.never,received:r.parsedType}),vr}};Rf.create=t=>new Rf({typeName:lr.ZodNever,...Br(t)});var _1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.void,received:a.parsedType}),vr}return La(e.data)}};_1.create=t=>new _1({typeName:lr.ZodVoid,...Br(t)});var Ch=class t extends Pr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Pt.invalid_type,expected:Yt.array,received:r.parsedType}),vr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Wt(r,{code:c?Pt.too_big:Pt.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new Os(r,c,r.path,p)))).then(c=>ka.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new Os(r,c,r.path,p)));return ka.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ir.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ir.toString(r)}})}nonempty(e){return this.min(1,e)}};Ch.create=(t,e)=>new Ch({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lr.ZodArray,...Br(e)});function g1(t){if(t instanceof oo){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Ps.create(g1(a))}return new oo({...t._def,shape:()=>e})}else return t instanceof Ch?new Ch({...t._def,type:g1(t.element)}):t instanceof Ps?Ps.create(g1(t.unwrap())):t instanceof Pu?Pu.create(g1(t.unwrap())):t instanceof Bu?Bu.create(t.items.map(e=>g1(e))):t}var oo=class t extends Pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=si.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Pt.invalid_type,expected:Yt.object,received:g.parsedType}),vr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof Rf&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||p.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new Os(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Rf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Wt(i,{code:Pt.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new Os(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>ka.mergeObjectSync(a,g)):ka.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return ir.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=ir.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return si.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return si.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return g1(this)}partial(e){let r={};return si.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return si.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Ps;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return tQ(si.objectKeys(this.shape))}};oo.create=(t,e)=>new oo({shape:()=>t,unknownKeys:"strip",catchall:Rf.create(),typeName:lr.ZodObject,...Br(e)});oo.strictCreate=(t,e)=>new oo({shape:()=>t,unknownKeys:"strict",catchall:Rf.create(),typeName:lr.ZodObject,...Br(e)});oo.lazycreate=(t,e)=>new oo({shape:t,unknownKeys:"strip",catchall:Rf.create(),typeName:lr.ZodObject,...Br(e)});var fd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let p of h)if(p.result.status==="valid")return p.result;for(let p of h)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let c=h.map(p=>new Po(p.ctx.common.issues));return Wt(r,{code:Pt.invalid_union,unionErrors:c}),vr}if(r.common.async)return Promise.all(a.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let p=c.map(b=>new Po(b));return Wt(r,{code:Pt.invalid_union,unionErrors:p}),vr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:lr.ZodUnion,...Br(e)});var Oh=t=>t instanceof hd?Oh(t.schema):t instanceof Oo?Oh(t.innerType()):t instanceof cd?[t.value]:t instanceof ld?t.options:t instanceof dd?si.objectValues(t.enum):t instanceof pd?Oh(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Ps?[void 0,...Oh(t.unwrap())]:t instanceof Pu?[null,...Oh(t.unwrap())]:t instanceof Og||t instanceof md?Oh(t.unwrap()):t instanceof vd?Oh(t._def.innerType):[],N8=class t extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Pt.invalid_type,expected:Yt.object,received:r.parsedType}),vr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),vr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Oh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new t({typeName:lr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(a)})}};function gT(t,e){let r=hl(t),a=hl(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&a===Yt.object){let i=si.objectKeys(e),h=si.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=gT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Yt.array&&a===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=gT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&a===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,c)=>{if(vT(h)||vT(c))return vr;let p=gT(h.value,c.value);return p.valid?((mT(h)||mT(c))&&r.dirty(),{status:r.value,value:p.data}):(Wt(a,{code:Pt.invalid_intersection_types}),vr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:lr.ZodIntersection,...Br(r)});var Bu=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.array)return Wt(a,{code:Pt.invalid_type,expected:Yt.array,received:a.parsedType}),vr;if(a.data.length<this._def.items.length)return Wt(a,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vr;!this._def.rest&&a.data.length>this._def.items.length&&(Wt(a,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new Os(a,c,a.path,p)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>ka.mergeArray(r,c)):ka.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Bu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bu({items:t,typeName:lr.ZodTuple,rest:null,...Br(e)})};var C8=class t extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.object)return Wt(a,{code:Pt.invalid_type,expected:Yt.object,received:a.parsedType}),vr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Os(a,p,a.path,p)),value:c._parse(new Os(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?ka.mergeObjectAsync(r,i):ka.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Pr?new t({keyType:e,valueType:r,typeName:lr.ZodRecord,...Br(a)}):new t({keyType:cl.create(),valueType:e,typeName:lr.ZodRecord,...Br(r)})}},M1=class extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.map)return Wt(a,{code:Pt.invalid_type,expected:Yt.map,received:a.parsedType}),vr;let i=this._def.keyType,h=this._def.valueType,c=[...a.data.entries()].map(([p,b],g)=>({key:i._parse(new Os(a,p,a.path,[g,"key"])),value:h._parse(new Os(a,b,a.path,[g,"value"]))}));if(a.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let b of c){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return vr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}}}};M1.create=(t,e,r)=>new M1({valueType:e,keyType:t,typeName:lr.ZodMap,...Br(r)});var x1=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.set)return Wt(a,{code:Pt.invalid_type,expected:Yt.set,received:a.parsedType}),vr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Wt(a,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Wt(a,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return vr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Os(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ir.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};x1.create=(t,e)=>new x1({valueType:t,minSize:null,maxSize:null,typeName:lr.ZodSet,...Br(e)});var L8=class t extends Pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Pt.invalid_type,expected:Yt.function,received:r.parsedType}),vr;function a(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),y1].filter(g=>!!g),issueData:{code:Pt.invalid_arguments,argumentsError:b}})}function i(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),y1].filter(g=>!!g),issueData:{code:Pt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof dl){let p=this;return La(async function(...b){let g=new Po([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return La(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Po([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Po([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Bu.create(e).rest(Nh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Bu.create([]).rest(Nh.create()),returns:r||Nh.create(),typeName:lr.ZodFunction,...Br(a)})}},hd=class extends Pr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:lr.ZodLazy,...Br(e)});var cd=class extends Pr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Pt.invalid_literal,expected:this._def.value}),vr}return{status:"valid",value:e.data}}get value(){return this._def.value}};cd.create=(t,e)=>new cd({value:t,typeName:lr.ZodLiteral,...Br(e)});function tQ(t,e){return new ld({values:t,typeName:lr.ZodEnum,...Br(e)})}var ld=class t extends Pr{constructor(){super(...arguments),Ig.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{expected:si.joinValues(a),received:r.parsedType,code:Pt.invalid_type}),vr}if(O8(this,Ig,"f")||JX(this,Ig,new Set(this._def.values),"f"),!O8(this,Ig,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{received:r.data,code:Pt.invalid_enum_value,options:a}),vr}return La(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};Ig=new WeakMap;ld.create=tQ;var dd=class extends Pr{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=si.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Yt.string&&a.parsedType!==Yt.number){let i=si.objectValues(r);return Wt(a,{expected:si.joinValues(i),received:a.parsedType,code:Pt.invalid_type}),vr}if(O8(this,kg,"f")||JX(this,kg,new Set(si.getValidEnumValues(this._def.values)),"f"),!O8(this,kg,"f").has(e.data)){let i=si.objectValues(r);return Wt(a,{received:a.data,code:Pt.invalid_enum_value,options:i}),vr}return La(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:lr.ZodNativeEnum,...Br(e)});var dl=class extends Pr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Pt.invalid_type,expected:Yt.promise,received:r.parsedType}),vr;let a=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return La(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dl.create=(t,e)=>new dl({type:t,typeName:lr.ZodPromise,...Br(e)});var Oo=class extends Pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Wt(a,c),c.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(a.data,h);if(a.common.async)return Promise.resolve(c).then(async p=>{if(r.value==="aborted")return vr;let b=await this._def.schema._parseAsync({data:p,path:a.path,parent:a});return b.status==="aborted"?vr:b.status==="dirty"||r.value==="dirty"?b1(b.value):b});{if(r.value==="aborted")return vr;let p=this._def.schema._parseSync({data:c,path:a.path,parent:a});return p.status==="aborted"?vr:p.status==="dirty"||r.value==="dirty"?b1(p.value):p}}if(i.type==="refinement"){let c=p=>{let b=i.refinement(p,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(a.common.async===!1){let p=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return p.status==="aborted"?vr:(p.status==="dirty"&&r.dirty(),c(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(p=>p.status==="aborted"?vr:(p.status==="dirty"&&r.dirty(),c(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Bg(c))return c;let p=i.transform(c.value,h);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>Bg(c)?Promise.resolve(i.transform(c.value,h)).then(p=>({status:r.value,value:p})):c);si.assertNever(i)}};Oo.create=(t,e,r)=>new Oo({schema:t,typeName:lr.ZodEffects,effect:e,...Br(r)});Oo.createWithPreprocess=(t,e,r)=>new Oo({schema:e,effect:{type:"preprocess",transform:t},typeName:lr.ZodEffects,...Br(r)});var Ps=class extends Pr{_parse(e){return this._getType(e)===Yt.undefined?La(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ps.create=(t,e)=>new Ps({innerType:t,typeName:lr.ZodOptional,...Br(e)});var Pu=class extends Pr{_parse(e){return this._getType(e)===Yt.null?La(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pu.create=(t,e)=>new Pu({innerType:t,typeName:lr.ZodNullable,...Br(e)});var pd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Yt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:lr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Pg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Po(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Po(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:lr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var S1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.nan){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.nan,received:a.parsedType}),vr}return{status:"valid",value:e.data}}};S1.create=t=>new S1({typeName:lr.ZodNaN,...Br(t)});var xwe=Symbol("zod_brand"),Og=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Ng=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?vr:h.status==="dirty"?(r.dirty(),b1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?vr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:lr.ZodPipeline})}},md=class extends Pr{_parse(e){let r=this._def.innerType._parse(e),a=i=>(Bg(i)&&(i.value=Object.freeze(i.value)),i);return Pg(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:lr.ZodReadonly,...Br(e)});function rQ(t,e={},r){return t?ll.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):ll.create()}var Swe={object:oo.lazycreate},lr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lr||(lr={}));var Ewe=(t,e={message:`Input not instance of ${t.name}`})=>rQ(r=>r instanceof t,e),iQ=cl.create,nQ=rd.create,Awe=S1.create,Rwe=id.create,aQ=nd.create,Twe=ad.create,Iwe=w1.create,kwe=od.create,Bwe=sd.create,Pwe=ll.create,Owe=Nh.create,Nwe=Rf.create,Cwe=_1.create,Lwe=Ch.create,Dwe=oo.create,$we=oo.strictCreate,qwe=fd.create,Uwe=N8.create,Fwe=ud.create,jwe=Bu.create,zwe=C8.create,Zwe=M1.create,Hwe=x1.create,Kwe=L8.create,Wwe=hd.create,Vwe=cd.create,Gwe=ld.create,Ywe=dd.create,Jwe=dl.create,GX=Oo.create,Xwe=Ps.create,Qwe=Pu.create,e5e=Oo.createWithPreprocess,t5e=Ng.create,r5e=()=>iQ().optional(),i5e=()=>nQ().optional(),n5e=()=>aQ().optional(),a5e={string:t=>cl.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},o5e=vr,Qt=Object.freeze({__proto__:null,defaultErrorMap:y1,setErrorMap:owe,getErrorMap:B8,makeIssue:P8,EMPTY_PATH:swe,addIssueToContext:Wt,ParseStatus:ka,INVALID:vr,DIRTY:b1,OK:La,isAborted:vT,isDirty:mT,isValid:Bg,isAsync:Pg,get util(){return si},get objectUtil(){return pT},ZodParsedType:Yt,getParsedType:hl,ZodType:Pr,datetimeRegex:eQ,ZodString:cl,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:w1,ZodUndefined:od,ZodNull:sd,ZodAny:ll,ZodUnknown:Nh,ZodNever:Rf,ZodVoid:_1,ZodArray:Ch,ZodObject:oo,ZodUnion:fd,ZodDiscriminatedUnion:N8,ZodIntersection:ud,ZodTuple:Bu,ZodRecord:C8,ZodMap:M1,ZodSet:x1,ZodFunction:L8,ZodLazy:hd,ZodLiteral:cd,ZodEnum:ld,ZodNativeEnum:dd,ZodPromise:dl,ZodEffects:Oo,ZodTransformer:Oo,ZodOptional:Ps,ZodNullable:Pu,ZodDefault:pd,ZodCatch:vd,ZodNaN:S1,BRAND:xwe,ZodBranded:Og,ZodPipeline:Ng,ZodReadonly:md,custom:rQ,Schema:Pr,ZodSchema:Pr,late:Swe,get ZodFirstPartyTypeKind(){return lr},coerce:a5e,any:Pwe,array:Lwe,bigint:Rwe,boolean:aQ,date:Twe,discriminatedUnion:Uwe,effect:GX,enum:Gwe,function:Kwe,instanceof:Ewe,intersection:Fwe,lazy:Wwe,literal:Vwe,map:Zwe,nan:Awe,nativeEnum:Ywe,never:Nwe,null:Bwe,nullable:Qwe,number:nQ,object:Dwe,oboolean:n5e,onumber:i5e,optional:Xwe,ostring:r5e,pipeline:t5e,preprocess:e5e,promise:Jwe,record:zwe,set:Hwe,strictObject:$we,string:iQ,symbol:Iwe,transformer:GX,tuple:jwe,undefined:kwe,union:qwe,unknown:Owe,void:Cwe,NEVER:o5e,ZodIssueCode:Pt,quotelessJson:awe,ZodError:Po});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),jft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),zft=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),Zft=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",Hft="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",s5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",Kft=s5e,Lh="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",Wft="placeholder",$8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",bT=1e6,oQ="pb4fCvdJqwT-_bn38ERMdqnOF4weRMjoJ6bY6yfl4a8",sQ="OO2ewZKq4AHoqGQmYUIl-NhJ-llQyFJ3ha4Uf4-w5RI",fQ="fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY",uQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var gd=Qt.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),hQ=Qt.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),f5e=Qt.string(),lQ=Qt.array(Qt.string()),q8=Qt.object({transactionId:gd.describe("The Target ID of the undername"),ttlSeconds:Qt.number(),priority:Qt.number().optional()}),yT=Qt.record(Qt.string(),q8),wT=Qt.array(gd.describe("Controller address")),_T=Qt.record(gd.describe("Holder address"),Qt.number()),MT=Qt.object({Name:Qt.string().describe("The name of the ANT."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),Description:Qt.string().describe("The description for the ANT."),Keywords:lQ.describe("The keywords for the ANT."),Denomination:Qt.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:gd.describe("The Owners address."),Controllers:wT.describe("Controllers of the ANT who have administrative privileges."),Records:yT.describe("Records associated with the ANT."),Balances:_T.describe("Balance details for each address holding the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),TotalSupply:Qt.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:Qt.boolean().describe("Flag indicating whether the ANT has been initialized.")}),u5e=["balance","balances","totalSupply","info","controllers","record","records","state"],h5e=["_eval","_default","transfer","addController","removeController","setRecord","removeRecord","setName","setTicker","setDescription","setKeywords","setLogo","initializeState","releaseName","reassignName","approvePrimaryName","removePrimaryNames"],c5e=[...u5e,...h5e],cQ=Qt.array(Qt.string({description:"Handler Name"})).refine(t=>c5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),dQ=Qt.object({Name:Qt.string().describe("The name of the ANT."),Owner:gd.describe("The Owners address."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),"Total-Supply":hQ.describe("Total supply of the ANT in circulation."),Description:f5e.describe("The description for the ANT."),Keywords:lQ.describe("The keywords for the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),Denomination:hQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:cQ.optional().describe("List of handlers for the ANT."),HandlerNames:cQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function eut(t){return MT.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var l5e=Object.create,iI=Object.defineProperty,d5e=Object.getOwnPropertyDescriptor,qQ=Object.getOwnPropertyNames,p5e=Object.getPrototypeOf,v5e=Object.prototype.hasOwnProperty,No=(t,e)=>function(){return e||(0,t[qQ(t)[0]])((e={exports:{}}).exports,e),e.exports},UQ=(t,e)=>{for(var r in e)iI(t,r,{get:e[r],enumerable:!0})},m5e=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qQ(e))!v5e.call(t,i)&&i!==r&&iI(t,i,{get:()=>e[i],enumerable:!(a=d5e(e,i))||a.enumerable});return t},nI=(t,e,r)=>(r=t!=null?l5e(p5e(t)):{},m5e(e||!t||!t.__esModule?iI(r,"default",{value:t,enumerable:!0}):r,t)),g5e=No({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),b5e=No({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),aI=No({"node_modules/obliterator/foreach.js"(t,e){var r=b5e(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,p){var b,g,y,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof p!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||a&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,M=c.length;y<M;y++)p(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(p);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,y=0;x=b.next(),x.done!==!0;)p(x.value,y),y++;return}for(g in c)c.hasOwnProperty(g)&&p(c[g],g)}}}),oI=No({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var p={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,I,P;for(I=0,P=b.length;I<P;I++)A=g?g(b[I]):b[I],E=t.getNumberType(A),x=p[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),FQ=No({"node_modules/mnemonist/utils/iterables.js"(t){var e=aI(),r=oI();function a(p){return Array.isArray(p)||r.isTypedArray(p)}function i(p){if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size}function h(p){var b=i(p),g=typeof b=="number"?new Array(b):[],y=0;return e(p,function(M){g[y++]=M}),g}function c(p){var b=i(p),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(p,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),y5e=No({"node_modules/mnemonist/lru-cache.js"(t,e){var r=g5e(),a=aI(),i=oI(),h=FQ();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(p){var b=this.head;if(this.head===p)return this;var g=this.backward[p],y=this.forward[p];return this.tail===p?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=p,this.head=p,this.forward[p]=b,this},c.prototype.set=function(p,b){var g=this.items[p];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[p]=g,this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items[p];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[p]=M,this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return p in this.items},c.prototype.get=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(p,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)p.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var p=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(p>=b)return{done:!0};var E=y[g],A=M[g];return p++,p<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var p=new Map,b=this.entries(),g;g=b.next(),!g.done;)p.set(g.value[0],g.value[1]);return Object.defineProperty(p,"constructor",{value:c,enumerable:!1}),p},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),w5e=No({"node_modules/mnemonist/lru-map.js"(t,e){var r=y5e(),a=aI(),i=oI(),h=FQ();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(p,b){var g=this.items.get(p);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(p,g),this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items.get(p);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(p,M),this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return this.items.has(p)},c.prototype.get=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),_5e=No({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,c=h*7,p=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),I=(E[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return A*p;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,I){var P=E>=A*1.5;return Math.round(x/A)+" "+I+(P?"s":"")}}}),M5e=No({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=p,h.enabled=g,h.humanize=_5e(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let I=0;I<E.length;I++)A=(A<<5)-A+E.charCodeAt(I),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,I=null,P,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ee=G-(A||G);Y.diff=ee,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let D=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";D++;let n=h.formatters[_];if(typeof n=="function"){let s=C[D];V=n.call(Y,s),C.splice(D,1),D--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>I!==null?I:(P!==h.namespaces&&(P=h.namespaces,N=h.enabled(E)),N),set:C=>{I=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let I=h(this.namespace+(typeof A>"u"?":":A)+E);return I.log=this.log,I}function p(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,I=(typeof E=="string"?E:"").split(/[\s,]+/),P=I.length;for(A=0;A<P;A++)I[A]&&(E=I[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,I;for(A=0,I=h.skips.length;A<I;A++)if(h.skips[A].test(E))return!1;for(A=0,I=h.names.length;A<I;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),x5e=No({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=M5e()(t);var{formatters:p}=e.exports;p.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),S5e=No({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=p(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function y(A){var I,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)I=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}}),E5e=No({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=I,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=I,p/=256,y-=8);e[a+A-I]|=P*128}}}),A5e=No({"node_modules/buffer/index.js"(t){"use strict";var e=S5e(),r=E5e(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,p.prototype),k}function p(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}p.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}p.alloc=function(T,k,O){return y(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!p.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==p.prototype},p.compare=function(k,O){if(ut(k,Uint8Array)&&(k=p.from(k,k.offset,k.byteLength)),ut(O,Uint8Array)&&(O=p.from(O,O.offset,O.byteLength)),!p.isBuffer(k)||!p.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===O)return 0;let q=k.length,H=O.length;for(let W=0,fe=Math.min(q,H);W<fe;++W)if(k[W]!==O[W]){q=k[W],H=O[W];break}return q<H?-1:H<q?1:0},p.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(k,O){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return p.alloc(0);let q;if(O===void 0)for(O=0,q=0;q<k.length;++q)O+=k[q].length;let H=p.allocUnsafe(O),W=0;for(q=0;q<k.length;++q){let fe=k[q];if(ut(fe,Uint8Array))W+fe.length>H.length?(p.isBuffer(fe)||(fe=p.from(fe)),fe.copy(H,W)):Uint8Array.prototype.set.call(H,fe,W);else if(p.isBuffer(fe))fe.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return H};function C(T,k){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return w(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}p.prototype.swap16=function(){let k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<k;O+=2)G(this,O,O+1);return this},p.prototype.swap32=function(){let k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<k;O+=4)G(this,O,O+3),G(this,O+1,O+2);return this},p.prototype.swap64=function(){let k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<k;O+=8)G(this,O,O+7),G(this,O+1,O+6),G(this,O+2,O+5),G(this,O+3,O+4);return this},p.prototype.toString=function(){let k=this.length;return k===0?"":arguments.length===0?u(this,0,k):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(k){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:p.compare(this,k)===0},p.prototype.inspect=function(){let k="",O=t.INSPECT_MAX_BYTES;return k=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(k+=" ... "),"<Buffer "+k+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(k,O,q,H,W){if(ut(k,Uint8Array)&&(k=p.from(k,k.offset,k.byteLength)),!p.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(O===void 0&&(O=0),q===void 0&&(q=k?k.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),O<0||q>k.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&O>=q)return 0;if(H>=W)return-1;if(O>=q)return 1;if(O>>>=0,q>>>=0,H>>>=0,W>>>=0,this===k)return 0;let fe=W-H,st=q-O,ue=Math.min(fe,st),me=this.slice(H,W),pe=k.slice(O,q);for(let be=0;be<ue;++be)if(me[be]!==pe[be]){fe=me[be],st=pe[be];break}return fe<st?-1:st<fe?1:0};function ee(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=p.from(k,q)),p.isBuffer(k))return k.length===0?-1:D(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):D(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,k,O,q,H){let W=1,fe=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(k,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(k,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(k,O,q){return this.indexOf(k,O,q)!==-1},p.prototype.indexOf=function(k,O,q){return ee(this,k,O,q,!0)},p.prototype.lastIndexOf=function(k,O,q){return ee(this,k,O,q,!1)};function U(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(k.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,k,O,q){return Se(oe(k,T.length-O),T,O,q)}function _(T,k,O,q){return Se(le(k),T,O,q)}function n(T,k,O,q){return Se(ge(k),T,O,q)}function s(T,k,O,q){return Se(ot(k,T.length-O),T,O,q)}p.prototype.write=function(k,O,q,H){if(O===void 0)H="utf8",q=this.length,O=0;else if(q===void 0&&typeof O=="string")H=O,q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(q)?(q=q>>>0,H===void 0&&(H="utf8")):(H=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-O;if((q===void 0||q>W)&&(q=W),k.length>0&&(q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let fe=!1;for(;;)switch(H){case"hex":return U(this,k,O,q);case"utf8":case"utf-8":return V(this,k,O,q);case"ascii":case"latin1":case"binary":return _(this,k,O,q);case"base64":return n(this,k,O,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,k,O,q);default:if(fe)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),fe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function w(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function v(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(k,O){let q=this.length;k=~~k,O=O===void 0?q:~~O,k<0?(k+=q,k<0&&(k=0)):k>q&&(k=q),O<0?(O+=q,O<0&&(O=0)):O>q&&(O=q),O<k&&(O=k);let H=this.subarray(k,O);return Object.setPrototypeOf(H,p.prototype),H};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[k+fe]*W;return H},p.prototype.readUintBE=p.prototype.readUIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k+--O],W=1;for(;O>0&&(W*=256);)H+=this[k+--O]*W;return H},p.prototype.readUint8=p.prototype.readUInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]|this[k+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]<<8|this[k+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},p.prototype.readBigUInt64LE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,W=this[++k]+this[++k]*2**8+this[++k]*2**16+q*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],W=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q;return(BigInt(H)<<BigInt(32))+BigInt(W)}),p.prototype.readIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[k+fe]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*O)),H},p.prototype.readIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=O,W=1,fe=this[k+--H];for(;H>0&&(W*=256);)fe+=this[k+--H]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*O)),fe},p.prototype.readInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},p.prototype.readInt16LE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k]|this[k+1]<<8;return q&32768?q|4294901760:q},p.prototype.readInt16BE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k+1]|this[k]<<8;return q&32768?q|4294901760:q},p.prototype.readInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},p.prototype.readInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},p.prototype.readBigInt64LE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(q<<24);return(BigInt(H)<<BigInt(32))+BigInt(O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),p.prototype.readBigInt64BE=ct(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=(O<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(H)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q)}),p.prototype.readFloatLE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!0,23,4)},p.prototype.readFloatBE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!1,23,4)},p.prototype.readDoubleLE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!0,52,8)},p.prototype.readDoubleBE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!1,52,8)};function S(T,k,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=1,fe=0;for(this[O]=k&255;++fe<q&&(W*=256);)this[O+fe]=k/W&255;return O+q},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=q-1,fe=1;for(this[O+W]=k&255;--W>=0&&(fe*=256);)this[O+W]=k/fe&255;return O+q},p.prototype.writeUint8=p.prototype.writeUInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,255,0),this[O]=k&255,O+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k&255,this[O+1]=k>>>8,O+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k>>>8,this[O+1]=k&255,O+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O+3]=k>>>24,this[O+2]=k>>>16,this[O+1]=k>>>8,this[O]=k&255,O+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=ct(function(k,O=0){return B(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(k,O=0){return F(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=0,fe=1,st=0;for(this[O]=k&255;++W<q&&(fe*=256);)k<0&&st===0&&this[O+W-1]!==0&&(st=1),this[O+W]=(k/fe>>0)-st&255;return O+q},p.prototype.writeIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=q-1,fe=1,st=0;for(this[O+W]=k&255;--W>=0&&(fe*=256);)k<0&&st===0&&this[O+W+1]!==0&&(st=1),this[O+W]=(k/fe>>0)-st&255;return O+q},p.prototype.writeInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,127,-128),k<0&&(k=255+k+1),this[O]=k&255,O+1},p.prototype.writeInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k&255,this[O+1]=k>>>8,O+2},p.prototype.writeInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k>>>8,this[O+1]=k&255,O+2},p.prototype.writeInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),this[O]=k&255,this[O+1]=k>>>8,this[O+2]=k>>>16,this[O+3]=k>>>24,O+4},p.prototype.writeInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4},p.prototype.writeBigInt64LE=ct(function(k,O=0){return B(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(k,O=0){return F(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}p.prototype.writeFloatLE=function(k,O,q){return re(this,k,O,!0,q)},p.prototype.writeFloatBE=function(k,O,q){return re(this,k,O,!1,q)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(k,O,q){return Q(this,k,O,!0,q)},p.prototype.writeDoubleBE=function(k,O,q){return Q(this,k,O,!1,q)},p.prototype.copy=function(k,O,q,H){if(!p.isBuffer(k))throw new TypeError("argument should be a Buffer");if(q||(q=0),!H&&H!==0&&(H=this.length),O>=k.length&&(O=k.length),O||(O=0),H>0&&H<q&&(H=q),H===q||k.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),k.length-O<H-q&&(H=k.length-O+q);let W=H-q;return this===k&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,q,H):Uint8Array.prototype.set.call(k,this.subarray(q,H),O),W},p.prototype.fill=function(k,O,q,H){if(typeof k=="string"){if(typeof O=="string"?(H=O,O=0,q=this.length):typeof q=="string"&&(H=q,q=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!p.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(k.length===1){let fe=k.charCodeAt(0);(H==="utf8"&&fe<128||H==="latin1")&&(k=fe)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(O<0||this.length<O||this.length<q)throw new RangeError("Out of range index");if(q<=O)return this;O=O>>>0,q=q===void 0?this.length:q>>>0,k||(k=0);let W;if(typeof k=="number")for(W=O;W<q;++W)this[W]=k;else{let fe=p.isBuffer(k)?k:p.from(k,H),st=fe.length;if(st===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(W=0;W<q-O;++W)this[W+O]=fe[W%st]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function te(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let fe=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${k}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((k-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),R5e={"@@functional/placeholder":!0};function Vi(t){return t===R5e}function Da(t){return function e(r){return arguments.length===0||Vi(r)?e:t.apply(this,arguments)}}function $n(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:Da(function(i){return t(r,i)});default:return Vi(r)&&Vi(a)?e:Vi(r)?Da(function(i){return t(i,a)}):Vi(a)?Da(function(i){return t(r,i)}):t(r,a)}}}function m4(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function jQ(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,p=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Vi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Vi(b)?p=!0:h-=1,c+=1}return!p&&h<=0?r.apply(this,a):m4(Math.max(0,h),jQ(t,a,r))}}var T5e=$n(function(t,e){return t===1?Da(e):m4(t,jQ(t,[],e))}),zQ=T5e;function sI(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:$n(function(h,c){return t(r,h,c)});case 2:return Vi(r)&&Vi(a)?e:Vi(r)?$n(function(h,c){return t(h,a,c)}):Vi(a)?$n(function(h,c){return t(r,h,c)}):Da(function(h){return t(r,a,h)});default:return Vi(r)&&Vi(a)&&Vi(i)?e:Vi(r)&&Vi(a)?$n(function(h,c){return t(h,c,i)}):Vi(r)&&Vi(i)?$n(function(h,c){return t(h,a,c)}):Vi(a)&&Vi(i)?$n(function(h,c){return t(r,h,c)}):Vi(r)?Da(function(h){return t(h,a,i)}):Vi(a)?Da(function(h){return t(r,h,i)}):Vi(i)?Da(function(h){return t(r,a,h)}):t(r,a,i)}}}var fI=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function I5e(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function uI(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!fI(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(I5e(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function k5e(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var Vg={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function pQ(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function vQ(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function B5e(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function K8(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function P5e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var xT=typeof Object.is=="function"?Object.is:P5e,mQ=Object.prototype.toString,O5e=function(){return mQ.call(arguments)==="[object Arguments]"?function(t){return mQ.call(t)==="[object Arguments]"}:function(t){return K8("callee",t)}}(),N5e=O5e,C5e=!{toString:null}.propertyIsEnumerable("toString"),gQ=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],bQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),L5e=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},D5e=Da(typeof Object.keys=="function"&&!bQ?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=bQ&&N5e(t);for(e in t)K8(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(C5e)for(r=gQ.length-1;r>=0;)e=gQ[r],K8(e,t)&&!L5e(a,e)&&(a[a.length]=e),r-=1;return a}),P1=D5e,$5e=Da(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),yQ=$5e;function wQ(t,e,r,a){var i=pQ(t),h=pQ(e);function c(p,b){return hI(p,b,r.slice(),a.slice())}return!vQ(function(p,b){return!vQ(c,b,p)},h,i)}function hI(t,e,r,a){if(xT(t,e))return!0;var i=yQ(t);if(i!==yQ(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&B5e(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&xT(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!xT(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:wQ(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:wQ(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=P1(t);if(c.length!==P1(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(K8(g,e)&&hI(e[g],t[g],p,b)))return!1;h-=1}return!0}var q5e=$n(function(t,e){return hI(t,e,[],[])}),ZQ=q5e;function U5e(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(ZQ(t[r],e))return r;r+=1}return-1}function F5e(t,e){return U5e(e,t,0)>=0}function Kg(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function ST(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var Cg=function(t){return(t<10?"0":"")+t},j5e=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+Cg(t.getUTCMonth()+1)+"-"+Cg(t.getUTCDate())+"T"+Cg(t.getUTCHours())+":"+Cg(t.getUTCMinutes())+":"+Cg(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},z5e=j5e;function Z5e(t){return function(){return!t.apply(this,arguments)}}function HQ(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function H5e(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function K5e(t){return Object.prototype.toString.call(t)==="[object Object]"}var W5e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function V5e(t){return function(e){return new W5e(t,e)}}var G5e=$n(uI(["fantasy-land/filter","filter"],V5e,function(t,e){return K5e(e)?HQ(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},P1(e)):H5e(t,e)})),Y5e=G5e,J5e=$n(function(t,e){return Y5e(Z5e(t),e)}),X5e=J5e;function KQ(t,e){var r=function(h){var c=e.concat([t]);return F5e(h,c)?"<Circular>":KQ(h,c)},a=function(h,c){return Kg(function(p){return ST(p)+": "+r(h[p])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Kg(r,t).join(", ")+"))";case"[object Array]":return"["+Kg(r,t).concat(a(t,X5e(function(h){return/^\d+$/.test(h)},P1(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):ST(z5e(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":ST(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,P1(t)).join(", ")+"}"}}var Q5e=Da(function(t){return KQ(t,[])}),_Q=Q5e,e7e=$n(function(t,e){if(t===e)return e;function r(p,b){if(p>b!=b>p)return b>p?b:p}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=_Q(t),c=r(h,_Q(e));return c!==void 0&&c===h?t:e}),t7e=e7e,r7e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),i7e=function(t){return function(e){return new r7e(t,e)}},n7e=i7e,a7e=$n(uI(["fantasy-land/map","map"],n7e,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return zQ(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return HQ(function(r,a){return r[a]=t(e[a]),r},{},P1(e));default:return Kg(t,e)}})),o7e=a7e,WQ=Number.isInteger||function(t){return t<<0===t};function VQ(t){return Object.prototype.toString.call(t)==="[object String]"}function GQ(t,e){var r=t<0?e.length+t:t;return VQ(e)?e.charAt(r):e[r]}var s7e=$n(function(t,e){if(e!=null)return WQ(t)?GQ(t,e):e[t]}),g4=s7e,f7e=$n(function(t,e){return o7e(g4(t),e)}),u7e=f7e,h7e=Da(function(t){return fI(t)?!0:!t||typeof t!="object"||VQ(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),c7e=h7e,MQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function l7e(t,e,r){return function(a,i,h){if(c7e(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[MQ]!=null)return r(a,i,h[MQ]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function d7e(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var p7e=$n(function(t,e){return m4(t.length,function(){return t.apply(e,arguments)})}),v7e=p7e;function m7e(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function g7e(t,e,r,a){return t["@@transducer/result"](r[a](v7e(t["@@transducer/step"],t),e))}var b7e=l7e(d7e,g7e,m7e),y7e=b7e,w7e=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function _7e(t){return new w7e(t)}var M7e=sI(function(t,e,r){return y7e(typeof t=="function"?_7e(t):t,e,r)}),YQ=M7e;function x7e(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function JQ(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return fI(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var S7e=sI(JQ("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),E7e=S7e,A7e=Da(JQ("tail",E7e(1,1/0))),R7e=A7e;function XQ(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return m4(arguments[0].length,YQ(x7e,arguments[0],R7e(arguments)))}var T7e=$n(function(t,e){return zQ(YQ(t7e,0,u7e("length",e)),function(){var r=arguments,a=this;return t.apply(a,Kg(function(i){return i.apply(a,r)},e))})}),I7e=T7e,k7e=$n(function(t,e){return e==null||e!==e?t:e}),PT=k7e,B7e=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=k5e(this.xf["@@transducer/step"](e,r))),e},t}();function P7e(t){return function(e){return new B7e(t,e)}}var O7e=$n(uI(["find"],P7e,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),N7e=O7e,C7e=Da(function(t){return I7e(function(){return Array.prototype.slice.call(arguments,0)},t)}),L7e=C7e;function D7e(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];WQ(i)?r=GQ(i,r):r=r[i]}return r}var $7e=$n(D7e),QQ=$7e,q7e=sI(function(t,e,r){return ZQ(t,g4(e,r))}),U7e=q7e,W8=class extends Error{name="InvalidSchedulerLocation"},F7e=class extends Error{name="SchedulerTagNotFound"},j7e=class extends Error{name="TransactionNotFound"},z7e="Url",Z7e="Time-To-Live",H7e="Scheduler",OT=t=>XQ(PT([]),N7e(U7e(t,"name")),PT({}),g4("value")),eee=t=>XQ(e=>{if(!e)throw new j7e(t);return e},g4("tags"),PT([]));function tee({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function K7e({fetch:t,GRAPHQL_URL:e}){let r=tee({fetch:t,GRAPHQL_URL:e}),a=ree({fetch:t,GRAPHQL_URL:e}),i=`
|
|
135
135
|
query GetTransactions ($transactionIds: [ID!]!) {
|
|
136
136
|
transactions(ids: $transactionIds) {
|
|
137
137
|
edges {
|
|
@@ -166,7 +166,7 @@ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
`;return async i=>r({query:a,variables:{owner:i}}).then(QQ(["data","transactions","edges","0","node"])).then(eee(`Could not find 'Scheduler-Location' owner by wallet ${i}`)).then(L7e([OT(z7e),OT(Z7e)])).then(([h,c])=>{if(!h)throw new W8('No "Url" tag found on Scheduler-Location');if(!c)throw new W8('No "Time-To-Live" tag found on Scheduler-Location');return{url:h,ttl:c,address:i}})}var E1=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,iee=new Set,NT=typeof He=="object"&&He?He:{},nee=(t,e,r,a)=>{typeof NT.emitWarning=="function"?NT.emitWarning(t,e,r,a):console.error(`[${r}] ${e}: ${t}`)},V8=globalThis.AbortController,xQ=globalThis.AbortSignal;if(typeof V8>"u"){xQ=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,a){this._onabort.push(a)}},V8=class{constructor(){e()}signal=new xQ;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let a of this.signal._onabort)a(r);this.signal.onabort?.(r)}}};let t=NT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,nee("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var W7e=t=>!iee.has(t),fut=Symbol("type"),vl=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),aee=t=>vl(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?U8:null:null,U8=class extends Array{constructor(t){super(t),this.fill(0)}},V7e=class $g{heap;length;static#f=!1;static create(e){let r=aee(e);if(!r)return[];$g.#f=!0;let a=new $g(e,r);return $g.#f=!1,a}constructor(e,r){if(!$g.#f)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},G7e=class oee{#f;#c;#v;#m;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#g;#i;#r;#e;#u;#l;#s;#a;#b;#o;#y;#w;#d;#_;#E;#h;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#d,sizes:e.#y,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#l,get head(){return e.#s},get tail(){return e.#a},free:e.#b,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,a,i,h)=>e.#P(r,a,i,h),moveToTail:r=>e.#T(r),indexes:r=>e.#M(r),rindexes:r=>e.#x(r),isStale:r=>e.#p(r)}}get max(){return this.#f}get maxSize(){return this.#c}get calculatedSize(){return this.#g}get size(){return this.#n}get fetchMethod(){return this.#I}get dispose(){return this.#v}get disposeAfter(){return this.#m}constructor(e){let{max:r=0,ttl:a,ttlResolution:i=1,ttlAutopurge:h,updateAgeOnGet:c,updateAgeOnHas:p,allowStale:b,dispose:g,disposeAfter:y,noDisposeOnSet:M,noUpdateTTL:x,maxSize:E=0,maxEntrySize:A=0,sizeCalculation:I,fetchMethod:P,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:Y,ignoreFetchAbort:G}=e;if(r!==0&&!vl(r))throw new TypeError("max option must be a nonnegative integer");let ee=r?aee(r):Array;if(!ee)throw new Error("invalid max value: "+r);if(this.#f=r,this.#c=E,this.maxEntrySize=A||this.#c,this.sizeCalculation=I,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(P!==void 0&&typeof P!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=P,this.#E=!!P,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new ee(r),this.#l=new ee(r),this.#s=0,this.#a=0,this.#b=V7e.create(r),this.#n=0,this.#g=0,typeof g=="function"&&(this.#v=g),typeof y=="function"?(this.#m=y,this.#o=[]):(this.#m=void 0,this.#o=void 0),this.#_=!!this.#v,this.#h=!!this.#m,this.noDisposeOnSet=!!M,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!Y,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#c!==0&&!vl(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!vl(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!b,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!p,this.ttlResolution=vl(i)||i===0?i:1,this.ttlAutopurge=!!h,this.ttl=a||0,this.ttl){if(!vl(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#f===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#f&&!this.#c){let D="LRU_CACHE_UNBOUNDED";W7e(D)&&(iee.add(D),nee("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,oee))}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#O(){let e=new U8(this.#f),r=new U8(this.#f);this.#d=e,this.#w=r,this.#N=(h,c,p=E1.now())=>{if(r[h]=c!==0?p:0,e[h]=c,c!==0&&this.ttlAutopurge){let b=setTimeout(()=>{this.#p(h)&&this.delete(this.#r[h])},c+1);b.unref&&b.unref()}},this.#A=h=>{r[h]=e[h]!==0?E1.now():0},this.#S=(h,c)=>{if(e[c]){let p=e[c],b=r[c];if(!p||!b)return;h.ttl=p,h.start=b,h.now=a||i();let g=h.now-b;h.remainingTTL=p-g}};let a=0,i=()=>{let h=E1.now();if(this.ttlResolution>0){a=h;let c=setTimeout(()=>a=0,this.ttlResolution);c.unref&&c.unref()}return h};this.getRemainingTTL=h=>{let c=this.#i.get(h);if(c===void 0)return 0;let p=e[c],b=r[c];if(!p||!b)return 1/0;let g=(a||i())-b;return p-g},this.#p=h=>{let c=r[h],p=e[h];return!!p&&!!c&&(a||i())-c>p}}#A=()=>{};#S=()=>{};#N=()=>{};#p=()=>!1;#$(){let e=new U8(this.#f);this.#g=0,this.#y=e,this.#R=r=>{this.#g-=e[r],e[r]=0},this.#C=(r,a,i,h)=>{if(this.#t(a))return 0;if(!vl(i))if(h){if(typeof h!="function")throw new TypeError("sizeCalculation must be a function");if(i=h(a,r),!vl(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#k=(r,a,i)=>{if(e[r]=a,this.#c){let h=this.#c-e[r];for(;this.#g>h;)this.#B(!0)}this.#g+=e[r],i&&(i.entrySize=a,i.totalCalculatedSize=this.#g)}}#R=e=>{};#k=(e,r,a)=>{};#C=(e,r,a,i)=>{if(a||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#a;!(!this.#L(r)||((e||!this.#p(r))&&(yield r),r===this.#s));)r=this.#l[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#L(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#u[r]}#L(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#M())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#x())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#M()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#M())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#x())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let a of this.#M()){let i=this.#e[a],h=this.#t(i)?i.__staleWhileFetching:i;if(h!==void 0&&e(h,this.#r[a],this))return this.get(this.#r[a],r)}}forEach(e,r=this){for(let a of this.#M()){let i=this.#e[a],h=this.#t(i)?i.__staleWhileFetching:i;h!==void 0&&e.call(r,h,this.#r[a],this)}}rforEach(e,r=this){for(let a of this.#x()){let i=this.#e[a],h=this.#t(i)?i.__staleWhileFetching:i;h!==void 0&&e.call(r,h,this.#r[a],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#p(r)&&(this.delete(this.#r[r]),e=!0);return e}info(e){let r=this.#i.get(e);if(r===void 0)return;let a=this.#e[r],i=this.#t(a)?a.__staleWhileFetching:a;if(i===void 0)return;let h={value:i};if(this.#d&&this.#w){let c=this.#d[r],p=this.#w[r];if(c&&p){let b=c-(E1.now()-p);h.ttl=b,h.start=Date.now()}}return this.#y&&(h.size=this.#y[r]),h}dump(){let e=[];for(let r of this.#M({allowStale:!0})){let a=this.#r[r],i=this.#e[r],h=this.#t(i)?i.__staleWhileFetching:i;if(h===void 0||a===void 0)continue;let c={value:h};if(this.#d&&this.#w){c.ttl=this.#d[r];let p=E1.now()-this.#w[r];c.start=Math.floor(Date.now()-p)}this.#y&&(c.size=this.#y[r]),e.unshift([a,c])}return e}load(e){this.clear();for(let[r,a]of e){if(a.start){let i=Date.now()-a.start;a.start=E1.now()-i}this.set(r,a.value,a)}}set(e,r,a={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:h,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:b}=a,{noUpdateTTL:g=this.noUpdateTTL}=a,y=this.#C(e,r,a.size||0,p);if(this.maxEntrySize&&y>this.maxEntrySize)return b&&(b.set="miss",b.maxEntrySizeExceeded=!0),this.delete(e),this;let M=this.#n===0?void 0:this.#i.get(e);if(M===void 0)M=this.#n===0?this.#a:this.#b.length!==0?this.#b.pop():this.#n===this.#f?this.#B(!1):this.#n,this.#r[M]=e,this.#e[M]=r,this.#i.set(e,M),this.#u[this.#a]=M,this.#l[M]=this.#a,this.#a=M,this.#n++,this.#k(M,y,b),b&&(b.set="add"),g=!1;else{this.#T(M);let x=this.#e[M];if(r!==x){if(this.#E&&this.#t(x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:E}=x;E!==void 0&&!c&&(this.#_&&this.#v?.(E,e,"set"),this.#h&&this.#o?.push([E,e,"set"]))}else c||(this.#_&&this.#v?.(x,e,"set"),this.#h&&this.#o?.push([x,e,"set"]));if(this.#R(M),this.#k(M,y,b),this.#e[M]=r,b){b.set="replace";let E=x&&this.#t(x)?x.__staleWhileFetching:x;E!==void 0&&(b.oldValue=E)}}else b&&(b.set="update")}if(i!==0&&!this.#d&&this.#O(),this.#d&&(g||this.#N(M,i,h),b&&this.#S(b,M)),!c&&this.#h&&this.#o){let x=this.#o,E;for(;E=x?.shift();)this.#m?.(...E)}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#s];if(this.#B(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#h&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#m?.(...r)}}}#B(e){let r=this.#s,a=this.#r[r],i=this.#e[r];return this.#E&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#h)&&(this.#_&&this.#v?.(i,a,"evict"),this.#h&&this.#o?.push([i,a,"evict"])),this.#R(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#b.push(r)),this.#n===1?(this.#s=this.#a=0,this.#b.length=0):this.#s=this.#u[r],this.#i.delete(a),this.#n--,r}has(e,r={}){let{updateAgeOnHas:a=this.updateAgeOnHas,status:i}=r,h=this.#i.get(e);if(h!==void 0){let c=this.#e[h];if(this.#t(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#p(h))i&&(i.has="stale",this.#S(i,h));else return a&&this.#A(h),i&&(i.has="hit",this.#S(i,h)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:a=this.allowStale}=r,i=this.#i.get(e);if(i===void 0||!a&&this.#p(i))return;let h=this.#e[i];return this.#t(h)?h.__staleWhileFetching:h}#P(e,r,a,i){let h=r===void 0?void 0:this.#e[r];if(this.#t(h))return h;let c=new V8,{signal:p}=a;p?.addEventListener("abort",()=>c.abort(p.reason),{signal:c.signal});let b={signal:c.signal,options:a,context:i},g=(I,P=!1)=>{let{aborted:N}=c.signal,L=a.ignoreFetchAbort&&I!==void 0;if(a.status&&(N&&!P?(a.status.fetchAborted=!0,a.status.fetchError=c.signal.reason,L&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),N&&!L&&!P)return M(c.signal.reason);let C=E;return this.#e[r]===E&&(I===void 0?C.__staleWhileFetching?this.#e[r]=C.__staleWhileFetching:this.delete(e):(a.status&&(a.status.fetchUpdated=!0),this.set(e,I,b.options))),I},y=I=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=I),M(I)),M=I=>{let{aborted:P}=c.signal,N=P&&a.allowStaleOnFetchAbort,L=N||a.allowStaleOnFetchRejection,C=L||a.noDeleteOnFetchRejection,Y=E;if(this.#e[r]===E&&(!C||Y.__staleWhileFetching===void 0?this.delete(e):N||(this.#e[r]=Y.__staleWhileFetching)),L)return a.status&&Y.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),Y.__staleWhileFetching;if(Y.__returned===Y)throw I},x=(I,P)=>{let N=this.#I?.(e,h,b);N&&N instanceof Promise&&N.then(L=>I(L===void 0?void 0:L),P),c.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(I(void 0),a.allowStaleOnFetchAbort&&(I=L=>g(L,!0)))})};a.status&&(a.status.fetchDispatched=!0);let E=new Promise(x).then(g,y),A=Object.assign(E,{__abortController:c,__staleWhileFetching:h,__returned:void 0});return r===void 0?(this.set(e,A,{...b.options,status:void 0}),r=this.#i.get(e)):this.#e[r]=A,A}#t(e){if(!this.#E)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof V8}async fetch(e,r={}){let{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:b=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:y=this.noUpdateTTL,noDeleteOnFetchRejection:M=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:I,forceRefresh:P=!1,status:N,signal:L}=r;if(!this.#E)return N&&(N.fetch="get"),this.get(e,{allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:h,status:N});let C={allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:h,ttl:c,noDisposeOnSet:p,size:b,sizeCalculation:g,noUpdateTTL:y,noDeleteOnFetchRejection:M,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:A,ignoreFetchAbort:E,status:N,signal:L},Y=this.#i.get(e);if(Y===void 0){N&&(N.fetch="miss");let G=this.#P(e,Y,C,I);return G.__returned=G}else{let G=this.#e[Y];if(this.#t(G)){let V=a&&G.__staleWhileFetching!==void 0;return N&&(N.fetch="inflight",V&&(N.returnedStale=!0)),V?G.__staleWhileFetching:G.__returned=G}let ee=this.#p(Y);if(!P&&!ee)return N&&(N.fetch="hit"),this.#T(Y),i&&this.#A(Y),N&&this.#S(N,Y),G;let D=this.#P(e,Y,C,I),U=D.__staleWhileFetching!==void 0&&a;return N&&(N.fetch=ee?"stale":"refresh",U&&ee&&(N.returnedStale=!0)),U?D.__staleWhileFetching:D.__returned=D}}get(e,r={}){let{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,status:c}=r,p=this.#i.get(e);if(p!==void 0){let b=this.#e[p],g=this.#t(b);return c&&this.#S(c,p),this.#p(p)?(c&&(c.get="stale"),g?(c&&a&&b.__staleWhileFetching!==void 0&&(c.returnedStale=!0),a?b.__staleWhileFetching:void 0):(h||this.delete(e),c&&a&&(c.returnedStale=!0),a?b:void 0)):(c&&(c.get="hit"),g?b.__staleWhileFetching:(this.#T(p),i&&this.#A(p),b))}else c&&(c.get="miss")}#D(e,r){this.#l[r]=e,this.#u[e]=r}#T(e){e!==this.#a&&(e===this.#s?this.#s=this.#u[e]:this.#D(this.#l[e],this.#u[e]),this.#D(this.#a,e),this.#a=e)}delete(e){let r=!1;if(this.#n!==0){let a=this.#i.get(e);if(a!==void 0)if(r=!0,this.#n===1)this.clear();else{this.#R(a);let i=this.#e[a];if(this.#t(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#h)&&(this.#_&&this.#v?.(i,e,"delete"),this.#h&&this.#o?.push([i,e,"delete"])),this.#i.delete(e),this.#r[a]=void 0,this.#e[a]=void 0,a===this.#a)this.#a=this.#l[a];else if(a===this.#s)this.#s=this.#u[a];else{let h=this.#l[a];this.#u[h]=this.#u[a];let c=this.#u[a];this.#l[c]=this.#l[a]}this.#n--,this.#b.push(a)}}if(this.#h&&this.#o?.length){let a=this.#o,i;for(;i=a?.shift();)this.#m?.(...i)}return r}clear(){for(let e of this.#x({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else{let a=this.#r[e];this.#_&&this.#v?.(r,a,"delete"),this.#h&&this.#o?.push([r,a,"delete"])}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#s=0,this.#a=0,this.#b.length=0,this.#g=0,this.#n=0,this.#h&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#m?.(...r)}}};function Y7e({size:t}){return new G7e({max:t,maxSize:5e6,sizeCalculation:e=>JSON.stringify(e).length,allowStale:!0})}function J7e({cache:t}){return async e=>{if(t.max)return t.get(e)}}function X7e({cache:t}){return async(e,{url:r,address:a},i)=>{if(t.max)return t.set(e,{url:r,address:a},{ttl:i})}}function Q7e({cache:t}){return async e=>{if(t.max)return t.get(e)}}function e_e({cache:t}){return async(e,r,a)=>{if(t.max)return t.set(e,{url:r,address:e,ttl:a},{ttl:a})}}function t_e({fetch:t}){return async(e,r)=>{let a=await t(`${e}?process-id=${r}`,{method:"GET",redirect:"manual"});return[301,302,307,308].includes(a.status)?new URL(a.headers.get("Location")).origin:e}}var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(fi||(fi={}));var CT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(CT||(CT={}));var Jt=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gl=t=>{switch(typeof t){case"undefined":return Jt.undefined;case"string":return Jt.string;case"number":return isNaN(t)?Jt.nan:Jt.number;case"boolean":return Jt.boolean;case"function":return Jt.function;case"bigint":return Jt.bigint;case"symbol":return Jt.symbol;case"object":return Array.isArray(t)?Jt.array:t===null?Jt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Jt.promise:typeof Map<"u"&&t instanceof Map?Jt.map:typeof Set<"u"&&t instanceof Set?Jt.set:typeof Date<"u"&&t instanceof Date?Jt.date:Jt.object;default:return Jt.unknown}},Ot=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),r_e=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bf=class see extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof see))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Bf.create=t=>new Bf(t);var O1=(t,e)=>{let r;switch(t.code){case Ot.invalid_type:t.received===Jt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ot.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Ot.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Ot.invalid_union:r="Invalid input";break;case Ot.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Ot.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Ot.invalid_arguments:r="Invalid function arguments";break;case Ot.invalid_return_type:r="Invalid function return type";break;case Ot.invalid_date:r="Invalid date";break;case Ot.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ot.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ot.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ot.custom:r="Invalid input";break;case Ot.invalid_intersection_types:r="Intersection results could not be merged";break;case Ot.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ot.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}},fee=O1;function i_e(t){fee=t}function G8(){return fee}var Y8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},n_e=[];function Vt(t,e){let r=G8(),a=Y8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===O1?void 0:O1].filter(i=>!!i)});t.common.issues.push(a)}var so=class uee{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return br;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return uee.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return br;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},br=Object.freeze({status:"aborted"}),J8=t=>({status:"dirty",value:t}),$a=t=>({status:"valid",value:t}),LT=t=>t.status==="aborted",DT=t=>t.status==="dirty",Gg=t=>t.status==="valid",X8=t=>typeof Promise<"u"&&t instanceof Promise;function Q8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function hee(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var nr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(nr||(nr={}));var qg,Ug,Lu=class{constructor(t,e,r,a){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},SQ=(t,e)=>{if(Gg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bf(t.common.issues);return this._error=r,this._error}}};function Or(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(h,c)=>{var p,b;let{message:g}=t;return h.code==="invalid_enum_value"?{message:g??c.defaultError}:typeof c.data>"u"?{message:(p=g??a)!==null&&p!==void 0?p:c.defaultError}:h.code!=="invalid_type"?{message:c.defaultError}:{message:(b=g??r)!==null&&b!==void 0?b:c.defaultError}},description:i}}var qr=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return gl(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:gl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new so,ctx:{common:t.parent.common,data:t.data,parsedType:gl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(X8(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let a={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gl(t)},i=this._parseSync({data:t,path:a.path,parent:a});return SQ(a,i)}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gl(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(X8(a)?a:Promise.resolve(a));return SQ(r,i)}refine(t,e){let r=a=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(a):e;return this._refinement((a,i)=>{let h=t(a),c=()=>i.addIssue({code:Ot.custom,...r(a)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(c(),!1)):h?!0:(c(),!1)})}refinement(t,e){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof e=="function"?e(r,a):e),!1))}_refinement(t){return new Pf({schema:this,typeName:dr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Nu.create(this,this._def)}nullable(){return wl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wd.create(this,this._def)}promise(){return L1.create(this,this._def)}or(t){return r2.create([this,t],this._def)}and(t){return i2.create(this,t,this._def)}transform(t){return new Pf({...Or(this._def),schema:this,typeName:dr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new s2({...Or(this._def),innerType:this,defaultValue:e,typeName:dr.ZodDefault})}brand(){return new cI({typeName:dr.ZodBranded,type:this,...Or(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new f2({...Or(this._def),innerType:this,catchValue:e,typeName:dr.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return lI.create(this,t)}readonly(){return u2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},a_e=/^c[^\s-]{8,}$/i,o_e=/^[0-9a-z]+$/,s_e=/^[0-9A-HJKMNP-TV-Z]{26}$/,f_e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,u_e=/^[a-z0-9_-]{21}$/i,h_e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,c_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,l_e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ET,d_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,p_e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,v_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cee="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",m_e=new RegExp(`^${cee}$`);function lee(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function g_e(t){return new RegExp(`^${lee(t)}$`)}function dee(t){let e=`${cee}T${lee(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function b_e(t,e){return!!((e==="v4"||!e)&&d_e.test(t)||(e==="v6"||!e)&&p_e.test(t))}var N1=class Fg extends qr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Jt.string){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.string,received:i.parsedType}),br}let r=new so,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let h=e.data.length>i.value,c=e.data.length<i.value;(h||c)&&(a=this._getOrReturnCtx(e,a),h?Vt(a,{code:Ot.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&Vt(a,{code:Ot.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")c_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"email",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")ET||(ET=new RegExp(l_e,"u")),ET.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"emoji",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")f_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"uuid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")u_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"nanoid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")a_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"cuid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")o_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"cuid2",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")s_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"ulid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Vt(a,{validation:"url",code:Ot.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"regex",code:Ot.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?dee(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?m_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?g_e(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?h_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"duration",code:Ot.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?b_e(e.data,i.version)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"ip",code:Ot.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?v_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"base64",code:Ot.invalid_string,message:i.message}),r.dirty()):fi.assertNever(i);return{status:r.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Ot.invalid_string,...nr.errToObj(a)})}_addCheck(e){return new Fg({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...nr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...nr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...nr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...nr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...nr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...nr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...nr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...nr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...nr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...nr.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...nr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...nr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...nr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...nr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...nr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...nr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...nr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...nr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...nr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...nr.errToObj(r)})}nonempty(e){return this.min(1,nr.errToObj(e))}trim(){return new Fg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};N1.create=t=>{var e;return new N1({checks:[],typeName:dr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Or(t)})};function y_e(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var Yg=class $T extends qr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Jt.number){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.number,received:i.parsedType}),br}let r,a=new so;for(let i of this._def.checks)i.kind==="int"?fi.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?y_e(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.not_finite,message:i.message}),a.dirty()):fi.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,nr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,nr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,nr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,nr.toString(r))}setLimit(e,r,a,i){return new $T({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:nr.toString(i)}]})}_addCheck(e){return new $T({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:nr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:nr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:nr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:nr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:nr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:nr.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Yg.create=t=>new Yg({checks:[],typeName:dr.ZodNumber,coerce:t?.coerce||!1,...Or(t)});var Jg=class qT extends qr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Jt.bigint){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.bigint,received:i.parsedType}),br}let r,a=new so;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):fi.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,nr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,nr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,nr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,nr.toString(r))}setLimit(e,r,a,i){return new qT({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:nr.toString(i)}]})}_addCheck(e){return new qT({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:nr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:nr.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Jg.create=t=>{var e;return new Jg({checks:[],typeName:dr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Or(t)})};var Xg=class extends qr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Jt.boolean){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.boolean,received:e.parsedType}),br}return $a(t.data)}};Xg.create=t=>new Xg({typeName:dr.ZodBoolean,coerce:t?.coerce||!1,...Or(t)});var Qg=class pee extends qr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Jt.date){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.date,received:i.parsedType}),br}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_date}),br}let r=new so,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):fi.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pee({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:nr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:nr.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Qg.create=t=>new Qg({checks:[],coerce:t?.coerce||!1,typeName:dr.ZodDate,...Or(t)});var e4=class extends qr{_parse(t){if(this._getType(t)!==Jt.symbol){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.symbol,received:e.parsedType}),br}return $a(t.data)}};e4.create=t=>new e4({typeName:dr.ZodSymbol,...Or(t)});var e2=class extends qr{_parse(t){if(this._getType(t)!==Jt.undefined){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.undefined,received:e.parsedType}),br}return $a(t.data)}};e2.create=t=>new e2({typeName:dr.ZodUndefined,...Or(t)});var t2=class extends qr{_parse(t){if(this._getType(t)!==Jt.null){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.null,received:e.parsedType}),br}return $a(t.data)}};t2.create=t=>new t2({typeName:dr.ZodNull,...Or(t)});var C1=class extends qr{constructor(){super(...arguments),this._any=!0}_parse(t){return $a(t.data)}};C1.create=t=>new C1({typeName:dr.ZodAny,...Or(t)});var bd=class extends qr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return $a(t.data)}};bd.create=t=>new bd({typeName:dr.ZodUnknown,...Or(t)});var Uh=class extends qr{_parse(t){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.never,received:e.parsedType}),br}};Uh.create=t=>new Uh({typeName:dr.ZodNever,...Or(t)});var t4=class extends qr{_parse(t){if(this._getType(t)!==Jt.undefined){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.void,received:e.parsedType}),br}return $a(t.data)}};t4.create=t=>new t4({typeName:dr.ZodVoid,...Or(t)});var wd=class F8 extends qr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Jt.array)return Vt(r,{code:Ot.invalid_type,expected:Jt.array,received:r.parsedType}),br;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Vt(r,{code:c?Ot.too_big:Ot.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Vt(r,{code:Ot.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Vt(r,{code:Ot.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new Lu(r,c,r.path,p)))).then(c=>so.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new Lu(r,c,r.path,p)));return so.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new F8({...this._def,minLength:{value:e,message:nr.toString(r)}})}max(e,r){return new F8({...this._def,maxLength:{value:e,message:nr.toString(r)}})}length(e,r){return new F8({...this._def,exactLength:{value:e,message:nr.toString(r)}})}nonempty(e){return this.min(1,e)}};wd.create=(t,e)=>new wd({type:t,minLength:null,maxLength:null,exactLength:null,typeName:dr.ZodArray,...Or(e)});function R1(t){if(t instanceof Ds){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Nu.create(R1(a))}return new Ds({...t._def,shape:()=>e})}else return t instanceof wd?new wd({...t._def,type:R1(t.element)}):t instanceof Nu?Nu.create(R1(t.unwrap())):t instanceof wl?wl.create(R1(t.unwrap())):t instanceof yl?yl.create(t.items.map(e=>R1(e))):t}var Ds=class Tf extends qr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Jt.object){let b=this._getOrReturnCtx(e);return Vt(b,{code:Ot.invalid_type,expected:Jt.object,received:b.parsedType}),br}let{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:h}=this._getCached(),c=[];if(!(this._def.catchall instanceof Uh&&this._def.unknownKeys==="strip"))for(let b in a.data)h.includes(b)||c.push(b);let p=[];for(let b of h){let g=i[b],y=a.data[b];p.push({key:{status:"valid",value:b},value:g._parse(new Lu(a,y,a.path,b)),alwaysSet:b in a.data})}if(this._def.catchall instanceof Uh){let b=this._def.unknownKeys;if(b==="passthrough")for(let g of c)p.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(b==="strict")c.length>0&&(Vt(a,{code:Ot.unrecognized_keys,keys:c}),r.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let b=this._def.catchall;for(let g of c){let y=a.data[g];p.push({key:{status:"valid",value:g},value:b._parse(new Lu(a,y,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let b=[];for(let g of p){let y=await g.key,M=await g.value;b.push({key:y,value:M,alwaysSet:g.alwaysSet})}return b}).then(b=>so.mergeObjectSync(r,b)):so.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return nr.errToObj,new Tf({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=nr.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new Tf({...this._def,unknownKeys:"strip"})}passthrough(){return new Tf({...this._def,unknownKeys:"passthrough"})}extend(e){return new Tf({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Tf({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:dr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Tf({...this._def,catchall:e})}pick(e){let r={};return fi.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new Tf({...this._def,shape:()=>r})}omit(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new Tf({...this._def,shape:()=>r})}deepPartial(){return R1(this)}partial(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new Tf({...this._def,shape:()=>r})}required(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Nu;)i=i._def.innerType;r[a]=i}}),new Tf({...this._def,shape:()=>r})}keyof(){return wee(fi.objectKeys(this.shape))}};Ds.create=(t,e)=>new Ds({shape:()=>t,unknownKeys:"strip",catchall:Uh.create(),typeName:dr.ZodObject,...Or(e)});Ds.strictCreate=(t,e)=>new Ds({shape:()=>t,unknownKeys:"strict",catchall:Uh.create(),typeName:dr.ZodObject,...Or(e)});Ds.lazycreate=(t,e)=>new Ds({shape:t,unknownKeys:"strip",catchall:Uh.create(),typeName:dr.ZodObject,...Or(e)});var r2=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function a(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return e.common.issues.push(...c.ctx.common.issues),c.result;let h=i.map(c=>new Bf(c.ctx.common.issues));return Vt(e,{code:Ot.invalid_union,unionErrors:h}),br}if(e.common.async)return Promise.all(r.map(async i=>{let h={...e,common:{...e.common,issues:[]},parent:null};return{result:await i._parseAsync({data:e.data,path:e.path,parent:h}),ctx:h}})).then(a);{let i,h=[];for(let p of r){let b={...e,common:{...e.common,issues:[]},parent:null},g=p._parseSync({data:e.data,path:e.path,parent:b});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:b}),b.common.issues.length&&h.push(b.common.issues)}if(i)return e.common.issues.push(...i.ctx.common.issues),i.result;let c=h.map(p=>new Bf(p));return Vt(e,{code:Ot.invalid_union,unionErrors:c}),br}}get options(){return this._def.options}};r2.create=(t,e)=>new r2({options:t,typeName:dr.ZodUnion,...Or(e)});var ml=t=>t instanceof n2?ml(t.schema):t instanceof Pf?ml(t.innerType()):t instanceof a2?[t.value]:t instanceof R2?t.options:t instanceof o2?fi.objectValues(t.enum):t instanceof s2?ml(t._def.innerType):t instanceof e2?[void 0]:t instanceof t2?[null]:t instanceof Nu?[void 0,...ml(t.unwrap())]:t instanceof wl?[null,...ml(t.unwrap())]:t instanceof cI||t instanceof u2?ml(t.unwrap()):t instanceof f2?ml(t._def.innerType):[],vee=class mee extends qr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.object)return Vt(r,{code:Ot.invalid_type,expected:Jt.object,received:r.parsedType}),br;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Vt(r,{code:Ot.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),br)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=ml(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new mee({typeName:dr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Or(a)})}};function UT(t,e){let r=gl(t),a=gl(e);if(t===e)return{valid:!0,data:t};if(r===Jt.object&&a===Jt.object){let i=fi.objectKeys(e),h=fi.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=UT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Jt.array&&a===Jt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=UT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Jt.date&&a===Jt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var i2=class extends qr{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=(i,h)=>{if(LT(i)||LT(h))return br;let c=UT(i.value,h.value);return c.valid?((DT(i)||DT(h))&&e.dirty(),{status:e.value,value:c.data}):(Vt(r,{code:Ot.invalid_intersection_types}),br)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,h])=>a(i,h)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};i2.create=(t,e,r)=>new i2({left:t,right:e,typeName:dr.ZodIntersection,...Or(r)});var yl=class gee extends qr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.array)return Vt(a,{code:Ot.invalid_type,expected:Jt.array,received:a.parsedType}),br;if(a.data.length<this._def.items.length)return Vt(a,{code:Ot.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),br;!this._def.rest&&a.data.length>this._def.items.length&&(Vt(a,{code:Ot.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...a.data].map((h,c)=>{let p=this._def.items[c]||this._def.rest;return p?p._parse(new Lu(a,h,a.path,c)):null}).filter(h=>!!h);return a.common.async?Promise.all(i).then(h=>so.mergeArray(r,h)):so.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new gee({...this._def,rest:e})}};yl.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yl({items:t,typeName:dr.ZodTuple,rest:null,...Or(e)})};var bee=class FT extends qr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.object)return Vt(a,{code:Ot.invalid_type,expected:Jt.object,received:a.parsedType}),br;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Lu(a,p,a.path,p)),value:c._parse(new Lu(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?so.mergeObjectAsync(r,i):so.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof qr?new FT({keyType:e,valueType:r,typeName:dr.ZodRecord,...Or(a)}):new FT({keyType:N1.create(),valueType:e,typeName:dr.ZodRecord,...Or(r)})}},r4=class extends qr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==Jt.map)return Vt(r,{code:Ot.invalid_type,expected:Jt.map,received:r.parsedType}),br;let a=this._def.keyType,i=this._def.valueType,h=[...r.data.entries()].map(([c,p],b)=>({key:a._parse(new Lu(r,c,r.path,[b,"key"])),value:i._parse(new Lu(r,p,r.path,[b,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of h){let b=await p.key,g=await p.value;if(b.status==="aborted"||g.status==="aborted")return br;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}})}else{let c=new Map;for(let p of h){let b=p.key,g=p.value;if(b.status==="aborted"||g.status==="aborted")return br;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}}}};r4.create=(t,e,r)=>new r4({valueType:e,keyType:t,typeName:dr.ZodMap,...Or(r)});var i4=class jT extends qr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.set)return Vt(a,{code:Ot.invalid_type,expected:Jt.set,received:a.parsedType}),br;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Vt(a,{code:Ot.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Vt(a,{code:Ot.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return br;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Lu(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new jT({...this._def,minSize:{value:e,message:nr.toString(r)}})}max(e,r){return new jT({...this._def,maxSize:{value:e,message:nr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};i4.create=(t,e)=>new i4({valueType:t,minSize:null,maxSize:null,typeName:dr.ZodSet,...Or(e)});var yee=class j8 extends qr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.function)return Vt(r,{code:Ot.invalid_type,expected:Jt.function,received:r.parsedType}),br;function a(p,b){return Y8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G8(),O1].filter(g=>!!g),issueData:{code:Ot.invalid_arguments,argumentsError:b}})}function i(p,b){return Y8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G8(),O1].filter(g=>!!g),issueData:{code:Ot.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof L1){let p=this;return $a(async function(...b){let g=new Bf([]),y=await p._def.args.parseAsync(b,h).catch(x=>{throw g.addIssue(a(b,x)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(x=>{throw g.addIssue(i(M,x)),g})})}else{let p=this;return $a(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Bf([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Bf([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new j8({...this._def,args:yl.create(e).rest(bd.create())})}returns(e){return new j8({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new j8({args:e||yl.create([]).rest(bd.create()),returns:r||bd.create(),typeName:dr.ZodFunction,...Or(a)})}},n2=class extends qr{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};n2.create=(t,e)=>new n2({getter:t,typeName:dr.ZodLazy,...Or(e)});var a2=class extends qr{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return Vt(e,{received:e.data,code:Ot.invalid_literal,expected:this._def.value}),br}return{status:"valid",value:t.data}}get value(){return this._def.value}};a2.create=(t,e)=>new a2({value:t,typeName:dr.ZodLiteral,...Or(e)});function wee(t,e){return new R2({values:t,typeName:dr.ZodEnum,...Or(e)})}var R2=class zT extends qr{constructor(){super(...arguments),qg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Ot.invalid_type}),br}if(Q8(this,qg,"f")||hee(this,qg,new Set(this._def.values),"f"),!Q8(this,qg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{received:r.data,code:Ot.invalid_enum_value,options:a}),br}return $a(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return zT.create(e,{...this._def,...r})}exclude(e,r=this._def){return zT.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};qg=new WeakMap;R2.create=wee;var o2=class extends qr{constructor(){super(...arguments),Ug.set(this,void 0)}_parse(t){let e=fi.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Jt.string&&r.parsedType!==Jt.number){let a=fi.objectValues(e);return Vt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Ot.invalid_type}),br}if(Q8(this,Ug,"f")||hee(this,Ug,new Set(fi.getValidEnumValues(this._def.values)),"f"),!Q8(this,Ug,"f").has(t.data)){let a=fi.objectValues(e);return Vt(r,{received:r.data,code:Ot.invalid_enum_value,options:a}),br}return $a(t.data)}get enum(){return this._def.values}};Ug=new WeakMap;o2.create=(t,e)=>new o2({values:t,typeName:dr.ZodNativeEnum,...Or(e)});var L1=class extends qr{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Jt.promise&&e.common.async===!1)return Vt(e,{code:Ot.invalid_type,expected:Jt.promise,received:e.parsedType}),br;let r=e.parsedType===Jt.promise?e.data:Promise.resolve(e.data);return $a(r.then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};L1.create=(t,e)=>new L1({type:t,typeName:dr.ZodPromise,...Or(e)});var Pf=class extends qr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:h=>{Vt(r,h),h.fatal?e.abort():e.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let h=a.transform(r.data,i);if(r.common.async)return Promise.resolve(h).then(async c=>{if(e.value==="aborted")return br;let p=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return p.status==="aborted"?br:p.status==="dirty"||e.value==="dirty"?J8(p.value):p});{if(e.value==="aborted")return br;let c=this._def.schema._parseSync({data:h,path:r.path,parent:r});return c.status==="aborted"?br:c.status==="dirty"||e.value==="dirty"?J8(c.value):c}}if(a.type==="refinement"){let h=c=>{let p=a.refinement(c,i);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?br:(c.status==="dirty"&&e.dirty(),h(c.value),{status:e.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?br:(c.status==="dirty"&&e.dirty(),h(c.value).then(()=>({status:e.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){let h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Gg(h))return h;let c=a.transform(h.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>Gg(h)?Promise.resolve(a.transform(h.value,i)).then(c=>({status:e.value,value:c})):h);fi.assertNever(a)}};Pf.create=(t,e,r)=>new Pf({schema:t,typeName:dr.ZodEffects,effect:e,...Or(r)});Pf.createWithPreprocess=(t,e,r)=>new Pf({schema:e,effect:{type:"preprocess",transform:t},typeName:dr.ZodEffects,...Or(r)});var Nu=class extends qr{_parse(t){return this._getType(t)===Jt.undefined?$a(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Nu.create=(t,e)=>new Nu({innerType:t,typeName:dr.ZodOptional,...Or(e)});var wl=class extends qr{_parse(t){return this._getType(t)===Jt.null?$a(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wl.create=(t,e)=>new wl({innerType:t,typeName:dr.ZodNullable,...Or(e)});var s2=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===Jt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};s2.create=(t,e)=>new s2({innerType:t,typeName:dr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Or(e)});var f2=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X8(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bf(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Bf(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};f2.create=(t,e)=>new f2({innerType:t,typeName:dr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Or(e)});var n4=class extends qr{_parse(t){if(this._getType(t)!==Jt.nan){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.nan,received:e.parsedType}),br}return{status:"valid",value:t.data}}};n4.create=t=>new n4({typeName:dr.ZodNaN,...Or(t)});var w_e=Symbol("zod_brand"),cI=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},lI=class _ee extends qr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?br:i.status==="dirty"?(r.dirty(),J8(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?br:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new _ee({in:e,out:r,typeName:dr.ZodPipeline})}},u2=class extends qr{_parse(t){let e=this._def.innerType._parse(t);return Gg(e)&&(e.value=Object.freeze(e.value)),e}unwrap(){return this._def.innerType}};u2.create=(t,e)=>new u2({innerType:t,typeName:dr.ZodReadonly,...Or(e)});function Mee(t,e={},r){return t?C1.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):C1.create()}var __e={object:Ds.lazycreate},dr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(dr||(dr={}));var M_e=(t,e={message:`Input not instance of ${t.name}`})=>Mee(r=>r instanceof t,e),xee=N1.create,See=Yg.create,x_e=n4.create,S_e=Jg.create,Eee=Xg.create,E_e=Qg.create,A_e=e4.create,R_e=e2.create,T_e=t2.create,I_e=C1.create,k_e=bd.create,B_e=Uh.create,P_e=t4.create,O_e=wd.create,N_e=Ds.create,C_e=Ds.strictCreate,L_e=r2.create,D_e=vee.create,$_e=i2.create,q_e=yl.create,U_e=bee.create,F_e=r4.create,j_e=i4.create,z_e=yee.create,Z_e=n2.create,H_e=a2.create,K_e=R2.create,W_e=o2.create,V_e=L1.create,EQ=Pf.create,G_e=Nu.create,Y_e=wl.create,J_e=Pf.createWithPreprocess,X_e=lI.create,Q_e=()=>xee().optional(),e9e=()=>See().optional(),t9e=()=>Eee().optional(),r9e={string:t=>N1.create({...t,coerce:!0}),number:t=>Yg.create({...t,coerce:!0}),boolean:t=>Xg.create({...t,coerce:!0}),bigint:t=>Jg.create({...t,coerce:!0}),date:t=>Qg.create({...t,coerce:!0})},i9e=br,pi=Object.freeze({__proto__:null,defaultErrorMap:O1,setErrorMap:i_e,getErrorMap:G8,makeIssue:Y8,EMPTY_PATH:n_e,addIssueToContext:Vt,ParseStatus:so,INVALID:br,DIRTY:J8,OK:$a,isAborted:LT,isDirty:DT,isValid:Gg,isAsync:X8,get util(){return fi},get objectUtil(){return CT},ZodParsedType:Jt,getParsedType:gl,ZodType:qr,datetimeRegex:dee,ZodString:N1,ZodNumber:Yg,ZodBigInt:Jg,ZodBoolean:Xg,ZodDate:Qg,ZodSymbol:e4,ZodUndefined:e2,ZodNull:t2,ZodAny:C1,ZodUnknown:bd,ZodNever:Uh,ZodVoid:t4,ZodArray:wd,ZodObject:Ds,ZodUnion:r2,ZodDiscriminatedUnion:vee,ZodIntersection:i2,ZodTuple:yl,ZodRecord:bee,ZodMap:r4,ZodSet:i4,ZodFunction:yee,ZodLazy:n2,ZodLiteral:a2,ZodEnum:R2,ZodNativeEnum:o2,ZodPromise:L1,ZodEffects:Pf,ZodTransformer:Pf,ZodOptional:Nu,ZodNullable:wl,ZodDefault:s2,ZodCatch:f2,ZodNaN:n4,BRAND:w_e,ZodBranded:cI,ZodPipeline:lI,ZodReadonly:u2,custom:Mee,Schema:qr,ZodSchema:qr,late:__e,get ZodFirstPartyTypeKind(){return dr},coerce:r9e,any:I_e,array:O_e,bigint:S_e,boolean:Eee,date:E_e,discriminatedUnion:D_e,effect:EQ,enum:K_e,function:z_e,instanceof:M_e,intersection:$_e,lazy:Z_e,literal:H_e,map:F_e,nan:x_e,nativeEnum:W_e,never:B_e,null:T_e,nullable:Y_e,number:See,object:N_e,oboolean:t9e,onumber:e9e,optional:G_e,ostring:Q_e,pipeline:X_e,preprocess:J_e,promise:V_e,record:U_e,set:j_e,strictObject:C_e,string:xee,symbol:A_e,transformer:EQ,tuple:q_e,undefined:R_e,union:L_e,unknown:k_e,void:P_e,NEVER:i9e,ZodIssueCode:Ot,quotelessJson:r_e,ZodError:Bf}),Aee=pi.object({url:pi.string(),address:pi.string()}),Ree=pi.object({url:pi.string(),address:pi.string(),ttl:pi.coerce.number()}),n9e=pi.function().args(pi.string(),pi.string()).returns(pi.promise(pi.string())),a9e=pi.function().args(pi.string()).returns(pi.promise(Aee.nullish())),o9e=pi.function().args(pi.string(),Aee,pi.number()).returns(pi.promise(pi.any())),dI=pi.function().args(pi.string()).returns(pi.promise(Ree.nullish())),pI=pi.function().args(pi.string(),pi.string(),pi.number()).returns(pi.promise(pi.any())),b4=pi.function().args(pi.string()).returns(pi.promise(Ree)),s9e=b4;function vI(t=""){return t=t.trim(),t.endsWith("/")?vI(t.slice(0,-1)):t}function f9e({loadProcessScheduler:t,loadScheduler:e,cache:r,followRedirects:a,checkForRedirect:i}){t=s9e.implement(t),e=b4.implement(e),i=n9e.implement(i);let h=a9e.implement(r.getByProcess),c=dI.implement(r.getByOwner),p=o9e.implement(r.setByProcess),b=pI.implement(r.setByOwner);return(g,y)=>h(g).then(async M=>M||Promise.resolve().then(async()=>y?await c(y)||e(y).then(E=>(b(E.address,E.url,E.ttl),E)):t(g)).then(async x=>{let E=x.url;a&&(E=await i(x.url,g));let A={url:vI(E),address:x.address};return await p(g,A,x.ttl),A}))}function u9e({loadScheduler:t,cache:e}){t=b4.implement(t);let r=dI.implement(e.getByOwner),a=pI.implement(e.setByOwner);return i=>r(i).then(h=>h?{url:h.url}:t(i).then(c=>a(i,c.url,c.ttl).then(()=>({url:vI(c.url)}))).catch(c=>{if(!(c instanceof W8))throw c}))}function h9e({loadScheduler:t,cache:e}){t=b4.implement(t);let r=dI.implement(e.getByOwner),a=pI.implement(e.setByOwner);return i=>r(i).then(h=>h?!0:t(i).then(c=>a(i,c.url,c.ttl)).then(()=>!0).catch(c=>{if(c instanceof W8)return!1;throw c}))}var c9e="https://arweave.net/graphql";function Tee({cacheSize:t=100,GRAPHQL_URL:e=c9e,followRedirects:r=!1}={}){let a=Y7e({size:t}),i=ree({fetch,GRAPHQL_URL:e}),h={getByProcess:J7e({cache:a}),getByOwner:Q7e({cache:a}),setByProcess:X7e({cache:a}),setByOwner:e_e({cache:a})},c=f9e({loadProcessScheduler:K7e({fetch,GRAPHQL_URL:e}),loadScheduler:i,cache:h,followRedirects:r,checkForRedirect:t_e({fetch})}),p=h9e({loadScheduler:i,cache:h}),b=u9e({loadScheduler:i,cache:h});return{locate:c,validate:p,raw:b}}var l9e=globalThis.GRAPHQL_URL||void 0,d9e=globalThis.SCHEDULER_UTILS_CACHE_SIZE||void 0,p9e=globalThis.SCHEDULER_UTILS_FOLLOW_REDIRECTS==="true"||void 0,{locate:uut,validate:hut,raw:cut}=Tee({GRAPHQL_URL:l9e,cacheSize:d9e,followRedirects:p9e}),$h=t=>({fork:t,toPromise:()=>new Promise((e,r)=>t(r,e)),map:e=>$h((r,a)=>t(r,i=>a(e(i)))),bimap:(e,r)=>$h((a,i)=>t(h=>a(e(h)),h=>i(r(h)))),chain:e=>$h((r,a)=>t(r,i=>e(i).fork(r,a))),bichain:(e,r)=>$h((a,i)=>t(h=>e(h).fork(a,i),h=>r(h).fork(a,i))),fold:(e,r)=>$h((a,i)=>t(h=>e(h).fork(a,i),h=>r(h).fork(a,i)))}),jr=t=>$h((e,r)=>r(t)),_d=t=>$h((e,r)=>r(t)),xl=t=>$h((e,r)=>e(t)),Li=t=>(...e)=>$h((r,a)=>t(...e).then(a).catch(r));function v9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployMessage");return i=>jr(i).chain(Li(({processId:h,data:c,tags:p,anchor:b,signer:g})=>g({data:c,tags:p,target:h,anchor:b}))).chain(h=>jr(h).chain(Li(async c=>t(e,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return c.json();throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when writing message via MU"),a.tap("Successfully wrote message via MU")).map(c=>({res:c,messageId:h.id}))).toPromise()}function m9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployProcess");return i=>jr(i).chain(Li(({data:h,tags:c,signer:p})=>p({data:h,tags:c}))).chain(h=>jr(h).chain(Li(async c=>t(e,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return c.json();throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when deploying process via MU"),a.tap("Successfully deployed process via MU")).map(c=>({res:c,processId:h.id}))).toPromise()}function g9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployMonitor");return i=>jr(i).chain(Li(({processId:h,data:c,tags:p,anchor:b,signer:g})=>g({data:c,tags:p,target:h,anchor:b}))).chain(h=>jr(h).chain(Li(async c=>t(e+"/monitor/"+i.processId,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return{ok:!0};throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when subscribing to process via MU"),a.tap("Successfully subscribed to process via MU")).map(c=>({res:c,messageId:h.id}))).toPromise()}function b9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployUnmonitor");return i=>jr(i).chain(Li(({processId:h,data:c,tags:p,anchor:b,signer:g})=>g({data:c,tags:p,target:h,anchor:b}))).chain(h=>jr(h).chain(Li(async c=>t(e+"/monitor/"+i.processId,{method:"DELETE",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return{ok:!0};throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when unsubscribing to process via MU"),a.tap("Successfully unsubscribed to process via MU")).map(c=>({res:c,messageId:h.id}))).toPromise()}function y9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployAssign");return i=>jr(i).chain(Li(async({process:h,message:c,baseLayer:p,exclude:b})=>t(`${e}?process-id=${h}&assign=${c}${p?"&base-layer":""}${b?"&exclude="+b.join(","):""}`,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"}}))).bichain(h=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(h)}`)),Li(async h=>{if(h.ok)return h.json();throw new Error(`${h.status}: ${await h.text()}`)})).bimap(a.tap("Error encountered when writing assignment via MU"),a.tap("Successfully wrote assignment via MU")).map(h=>({res:h,assignmentId:h.id})).toPromise()}function w9e({fetch:t,CU_URL:e,logger:r}){return a=>jr(a).map(r.tap("posting dryrun request to CU")).chain(Li(i=>t(`${e}/dry-run?process-id=${i.Target}`,{method:"POST",headers:{"Content-Type":"application/json"},redirect:"follow",body:JSON.stringify(i)}).then(h=>h.json()))).toPromise()}function _9e({fetch:t,CU_URL:e,logger:r}){return({id:a,processId:i})=>jr(`${e}/result/${a}?process-id=${i}`).map(r.tap("fetching message result from CU")).chain(Li(async h=>t(h,{method:"GET",headers:{Accept:"application/json"},redirect:"follow"}).then(c=>c.json()))).toPromise()}function M9e({fetch:t,CU_URL:e,logger:r}){return({process:a,from:i,to:h,sort:c,limit:p})=>{let b=new URL(`${e}/results/${a}`),g=new URLSearchParams(b.search);return i&&g.append("from",i),h&&g.append("to",h),c&&g.append("sort",c),p&&g.append("limit",p),b.search=g,jr(b.toString()).map(r.tap("fetching message result from CU")).chain(Li(async y=>t(y,{method:"GET",headers:{Accept:"application/json"},redirect:"follow"}).then(M=>M.json()))).toPromise()}}var x9e=nI(w5e(),1),jg,S9e=({MAX_SIZE:t})=>jg||(jg=new x9e.default(t),jg),AT=({logger:t,fetch:e,cache:r=jg})=>async({suUrl:a,processId:i})=>r.has(i)?r.get(i):e(`${a}/processes/${i}`,{method:"GET",redirect:"follow"}).then(async h=>{if(h.ok)return h.json();throw t("Error Encountered when fetching process meta from SU '%s' for process '%s'",a,i),new Error(`Encountered Error fetching scheduled messages from Scheduler Unit: ${h.status}: ${await h.text()}`)}).then(h=>(t("Caching process meta for process '%s'",i),r.set(i,{tags:h.tags}),h)),E9e=function(){return!1},A9e=E9e,R9e=function(){return!0},mI=R9e,Fh={"@@functional/placeholder":!0};function Gi(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function Tn(t){return function e(r){return arguments.length===0||Gi(r)?e:t.apply(this,arguments)}}function Ki(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Gi(r)?e:Tn(function(i){return t(r,i)});default:return Gi(r)&&Gi(a)?e:Gi(r)?Tn(function(i){return t(i,a)}):Gi(a)?Tn(function(i){return t(r,i)}):t(r,a)}}}function T9e(t,e){t=t||[],e=e||[];var r,a=t.length,i=e.length,h=[];for(r=0;r<a;)h[h.length]=t[r],r+=1;for(r=0;r<i;)h[h.length]=e[r],r+=1;return h}function T2(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Iee(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,p=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Gi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Gi(b)?p=!0:h-=1,c+=1}return!p&&h<=0?r.apply(this,a):T2(Math.max(0,h),Iee(t,a,r))}}var I9e=Ki(function(e,r){return e===1?Tn(r):T2(e,Iee(e,[],r))}),y4=I9e;function xd(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Gi(r)?e:Ki(function(h,c){return t(r,h,c)});case 2:return Gi(r)&&Gi(a)?e:Gi(r)?Ki(function(h,c){return t(h,a,c)}):Gi(a)?Ki(function(h,c){return t(r,h,c)}):Tn(function(h){return t(r,a,h)});default:return Gi(r)&&Gi(a)&&Gi(i)?e:Gi(r)&&Gi(a)?Ki(function(h,c){return t(h,c,i)}):Gi(r)&&Gi(i)?Ki(function(h,c){return t(h,a,c)}):Gi(a)&&Gi(i)?Ki(function(h,c){return t(r,h,c)}):Gi(r)?Tn(function(h){return t(h,a,i)}):Gi(a)?Tn(function(h){return t(r,h,i)}):Gi(i)?Tn(function(h){return t(r,a,h)}):t(r,a,i)}}}var D1=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function k9e(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function w4(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!D1(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(k9e(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}var Du={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function AQ(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function RQ(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function B9e(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function $1(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function P9e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var RT=typeof Object.is=="function"?Object.is:P9e,TQ=Object.prototype.toString,O9e=function(){return TQ.call(arguments)==="[object Arguments]"?function(e){return TQ.call(e)==="[object Arguments]"}:function(e){return $1("callee",e)}}(),N9e=O9e,C9e=!{toString:null}.propertyIsEnumerable("toString"),IQ=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],kQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),L9e=function(e,r){for(var a=0;a<e.length;){if(e[a]===r)return!0;a+=1}return!1},D9e=Tn(typeof Object.keys=="function"&&!kQ?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var r,a,i=[],h=kQ&&N9e(e);for(r in e)$1(r,e)&&(!h||r!=="length")&&(i[i.length]=r);if(C9e)for(a=IQ.length-1;a>=0;)r=IQ[a],$1(r,e)&&!L9e(i,r)&&(i[i.length]=r),a-=1;return i}),q1=D9e,$9e=Tn(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),BQ=$9e;function PQ(t,e,r,a){var i=AQ(t),h=AQ(e);function c(p,b){return gI(p,b,r.slice(),a.slice())}return!RQ(function(p,b){return!RQ(c,b,p)},h,i)}function gI(t,e,r,a){if(RT(t,e))return!0;var i=BQ(t);if(i!==BQ(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&B9e(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&RT(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!RT(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:PQ(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:PQ(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=q1(t);if(c.length!==q1(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!($1(g,e)&&gI(e[g],t[g],p,b)))return!1;h-=1}return!0}var q9e=Ki(function(e,r){return gI(e,r,[],[])}),k1=q9e;function U9e(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(k1(t[r],e))return r;r+=1}return-1}function kee(t,e){return U9e(e,t,0)>=0}function z8(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function TT(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var Lg=function(e){return(e<10?"0":"")+e},F9e=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+Lg(e.getUTCMonth()+1)+"-"+Lg(e.getUTCDate())+"T"+Lg(e.getUTCHours())+":"+Lg(e.getUTCMinutes())+":"+Lg(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},j9e=F9e;function z9e(t){return function(){return!t.apply(this,arguments)}}function Bee(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function Z9e(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function H9e(t){return Object.prototype.toString.call(t)==="[object Object]"}var K9e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Du.init,t.prototype["@@transducer/result"]=Du.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function W9e(t){return function(e){return new K9e(t,e)}}var V9e=Ki(w4(["fantasy-land/filter","filter"],W9e,function(t,e){return H9e(e)?Bee(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},q1(e)):Z9e(t,e)})),G9e=V9e,Y9e=Ki(function(e,r){return G9e(z9e(e),r)}),Pee=Y9e;function Oee(t,e){var r=function(c){var p=e.concat([t]);return kee(c,p)?"<Circular>":Oee(c,p)},a=function(h,c){return z8(function(p){return TT(p)+": "+r(h[p])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+z8(r,t).join(", ")+"))";case"[object Array]":return"["+z8(r,t).concat(a(t,Pee(function(h){return/^\d+$/.test(h)},q1(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):TT(j9e(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":TT(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,q1(t)).join(", ")+"}"}}var J9e=Tn(function(e){return Oee(e,[])}),B1=J9e,X9e=Ki(function(e,r){if(e===r)return r;function a(b,g){if(b>g!=g>b)return g>b?g:b}var i=a(e,r);if(i!==void 0)return i;var h=a(typeof e,typeof r);if(h!==void 0)return h===typeof e?e:r;var c=B1(e),p=a(c,B1(r));return p!==void 0&&p===c?e:r}),Nee=X9e,Q9e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Du.init,t.prototype["@@transducer/result"]=Du.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),eMe=function(e){return function(r){return new Q9e(e,r)}},Cee=eMe,tMe=Ki(w4(["fantasy-land/map","map"],Cee,function(e,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return y4(r.length,function(){return e.call(this,r.apply(this,arguments))});case"[object Object]":return Bee(function(a,i){return a[i]=e(r[i]),a},{},q1(r));default:return z8(e,r)}})),_4=tMe,M4=Number.isInteger||function(e){return e<<0===e};function a4(t){return Object.prototype.toString.call(t)==="[object String]"}function Lee(t,e){var r=t<0?e.length+t:t;return a4(e)?e.charAt(r):e[r]}var rMe=Ki(function(e,r){if(r!=null)return M4(e)?Lee(e,r):r[e]}),Sd=rMe,iMe=Ki(function(e,r){return _4(Sd(e),r)}),nMe=iMe,aMe=Tn(function(e){return D1(e)?!0:!e||typeof e!="object"||a4(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),bI=aMe,OQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function oMe(t,e,r){return function(i,h,c){if(bI(c))return t(i,h,c);if(c==null)return h;if(typeof c["fantasy-land/reduce"]=="function")return e(i,h,c,"fantasy-land/reduce");if(c[OQ]!=null)return r(i,h,c[OQ]());if(typeof c.next=="function")return r(i,h,c);if(typeof c.reduce=="function")return e(i,h,c,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Dee(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var sMe=Ki(function(e,r){return T2(e.length,function(){return e.apply(r,arguments)})}),fMe=sMe;function uMe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function hMe(t,e,r,a){return t["@@transducer/result"](r[a](fMe(t["@@transducer/step"],t),e))}var cMe=oMe(Dee,hMe,uMe),$ee=cMe,lMe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function dMe(t){return new lMe(t)}var pMe=xd(function(t,e,r){return $ee(typeof t=="function"?dMe(t):t,e,r)}),U1=pMe,vMe=Tn(function(e){return y4(U1(Nee,0,nMe("length",e)),function(){for(var r=0,a=e.length;r<a;){if(!e[r].apply(this,arguments))return!1;r+=1}return!0})}),mMe=vMe,gMe=Tn(function(e){return function(){return e}}),yI=gMe,bMe=Ki(function(e,r){return T9e(r,[e])}),wI=bMe;function yMe(t,e,r){if(M4(t)&&D1(r)){var a=[].concat(r);return a[t]=e,a}var i={};for(var h in r)i[h]=r[h];return i[t]=e,i}var wMe=Tn(function(e){return e==null}),o4=wMe,_Me=xd(function t(e,r,a){if(e.length===0)return r;var i=e[0];if(e.length>1){var h=!o4(a)&&$1(i,a)&&typeof a[i]=="object"?a[i]:M4(e[1])?[]:{};r=t(Array.prototype.slice.call(e,1),r,h)}return yMe(i,r,a)}),MMe=_Me,xMe=xd(function(e,r,a){return MMe([e],r,a)}),$s=xMe;function ZT(t){var e=Object.prototype.toString.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"}function SMe(t){return function e(r){for(var a,i,h,c=[],p=0,b=r.length;p<b;){if(bI(r[p]))for(a=t?e(r[p]):r[p],h=0,i=a.length;h<i;)c[c.length]=a[h],h+=1;else c[c.length]=r[p];p+=1}return c}}function EMe(t){return{"@@transducer/value":t,"@@transducer/reduced":!0}}var qee="@@transducer/init",HT="@@transducer/step",Uee="@@transducer/result",AMe=function(){function t(e){this.xf=e}return t.prototype[qee]=Du.init,t.prototype[Uee]=Du.result,t.prototype[HT]=function(e,r){var a=this.xf[HT](e,r);return a["@@transducer/reduced"]?EMe(a):a},t}(),RMe=function(){function t(e){this.xf=new AMe(e)}return t.prototype[qee]=Du.init,t.prototype[Uee]=Du.result,t.prototype[HT]=function(e,r){return bI(r)?$ee(this.xf,e,r):Dee(this.xf,e,[r])},t}(),TMe=function(e){return new RMe(e)},IMe=TMe;function kMe(t){return function(e){return Cee(t)(IMe(e))}}var BMe=Ki(w4(["fantasy-land/chain","chain"],kMe,function(e,r){return typeof r=="function"?function(a){return e(r(a))(a)}:SMe(!1)(_4(e,r))})),PMe=BMe;function OMe(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function Fee(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return D1(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var NMe=xd(Fee("slice",function(e,r,a){return Array.prototype.slice.call(a,e,r)})),CMe=NMe,LMe=Tn(Fee("tail",CMe(1,1/0))),DMe=LMe;function F1(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return T2(arguments[0].length,U1(OMe,arguments[0],DMe(arguments)))}function $Me(t){return t}var qMe=Tn($Me),Ed=qMe,UMe=Ki(function(e,r){if(D1(e)){if(D1(r))return e.concat(r);throw new TypeError(B1(r)+" is not an array")}if(a4(e)){if(a4(r))return e+r;throw new TypeError(B1(r)+" is not a string")}if(e!=null&&ZT(e["fantasy-land/concat"]))return e["fantasy-land/concat"](r);if(e!=null&&ZT(e.concat))return e.concat(r);throw new TypeError(B1(e)+' does not have a method named "concat" or "fantasy-land/concat"')}),_I=UMe,FMe=Tn(function(e){var r=U1(Nee,0,_4(function(a){return a[0].length},e));return T2(r,function(){for(var a=0;a<e.length;){if(e[a][0].apply(this,arguments))return e[a][1].apply(this,arguments);a+=1}})}),jee=FMe,jMe=Ki(function(e,r){return r==null||r!==r?e:r}),x4=jMe,zMe=Ki(function(e,r){if(e.length===0||o4(r))return!1;for(var a=r,i=0;i<e.length;)if(!o4(a)&&$1(e[i],a))a=a[e[i]],i+=1;else return!1;return!0}),ZMe=zMe,HMe=Ki(function(e,r){return ZMe([e],r)}),KMe=HMe,WMe=xd(function(e,r,a){return y4(Math.max(e.length,r.length,a.length),function(){return e.apply(this,arguments)?r.apply(this,arguments):a.apply(this,arguments)})}),MI=WMe,VMe=Ki(kee),GMe=VMe,YMe=Ki(function(e,r){return y4(e+1,function(){var a=arguments[e];if(a!=null&&ZT(a[r]))return a[r].apply(a,Array.prototype.slice.call(arguments,0,e));throw new TypeError(B1(a)+' does not have a method named "'+r+'"')})}),JMe=YMe,XMe=Ki(function(e,r){return r instanceof e||r!=null&&(r.constructor===e||e.name==="Object"&&typeof r=="object")}),Wg=XMe,QMe=Tn(function(e){return!o4(e)}),IT=QMe,exe=JMe(1,"join"),txe=exe;function rxe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];M4(i)?r=Lee(i,r):r=r[i]}return r}var ixe=Ki(rxe),nxe=ixe,axe=xd(function(e,r,a){return k1(e,Sd(r,a))}),NQ=axe,oxe=xd(function(e,r,a){return x4(e,Sd(r,a))}),sxe=oxe,fxe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Du.init,t.prototype["@@transducer/result"]=Du.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r),this.xf["@@transducer/step"](e,r)},t}();function uxe(t){return function(e){return new fxe(t,e)}}var hxe=Ki(w4([],uxe,function(e,r){return e(r),r})),cxe=hxe,ui;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(ui||(ui={}));var KT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(KT||(KT={}));var Xt=ui.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bl=t=>{switch(typeof t){case"undefined":return Xt.undefined;case"string":return Xt.string;case"number":return isNaN(t)?Xt.nan:Xt.number;case"boolean":return Xt.boolean;case"function":return Xt.function;case"bigint":return Xt.bigint;case"symbol":return Xt.symbol;case"object":return Array.isArray(t)?Xt.array:t===null?Xt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Xt.promise:typeof Map<"u"&&t instanceof Map?Xt.map:typeof Set<"u"&&t instanceof Set?Xt.set:typeof Date<"u"&&t instanceof Date?Xt.date:Xt.object;default:return Xt.unknown}},Rt=ui.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),lxe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ls=class zee extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof zee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ui.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Ls.create=t=>new Ls(t);var j1=(t,e)=>{let r;switch(t.code){case Rt.invalid_type:t.received===Xt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Rt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ui.jsonStringifyReplacer)}`;break;case Rt.unrecognized_keys:r=`Unrecognized key(s) in object: ${ui.joinValues(t.keys,", ")}`;break;case Rt.invalid_union:r="Invalid input";break;case Rt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ui.joinValues(t.options)}`;break;case Rt.invalid_enum_value:r=`Invalid enum value. Expected ${ui.joinValues(t.options)}, received '${t.received}'`;break;case Rt.invalid_arguments:r="Invalid function arguments";break;case Rt.invalid_return_type:r="Invalid function return type";break;case Rt.invalid_date:r="Invalid date";break;case Rt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ui.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Rt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Rt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Rt.custom:r="Invalid input";break;case Rt.invalid_intersection_types:r="Intersection results could not be merged";break;case Rt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Rt.not_finite:r="Number must be finite";break;default:r=e.defaultError,ui.assertNever(t)}return{message:r}},Zee=j1;function dxe(t){Zee=t}function s4(){return Zee}var f4=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},pxe=[];function Gt(t,e){let r=s4(),a=f4({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===j1?void 0:j1].filter(i=>!!i)});t.common.issues.push(a)}var fo=class Hee{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return mr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return Hee.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return mr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},mr=Object.freeze({status:"aborted"}),I1=t=>({status:"dirty",value:t}),qa=t=>({status:"valid",value:t}),WT=t=>t.status==="aborted",VT=t=>t.status==="dirty",h2=t=>t.status==="valid",c2=t=>typeof Promise<"u"&&t instanceof Promise;function u4(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function Kee(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ar;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ar||(ar={}));var zg,Zg,$u=class{constructor(t,e,r,a){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},CQ=(t,e)=>{if(h2(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ls(t.common.issues);return this._error=r,this._error}}};function Nr(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,p)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:c.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Ur=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return bl(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new fo,ctx:{common:t.parent.common,data:t.data,parsedType:bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(c2(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let a={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:bl(t)},i=this._parseSync({data:t,path:a.path,parent:a});return CQ(a,i)}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:bl(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(c2(a)?a:Promise.resolve(a));return CQ(r,i)}refine(t,e){let r=a=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(a):e;return this._refinement((a,i)=>{let h=t(a),c=()=>i.addIssue({code:Rt.custom,...r(a)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(c(),!1)):h?!0:(c(),!1)})}refinement(t,e){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof e=="function"?e(r,a):e),!1))}_refinement(t){return new Of({schema:this,typeName:pr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Cu.create(this,this._def)}nullable(){return Ml.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Md.create(this,this._def)}promise(){return H1.create(this,this._def)}or(t){return b2.create([this,t],this._def)}and(t){return y2.create(this,t,this._def)}transform(t){return new Of({...Nr(this._def),schema:this,typeName:pr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new x2({...Nr(this._def),innerType:this,defaultValue:e,typeName:pr.ZodDefault})}brand(){return new xI({typeName:pr.ZodBranded,type:this,...Nr(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new S2({...Nr(this._def),innerType:this,catchValue:e,typeName:pr.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return SI.create(this,t)}readonly(){return E2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vxe=/^c[^\s-]{8,}$/i,mxe=/^[0-9a-z]+$/,gxe=/^[0-9A-HJKMNP-TV-Z]{26}$/,bxe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yxe=/^[a-z0-9_-]{21}$/i,wxe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_xe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mxe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kT,xxe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sxe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Exe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wee="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Axe=new RegExp(`^${Wee}$`);function Vee(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Rxe(t){return new RegExp(`^${Vee(t)}$`)}function Gee(t){let e=`${Wee}T${Vee(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Txe(t,e){return!!((e==="v4"||!e)&&xxe.test(t)||(e==="v6"||!e)&&Sxe.test(t))}var z1=class Hg extends Ur{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Xt.string){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.string,received:h.parsedType}),mr}let a=new fo,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,p=e.data.length<h.value;(c||p)&&(i=this._getOrReturnCtx(e,i),c?Gt(i,{code:Rt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Gt(i,{code:Rt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")_xe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"email",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")kT||(kT=new RegExp(Mxe,"u")),kT.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"emoji",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")bxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"uuid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")yxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"nanoid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")vxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"cuid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")mxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"cuid2",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")gxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"ulid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Gt(i,{validation:"url",code:Rt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"regex",code:Rt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?Gee(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?Axe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?Rxe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?wxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"duration",code:Rt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?Txe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"ip",code:Rt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?Exe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"base64",code:Rt.invalid_string,message:h.message}),a.dirty()):ui.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Rt.invalid_string,...ar.errToObj(a)})}_addCheck(e){return new Hg({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ar.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ar.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ar.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ar.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ar.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ar.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ar.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ar.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ar.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ar.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...ar.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ar.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ar.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ar.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ar.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ar.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ar.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ar.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ar.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ar.errToObj(r)})}nonempty(e){return this.min(1,ar.errToObj(e))}trim(){return new Hg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};z1.create=t=>{var e;return new z1({checks:[],typeName:pr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Nr(t)})};function Ixe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var l2=class GT extends Ur{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Xt.number){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.number,received:h.parsedType}),mr}let a,i=new fo;for(let h of this._def.checks)h.kind==="int"?ui.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?Ixe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.not_finite,message:h.message}),i.dirty()):ui.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ar.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ar.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ar.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ar.toString(r))}setLimit(e,r,a,i){return new GT({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ar.toString(i)}]})}_addCheck(e){return new GT({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ar.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ar.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ar.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ar.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ar.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ar.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ar.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ar.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ar.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ui.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};l2.create=t=>new l2({checks:[],typeName:pr.ZodNumber,coerce:t?.coerce||!1,...Nr(t)});var d2=class YT extends Ur{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Xt.bigint){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.bigint,received:h.parsedType}),mr}let a,i=new fo;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):ui.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ar.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ar.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ar.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ar.toString(r))}setLimit(e,r,a,i){return new YT({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ar.toString(i)}]})}_addCheck(e){return new YT({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ar.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ar.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ar.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ar.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ar.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};d2.create=t=>{var e;return new d2({checks:[],typeName:pr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Nr(t)})};var p2=class extends Ur{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Xt.boolean){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.boolean,received:r.parsedType}),mr}return qa(t.data)}};p2.create=t=>new p2({typeName:pr.ZodBoolean,coerce:t?.coerce||!1,...Nr(t)});var v2=class Yee extends Ur{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Xt.date){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.date,received:h.parsedType}),mr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_date}),mr}let a=new fo,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):ui.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yee({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ar.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ar.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};v2.create=t=>new v2({checks:[],coerce:t?.coerce||!1,typeName:pr.ZodDate,...Nr(t)});var h4=class extends Ur{_parse(t){if(this._getType(t)!==Xt.symbol){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.symbol,received:r.parsedType}),mr}return qa(t.data)}};h4.create=t=>new h4({typeName:pr.ZodSymbol,...Nr(t)});var m2=class extends Ur{_parse(t){if(this._getType(t)!==Xt.undefined){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.undefined,received:r.parsedType}),mr}return qa(t.data)}};m2.create=t=>new m2({typeName:pr.ZodUndefined,...Nr(t)});var g2=class extends Ur{_parse(t){if(this._getType(t)!==Xt.null){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.null,received:r.parsedType}),mr}return qa(t.data)}};g2.create=t=>new g2({typeName:pr.ZodNull,...Nr(t)});var Z1=class extends Ur{constructor(){super(...arguments),this._any=!0}_parse(t){return qa(t.data)}};Z1.create=t=>new Z1({typeName:pr.ZodAny,...Nr(t)});var yd=class extends Ur{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qa(t.data)}};yd.create=t=>new yd({typeName:pr.ZodUnknown,...Nr(t)});var jh=class extends Ur{_parse(t){let e=this._getOrReturnCtx(t);return Gt(e,{code:Rt.invalid_type,expected:Xt.never,received:e.parsedType}),mr}};jh.create=t=>new jh({typeName:pr.ZodNever,...Nr(t)});var c4=class extends Ur{_parse(t){if(this._getType(t)!==Xt.undefined){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.void,received:r.parsedType}),mr}return qa(t.data)}};c4.create=t=>new c4({typeName:pr.ZodVoid,...Nr(t)});var Md=class Z8 extends Ur{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Xt.array)return Gt(r,{code:Rt.invalid_type,expected:Xt.array,received:r.parsedType}),mr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Gt(r,{code:c?Rt.too_big:Rt.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Gt(r,{code:Rt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Gt(r,{code:Rt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new $u(r,c,r.path,p)))).then(c=>fo.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new $u(r,c,r.path,p)));return fo.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new Z8({...this._def,minLength:{value:e,message:ar.toString(r)}})}max(e,r){return new Z8({...this._def,maxLength:{value:e,message:ar.toString(r)}})}length(e,r){return new Z8({...this._def,exactLength:{value:e,message:ar.toString(r)}})}nonempty(e){return this.min(1,e)}};Md.create=(t,e)=>new Md({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pr.ZodArray,...Nr(e)});function T1(t){if(t instanceof qs){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Cu.create(T1(a))}return new qs({...t._def,shape:()=>e})}else return t instanceof Md?new Md({...t._def,type:T1(t.element)}):t instanceof Cu?Cu.create(T1(t.unwrap())):t instanceof Ml?Ml.create(T1(t.unwrap())):t instanceof _l?_l.create(t.items.map(e=>T1(e))):t}var qs=class If extends Ur{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ui.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Xt.object){let g=this._getOrReturnCtx(e);return Gt(g,{code:Rt.invalid_type,expected:Xt.object,received:g.parsedType}),mr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof jh&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||p.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new $u(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof jh){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Gt(i,{code:Rt.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new $u(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>fo.mergeObjectSync(a,g)):fo.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return ar.errToObj,new If({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=ar.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new If({...this._def,unknownKeys:"strip"})}passthrough(){return new If({...this._def,unknownKeys:"passthrough"})}extend(e){return new If({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new If({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:pr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new If({...this._def,catchall:e})}pick(e){let r={};return ui.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new If({...this._def,shape:()=>r})}omit(e){let r={};return ui.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new If({...this._def,shape:()=>r})}deepPartial(){return T1(this)}partial(e){let r={};return ui.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new If({...this._def,shape:()=>r})}required(e){let r={};return ui.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Cu;)h=h._def.innerType;r[a]=h}}),new If({...this._def,shape:()=>r})}keyof(){return rte(ui.objectKeys(this.shape))}};qs.create=(t,e)=>new qs({shape:()=>t,unknownKeys:"strip",catchall:jh.create(),typeName:pr.ZodObject,...Nr(e)});qs.strictCreate=(t,e)=>new qs({shape:()=>t,unknownKeys:"strict",catchall:jh.create(),typeName:pr.ZodObject,...Nr(e)});qs.lazycreate=(t,e)=>new qs({shape:t,unknownKeys:"strip",catchall:jh.create(),typeName:pr.ZodObject,...Nr(e)});var b2=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function a(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return e.common.issues.push(...c.ctx.common.issues),c.result;let h=i.map(c=>new Ls(c.ctx.common.issues));return Gt(e,{code:Rt.invalid_union,unionErrors:h}),mr}if(e.common.async)return Promise.all(r.map(async i=>{let h={...e,common:{...e.common,issues:[]},parent:null};return{result:await i._parseAsync({data:e.data,path:e.path,parent:h}),ctx:h}})).then(a);{let i,h=[];for(let p of r){let b={...e,common:{...e.common,issues:[]},parent:null},g=p._parseSync({data:e.data,path:e.path,parent:b});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:b}),b.common.issues.length&&h.push(b.common.issues)}if(i)return e.common.issues.push(...i.ctx.common.issues),i.result;let c=h.map(p=>new Ls(p));return Gt(e,{code:Rt.invalid_union,unionErrors:c}),mr}}get options(){return this._def.options}};b2.create=(t,e)=>new b2({options:t,typeName:pr.ZodUnion,...Nr(e)});var Dh=t=>t instanceof w2?Dh(t.schema):t instanceof Of?Dh(t.innerType()):t instanceof _2?[t.value]:t instanceof I2?t.options:t instanceof M2?ui.objectValues(t.enum):t instanceof x2?Dh(t._def.innerType):t instanceof m2?[void 0]:t instanceof g2?[null]:t instanceof Cu?[void 0,...Dh(t.unwrap())]:t instanceof Ml?[null,...Dh(t.unwrap())]:t instanceof xI||t instanceof E2?Dh(t.unwrap()):t instanceof S2?Dh(t._def.innerType):[],Jee=class Xee extends Ur{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Xt.object)return Gt(r,{code:Rt.invalid_type,expected:Xt.object,received:r.parsedType}),mr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Gt(r,{code:Rt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),mr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Dh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new Xee({typeName:pr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Nr(a)})}};function JT(t,e){let r=bl(t),a=bl(e);if(t===e)return{valid:!0,data:t};if(r===Xt.object&&a===Xt.object){let i=ui.objectKeys(e),h=ui.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=JT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Xt.array&&a===Xt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=JT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Xt.date&&a===Xt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var y2=class extends Ur{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=(i,h)=>{if(WT(i)||WT(h))return mr;let c=JT(i.value,h.value);return c.valid?((VT(i)||VT(h))&&e.dirty(),{status:e.value,value:c.data}):(Gt(r,{code:Rt.invalid_intersection_types}),mr)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,h])=>a(i,h)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};y2.create=(t,e,r)=>new y2({left:t,right:e,typeName:pr.ZodIntersection,...Nr(r)});var _l=class Qee extends Ur{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Xt.array)return Gt(a,{code:Rt.invalid_type,expected:Xt.array,received:a.parsedType}),mr;if(a.data.length<this._def.items.length)return Gt(a,{code:Rt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),mr;!this._def.rest&&a.data.length>this._def.items.length&&(Gt(a,{code:Rt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new $u(a,c,a.path,p)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>fo.mergeArray(r,c)):fo.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new Qee({...this._def,rest:e})}};_l.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _l({items:t,typeName:pr.ZodTuple,rest:null,...Nr(e)})};var ete=class XT extends Ur{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Xt.object)return Gt(a,{code:Rt.invalid_type,expected:Xt.object,received:a.parsedType}),mr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new $u(a,p,a.path,p)),value:c._parse(new $u(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?fo.mergeObjectAsync(r,i):fo.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Ur?new XT({keyType:e,valueType:r,typeName:pr.ZodRecord,...Nr(a)}):new XT({keyType:z1.create(),valueType:e,typeName:pr.ZodRecord,...Nr(r)})}},l4=class extends Ur{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xt.map)return Gt(r,{code:Rt.invalid_type,expected:Xt.map,received:r.parsedType}),mr;let a=this._def.keyType,i=this._def.valueType,h=[...r.data.entries()].map(([c,p],b)=>({key:a._parse(new $u(r,c,r.path,[b,"key"])),value:i._parse(new $u(r,p,r.path,[b,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of h){let b=await p.key,g=await p.value;if(b.status==="aborted"||g.status==="aborted")return mr;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}})}else{let c=new Map;for(let p of h){let b=p.key,g=p.value;if(b.status==="aborted"||g.status==="aborted")return mr;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}}}};l4.create=(t,e,r)=>new l4({valueType:e,keyType:t,typeName:pr.ZodMap,...Nr(r)});var d4=class QT extends Ur{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Xt.set)return Gt(a,{code:Rt.invalid_type,expected:Xt.set,received:a.parsedType}),mr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Gt(a,{code:Rt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Gt(a,{code:Rt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return mr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new $u(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new QT({...this._def,minSize:{value:e,message:ar.toString(r)}})}max(e,r){return new QT({...this._def,maxSize:{value:e,message:ar.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};d4.create=(t,e)=>new d4({valueType:t,minSize:null,maxSize:null,typeName:pr.ZodSet,...Nr(e)});var tte=class H8 extends Ur{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Xt.function)return Gt(r,{code:Rt.invalid_type,expected:Xt.function,received:r.parsedType}),mr;function a(p,b){return f4({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s4(),j1].filter(g=>!!g),issueData:{code:Rt.invalid_arguments,argumentsError:b}})}function i(p,b){return f4({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s4(),j1].filter(g=>!!g),issueData:{code:Rt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof H1){let p=this;return qa(async function(...b){let g=new Ls([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return qa(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Ls([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Ls([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new H8({...this._def,args:_l.create(e).rest(yd.create())})}returns(e){return new H8({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new H8({args:e||_l.create([]).rest(yd.create()),returns:r||yd.create(),typeName:pr.ZodFunction,...Nr(a)})}},w2=class extends Ur{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};w2.create=(t,e)=>new w2({getter:t,typeName:pr.ZodLazy,...Nr(e)});var _2=class extends Ur{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return Gt(e,{received:e.data,code:Rt.invalid_literal,expected:this._def.value}),mr}return{status:"valid",value:t.data}}get value(){return this._def.value}};_2.create=(t,e)=>new _2({value:t,typeName:pr.ZodLiteral,...Nr(e)});function rte(t,e){return new I2({values:t,typeName:pr.ZodEnum,...Nr(e)})}var I2=class eI extends Ur{constructor(){super(...arguments),zg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Gt(r,{expected:ui.joinValues(a),received:r.parsedType,code:Rt.invalid_type}),mr}if(u4(this,zg,"f")||Kee(this,zg,new Set(this._def.values),"f"),!u4(this,zg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Gt(r,{received:r.data,code:Rt.invalid_enum_value,options:a}),mr}return qa(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return eI.create(e,{...this._def,...r})}exclude(e,r=this._def){return eI.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};zg=new WeakMap;I2.create=rte;var M2=class extends Ur{constructor(){super(...arguments),Zg.set(this,void 0)}_parse(t){let e=ui.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Xt.string&&r.parsedType!==Xt.number){let a=ui.objectValues(e);return Gt(r,{expected:ui.joinValues(a),received:r.parsedType,code:Rt.invalid_type}),mr}if(u4(this,Zg,"f")||Kee(this,Zg,new Set(ui.getValidEnumValues(this._def.values)),"f"),!u4(this,Zg,"f").has(t.data)){let a=ui.objectValues(e);return Gt(r,{received:r.data,code:Rt.invalid_enum_value,options:a}),mr}return qa(t.data)}get enum(){return this._def.values}};Zg=new WeakMap;M2.create=(t,e)=>new M2({values:t,typeName:pr.ZodNativeEnum,...Nr(e)});var H1=class extends Ur{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Xt.promise&&e.common.async===!1)return Gt(e,{code:Rt.invalid_type,expected:Xt.promise,received:e.parsedType}),mr;let r=e.parsedType===Xt.promise?e.data:Promise.resolve(e.data);return qa(r.then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};H1.create=(t,e)=>new H1({type:t,typeName:pr.ZodPromise,...Nr(e)});var Of=class extends Ur{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:h=>{Gt(r,h),h.fatal?e.abort():e.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let h=a.transform(r.data,i);if(r.common.async)return Promise.resolve(h).then(async c=>{if(e.value==="aborted")return mr;let p=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return p.status==="aborted"?mr:p.status==="dirty"||e.value==="dirty"?I1(p.value):p});{if(e.value==="aborted")return mr;let c=this._def.schema._parseSync({data:h,path:r.path,parent:r});return c.status==="aborted"?mr:c.status==="dirty"||e.value==="dirty"?I1(c.value):c}}if(a.type==="refinement"){let h=c=>{let p=a.refinement(c,i);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?mr:(c.status==="dirty"&&e.dirty(),h(c.value),{status:e.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?mr:(c.status==="dirty"&&e.dirty(),h(c.value).then(()=>({status:e.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){let h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!h2(h))return h;let c=a.transform(h.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>h2(h)?Promise.resolve(a.transform(h.value,i)).then(c=>({status:e.value,value:c})):h);ui.assertNever(a)}};Of.create=(t,e,r)=>new Of({schema:t,typeName:pr.ZodEffects,effect:e,...Nr(r)});Of.createWithPreprocess=(t,e,r)=>new Of({schema:e,effect:{type:"preprocess",transform:t},typeName:pr.ZodEffects,...Nr(r)});var Cu=class extends Ur{_parse(t){return this._getType(t)===Xt.undefined?qa(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Cu.create=(t,e)=>new Cu({innerType:t,typeName:pr.ZodOptional,...Nr(e)});var Ml=class extends Ur{_parse(t){return this._getType(t)===Xt.null?qa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ml.create=(t,e)=>new Ml({innerType:t,typeName:pr.ZodNullable,...Nr(e)});var x2=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===Xt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};x2.create=(t,e)=>new x2({innerType:t,typeName:pr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Nr(e)});var S2=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return c2(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ls(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ls(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};S2.create=(t,e)=>new S2({innerType:t,typeName:pr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Nr(e)});var p4=class extends Ur{_parse(t){if(this._getType(t)!==Xt.nan){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.nan,received:r.parsedType}),mr}return{status:"valid",value:t.data}}};p4.create=t=>new p4({typeName:pr.ZodNaN,...Nr(t)});var kxe=Symbol("zod_brand"),xI=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},SI=class ite extends Ur{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?mr:h.status==="dirty"?(r.dirty(),I1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?mr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new ite({in:e,out:r,typeName:pr.ZodPipeline})}},E2=class extends Ur{_parse(t){let e=this._def.innerType._parse(t),r=a=>(h2(a)&&(a.value=Object.freeze(a.value)),a);return c2(e)?e.then(a=>r(a)):r(e)}unwrap(){return this._def.innerType}};E2.create=(t,e)=>new E2({innerType:t,typeName:pr.ZodReadonly,...Nr(e)});function nte(t,e={},r){return t?Z1.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):Z1.create()}var Bxe={object:qs.lazycreate},pr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(pr||(pr={}));var Pxe=(t,e={message:`Input not instance of ${t.name}`})=>nte(r=>r instanceof t,e),ate=z1.create,ote=l2.create,Oxe=p4.create,Nxe=d2.create,ste=p2.create,Cxe=v2.create,Lxe=h4.create,Dxe=m2.create,$xe=g2.create,qxe=Z1.create,Uxe=yd.create,Fxe=jh.create,jxe=c4.create,zxe=Md.create,Zxe=qs.create,Hxe=qs.strictCreate,Kxe=b2.create,Wxe=Jee.create,Vxe=y2.create,Gxe=_l.create,Yxe=ete.create,Jxe=l4.create,Xxe=d4.create,Qxe=tte.create,eSe=w2.create,tSe=_2.create,rSe=I2.create,iSe=M2.create,nSe=H1.create,LQ=Of.create,aSe=Cu.create,oSe=Ml.create,sSe=Of.createWithPreprocess,fSe=SI.create,uSe=()=>ate().optional(),hSe=()=>ote().optional(),cSe=()=>ste().optional(),lSe={string:t=>z1.create({...t,coerce:!0}),number:t=>l2.create({...t,coerce:!0}),boolean:t=>p2.create({...t,coerce:!0}),bigint:t=>d2.create({...t,coerce:!0}),date:t=>v2.create({...t,coerce:!0})},dSe=mr,wt=Object.freeze({__proto__:null,defaultErrorMap:j1,setErrorMap:dxe,getErrorMap:s4,makeIssue:f4,EMPTY_PATH:pxe,addIssueToContext:Gt,ParseStatus:fo,INVALID:mr,DIRTY:I1,OK:qa,isAborted:WT,isDirty:VT,isValid:h2,isAsync:c2,get util(){return ui},get objectUtil(){return KT},ZodParsedType:Xt,getParsedType:bl,ZodType:Ur,datetimeRegex:Gee,ZodString:z1,ZodNumber:l2,ZodBigInt:d2,ZodBoolean:p2,ZodDate:v2,ZodSymbol:h4,ZodUndefined:m2,ZodNull:g2,ZodAny:Z1,ZodUnknown:yd,ZodNever:jh,ZodVoid:c4,ZodArray:Md,ZodObject:qs,ZodUnion:b2,ZodDiscriminatedUnion:Jee,ZodIntersection:y2,ZodTuple:_l,ZodRecord:ete,ZodMap:l4,ZodSet:d4,ZodFunction:tte,ZodLazy:w2,ZodLiteral:_2,ZodEnum:I2,ZodNativeEnum:M2,ZodPromise:H1,ZodEffects:Of,ZodTransformer:Of,ZodOptional:Cu,ZodNullable:Ml,ZodDefault:x2,ZodCatch:S2,ZodNaN:p4,BRAND:kxe,ZodBranded:xI,ZodPipeline:SI,ZodReadonly:E2,custom:nte,Schema:Ur,ZodSchema:Ur,late:Bxe,get ZodFirstPartyTypeKind(){return pr},coerce:lSe,any:qxe,array:zxe,bigint:Nxe,boolean:ste,date:Cxe,discriminatedUnion:Wxe,effect:LQ,enum:rSe,function:Qxe,instanceof:Pxe,intersection:Vxe,lazy:eSe,literal:tSe,map:Jxe,nan:Oxe,nativeEnum:iSe,never:Fxe,null:$xe,nullable:oSe,number:ote,object:Zxe,oboolean:cSe,onumber:hSe,optional:aSe,ostring:uSe,pipeline:fSe,preprocess:sSe,promise:nSe,record:Yxe,set:Xxe,strictObject:Hxe,string:ate,symbol:Lxe,transformer:LQ,tuple:Gxe,undefined:Dxe,union:Kxe,unknown:Uxe,void:jxe,NEVER:dSe,ZodIssueCode:Rt,quotelessJson:lxe,ZodError:Ls});function pSe({fetch:t,GRAPHQL_URL:e,logger:r}){let a=`
|
|
169
|
+
`;return async i=>r({query:a,variables:{owner:i}}).then(QQ(["data","transactions","edges","0","node"])).then(eee(`Could not find 'Scheduler-Location' owner by wallet ${i}`)).then(L7e([OT(z7e),OT(Z7e)])).then(([h,c])=>{if(!h)throw new W8('No "Url" tag found on Scheduler-Location');if(!c)throw new W8('No "Time-To-Live" tag found on Scheduler-Location');return{url:h,ttl:c,address:i}})}var E1=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,iee=new Set,NT=typeof He=="object"&&He?He:{},nee=(t,e,r,a)=>{typeof NT.emitWarning=="function"?NT.emitWarning(t,e,r,a):console.error(`[${r}] ${e}: ${t}`)},V8=globalThis.AbortController,xQ=globalThis.AbortSignal;if(typeof V8>"u"){xQ=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,a){this._onabort.push(a)}},V8=class{constructor(){e()}signal=new xQ;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let a of this.signal._onabort)a(r);this.signal.onabort?.(r)}}};let t=NT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,nee("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var W7e=t=>!iee.has(t),uut=Symbol("type"),vl=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),aee=t=>vl(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?U8:null:null,U8=class extends Array{constructor(t){super(t),this.fill(0)}},V7e=class $g{heap;length;static#f=!1;static create(e){let r=aee(e);if(!r)return[];$g.#f=!0;let a=new $g(e,r);return $g.#f=!1,a}constructor(e,r){if(!$g.#f)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},G7e=class oee{#f;#c;#v;#m;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#g;#i;#r;#e;#u;#l;#s;#a;#b;#o;#y;#w;#d;#_;#E;#h;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#d,sizes:e.#y,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#l,get head(){return e.#s},get tail(){return e.#a},free:e.#b,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,a,i,h)=>e.#P(r,a,i,h),moveToTail:r=>e.#T(r),indexes:r=>e.#M(r),rindexes:r=>e.#x(r),isStale:r=>e.#p(r)}}get max(){return this.#f}get maxSize(){return this.#c}get calculatedSize(){return this.#g}get size(){return this.#n}get fetchMethod(){return this.#I}get dispose(){return this.#v}get disposeAfter(){return this.#m}constructor(e){let{max:r=0,ttl:a,ttlResolution:i=1,ttlAutopurge:h,updateAgeOnGet:c,updateAgeOnHas:p,allowStale:b,dispose:g,disposeAfter:y,noDisposeOnSet:M,noUpdateTTL:x,maxSize:E=0,maxEntrySize:A=0,sizeCalculation:I,fetchMethod:P,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:Y,ignoreFetchAbort:G}=e;if(r!==0&&!vl(r))throw new TypeError("max option must be a nonnegative integer");let ee=r?aee(r):Array;if(!ee)throw new Error("invalid max value: "+r);if(this.#f=r,this.#c=E,this.maxEntrySize=A||this.#c,this.sizeCalculation=I,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(P!==void 0&&typeof P!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=P,this.#E=!!P,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new ee(r),this.#l=new ee(r),this.#s=0,this.#a=0,this.#b=V7e.create(r),this.#n=0,this.#g=0,typeof g=="function"&&(this.#v=g),typeof y=="function"?(this.#m=y,this.#o=[]):(this.#m=void 0,this.#o=void 0),this.#_=!!this.#v,this.#h=!!this.#m,this.noDisposeOnSet=!!M,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!Y,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#c!==0&&!vl(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!vl(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!b,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!p,this.ttlResolution=vl(i)||i===0?i:1,this.ttlAutopurge=!!h,this.ttl=a||0,this.ttl){if(!vl(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#f===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#f&&!this.#c){let D="LRU_CACHE_UNBOUNDED";W7e(D)&&(iee.add(D),nee("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,oee))}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#O(){let e=new U8(this.#f),r=new U8(this.#f);this.#d=e,this.#w=r,this.#N=(h,c,p=E1.now())=>{if(r[h]=c!==0?p:0,e[h]=c,c!==0&&this.ttlAutopurge){let b=setTimeout(()=>{this.#p(h)&&this.delete(this.#r[h])},c+1);b.unref&&b.unref()}},this.#A=h=>{r[h]=e[h]!==0?E1.now():0},this.#S=(h,c)=>{if(e[c]){let p=e[c],b=r[c];if(!p||!b)return;h.ttl=p,h.start=b,h.now=a||i();let g=h.now-b;h.remainingTTL=p-g}};let a=0,i=()=>{let h=E1.now();if(this.ttlResolution>0){a=h;let c=setTimeout(()=>a=0,this.ttlResolution);c.unref&&c.unref()}return h};this.getRemainingTTL=h=>{let c=this.#i.get(h);if(c===void 0)return 0;let p=e[c],b=r[c];if(!p||!b)return 1/0;let g=(a||i())-b;return p-g},this.#p=h=>{let c=r[h],p=e[h];return!!p&&!!c&&(a||i())-c>p}}#A=()=>{};#S=()=>{};#N=()=>{};#p=()=>!1;#$(){let e=new U8(this.#f);this.#g=0,this.#y=e,this.#R=r=>{this.#g-=e[r],e[r]=0},this.#C=(r,a,i,h)=>{if(this.#t(a))return 0;if(!vl(i))if(h){if(typeof h!="function")throw new TypeError("sizeCalculation must be a function");if(i=h(a,r),!vl(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#k=(r,a,i)=>{if(e[r]=a,this.#c){let h=this.#c-e[r];for(;this.#g>h;)this.#B(!0)}this.#g+=e[r],i&&(i.entrySize=a,i.totalCalculatedSize=this.#g)}}#R=e=>{};#k=(e,r,a)=>{};#C=(e,r,a,i)=>{if(a||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#a;!(!this.#L(r)||((e||!this.#p(r))&&(yield r),r===this.#s));)r=this.#l[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#L(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#u[r]}#L(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#M())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#x())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#M()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#M())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#x())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let a of this.#M()){let i=this.#e[a],h=this.#t(i)?i.__staleWhileFetching:i;if(h!==void 0&&e(h,this.#r[a],this))return this.get(this.#r[a],r)}}forEach(e,r=this){for(let a of this.#M()){let i=this.#e[a],h=this.#t(i)?i.__staleWhileFetching:i;h!==void 0&&e.call(r,h,this.#r[a],this)}}rforEach(e,r=this){for(let a of this.#x()){let i=this.#e[a],h=this.#t(i)?i.__staleWhileFetching:i;h!==void 0&&e.call(r,h,this.#r[a],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#p(r)&&(this.delete(this.#r[r]),e=!0);return e}info(e){let r=this.#i.get(e);if(r===void 0)return;let a=this.#e[r],i=this.#t(a)?a.__staleWhileFetching:a;if(i===void 0)return;let h={value:i};if(this.#d&&this.#w){let c=this.#d[r],p=this.#w[r];if(c&&p){let b=c-(E1.now()-p);h.ttl=b,h.start=Date.now()}}return this.#y&&(h.size=this.#y[r]),h}dump(){let e=[];for(let r of this.#M({allowStale:!0})){let a=this.#r[r],i=this.#e[r],h=this.#t(i)?i.__staleWhileFetching:i;if(h===void 0||a===void 0)continue;let c={value:h};if(this.#d&&this.#w){c.ttl=this.#d[r];let p=E1.now()-this.#w[r];c.start=Math.floor(Date.now()-p)}this.#y&&(c.size=this.#y[r]),e.unshift([a,c])}return e}load(e){this.clear();for(let[r,a]of e){if(a.start){let i=Date.now()-a.start;a.start=E1.now()-i}this.set(r,a.value,a)}}set(e,r,a={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:h,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:b}=a,{noUpdateTTL:g=this.noUpdateTTL}=a,y=this.#C(e,r,a.size||0,p);if(this.maxEntrySize&&y>this.maxEntrySize)return b&&(b.set="miss",b.maxEntrySizeExceeded=!0),this.delete(e),this;let M=this.#n===0?void 0:this.#i.get(e);if(M===void 0)M=this.#n===0?this.#a:this.#b.length!==0?this.#b.pop():this.#n===this.#f?this.#B(!1):this.#n,this.#r[M]=e,this.#e[M]=r,this.#i.set(e,M),this.#u[this.#a]=M,this.#l[M]=this.#a,this.#a=M,this.#n++,this.#k(M,y,b),b&&(b.set="add"),g=!1;else{this.#T(M);let x=this.#e[M];if(r!==x){if(this.#E&&this.#t(x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:E}=x;E!==void 0&&!c&&(this.#_&&this.#v?.(E,e,"set"),this.#h&&this.#o?.push([E,e,"set"]))}else c||(this.#_&&this.#v?.(x,e,"set"),this.#h&&this.#o?.push([x,e,"set"]));if(this.#R(M),this.#k(M,y,b),this.#e[M]=r,b){b.set="replace";let E=x&&this.#t(x)?x.__staleWhileFetching:x;E!==void 0&&(b.oldValue=E)}}else b&&(b.set="update")}if(i!==0&&!this.#d&&this.#O(),this.#d&&(g||this.#N(M,i,h),b&&this.#S(b,M)),!c&&this.#h&&this.#o){let x=this.#o,E;for(;E=x?.shift();)this.#m?.(...E)}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#s];if(this.#B(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#h&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#m?.(...r)}}}#B(e){let r=this.#s,a=this.#r[r],i=this.#e[r];return this.#E&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#h)&&(this.#_&&this.#v?.(i,a,"evict"),this.#h&&this.#o?.push([i,a,"evict"])),this.#R(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#b.push(r)),this.#n===1?(this.#s=this.#a=0,this.#b.length=0):this.#s=this.#u[r],this.#i.delete(a),this.#n--,r}has(e,r={}){let{updateAgeOnHas:a=this.updateAgeOnHas,status:i}=r,h=this.#i.get(e);if(h!==void 0){let c=this.#e[h];if(this.#t(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#p(h))i&&(i.has="stale",this.#S(i,h));else return a&&this.#A(h),i&&(i.has="hit",this.#S(i,h)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:a=this.allowStale}=r,i=this.#i.get(e);if(i===void 0||!a&&this.#p(i))return;let h=this.#e[i];return this.#t(h)?h.__staleWhileFetching:h}#P(e,r,a,i){let h=r===void 0?void 0:this.#e[r];if(this.#t(h))return h;let c=new V8,{signal:p}=a;p?.addEventListener("abort",()=>c.abort(p.reason),{signal:c.signal});let b={signal:c.signal,options:a,context:i},g=(I,P=!1)=>{let{aborted:N}=c.signal,L=a.ignoreFetchAbort&&I!==void 0;if(a.status&&(N&&!P?(a.status.fetchAborted=!0,a.status.fetchError=c.signal.reason,L&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),N&&!L&&!P)return M(c.signal.reason);let C=E;return this.#e[r]===E&&(I===void 0?C.__staleWhileFetching?this.#e[r]=C.__staleWhileFetching:this.delete(e):(a.status&&(a.status.fetchUpdated=!0),this.set(e,I,b.options))),I},y=I=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=I),M(I)),M=I=>{let{aborted:P}=c.signal,N=P&&a.allowStaleOnFetchAbort,L=N||a.allowStaleOnFetchRejection,C=L||a.noDeleteOnFetchRejection,Y=E;if(this.#e[r]===E&&(!C||Y.__staleWhileFetching===void 0?this.delete(e):N||(this.#e[r]=Y.__staleWhileFetching)),L)return a.status&&Y.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),Y.__staleWhileFetching;if(Y.__returned===Y)throw I},x=(I,P)=>{let N=this.#I?.(e,h,b);N&&N instanceof Promise&&N.then(L=>I(L===void 0?void 0:L),P),c.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(I(void 0),a.allowStaleOnFetchAbort&&(I=L=>g(L,!0)))})};a.status&&(a.status.fetchDispatched=!0);let E=new Promise(x).then(g,y),A=Object.assign(E,{__abortController:c,__staleWhileFetching:h,__returned:void 0});return r===void 0?(this.set(e,A,{...b.options,status:void 0}),r=this.#i.get(e)):this.#e[r]=A,A}#t(e){if(!this.#E)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof V8}async fetch(e,r={}){let{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:b=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:y=this.noUpdateTTL,noDeleteOnFetchRejection:M=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:I,forceRefresh:P=!1,status:N,signal:L}=r;if(!this.#E)return N&&(N.fetch="get"),this.get(e,{allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:h,status:N});let C={allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:h,ttl:c,noDisposeOnSet:p,size:b,sizeCalculation:g,noUpdateTTL:y,noDeleteOnFetchRejection:M,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:A,ignoreFetchAbort:E,status:N,signal:L},Y=this.#i.get(e);if(Y===void 0){N&&(N.fetch="miss");let G=this.#P(e,Y,C,I);return G.__returned=G}else{let G=this.#e[Y];if(this.#t(G)){let V=a&&G.__staleWhileFetching!==void 0;return N&&(N.fetch="inflight",V&&(N.returnedStale=!0)),V?G.__staleWhileFetching:G.__returned=G}let ee=this.#p(Y);if(!P&&!ee)return N&&(N.fetch="hit"),this.#T(Y),i&&this.#A(Y),N&&this.#S(N,Y),G;let D=this.#P(e,Y,C,I),U=D.__staleWhileFetching!==void 0&&a;return N&&(N.fetch=ee?"stale":"refresh",U&&ee&&(N.returnedStale=!0)),U?D.__staleWhileFetching:D.__returned=D}}get(e,r={}){let{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,status:c}=r,p=this.#i.get(e);if(p!==void 0){let b=this.#e[p],g=this.#t(b);return c&&this.#S(c,p),this.#p(p)?(c&&(c.get="stale"),g?(c&&a&&b.__staleWhileFetching!==void 0&&(c.returnedStale=!0),a?b.__staleWhileFetching:void 0):(h||this.delete(e),c&&a&&(c.returnedStale=!0),a?b:void 0)):(c&&(c.get="hit"),g?b.__staleWhileFetching:(this.#T(p),i&&this.#A(p),b))}else c&&(c.get="miss")}#D(e,r){this.#l[r]=e,this.#u[e]=r}#T(e){e!==this.#a&&(e===this.#s?this.#s=this.#u[e]:this.#D(this.#l[e],this.#u[e]),this.#D(this.#a,e),this.#a=e)}delete(e){let r=!1;if(this.#n!==0){let a=this.#i.get(e);if(a!==void 0)if(r=!0,this.#n===1)this.clear();else{this.#R(a);let i=this.#e[a];if(this.#t(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#h)&&(this.#_&&this.#v?.(i,e,"delete"),this.#h&&this.#o?.push([i,e,"delete"])),this.#i.delete(e),this.#r[a]=void 0,this.#e[a]=void 0,a===this.#a)this.#a=this.#l[a];else if(a===this.#s)this.#s=this.#u[a];else{let h=this.#l[a];this.#u[h]=this.#u[a];let c=this.#u[a];this.#l[c]=this.#l[a]}this.#n--,this.#b.push(a)}}if(this.#h&&this.#o?.length){let a=this.#o,i;for(;i=a?.shift();)this.#m?.(...i)}return r}clear(){for(let e of this.#x({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else{let a=this.#r[e];this.#_&&this.#v?.(r,a,"delete"),this.#h&&this.#o?.push([r,a,"delete"])}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#s=0,this.#a=0,this.#b.length=0,this.#g=0,this.#n=0,this.#h&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#m?.(...r)}}};function Y7e({size:t}){return new G7e({max:t,maxSize:5e6,sizeCalculation:e=>JSON.stringify(e).length,allowStale:!0})}function J7e({cache:t}){return async e=>{if(t.max)return t.get(e)}}function X7e({cache:t}){return async(e,{url:r,address:a},i)=>{if(t.max)return t.set(e,{url:r,address:a},{ttl:i})}}function Q7e({cache:t}){return async e=>{if(t.max)return t.get(e)}}function e_e({cache:t}){return async(e,r,a)=>{if(t.max)return t.set(e,{url:r,address:e,ttl:a},{ttl:a})}}function t_e({fetch:t}){return async(e,r)=>{let a=await t(`${e}?process-id=${r}`,{method:"GET",redirect:"manual"});return[301,302,307,308].includes(a.status)?new URL(a.headers.get("Location")).origin:e}}var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(fi||(fi={}));var CT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(CT||(CT={}));var Jt=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gl=t=>{switch(typeof t){case"undefined":return Jt.undefined;case"string":return Jt.string;case"number":return isNaN(t)?Jt.nan:Jt.number;case"boolean":return Jt.boolean;case"function":return Jt.function;case"bigint":return Jt.bigint;case"symbol":return Jt.symbol;case"object":return Array.isArray(t)?Jt.array:t===null?Jt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Jt.promise:typeof Map<"u"&&t instanceof Map?Jt.map:typeof Set<"u"&&t instanceof Set?Jt.set:typeof Date<"u"&&t instanceof Date?Jt.date:Jt.object;default:return Jt.unknown}},Ot=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),r_e=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bf=class see extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof see))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Bf.create=t=>new Bf(t);var O1=(t,e)=>{let r;switch(t.code){case Ot.invalid_type:t.received===Jt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ot.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Ot.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Ot.invalid_union:r="Invalid input";break;case Ot.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Ot.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Ot.invalid_arguments:r="Invalid function arguments";break;case Ot.invalid_return_type:r="Invalid function return type";break;case Ot.invalid_date:r="Invalid date";break;case Ot.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ot.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ot.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ot.custom:r="Invalid input";break;case Ot.invalid_intersection_types:r="Intersection results could not be merged";break;case Ot.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ot.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}},fee=O1;function i_e(t){fee=t}function G8(){return fee}var Y8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},n_e=[];function Vt(t,e){let r=G8(),a=Y8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===O1?void 0:O1].filter(i=>!!i)});t.common.issues.push(a)}var so=class uee{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return br;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return uee.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return br;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},br=Object.freeze({status:"aborted"}),J8=t=>({status:"dirty",value:t}),$a=t=>({status:"valid",value:t}),LT=t=>t.status==="aborted",DT=t=>t.status==="dirty",Gg=t=>t.status==="valid",X8=t=>typeof Promise<"u"&&t instanceof Promise;function Q8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function hee(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var nr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(nr||(nr={}));var qg,Ug,Lu=class{constructor(t,e,r,a){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},SQ=(t,e)=>{if(Gg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bf(t.common.issues);return this._error=r,this._error}}};function Or(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(h,c)=>{var p,b;let{message:g}=t;return h.code==="invalid_enum_value"?{message:g??c.defaultError}:typeof c.data>"u"?{message:(p=g??a)!==null&&p!==void 0?p:c.defaultError}:h.code!=="invalid_type"?{message:c.defaultError}:{message:(b=g??r)!==null&&b!==void 0?b:c.defaultError}},description:i}}var qr=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return gl(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:gl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new so,ctx:{common:t.parent.common,data:t.data,parsedType:gl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(X8(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let a={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gl(t)},i=this._parseSync({data:t,path:a.path,parent:a});return SQ(a,i)}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gl(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(X8(a)?a:Promise.resolve(a));return SQ(r,i)}refine(t,e){let r=a=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(a):e;return this._refinement((a,i)=>{let h=t(a),c=()=>i.addIssue({code:Ot.custom,...r(a)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(c(),!1)):h?!0:(c(),!1)})}refinement(t,e){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof e=="function"?e(r,a):e),!1))}_refinement(t){return new Pf({schema:this,typeName:dr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Nu.create(this,this._def)}nullable(){return wl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wd.create(this,this._def)}promise(){return L1.create(this,this._def)}or(t){return r2.create([this,t],this._def)}and(t){return i2.create(this,t,this._def)}transform(t){return new Pf({...Or(this._def),schema:this,typeName:dr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new s2({...Or(this._def),innerType:this,defaultValue:e,typeName:dr.ZodDefault})}brand(){return new cI({typeName:dr.ZodBranded,type:this,...Or(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new f2({...Or(this._def),innerType:this,catchValue:e,typeName:dr.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return lI.create(this,t)}readonly(){return u2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},a_e=/^c[^\s-]{8,}$/i,o_e=/^[0-9a-z]+$/,s_e=/^[0-9A-HJKMNP-TV-Z]{26}$/,f_e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,u_e=/^[a-z0-9_-]{21}$/i,h_e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,c_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,l_e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ET,d_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,p_e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,v_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cee="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",m_e=new RegExp(`^${cee}$`);function lee(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function g_e(t){return new RegExp(`^${lee(t)}$`)}function dee(t){let e=`${cee}T${lee(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function b_e(t,e){return!!((e==="v4"||!e)&&d_e.test(t)||(e==="v6"||!e)&&p_e.test(t))}var N1=class Fg extends qr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Jt.string){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.string,received:i.parsedType}),br}let r=new so,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let h=e.data.length>i.value,c=e.data.length<i.value;(h||c)&&(a=this._getOrReturnCtx(e,a),h?Vt(a,{code:Ot.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&Vt(a,{code:Ot.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")c_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"email",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")ET||(ET=new RegExp(l_e,"u")),ET.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"emoji",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")f_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"uuid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")u_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"nanoid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")a_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"cuid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")o_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"cuid2",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")s_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"ulid",code:Ot.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Vt(a,{validation:"url",code:Ot.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"regex",code:Ot.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?dee(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?m_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?g_e(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?h_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"duration",code:Ot.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?b_e(e.data,i.version)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"ip",code:Ot.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?v_e.test(e.data)||(a=this._getOrReturnCtx(e,a),Vt(a,{validation:"base64",code:Ot.invalid_string,message:i.message}),r.dirty()):fi.assertNever(i);return{status:r.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Ot.invalid_string,...nr.errToObj(a)})}_addCheck(e){return new Fg({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...nr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...nr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...nr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...nr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...nr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...nr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...nr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...nr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...nr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...nr.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...nr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...nr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...nr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...nr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...nr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...nr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...nr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...nr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...nr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...nr.errToObj(r)})}nonempty(e){return this.min(1,nr.errToObj(e))}trim(){return new Fg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};N1.create=t=>{var e;return new N1({checks:[],typeName:dr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Or(t)})};function y_e(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var Yg=class $T extends qr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Jt.number){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.number,received:i.parsedType}),br}let r,a=new so;for(let i of this._def.checks)i.kind==="int"?fi.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?y_e(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.not_finite,message:i.message}),a.dirty()):fi.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,nr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,nr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,nr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,nr.toString(r))}setLimit(e,r,a,i){return new $T({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:nr.toString(i)}]})}_addCheck(e){return new $T({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:nr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:nr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:nr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:nr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:nr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:nr.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Yg.create=t=>new Yg({checks:[],typeName:dr.ZodNumber,coerce:t?.coerce||!1,...Or(t)});var Jg=class qT extends qr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Jt.bigint){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.bigint,received:i.parsedType}),br}let r,a=new so;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Vt(r,{code:Ot.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):fi.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,nr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,nr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,nr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,nr.toString(r))}setLimit(e,r,a,i){return new qT({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:nr.toString(i)}]})}_addCheck(e){return new qT({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:nr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:nr.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Jg.create=t=>{var e;return new Jg({checks:[],typeName:dr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Or(t)})};var Xg=class extends qr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Jt.boolean){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.boolean,received:e.parsedType}),br}return $a(t.data)}};Xg.create=t=>new Xg({typeName:dr.ZodBoolean,coerce:t?.coerce||!1,...Or(t)});var Qg=class pee extends qr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Jt.date){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_type,expected:Jt.date,received:i.parsedType}),br}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return Vt(i,{code:Ot.invalid_date}),br}let r=new so,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),Vt(a,{code:Ot.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):fi.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pee({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:nr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:nr.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Qg.create=t=>new Qg({checks:[],coerce:t?.coerce||!1,typeName:dr.ZodDate,...Or(t)});var e4=class extends qr{_parse(t){if(this._getType(t)!==Jt.symbol){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.symbol,received:e.parsedType}),br}return $a(t.data)}};e4.create=t=>new e4({typeName:dr.ZodSymbol,...Or(t)});var e2=class extends qr{_parse(t){if(this._getType(t)!==Jt.undefined){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.undefined,received:e.parsedType}),br}return $a(t.data)}};e2.create=t=>new e2({typeName:dr.ZodUndefined,...Or(t)});var t2=class extends qr{_parse(t){if(this._getType(t)!==Jt.null){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.null,received:e.parsedType}),br}return $a(t.data)}};t2.create=t=>new t2({typeName:dr.ZodNull,...Or(t)});var C1=class extends qr{constructor(){super(...arguments),this._any=!0}_parse(t){return $a(t.data)}};C1.create=t=>new C1({typeName:dr.ZodAny,...Or(t)});var bd=class extends qr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return $a(t.data)}};bd.create=t=>new bd({typeName:dr.ZodUnknown,...Or(t)});var Uh=class extends qr{_parse(t){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.never,received:e.parsedType}),br}};Uh.create=t=>new Uh({typeName:dr.ZodNever,...Or(t)});var t4=class extends qr{_parse(t){if(this._getType(t)!==Jt.undefined){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.void,received:e.parsedType}),br}return $a(t.data)}};t4.create=t=>new t4({typeName:dr.ZodVoid,...Or(t)});var wd=class F8 extends qr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Jt.array)return Vt(r,{code:Ot.invalid_type,expected:Jt.array,received:r.parsedType}),br;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Vt(r,{code:c?Ot.too_big:Ot.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Vt(r,{code:Ot.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Vt(r,{code:Ot.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new Lu(r,c,r.path,p)))).then(c=>so.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new Lu(r,c,r.path,p)));return so.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new F8({...this._def,minLength:{value:e,message:nr.toString(r)}})}max(e,r){return new F8({...this._def,maxLength:{value:e,message:nr.toString(r)}})}length(e,r){return new F8({...this._def,exactLength:{value:e,message:nr.toString(r)}})}nonempty(e){return this.min(1,e)}};wd.create=(t,e)=>new wd({type:t,minLength:null,maxLength:null,exactLength:null,typeName:dr.ZodArray,...Or(e)});function R1(t){if(t instanceof Ds){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Nu.create(R1(a))}return new Ds({...t._def,shape:()=>e})}else return t instanceof wd?new wd({...t._def,type:R1(t.element)}):t instanceof Nu?Nu.create(R1(t.unwrap())):t instanceof wl?wl.create(R1(t.unwrap())):t instanceof yl?yl.create(t.items.map(e=>R1(e))):t}var Ds=class Tf extends qr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Jt.object){let b=this._getOrReturnCtx(e);return Vt(b,{code:Ot.invalid_type,expected:Jt.object,received:b.parsedType}),br}let{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:h}=this._getCached(),c=[];if(!(this._def.catchall instanceof Uh&&this._def.unknownKeys==="strip"))for(let b in a.data)h.includes(b)||c.push(b);let p=[];for(let b of h){let g=i[b],y=a.data[b];p.push({key:{status:"valid",value:b},value:g._parse(new Lu(a,y,a.path,b)),alwaysSet:b in a.data})}if(this._def.catchall instanceof Uh){let b=this._def.unknownKeys;if(b==="passthrough")for(let g of c)p.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(b==="strict")c.length>0&&(Vt(a,{code:Ot.unrecognized_keys,keys:c}),r.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let b=this._def.catchall;for(let g of c){let y=a.data[g];p.push({key:{status:"valid",value:g},value:b._parse(new Lu(a,y,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let b=[];for(let g of p){let y=await g.key,M=await g.value;b.push({key:y,value:M,alwaysSet:g.alwaysSet})}return b}).then(b=>so.mergeObjectSync(r,b)):so.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return nr.errToObj,new Tf({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=nr.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new Tf({...this._def,unknownKeys:"strip"})}passthrough(){return new Tf({...this._def,unknownKeys:"passthrough"})}extend(e){return new Tf({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Tf({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:dr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Tf({...this._def,catchall:e})}pick(e){let r={};return fi.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new Tf({...this._def,shape:()=>r})}omit(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new Tf({...this._def,shape:()=>r})}deepPartial(){return R1(this)}partial(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new Tf({...this._def,shape:()=>r})}required(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Nu;)i=i._def.innerType;r[a]=i}}),new Tf({...this._def,shape:()=>r})}keyof(){return wee(fi.objectKeys(this.shape))}};Ds.create=(t,e)=>new Ds({shape:()=>t,unknownKeys:"strip",catchall:Uh.create(),typeName:dr.ZodObject,...Or(e)});Ds.strictCreate=(t,e)=>new Ds({shape:()=>t,unknownKeys:"strict",catchall:Uh.create(),typeName:dr.ZodObject,...Or(e)});Ds.lazycreate=(t,e)=>new Ds({shape:t,unknownKeys:"strip",catchall:Uh.create(),typeName:dr.ZodObject,...Or(e)});var r2=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function a(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return e.common.issues.push(...c.ctx.common.issues),c.result;let h=i.map(c=>new Bf(c.ctx.common.issues));return Vt(e,{code:Ot.invalid_union,unionErrors:h}),br}if(e.common.async)return Promise.all(r.map(async i=>{let h={...e,common:{...e.common,issues:[]},parent:null};return{result:await i._parseAsync({data:e.data,path:e.path,parent:h}),ctx:h}})).then(a);{let i,h=[];for(let p of r){let b={...e,common:{...e.common,issues:[]},parent:null},g=p._parseSync({data:e.data,path:e.path,parent:b});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:b}),b.common.issues.length&&h.push(b.common.issues)}if(i)return e.common.issues.push(...i.ctx.common.issues),i.result;let c=h.map(p=>new Bf(p));return Vt(e,{code:Ot.invalid_union,unionErrors:c}),br}}get options(){return this._def.options}};r2.create=(t,e)=>new r2({options:t,typeName:dr.ZodUnion,...Or(e)});var ml=t=>t instanceof n2?ml(t.schema):t instanceof Pf?ml(t.innerType()):t instanceof a2?[t.value]:t instanceof R2?t.options:t instanceof o2?fi.objectValues(t.enum):t instanceof s2?ml(t._def.innerType):t instanceof e2?[void 0]:t instanceof t2?[null]:t instanceof Nu?[void 0,...ml(t.unwrap())]:t instanceof wl?[null,...ml(t.unwrap())]:t instanceof cI||t instanceof u2?ml(t.unwrap()):t instanceof f2?ml(t._def.innerType):[],vee=class mee extends qr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.object)return Vt(r,{code:Ot.invalid_type,expected:Jt.object,received:r.parsedType}),br;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Vt(r,{code:Ot.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),br)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=ml(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new mee({typeName:dr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Or(a)})}};function UT(t,e){let r=gl(t),a=gl(e);if(t===e)return{valid:!0,data:t};if(r===Jt.object&&a===Jt.object){let i=fi.objectKeys(e),h=fi.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=UT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Jt.array&&a===Jt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=UT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Jt.date&&a===Jt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var i2=class extends qr{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=(i,h)=>{if(LT(i)||LT(h))return br;let c=UT(i.value,h.value);return c.valid?((DT(i)||DT(h))&&e.dirty(),{status:e.value,value:c.data}):(Vt(r,{code:Ot.invalid_intersection_types}),br)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,h])=>a(i,h)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};i2.create=(t,e,r)=>new i2({left:t,right:e,typeName:dr.ZodIntersection,...Or(r)});var yl=class gee extends qr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.array)return Vt(a,{code:Ot.invalid_type,expected:Jt.array,received:a.parsedType}),br;if(a.data.length<this._def.items.length)return Vt(a,{code:Ot.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),br;!this._def.rest&&a.data.length>this._def.items.length&&(Vt(a,{code:Ot.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...a.data].map((h,c)=>{let p=this._def.items[c]||this._def.rest;return p?p._parse(new Lu(a,h,a.path,c)):null}).filter(h=>!!h);return a.common.async?Promise.all(i).then(h=>so.mergeArray(r,h)):so.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new gee({...this._def,rest:e})}};yl.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yl({items:t,typeName:dr.ZodTuple,rest:null,...Or(e)})};var bee=class FT extends qr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.object)return Vt(a,{code:Ot.invalid_type,expected:Jt.object,received:a.parsedType}),br;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Lu(a,p,a.path,p)),value:c._parse(new Lu(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?so.mergeObjectAsync(r,i):so.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof qr?new FT({keyType:e,valueType:r,typeName:dr.ZodRecord,...Or(a)}):new FT({keyType:N1.create(),valueType:e,typeName:dr.ZodRecord,...Or(r)})}},r4=class extends qr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==Jt.map)return Vt(r,{code:Ot.invalid_type,expected:Jt.map,received:r.parsedType}),br;let a=this._def.keyType,i=this._def.valueType,h=[...r.data.entries()].map(([c,p],b)=>({key:a._parse(new Lu(r,c,r.path,[b,"key"])),value:i._parse(new Lu(r,p,r.path,[b,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of h){let b=await p.key,g=await p.value;if(b.status==="aborted"||g.status==="aborted")return br;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}})}else{let c=new Map;for(let p of h){let b=p.key,g=p.value;if(b.status==="aborted"||g.status==="aborted")return br;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}}}};r4.create=(t,e,r)=>new r4({valueType:e,keyType:t,typeName:dr.ZodMap,...Or(r)});var i4=class jT extends qr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Jt.set)return Vt(a,{code:Ot.invalid_type,expected:Jt.set,received:a.parsedType}),br;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Vt(a,{code:Ot.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Vt(a,{code:Ot.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return br;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Lu(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new jT({...this._def,minSize:{value:e,message:nr.toString(r)}})}max(e,r){return new jT({...this._def,maxSize:{value:e,message:nr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};i4.create=(t,e)=>new i4({valueType:t,minSize:null,maxSize:null,typeName:dr.ZodSet,...Or(e)});var yee=class j8 extends qr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Jt.function)return Vt(r,{code:Ot.invalid_type,expected:Jt.function,received:r.parsedType}),br;function a(p,b){return Y8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G8(),O1].filter(g=>!!g),issueData:{code:Ot.invalid_arguments,argumentsError:b}})}function i(p,b){return Y8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G8(),O1].filter(g=>!!g),issueData:{code:Ot.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof L1){let p=this;return $a(async function(...b){let g=new Bf([]),y=await p._def.args.parseAsync(b,h).catch(x=>{throw g.addIssue(a(b,x)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(x=>{throw g.addIssue(i(M,x)),g})})}else{let p=this;return $a(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Bf([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Bf([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new j8({...this._def,args:yl.create(e).rest(bd.create())})}returns(e){return new j8({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new j8({args:e||yl.create([]).rest(bd.create()),returns:r||bd.create(),typeName:dr.ZodFunction,...Or(a)})}},n2=class extends qr{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};n2.create=(t,e)=>new n2({getter:t,typeName:dr.ZodLazy,...Or(e)});var a2=class extends qr{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return Vt(e,{received:e.data,code:Ot.invalid_literal,expected:this._def.value}),br}return{status:"valid",value:t.data}}get value(){return this._def.value}};a2.create=(t,e)=>new a2({value:t,typeName:dr.ZodLiteral,...Or(e)});function wee(t,e){return new R2({values:t,typeName:dr.ZodEnum,...Or(e)})}var R2=class zT extends qr{constructor(){super(...arguments),qg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Ot.invalid_type}),br}if(Q8(this,qg,"f")||hee(this,qg,new Set(this._def.values),"f"),!Q8(this,qg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Vt(r,{received:r.data,code:Ot.invalid_enum_value,options:a}),br}return $a(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return zT.create(e,{...this._def,...r})}exclude(e,r=this._def){return zT.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};qg=new WeakMap;R2.create=wee;var o2=class extends qr{constructor(){super(...arguments),Ug.set(this,void 0)}_parse(t){let e=fi.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Jt.string&&r.parsedType!==Jt.number){let a=fi.objectValues(e);return Vt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Ot.invalid_type}),br}if(Q8(this,Ug,"f")||hee(this,Ug,new Set(fi.getValidEnumValues(this._def.values)),"f"),!Q8(this,Ug,"f").has(t.data)){let a=fi.objectValues(e);return Vt(r,{received:r.data,code:Ot.invalid_enum_value,options:a}),br}return $a(t.data)}get enum(){return this._def.values}};Ug=new WeakMap;o2.create=(t,e)=>new o2({values:t,typeName:dr.ZodNativeEnum,...Or(e)});var L1=class extends qr{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Jt.promise&&e.common.async===!1)return Vt(e,{code:Ot.invalid_type,expected:Jt.promise,received:e.parsedType}),br;let r=e.parsedType===Jt.promise?e.data:Promise.resolve(e.data);return $a(r.then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};L1.create=(t,e)=>new L1({type:t,typeName:dr.ZodPromise,...Or(e)});var Pf=class extends qr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:h=>{Vt(r,h),h.fatal?e.abort():e.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let h=a.transform(r.data,i);if(r.common.async)return Promise.resolve(h).then(async c=>{if(e.value==="aborted")return br;let p=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return p.status==="aborted"?br:p.status==="dirty"||e.value==="dirty"?J8(p.value):p});{if(e.value==="aborted")return br;let c=this._def.schema._parseSync({data:h,path:r.path,parent:r});return c.status==="aborted"?br:c.status==="dirty"||e.value==="dirty"?J8(c.value):c}}if(a.type==="refinement"){let h=c=>{let p=a.refinement(c,i);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?br:(c.status==="dirty"&&e.dirty(),h(c.value),{status:e.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?br:(c.status==="dirty"&&e.dirty(),h(c.value).then(()=>({status:e.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){let h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Gg(h))return h;let c=a.transform(h.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>Gg(h)?Promise.resolve(a.transform(h.value,i)).then(c=>({status:e.value,value:c})):h);fi.assertNever(a)}};Pf.create=(t,e,r)=>new Pf({schema:t,typeName:dr.ZodEffects,effect:e,...Or(r)});Pf.createWithPreprocess=(t,e,r)=>new Pf({schema:e,effect:{type:"preprocess",transform:t},typeName:dr.ZodEffects,...Or(r)});var Nu=class extends qr{_parse(t){return this._getType(t)===Jt.undefined?$a(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Nu.create=(t,e)=>new Nu({innerType:t,typeName:dr.ZodOptional,...Or(e)});var wl=class extends qr{_parse(t){return this._getType(t)===Jt.null?$a(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wl.create=(t,e)=>new wl({innerType:t,typeName:dr.ZodNullable,...Or(e)});var s2=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===Jt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};s2.create=(t,e)=>new s2({innerType:t,typeName:dr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Or(e)});var f2=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X8(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bf(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Bf(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};f2.create=(t,e)=>new f2({innerType:t,typeName:dr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Or(e)});var n4=class extends qr{_parse(t){if(this._getType(t)!==Jt.nan){let e=this._getOrReturnCtx(t);return Vt(e,{code:Ot.invalid_type,expected:Jt.nan,received:e.parsedType}),br}return{status:"valid",value:t.data}}};n4.create=t=>new n4({typeName:dr.ZodNaN,...Or(t)});var w_e=Symbol("zod_brand"),cI=class extends qr{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},lI=class _ee extends qr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?br:i.status==="dirty"?(r.dirty(),J8(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?br:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new _ee({in:e,out:r,typeName:dr.ZodPipeline})}},u2=class extends qr{_parse(t){let e=this._def.innerType._parse(t);return Gg(e)&&(e.value=Object.freeze(e.value)),e}unwrap(){return this._def.innerType}};u2.create=(t,e)=>new u2({innerType:t,typeName:dr.ZodReadonly,...Or(e)});function Mee(t,e={},r){return t?C1.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):C1.create()}var __e={object:Ds.lazycreate},dr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(dr||(dr={}));var M_e=(t,e={message:`Input not instance of ${t.name}`})=>Mee(r=>r instanceof t,e),xee=N1.create,See=Yg.create,x_e=n4.create,S_e=Jg.create,Eee=Xg.create,E_e=Qg.create,A_e=e4.create,R_e=e2.create,T_e=t2.create,I_e=C1.create,k_e=bd.create,B_e=Uh.create,P_e=t4.create,O_e=wd.create,N_e=Ds.create,C_e=Ds.strictCreate,L_e=r2.create,D_e=vee.create,$_e=i2.create,q_e=yl.create,U_e=bee.create,F_e=r4.create,j_e=i4.create,z_e=yee.create,Z_e=n2.create,H_e=a2.create,K_e=R2.create,W_e=o2.create,V_e=L1.create,EQ=Pf.create,G_e=Nu.create,Y_e=wl.create,J_e=Pf.createWithPreprocess,X_e=lI.create,Q_e=()=>xee().optional(),e9e=()=>See().optional(),t9e=()=>Eee().optional(),r9e={string:t=>N1.create({...t,coerce:!0}),number:t=>Yg.create({...t,coerce:!0}),boolean:t=>Xg.create({...t,coerce:!0}),bigint:t=>Jg.create({...t,coerce:!0}),date:t=>Qg.create({...t,coerce:!0})},i9e=br,pi=Object.freeze({__proto__:null,defaultErrorMap:O1,setErrorMap:i_e,getErrorMap:G8,makeIssue:Y8,EMPTY_PATH:n_e,addIssueToContext:Vt,ParseStatus:so,INVALID:br,DIRTY:J8,OK:$a,isAborted:LT,isDirty:DT,isValid:Gg,isAsync:X8,get util(){return fi},get objectUtil(){return CT},ZodParsedType:Jt,getParsedType:gl,ZodType:qr,datetimeRegex:dee,ZodString:N1,ZodNumber:Yg,ZodBigInt:Jg,ZodBoolean:Xg,ZodDate:Qg,ZodSymbol:e4,ZodUndefined:e2,ZodNull:t2,ZodAny:C1,ZodUnknown:bd,ZodNever:Uh,ZodVoid:t4,ZodArray:wd,ZodObject:Ds,ZodUnion:r2,ZodDiscriminatedUnion:vee,ZodIntersection:i2,ZodTuple:yl,ZodRecord:bee,ZodMap:r4,ZodSet:i4,ZodFunction:yee,ZodLazy:n2,ZodLiteral:a2,ZodEnum:R2,ZodNativeEnum:o2,ZodPromise:L1,ZodEffects:Pf,ZodTransformer:Pf,ZodOptional:Nu,ZodNullable:wl,ZodDefault:s2,ZodCatch:f2,ZodNaN:n4,BRAND:w_e,ZodBranded:cI,ZodPipeline:lI,ZodReadonly:u2,custom:Mee,Schema:qr,ZodSchema:qr,late:__e,get ZodFirstPartyTypeKind(){return dr},coerce:r9e,any:I_e,array:O_e,bigint:S_e,boolean:Eee,date:E_e,discriminatedUnion:D_e,effect:EQ,enum:K_e,function:z_e,instanceof:M_e,intersection:$_e,lazy:Z_e,literal:H_e,map:F_e,nan:x_e,nativeEnum:W_e,never:B_e,null:T_e,nullable:Y_e,number:See,object:N_e,oboolean:t9e,onumber:e9e,optional:G_e,ostring:Q_e,pipeline:X_e,preprocess:J_e,promise:V_e,record:U_e,set:j_e,strictObject:C_e,string:xee,symbol:A_e,transformer:EQ,tuple:q_e,undefined:R_e,union:L_e,unknown:k_e,void:P_e,NEVER:i9e,ZodIssueCode:Ot,quotelessJson:r_e,ZodError:Bf}),Aee=pi.object({url:pi.string(),address:pi.string()}),Ree=pi.object({url:pi.string(),address:pi.string(),ttl:pi.coerce.number()}),n9e=pi.function().args(pi.string(),pi.string()).returns(pi.promise(pi.string())),a9e=pi.function().args(pi.string()).returns(pi.promise(Aee.nullish())),o9e=pi.function().args(pi.string(),Aee,pi.number()).returns(pi.promise(pi.any())),dI=pi.function().args(pi.string()).returns(pi.promise(Ree.nullish())),pI=pi.function().args(pi.string(),pi.string(),pi.number()).returns(pi.promise(pi.any())),b4=pi.function().args(pi.string()).returns(pi.promise(Ree)),s9e=b4;function vI(t=""){return t=t.trim(),t.endsWith("/")?vI(t.slice(0,-1)):t}function f9e({loadProcessScheduler:t,loadScheduler:e,cache:r,followRedirects:a,checkForRedirect:i}){t=s9e.implement(t),e=b4.implement(e),i=n9e.implement(i);let h=a9e.implement(r.getByProcess),c=dI.implement(r.getByOwner),p=o9e.implement(r.setByProcess),b=pI.implement(r.setByOwner);return(g,y)=>h(g).then(async M=>M||Promise.resolve().then(async()=>y?await c(y)||e(y).then(E=>(b(E.address,E.url,E.ttl),E)):t(g)).then(async x=>{let E=x.url;a&&(E=await i(x.url,g));let A={url:vI(E),address:x.address};return await p(g,A,x.ttl),A}))}function u9e({loadScheduler:t,cache:e}){t=b4.implement(t);let r=dI.implement(e.getByOwner),a=pI.implement(e.setByOwner);return i=>r(i).then(h=>h?{url:h.url}:t(i).then(c=>a(i,c.url,c.ttl).then(()=>({url:vI(c.url)}))).catch(c=>{if(!(c instanceof W8))throw c}))}function h9e({loadScheduler:t,cache:e}){t=b4.implement(t);let r=dI.implement(e.getByOwner),a=pI.implement(e.setByOwner);return i=>r(i).then(h=>h?!0:t(i).then(c=>a(i,c.url,c.ttl)).then(()=>!0).catch(c=>{if(c instanceof W8)return!1;throw c}))}var c9e="https://arweave.net/graphql";function Tee({cacheSize:t=100,GRAPHQL_URL:e=c9e,followRedirects:r=!1}={}){let a=Y7e({size:t}),i=ree({fetch,GRAPHQL_URL:e}),h={getByProcess:J7e({cache:a}),getByOwner:Q7e({cache:a}),setByProcess:X7e({cache:a}),setByOwner:e_e({cache:a})},c=f9e({loadProcessScheduler:K7e({fetch,GRAPHQL_URL:e}),loadScheduler:i,cache:h,followRedirects:r,checkForRedirect:t_e({fetch})}),p=h9e({loadScheduler:i,cache:h}),b=u9e({loadScheduler:i,cache:h});return{locate:c,validate:p,raw:b}}var l9e=globalThis.GRAPHQL_URL||void 0,d9e=globalThis.SCHEDULER_UTILS_CACHE_SIZE||void 0,p9e=globalThis.SCHEDULER_UTILS_FOLLOW_REDIRECTS==="true"||void 0,{locate:hut,validate:cut,raw:lut}=Tee({GRAPHQL_URL:l9e,cacheSize:d9e,followRedirects:p9e}),$h=t=>({fork:t,toPromise:()=>new Promise((e,r)=>t(r,e)),map:e=>$h((r,a)=>t(r,i=>a(e(i)))),bimap:(e,r)=>$h((a,i)=>t(h=>a(e(h)),h=>i(r(h)))),chain:e=>$h((r,a)=>t(r,i=>e(i).fork(r,a))),bichain:(e,r)=>$h((a,i)=>t(h=>e(h).fork(a,i),h=>r(h).fork(a,i))),fold:(e,r)=>$h((a,i)=>t(h=>e(h).fork(a,i),h=>r(h).fork(a,i)))}),jr=t=>$h((e,r)=>r(t)),_d=t=>$h((e,r)=>r(t)),xl=t=>$h((e,r)=>e(t)),Li=t=>(...e)=>$h((r,a)=>t(...e).then(a).catch(r));function v9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployMessage");return i=>jr(i).chain(Li(({processId:h,data:c,tags:p,anchor:b,signer:g})=>g({data:c,tags:p,target:h,anchor:b}))).chain(h=>jr(h).chain(Li(async c=>t(e,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return c.json();throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when writing message via MU"),a.tap("Successfully wrote message via MU")).map(c=>({res:c,messageId:h.id}))).toPromise()}function m9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployProcess");return i=>jr(i).chain(Li(({data:h,tags:c,signer:p})=>p({data:h,tags:c}))).chain(h=>jr(h).chain(Li(async c=>t(e,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return c.json();throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when deploying process via MU"),a.tap("Successfully deployed process via MU")).map(c=>({res:c,processId:h.id}))).toPromise()}function g9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployMonitor");return i=>jr(i).chain(Li(({processId:h,data:c,tags:p,anchor:b,signer:g})=>g({data:c,tags:p,target:h,anchor:b}))).chain(h=>jr(h).chain(Li(async c=>t(e+"/monitor/"+i.processId,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return{ok:!0};throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when subscribing to process via MU"),a.tap("Successfully subscribed to process via MU")).map(c=>({res:c,messageId:h.id}))).toPromise()}function b9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployUnmonitor");return i=>jr(i).chain(Li(({processId:h,data:c,tags:p,anchor:b,signer:g})=>g({data:c,tags:p,target:h,anchor:b}))).chain(h=>jr(h).chain(Li(async c=>t(e+"/monitor/"+i.processId,{method:"DELETE",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"},redirect:"follow",body:c.raw}))).bichain(c=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(c)}`)),Li(async c=>{if(c.ok)return{ok:!0};throw new Error(`${c.status}: ${await c.text()}`)})).bimap(a.tap("Error encountered when unsubscribing to process via MU"),a.tap("Successfully unsubscribed to process via MU")).map(c=>({res:c,messageId:h.id}))).toPromise()}function y9e({fetch:t,MU_URL:e,logger:r}){let a=r.child("deployAssign");return i=>jr(i).chain(Li(async({process:h,message:c,baseLayer:p,exclude:b})=>t(`${e}?process-id=${h}&assign=${c}${p?"&base-layer":""}${b?"&exclude="+b.join(","):""}`,{method:"POST",headers:{"Content-Type":"application/octet-stream",Accept:"application/json"}}))).bichain(h=>xl(new Error(`Error while communicating with MU: ${JSON.stringify(h)}`)),Li(async h=>{if(h.ok)return h.json();throw new Error(`${h.status}: ${await h.text()}`)})).bimap(a.tap("Error encountered when writing assignment via MU"),a.tap("Successfully wrote assignment via MU")).map(h=>({res:h,assignmentId:h.id})).toPromise()}function w9e({fetch:t,CU_URL:e,logger:r}){return a=>jr(a).map(r.tap("posting dryrun request to CU")).chain(Li(i=>t(`${e}/dry-run?process-id=${i.Target}`,{method:"POST",headers:{"Content-Type":"application/json"},redirect:"follow",body:JSON.stringify(i)}).then(h=>h.json()))).toPromise()}function _9e({fetch:t,CU_URL:e,logger:r}){return({id:a,processId:i})=>jr(`${e}/result/${a}?process-id=${i}`).map(r.tap("fetching message result from CU")).chain(Li(async h=>t(h,{method:"GET",headers:{Accept:"application/json"},redirect:"follow"}).then(c=>c.json()))).toPromise()}function M9e({fetch:t,CU_URL:e,logger:r}){return({process:a,from:i,to:h,sort:c,limit:p})=>{let b=new URL(`${e}/results/${a}`),g=new URLSearchParams(b.search);return i&&g.append("from",i),h&&g.append("to",h),c&&g.append("sort",c),p&&g.append("limit",p),b.search=g,jr(b.toString()).map(r.tap("fetching message result from CU")).chain(Li(async y=>t(y,{method:"GET",headers:{Accept:"application/json"},redirect:"follow"}).then(M=>M.json()))).toPromise()}}var x9e=nI(w5e(),1),jg,S9e=({MAX_SIZE:t})=>jg||(jg=new x9e.default(t),jg),AT=({logger:t,fetch:e,cache:r=jg})=>async({suUrl:a,processId:i})=>r.has(i)?r.get(i):e(`${a}/processes/${i}`,{method:"GET",redirect:"follow"}).then(async h=>{if(h.ok)return h.json();throw t("Error Encountered when fetching process meta from SU '%s' for process '%s'",a,i),new Error(`Encountered Error fetching scheduled messages from Scheduler Unit: ${h.status}: ${await h.text()}`)}).then(h=>(t("Caching process meta for process '%s'",i),r.set(i,{tags:h.tags}),h)),E9e=function(){return!1},A9e=E9e,R9e=function(){return!0},mI=R9e,Fh={"@@functional/placeholder":!0};function Gi(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function Tn(t){return function e(r){return arguments.length===0||Gi(r)?e:t.apply(this,arguments)}}function Ki(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Gi(r)?e:Tn(function(i){return t(r,i)});default:return Gi(r)&&Gi(a)?e:Gi(r)?Tn(function(i){return t(i,a)}):Gi(a)?Tn(function(i){return t(r,i)}):t(r,a)}}}function T9e(t,e){t=t||[],e=e||[];var r,a=t.length,i=e.length,h=[];for(r=0;r<a;)h[h.length]=t[r],r+=1;for(r=0;r<i;)h[h.length]=e[r],r+=1;return h}function T2(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Iee(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,p=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Gi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Gi(b)?p=!0:h-=1,c+=1}return!p&&h<=0?r.apply(this,a):T2(Math.max(0,h),Iee(t,a,r))}}var I9e=Ki(function(e,r){return e===1?Tn(r):T2(e,Iee(e,[],r))}),y4=I9e;function xd(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Gi(r)?e:Ki(function(h,c){return t(r,h,c)});case 2:return Gi(r)&&Gi(a)?e:Gi(r)?Ki(function(h,c){return t(h,a,c)}):Gi(a)?Ki(function(h,c){return t(r,h,c)}):Tn(function(h){return t(r,a,h)});default:return Gi(r)&&Gi(a)&&Gi(i)?e:Gi(r)&&Gi(a)?Ki(function(h,c){return t(h,c,i)}):Gi(r)&&Gi(i)?Ki(function(h,c){return t(h,a,c)}):Gi(a)&&Gi(i)?Ki(function(h,c){return t(r,h,c)}):Gi(r)?Tn(function(h){return t(h,a,i)}):Gi(a)?Tn(function(h){return t(r,h,i)}):Gi(i)?Tn(function(h){return t(r,a,h)}):t(r,a,i)}}}var D1=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function k9e(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function w4(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!D1(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(k9e(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}var Du={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function AQ(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function RQ(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function B9e(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function $1(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function P9e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var RT=typeof Object.is=="function"?Object.is:P9e,TQ=Object.prototype.toString,O9e=function(){return TQ.call(arguments)==="[object Arguments]"?function(e){return TQ.call(e)==="[object Arguments]"}:function(e){return $1("callee",e)}}(),N9e=O9e,C9e=!{toString:null}.propertyIsEnumerable("toString"),IQ=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],kQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),L9e=function(e,r){for(var a=0;a<e.length;){if(e[a]===r)return!0;a+=1}return!1},D9e=Tn(typeof Object.keys=="function"&&!kQ?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var r,a,i=[],h=kQ&&N9e(e);for(r in e)$1(r,e)&&(!h||r!=="length")&&(i[i.length]=r);if(C9e)for(a=IQ.length-1;a>=0;)r=IQ[a],$1(r,e)&&!L9e(i,r)&&(i[i.length]=r),a-=1;return i}),q1=D9e,$9e=Tn(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),BQ=$9e;function PQ(t,e,r,a){var i=AQ(t),h=AQ(e);function c(p,b){return gI(p,b,r.slice(),a.slice())}return!RQ(function(p,b){return!RQ(c,b,p)},h,i)}function gI(t,e,r,a){if(RT(t,e))return!0;var i=BQ(t);if(i!==BQ(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&B9e(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&RT(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!RT(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:PQ(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:PQ(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=q1(t);if(c.length!==q1(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!($1(g,e)&&gI(e[g],t[g],p,b)))return!1;h-=1}return!0}var q9e=Ki(function(e,r){return gI(e,r,[],[])}),k1=q9e;function U9e(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(k1(t[r],e))return r;r+=1}return-1}function kee(t,e){return U9e(e,t,0)>=0}function z8(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function TT(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var Lg=function(e){return(e<10?"0":"")+e},F9e=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+Lg(e.getUTCMonth()+1)+"-"+Lg(e.getUTCDate())+"T"+Lg(e.getUTCHours())+":"+Lg(e.getUTCMinutes())+":"+Lg(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},j9e=F9e;function z9e(t){return function(){return!t.apply(this,arguments)}}function Bee(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function Z9e(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function H9e(t){return Object.prototype.toString.call(t)==="[object Object]"}var K9e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Du.init,t.prototype["@@transducer/result"]=Du.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function W9e(t){return function(e){return new K9e(t,e)}}var V9e=Ki(w4(["fantasy-land/filter","filter"],W9e,function(t,e){return H9e(e)?Bee(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},q1(e)):Z9e(t,e)})),G9e=V9e,Y9e=Ki(function(e,r){return G9e(z9e(e),r)}),Pee=Y9e;function Oee(t,e){var r=function(c){var p=e.concat([t]);return kee(c,p)?"<Circular>":Oee(c,p)},a=function(h,c){return z8(function(p){return TT(p)+": "+r(h[p])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+z8(r,t).join(", ")+"))";case"[object Array]":return"["+z8(r,t).concat(a(t,Pee(function(h){return/^\d+$/.test(h)},q1(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):TT(j9e(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":TT(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,q1(t)).join(", ")+"}"}}var J9e=Tn(function(e){return Oee(e,[])}),B1=J9e,X9e=Ki(function(e,r){if(e===r)return r;function a(b,g){if(b>g!=g>b)return g>b?g:b}var i=a(e,r);if(i!==void 0)return i;var h=a(typeof e,typeof r);if(h!==void 0)return h===typeof e?e:r;var c=B1(e),p=a(c,B1(r));return p!==void 0&&p===c?e:r}),Nee=X9e,Q9e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Du.init,t.prototype["@@transducer/result"]=Du.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),eMe=function(e){return function(r){return new Q9e(e,r)}},Cee=eMe,tMe=Ki(w4(["fantasy-land/map","map"],Cee,function(e,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return y4(r.length,function(){return e.call(this,r.apply(this,arguments))});case"[object Object]":return Bee(function(a,i){return a[i]=e(r[i]),a},{},q1(r));default:return z8(e,r)}})),_4=tMe,M4=Number.isInteger||function(e){return e<<0===e};function a4(t){return Object.prototype.toString.call(t)==="[object String]"}function Lee(t,e){var r=t<0?e.length+t:t;return a4(e)?e.charAt(r):e[r]}var rMe=Ki(function(e,r){if(r!=null)return M4(e)?Lee(e,r):r[e]}),Sd=rMe,iMe=Ki(function(e,r){return _4(Sd(e),r)}),nMe=iMe,aMe=Tn(function(e){return D1(e)?!0:!e||typeof e!="object"||a4(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),bI=aMe,OQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function oMe(t,e,r){return function(i,h,c){if(bI(c))return t(i,h,c);if(c==null)return h;if(typeof c["fantasy-land/reduce"]=="function")return e(i,h,c,"fantasy-land/reduce");if(c[OQ]!=null)return r(i,h,c[OQ]());if(typeof c.next=="function")return r(i,h,c);if(typeof c.reduce=="function")return e(i,h,c,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Dee(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var sMe=Ki(function(e,r){return T2(e.length,function(){return e.apply(r,arguments)})}),fMe=sMe;function uMe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function hMe(t,e,r,a){return t["@@transducer/result"](r[a](fMe(t["@@transducer/step"],t),e))}var cMe=oMe(Dee,hMe,uMe),$ee=cMe,lMe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function dMe(t){return new lMe(t)}var pMe=xd(function(t,e,r){return $ee(typeof t=="function"?dMe(t):t,e,r)}),U1=pMe,vMe=Tn(function(e){return y4(U1(Nee,0,nMe("length",e)),function(){for(var r=0,a=e.length;r<a;){if(!e[r].apply(this,arguments))return!1;r+=1}return!0})}),mMe=vMe,gMe=Tn(function(e){return function(){return e}}),yI=gMe,bMe=Ki(function(e,r){return T9e(r,[e])}),wI=bMe;function yMe(t,e,r){if(M4(t)&&D1(r)){var a=[].concat(r);return a[t]=e,a}var i={};for(var h in r)i[h]=r[h];return i[t]=e,i}var wMe=Tn(function(e){return e==null}),o4=wMe,_Me=xd(function t(e,r,a){if(e.length===0)return r;var i=e[0];if(e.length>1){var h=!o4(a)&&$1(i,a)&&typeof a[i]=="object"?a[i]:M4(e[1])?[]:{};r=t(Array.prototype.slice.call(e,1),r,h)}return yMe(i,r,a)}),MMe=_Me,xMe=xd(function(e,r,a){return MMe([e],r,a)}),$s=xMe;function ZT(t){var e=Object.prototype.toString.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"}function SMe(t){return function e(r){for(var a,i,h,c=[],p=0,b=r.length;p<b;){if(bI(r[p]))for(a=t?e(r[p]):r[p],h=0,i=a.length;h<i;)c[c.length]=a[h],h+=1;else c[c.length]=r[p];p+=1}return c}}function EMe(t){return{"@@transducer/value":t,"@@transducer/reduced":!0}}var qee="@@transducer/init",HT="@@transducer/step",Uee="@@transducer/result",AMe=function(){function t(e){this.xf=e}return t.prototype[qee]=Du.init,t.prototype[Uee]=Du.result,t.prototype[HT]=function(e,r){var a=this.xf[HT](e,r);return a["@@transducer/reduced"]?EMe(a):a},t}(),RMe=function(){function t(e){this.xf=new AMe(e)}return t.prototype[qee]=Du.init,t.prototype[Uee]=Du.result,t.prototype[HT]=function(e,r){return bI(r)?$ee(this.xf,e,r):Dee(this.xf,e,[r])},t}(),TMe=function(e){return new RMe(e)},IMe=TMe;function kMe(t){return function(e){return Cee(t)(IMe(e))}}var BMe=Ki(w4(["fantasy-land/chain","chain"],kMe,function(e,r){return typeof r=="function"?function(a){return e(r(a))(a)}:SMe(!1)(_4(e,r))})),PMe=BMe;function OMe(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function Fee(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return D1(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var NMe=xd(Fee("slice",function(e,r,a){return Array.prototype.slice.call(a,e,r)})),CMe=NMe,LMe=Tn(Fee("tail",CMe(1,1/0))),DMe=LMe;function F1(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return T2(arguments[0].length,U1(OMe,arguments[0],DMe(arguments)))}function $Me(t){return t}var qMe=Tn($Me),Ed=qMe,UMe=Ki(function(e,r){if(D1(e)){if(D1(r))return e.concat(r);throw new TypeError(B1(r)+" is not an array")}if(a4(e)){if(a4(r))return e+r;throw new TypeError(B1(r)+" is not a string")}if(e!=null&&ZT(e["fantasy-land/concat"]))return e["fantasy-land/concat"](r);if(e!=null&&ZT(e.concat))return e.concat(r);throw new TypeError(B1(e)+' does not have a method named "concat" or "fantasy-land/concat"')}),_I=UMe,FMe=Tn(function(e){var r=U1(Nee,0,_4(function(a){return a[0].length},e));return T2(r,function(){for(var a=0;a<e.length;){if(e[a][0].apply(this,arguments))return e[a][1].apply(this,arguments);a+=1}})}),jee=FMe,jMe=Ki(function(e,r){return r==null||r!==r?e:r}),x4=jMe,zMe=Ki(function(e,r){if(e.length===0||o4(r))return!1;for(var a=r,i=0;i<e.length;)if(!o4(a)&&$1(e[i],a))a=a[e[i]],i+=1;else return!1;return!0}),ZMe=zMe,HMe=Ki(function(e,r){return ZMe([e],r)}),KMe=HMe,WMe=xd(function(e,r,a){return y4(Math.max(e.length,r.length,a.length),function(){return e.apply(this,arguments)?r.apply(this,arguments):a.apply(this,arguments)})}),MI=WMe,VMe=Ki(kee),GMe=VMe,YMe=Ki(function(e,r){return y4(e+1,function(){var a=arguments[e];if(a!=null&&ZT(a[r]))return a[r].apply(a,Array.prototype.slice.call(arguments,0,e));throw new TypeError(B1(a)+' does not have a method named "'+r+'"')})}),JMe=YMe,XMe=Ki(function(e,r){return r instanceof e||r!=null&&(r.constructor===e||e.name==="Object"&&typeof r=="object")}),Wg=XMe,QMe=Tn(function(e){return!o4(e)}),IT=QMe,exe=JMe(1,"join"),txe=exe;function rxe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];M4(i)?r=Lee(i,r):r=r[i]}return r}var ixe=Ki(rxe),nxe=ixe,axe=xd(function(e,r,a){return k1(e,Sd(r,a))}),NQ=axe,oxe=xd(function(e,r,a){return x4(e,Sd(r,a))}),sxe=oxe,fxe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Du.init,t.prototype["@@transducer/result"]=Du.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r),this.xf["@@transducer/step"](e,r)},t}();function uxe(t){return function(e){return new fxe(t,e)}}var hxe=Ki(w4([],uxe,function(e,r){return e(r),r})),cxe=hxe,ui;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(ui||(ui={}));var KT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(KT||(KT={}));var Xt=ui.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bl=t=>{switch(typeof t){case"undefined":return Xt.undefined;case"string":return Xt.string;case"number":return isNaN(t)?Xt.nan:Xt.number;case"boolean":return Xt.boolean;case"function":return Xt.function;case"bigint":return Xt.bigint;case"symbol":return Xt.symbol;case"object":return Array.isArray(t)?Xt.array:t===null?Xt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Xt.promise:typeof Map<"u"&&t instanceof Map?Xt.map:typeof Set<"u"&&t instanceof Set?Xt.set:typeof Date<"u"&&t instanceof Date?Xt.date:Xt.object;default:return Xt.unknown}},Rt=ui.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),lxe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ls=class zee extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof zee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ui.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Ls.create=t=>new Ls(t);var j1=(t,e)=>{let r;switch(t.code){case Rt.invalid_type:t.received===Xt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Rt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ui.jsonStringifyReplacer)}`;break;case Rt.unrecognized_keys:r=`Unrecognized key(s) in object: ${ui.joinValues(t.keys,", ")}`;break;case Rt.invalid_union:r="Invalid input";break;case Rt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ui.joinValues(t.options)}`;break;case Rt.invalid_enum_value:r=`Invalid enum value. Expected ${ui.joinValues(t.options)}, received '${t.received}'`;break;case Rt.invalid_arguments:r="Invalid function arguments";break;case Rt.invalid_return_type:r="Invalid function return type";break;case Rt.invalid_date:r="Invalid date";break;case Rt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ui.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Rt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Rt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Rt.custom:r="Invalid input";break;case Rt.invalid_intersection_types:r="Intersection results could not be merged";break;case Rt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Rt.not_finite:r="Number must be finite";break;default:r=e.defaultError,ui.assertNever(t)}return{message:r}},Zee=j1;function dxe(t){Zee=t}function s4(){return Zee}var f4=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},pxe=[];function Gt(t,e){let r=s4(),a=f4({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===j1?void 0:j1].filter(i=>!!i)});t.common.issues.push(a)}var fo=class Hee{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return mr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return Hee.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return mr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},mr=Object.freeze({status:"aborted"}),I1=t=>({status:"dirty",value:t}),qa=t=>({status:"valid",value:t}),WT=t=>t.status==="aborted",VT=t=>t.status==="dirty",h2=t=>t.status==="valid",c2=t=>typeof Promise<"u"&&t instanceof Promise;function u4(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function Kee(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ar;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ar||(ar={}));var zg,Zg,$u=class{constructor(t,e,r,a){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},CQ=(t,e)=>{if(h2(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ls(t.common.issues);return this._error=r,this._error}}};function Nr(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,p)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:c.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Ur=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return bl(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new fo,ctx:{common:t.parent.common,data:t.data,parsedType:bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(c2(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let a={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:bl(t)},i=this._parseSync({data:t,path:a.path,parent:a});return CQ(a,i)}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:bl(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(c2(a)?a:Promise.resolve(a));return CQ(r,i)}refine(t,e){let r=a=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(a):e;return this._refinement((a,i)=>{let h=t(a),c=()=>i.addIssue({code:Rt.custom,...r(a)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(c(),!1)):h?!0:(c(),!1)})}refinement(t,e){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof e=="function"?e(r,a):e),!1))}_refinement(t){return new Of({schema:this,typeName:pr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Cu.create(this,this._def)}nullable(){return Ml.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Md.create(this,this._def)}promise(){return H1.create(this,this._def)}or(t){return b2.create([this,t],this._def)}and(t){return y2.create(this,t,this._def)}transform(t){return new Of({...Nr(this._def),schema:this,typeName:pr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new x2({...Nr(this._def),innerType:this,defaultValue:e,typeName:pr.ZodDefault})}brand(){return new xI({typeName:pr.ZodBranded,type:this,...Nr(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new S2({...Nr(this._def),innerType:this,catchValue:e,typeName:pr.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return SI.create(this,t)}readonly(){return E2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vxe=/^c[^\s-]{8,}$/i,mxe=/^[0-9a-z]+$/,gxe=/^[0-9A-HJKMNP-TV-Z]{26}$/,bxe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yxe=/^[a-z0-9_-]{21}$/i,wxe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_xe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mxe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kT,xxe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sxe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Exe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wee="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Axe=new RegExp(`^${Wee}$`);function Vee(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Rxe(t){return new RegExp(`^${Vee(t)}$`)}function Gee(t){let e=`${Wee}T${Vee(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Txe(t,e){return!!((e==="v4"||!e)&&xxe.test(t)||(e==="v6"||!e)&&Sxe.test(t))}var z1=class Hg extends Ur{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Xt.string){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.string,received:h.parsedType}),mr}let a=new fo,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,p=e.data.length<h.value;(c||p)&&(i=this._getOrReturnCtx(e,i),c?Gt(i,{code:Rt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Gt(i,{code:Rt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")_xe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"email",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")kT||(kT=new RegExp(Mxe,"u")),kT.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"emoji",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")bxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"uuid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")yxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"nanoid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")vxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"cuid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")mxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"cuid2",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")gxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"ulid",code:Rt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Gt(i,{validation:"url",code:Rt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"regex",code:Rt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?Gee(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?Axe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?Rxe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?wxe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"duration",code:Rt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?Txe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"ip",code:Rt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?Exe.test(e.data)||(i=this._getOrReturnCtx(e,i),Gt(i,{validation:"base64",code:Rt.invalid_string,message:h.message}),a.dirty()):ui.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Rt.invalid_string,...ar.errToObj(a)})}_addCheck(e){return new Hg({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ar.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ar.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ar.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ar.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ar.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ar.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ar.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ar.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ar.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ar.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...ar.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ar.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ar.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ar.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ar.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ar.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ar.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ar.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ar.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ar.errToObj(r)})}nonempty(e){return this.min(1,ar.errToObj(e))}trim(){return new Hg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};z1.create=t=>{var e;return new z1({checks:[],typeName:pr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Nr(t)})};function Ixe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var l2=class GT extends Ur{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Xt.number){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.number,received:h.parsedType}),mr}let a,i=new fo;for(let h of this._def.checks)h.kind==="int"?ui.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?Ixe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.not_finite,message:h.message}),i.dirty()):ui.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ar.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ar.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ar.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ar.toString(r))}setLimit(e,r,a,i){return new GT({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ar.toString(i)}]})}_addCheck(e){return new GT({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ar.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ar.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ar.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ar.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ar.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ar.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ar.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ar.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ar.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ui.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};l2.create=t=>new l2({checks:[],typeName:pr.ZodNumber,coerce:t?.coerce||!1,...Nr(t)});var d2=class YT extends Ur{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Xt.bigint){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.bigint,received:h.parsedType}),mr}let a,i=new fo;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Gt(a,{code:Rt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):ui.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ar.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ar.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ar.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ar.toString(r))}setLimit(e,r,a,i){return new YT({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:ar.toString(i)}]})}_addCheck(e){return new YT({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ar.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ar.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ar.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ar.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ar.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};d2.create=t=>{var e;return new d2({checks:[],typeName:pr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Nr(t)})};var p2=class extends Ur{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Xt.boolean){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.boolean,received:r.parsedType}),mr}return qa(t.data)}};p2.create=t=>new p2({typeName:pr.ZodBoolean,coerce:t?.coerce||!1,...Nr(t)});var v2=class Yee extends Ur{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Xt.date){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_type,expected:Xt.date,received:h.parsedType}),mr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Gt(h,{code:Rt.invalid_date}),mr}let a=new fo,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Gt(i,{code:Rt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):ui.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yee({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ar.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ar.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};v2.create=t=>new v2({checks:[],coerce:t?.coerce||!1,typeName:pr.ZodDate,...Nr(t)});var h4=class extends Ur{_parse(t){if(this._getType(t)!==Xt.symbol){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.symbol,received:r.parsedType}),mr}return qa(t.data)}};h4.create=t=>new h4({typeName:pr.ZodSymbol,...Nr(t)});var m2=class extends Ur{_parse(t){if(this._getType(t)!==Xt.undefined){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.undefined,received:r.parsedType}),mr}return qa(t.data)}};m2.create=t=>new m2({typeName:pr.ZodUndefined,...Nr(t)});var g2=class extends Ur{_parse(t){if(this._getType(t)!==Xt.null){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.null,received:r.parsedType}),mr}return qa(t.data)}};g2.create=t=>new g2({typeName:pr.ZodNull,...Nr(t)});var Z1=class extends Ur{constructor(){super(...arguments),this._any=!0}_parse(t){return qa(t.data)}};Z1.create=t=>new Z1({typeName:pr.ZodAny,...Nr(t)});var yd=class extends Ur{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qa(t.data)}};yd.create=t=>new yd({typeName:pr.ZodUnknown,...Nr(t)});var jh=class extends Ur{_parse(t){let e=this._getOrReturnCtx(t);return Gt(e,{code:Rt.invalid_type,expected:Xt.never,received:e.parsedType}),mr}};jh.create=t=>new jh({typeName:pr.ZodNever,...Nr(t)});var c4=class extends Ur{_parse(t){if(this._getType(t)!==Xt.undefined){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.void,received:r.parsedType}),mr}return qa(t.data)}};c4.create=t=>new c4({typeName:pr.ZodVoid,...Nr(t)});var Md=class Z8 extends Ur{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Xt.array)return Gt(r,{code:Rt.invalid_type,expected:Xt.array,received:r.parsedType}),mr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Gt(r,{code:c?Rt.too_big:Rt.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Gt(r,{code:Rt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Gt(r,{code:Rt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new $u(r,c,r.path,p)))).then(c=>fo.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new $u(r,c,r.path,p)));return fo.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new Z8({...this._def,minLength:{value:e,message:ar.toString(r)}})}max(e,r){return new Z8({...this._def,maxLength:{value:e,message:ar.toString(r)}})}length(e,r){return new Z8({...this._def,exactLength:{value:e,message:ar.toString(r)}})}nonempty(e){return this.min(1,e)}};Md.create=(t,e)=>new Md({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pr.ZodArray,...Nr(e)});function T1(t){if(t instanceof qs){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Cu.create(T1(a))}return new qs({...t._def,shape:()=>e})}else return t instanceof Md?new Md({...t._def,type:T1(t.element)}):t instanceof Cu?Cu.create(T1(t.unwrap())):t instanceof Ml?Ml.create(T1(t.unwrap())):t instanceof _l?_l.create(t.items.map(e=>T1(e))):t}var qs=class If extends Ur{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ui.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Xt.object){let g=this._getOrReturnCtx(e);return Gt(g,{code:Rt.invalid_type,expected:Xt.object,received:g.parsedType}),mr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof jh&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||p.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new $u(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof jh){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Gt(i,{code:Rt.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new $u(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>fo.mergeObjectSync(a,g)):fo.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return ar.errToObj,new If({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=ar.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new If({...this._def,unknownKeys:"strip"})}passthrough(){return new If({...this._def,unknownKeys:"passthrough"})}extend(e){return new If({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new If({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:pr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new If({...this._def,catchall:e})}pick(e){let r={};return ui.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new If({...this._def,shape:()=>r})}omit(e){let r={};return ui.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new If({...this._def,shape:()=>r})}deepPartial(){return T1(this)}partial(e){let r={};return ui.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new If({...this._def,shape:()=>r})}required(e){let r={};return ui.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Cu;)h=h._def.innerType;r[a]=h}}),new If({...this._def,shape:()=>r})}keyof(){return rte(ui.objectKeys(this.shape))}};qs.create=(t,e)=>new qs({shape:()=>t,unknownKeys:"strip",catchall:jh.create(),typeName:pr.ZodObject,...Nr(e)});qs.strictCreate=(t,e)=>new qs({shape:()=>t,unknownKeys:"strict",catchall:jh.create(),typeName:pr.ZodObject,...Nr(e)});qs.lazycreate=(t,e)=>new qs({shape:t,unknownKeys:"strip",catchall:jh.create(),typeName:pr.ZodObject,...Nr(e)});var b2=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function a(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return e.common.issues.push(...c.ctx.common.issues),c.result;let h=i.map(c=>new Ls(c.ctx.common.issues));return Gt(e,{code:Rt.invalid_union,unionErrors:h}),mr}if(e.common.async)return Promise.all(r.map(async i=>{let h={...e,common:{...e.common,issues:[]},parent:null};return{result:await i._parseAsync({data:e.data,path:e.path,parent:h}),ctx:h}})).then(a);{let i,h=[];for(let p of r){let b={...e,common:{...e.common,issues:[]},parent:null},g=p._parseSync({data:e.data,path:e.path,parent:b});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:b}),b.common.issues.length&&h.push(b.common.issues)}if(i)return e.common.issues.push(...i.ctx.common.issues),i.result;let c=h.map(p=>new Ls(p));return Gt(e,{code:Rt.invalid_union,unionErrors:c}),mr}}get options(){return this._def.options}};b2.create=(t,e)=>new b2({options:t,typeName:pr.ZodUnion,...Nr(e)});var Dh=t=>t instanceof w2?Dh(t.schema):t instanceof Of?Dh(t.innerType()):t instanceof _2?[t.value]:t instanceof I2?t.options:t instanceof M2?ui.objectValues(t.enum):t instanceof x2?Dh(t._def.innerType):t instanceof m2?[void 0]:t instanceof g2?[null]:t instanceof Cu?[void 0,...Dh(t.unwrap())]:t instanceof Ml?[null,...Dh(t.unwrap())]:t instanceof xI||t instanceof E2?Dh(t.unwrap()):t instanceof S2?Dh(t._def.innerType):[],Jee=class Xee extends Ur{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Xt.object)return Gt(r,{code:Rt.invalid_type,expected:Xt.object,received:r.parsedType}),mr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Gt(r,{code:Rt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),mr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Dh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new Xee({typeName:pr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Nr(a)})}};function JT(t,e){let r=bl(t),a=bl(e);if(t===e)return{valid:!0,data:t};if(r===Xt.object&&a===Xt.object){let i=ui.objectKeys(e),h=ui.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=JT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Xt.array&&a===Xt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=JT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Xt.date&&a===Xt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var y2=class extends Ur{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=(i,h)=>{if(WT(i)||WT(h))return mr;let c=JT(i.value,h.value);return c.valid?((VT(i)||VT(h))&&e.dirty(),{status:e.value,value:c.data}):(Gt(r,{code:Rt.invalid_intersection_types}),mr)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,h])=>a(i,h)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};y2.create=(t,e,r)=>new y2({left:t,right:e,typeName:pr.ZodIntersection,...Nr(r)});var _l=class Qee extends Ur{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Xt.array)return Gt(a,{code:Rt.invalid_type,expected:Xt.array,received:a.parsedType}),mr;if(a.data.length<this._def.items.length)return Gt(a,{code:Rt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),mr;!this._def.rest&&a.data.length>this._def.items.length&&(Gt(a,{code:Rt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new $u(a,c,a.path,p)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>fo.mergeArray(r,c)):fo.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new Qee({...this._def,rest:e})}};_l.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _l({items:t,typeName:pr.ZodTuple,rest:null,...Nr(e)})};var ete=class XT extends Ur{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Xt.object)return Gt(a,{code:Rt.invalid_type,expected:Xt.object,received:a.parsedType}),mr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new $u(a,p,a.path,p)),value:c._parse(new $u(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?fo.mergeObjectAsync(r,i):fo.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Ur?new XT({keyType:e,valueType:r,typeName:pr.ZodRecord,...Nr(a)}):new XT({keyType:z1.create(),valueType:e,typeName:pr.ZodRecord,...Nr(r)})}},l4=class extends Ur{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xt.map)return Gt(r,{code:Rt.invalid_type,expected:Xt.map,received:r.parsedType}),mr;let a=this._def.keyType,i=this._def.valueType,h=[...r.data.entries()].map(([c,p],b)=>({key:a._parse(new $u(r,c,r.path,[b,"key"])),value:i._parse(new $u(r,p,r.path,[b,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of h){let b=await p.key,g=await p.value;if(b.status==="aborted"||g.status==="aborted")return mr;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}})}else{let c=new Map;for(let p of h){let b=p.key,g=p.value;if(b.status==="aborted"||g.status==="aborted")return mr;(b.status==="dirty"||g.status==="dirty")&&e.dirty(),c.set(b.value,g.value)}return{status:e.value,value:c}}}};l4.create=(t,e,r)=>new l4({valueType:e,keyType:t,typeName:pr.ZodMap,...Nr(r)});var d4=class QT extends Ur{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Xt.set)return Gt(a,{code:Rt.invalid_type,expected:Xt.set,received:a.parsedType}),mr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Gt(a,{code:Rt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Gt(a,{code:Rt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return mr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new $u(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new QT({...this._def,minSize:{value:e,message:ar.toString(r)}})}max(e,r){return new QT({...this._def,maxSize:{value:e,message:ar.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};d4.create=(t,e)=>new d4({valueType:t,minSize:null,maxSize:null,typeName:pr.ZodSet,...Nr(e)});var tte=class H8 extends Ur{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Xt.function)return Gt(r,{code:Rt.invalid_type,expected:Xt.function,received:r.parsedType}),mr;function a(p,b){return f4({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s4(),j1].filter(g=>!!g),issueData:{code:Rt.invalid_arguments,argumentsError:b}})}function i(p,b){return f4({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s4(),j1].filter(g=>!!g),issueData:{code:Rt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof H1){let p=this;return qa(async function(...b){let g=new Ls([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return qa(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Ls([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Ls([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new H8({...this._def,args:_l.create(e).rest(yd.create())})}returns(e){return new H8({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new H8({args:e||_l.create([]).rest(yd.create()),returns:r||yd.create(),typeName:pr.ZodFunction,...Nr(a)})}},w2=class extends Ur{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};w2.create=(t,e)=>new w2({getter:t,typeName:pr.ZodLazy,...Nr(e)});var _2=class extends Ur{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return Gt(e,{received:e.data,code:Rt.invalid_literal,expected:this._def.value}),mr}return{status:"valid",value:t.data}}get value(){return this._def.value}};_2.create=(t,e)=>new _2({value:t,typeName:pr.ZodLiteral,...Nr(e)});function rte(t,e){return new I2({values:t,typeName:pr.ZodEnum,...Nr(e)})}var I2=class eI extends Ur{constructor(){super(...arguments),zg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Gt(r,{expected:ui.joinValues(a),received:r.parsedType,code:Rt.invalid_type}),mr}if(u4(this,zg,"f")||Kee(this,zg,new Set(this._def.values),"f"),!u4(this,zg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Gt(r,{received:r.data,code:Rt.invalid_enum_value,options:a}),mr}return qa(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return eI.create(e,{...this._def,...r})}exclude(e,r=this._def){return eI.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};zg=new WeakMap;I2.create=rte;var M2=class extends Ur{constructor(){super(...arguments),Zg.set(this,void 0)}_parse(t){let e=ui.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Xt.string&&r.parsedType!==Xt.number){let a=ui.objectValues(e);return Gt(r,{expected:ui.joinValues(a),received:r.parsedType,code:Rt.invalid_type}),mr}if(u4(this,Zg,"f")||Kee(this,Zg,new Set(ui.getValidEnumValues(this._def.values)),"f"),!u4(this,Zg,"f").has(t.data)){let a=ui.objectValues(e);return Gt(r,{received:r.data,code:Rt.invalid_enum_value,options:a}),mr}return qa(t.data)}get enum(){return this._def.values}};Zg=new WeakMap;M2.create=(t,e)=>new M2({values:t,typeName:pr.ZodNativeEnum,...Nr(e)});var H1=class extends Ur{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Xt.promise&&e.common.async===!1)return Gt(e,{code:Rt.invalid_type,expected:Xt.promise,received:e.parsedType}),mr;let r=e.parsedType===Xt.promise?e.data:Promise.resolve(e.data);return qa(r.then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};H1.create=(t,e)=>new H1({type:t,typeName:pr.ZodPromise,...Nr(e)});var Of=class extends Ur{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:h=>{Gt(r,h),h.fatal?e.abort():e.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let h=a.transform(r.data,i);if(r.common.async)return Promise.resolve(h).then(async c=>{if(e.value==="aborted")return mr;let p=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return p.status==="aborted"?mr:p.status==="dirty"||e.value==="dirty"?I1(p.value):p});{if(e.value==="aborted")return mr;let c=this._def.schema._parseSync({data:h,path:r.path,parent:r});return c.status==="aborted"?mr:c.status==="dirty"||e.value==="dirty"?I1(c.value):c}}if(a.type==="refinement"){let h=c=>{let p=a.refinement(c,i);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?mr:(c.status==="dirty"&&e.dirty(),h(c.value),{status:e.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?mr:(c.status==="dirty"&&e.dirty(),h(c.value).then(()=>({status:e.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){let h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!h2(h))return h;let c=a.transform(h.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>h2(h)?Promise.resolve(a.transform(h.value,i)).then(c=>({status:e.value,value:c})):h);ui.assertNever(a)}};Of.create=(t,e,r)=>new Of({schema:t,typeName:pr.ZodEffects,effect:e,...Nr(r)});Of.createWithPreprocess=(t,e,r)=>new Of({schema:e,effect:{type:"preprocess",transform:t},typeName:pr.ZodEffects,...Nr(r)});var Cu=class extends Ur{_parse(t){return this._getType(t)===Xt.undefined?qa(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Cu.create=(t,e)=>new Cu({innerType:t,typeName:pr.ZodOptional,...Nr(e)});var Ml=class extends Ur{_parse(t){return this._getType(t)===Xt.null?qa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ml.create=(t,e)=>new Ml({innerType:t,typeName:pr.ZodNullable,...Nr(e)});var x2=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===Xt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};x2.create=(t,e)=>new x2({innerType:t,typeName:pr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Nr(e)});var S2=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return c2(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ls(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ls(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};S2.create=(t,e)=>new S2({innerType:t,typeName:pr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Nr(e)});var p4=class extends Ur{_parse(t){if(this._getType(t)!==Xt.nan){let r=this._getOrReturnCtx(t);return Gt(r,{code:Rt.invalid_type,expected:Xt.nan,received:r.parsedType}),mr}return{status:"valid",value:t.data}}};p4.create=t=>new p4({typeName:pr.ZodNaN,...Nr(t)});var kxe=Symbol("zod_brand"),xI=class extends Ur{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},SI=class ite extends Ur{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?mr:h.status==="dirty"?(r.dirty(),I1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?mr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new ite({in:e,out:r,typeName:pr.ZodPipeline})}},E2=class extends Ur{_parse(t){let e=this._def.innerType._parse(t),r=a=>(h2(a)&&(a.value=Object.freeze(a.value)),a);return c2(e)?e.then(a=>r(a)):r(e)}unwrap(){return this._def.innerType}};E2.create=(t,e)=>new E2({innerType:t,typeName:pr.ZodReadonly,...Nr(e)});function nte(t,e={},r){return t?Z1.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):Z1.create()}var Bxe={object:qs.lazycreate},pr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(pr||(pr={}));var Pxe=(t,e={message:`Input not instance of ${t.name}`})=>nte(r=>r instanceof t,e),ate=z1.create,ote=l2.create,Oxe=p4.create,Nxe=d2.create,ste=p2.create,Cxe=v2.create,Lxe=h4.create,Dxe=m2.create,$xe=g2.create,qxe=Z1.create,Uxe=yd.create,Fxe=jh.create,jxe=c4.create,zxe=Md.create,Zxe=qs.create,Hxe=qs.strictCreate,Kxe=b2.create,Wxe=Jee.create,Vxe=y2.create,Gxe=_l.create,Yxe=ete.create,Jxe=l4.create,Xxe=d4.create,Qxe=tte.create,eSe=w2.create,tSe=_2.create,rSe=I2.create,iSe=M2.create,nSe=H1.create,LQ=Of.create,aSe=Cu.create,oSe=Ml.create,sSe=Of.createWithPreprocess,fSe=SI.create,uSe=()=>ate().optional(),hSe=()=>ote().optional(),cSe=()=>ste().optional(),lSe={string:t=>z1.create({...t,coerce:!0}),number:t=>l2.create({...t,coerce:!0}),boolean:t=>p2.create({...t,coerce:!0}),bigint:t=>d2.create({...t,coerce:!0}),date:t=>v2.create({...t,coerce:!0})},dSe=mr,wt=Object.freeze({__proto__:null,defaultErrorMap:j1,setErrorMap:dxe,getErrorMap:s4,makeIssue:f4,EMPTY_PATH:pxe,addIssueToContext:Gt,ParseStatus:fo,INVALID:mr,DIRTY:I1,OK:qa,isAborted:WT,isDirty:VT,isValid:h2,isAsync:c2,get util(){return ui},get objectUtil(){return KT},ZodParsedType:Xt,getParsedType:bl,ZodType:Ur,datetimeRegex:Gee,ZodString:z1,ZodNumber:l2,ZodBigInt:d2,ZodBoolean:p2,ZodDate:v2,ZodSymbol:h4,ZodUndefined:m2,ZodNull:g2,ZodAny:Z1,ZodUnknown:yd,ZodNever:jh,ZodVoid:c4,ZodArray:Md,ZodObject:qs,ZodUnion:b2,ZodDiscriminatedUnion:Jee,ZodIntersection:y2,ZodTuple:_l,ZodRecord:ete,ZodMap:l4,ZodSet:d4,ZodFunction:tte,ZodLazy:w2,ZodLiteral:_2,ZodEnum:I2,ZodNativeEnum:M2,ZodPromise:H1,ZodEffects:Of,ZodTransformer:Of,ZodOptional:Cu,ZodNullable:Ml,ZodDefault:x2,ZodCatch:S2,ZodNaN:p4,BRAND:kxe,ZodBranded:xI,ZodPipeline:SI,ZodReadonly:E2,custom:nte,Schema:Ur,ZodSchema:Ur,late:Bxe,get ZodFirstPartyTypeKind(){return pr},coerce:lSe,any:qxe,array:zxe,bigint:Nxe,boolean:ste,date:Cxe,discriminatedUnion:Wxe,effect:LQ,enum:rSe,function:Qxe,instanceof:Pxe,intersection:Vxe,lazy:eSe,literal:tSe,map:Jxe,nan:Oxe,nativeEnum:iSe,never:Fxe,null:$xe,nullable:oSe,number:ote,object:Zxe,oboolean:cSe,onumber:hSe,optional:aSe,ostring:uSe,pipeline:fSe,preprocess:sSe,promise:nSe,record:Yxe,set:Xxe,strictObject:Hxe,string:ate,symbol:Lxe,transformer:LQ,tuple:Gxe,undefined:Dxe,union:Kxe,unknown:Uxe,void:jxe,NEVER:dSe,ZodIssueCode:Rt,quotelessJson:lxe,ZodError:Ls});function pSe({fetch:t,GRAPHQL_URL:e,logger:r}){let a=`
|
|
170
170
|
query GetTransactions ($transactionIds: [ID!]!) {
|
|
171
171
|
transactions(ids: $transactionIds) {
|
|
172
172
|
edges {
|
|
@@ -186,7 +186,7 @@ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
}`,i=wt.object({data:wt.object({transactions:wt.object({edges:wt.array(wt.object({node:wt.record(wt.any())}))})})});return h=>jr(h).chain(Li(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[c]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${p.status}: ${await p.text()}`)}).then(i.parse).then(nxe(["data","transactions","edges","0","node"])))).toPromise()}var vSe=nI(x5e(),1),fte=(t="@permaweb/aoconnect")=>{let e=(0,vSe.default)(t);return e.child=r=>fte(`${e.namespace}:${r}`),e.tap=(r,...a)=>cxe((...i)=>e(r,...a,...i)),e},ute=({url:t,path:e})=>e?e.startsWith("/")?ute({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function mSe(t){return F1(x4([]),U1((e,r)=>F1(sxe([],r.name),wI(r.value),$s(r.name,Fh,e))(e),{}),_4(e=>e.length>1?e:e[0]))(t)}function Cs(t,e){return r=>Pee(mMe([NQ(t,"name"),MI(yI(e),NQ(e,"value"),mI)]),r)}function DQ(t){return jee([[Wg(String),k1(t)],[Wg(Array),GMe(t)],[mI,A9e]])}function Ad(t){let e;return Wg(Ls,t)?(e=new Error(gSe(t)),e.stack+=t.stack):Wg(Error,t)?e=t:KMe("message",t)?e=new Error(t.message):Wg(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function gSe(t){return F1(e=>function r(a,i,h){return U1((c,p)=>F1(jee([[k1(Rt.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[k1(Rt.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[k1(Rt.invalid_union),()=>PMe(b=>r(b,400,"Invalid Union"),p.unionErrors)],[mI,()=>[{...p,status:i,contextCode:h}]]]),_I(c))(p.code),[],a.issues)}(e,400,""),e=>U1((r,a)=>{let{message:i,path:h,contextCode:c}=a,p=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${p}': ${i}.`),r},[],e),txe(" | "))(t)}var bSe=wt.object({id:wt.string().min(1,{message:"message is required to be a message id"}),processId:wt.string().min(1,{message:"process is required to be a process id"})});function ySe(){return t=>jr(t).map(bSe.parse).map(()=>t)}var k2=wt.object({name:wt.string(),value:wt.string()}),wSe=wt.function().args(wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))})).returns(wt.promise(wt.any())),_Se=wt.function().args(wt.object({id:wt.string().min(1,{message:"message id is required"}),processId:wt.string().min(1,{message:"process id is required"})})).returns(wt.promise(wt.any())),MSe=wt.function().args(wt.object({process:wt.string().min(1,{message:"process id is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()})).returns(wt.promise(wt.object({edges:wt.array(wt.object({cursor:wt.string(),node:wt.object({Output:wt.any().optional(),Messages:wt.array(wt.any()).optional(),Spawns:wt.array(wt.any()).optional(),Error:wt.any().optional()})}))}))),hte=wt.function().args(wt.object({processId:wt.string(),data:wt.any(),tags:wt.array(k2),anchor:wt.string().optional(),signer:wt.any()})).returns(wt.promise(wt.object({messageId:wt.string()}).passthrough())),xSe=wt.function().args(wt.object({data:wt.any(),tags:wt.array(k2),signer:wt.any()})).returns(wt.promise(wt.object({processId:wt.string()}).passthrough())),SSe=wt.function().args(wt.object({process:wt.string(),message:wt.string(),baseLayer:wt.boolean().optional(),exclude:wt.array(wt.string()).optional()})).returns(wt.promise(wt.object({assignmentId:wt.string()}).passthrough())),cte=hte,lut=wt.function().args(wt.object({suUrl:wt.string().url(),processId:wt.string()})).returns(wt.promise(wt.object({tags:wt.array(k2)}).passthrough())),dut=wt.function().args(wt.string()).returns(wt.promise(wt.object({url:wt.string()}))),ESe=wt.function().args(wt.string()).returns(wt.promise(wt.boolean())),ASe=wt.function().args(wt.string()).returns(wt.promise(wt.object({tags:wt.array(k2)}).passthrough())),S4=wt.function().args(wt.object({data:wt.any(),tags:wt.array(k2),target:wt.string().optional(),anchor:wt.string().optional()})).returns(wt.promise(wt.object({id:wt.string(),raw:wt.any()})));function RSe({loadResult:t}){return t=Li(_Se.implement(t)),e=>jr({id:e.id,processId:e.processId}).chain(t)}function TSe(t){let e=ySe(t),r=RSe(t);return({message:a,process:i})=>jr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(Ad,Ed).toPromise()}var ISe=wt.array(wt.object({name:wt.string(),value:wt.string()}));function kSe(){return t=>jr(t.tags).map(x4([])).map(Cs("Data-Protocol","ao")).map(Cs("Variant")).map(Cs("Type")).map(Cs("SDK")).map(_I(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(ISe.parse).map($s("tags",Fh,t))}function BSe({logger:t}){return e=>jr(e).chain(MI(yI(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map($s("data",Fh,e)).map(r=>F1(Sd("tags"),Cs("Content-Type"),wI({name:"Content-Type",value:"text/plain"}),$s("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function PSe(t){let e=kSe(t),r=BSe(t),a=hte.implement(t.deployMessage);return i=>jr(i).chain(e).chain(r).chain(Li(({id:h,data:c,tags:p,anchor:b,signer:g})=>a({processId:h,data:c,tags:p,anchor:b,signer:S4.implement(g)}))).map(h=>$s("messageId",h.messageId,i))}function OSe(t){let e=PSe(t);return({process:r,data:a,tags:i,anchor:h,signer:c})=>jr({id:r,data:a,tags:i,anchor:h,signer:c}).chain(e).map(p=>p.messageId).bimap(Ad,Ed).toPromise()}var Dg=(t,e,r)=>a=>e(a[t])?_d(a):xl(`Tag '${t}': ${r}`);function NSe({loadTransactionMeta:t,logger:e}){return t=Li(ASe.implement(t)),r=>jr(r).chain(t).map(Sd("tags")).map(mSe).chain(Dg("Data-Protocol",DQ("ao"),"value 'ao' was not found on module")).chain(Dg("Type",DQ("Module"),"value 'Module' was not found on module")).chain(Dg("Module-Format",IT,"was not found on module")).chain(Dg("Input-Encoding",IT,"was not found on module")).chain(Dg("Output-Encoding",IT,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function CSe({logger:t,validateScheduler:e}){return e=Li(ESe.implement(e)),r=>jr(r).chain(a=>e(a).chain(i=>i?_d(a):xl(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function LSe({logger:t}){return e=>jr(e).map(t.tap("Checking for signer")).chain(r=>r?_d(r):xl("signer not found"))}function DSe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=NSe(t),a=CSe(t),i=LSe(t);return h=>jr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>a(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var $Se=wt.array(wt.object({name:wt.string(),value:wt.string()}));function qSe(){return t=>jr(t).map(Sd("tags")).map(x4([])).map(Cs("Data-Protocol","ao")).map(Cs("Variant")).map(Cs("Type")).map(Cs("Module")).map(Cs("Scheduler")).map(Cs("SDK")).map(_I(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map($Se.parse).map($s("tags",Fh,t))}function USe({logger:t}){return e=>jr(e).chain(MI(yI(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map($s("data",Fh,e)).map(r=>F1(Sd("tags"),Cs("Content-Type"),wI({name:"Content-Type",value:"text/plain"}),$s("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function FSe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=qSe(t),a=USe(t),i=xSe.implement(t.deployProcess);return h=>jr(h).chain(r).chain(a).chain(Li(({data:c,tags:p,signer:b})=>i({data:c,tags:p,signer:S4.implement(b)}))).map(c=>$s("processId",c.processId,h))}function jSe(t){let e=DSe(t),r=FSe(t);return({module:a,scheduler:i,signer:h,tags:c,data:p})=>jr({module:a,scheduler:i,signer:h,tags:c,data:p}).chain(e).chain(r).map(b=>b.processId).bimap(Ad,Ed).toPromise()}function zSe(t){let e=cte.implement(t.deployMonitor);return r=>jr(r).chain(Li(({id:a,signer:i})=>e({processId:a,signer:S4.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>$s("monitorId",a.messageId,r))}function ZSe(t){let e=zSe(t);return({process:r,signer:a})=>jr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}function HSe(t){let e=cte.implement(t.deployUnmonitor);return r=>jr(r).chain(Li(({id:a,signer:i})=>e({processId:a,signer:S4.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>$s("monitorId",a.messageId,r))}function KSe(t){let e=HSe(t);return({process:r,signer:a})=>jr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}var WSe=wt.object({process:wt.string().min(1,{message:"process identifier is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()});function VSe(){return t=>jr(t).map(WSe.parse).map(()=>t)}function GSe({queryResults:t}){return t=Li(MSe.implement(t)),e=>jr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function YSe(t){let e=VSe(t),r=GSe(t);return({process:a,from:i,to:h,sort:c,limit:p})=>jr({process:a,from:i,to:h,sort:c,limit:p}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(Ad,Ed).toPromise()}var JSe=wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))});function XSe(){return t=>jr(t).map(JSe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function QSe({dryrunFetch:t}){return Li(wSe.implement(t))}function eEe(t){let e=XSe(t),r=QSe(t);return a=>jr(a).map(tEe).chain(e).chain(r).toPromise()}function tEe({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function rEe(t){let e=SSe.implement(t.deployAssign);return r=>jr(r).chain(Li(({process:a,message:i,baseLayer:h,exclude:c})=>e({process:a,message:i,baseLayer:h,exclude:c}))).map(a=>$s("assignmentId",a.assignmentId,r))}function iEe(t){let e=rEe(t);return({process:r,message:a,baseLayer:i,exclude:h})=>jr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(Ad,Ed).toPromise()}var nEe="https://arweave.net",aEe="https://mu.ao-testnet.xyz",oEe="https://cu.ao-testnet.xyz";function Sl({GRAPHQL_URL:t,GATEWAY_URL:e=nEe,MU_URL:r=aEe,CU_URL:a=oEe}={}){let i=fte();t||(t=ute({url:e,path:"/graphql"}));let{validate:h}=Tee({cacheSize:100,GRAPHQL_URL:t}),c=S9e({MAX_SIZE:25}),p=i.child("result"),b=TSe({loadResult:_9e({fetch,CU_URL:a,logger:p}),logger:p}),g=i.child("message"),y=OSe({loadProcessMeta:AT({fetch,cache:c,logger:g}),deployMessage:v9e({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=jSe({loadTransactionMeta:pSe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:m9e({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=ZSe({loadProcessMeta:AT({fetch,cache:c,logger:E}),deployMonitor:g9e({fetch,MU_URL:r,logger:E}),logger:E}),I=i.child("unmonitor"),P=KSe({loadProcessMeta:AT({fetch,cache:c,logger:I}),deployUnmonitor:b9e({fetch,MU_URL:r,logger:I}),logger:E}),N=i.child("results"),L=YSe({queryResults:M9e({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=eEe({dryrunFetch:w9e({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ee=iEe({deployAssign:y9e({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:P,dryrun:Y,assign:ee}}var lte={};UQ(lte,{createDataItemSigner:()=>BEe});var dte=nI(A5e(),1),pte={};UQ(pte,{AVSCTap:()=>B2,ArweaveSigner:()=>RI,DataItem:()=>A2,MAX_TAG_BYTES:()=>E4,MIN_BINARY_SIZE:()=>kI,SIG_CONFIG:()=>K1,SignatureConfig:()=>Ns,Signer:()=>bte,createData:()=>Mte,default:()=>TEe,deserializeTags:()=>v4,indexToType:()=>TI,serializeTags:()=>II,tagsExceedLimit:()=>_te,warparbundles:()=>IEe});var sEe=Object.create,EI=Object.defineProperty,fEe=Object.getOwnPropertyDescriptor,uEe=Object.getOwnPropertyNames,hEe=Object.getPrototypeOf,cEe=Object.prototype.hasOwnProperty,zh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lEe=(t,e)=>{for(var r in e)EI(t,r,{get:e[r],enumerable:!0})},dEe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uEe(e))!cEe.call(t,i)&&i!==r&&EI(t,i,{get:()=>e[i],enumerable:!(a=fEe(e,i))||a.enumerable});return t},Rd=(t,e,r)=>(r=t!=null?sEe(hEe(t)):{},dEe(e||!t||!t.__esModule?EI(r,"default",{value:t,enumerable:!0}):r,t)),pEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var c=i,p=a-h,b=i+p,g=Me.alloc(b);for(g.write(r);p--;)g.write("=",c++);return g.toString()}t.default=e}),vEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=pEe();function r(b,g){return g===void 0&&(g="utf8"),Me.isBuffer(b)?h(b.toString("base64")):h(Me.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),Me.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return Me.from(i(b),"base64")}var p=r;p.encode=r,p.decode=a,p.toBase64=i,p.fromBase64=h,p.toBuffer=c,t.default=p}),AI=zh((t,e)=>{e.exports=vEe().default,e.exports.default=e.exports}),vte=zh(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=p(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function y(A){var I,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)I=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}),mte=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=vte();function r(x){let E=0;for(let P=0;P<x.length;P++)E+=x[P].byteLength;let A=new Uint8Array(E),I=0;A.set(new Uint8Array(x[0]),I),I+=x[0].byteLength;for(let P=1;P<x.length;P++)A.set(new Uint8Array(x[P]),I),I+=x[P].byteLength;return A}t.concatBuffers=r;function a(x){let E=p(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function p(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=p;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),mEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=mte(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(c)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let c={kty:"RSA",e:"AQAB",n:a},p=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-b.byteLength-2},p,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},p,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},p,a.slice(16));return e.concatBuffers([g])}};t.default=r}),gEe=zh(t=>{t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=I,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=I,p/=256,y-=8);e[a+A-I]|=P*128}}),tI=zh(t=>{"use strict";var e=vte(),r=gEe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,p.prototype),k}function p(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}p.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}p.alloc=function(T,k,O){return y(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!p.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==p.prototype},p.compare=function(T,k){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),ut(k,Uint8Array)&&(k=p.from(k,k.offset,k.byteLength)),!p.isBuffer(T)||!p.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===k)return 0;let O=T.length,q=k.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==k[H]){O=T[H],q=k[H];break}return O<q?-1:q<O?1:0},p.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(T,k){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return p.alloc(0);let O;if(k===void 0)for(k=0,O=0;O<T.length;++O)k+=T[O].length;let q=p.allocUnsafe(k),H=0;for(O=0;O<T.length;++O){let W=T[O];if(ut(W,Uint8Array))H+W.length>q.length?(p.isBuffer(W)||(W=p.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(p.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function C(T,k){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return w(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}p.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<T;k+=2)G(this,k,k+1);return this},p.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<T;k+=4)G(this,k,k+3),G(this,k+1,k+2);return this},p.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<T;k+=8)G(this,k,k+7),G(this,k+1,k+6),G(this,k+2,k+5),G(this,k+3,k+4);return this},p.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(T){if(!p.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:p.compare(this,T)===0},p.prototype.inspect=function(){let T="",k=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(T+=" ... "),"<Buffer "+T+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(T,k,O,q,H){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),!p.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(k===void 0&&(k=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),k<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&k>=O)return 0;if(q>=H)return-1;if(k>=O)return 1;if(k>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,fe=O-k,st=Math.min(W,fe),ue=this.slice(q,H),me=T.slice(k,O);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ee(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=p.from(k,q)),p.isBuffer(k))return k.length===0?-1:D(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):D(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,k,O,q,H){let W=1,fe=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(k,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(k,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(T,k,O){return this.indexOf(T,k,O)!==-1},p.prototype.indexOf=function(T,k,O){return ee(this,T,k,O,!0)},p.prototype.lastIndexOf=function(T,k,O){return ee(this,T,k,O,!1)};function U(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(k.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,k,O,q){return Se(oe(k,T.length-O),T,O,q)}function _(T,k,O,q){return Se(le(k),T,O,q)}function n(T,k,O,q){return Se(ge(k),T,O,q)}function s(T,k,O,q){return Se(ot(k,T.length-O),T,O,q)}p.prototype.write=function(T,k,O,q){if(k===void 0)q="utf8",O=this.length,k=0;else if(O===void 0&&typeof k=="string")q=k,O=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-k;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return U(this,T,k,O);case"utf8":case"utf-8":return V(this,T,k,O);case"ascii":case"latin1":case"binary":return _(this,T,k,O);case"base64":return n(this,T,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,k,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function w(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function v(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(T,k){let O=this.length;T=~~T,k=k===void 0?O:~~k,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),k<0?(k+=O,k<0&&(k=0)):k>O&&(k=O),k<T&&(k=T);let q=this.subarray(T,k);return Object.setPrototypeOf(q,p.prototype),q};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return q},p.prototype.readUintBE=p.prototype.readUIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T+--k],H=1;for(;k>0&&(H*=256);)q+=this[T+--k]*H;return q},p.prototype.readUint8=p.prototype.readUInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]|this[T+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]<<8|this[T+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},p.prototype.readBigUInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),p.prototype.readIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*k)),q},p.prototype.readIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=k,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*k)),W},p.prototype.readInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},p.prototype.readInt16LE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},p.prototype.readInt16BE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},p.prototype.readInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},p.prototype.readInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},p.prototype.readBigInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),p.prototype.readBigInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=(k<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),p.prototype.readFloatLE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!0,23,4)},p.prototype.readFloatBE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!1,23,4)},p.prototype.readDoubleLE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!0,52,8)},p.prototype.readDoubleBE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,k,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,k,O,fe,0)}let H=1,W=0;for(this[k]=T&255;++W<O&&(H*=256);)this[k+W]=T/H&255;return k+O},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,k,O,fe,0)}let H=O-1,W=1;for(this[k+H]=T&255;--H>=0&&(W*=256);)this[k+H]=T/W&255;return k+O},p.prototype.writeUint8=p.prototype.writeUInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,255,0),this[k]=T&255,k+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T&255,this[k+1]=T>>>8,k+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T>>>8,this[k+1]=T&255,k+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k+3]=T>>>24,this[k+2]=T>>>16,this[k+1]=T>>>8,this[k]=T&255,k+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=ct(function(T,k=0){return B(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(T,k=0){return F(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=0,W=1,fe=0;for(this[k]=T&255;++H<O&&(W*=256);)T<0&&fe===0&&this[k+H-1]!==0&&(fe=1),this[k+H]=(T/W>>0)-fe&255;return k+O},p.prototype.writeIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=O-1,W=1,fe=0;for(this[k+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[k+H+1]!==0&&(fe=1),this[k+H]=(T/W>>0)-fe&255;return k+O},p.prototype.writeInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,127,-128),T<0&&(T=255+T+1),this[k]=T&255,k+1},p.prototype.writeInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T&255,this[k+1]=T>>>8,k+2},p.prototype.writeInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T>>>8,this[k+1]=T&255,k+2},p.prototype.writeInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),this[k]=T&255,this[k+1]=T>>>8,this[k+2]=T>>>16,this[k+3]=T>>>24,k+4},p.prototype.writeInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4},p.prototype.writeBigInt64LE=ct(function(T,k=0){return B(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(T,k=0){return F(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}p.prototype.writeFloatLE=function(T,k,O){return re(this,T,k,!0,O)},p.prototype.writeFloatBE=function(T,k,O){return re(this,T,k,!1,O)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(T,k,O){return Q(this,T,k,!0,O)},p.prototype.writeDoubleBE=function(T,k,O){return Q(this,T,k,!1,O)},p.prototype.copy=function(T,k,O,q){if(!p.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),k>=T.length&&(k=T.length),k||(k=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-k<q-O&&(q=T.length-k+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(k,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),k),H},p.prototype.fill=function(T,k,O,q){if(typeof T=="string"){if(typeof k=="string"?(q=k,k=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!p.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(k<0||this.length<k||this.length<O)throw new RangeError("Out of range index");if(O<=k)return this;k=k>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=k;H<O;++H)this[H]=T;else{let W=p.isBuffer(T)?T:p.from(T,q),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-k;++H)this[H+k]=W[H%fe]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function te(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let fe=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${k}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((k-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),bEe=zh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:tI().Buffer,Crypto:window.crypto}):e.exports={Buffer:tI().Buffer,Crypto:crypto}}),gte={};lEe(gte,{AVSCTap:()=>B2,ArweaveSigner:()=>RI,DataItem:()=>A2,MAX_TAG_BYTES:()=>E4,MIN_BINARY_SIZE:()=>kI,SIG_CONFIG:()=>K1,SignatureConfig:()=>Ns,Signer:()=>bte,createData:()=>Mte,deserializeTags:()=>v4,indexToType:()=>TI,serializeTags:()=>II,tagsExceedLimit:()=>_te});var bte=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},yEe=Rd(AI(),1),kf=Rd(mte(),1);async function yte(t){if(Array.isArray(t)){let i=(0,kf.concatBuffers)([(0,kf.stringToBuffer)("list"),(0,kf.stringToBuffer)(t.length.toString())]);return await wte(t,await qh().hash(i,"SHA-384"))}let e=t,r=(0,kf.concatBuffers)([(0,kf.stringToBuffer)("blob"),(0,kf.stringToBuffer)(e.byteLength.toString())]),a=(0,kf.concatBuffers)([await qh().hash(r,"SHA-384"),await qh().hash(e,"SHA-384")]);return await qh().hash(a,"SHA-384")}async function wte(t,e){if(t.length<1)return e;let r=(0,kf.concatBuffers)([e,await yte(t[0])]),a=await qh().hash(r,"SHA-384");return await wte(t.slice(1),a)}var BT=Rd(mEe(),1),wEe=BT.default.default?BT.default.default:BT.default,_Ee=class extends wEe{getPublicKey(t){throw new Error("Unimplemented")}},MEe;function qh(){return MEe??=new _Ee}var Ns;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Ns||(Ns={}));var K1={[Ns.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Ns.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Ns.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Ns.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Ns.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Ns.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Ns.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},RI=class{signatureType=1;ownerLength=K1[1].pubLength;signatureLength=K1[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return yEe.default.toBuffer(this.pk)}sign(t){return qh().sign(this.jwk,t)}static async verify(t,e,r){return await qh().verify(t,e,r)}},TI={1:RI},Ou=Rd(AI(),1);async function rI(t){return yte([(0,kf.stringToBuffer)("dataitem"),(0,kf.stringToBuffer)("1"),(0,kf.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function xEe(t,e){let r=await rI(t),a=await e.sign(r),i=await qh().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function SEe(t,e){let{signature:r,id:a}=await xEe(t,e);return t.getRaw().set(r,2),a}var B2=class{buf;pos;constructor(t=Me.alloc(E4),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Me.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,p;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[a++]=c:c<2048?(r[a++]=c>>6|192,r[a++]=c&63|128):(c&64512)===55296&&((p=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(p&1023),i++,r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=c&63|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,c;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do a=r[this.pos++],h+=(a&127)*c,c*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function II(t){let e=new B2;return e.writeTags(t),e.toBuffer()}function _te(t){let e=new B2;return e.writeTags(t),e.tagsExceedLimit()}function v4(t){return new B2(t).readTags()}function pl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function EEe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function $Q(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var AEe=Rd(bEe(),1),A1=Rd(tI(),1),E4=4096,kI=80,A2=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=pl(this.binary.subarray(0,2));if(Ns?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return A2.verify(this.binary)}get id(){return(async()=>Ou.default.encode(await this.rawId))()}set id(t){this._id=Ou.default.toBuffer(t)}get rawId(){return(async()=>A1.Buffer.from(await AEe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Ou.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return K1[this.signatureType].sigLength}get owner(){return Ou.default.encode(this.rawOwner)}get ownerLength(){return K1[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):A1.Buffer.alloc(0)}get target(){return Ou.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):A1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=pl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(pl(this.binary.subarray(t,t+8))==0)return[];let e=pl(this.binary.subarray(t+8,t+16));return v4(A1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Ou.default.encode(t.name),value:Ou.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return Ou.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await SEe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=A1.Buffer.from(await qh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Ou.default.encode(t.name),value:Ou.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<kI)return!1;let e=new A2(t),r=e.signatureType,a=e.getTagsStart(),i=pl(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),c=pl(h);if(c>E4)return!1;if(i>0)try{if(v4(A1.Buffer.from(t.subarray(a+16,a+16+c))).length!==i)return!1}catch{return!1}let p=TI[r],b=await rI(e);return await p.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return rI(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},REe=Rd(AI(),1);function Mte(t,e,r){let a=e.publicKey,i=r?.target?REe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?II(r.tags):null,g=16+(b?b.byteLength:0),y=Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(EEe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set($Q(r?.tags?.length??0),P);let N=$Q(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new A2(E)}var BI={...gte};globalThis.arbundles??=BI;var TEe=BI,IEe=BI;globalThis.Buffer||(globalThis.Buffer=dte.Buffer);var{DataItem:kEe}=pte;function BEe(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:c=p=>new kEe(p)})=>{let p=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=c(dte.Buffer.from(p));return{id:await b.id,raw:await b.getRaw()}}}var PEe=globalThis.GATEWAY_URL||void 0,OEe=globalThis.MU_URL||void 0,NEe=globalThis.CU_URL||void 0,CEe=globalThis.GRAPHQL_URL||void 0,{result:put,results:vut,message:mut,spawn:gut,monitor:but,unmonitor:yut,dryrun:wut,assign:_ut}=Sl({GATEWAY_URL:PEe,MU_URL:OEe,CU_URL:NEe,GRAPHQL_URL:CEe}),xte=lte.createDataItemSigner;ie();ae();ne();var mre=mi(vre(),1),N4=mre.default.init({host:"arweave.net",port:443,protocol:"https"});ie();ae();ne();ie();ae();ne();var Df=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},gre=class extends Df{},bre=class extends Df{},yre=class extends Df{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},wre=class extends Df{},C4=class extends Df{},_re=class extends Df{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Rl=class extends Df{constructor(){super("Invalid contract configuration")}},Mre=class extends Df{constructor(){super("Invalid process configuration")}},xre=class extends Df{};ie();ae();ne();var Kf=mi(zfe(),1);ie();ae();ne();var jw="3.5.1";var Wu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Kf.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:jw},format:Kf.format.combine(Kf.format.timestamp(),Kf.format.json()),transports:[new Kf.transports.Console({format:Kf.format.combine(Kf.format.timestamp(),Kf.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();var Zfe=t=>{let e=Object.entries(t).sort(([r,a],[i,h])=>r==="@"?-1:i==="@"?1:"priority"in a&&!("priority"in h)?-1:!("priority"in a)&&"priority"in h?1:a.priority!==void 0&&h.priority!==void 0?a.priority===h.priority?r<i?-1:r>i?1:0:a.priority-h.priority:r<i?-1:r>i?1:0);return Object.fromEntries(e.map(([r,a],i)=>[r,{...a,index:i}]))};ie();ae();ne();function Pl(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var zw=class{static init(e){return e!==void 0&&"signer"in e?new fP(e):new Zw(e)}},Zw=class{process;processId;strict;constructor(e){if(this.strict=e.strict||!1,vv(e))this.process=e.process;else if(mv(e))this.process=new za({processId:e.processId});else throw new Rl;this.processId=this.process.processId}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&Pl(MT.passthrough().and(Qt.object({Records:Qt.record(Qt.string(),q8.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&Pl(dQ.passthrough(),a),a}async getLogo(){return(await this.getInfo()).Logo}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&Pl(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&Pl(yT,a),Zfe(a)}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&Pl(wT,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&Pl(_T,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&Pl(Qt.number(),i),i}async getHandlers(){let e=await this.getInfo();return e.Handlers??e.HandlerNames}},fP=class extends Zw{signer;constructor({signer:e,...r}){super(r),this.signer=pv(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async setBaseNameRecord({transactionId:e,ttlSeconds:r},a){return this.setRecord({transactionId:e,ttlSeconds:r,undername:"@"},a)}async setUndernameRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.setRecord({undername:e,transactionId:r,ttlSeconds:a},i)}async removeUndernameRecord({undername:e}){return this.removeRecord({undername:e})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Keywords",value:JSON.stringify(e)}],signer:this.signer})}async setLogo({txId:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Logo"},{name:"Logo",value:e}],signer:this.signer})}async releaseName({name:e,arioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,arioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}async approvePrimaryNameRequest({name:e,address:r,arioProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Approve-Primary-Name"},{name:"Name",value:e},{name:"Recipient",value:r},{name:"IO-Process-Id",value:a},{name:"ARIO-Process-Id",value:a}],signer:this.signer})}async removePrimaryNames({names:e,arioProcessId:r,notifyOwners:a=!1},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Remove-Primary-Names"},{name:"Names",value:e.join(",")},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Notify-Owners",value:a.toString()}],signer:this.signer})}};ie();ae();ne();var Eb=class{static init(e){return e!==void 0&&"signer"in e?new uP(e):new Hw(e)}},Hw=class{process;constructor(e){if(e===void 0||Object.keys(e).length===0)this.process=new za({processId:$8});else if(vv(e))this.process=e.process;else if(mv(e))this.process=new za({processId:e.processId});else throw new Rl}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},uP=class extends Hw{signer;constructor({signer:e,...r}){super(r),this.signer=pv(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();lu();var Hfe="+",Kfe="/",Wfe="-",Vfe="_",Gfe="=";function eUe(t){let e=t.length%4;return e&&(t+=Gfe.repeat(4-e)),t.replaceAll(Wfe,Hfe).replaceAll(Vfe,Kfe)}function tUe(t){return t.replaceAll(Hfe,Wfe).replaceAll(Kfe,Vfe).replaceAll(Gfe,"")}function ayt(t){let e=eUe(t);return Me.from(e,"base64")}function rUe(t){let e=t.toString("base64");return tUe(e)}function oyt(t){return rUe(df("sha256").update(Uint8Array.from(t)).digest())}function Yfe(t=32){let e=oE(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}ie();ae();ne();ie();ae();ne();function hP(t){try{return JSON.parse(t)}catch{return t}}ie();ae();ne();ie();ae();ne();var lP=mi(Xfe(),1);ie();ae();ne();var aUe=Object.defineProperty,oUe=(t,e,r)=>e in t?aUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rb=(t,e,r)=>(oUe(t,typeof e!="symbol"?e+"":e,r),r),dP=class{constructor(e){Rb(this,"value"),Rb(this,"next"),this.value=e}},pP=class{constructor(){Rb(this,"head"),Rb(this,"tail"),Rb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new dP(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function Qfe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new pP,r=0,a=()=>{r--,e.size>0&&e.pop()()},i=async(p,b,g)=>{r++;let y=(async()=>p(...g))();b(y);try{await y}catch{}a()},h=(p,b,g)=>{e.push(i.bind(null,p,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},c=(p,...b)=>new Promise(g=>{h(p,g,b)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),c}var Dyt=async({address:t,registry:e=Eb.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function eue(t,e){return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),a(h)})})}var tue=class extends lP.default{contract;timeoutMs;throttle;logger;strict;antAoClient;constructor({contract:e=Tb.init({processId:Lh}),timeoutMs:r=6e4,concurrency:a=30,logger:i=Wu.default,strict:h=!1,antAoClient:c=Sl()}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=Qfe(a),this.logger=i,this.strict=h,this.antAoClient=c}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:a=Eb.init()}){let i={},h=await a.accessControlList({address:e}),c=new Set([...h.Owned,...h.Controlled]);await eue(this.timeoutMs,sUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,y])=>{c.has(y.processId)&&(i[y.processId]==null&&(i[y.processId]={state:void 0,names:{}}),i[y.processId].names[g]=y)})});let p=Object.keys(i).length;this.emit("progress",0,p),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,p);return}let y=zw.init({process:new za({processId:b,ao:this.antAoClient}),strict:this.strict}),M=await eue(this.timeoutMs,y.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,p)}))),this.emit("end",i)}},sUe=async({contract:t=Tb.init({processId:Lh}),emitter:e,logger:r=Wu.default,pageSize:a=5e4})=>{let i,h=Date.now(),c={};do{let p=await t.getArNSRecords({cursor:i,limit:a}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!p)return{};p.items.forEach(b=>{let{name:g,...y}=b;c[g]=y}),r.debug("Fetched page of ArNS records",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,cursor:p.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,records:p.items,cursor:p.nextCursor}),i=p.nextCursor}while(i!==void 0);return e?.emit("arns:end",c),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(c).length,durationMs:Date.now()-h}),c};var za=class{logger;ao;processId;constructor({processId:e,ao:r=Sl(),logger:a=Wu.default}){this.processId=e,this.logger=a,this.ao=r}isMessageDataEmpty(e){return e===void 0||e==="null"||e===""||e===null}async read({tags:e,retries:r=3,fromAddress:a}){let i=0,h;for(;i<r;)try{this.logger.debug("Evaluating read interaction on process",{tags:e,processId:this.processId});let c={process:this.processId,tags:e};a!==void 0&&(c.Owner=a);let p=await this.ao.dryrun(c);this.logger.debug("Read interaction result",{result:p,processId:this.processId});let b=vP(p);if(b!==void 0)throw new Error(b);if(p.Messages===void 0||p.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,{result:p,tags:e,processId:this.processId}),new Error(`Process ${this.processId} does not support provided action.`);let g=p.Messages?.[0]?.Data;return this.isMessageDataEmpty(g)?void 0:hP(g)}catch(c){i++,this.logger.debug(`Read attempt ${i} failed`,{error:c?.message,stack:c?.stack,tags:e,processId:this.processId}),h=c,await new Promise(p=>setTimeout(p,2**i*1e3))}throw h}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let p=Yfe(32),b=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:jw}],data:r,signer:a,anchor:p});this.logger.debug("Sent message to process",{messageId:b,processId:this.processId,anchor:p});let g=await this.ao.result({message:b,process:this.processId});this.logger.debug("Message result",{output:g,messageId:b,processId:this.processId});let y=vP(g);if(y!==void 0)throw new C4(y);if(g.Messages?.length===0||g.Messages===void 0)return{id:b};if(g.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(this.isMessageDataEmpty(g.Messages[0].Data))return{id:b};let M=hP(g.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:b,processId:this.processId}),{id:b,result:M}}catch(p){if(this.logger.error("Error sending message to process",{error:p?.message,stack:p?.stack,processId:this.processId,tags:e}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:p?.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=p;else throw p}throw c}};var Tb=class{static init(e){return e!==void 0&&"signer"in e?new mP(e):new Ww(e)}},Ww=class{process;epochSettings;arweave;constructor(e){if(this.arweave=e?.arweave??N4,e===void 0||Object.keys(e).length===0)this.process=new za({processId:Lh});else if(vv(e))this.process=e.process;else if(mv(e))this.process=new za({processId:e.processId});else throw new Rl}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async computeEpochIndexForTimestamp(e){let r=await this.getEpochSettings(),a=r.epochZeroStartTimestamp,i=r.durationMs;return Math.floor((e-a)/i)}async computeCurrentEpochIndex(){let e=await this.getEpochSettings(),r=e.epochZeroStartTimestamp,a=e.durationMs,i=Date.now();return Math.floor((i-r)/a)}async computeEpochIndex(e){let r=e?.epochIndex;if(r!==void 0)return r;let a=e?.timestamp;if(a!==void 0)return this.computeEpochIndexForTimestamp(a)}async getEpochSettings(){return this.epochSettings??=await this.process.read({tags:[{name:"Action",value:"Epoch-Settings"}]})}async getEpoch(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId});let i=[{name:"Action",value:"Epoch"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Records"},...Ha(e)]})}async getArNSReservedNames(e){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"},...Ha(e)]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Balances"},...Ha(e)]})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Vaults"},...Ha(e)]})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},...Ha(r)]})}async getGatewayDelegateAllowList({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},...Ha(r)]})}async getGateways(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateways"},...Ha(e)]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"}]})}async getPrescribedObservers(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedObservers;let i=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getPrescribedNames(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedNames;let i=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getObservations(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.observations;let i=[{name:"Action",value:"Epoch-Observations"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getDistributions(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.distributions;let i=[{name:"Action",value:"Epoch-Distributions"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:c}){let p=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r}];return this.process.read({tags:Sn(p),fromAddress:c})}async getCostDetails({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:c,fundFrom:p}){let b=[{name:"Action",value:"Cost-Details"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Fund-From",value:p}];return this.process.read({tags:Sn(b),fromAddress:c})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getDemandFactorSettings(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor-Settings"}]})}async getArNSReturnedNames(e){return this.process.read({tags:[{name:"Action",value:"Returned-Names"},...Ha(e)]})}async getArNSReturnedName({name:e}){let r=[{name:"Action",value:"Returned-Name"},{name:"Name",value:e}];return this.process.read({tags:r})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Address",value:e.address},...Ha(e)];return this.process.read({tags:Sn(r)})}async getAllowedDelegates(e){return this.getGatewayDelegateAllowList(e)}async getGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateway-Vaults"},{name:"Address",value:e.address},...Ha(e)]})}async getPrimaryNameRequest(e){let r=[{name:"Action",value:"Primary-Name-Request"},{name:"Initiator",value:e.initiator}];return this.process.read({tags:r})}async getPrimaryNameRequests(e){return this.process.read({tags:[{name:"Action",value:"Primary-Name-Requests"},...Ha(e)]})}async getPrimaryName(e){let r=[{name:"Action",value:"Primary-Name"},{name:"Address",value:e?.address},{name:"Name",value:e?.name}];return this.process.read({tags:Sn(r)})}async getPrimaryNames(e){return this.process.read({tags:[{name:"Action",value:"Primary-Names"},...Ha(e)]})}async getRedelegationFee(e){return this.process.read({tags:[{name:"Action",value:"Redelegation-Fee"},{name:"Address",value:e.address}]})}async getGatewayRegistrySettings(){return this.process.read({tags:[{name:"Action",value:"Gateway-Registry-Settings"}]})}async getAllDelegates(e){return this.process.read({tags:[{name:"Action",value:"All-Paginated-Delegates"},...Ha(e)]})}async getAllGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"All-Gateway-Vaults"},...Ha(e)]})}},mP=class extends Ww{signer;constructor({signer:e,...r}){r===void 0?super({process:new za({processId:Lh})}):super(r),this.signer=pv(e)}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async vaultedTransfer({recipient:e,quantity:r,lockLengthMs:a,revokable:i=!1},h){let{tags:c=[]}=h||{};return this.process.send({tags:[...c,{name:"Action",value:"Vaulted-Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.toString()},{name:"Lock-Length",value:a.toString()},{name:"Revokable",value:`${i}`}],signer:this.signer})}async revokeVault({vaultId:e,recipient:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Revoke-Vault"},{name:"Vault-Id",value:e},{name:"Recipient",value:r}],signer:this.signer})}async createVault({lockLengthMs:e,quantity:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Create-Vault"},{name:"Lock-Length",value:e.toString()},{name:"Quantity",value:r.toString()}],signer:this.signer})}async extendVault({vaultId:e,extendLengthMs:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Extend-Vault"},{name:"Vault-Id",value:e},{name:"Extend-Length",value:r.toString()}],signer:this.signer})}async increaseVault({vaultId:e,quantity:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Increase-Vault"},{name:"Vault-Id",value:e},{name:"Quantity",value:r.toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:a,delegateRewardShareRatio:i,fqdn:h,label:c,minDelegatedStake:p,note:b,port:g,properties:y,protocol:M,autoStake:x,observerAddress:E},A){let{tags:I=[]}=A||{},P=[...I,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:a?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:c},{name:"Min-Delegated-Stake",value:p?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:y},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:Sn(P)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:c,note:p,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},I=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:p},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:Sn(I)})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:Sn(i)})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Buy-Name"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async upgradeRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async extendLease(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:Sn(i)})}async requestPrimaryName(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Request-Primary-Name"},{name:"Name",value:e.name}];return this.process.send({signer:this.signer,tags:Sn(i)})}async redelegateStake(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Redelegate-Stake"},{name:"Target",value:e.target},{name:"Source",value:e.source},{name:"Quantity",value:e.stakeQty.valueOf().toString()},{name:"Vault-Id",value:e.vaultId}];return this.process.send({signer:this.signer,tags:Sn(i)})}};async function v3t({signer:t,module:e=oQ,ao:r=Sl(),scheduler:a=uQ,state:i,antRegistryId:h=$8,logger:c=Wu.default,authority:p=fQ}){let b=await r.spawn({module:e,scheduler:a,signer:t,data:i?JSON.stringify(i):void 0,tags:[{name:"Authority",value:p},{name:"ANT-Registry-Id",value:h}]});return c.debug("Spawned ANT",{processId:b,module:e,scheduler:a}),b}async function m3t({signer:t,processId:e,luaCodeTxId:r=sQ,ao:a=Sl(),logger:i=Wu.default,arweave:h=N4}){let c=new za({processId:e,ao:a,logger:i}),{api:{host:p,port:b,protocol:g}}=h.getConfig(),y=await fetch(`${g}://${p}:${b}/${r}`).then(x=>x.text()),{id:M}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:y,signer:t});return i.debug("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:M}),M}function fUe(t){let e=Qt.object({name:Qt.string(),value:Qt.union([Qt.string(),Qt.number()])}),r=Qt.function().args(Qt.object({data:Qt.union([Qt.string(),Qt.instanceof(Me)]),tags:Qt.array(e).optional(),target:Qt.string().optional(),anchor:Qt.string().optional()})).returns(Qt.promise(Qt.object({id:Qt.string(),raw:Qt.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function pv(t){return fUe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{if(t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey(),t instanceof ul){let b=await t.signer.signDataItem({data:r,tags:a,target:i,anchor:h}),g=new v1(Me.from(b));return{id:await g.id,raw:await g.getRaw()}}let c=Rg(r,t,{tags:a,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:xte(t)}var uUe="-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";function g3t({owner:t,targetId:e,ttlSeconds:r=3600,keywords:a=[],controllers:i=[],description:h="",ticker:c="aos",name:p="ANT"}){return{ticker:c,name:p,description:h,keywords:a,owner:t,controllers:[t,...i],balances:{[t]:1},records:{"@":{transactionId:e??uUe.toString(),ttlSeconds:r}}}}function iue(t){return Qt.object({startTimestamp:Qt.number(),startHeight:Qt.number(),distributions:Qt.any(),endTimestamp:Qt.number(),prescribedObservers:Qt.any(),prescribedNames:Qt.array(Qt.string()),observations:Qt.any(),epochIndex:Qt.number()}).parse(t)}function vP(t){let r=t.Error??t.Messages?.[0]?.Tags?.find(a=>a.name==="Error")?.value;if(r!==void 0){let a=r.match(/\[string "aos"]:(\d+):\s*(.+)/);if(a){let[,i,h]=a;return`${rue(h).trim()} (line ${i.trim()})`.trim()}return rue(r)}}function rue(t){let e="\x1B";return t.replace(new RegExp(`${e}[\\[\\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`,"g"),"").trim()}var nue=t=>D8.test(t);function S3t(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var Sn=t=>t.filter(e=>e.value!==void 0&&e.value!==""),Ha=t=>{let e=[{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy?.toString()},{name:"Sort-Order",value:t?.sortOrder?.toString()}];return Sn(e)},gv=async({arweave:t,epochIndex:e,processId:r=Lh,retries:a=3,gqlUrl:i="https://arweave-search.goldsky.com/graphql"})=>{let h=hUe({epochIndex:e,processId:r});for(let c=0;c<a;c++)try{let p=await fetch(i,{method:"POST",body:h,headers:{"Content-Type":"application/json"}}).then(y=>y.json());if(p?.data?.transactions?.edges?.length===0)return;let b=p.data.transactions.edges[0].node.id,g=await t.api.get(b);return iue(g.data)}catch(p){if(c===a-1)throw p;await new Promise(b=>setTimeout(b,Math.pow(2,c)*1e3))}},hUe=({epochIndex:t,processId:e=Lh,authorities:r=["fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY"]})=>JSON.stringify({query:`
|
|
189
|
+
}`,i=wt.object({data:wt.object({transactions:wt.object({edges:wt.array(wt.object({node:wt.record(wt.any())}))})})});return h=>jr(h).chain(Li(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[c]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${p.status}: ${await p.text()}`)}).then(i.parse).then(nxe(["data","transactions","edges","0","node"])))).toPromise()}var vSe=nI(x5e(),1),fte=(t="@permaweb/aoconnect")=>{let e=(0,vSe.default)(t);return e.child=r=>fte(`${e.namespace}:${r}`),e.tap=(r,...a)=>cxe((...i)=>e(r,...a,...i)),e},ute=({url:t,path:e})=>e?e.startsWith("/")?ute({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function mSe(t){return F1(x4([]),U1((e,r)=>F1(sxe([],r.name),wI(r.value),$s(r.name,Fh,e))(e),{}),_4(e=>e.length>1?e:e[0]))(t)}function Cs(t,e){return r=>Pee(mMe([NQ(t,"name"),MI(yI(e),NQ(e,"value"),mI)]),r)}function DQ(t){return jee([[Wg(String),k1(t)],[Wg(Array),GMe(t)],[mI,A9e]])}function Ad(t){let e;return Wg(Ls,t)?(e=new Error(gSe(t)),e.stack+=t.stack):Wg(Error,t)?e=t:KMe("message",t)?e=new Error(t.message):Wg(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function gSe(t){return F1(e=>function r(a,i,h){return U1((c,p)=>F1(jee([[k1(Rt.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[k1(Rt.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[k1(Rt.invalid_union),()=>PMe(b=>r(b,400,"Invalid Union"),p.unionErrors)],[mI,()=>[{...p,status:i,contextCode:h}]]]),_I(c))(p.code),[],a.issues)}(e,400,""),e=>U1((r,a)=>{let{message:i,path:h,contextCode:c}=a,p=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${p}': ${i}.`),r},[],e),txe(" | "))(t)}var bSe=wt.object({id:wt.string().min(1,{message:"message is required to be a message id"}),processId:wt.string().min(1,{message:"process is required to be a process id"})});function ySe(){return t=>jr(t).map(bSe.parse).map(()=>t)}var k2=wt.object({name:wt.string(),value:wt.string()}),wSe=wt.function().args(wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))})).returns(wt.promise(wt.any())),_Se=wt.function().args(wt.object({id:wt.string().min(1,{message:"message id is required"}),processId:wt.string().min(1,{message:"process id is required"})})).returns(wt.promise(wt.any())),MSe=wt.function().args(wt.object({process:wt.string().min(1,{message:"process id is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()})).returns(wt.promise(wt.object({edges:wt.array(wt.object({cursor:wt.string(),node:wt.object({Output:wt.any().optional(),Messages:wt.array(wt.any()).optional(),Spawns:wt.array(wt.any()).optional(),Error:wt.any().optional()})}))}))),hte=wt.function().args(wt.object({processId:wt.string(),data:wt.any(),tags:wt.array(k2),anchor:wt.string().optional(),signer:wt.any()})).returns(wt.promise(wt.object({messageId:wt.string()}).passthrough())),xSe=wt.function().args(wt.object({data:wt.any(),tags:wt.array(k2),signer:wt.any()})).returns(wt.promise(wt.object({processId:wt.string()}).passthrough())),SSe=wt.function().args(wt.object({process:wt.string(),message:wt.string(),baseLayer:wt.boolean().optional(),exclude:wt.array(wt.string()).optional()})).returns(wt.promise(wt.object({assignmentId:wt.string()}).passthrough())),cte=hte,dut=wt.function().args(wt.object({suUrl:wt.string().url(),processId:wt.string()})).returns(wt.promise(wt.object({tags:wt.array(k2)}).passthrough())),put=wt.function().args(wt.string()).returns(wt.promise(wt.object({url:wt.string()}))),ESe=wt.function().args(wt.string()).returns(wt.promise(wt.boolean())),ASe=wt.function().args(wt.string()).returns(wt.promise(wt.object({tags:wt.array(k2)}).passthrough())),S4=wt.function().args(wt.object({data:wt.any(),tags:wt.array(k2),target:wt.string().optional(),anchor:wt.string().optional()})).returns(wt.promise(wt.object({id:wt.string(),raw:wt.any()})));function RSe({loadResult:t}){return t=Li(_Se.implement(t)),e=>jr({id:e.id,processId:e.processId}).chain(t)}function TSe(t){let e=ySe(t),r=RSe(t);return({message:a,process:i})=>jr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(Ad,Ed).toPromise()}var ISe=wt.array(wt.object({name:wt.string(),value:wt.string()}));function kSe(){return t=>jr(t.tags).map(x4([])).map(Cs("Data-Protocol","ao")).map(Cs("Variant")).map(Cs("Type")).map(Cs("SDK")).map(_I(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(ISe.parse).map($s("tags",Fh,t))}function BSe({logger:t}){return e=>jr(e).chain(MI(yI(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map($s("data",Fh,e)).map(r=>F1(Sd("tags"),Cs("Content-Type"),wI({name:"Content-Type",value:"text/plain"}),$s("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function PSe(t){let e=kSe(t),r=BSe(t),a=hte.implement(t.deployMessage);return i=>jr(i).chain(e).chain(r).chain(Li(({id:h,data:c,tags:p,anchor:b,signer:g})=>a({processId:h,data:c,tags:p,anchor:b,signer:S4.implement(g)}))).map(h=>$s("messageId",h.messageId,i))}function OSe(t){let e=PSe(t);return({process:r,data:a,tags:i,anchor:h,signer:c})=>jr({id:r,data:a,tags:i,anchor:h,signer:c}).chain(e).map(p=>p.messageId).bimap(Ad,Ed).toPromise()}var Dg=(t,e,r)=>a=>e(a[t])?_d(a):xl(`Tag '${t}': ${r}`);function NSe({loadTransactionMeta:t,logger:e}){return t=Li(ASe.implement(t)),r=>jr(r).chain(t).map(Sd("tags")).map(mSe).chain(Dg("Data-Protocol",DQ("ao"),"value 'ao' was not found on module")).chain(Dg("Type",DQ("Module"),"value 'Module' was not found on module")).chain(Dg("Module-Format",IT,"was not found on module")).chain(Dg("Input-Encoding",IT,"was not found on module")).chain(Dg("Output-Encoding",IT,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function CSe({logger:t,validateScheduler:e}){return e=Li(ESe.implement(e)),r=>jr(r).chain(a=>e(a).chain(i=>i?_d(a):xl(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function LSe({logger:t}){return e=>jr(e).map(t.tap("Checking for signer")).chain(r=>r?_d(r):xl("signer not found"))}function DSe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=NSe(t),a=CSe(t),i=LSe(t);return h=>jr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>a(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var $Se=wt.array(wt.object({name:wt.string(),value:wt.string()}));function qSe(){return t=>jr(t).map(Sd("tags")).map(x4([])).map(Cs("Data-Protocol","ao")).map(Cs("Variant")).map(Cs("Type")).map(Cs("Module")).map(Cs("Scheduler")).map(Cs("SDK")).map(_I(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map($Se.parse).map($s("tags",Fh,t))}function USe({logger:t}){return e=>jr(e).chain(MI(yI(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map($s("data",Fh,e)).map(r=>F1(Sd("tags"),Cs("Content-Type"),wI({name:"Content-Type",value:"text/plain"}),$s("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function FSe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=qSe(t),a=USe(t),i=xSe.implement(t.deployProcess);return h=>jr(h).chain(r).chain(a).chain(Li(({data:c,tags:p,signer:b})=>i({data:c,tags:p,signer:S4.implement(b)}))).map(c=>$s("processId",c.processId,h))}function jSe(t){let e=DSe(t),r=FSe(t);return({module:a,scheduler:i,signer:h,tags:c,data:p})=>jr({module:a,scheduler:i,signer:h,tags:c,data:p}).chain(e).chain(r).map(b=>b.processId).bimap(Ad,Ed).toPromise()}function zSe(t){let e=cte.implement(t.deployMonitor);return r=>jr(r).chain(Li(({id:a,signer:i})=>e({processId:a,signer:S4.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>$s("monitorId",a.messageId,r))}function ZSe(t){let e=zSe(t);return({process:r,signer:a})=>jr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}function HSe(t){let e=cte.implement(t.deployUnmonitor);return r=>jr(r).chain(Li(({id:a,signer:i})=>e({processId:a,signer:S4.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>$s("monitorId",a.messageId,r))}function KSe(t){let e=HSe(t);return({process:r,signer:a})=>jr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}var WSe=wt.object({process:wt.string().min(1,{message:"process identifier is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()});function VSe(){return t=>jr(t).map(WSe.parse).map(()=>t)}function GSe({queryResults:t}){return t=Li(MSe.implement(t)),e=>jr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function YSe(t){let e=VSe(t),r=GSe(t);return({process:a,from:i,to:h,sort:c,limit:p})=>jr({process:a,from:i,to:h,sort:c,limit:p}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(Ad,Ed).toPromise()}var JSe=wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))});function XSe(){return t=>jr(t).map(JSe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function QSe({dryrunFetch:t}){return Li(wSe.implement(t))}function eEe(t){let e=XSe(t),r=QSe(t);return a=>jr(a).map(tEe).chain(e).chain(r).toPromise()}function tEe({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function rEe(t){let e=SSe.implement(t.deployAssign);return r=>jr(r).chain(Li(({process:a,message:i,baseLayer:h,exclude:c})=>e({process:a,message:i,baseLayer:h,exclude:c}))).map(a=>$s("assignmentId",a.assignmentId,r))}function iEe(t){let e=rEe(t);return({process:r,message:a,baseLayer:i,exclude:h})=>jr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(Ad,Ed).toPromise()}var nEe="https://arweave.net",aEe="https://mu.ao-testnet.xyz",oEe="https://cu.ao-testnet.xyz";function Sl({GRAPHQL_URL:t,GATEWAY_URL:e=nEe,MU_URL:r=aEe,CU_URL:a=oEe}={}){let i=fte();t||(t=ute({url:e,path:"/graphql"}));let{validate:h}=Tee({cacheSize:100,GRAPHQL_URL:t}),c=S9e({MAX_SIZE:25}),p=i.child("result"),b=TSe({loadResult:_9e({fetch,CU_URL:a,logger:p}),logger:p}),g=i.child("message"),y=OSe({loadProcessMeta:AT({fetch,cache:c,logger:g}),deployMessage:v9e({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=jSe({loadTransactionMeta:pSe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:m9e({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=ZSe({loadProcessMeta:AT({fetch,cache:c,logger:E}),deployMonitor:g9e({fetch,MU_URL:r,logger:E}),logger:E}),I=i.child("unmonitor"),P=KSe({loadProcessMeta:AT({fetch,cache:c,logger:I}),deployUnmonitor:b9e({fetch,MU_URL:r,logger:I}),logger:E}),N=i.child("results"),L=YSe({queryResults:M9e({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=eEe({dryrunFetch:w9e({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ee=iEe({deployAssign:y9e({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:P,dryrun:Y,assign:ee}}var lte={};UQ(lte,{createDataItemSigner:()=>BEe});var dte=nI(A5e(),1),pte={};UQ(pte,{AVSCTap:()=>B2,ArweaveSigner:()=>RI,DataItem:()=>A2,MAX_TAG_BYTES:()=>E4,MIN_BINARY_SIZE:()=>kI,SIG_CONFIG:()=>K1,SignatureConfig:()=>Ns,Signer:()=>bte,createData:()=>Mte,default:()=>TEe,deserializeTags:()=>v4,indexToType:()=>TI,serializeTags:()=>II,tagsExceedLimit:()=>_te,warparbundles:()=>IEe});var sEe=Object.create,EI=Object.defineProperty,fEe=Object.getOwnPropertyDescriptor,uEe=Object.getOwnPropertyNames,hEe=Object.getPrototypeOf,cEe=Object.prototype.hasOwnProperty,zh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lEe=(t,e)=>{for(var r in e)EI(t,r,{get:e[r],enumerable:!0})},dEe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uEe(e))!cEe.call(t,i)&&i!==r&&EI(t,i,{get:()=>e[i],enumerable:!(a=fEe(e,i))||a.enumerable});return t},Rd=(t,e,r)=>(r=t!=null?sEe(hEe(t)):{},dEe(e||!t||!t.__esModule?EI(r,"default",{value:t,enumerable:!0}):r,t)),pEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var c=i,p=a-h,b=i+p,g=Me.alloc(b);for(g.write(r);p--;)g.write("=",c++);return g.toString()}t.default=e}),vEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=pEe();function r(b,g){return g===void 0&&(g="utf8"),Me.isBuffer(b)?h(b.toString("base64")):h(Me.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),Me.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return Me.from(i(b),"base64")}var p=r;p.encode=r,p.decode=a,p.toBase64=i,p.fromBase64=h,p.toBuffer=c,t.default=p}),AI=zh((t,e)=>{e.exports=vEe().default,e.exports.default=e.exports}),vte=zh(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=p(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function y(A){var I,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)I=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}),mte=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=vte();function r(x){let E=0;for(let P=0;P<x.length;P++)E+=x[P].byteLength;let A=new Uint8Array(E),I=0;A.set(new Uint8Array(x[0]),I),I+=x[0].byteLength;for(let P=1;P<x.length;P++)A.set(new Uint8Array(x[P]),I),I+=x[P].byteLength;return A}t.concatBuffers=r;function a(x){let E=p(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function p(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=p;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),mEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=mte(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(c)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let c={kty:"RSA",e:"AQAB",n:a},p=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-b.byteLength-2},p,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},p,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},p,a.slice(16));return e.concatBuffers([g])}};t.default=r}),gEe=zh(t=>{t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=I,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=I,p/=256,y-=8);e[a+A-I]|=P*128}}),tI=zh(t=>{"use strict";var e=vte(),r=gEe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,p.prototype),k}function p(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}p.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}p.alloc=function(T,k,O){return y(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!p.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==p.prototype},p.compare=function(T,k){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),ut(k,Uint8Array)&&(k=p.from(k,k.offset,k.byteLength)),!p.isBuffer(T)||!p.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===k)return 0;let O=T.length,q=k.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==k[H]){O=T[H],q=k[H];break}return O<q?-1:q<O?1:0},p.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(T,k){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return p.alloc(0);let O;if(k===void 0)for(k=0,O=0;O<T.length;++O)k+=T[O].length;let q=p.allocUnsafe(k),H=0;for(O=0;O<T.length;++O){let W=T[O];if(ut(W,Uint8Array))H+W.length>q.length?(p.isBuffer(W)||(W=p.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(p.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function C(T,k){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return w(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}p.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<T;k+=2)G(this,k,k+1);return this},p.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<T;k+=4)G(this,k,k+3),G(this,k+1,k+2);return this},p.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<T;k+=8)G(this,k,k+7),G(this,k+1,k+6),G(this,k+2,k+5),G(this,k+3,k+4);return this},p.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(T){if(!p.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:p.compare(this,T)===0},p.prototype.inspect=function(){let T="",k=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(T+=" ... "),"<Buffer "+T+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(T,k,O,q,H){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),!p.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(k===void 0&&(k=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),k<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&k>=O)return 0;if(q>=H)return-1;if(k>=O)return 1;if(k>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,fe=O-k,st=Math.min(W,fe),ue=this.slice(q,H),me=T.slice(k,O);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ee(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=p.from(k,q)),p.isBuffer(k))return k.length===0?-1:D(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):D(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,k,O,q,H){let W=1,fe=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(k,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(k,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(T,k,O){return this.indexOf(T,k,O)!==-1},p.prototype.indexOf=function(T,k,O){return ee(this,T,k,O,!0)},p.prototype.lastIndexOf=function(T,k,O){return ee(this,T,k,O,!1)};function U(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(k.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,k,O,q){return Se(oe(k,T.length-O),T,O,q)}function _(T,k,O,q){return Se(le(k),T,O,q)}function n(T,k,O,q){return Se(ge(k),T,O,q)}function s(T,k,O,q){return Se(ot(k,T.length-O),T,O,q)}p.prototype.write=function(T,k,O,q){if(k===void 0)q="utf8",O=this.length,k=0;else if(O===void 0&&typeof k=="string")q=k,O=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-k;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return U(this,T,k,O);case"utf8":case"utf-8":return V(this,T,k,O);case"ascii":case"latin1":case"binary":return _(this,T,k,O);case"base64":return n(this,T,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,k,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function w(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function v(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(T,k){let O=this.length;T=~~T,k=k===void 0?O:~~k,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),k<0?(k+=O,k<0&&(k=0)):k>O&&(k=O),k<T&&(k=T);let q=this.subarray(T,k);return Object.setPrototypeOf(q,p.prototype),q};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return q},p.prototype.readUintBE=p.prototype.readUIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T+--k],H=1;for(;k>0&&(H*=256);)q+=this[T+--k]*H;return q},p.prototype.readUint8=p.prototype.readUInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]|this[T+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]<<8|this[T+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},p.prototype.readBigUInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),p.prototype.readIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*k)),q},p.prototype.readIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=k,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*k)),W},p.prototype.readInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},p.prototype.readInt16LE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},p.prototype.readInt16BE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},p.prototype.readInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},p.prototype.readInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},p.prototype.readBigInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),p.prototype.readBigInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=(k<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),p.prototype.readFloatLE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!0,23,4)},p.prototype.readFloatBE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!1,23,4)},p.prototype.readDoubleLE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!0,52,8)},p.prototype.readDoubleBE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,k,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,k,O,fe,0)}let H=1,W=0;for(this[k]=T&255;++W<O&&(H*=256);)this[k+W]=T/H&255;return k+O},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,k,O,fe,0)}let H=O-1,W=1;for(this[k+H]=T&255;--H>=0&&(W*=256);)this[k+H]=T/W&255;return k+O},p.prototype.writeUint8=p.prototype.writeUInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,255,0),this[k]=T&255,k+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T&255,this[k+1]=T>>>8,k+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T>>>8,this[k+1]=T&255,k+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k+3]=T>>>24,this[k+2]=T>>>16,this[k+1]=T>>>8,this[k]=T&255,k+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=ct(function(T,k=0){return B(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(T,k=0){return F(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=0,W=1,fe=0;for(this[k]=T&255;++H<O&&(W*=256);)T<0&&fe===0&&this[k+H-1]!==0&&(fe=1),this[k+H]=(T/W>>0)-fe&255;return k+O},p.prototype.writeIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=O-1,W=1,fe=0;for(this[k+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[k+H+1]!==0&&(fe=1),this[k+H]=(T/W>>0)-fe&255;return k+O},p.prototype.writeInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,127,-128),T<0&&(T=255+T+1),this[k]=T&255,k+1},p.prototype.writeInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T&255,this[k+1]=T>>>8,k+2},p.prototype.writeInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T>>>8,this[k+1]=T&255,k+2},p.prototype.writeInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),this[k]=T&255,this[k+1]=T>>>8,this[k+2]=T>>>16,this[k+3]=T>>>24,k+4},p.prototype.writeInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4},p.prototype.writeBigInt64LE=ct(function(T,k=0){return B(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(T,k=0){return F(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}p.prototype.writeFloatLE=function(T,k,O){return re(this,T,k,!0,O)},p.prototype.writeFloatBE=function(T,k,O){return re(this,T,k,!1,O)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||$(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(T,k,O){return Q(this,T,k,!0,O)},p.prototype.writeDoubleBE=function(T,k,O){return Q(this,T,k,!1,O)},p.prototype.copy=function(T,k,O,q){if(!p.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),k>=T.length&&(k=T.length),k||(k=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-k<q-O&&(q=T.length-k+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(k,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),k),H},p.prototype.fill=function(T,k,O,q){if(typeof T=="string"){if(typeof k=="string"?(q=k,k=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!p.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(k<0||this.length<k||this.length<O)throw new RangeError("Out of range index");if(O<=k)return this;k=k>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=k;H<O;++H)this[H]=T;else{let W=p.isBuffer(T)?T:p.from(T,q),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-k;++H)this[H+k]=W[H%fe]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function te(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let fe=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${k}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((k-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),bEe=zh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:tI().Buffer,Crypto:window.crypto}):e.exports={Buffer:tI().Buffer,Crypto:crypto}}),gte={};lEe(gte,{AVSCTap:()=>B2,ArweaveSigner:()=>RI,DataItem:()=>A2,MAX_TAG_BYTES:()=>E4,MIN_BINARY_SIZE:()=>kI,SIG_CONFIG:()=>K1,SignatureConfig:()=>Ns,Signer:()=>bte,createData:()=>Mte,deserializeTags:()=>v4,indexToType:()=>TI,serializeTags:()=>II,tagsExceedLimit:()=>_te});var bte=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},yEe=Rd(AI(),1),kf=Rd(mte(),1);async function yte(t){if(Array.isArray(t)){let i=(0,kf.concatBuffers)([(0,kf.stringToBuffer)("list"),(0,kf.stringToBuffer)(t.length.toString())]);return await wte(t,await qh().hash(i,"SHA-384"))}let e=t,r=(0,kf.concatBuffers)([(0,kf.stringToBuffer)("blob"),(0,kf.stringToBuffer)(e.byteLength.toString())]),a=(0,kf.concatBuffers)([await qh().hash(r,"SHA-384"),await qh().hash(e,"SHA-384")]);return await qh().hash(a,"SHA-384")}async function wte(t,e){if(t.length<1)return e;let r=(0,kf.concatBuffers)([e,await yte(t[0])]),a=await qh().hash(r,"SHA-384");return await wte(t.slice(1),a)}var BT=Rd(mEe(),1),wEe=BT.default.default?BT.default.default:BT.default,_Ee=class extends wEe{getPublicKey(t){throw new Error("Unimplemented")}},MEe;function qh(){return MEe??=new _Ee}var Ns;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Ns||(Ns={}));var K1={[Ns.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Ns.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Ns.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Ns.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Ns.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Ns.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Ns.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},RI=class{signatureType=1;ownerLength=K1[1].pubLength;signatureLength=K1[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return yEe.default.toBuffer(this.pk)}sign(t){return qh().sign(this.jwk,t)}static async verify(t,e,r){return await qh().verify(t,e,r)}},TI={1:RI},Ou=Rd(AI(),1);async function rI(t){return yte([(0,kf.stringToBuffer)("dataitem"),(0,kf.stringToBuffer)("1"),(0,kf.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function xEe(t,e){let r=await rI(t),a=await e.sign(r),i=await qh().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function SEe(t,e){let{signature:r,id:a}=await xEe(t,e);return t.getRaw().set(r,2),a}var B2=class{buf;pos;constructor(t=Me.alloc(E4),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Me.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,p;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[a++]=c:c<2048?(r[a++]=c>>6|192,r[a++]=c&63|128):(c&64512)===55296&&((p=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(p&1023),i++,r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=c&63|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,c;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do a=r[this.pos++],h+=(a&127)*c,c*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function II(t){let e=new B2;return e.writeTags(t),e.toBuffer()}function _te(t){let e=new B2;return e.writeTags(t),e.tagsExceedLimit()}function v4(t){return new B2(t).readTags()}function pl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function EEe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function $Q(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var AEe=Rd(bEe(),1),A1=Rd(tI(),1),E4=4096,kI=80,A2=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=pl(this.binary.subarray(0,2));if(Ns?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return A2.verify(this.binary)}get id(){return(async()=>Ou.default.encode(await this.rawId))()}set id(t){this._id=Ou.default.toBuffer(t)}get rawId(){return(async()=>A1.Buffer.from(await AEe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Ou.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return K1[this.signatureType].sigLength}get owner(){return Ou.default.encode(this.rawOwner)}get ownerLength(){return K1[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):A1.Buffer.alloc(0)}get target(){return Ou.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):A1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=pl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(pl(this.binary.subarray(t,t+8))==0)return[];let e=pl(this.binary.subarray(t+8,t+16));return v4(A1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Ou.default.encode(t.name),value:Ou.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return Ou.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await SEe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=A1.Buffer.from(await qh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Ou.default.encode(t.name),value:Ou.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<kI)return!1;let e=new A2(t),r=e.signatureType,a=e.getTagsStart(),i=pl(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),c=pl(h);if(c>E4)return!1;if(i>0)try{if(v4(A1.Buffer.from(t.subarray(a+16,a+16+c))).length!==i)return!1}catch{return!1}let p=TI[r],b=await rI(e);return await p.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return rI(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},REe=Rd(AI(),1);function Mte(t,e,r){let a=e.publicKey,i=r?.target?REe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?II(r.tags):null,g=16+(b?b.byteLength:0),y=Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(EEe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set($Q(r?.tags?.length??0),P);let N=$Q(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new A2(E)}var BI={...gte};globalThis.arbundles??=BI;var TEe=BI,IEe=BI;globalThis.Buffer||(globalThis.Buffer=dte.Buffer);var{DataItem:kEe}=pte;function BEe(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:c=p=>new kEe(p)})=>{let p=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=c(dte.Buffer.from(p));return{id:await b.id,raw:await b.getRaw()}}}var PEe=globalThis.GATEWAY_URL||void 0,OEe=globalThis.MU_URL||void 0,NEe=globalThis.CU_URL||void 0,CEe=globalThis.GRAPHQL_URL||void 0,{result:vut,results:mut,message:gut,spawn:but,monitor:yut,unmonitor:wut,dryrun:_ut,assign:Mut}=Sl({GATEWAY_URL:PEe,MU_URL:OEe,CU_URL:NEe,GRAPHQL_URL:CEe}),xte=lte.createDataItemSigner;ie();ae();ne();var mre=mi(vre(),1),N4=mre.default.init({host:"arweave.net",port:443,protocol:"https"});ie();ae();ne();ie();ae();ne();var Df=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},gre=class extends Df{},bre=class extends Df{},yre=class extends Df{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},wre=class extends Df{},C4=class extends Df{},_re=class extends Df{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Rl=class extends Df{constructor(){super("Invalid contract configuration")}},Mre=class extends Df{constructor(){super("Invalid process configuration")}},xre=class extends Df{};ie();ae();ne();var Kf=mi(zfe(),1);ie();ae();ne();var jw="3.6.0-alpha.2";var Wu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Kf.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:jw},format:Kf.format.combine(Kf.format.timestamp(),Kf.format.json()),transports:[new Kf.transports.Console({format:Kf.format.combine(Kf.format.timestamp(),Kf.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();var Zfe=t=>{let e=Object.entries(t).sort(([r,a],[i,h])=>r==="@"?-1:i==="@"?1:"priority"in a&&!("priority"in h)?-1:!("priority"in a)&&"priority"in h?1:a.priority!==void 0&&h.priority!==void 0?a.priority===h.priority?r<i?-1:r>i?1:0:a.priority-h.priority:r<i?-1:r>i?1:0);return Object.fromEntries(e.map(([r,a],i)=>[r,{...a,index:i}]))};ie();ae();ne();function Pl(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var zw=class{static init(e){return e!==void 0&&"signer"in e?new fP(e):new Zw(e)}},Zw=class{process;processId;strict;constructor(e){if(this.strict=e.strict||!1,vv(e))this.process=e.process;else if(mv(e))this.process=new za({processId:e.processId});else throw new Rl;this.processId=this.process.processId}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&Pl(MT.passthrough().and(Qt.object({Records:Qt.record(Qt.string(),q8.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&Pl(dQ.passthrough(),a),a}async getLogo(){return(await this.getInfo()).Logo}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&Pl(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&Pl(yT,a),Zfe(a)}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&Pl(wT,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&Pl(_T,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&Pl(Qt.number(),i),i}async getHandlers(){let e=await this.getInfo();return e.Handlers??e.HandlerNames}},fP=class extends Zw{signer;constructor({signer:e,...r}){super(r),this.signer=pv(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async setBaseNameRecord({transactionId:e,ttlSeconds:r},a){return this.setRecord({transactionId:e,ttlSeconds:r,undername:"@"},a)}async setUndernameRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.setRecord({undername:e,transactionId:r,ttlSeconds:a},i)}async removeUndernameRecord({undername:e}){return this.removeRecord({undername:e})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Keywords",value:JSON.stringify(e)}],signer:this.signer})}async setLogo({txId:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Logo"},{name:"Logo",value:e}],signer:this.signer})}async releaseName({name:e,arioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,arioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}async approvePrimaryNameRequest({name:e,address:r,arioProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Approve-Primary-Name"},{name:"Name",value:e},{name:"Recipient",value:r},{name:"IO-Process-Id",value:a},{name:"ARIO-Process-Id",value:a}],signer:this.signer})}async removePrimaryNames({names:e,arioProcessId:r,notifyOwners:a=!1},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Remove-Primary-Names"},{name:"Names",value:e.join(",")},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Notify-Owners",value:a.toString()}],signer:this.signer})}};ie();ae();ne();var Eb=class{static init(e){return e!==void 0&&"signer"in e?new uP(e):new Hw(e)}},Hw=class{process;constructor(e){if(e===void 0||Object.keys(e).length===0)this.process=new za({processId:$8});else if(vv(e))this.process=e.process;else if(mv(e))this.process=new za({processId:e.processId});else throw new Rl}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},uP=class extends Hw{signer;constructor({signer:e,...r}){super(r),this.signer=pv(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();lu();var Hfe="+",Kfe="/",Wfe="-",Vfe="_",Gfe="=";function eUe(t){let e=t.length%4;return e&&(t+=Gfe.repeat(4-e)),t.replaceAll(Wfe,Hfe).replaceAll(Vfe,Kfe)}function tUe(t){return t.replaceAll(Hfe,Wfe).replaceAll(Kfe,Vfe).replaceAll(Gfe,"")}function oyt(t){let e=eUe(t);return Me.from(e,"base64")}function rUe(t){let e=t.toString("base64");return tUe(e)}function syt(t){return rUe(df("sha256").update(Uint8Array.from(t)).digest())}function Yfe(t=32){let e=oE(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}ie();ae();ne();ie();ae();ne();function hP(t){try{return JSON.parse(t)}catch{return t}}ie();ae();ne();ie();ae();ne();var lP=mi(Xfe(),1);ie();ae();ne();var aUe=Object.defineProperty,oUe=(t,e,r)=>e in t?aUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rb=(t,e,r)=>(oUe(t,typeof e!="symbol"?e+"":e,r),r),dP=class{constructor(e){Rb(this,"value"),Rb(this,"next"),this.value=e}},pP=class{constructor(){Rb(this,"head"),Rb(this,"tail"),Rb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new dP(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function Qfe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new pP,r=0,a=()=>{r--,e.size>0&&e.pop()()},i=async(p,b,g)=>{r++;let y=(async()=>p(...g))();b(y);try{await y}catch{}a()},h=(p,b,g)=>{e.push(i.bind(null,p,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},c=(p,...b)=>new Promise(g=>{h(p,g,b)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),c}var $yt=async({address:t,registry:e=Eb.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function eue(t,e){return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),a(h)})})}var tue=class extends lP.default{contract;timeoutMs;throttle;logger;strict;antAoClient;constructor({contract:e=Tb.init({processId:Lh}),timeoutMs:r=6e4,concurrency:a=30,logger:i=Wu.default,strict:h=!1,antAoClient:c=Sl()}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=Qfe(a),this.logger=i,this.strict=h,this.antAoClient=c}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:a=Eb.init()}){let i={},h=await a.accessControlList({address:e}),c=new Set([...h.Owned,...h.Controlled]);await eue(this.timeoutMs,sUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,y])=>{c.has(y.processId)&&(i[y.processId]==null&&(i[y.processId]={state:void 0,names:{}}),i[y.processId].names[g]=y)})});let p=Object.keys(i).length;this.emit("progress",0,p),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,p);return}let y=zw.init({process:new za({processId:b,ao:this.antAoClient}),strict:this.strict}),M=await eue(this.timeoutMs,y.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,p)}))),this.emit("end",i)}},sUe=async({contract:t=Tb.init({processId:Lh}),emitter:e,logger:r=Wu.default,pageSize:a=5e4})=>{let i,h=Date.now(),c={};do{let p=await t.getArNSRecords({cursor:i,limit:a}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!p)return{};p.items.forEach(b=>{let{name:g,...y}=b;c[g]=y}),r.debug("Fetched page of ArNS records",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,cursor:p.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,records:p.items,cursor:p.nextCursor}),i=p.nextCursor}while(i!==void 0);return e?.emit("arns:end",c),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(c).length,durationMs:Date.now()-h}),c};var za=class{logger;ao;processId;constructor({processId:e,ao:r=Sl(),logger:a=Wu.default}){this.processId=e,this.logger=a,this.ao=r}isMessageDataEmpty(e){return e===void 0||e==="null"||e===""||e===null}async read({tags:e,retries:r=3,fromAddress:a}){let i=0,h;for(;i<r;)try{this.logger.debug("Evaluating read interaction on process",{tags:e,processId:this.processId});let c={process:this.processId,tags:e};a!==void 0&&(c.Owner=a);let p=await this.ao.dryrun(c);this.logger.debug("Read interaction result",{result:p,processId:this.processId});let b=vP(p);if(b!==void 0)throw new Error(b);if(p.Messages===void 0||p.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,{result:p,tags:e,processId:this.processId}),new Error(`Process ${this.processId} does not support provided action.`);let g=p.Messages?.[0]?.Data;return this.isMessageDataEmpty(g)?void 0:hP(g)}catch(c){i++,this.logger.debug(`Read attempt ${i} failed`,{error:c?.message,stack:c?.stack,tags:e,processId:this.processId}),h=c,await new Promise(p=>setTimeout(p,2**i*1e3))}throw h}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let p=Yfe(32),b=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:jw}],data:r,signer:a,anchor:p});this.logger.debug("Sent message to process",{messageId:b,processId:this.processId,anchor:p});let g=await this.ao.result({message:b,process:this.processId});this.logger.debug("Message result",{output:g,messageId:b,processId:this.processId});let y=vP(g);if(y!==void 0)throw new C4(y);if(g.Messages?.length===0||g.Messages===void 0)return{id:b};if(g.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(this.isMessageDataEmpty(g.Messages[0].Data))return{id:b};let M=hP(g.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:b,processId:this.processId}),{id:b,result:M}}catch(p){if(this.logger.error("Error sending message to process",{error:p?.message,stack:p?.stack,processId:this.processId,tags:e}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:p?.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=p;else throw p}throw c}};var Tb=class{static init(e){return e!==void 0&&"signer"in e?new mP(e):new Ww(e)}},Ww=class{process;epochSettings;arweave;constructor(e){if(this.arweave=e?.arweave??N4,e===void 0||Object.keys(e).length===0)this.process=new za({processId:Lh});else if(vv(e))this.process=e.process;else if(mv(e))this.process=new za({processId:e.processId});else throw new Rl}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async computeEpochIndexForTimestamp(e){let r=await this.getEpochSettings(),a=r.epochZeroStartTimestamp,i=r.durationMs;return Math.floor((e-a)/i)}async computeCurrentEpochIndex(){let e=await this.getEpochSettings(),r=e.epochZeroStartTimestamp,a=e.durationMs,i=Date.now();return Math.floor((i-r)/a)}async computeEpochIndex(e){let r=e?.epochIndex;if(r!==void 0)return r;let a=e?.timestamp;if(a!==void 0)return this.computeEpochIndexForTimestamp(a)}async getEpochSettings(){return this.epochSettings??=await this.process.read({tags:[{name:"Action",value:"Epoch-Settings"}]})}async getEpoch(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId});let i=[{name:"Action",value:"Epoch"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Records"},...Ha(e)]})}async getArNSReservedNames(e){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"},...Ha(e)]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Balances"},...Ha(e)]})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Vaults"},...Ha(e)]})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},...Ha(r)]})}async getGatewayDelegateAllowList({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},...Ha(r)]})}async getGateways(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateways"},...Ha(e)]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"}]})}async getPrescribedObservers(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedObservers;let i=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getPrescribedNames(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedNames;let i=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getObservations(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.observations;let i=[{name:"Action",value:"Epoch-Observations"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getDistributions(e){let r=await this.computeEpochIndex(e),a=await this.computeCurrentEpochIndex();if(r!==void 0&&r<a)return(await gv({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.distributions;let i=[{name:"Action",value:"Epoch-Distributions"},{name:"Epoch-Index",value:a.toString()}];return this.process.read({tags:Sn(i)})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:c}){let b=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e==="Buy-Record"?"Buy-Name":e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r}];return this.process.read({tags:Sn(b),fromAddress:c})}async getCostDetails({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:c,fundFrom:p}){let g=[{name:"Action",value:"Cost-Details"},{name:"Intent",value:e==="Buy-Record"?"Buy-Name":e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Fund-From",value:p}];return this.process.read({tags:Sn(g),fromAddress:c})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getDemandFactorSettings(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor-Settings"}]})}async getArNSReturnedNames(e){return this.process.read({tags:[{name:"Action",value:"Returned-Names"},...Ha(e)]})}async getArNSReturnedName({name:e}){let r=[{name:"Action",value:"Returned-Name"},{name:"Name",value:e}];return this.process.read({tags:r})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Address",value:e.address},...Ha(e)];return this.process.read({tags:Sn(r)})}async getAllowedDelegates(e){return this.getGatewayDelegateAllowList(e)}async getGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateway-Vaults"},{name:"Address",value:e.address},...Ha(e)]})}async getPrimaryNameRequest(e){let r=[{name:"Action",value:"Primary-Name-Request"},{name:"Initiator",value:e.initiator}];return this.process.read({tags:r})}async getPrimaryNameRequests(e){return this.process.read({tags:[{name:"Action",value:"Primary-Name-Requests"},...Ha(e)]})}async getPrimaryName(e){let r=[{name:"Action",value:"Primary-Name"},{name:"Address",value:e?.address},{name:"Name",value:e?.name}];return this.process.read({tags:Sn(r)})}async getPrimaryNames(e){return this.process.read({tags:[{name:"Action",value:"Primary-Names"},...Ha(e)]})}async getRedelegationFee(e){return this.process.read({tags:[{name:"Action",value:"Redelegation-Fee"},{name:"Address",value:e.address}]})}async getGatewayRegistrySettings(){return this.process.read({tags:[{name:"Action",value:"Gateway-Registry-Settings"}]})}async getAllDelegates(e){return this.process.read({tags:[{name:"Action",value:"All-Paginated-Delegates"},...Ha(e)]})}async getAllGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"All-Gateway-Vaults"},...Ha(e)]})}},mP=class extends Ww{signer;constructor({signer:e,...r}){r===void 0?super({process:new za({processId:Lh})}):super(r),this.signer=pv(e)}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async vaultedTransfer({recipient:e,quantity:r,lockLengthMs:a,revokable:i=!1},h){let{tags:c=[]}=h||{};return this.process.send({tags:[...c,{name:"Action",value:"Vaulted-Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.toString()},{name:"Lock-Length",value:a.toString()},{name:"Revokable",value:`${i}`}],signer:this.signer})}async revokeVault({vaultId:e,recipient:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Revoke-Vault"},{name:"Vault-Id",value:e},{name:"Recipient",value:r}],signer:this.signer})}async createVault({lockLengthMs:e,quantity:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Create-Vault"},{name:"Lock-Length",value:e.toString()},{name:"Quantity",value:r.toString()}],signer:this.signer})}async extendVault({vaultId:e,extendLengthMs:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Extend-Vault"},{name:"Vault-Id",value:e},{name:"Extend-Length",value:r.toString()}],signer:this.signer})}async increaseVault({vaultId:e,quantity:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Increase-Vault"},{name:"Vault-Id",value:e},{name:"Quantity",value:r.toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:a,delegateRewardShareRatio:i,fqdn:h,label:c,minDelegatedStake:p,note:b,port:g,properties:y,protocol:M,autoStake:x,observerAddress:E},A){let{tags:I=[]}=A||{},P=[...I,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:a?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:c},{name:"Min-Delegated-Stake",value:p?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:y},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:Sn(P)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:c,note:p,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},I=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:p},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:Sn(I)})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:Sn(i)})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Buy-Name"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async upgradeRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async extendLease(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:Sn(i)})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:Sn(i)})}async requestPrimaryName(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Request-Primary-Name"},{name:"Name",value:e.name}];return this.process.send({signer:this.signer,tags:Sn(i)})}async redelegateStake(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Redelegate-Stake"},{name:"Target",value:e.target},{name:"Source",value:e.source},{name:"Quantity",value:e.stakeQty.valueOf().toString()},{name:"Vault-Id",value:e.vaultId}];return this.process.send({signer:this.signer,tags:Sn(i)})}};async function m3t({signer:t,module:e=oQ,ao:r=Sl(),scheduler:a=uQ,state:i,antRegistryId:h=$8,logger:c=Wu.default,authority:p=fQ}){let b=await r.spawn({module:e,scheduler:a,signer:t,data:i?JSON.stringify(i):void 0,tags:[{name:"Authority",value:p},{name:"ANT-Registry-Id",value:h}]});return c.debug("Spawned ANT",{processId:b,module:e,scheduler:a}),b}async function g3t({signer:t,processId:e,luaCodeTxId:r=sQ,ao:a=Sl(),logger:i=Wu.default,arweave:h=N4}){let c=new za({processId:e,ao:a,logger:i}),{api:{host:p,port:b,protocol:g}}=h.getConfig(),y=await fetch(`${g}://${p}:${b}/${r}`).then(x=>x.text()),{id:M}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:y,signer:t});return i.debug("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:M}),M}function fUe(t){let e=Qt.object({name:Qt.string(),value:Qt.union([Qt.string(),Qt.number()])}),r=Qt.function().args(Qt.object({data:Qt.union([Qt.string(),Qt.instanceof(Me)]),tags:Qt.array(e).optional(),target:Qt.string().optional(),anchor:Qt.string().optional()})).returns(Qt.promise(Qt.object({id:Qt.string(),raw:Qt.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function pv(t){return fUe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{if(t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey(),t instanceof ul){let b=await t.signer.signDataItem({data:r,tags:a,target:i,anchor:h}),g=new v1(Me.from(b));return{id:await g.id,raw:await g.getRaw()}}let c=Rg(r,t,{tags:a,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:xte(t)}var uUe="-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";function b3t({owner:t,targetId:e,ttlSeconds:r=3600,keywords:a=[],controllers:i=[],description:h="",ticker:c="aos",name:p="ANT"}){return{ticker:c,name:p,description:h,keywords:a,owner:t,controllers:[t,...i],balances:{[t]:1},records:{"@":{transactionId:e??uUe.toString(),ttlSeconds:r}}}}function iue(t){return Qt.object({startTimestamp:Qt.number(),startHeight:Qt.number(),distributions:Qt.any(),endTimestamp:Qt.number(),prescribedObservers:Qt.any(),prescribedNames:Qt.array(Qt.string()),observations:Qt.any(),epochIndex:Qt.number()}).parse(t)}function vP(t){let r=t.Error??t.Messages?.[0]?.Tags?.find(a=>a.name==="Error")?.value;if(r!==void 0){let a=r.match(/\[string "aos"]:(\d+):\s*(.+)/);if(a){let[,i,h]=a;return`${rue(h).trim()} (line ${i.trim()})`.trim()}return rue(r)}}function rue(t){let e="\x1B";return t.replace(new RegExp(`${e}[\\[\\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`,"g"),"").trim()}var nue=t=>D8.test(t);function E3t(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var Sn=t=>t.filter(e=>e.value!==void 0&&e.value!==""),Ha=t=>{let e=[{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy?.toString()},{name:"Sort-Order",value:t?.sortOrder?.toString()}];return Sn(e)},gv=async({arweave:t,epochIndex:e,processId:r=Lh,retries:a=3,gqlUrl:i="https://arweave-search.goldsky.com/graphql"})=>{let h=hUe({epochIndex:e,processId:r});for(let c=0;c<a;c++)try{let p=await fetch(i,{method:"POST",body:h,headers:{"Content-Type":"application/json"}}).then(y=>y.json());if(p?.data?.transactions?.edges?.length===0)return;let b=p.data.transactions.edges[0].node.id,g=await t.api.get(b);return iue(g.data)}catch(p){if(c===a-1)throw p;await new Promise(b=>setTimeout(b,Math.pow(2,c)*1e3))}},hUe=({epochIndex:t,processId:e=Lh,authorities:r=["fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY"]})=>JSON.stringify({query:`
|
|
190
190
|
query {
|
|
191
191
|
transactions(
|
|
192
192
|
tags: [
|
|
@@ -206,7 +206,7 @@ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
`});var cUe=["Buy-Name","Buy-Record","Extend-Lease","Increase-Undername-Limit","Upgrade-Name","Primary-Name-Request"],
|
|
209
|
+
`});var cUe=["Buy-Name","Buy-Record","Extend-Lease","Increase-Undername-Limit","Upgrade-Name","Primary-Name-Request"],B3t=["Buy-Record","Buy-Name","Extend-Lease"],P3t=t=>cUe.indexOf(t)!==-1,lUe=["balance","stakes","any"],O3t=t=>lUe.indexOf(t)!==-1;function vv(t){return"process"in t}function mv(t){return"processId"in t&&typeof t.processId=="string"&&nue(t.processId)===!0}function N3t(t){return t.type==="lease"}ie();ae();ne();var gP=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},bP=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new yP(Math.floor(this.value*bT))}toString(){return`${this.value}`}},yP=class t extends gP{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new bP(this.valueOf()/bT)}};export{zw as ANT,Eb as ANTRegistry,sQ as ANT_LUA_ID,$8 as ANT_REGISTRY_ID,za as AOProcess,oQ as AOS_MODULE_ID,fQ as AO_AUTHORITY,Tb as ARIO,Ww as ARIOReadable,bP as ARIOToken,mP as ARIOWriteable,s5e as ARIO_DEVNET_PROCESS_ID,Wft as ARIO_MAINNET_PROCESS_ID,Lh as ARIO_TESTNET_PROCESS_ID,Hft as ARNS_DEVNET_REGISTRY_TX,Zft as ARNS_TESTNET_REGISTRY_TX,D8 as ARWEAVE_TX_REGEX,xre as AbortError,_T as AntBalancesSchema,wT as AntControllersSchema,f5e as AntDescriptionSchema,c5e as AntHandlerNames,cQ as AntHandlersSchema,dQ as AntInfoSchema,lQ as AntKeywordsSchema,u5e as AntReadHandlers,q8 as AntRecordSchema,yT as AntRecordsSchema,MT as AntStateSchema,h5e as AntWriteHandlers,Zw as AoANTReadable,Hw as AoANTRegistryReadable,uP as AoANTRegistryWriteable,fP as AoANTWriteable,tue as ArNSEventEmitter,ul as ArconnectSigner,zc as ArweaveSigner,gd as ArweaveTxIdSchema,bre as BadRequest,Df as BaseError,uQ as DEFAULT_SCHEDULER_ID,jft as FQDN_REGEX,yre as FailedRequestError,hQ as IntegerStringSchema,Rl as InvalidContractConfigurationError,Mre as InvalidProcessConfigurationError,_re as InvalidSignerError,Wu as Logger,bT as MARIO_PER_ARIO,gre as NotFound,zft as SORT_KEY_REGEX,wre as UnknownError,C4 as WriteInteractionError,Kft as arioDevnetProcessId,pv as createAoSigner,uUe as defaultTargetManifestId,hUe as epochDistributionNoticeGqlQuery,vP as errorMessageFromOutput,g3t as evolveANT,sUe as fetchAllArNSRecords,oyt as fromB64Url,lUe as fundFromOptions,$yt as getANTProcessesOwnedByWallet,gv as getEpochDataFromGql,Yfe as getRandomText,b3t as initANTStateForAddress,B3t as intentsUsingYears,eut as isAoANTState,fUe as isAoSigner,E3t as isBlockHeight,N3t as isLeasedArNSRecord,vv as isProcessConfiguration,mv as isProcessIdConfiguration,O3t as isValidFundFrom,P3t as isValidIntent,yP as mARIOToken,Ha as paginationParamsToTags,iue as parseAoEpochData,Pl as parseSchemaResult,Sn as pruneTags,rue as removeUnicodeFromError,hP as safeDecode,syt as sha256B64Url,Zfe as sortANTRecords,m3t as spawnANT,rUe as toB64Url,cUe as validIntents,nue as validateArweaveId};
|
|
210
210
|
/*! Bundled license information:
|
|
211
211
|
|
|
212
212
|
@jspm/core/nodelibs/browser/buffer.js:
|